/* =========================================================
   GAMEHUB — GLOBAL
========================================================= */

:root {
    --bg: #070709;
    --bg-soft: #0d0d11;
    --surface: rgba(255, 255, 255, 0.055);
    --surface-strong: rgba(255, 255, 255, 0.085);

    --text: #f5f5f7;
    --muted: #9999a4;
    --border: rgba(255, 255, 255, 0.11);

    --accent: #9cff00;
    --accent-soft: rgba(156, 255, 0, 0.13);
    --accent-glow: rgba(156, 255, 0, 0.25);

    --max-width: 1200px;
    --radius: 24px;

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 80% 10%, rgba(156, 255, 0, 0.055), transparent 28%),
        radial-gradient(circle at 10% 55%, rgba(100, 80, 255, 0.045), transparent 30%),
        var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

::selection {
    background: var(--accent);
    color: #050505;
}


/* =========================================================
   NAVIGATION
========================================================= */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 18px 24px;
    pointer-events: none;
}

.navbar {
    max-width: var(--max-width);
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    padding: 13px 16px 13px 20px;

    background: rgba(12, 12, 15, 0.72);
    border: 1px solid var(--border);
    border-radius: 18px;

    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);

    box-shadow:
        0 18px 60px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);

    pointer-events: auto;
}

.logo {
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    white-space: nowrap;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    position: relative;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -7px;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.35s var(--ease);
}

.nav-links a:hover {
    color: var(--text);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle {
    width: 40px;
    height: 40px;

    display: grid;
    place-items: center;

    border: 1px solid var(--border);
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.045);
    color: var(--text);

    cursor: pointer;
    transition:
        transform 0.3s ease,
        border-color 0.3s ease,
        background 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(20deg);
    border-color: rgba(156, 255, 0, 0.4);
    background: var(--accent-soft);
}

.login-btn {
    padding: 10px 16px;

    border-radius: 12px;

    background: var(--text);
    color: #080808;

    font-size: 0.78rem;
    font-weight: 800;

    transition:
        transform 0.3s var(--ease),
        box-shadow 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.12);
}


/* =========================================================
   HERO
========================================================= */

.hero-section {
    position: relative;
    max-width: var(--max-width);
    min-height: 900px;

    margin: 0 auto;
    padding: 180px 40px 120px;

    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 60px;

    isolation: isolate;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-label,
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    color: var(--accent);

    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.2em;
}

.hero-label::before,
.section-label::before {
    content: "";
    width: 24px;
    height: 1px;
    background: currentColor;
}

.hero-content h1 {
    margin-top: 24px;

    font-size: clamp(5rem, 11vw, 9.5rem);
    line-height: 0.78;
    letter-spacing: -0.075em;
    font-weight: 950;
}

.hero-content h1 span {
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.42);
}

.hero-content p {
    max-width: 480px;
    margin-top: 42px;

    color: var(--muted);
    font-size: 1rem;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;
    padding: 0 22px;

    border-radius: 13px;

    font-size: 0.8rem;
    font-weight: 800;

    transition:
        transform 0.35s var(--ease),
        box-shadow 0.35s ease,
        border-color 0.35s ease;
}

.primary-btn {
    background: var(--accent);
    color: #050505;

    box-shadow:
        0 0 0 rgba(156, 255, 0, 0),
        0 12px 30px rgba(156, 255, 0, 0.12);
}

.primary-btn:hover {
    transform: translateY(-4px);
    box-shadow:
        0 0 35px var(--accent-glow),
        0 18px 40px rgba(156, 255, 0, 0.16);
}

.secondary-btn {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
}

.secondary-btn:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.25);
}


/* =========================================================
   HERO VISUAL
========================================================= */

.hero-visual {
    position: relative;
    min-height: 560px;

    display: grid;
    place-items: center;
}

.hero-visual::before {
    content: "";
    position: absolute;

    width: 360px;
    height: 360px;

    border-radius: 50%;

    background: var(--accent);
    opacity: 0.07;

    filter: blur(90px);
}

.game-orb {
    position: absolute;
    border-radius: 50%;

    border: 1px solid rgba(255, 255, 255, 0.1);

    animation: orbFloat 7s ease-in-out infinite;
}

.orb-one {
    width: 300px;
    height: 300px;

    border-color: rgba(156, 255, 0, 0.18);

    box-shadow:
        inset 0 0 70px rgba(156, 255, 0, 0.04),
        0 0 80px rgba(156, 255, 0, 0.05);
}

.orb-two {
    width: 210px;
    height: 210px;

    transform: translate(90px, -80px);

    animation-delay: -2s;
}

.orb-three {
    width: 130px;
    height: 130px;

    transform: translate(-120px, 110px);

    border-color: rgba(255, 255, 255, 0.18);

    animation-delay: -4s;
}

.hero-card {
    position: relative;
    z-index: 2;

    width: min(340px, 75%);

    padding: 38px;

    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 28px;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.1),
            rgba(255, 255, 255, 0.025)
        );

    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);

    box-shadow:
        0 40px 100px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);

    transform: rotate(-6deg);
    transition: transform 0.6s var(--ease);
}

.hero-card:hover {
    transform: rotate(0deg) translateY(-10px);
}

.hero-card span {
    display: block;

    color: var(--accent);

    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.hero-card strong {
    display: block;
    margin-top: 60px;

    font-size: clamp(2.5rem, 5vw, 4.5rem);
    letter-spacing: -0.06em;
}

.hero-card small {
    display: block;
    margin-top: 12px;

    color: var(--muted);
    font-size: 0.78rem;
}


/* =========================================================
   GENERAL SECTIONS
========================================================= */

.games-section,
.leaderboard-section,
.about-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 120px 40px;
}

.section-heading {
    max-width: 700px;
    margin-bottom: 55px;
}

.section-heading h2 {
    margin-top: 18px;

    font-size: clamp(2.4rem, 6vw, 5rem);
    line-height: 0.95;
    letter-spacing: -0.055em;
}

.section-heading p {
    margin-top: 18px;
    color: var(--muted);
    line-height: 1.7;
}


/* =========================================================
   GAME GRID
========================================================= */

.game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.game-card {
    min-height: 300px;
    padding: 26px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.075),
            rgba(255, 255, 255, 0.025)
        );

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    transition:
        transform 0.5s var(--ease),
        border-color 0.4s ease,
        box-shadow 0.4s ease;
}

.game-card:hover {
    transform: translateY(-10px);
    border-color: rgba(156, 255, 0, 0.25);

    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(156, 255, 0, 0.035);
}

.game-card-number {
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.15em;
}

.game-card h3 {
    margin-top: auto;
    padding-top: 50px;

    font-size: 2rem;
    letter-spacing: -0.04em;
}

.game-card p {
    margin-top: 10px;

    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.6;
}

.game-card-link {
    display: inline-flex;
    margin-top: 24px;

    color: var(--accent);

    font-size: 0.75rem;
    font-weight: 800;
}


/* =========================================================
   LEADERBOARD
========================================================= */
.leaderboard-player-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--glass);
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.leaderboard-player-note span {
    min-width: 0;
}

.leaderboard-name-btn {
    flex-shrink: 0;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        border-color 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

.leaderboard-name-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

.leaderboard-name-btn:active {
    transform: translateY(0);
}
.leaderboard-placeholder {
    min-height: 250px;

    display: grid;
    place-items: center;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: rgba(255, 255, 255, 0.025);

    color: var(--muted);
}

.leaderboard-placeholder p {
    font-size: 0.9rem;
}


/* =========================================================
   ABOUT
========================================================= */

.about-section {
    padding-bottom: 160px;
}

.about-text {
    max-width: 760px;

    color: var(--muted);

    font-size: clamp(1.2rem, 2.5vw, 2rem);
    line-height: 1.6;
}


/* =========================================================
   FOOTER
========================================================= */

.site-footer {
    max-width: var(--max-width);
    margin: 0 auto;

    padding: 35px 40px 50px;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;

    border-top: 1px solid var(--border);
}

.site-footer div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.site-footer strong {
    font-size: 0.85rem;
    letter-spacing: 0.15em;
}

.site-footer span,
.site-footer p {
    color: var(--muted);
    font-size: 0.72rem;
}


/* =========================================================
   ANIMATIONS
========================================================= */

@keyframes orbFloat {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-18px) scale(1.025);
    }
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {

    .nav-links {
        display: none;
    }

    .hero-section {
        grid-template-columns: 1fr;
        min-height: auto;

        padding-top: 160px;
    }

    .hero-content h1 {
        font-size: clamp(4.5rem, 16vw, 8rem);
    }

    .hero-visual {
        min-height: 430px;
    }

    .game-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


@media (max-width: 600px) {
   .game-visual {
    height: 190px;
}

    .site-header {
        padding: 10px 12px;
    }

    .navbar {
        padding: 11px 12px 11px 16px;
    }

    .login-btn {
        padding: 9px 13px;
    }

    .hero-section,
    .games-section,
    .leaderboard-section,
    .about-section {
        padding-left: 20px;
        padding-right: 20px;
    }

    .hero-section {
        padding-top: 145px;
        gap: 20px;
    }

    .hero-content h1 {
        font-size: clamp(4rem, 20vw, 6rem);
    }

    .hero-content p {
        margin-top: 30px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
    }

    .hero-visual {
        min-height: 360px;
    }

    .orb-one {
        width: 230px;
        height: 230px;
    }

    .orb-two {
        width: 160px;
        height: 160px;
    }

    .orb-three {
        width: 100px;
        height: 100px;
    }

    .hero-card {
        width: 78%;
        padding: 28px;
    }

    .hero-card strong {
        margin-top: 40px;
        font-size: 3rem;
    }

    .games-section,
    .leaderboard-section,
    .about-section {
        padding-top: 90px;
        padding-bottom: 90px;
    }

    .game-grid {
        grid-template-columns: 1fr;
    }

    .game-card {
        min-height: 260px;
    }

    .site-footer {
        padding: 30px 20px 40px;

        flex-direction: column;
        align-items: flex-start;
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* =========================================================
   LIGHT MODE
========================================================= */

body.light-mode {
    --bg: #f3f3f1;
    --bg-soft: #ffffff;
    --surface: rgba(0, 0, 0, 0.045);
    --surface-strong: rgba(0, 0, 0, 0.07);

    --text: #111113;
    --muted: #606067;
    --border: rgba(0, 0, 0, 0.12);

    --accent: #6faa00;
    --accent-soft: rgba(111, 170, 0, 0.12);
    --accent-glow: rgba(111, 170, 0, 0.2);
}

body.light-mode {
    background:
        radial-gradient(
            circle at 80% 10%,
            rgba(111, 170, 0, 0.08),
            transparent 28%
        ),
        var(--bg);
}

body.light-mode .navbar {
    background: rgba(255, 255, 255, 0.75);
}

body.light-mode .hero-content h1 span {
    -webkit-text-stroke-color: rgba(0, 0, 0, 0.35);
}

body.light-mode .hero-card {
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.9),
            rgba(255, 255, 255, 0.55)
        );
}

body.light-mode .login-btn {
    background: #111113;
    color: #ffffff;
}
/* =========================================================
   GAME VISUALS
========================================================= */

.game-card {
    overflow: hidden;
    padding: 0;
}

.game-visual {
    position: relative;

    height: 210px;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    padding: 22px;

    overflow: hidden;

    border-bottom: 1px solid var(--border);

    background:
        radial-gradient(
            circle at 70% 35%,
            rgba(156, 255, 0, 0.16),
            transparent 42%
        ),
        linear-gradient(145deg, #111116, #08080a);
}

.game-visual::before {
    content: "";

    position: absolute;

    width: 180px;
    height: 180px;

    right: -45px;
    top: -55px;

    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;

    box-shadow:
        0 0 70px rgba(156, 255, 0, 0.08);

    transition:
        transform 0.7s var(--ease),
        border-color 0.5s ease;
}

.game-card:hover .game-visual::before {
    transform: scale(1.25) rotate(25deg);
    border-color: rgba(156, 255, 0, 0.22);
}

.game-visual-icon {
    position: relative;
    z-index: 2;

    font-size: 4.5rem;
    font-weight: 950;
    line-height: 0.8;
    letter-spacing: -0.08em;

    color: transparent;

    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.38);
}

.game-visual-tag {
    position: relative;
    z-index: 2;

    padding: 7px 10px;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;

    background: rgba(0, 0, 0, 0.28);

    color: var(--muted);

    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.14em;

    backdrop-filter: blur(10px);
}

.number-game-visual {
    background:
        radial-gradient(
            circle at 72% 35%,
            rgba(156, 255, 0, 0.18),
            transparent 40%
        ),
        linear-gradient(145deg, #111116, #08080a);
}

.password-game-visual {
    background:
        radial-gradient(
            circle at 72% 35%,
            rgba(130, 100, 255, 0.17),
            transparent 40%
        ),
        linear-gradient(145deg, #111116, #08080a);
}

.hand-game-visual {
    background:
        radial-gradient(
            circle at 72% 35%,
            rgba(0, 200, 255, 0.14),
            transparent 40%
        ),
        linear-gradient(145deg, #111116, #08080a);
}

.chess-game-visual {
    background:
        radial-gradient(
            circle at 72% 35%,
            rgba(156, 255, 0, 0.20),
            transparent 40%
        ),
        radial-gradient(
            circle at 25% 70%,
            rgba(100, 80, 255, 0.10),
            transparent 35%
        ),
        linear-gradient(145deg, #111116, #08080a);
}

.chess-game-visual .game-visual-icon {
    font-size: 5.2rem;
    line-height: 0.72;
    letter-spacing: 0;
    -webkit-text-stroke: 0;
    color: rgba(255, 255, 255, 0.88);
    text-shadow:
        0 0 16px rgba(156, 255, 0, 0.16);
}

.coming-game-visual {
    background:
        radial-gradient(
            circle at 72% 35%,
            rgba(255, 255, 255, 0.08),
            transparent 40%
        ),
        linear-gradient(145deg, #111116, #08080a);
}

.game-card-info {
    padding: 24px 26px 28px;
}

.game-card-info h3 {
    margin-top: 12px;
}

.game-card-info p {
    margin-top: 10px;
}

.game-card-info .game-card-link {
    margin-top: 22px;
}
/* =========================================
   GAME PAGE — NUMBER PATTERN
   ========================================= */

.game-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 150px 6% 100px;
}


/* GAME HEADER */

.game-header {
    max-width: 760px;
    margin-bottom: 55px;
}

.back-link {
    display: inline-block;
    margin-bottom: 30px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
}

.back-link:hover {
    color: var(--accent);
    transform: translateX(-4px);
}

.game-page-label {
    display: block;
    margin-bottom: 16px;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.game-header h1 {
    margin: 0;
    font-size: clamp(3rem, 7vw, 6.5rem);
    line-height: 0.95;
    letter-spacing: -0.055em;
}

.game-header h1 span {
    color: var(--accent);
}

.game-header p {
    max-width: 600px;
    margin-top: 25px;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.8;
}


/* GAME CONTAINER */

.game-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 45px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.game-container::before {
    content: "";
    position: absolute;
    top: -180px;
    right: -160px;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.06;
    filter: blur(70px);
    pointer-events: none;
}


/* GAME TOP BAR */

.game-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.game-stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.game-stat span {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
}

.game-stat strong {
    font-size: 1.7rem;
}


/* PATTERN AREA */

.pattern-area {
    padding: 75px 20px 65px;
    text-align: center;
}

.pattern-label {
    display: block;
    margin-bottom: 30px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.pattern {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.pattern span {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 82px;
    height: 82px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    font-size: 1.7rem;
    font-weight: 700;
}

.pattern .missing {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 30px rgba(156, 255, 0, 0.08);
}


/* ANSWER AREA */

.answer-area {
    max-width: 620px;
    margin: 0 auto;
}

.answer-area label {
    display: block;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
}

.answer-row {
    display: flex;
    gap: 12px;
}

.answer-row input {
    min-width: 0;
    flex: 1;
    height: 54px;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    outline: none;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.answer-row input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.answer-row input::placeholder {
    color: var(--text-muted);
}

.answer-row .primary-btn {
    min-width: 120px;
    border: none;
    cursor: pointer;
}


/* FEEDBACK */

.game-feedback {
    min-height: 25px;
    margin: 16px 0 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}


/* GAME ACTIONS */

.game-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 25px;
}

.game-actions button {
    cursor: pointer;
}


/* GAME INFO */

.game-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1100px;
    margin: 90px auto 0;
}

.info-card {
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card-bg);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.info-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
}

.info-card > span {
    display: block;
    margin-bottom: 20px;
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
}

.info-card h3 {
    margin: 0 0 12px;
    font-size: 1.15rem;
}

.info-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}


/* =========================================
   GAME PAGE — RESPONSIVE
   ========================================= */

@media (max-width: 800px) {

    .game-page {
        padding-top: 125px;
    }

    .game-container {
        padding: 30px 22px;
    }

    .pattern {
        gap: 10px;
    }

    .pattern span {
        width: 68px;
        height: 68px;
        font-size: 1.4rem;
        border-radius: 15px;
    }

    .game-info {
        grid-template-columns: 1fr;
        margin-top: 60px;
    }
}


@media (max-width: 600px) {

    .game-page {
        padding: 110px 5% 70px;
    }

    .game-header {
        margin-bottom: 35px;
    }

    .game-header h1 {
        font-size: clamp(3rem, 15vw, 4.5rem);
    }

    .game-header p {
        font-size: 0.95rem;
    }

    .game-container {
        padding: 25px 18px;
        border-radius: 20px;
    }

    .game-topbar {
        padding-bottom: 22px;
    }

    .pattern-area {
        padding: 50px 5px;
    }

    .pattern {
        gap: 8px;
    }

    .pattern span {
        width: 58px;
        height: 58px;
        font-size: 1.2rem;
        border-radius: 13px;
    }

    .answer-row {
        flex-direction: column;
    }

    .answer-row input,
    .answer-row .primary-btn {
        width: 100%;
        min-width: 0;
    }

    .answer-row .primary-btn {
        min-height: 54px;
    }

    .game-actions {
        flex-direction: column;
    }

    .game-actions button {
        width: 100%;
    }

    .info-card {
        padding: 25px;
    }
}


/* REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {

    .back-link,
    .info-card,
    .answer-row input {
        transition: none;
    }
}
/* GAME CARD ACTIONS */

.game-card-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.game-card-actions .game-card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.game-card-actions .play-link {
    padding: 11px 18px;
    border-radius: 12px;
    background: var(--accent);
    color: #000;
    font-weight: 700;
}
/* =========================================
   MOBILE OVERFLOW FIX
   ========================================= */

@media (max-width: 600px) {

    /* Keep the navbar inside the screen */
    .navbar {
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .nav-actions {
        min-width: 0;
        gap: 8px;
    }

    .login-btn {
        white-space: nowrap;
        padding: 10px 12px;
        font-size: 0.75rem;
    }


    /* Prevent the huge hero title from overflowing */
    .hero-content h1 {
        max-width: 100%;
        font-size: clamp(3rem, 15vw, 5rem);
        line-height: 0.9;
        overflow-wrap: break-word;
        word-break: normal;
    }
   .hero-content h1 span {
    display: inline-block;
    transform: scaleX(1.03);
    transform-origin: left center;
}


    /* Keep hero buttons inside the phone */
    .hero-actions {
        width: 100%;
        max-width: 100%;
        flex-wrap: wrap;
        gap: 10px;
    }

    .hero-actions a {
        box-sizing: border-box;
        max-width: 100%;
    }


    /* Prevent decorative hero elements from creating
       horizontal page overflow */
    .hero-section {
        overflow: hidden;
    }

    .hero-visual {
        min-width: 0;
        max-width: 100%;
    }
}

.game-card-actions .project-link {
    padding: 11px 4px;
}
/* =========================================
   LIVES SYSTEM
   ========================================= */

#lives {
    letter-spacing: 4px;
    font-size: 1.15rem;
    color: var(--accent);
    white-space: nowrap;
}

@media (max-width: 600px) {

    #lives {
        font-size: 0.95rem;
        letter-spacing: 2px;
    }

}
/* =========================================
   STREAK SYSTEM
   ========================================= */

#streak {
    white-space: nowrap;
}

@media (max-width: 700px) {
   .leaderboard-player-note {
    align-items: flex-start;
    flex-direction: column;
}

.leaderboard-name-btn {
    width: 100%;
}
   .leaderboard-controls {
    justify-content: flex-start;
    flex-wrap: wrap;
}

#leaderboard-game {
    width: 100%;
    min-width: 0;
}

    .game-topbar {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media (max-width: 600px) {

    #streak {
        font-size: 0.95rem;
    }

}
/* =========================================
   TIMER SYSTEM
   ========================================= */

.timer-stat strong {
    min-width: 42px;
    display: inline-block;
    text-align: center;
}

.timer-stat.warning strong {
    animation: timerPulse 0.8s ease-in-out infinite;
}

@keyframes timerPulse {

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

    50% {
        transform: scale(1.12);
    }

}

@media (max-width: 700px) {

    .game-topbar {
        grid-template-columns: repeat(2, 1fr);
    }

    .timer-stat {
        grid-column: 1 / -1;
    }

}

@media (max-width: 600px) {

    .timer-stat strong {
        font-size: 0.95rem;
    }

}
/* =========================================
   FINAL SCORE SCREEN
   ========================================= */

.final-screen {
    text-align: center;
    padding: 30px 10px 10px;
}

.final-label {
    display: inline-block;
    margin-bottom: 16px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}

.final-screen h2 {
    margin: 0;
    font-size: clamp(3rem, 8vw, 5.5rem);
    line-height: 0.95;
    letter-spacing: -0.05em;
}

.final-screen h2 span {
    color: var(--accent);
}

.final-message {
    margin: 18px auto 32px;
    max-width: 500px;
    color: var(--text-muted);
    line-height: 1.7;
}

.final-stats {
    width: min(100%, 700px);
    margin: 0 auto 34px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.final-stat {
    padding: 20px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card-bg);
}

.final-stat span {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.final-stat strong {
    display: block;
    font-size: 1.4rem;
}

.final-screen .primary-btn {
    min-width: 150px;
}


/* =========================================
   TIMER
   ========================================= */

.timer-stat strong {
    min-width: 42px;
    display: inline-block;
    text-align: center;
}

.timer-stat.warning strong {
    animation: timerPulse 0.8s ease-in-out infinite;
}

@keyframes timerPulse {

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

    50% {
        transform: scale(1.12);
    }

}


/* =========================================
   STREAK
   ========================================= */

#streak {
    white-space: nowrap;
}


/* =========================================
   MOBILE GAME STATS
   ========================================= */

@media (max-width: 700px) {

    .game-topbar {
        grid-template-columns: repeat(2, 1fr);
    }

    .timer-stat {
        grid-column: 1 / -1;
    }

    .final-stats {
        grid-template-columns: repeat(2, 1fr);
    }

}


@media (max-width: 600px) {

    #streak {
        font-size: 0.95rem;
    }

    .timer-stat strong {
        font-size: 0.95rem;
    }

    .final-screen {
        padding-top: 15px;
    }

    .final-stat {
        padding: 16px 10px;
    }

    .final-stat span {
        font-size: 0.6rem;
    }

}
/* =========================
   PLAYER SYSTEM
========================= */

.player-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card-bg);
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        background 0.25s ease;
}

.player-btn:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.player-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

/* PLAYER MODAL */

.player-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
}

.player-modal[hidden] {
    display: none;
}

.player-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.68);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.player-modal-card {
    position: relative;
    z-index: 1;
    width: min(100%, 480px);
    padding: 42px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    animation: playerModalIn 0.35s ease both;
}

.player-modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.player-modal-close:hover {
    transform: rotate(90deg);
    border-color: var(--accent);
}

.player-modal-label {
    display: block;
    margin-bottom: 14px;
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.player-modal-card h2 {
    margin: 0;
    font-size: clamp(2.4rem, 7vw, 4rem);
    line-height: 0.95;
    letter-spacing: -0.05em;
}

.player-modal-card h2 span {
    color: var(--accent);
}

.player-modal-card > p {
    margin: 20px 0 30px;
    color: var(--text-muted);
    line-height: 1.7;
}

#player-form label {
    display: block;
    margin-bottom: 9px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

#player-input {
    width: 100%;
    min-height: 54px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    outline: none;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

#player-input::placeholder {
    color: var(--text-muted);
}

#player-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.player-error {
    min-height: 22px;
    margin: 8px 0 4px;
    color: #ff6b6b;
    font-size: 0.8rem;
}

.player-submit {
    width: 100%;
    margin-top: 4px;
}

@keyframes playerModalIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.97);
    }

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

@media (max-width: 600px) {

    .player-btn {
        padding: 0 12px;
    }

    .player-modal {
        padding: 14px;
    }

    .player-modal-card {
        padding: 34px 24px 28px;
        border-radius: 22px;
    }

    .player-modal-card h2 {
        font-size: 2.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    .player-modal-card {
        animation: none;
    }

    .player-btn,
    .player-modal-close {
        transition: none;
    }
}
/* =========================
   GAME PLAYER
========================= */

.player-stat strong {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 700px) {

    .player-stat {
        grid-column: 1 / -1;
    }

    .player-stat strong {
        max-width: 180px;
    }
}

/* =========================
   LEADERBOARD
========================= */

.leaderboard-controls {
    width: min(100%, 900px);
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.leaderboard-controls label {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

#leaderboard-game {
    min-height: 44px;
    padding: 0 38px 0 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

#leaderboard-game:focus {
    border-color: var(--accent);
}

.leaderboard-board {
    width: min(100%, 900px);
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card-bg);
}

.leaderboard-header,
.leaderboard-row {
    display: grid;
    grid-template-columns: 80px minmax(140px, 1.4fr) minmax(130px, 1fr) 120px;
    align-items: center;
    gap: 20px;
    padding: 18px 24px;
}

.leaderboard-header {
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.leaderboard-row {
    min-height: 76px;
    border-bottom: 1px solid var(--border);
    transition:
        background 0.25s ease,
        transform 0.25s ease;
}

.leaderboard-row:last-child {
    border-bottom: none;
}

.leaderboard-row:hover {
    background: var(--surface);
}

.leaderboard-rank {
    font-size: 0.9rem;
    font-weight: 800;
}

.leaderboard-player {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.leaderboard-player-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}

.leaderboard-you {
    padding: 4px 7px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.leaderboard-game-name {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.leaderboard-score {
    text-align: right;
    font-size: 1.05rem;
    font-weight: 900;
}

.leaderboard-row.rank-one .leaderboard-rank,
.leaderboard-row.rank-two .leaderboard-rank,
.leaderboard-row.rank-three .leaderboard-rank {
    font-size: 1.15rem;
}

.leaderboard-empty {
    padding: 50px 24px;
    text-align: center;
    color: var(--text-muted);
}

.leaderboard-empty strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 1.1rem;
}

@media (max-width: 700px) {

    .leaderboard-controls {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .leaderboard-header {
        display: none;
    }

    .leaderboard-row {
        grid-template-columns: 48px minmax(0, 1fr) auto;
        gap: 12px;
        padding: 16px;
    }

    .leaderboard-game-name {
        grid-column: 2;
        margin-top: -8px;
        font-size: 0.72rem;
    }

    .leaderboard-score {
        grid-column: 3;
        grid-row: 1 / span 2;
    }
}

@media (max-width: 420px) {

    .leaderboard-row {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        padding: 14px;
    }

    .leaderboard-score {
        font-size: 0.95rem;
    }

    .leaderboard-you {
        display: none;
    }
}
/* =========================
   LEADERBOARD FILTER
========================= */

.leaderboard-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 18px;
}

.leaderboard-controls label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--muted);
}

#leaderboard-game {
    appearance: none;
    -webkit-appearance: none;

    min-width: 190px;
    padding: 12px 42px 12px 15px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 19px) 50% / 6px 6px no-repeat,
        linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 14px) 50% / 6px 6px no-repeat,
        var(--glass);

    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;

    outline: none;
    cursor: pointer;

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

#leaderboard-game:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

#leaderboard-game:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

#leaderboard-game option {
    background: var(--bg);
    color: var(--text);
}
/* =========================
   LEADERBOARD REFRESH
========================= */

.leaderboard-refresh {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--glass);
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        border-color 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

.leaderboard-refresh:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

.leaderboard-refresh:active {
    transform: translateY(0);
}
