/* === TTT ARENA | STYLE.CSS === */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Inter:wght@400;600;700&display=swap');

:root {
    --bg: #0a0a1a;
    --bg2: #111128;
    --card: rgba(255, 255, 255, .04);
    --card-h: rgba(255, 255, 255, .08);
    --txt: #f0f0ff;
    --txt2: #9090b0;
    --muted: #5a5a7a;
    --x: #ff4d6d;
    --o: #00d4ff;
    --p: #7c3aed;
    --p2: #a855f7;
    --gold: #ffd700;
    --border: rgba(255, 255, 255, .08);
    --bh: rgba(255, 255, 255, .18);
    --gr: linear-gradient(135deg, #7c3aed, #a855f7);
    --bgr: linear-gradient(135deg, #0a0a1a, #0d0d2b, #0a0a1a);
    --cell: rgba(255, 255, 255, .03);
    --ch: rgba(124, 58, 237, .15);
    --win: rgba(124, 58, 237, .25);
    --wl: #a855f7;
    --nav: rgba(10, 10, 26, .92);
    --tr: .3s cubic-bezier(.4, 0, .2, 1)
}

body.theme-neon {
    --bg: #020209;
    --bg2: #06040f;
    --card: rgba(0, 255, 180, .03);
    --card-h: rgba(0, 255, 180, .07);
    --txt: #c8ffee;
    --txt2: #4dbb99;
    --muted: #266649;
    --x: #ff003c;
    --o: #00ffe1;
    --p: #b000ff;
    --p2: #00ffe1;
    --gold: #f0ff00;
    --border: rgba(0, 255, 180, .15);
    --bh: rgba(0, 255, 180, .4);
    --gr: linear-gradient(135deg, #b000ff, #00ffe1);
    --bgr: linear-gradient(135deg, #020209, #06040f, #020209);
    --cell: rgba(0, 255, 180, .02);
    --ch: rgba(176, 0, 255, .15);
    --win: rgba(176, 0, 255, .25);
    --wl: #00ffe1;
    --nav: rgba(2, 2, 9, .95);
    --neon-x: 0 0 8px #ff003c, 0 0 20px #ff003c, 0 0 40px rgba(255, 0, 60, .4);
    --neon-o: 0 0 8px #00ffe1, 0 0 20px #00ffe1, 0 0 40px rgba(0, 255, 225, .4)
}

body.theme-light {
    --bg: #f0f0ff;
    --bg2: #e8e8f8;
    --card: rgba(255, 255, 255, .8);
    --card-h: rgba(255, 255, 255, .95);
    --txt: #1a1a3a;
    --txt2: #4a4a7a;
    --muted: #8a8aaa;
    --x: #e03050;
    --o: #0090cc;
    --p: #6b21e8;
    --p2: #9333ea;
    --border: rgba(100, 100, 150, .2);
    --bh: rgba(100, 100, 150, .4);
    --bgr: linear-gradient(135deg, #f0f0ff, #e8e8f8, #f0f0ff);
    --cell: rgba(255, 255, 255, .9);
    --ch: rgba(107, 33, 232, .08);
    --win: rgba(107, 33, 232, .12);
    --wl: #6b21e8;
    --nav: rgba(240, 240, 255, .92)
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bgr);
    background-attachment: fixed;
    color: var(--txt);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background .5s, color .5s
}

a {
    color: var(--p2);
    text-decoration: none
}

::placeholder {
    color: var(--muted)
}

::selection {
    background: rgba(168, 85, 247, .3);
    color: var(--txt)
}

::-webkit-scrollbar {
    width: 6px
}

::-webkit-scrollbar-track {
    background: var(--bg)
}

::-webkit-scrollbar-thumb {
    background: var(--p2);
    border-radius: 3px
}

/* Neon: Scanlines overlay + glows */
body.theme-neon::after {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 255, 180, .015) 2px, rgba(0, 255, 180, .015) 4px);
    pointer-events: none;
    z-index: 9999
}

body.theme-neon .gradient-text {
    filter: drop-shadow(0 0 12px #00ffe1) drop-shadow(0 0 24px #b000ff)
}

body.theme-neon .brand-name {
    text-shadow: 0 0 10px var(--p2), 0 0 20px var(--p2)
}

body.theme-neon .cell.cell-x {
    text-shadow: var(--neon-x)
}

body.theme-neon .cell.cell-o {
    text-shadow: var(--neon-o)
}

body.theme-neon .cell.winning {
    box-shadow: 0 0 20px var(--wl), 0 0 40px rgba(0, 255, 225, .3);
    border-color: var(--wl)
}

body.theme-neon .score-count {
    text-shadow: 0 0 12px var(--p2)
}

body.theme-neon .nav-link.active {
    box-shadow: 0 0 12px var(--p2), 0 0 24px rgba(0, 255, 225, .2);
    border-color: var(--p2)
}

body.theme-neon .btn-primary {
    box-shadow: 0 0 10px #b000ff, 0 0 20px rgba(176, 0, 255, .4)
}

body.theme-neon .btn-primary:hover {
    box-shadow: 0 0 20px #b000ff, 0 0 40px rgba(176, 0, 255, .6)
}

body.theme-neon .turn-indicator.turn-x {
    text-shadow: var(--neon-x)
}

body.theme-neon .turn-indicator.turn-o {
    text-shadow: var(--neon-o)
}

body.theme-neon .modal-card {
    box-shadow: 0 0 40px #b000ff, 0 0 80px rgba(176, 0, 255, .3), 0 24px 64px rgba(0, 0, 0, .8);
    border-color: rgba(0, 255, 225, .2)
}

body.theme-neon .bg-particles span {
    background: #00ffe1;
    box-shadow: 0 0 6px #00ffe1
}

body.theme-neon .stat-number {
    filter: drop-shadow(0 0 8px #00ffe1)
}

body.theme-neon .hero-badge {
    border-color: rgba(0, 255, 225, .4);
    box-shadow: 0 0 12px rgba(0, 255, 225, .15)
}

body.theme-neon .feature-card:hover {
    box-shadow: 0 0 20px rgba(176, 0, 255, .3), 0 8px 32px rgba(0, 0, 0, .5)
}

/* Particles */
.bg-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden
}

.bg-particles span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--p2);
    border-radius: 50%;
    opacity: 0;
    animation: float 12s infinite
}

.bg-particles span:nth-child(1) {
    left: 10%
}

.bg-particles span:nth-child(2) {
    left: 25%;
    animation-delay: 2s;
    width: 6px;
    height: 6px
}

.bg-particles span:nth-child(3) {
    left: 40%;
    animation-delay: 4s
}

.bg-particles span:nth-child(4) {
    left: 55%;
    animation-delay: 6s;
    width: 3px;
    height: 3px
}

.bg-particles span:nth-child(5) {
    left: 70%;
    animation-delay: 1s
}

.bg-particles span:nth-child(6) {
    left: 85%;
    animation-delay: 3s;
    width: 5px;
    height: 5px
}

.bg-particles span:nth-child(7) {
    left: 15%;
    animation-delay: 5s
}

.bg-particles span:nth-child(8) {
    left: 90%;
    animation-delay: 7s
}

.bg-particles span:nth-child(9) {
    left: 45%;
    animation-delay: 8s
}

.bg-particles span:nth-child(10) {
    left: 60%;
    animation-delay: 9s
}

@keyframes float {
    0% {
        transform: translateY(110vh) scale(0);
        opacity: 0
    }

    10% {
        opacity: .6
    }

    90% {
        opacity: .2
    }

    100% {
        transform: translateY(-10vh) scale(1.5);
        opacity: 0
    }
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--nav);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border)
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 68px;
    display: flex;
    align-items: center;
    gap: 16px
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    cursor: pointer
}

.brand-icon {
    color: var(--p2);
    display: flex;
    filter: drop-shadow(0 0 8px var(--p2))
}

.brand-name {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--txt);
    letter-spacing: 1px
}

.brand-highlight {
    color: var(--p2)
}

.nav-links {
    display: flex;
    gap: 4px;
    margin-left: auto
}

.nav-link {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: .9rem;
    font-weight: 500;
    color: var(--txt2);
    transition: var(--tr);
    cursor: pointer;
    border: 1px solid transparent
}

.nav-link:hover {
    color: var(--txt);
    background: var(--card);
    border-color: var(--bh)
}

.nav-link.active {
    color: var(--p2);
    background: rgba(124, 58, 237, .15);
    border-color: var(--p2);
    box-shadow: 0 0 12px rgba(168, 85, 247, .2)
}

.nav-actions {
    display: flex;
    gap: 8px;
    margin-left: 8px
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--txt);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--tr)
}

.theme-toggle:hover {
    border-color: var(--bh);
    transform: scale(1.1)
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--txt);
    border-radius: 2px;
    transition: var(--tr)
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg)
}

.hamburger.open span:nth-child(2) {
    opacity: 0
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg)
}

/* Sections */
.section {
    display: none;
    padding: 100px 24px 60px;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1
}

.section.active {
    display: block;
    animation: fadeIn .5s ease
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.page-title {
    font-family: 'Orbitron', monospace;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 8px
}

.page-subtitle {
    color: var(--txt2);
    margin-bottom: 32px
}

.section-title {
    font-family: 'Orbitron', monospace;
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
    text-align: center;
    color: var(--txt);
    margin-bottom: 40px
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 999px;
    font-size: .95rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border: none;
    cursor: pointer;
    transition: var(--tr);
    white-space: nowrap
}

.btn-primary {
    background: var(--gr);
    color: #fff;
    box-shadow: 0 4px 20px rgba(124, 58, 237, .4)
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(124, 58, 237, .6)
}

.btn-secondary {
    background: var(--card);
    color: var(--txt);
    border: 1px solid var(--border)
}

.btn-secondary:hover {
    background: var(--card-h);
    border-color: var(--bh);
    transform: translateY(-2px)
}

.btn-outline {
    background: transparent;
    color: var(--p2);
    border: 1px solid var(--p2)
}

.btn-outline:hover {
    background: rgba(168, 85, 247, .1);
    transform: translateY(-2px)
}

.btn-ghost {
    background: transparent;
    color: var(--txt2);
    border: 1px solid var(--border)
}

.btn-ghost:hover {
    color: var(--txt);
    background: var(--card)
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.05rem
}

.btn-sm {
    padding: 8px 18px;
    font-size: .85rem
}

.btn-full {
    width: 100%
}

/* Hero */
.hero {
    text-align: center;
    padding: 60px 0 80px
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 18px;
    border-radius: 999px;
    background: rgba(124, 58, 237, .15);
    border: 1px solid rgba(168, 85, 247, .3);
    font-size: .85rem;
    color: var(--p2);
    margin-bottom: 24px;
    animation: pulseBadge 3s ease-in-out infinite
}

@keyframes pulseBadge {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(168, 85, 247, .2)
    }

    50% {
        box-shadow: 0 0 0 8px rgba(168, 85, 247, 0)
    }
}

.hero-title {
    font-family: 'Orbitron', monospace;
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 20px
}

.gradient-text {
    background: var(--gr);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--txt2);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 60px
}

.hero-stats {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 40px;
    text-align: center;
    transition: var(--tr)
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .4)
}

.stat-number {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gr);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

.stat-label {
    font-size: .85rem;
    color: var(--txt2);
    margin-top: 4px
}

/* Feature Cards */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 60px
}

.feature-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    transition: var(--tr);
    overflow: hidden;
    position: relative
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gr);
    transform: scaleX(0);
    transition: .3s
}

.feature-card:hover {
    transform: translateY(-6px);
    border-color: var(--bh);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .4)
}

.feature-card:hover::before {
    transform: scaleX(1)
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 16px
}

.feature-card h3 {
    font-weight: 600;
    margin-bottom: 8px
}

.feature-card p {
    color: var(--txt2);
    font-size: .9rem;
    line-height: 1.6
}

/* Badge Preview */
.badges-preview {
    padding: 40px 0 60px
}

.badges-grid {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap
}

.badge-preview-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 28px;
    text-align: center;
    transition: var(--tr);
    min-width: 120px
}

.badge-preview-card:hover {
    transform: translateY(-8px) scale(1.05);
    border-color: var(--bh)
}

.badge-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    display: block
}

.badge-name {
    font-weight: 600;
    font-size: .9rem
}

.badge-req {
    font-size: .75rem;
    color: var(--muted);
    margin-top: 4px
}

/* Play Setup */
.play-container {
    max-width: 700px;
    margin: 0 auto
}

.setup-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 40px;
    backdrop-filter: blur(20px)
}

.setup-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px
}

.player-inputs {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap
}

.player-input-group {
    flex: 1;
    min-width: 160px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    transition: var(--tr)
}

.player-input-group:focus-within {
    border-color: var(--p2);
    box-shadow: 0 0 12px rgba(168, 85, 247, .2)
}

.player-color {
    font-size: 1.8rem;
    font-weight: 700;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

.player-x-color {
    background: rgba(255, 77, 109, .15);
    color: var(--x)
}

.player-o-color {
    background: rgba(0, 212, 255, .15);
    color: var(--o)
}

.player-input-group label {
    display: block;
    font-size: .75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px
}

.player-name-input {
    width: 100%;
    background: none;
    border: none;
    outline: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--txt);
    font-family: 'Inter', sans-serif
}

.vs-divider {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--p2);
    text-shadow: 0 0 20px var(--p2);
    flex-shrink: 0
}

/* Score Bar */
.score-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 16px 24px;
    margin-bottom: 16px
}

.score-player {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px
}

.score-o {
    flex-direction: row-reverse
}

.score-symbol {
    font-size: 1.5rem;
    font-weight: 700;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

.score-x .score-symbol {
    background: rgba(255, 77, 109, .15);
    color: var(--x)
}

.score-o .score-symbol {
    background: rgba(0, 212, 255, .15);
    color: var(--o)
}

.score-player-name {
    font-weight: 600;
    font-size: .9rem
}

.score-badge {
    font-size: .7rem;
    color: var(--muted);
    margin-top: 2px
}

.score-count {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    font-weight: 700;
    min-width: 40px;
    text-align: center
}

.score-info-right {
    text-align: right
}

.score-center {
    text-align: center;
    flex-shrink: 0
}

.score-draws {
    font-family: 'Orbitron', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--txt2)
}

.score-draws-label {
    font-size: .65rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px
}

/* Turn Indicator */
.turn-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--txt2);
    transition: var(--tr)
}

.turn-indicator.turn-x {
    color: var(--x)
}

.turn-indicator.turn-o {
    color: var(--o)
}

.turn-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--p2);
    animation: pulseDot 1.5s ease-in-out infinite
}

.turn-indicator.turn-x .turn-pulse {
    background: var(--x)
}

.turn-indicator.turn-o .turn-pulse {
    background: var(--o)
}

@keyframes pulseDot {

    0%,
    100% {
        transform: scale(1);
        opacity: 1
    }

    50% {
        transform: scale(1.5);
        opacity: .6
    }
}

/* Game Board */
.board-wrapper {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 0 auto 24px;
    aspect-ratio: 1
}

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1
}

.cell {
    background: var(--cell);
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    transition: var(--tr);
    user-select: none;
    font-family: 'Orbitron', monospace
}

.cell:hover:not(.taken) {
    background: var(--ch);
    transform: scale(.96);
    border-color: var(--bh)
}

.cell.taken {
    cursor: not-allowed
}

.cell.cell-x {
    color: var(--x);
    text-shadow: 0 0 20px var(--x);
    animation: popIn .3s cubic-bezier(.175, .885, .32, 1.275)
}

.cell.cell-o {
    color: var(--o);
    text-shadow: 0 0 20px var(--o);
    animation: popIn .3s cubic-bezier(.175, .885, .32, 1.275)
}

.cell.winning {
    background: var(--win);
    border-color: var(--p2);
    box-shadow: 0 0 20px rgba(168, 85, 247, .3);
    animation: winPulse .8s ease
}

@keyframes popIn {
    from {
        transform: scale(0) rotate(-10deg);
        opacity: 0
    }

    to {
        transform: scale(1) rotate(0);
        opacity: 1
    }
}

@keyframes winPulse {
    0% {
        transform: scale(1)
    }

    30% {
        transform: scale(1.08)
    }

    60% {
        transform: scale(.97)
    }

    100% {
        transform: scale(1)
    }
}

.win-line-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2
}

#win-line {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset .6s ease;
    stroke: var(--wl);
    stroke-width: 6;
    stroke-linecap: round
}

#win-line.drawn {
    stroke-dashoffset: 0
}

.game-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px
}

.result-banner {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    animation: fadeIn .4s ease
}

.result-message {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    font-weight: 700
}

.result-sub {
    color: var(--txt2);
    font-size: .9rem;
    margin-top: 6px
}

/* Leaderboard */
.leaderboard-container {
    max-width: 900px;
    margin: 0 auto
}

.leaderboard-header {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 40px;
    flex-wrap: wrap
}

.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
    flex-wrap: wrap
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: var(--tr)
}

.podium-item:hover {
    transform: translateY(-4px)
}

.podium-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    border: 3px solid;
    font-family: 'Orbitron', monospace
}

.podium-1 .podium-avatar {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, .3);
    background: rgba(255, 215, 0, .1)
}

.podium-2 .podium-avatar {
    border-color: #c0c0c0;
    background: rgba(192, 192, 192, .08)
}

.podium-3 .podium-avatar {
    border-color: #cd7f32;
    background: rgba(205, 127, 50, .08)
}

.podium-name {
    font-weight: 600;
    font-size: .9rem;
    text-align: center
}

.podium-wins {
    font-family: 'Orbitron', monospace;
    font-size: .85rem;
    color: var(--txt2)
}

.podium-stand {
    width: 100%;
    min-width: 90px;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    padding: 10px 24px
}

.stand-1 {
    background: linear-gradient(135deg, #ffd700, #ffb300);
    height: 90px
}

.stand-2 {
    background: linear-gradient(135deg, #9e9e9e, #bdbdbd);
    height: 70px
}

.stand-3 {
    background: linear-gradient(135deg, #a0522d, #cd853f);
    height: 55px
}

.leaderboard-table-wrapper {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden
}

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

.leaderboard-table th {
    padding: 16px 20px;
    text-align: left;
    font-size: .75rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border)
}

.leaderboard-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
    transition: var(--tr)
}

.leaderboard-table tr:last-child td {
    border-bottom: none
}

.leaderboard-table tbody tr:hover td {
    background: var(--card-h)
}

.rank-cell {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    color: var(--txt2)
}

.rank-1 {
    color: var(--gold)
}

.rank-2 {
    color: #c0c0c0
}

.rank-3 {
    color: #cd7f32
}

.player-cell {
    font-weight: 600
}

.winrate-cell {
    color: var(--p2);
    font-weight: 600
}

.empty-state {
    text-align: center;
    padding: 40px !important;
    color: var(--txt2)
}

/* Forum */
.forum-container {
    max-width: 800px;
    margin: 0 auto
}

.post-composer {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 24px;
    transition: var(--tr)
}

.post-composer:focus-within {
    border-color: var(--p2);
    box-shadow: 0 0 20px rgba(168, 85, 247, .1)
}

.composer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px
}

.composer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gr);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0
}

.composer-name {
    font-weight: 600;
    font-size: .95rem;
    display: block
}

.composer-hint {
    font-size: .75rem;
    color: var(--muted);
    display: block
}

.forum-input,
.forum-textarea,
.forum-select {
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--txt);
    font-family: 'Inter', sans-serif;
    font-size: .95rem;
    outline: none;
    transition: var(--tr);
    width: 100%
}

.forum-input {
    margin-bottom: 12px
}

.forum-textarea {
    resize: vertical;
    min-height: 100px;
    margin-bottom: 12px
}

.forum-select {
    width: auto;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: .85rem;
    cursor: pointer
}

.forum-input:focus,
.forum-textarea:focus,
.forum-select:focus {
    border-color: var(--p2)
}

.composer-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap
}

.char-counter {
    font-size: .75rem;
    color: var(--muted)
}

.composer-footer .btn {
    margin-left: auto
}

.forum-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px
}

.filter-btn {
    padding: 8px 18px;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 500;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--txt2);
    cursor: pointer;
    transition: var(--tr);
    font-family: 'Inter', sans-serif
}

.filter-btn:hover {
    color: var(--txt);
    border-color: var(--bh)
}

.filter-btn.active {
    background: rgba(168, 85, 247, .15);
    border-color: var(--p2);
    color: var(--p2)
}

.forum-posts {
    display: flex;
    flex-direction: column;
    gap: 16px
}

.empty-forum {
    text-align: center;
    padding: 60px 20px;
    color: var(--txt2)
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: .5
}

.empty-forum h3 {
    margin-bottom: 8px;
    color: var(--txt)
}

.forum-post {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    transition: var(--tr);
    animation: fadeIn .4s ease
}

.forum-post:hover {
    border-color: var(--bh);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .3)
}

.post-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px
}

.post-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--gr);
    flex-shrink: 0;
    font-family: 'Orbitron', monospace;
    color: #fff
}

.post-author {
    font-weight: 600;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: 8px
}

.post-tag {
    font-size: .7rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(168, 85, 247, .15);
    color: var(--p2);
    border: 1px solid rgba(168, 85, 247, .2)
}

.post-time {
    font-size: .75rem;
    color: var(--muted);
    margin-top: 2px
}

.post-title {
    font-weight: 600;
    margin-bottom: 6px
}

.post-content {
    color: var(--txt2);
    font-size: .9rem;
    line-height: 1.6
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border)
}

.post-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    color: var(--muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: var(--tr);
    font-family: 'Inter', sans-serif
}

.post-action-btn:hover {
    color: var(--p2);
    background: rgba(168, 85, 247, .1)
}

.post-action-btn.liked {
    color: var(--x)
}

.delete-btn {
    margin-left: auto
}

.delete-btn:hover {
    color: var(--x) !important;
    background: rgba(255, 77, 109, .1) !important
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn .3s ease
}

.modal-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 48px 40px;
    text-align: center;
    max-width: 440px;
    width: 100%;
    position: relative;
    overflow: hidden;
    animation: modalIn .4s cubic-bezier(.175, .885, .32, 1.275);
    box-shadow: 0 24px 64px rgba(0, 0, 0, .5)
}

@keyframes modalIn {
    from {
        transform: scale(.7) translateY(40px);
        opacity: 0
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1
    }
}

.modal-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden
}

.confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: confettiFall 2s ease-in forwards
}

@keyframes confettiFall {
    0% {
        transform: translateY(-20px) rotate(0);
        opacity: 1
    }

    100% {
        transform: translateY(400px) rotate(720deg);
        opacity: 0
    }
}

.modal-trophy {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: bounce .5s ease .3s both
}

@keyframes bounce {
    0% {
        transform: scale(0) rotate(-20deg)
    }

    70% {
        transform: scale(1.2) rotate(5deg)
    }

    100% {
        transform: scale(1) rotate(0)
    }
}

.modal-title {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px
}

.modal-message {
    color: var(--txt2);
    margin-bottom: 20px
}

.modal-badge {
    font-size: 1.5rem;
    margin-bottom: 28px;
    padding: 12px 24px;
    background: rgba(255, 215, 0, .1);
    border: 1px solid rgba(255, 215, 0, .2);
    border-radius: 999px;
    display: inline-block;
    color: var(--gold)
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 20px;
    font-size: .9rem;
    color: var(--txt);
    backdrop-filter: blur(20px);
    z-index: 3000;
    transform: translateY(100px);
    opacity: 0;
    transition: all .4s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .4);
    pointer-events: none;
    max-width: 300px
}

.toast.show {
    transform: translateY(0);
    opacity: 1
}

/* Responsive */
@media(max-width:768px) {
    .nav-links {
        position: fixed;
        top: 68px;
        left: 0;
        right: 0;
        background: var(--nav);
        border-bottom: 1px solid var(--border);
        backdrop-filter: blur(20px);
        padding: 16px;
        flex-direction: column;
        gap: 8px;
        transform: translateY(-120%);
        transition: transform .3s;
        z-index: 999
    }

    .nav-links.open {
        transform: translateY(0)
    }

    .hamburger {
        display: flex
    }

    .nav-link {
        text-align: center;
        padding: 12px 20px
    }

    .section {
        padding: 84px 16px 40px
    }

    .player-inputs {
        flex-direction: column
    }

    .vs-divider {
        align-self: center;
        transform: rotate(90deg)
    }

    .score-count {
        font-size: 1.5rem
    }

    .game-controls .btn {
        font-size: .85rem;
        padding: 10px 16px
    }

    .features-grid {
        grid-template-columns: 1fr
    }

    .setup-card {
        padding: 24px 20px
    }

    .modal-card {
        padding: 32px 24px
    }

    .modal-title {
        font-size: 1.5rem
    }

    .leaderboard-table th:nth-child(4),
    .leaderboard-table td:nth-child(4),
    .leaderboard-table th:nth-child(5),
    .leaderboard-table td:nth-child(5) {
        display: none
    }
}

@media(max-width:480px) {
    .hero-title {
        font-size: 2rem
    }

    .board-wrapper {
        max-width: 280px
    }

    .badge-preview-card {
        padding: 16px 18px;
        min-width: 90px
    }
}
.winning {
  animation: winGlow 0.6s infinite alternate;
}

@keyframes winGlow {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}