@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;1,400&display=swap');

:root {
    --forge-black: #0a0a0a;
    --iron-grey: #2a2a2a;
    --steel-blue: #3d5a80;
    --bronze-glow: #c67b3e;
    --copper-accent: #b87333;
    --gold-highlight: #d4af37;
    --smoke-white: #e8e8e8;
    --ash-grey: #8d8d8d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cormorant Garamond', serif;
    background: linear-gradient(135deg, var(--forge-black) 0%, var(--iron-grey) 50%, #1a1a2e 100%);
    color: var(--smoke-white);
    line-height: 1.8;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    padding: 60px 20px;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(198, 123, 62, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(61, 90, 128, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image:
        repeating-linear-gradient(0deg, rgba(255,255,255,0.02) 0px, transparent 1px, transparent 2px, rgba(255,255,255,0.02) 3px),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.02) 0px, transparent 1px, transparent 2px, rgba(255,255,255,0.02) 3px);
    pointer-events: none;
    z-index: 1;
    opacity: 0.3;
}

/* Sparks */
.spark {
    position: fixed;
    width: 3px;
    height: 3px;
    background: var(--gold-highlight);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    animation: sparkle 2s infinite;
    box-shadow: 0 0 10px var(--gold-highlight);
    z-index: 10;
}

.spark:nth-child(1) { top: 10%; left: 15%; animation-delay: 0s; }
.spark:nth-child(2) { top: 30%; right: 20%; animation-delay: 0.7s; }
.spark:nth-child(3) { bottom: 25%; left: 25%; animation-delay: 1.4s; }
.spark:nth-child(4) { top: 60%; right: 15%; animation-delay: 2.1s; }
.spark:nth-child(5) { bottom: 15%; right: 30%; animation-delay: 2.8s; }

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1.5); }
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInDown 1.2s ease-out;
}

.chapter-number {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    letter-spacing: 6px;
    color: var(--bronze-glow);
    margin-bottom: 15px;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0;
    animation: fadeIn 1s ease-out 0.3s forwards;
}

h1 {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--gold-highlight);
    margin-bottom: 12px;
    letter-spacing: 2px;
    text-shadow:
        0 0 20px rgba(212, 175, 55, 0.5),
        0 0 40px rgba(212, 175, 55, 0.3),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
    opacity: 0;
    animation: glowIn 1.5s ease-out 0.6s forwards;
}

.subtitle {
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    color: var(--ash-grey);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 8px;
    opacity: 0;
    animation: fadeIn 1s ease-out 0.9s forwards;
}

/* Decorative Line */
.decorative-line {
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--bronze-glow), transparent);
    margin: 30px auto;
    position: relative;
    opacity: 0;
    animation: expandLine 1.2s ease-out 1.2s forwards;
}

.decorative-line::before,
.decorative-line::after {
    content: '◆';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bronze-glow);
    font-size: 0.7rem;
}

.decorative-line::before { left: -20px; }
.decorative-line::after  { right: -20px; }

.player-rank-summary {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    max-width: 560px;
    margin: 0 auto 0;
    padding: 8px 18px;
    border: 1px solid rgba(198, 123, 62, 0.22);
    border-radius: 8px;
    background: rgba(198, 123, 62, 0.05);
    opacity: 0;
    animation: fadeIn 1s ease-out 1.35s forwards;
}

.player-rank-label {
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--bronze-glow);
    line-height: 1.8;
}

.player-rank-inline-name {
    color: var(--gold-highlight);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.22);
}

.player-rank-inline-value {
    display: inline-block;
    margin: 0 4px;
    color: var(--gold-highlight);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
    vertical-align: baseline;
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

.player-rank-copy {
    color: var(--smoke-white);
    font-size: 1rem;
    line-height: 1.6;
}

/* Rank Tabs */
.rank-tabs {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
    opacity: 0;
    animation: fadeIn 1s ease-out 1s forwards;
}

.rank-tab {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 10px 22px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--ash-grey);
    border: 1px solid rgba(141, 141, 141, 0.25);
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.3s;
}

.rank-tab.active {
    color: var(--gold-highlight);
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(212, 175, 55, 0.08);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.rank-tab:hover {
    color: var(--bronze-glow);
    border-color: rgba(198, 123, 62, 0.4);
    background: rgba(198, 123, 62, 0.06);
    transform: translateY(-2px);
}

/* Info Box */
.info-box {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--bronze-glow);
    border: 1px solid rgba(198, 123, 62, 0.3);
    background: rgba(198, 123, 62, 0.05);
    border-radius: 4px;
    padding: 14px 20px;
    text-align: center;
    margin-bottom: 30px;
    opacity: 0;
    animation: fadeIn 1s ease-out 1.1s forwards;
}

/* Ranking Card */
.ranking-card {
    border: 1px solid rgba(198, 123, 62, 0.25);
    border-radius: 6px;
    overflow: hidden;
    background: rgba(10, 10, 10, 0.6);
    box-shadow:
        0 0 40px rgba(198, 123, 62, 0.07),
        0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 1.3s forwards;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table thead {
    background: rgba(198, 123, 62, 0.08);
    border-bottom: 1px solid rgba(198, 123, 62, 0.3);
}

.ranking-table th {
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--bronze-glow);
    padding: 16px 20px;
    text-align: left;
}

.ranking-table th.center {
    text-align: center;
}

.ranking-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.3s;
}

.ranking-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}

.ranking-table tbody tr:hover {
    background: rgba(198, 123, 62, 0.07);
    transform: translateX(4px);
}

.ranking-table td {
    padding: 14px 5px;
    color: var(--smoke-white);
    font-size: 1.05rem;
}

.ranking-table td.center {
    text-align: center;
}

/* Position badge */
.rank-position {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    margin-right: 12px;
    background: rgba(141, 141, 141, 0.1);
    border: 1px solid rgba(141, 141, 141, 0.2);
    color: var(--ash-grey);
}

.rank-position.top3 {
    background: rgba(212, 175, 55, 0.12);
    border-color: rgba(212, 175, 55, 0.4);
    color: var(--gold-highlight);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

/* Player link */
.player-link {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--smoke-white);
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
}

.player-link:hover {
    color: var(--gold-highlight);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
    transform: translateX(4px);
}

/* Stats */
.stat-value {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gold-highlight);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.stat-level {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--bronze-glow);
    border: 1px solid rgba(198, 123, 62, 0.4);
    background: rgba(198, 123, 62, 0.08);
    border-radius: 4px;
    padding: 3px 10px;
    display: inline-block;
}

.stat-battles {
    color: var(--ash-grey);
    font-size: 0.95rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    opacity: 0;
    animation: fadeIn 1s ease-out 1.5s forwards;
}

.pagination-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 12px 22px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--ash-grey);
    border: 1px solid rgba(141, 141, 141, 0.2);
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn:hover {
    color: var(--bronze-glow);
    border-color: rgba(198, 123, 62, 0.4);
    background: rgba(198, 123, 62, 0.06);
    transform: translateY(-2px);
}

.pagination-btn.disabled {
    opacity: 0.25;
    pointer-events: none;
}

/* Back to menu */
.back-menu {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 10px;
    opacity: 0;
    animation: fadeIn 1s ease-out 1.7s forwards;
}

.menu-link {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    padding: 12px 28px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--gold-highlight);
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: rgba(212, 175, 55, 0.07);
    transition: all 0.3s;
    display: inline-block;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.menu-link:hover {
    background: rgba(212, 175, 55, 0.13);
    border-color: rgba(212, 175, 55, 0.65);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
    transform: translateY(-2px);
}

footer {
    margin-top: 60px;
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 4px;
    color: var(--ash-grey);
    text-transform: uppercase;
    opacity: 0;
    animation: fadeIn 1s ease-out 2s forwards;
}
.stat-percentage {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--bronze-glow);
    border: 1px solid rgba(198, 123, 62, 0.4);
    background: rgba(198, 123, 62, 0.08);
    border-radius: 4px;
    padding: 3px 10px;
    display: inline-block;
}

.player-santuario {
    font-family: 'Cinzel', serif;
    font-size: 0.68rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ash-grey);
    border: 1px solid rgba(141, 141, 141, 0.2);
    background: rgba(141, 141, 141, 0.05);
    border-radius: 3px;
    padding: 2px 8px;
    margin-left: 10px;
    vertical-align: middle;
    display: inline-block;
}

/* Keyframes */
@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes glowIn {
    from {
        opacity: 0;
        text-shadow: 0 0 0 rgba(212, 175, 55, 0);
    }
    to {
        opacity: 1;
        text-shadow:
            0 0 20px rgba(212, 175, 55, 0.5),
            0 0 40px rgba(212, 175, 55, 0.3),
            2px 2px 4px rgba(0, 0, 0, 0.8);
    }
}

@keyframes expandLine {
    from { opacity: 0; width: 0; }
    to   { opacity: 1; width: 200px; }
}

/* Responsive */
@media (max-width: 768px) {
    body { padding: 40px 15px; }

    h1 { font-size: 2rem; letter-spacing: 1px; }

    .player-rank-summary {
        width: 100%;
        padding: 8px 12px;
    }

    .player-rank-copy {
        font-size: 0.92rem;
    }

    .ranking-table th,
    .ranking-table td { padding: 12px 10px; font-size: 0.9rem; }

    .rank-position { min-width: 24px; height: 24px; font-size: 0.65rem; margin-right: 8px; }

    .chapter-number { font-size: 0.75rem; letter-spacing: 4px; }
}
