:root {
    --bg: #07100d;
    --panel: #101916;
    --panel-2: #17231f;
    --line: rgba(255, 255, 255, .12);
    --text: #f4f7f2;
    --muted: #a9b8ae;
    --lime: #b7ff3c;
    --gold: #ffd34f;
    --red: #ff4e4e;
    --cyan: #5be4ff;
    --shadow: 0 24px 70px rgba(0, 0, 0, .38);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 50% -10%, rgba(183, 255, 60, .14), transparent 32rem),
        linear-gradient(180deg, #07100d 0%, #0b1411 45%, #08100d 100%);
}

a {
    color: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    min-height: 72px;
    padding: .9rem clamp(1rem, 4vw, 3rem);
    border-bottom: 1px solid var(--line);
    background: rgba(7, 16, 13, .86);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    text-decoration: none;
}

.brand img {
    display: block;
    width: clamp(152px, 18vw, 210px);
    height: auto;
}

.nav {
    display: flex;
    align-items: center;
    gap: .45rem;
    overflow-x: auto;
    white-space: nowrap;
}

.nav a {
    padding: .65rem .82rem;
    border-radius: 6px;
    color: var(--muted);
    font-size: .92rem;
    font-weight: 800;
    text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
    background: rgba(255, 255, 255, .08);
    color: var(--text);
}

main {
    width: min(1240px, 100%);
    margin: 0 auto;
}

.game-shell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(1rem, 2vw, 1.6rem);
    min-height: calc(100vh - 72px);
    padding: clamp(1rem, 3vw, 2.2rem);
}

.game-copy {
    max-width: 760px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 .75rem;
    color: var(--lime);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    font-family: Oswald, sans-serif;
    line-height: 1.02;
    letter-spacing: 0;
}

h1 {
    max-width: none;
    font-size: clamp(3rem, 8vw, 5.8rem);
    text-transform: uppercase;
}

.content-page h1 {
    max-width: 15ch;
}

h2 {
    margin-top: 2rem;
    font-size: clamp(1.55rem, 3vw, 2.35rem);
}

p {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.75;
}

.game-copy p:not(.eyebrow) {
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.08rem;
}

.game-card {
    position: relative;
    width: min(1120px, 100%);
    min-height: 420px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    background: #050907;
    box-shadow: var(--shadow);
}

.game-card:fullscreen {
    width: 100vw;
    height: 100vh;
    border: 0;
    border-radius: 0;
    background: #020504;
}

.game-card:fullscreen #gameCanvas {
    height: calc(100vh - 58px);
}

.game-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 58px;
    padding: .7rem .9rem;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    background: rgba(5, 9, 7, .94);
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.game-toolbar strong,
.game-toolbar span {
    display: block;
}

.game-toolbar strong {
    color: var(--text);
    font-family: Oswald, sans-serif;
    font-size: 1.25rem;
    text-transform: uppercase;
}

.game-toolbar span {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}

.splash-screen,
.cover-panel {
    position: absolute;
    inset: 58px 0 0;
    z-index: 12;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background:
        linear-gradient(180deg, rgba(2, 5, 4, .18), rgba(2, 5, 4, .72)),
        radial-gradient(circle at 50% 38%, rgba(183, 255, 60, .18), transparent 32rem);
    text-align: center;
}

.splash-screen[hidden],
.cover-panel[hidden] {
    display: none;
}

.cover-panel.backdrop-only > * {
    display: none;
}

.splash-screen {
    inset: 0;
    z-index: 25;
    background: #fff;
    color: #073240;
}

.splash-logo-wrap {
    display: grid;
    place-items: center;
    width: min(560px, 88%);
    padding: 0;
    border-radius: 0;
    background: #fff;
}

.splash-logo-wrap img,
.cover-panel img {
    max-width: 100%;
    height: auto;
}

.cover-panel {
    align-content: center;
    gap: 1rem;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, .82)),
        url('/assets/cover-cricket.png') center / cover no-repeat;
}

.cover-panel h2 {
    margin-top: .2rem;
    font-size: clamp(2rem, 5vw, 4.8rem);
    text-transform: uppercase;
}

.cover-panel p {
    max-width: 42rem;
    margin: 0 auto .6rem;
    color: #dce8dd;
}

.cover-panel .primary-btn {
    min-width: min(360px, 86vw);
    min-height: 82px;
    padding: 1.15rem 2rem;
    border-radius: 10px;
    font-size: clamp(1.7rem, 4.5vw, 3rem);
    text-transform: uppercase;
    box-shadow: 0 18px 38px rgba(183, 255, 60, .22);
}

.ghost-link {
    color: var(--text);
    font-weight: 900;
    text-decoration: none;
}

#gameCanvas {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #07100d;
}

.game-panel,
.result-panel {
    position: absolute;
    z-index: 14;
    inset: auto 1rem 1rem auto;
    width: min(24rem, calc(100% - 2rem));
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    background: rgba(10, 18, 15, .88);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .36);
    backdrop-filter: blur(14px);
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-head h2,
.result-panel h2 {
    margin: 0;
}

.status-pill {
    flex: 0 0 auto;
    padding: .45rem .62rem;
    border-radius: 999px;
    background: rgba(183, 255, 60, .13);
    color: var(--lime);
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
}

label {
    display: grid;
    gap: .42rem;
    margin-bottom: .78rem;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 900;
    text-transform: uppercase;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 6px;
    background: rgba(255, 255, 255, .07);
    color: var(--text);
    font: inherit;
    padding: .82rem .9rem;
    outline: none;
}

select option {
    background: #101916;
    color: var(--text);
}

textarea {
    min-height: 10rem;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(183, 255, 60, .7);
}

button,
.coffee-btn,
.text-link {
    cursor: pointer;
    border: 0;
    border-radius: 6px;
    font: inherit;
    font-weight: 900;
    text-decoration: none;
}

.primary-btn,
.coffee-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: .86rem 1rem;
    background: var(--lime);
    color: #10210d;
}

.coffee-btn {
    background: var(--gold);
    color: #241700;
}

.coffee-btn.inline {
    margin-top: .4rem;
}

.ghost-btn {
    min-height: 46px;
    padding: .86rem 1rem;
    border: 1px solid rgba(255, 255, 255, .18);
    background: transparent;
    color: var(--text);
}

.icon-btn {
    display: inline-grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 6px;
    background: rgba(255, 255, 255, .05);
    color: var(--text);
    font-size: 1.35rem;
    line-height: 1;
}

.icon-btn:hover,
.ghost-btn:hover {
    border-color: rgba(183, 255, 60, .7);
}

.small-btn {
    min-height: 38px;
    padding: .55rem .78rem;
    font-size: .82rem;
}

.choice-panel {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: min(34rem, calc(100% - 2rem));
    max-height: calc(100% - 86px);
    overflow: auto;
    transform: translate(-50%, -42%);
}

.level-grid {
    display: grid;
    gap: .75rem;
}

.level-card {
    display: grid;
    gap: .25rem;
    width: 100%;
    min-height: 84px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .07);
    color: var(--text);
    text-align: left;
}

.level-card:hover {
    border-color: rgba(183, 255, 60, .75);
    background: rgba(183, 255, 60, .12);
}

.level-card strong {
    font-family: Oswald, sans-serif;
    font-size: 1.85rem;
    text-transform: uppercase;
}

.level-card span {
    color: var(--muted);
    font-size: .92rem;
    font-weight: 800;
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
}

.fineprint {
    margin: .8rem 0 0;
    color: #8ca096;
    font-size: .78rem;
    line-height: 1.55;
}

.content-band,
.content-page {
    padding: clamp(1.5rem, 4vw, 4rem);
}

.content-band.compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .03);
}

.content-band h2 {
    margin-top: 0;
}

.text-link {
    color: var(--lime);
}

.content-page {
    max-width: 920px;
    min-height: calc(100vh - 220px);
}

.content-page strong,
.content-page a {
    color: var(--text);
}

.steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.steps article {
    min-height: 220px;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .04);
}

.steps span {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    background: var(--lime);
    color: #10210d;
    font-weight: 900;
}

.leaderboard-page {
    max-width: 1180px;
}

.leaderboard-tools {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin: 1.5rem 0;
}

.board-tab {
    padding: .75rem 1rem;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .05);
    color: var(--text);
}

.board-tab.active {
    background: var(--lime);
    color: #10210d;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: .95rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    text-align: left;
}

th {
    color: var(--lime);
    font-size: .78rem;
    text-transform: uppercase;
}

td {
    color: var(--text);
}

.contact-form {
    margin-top: 1.5rem;
}

.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.4rem clamp(1rem, 4vw, 3rem);
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.footer p {
    margin: .2rem 0 0;
    font-size: .86rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .9rem;
}

.footer a {
    color: var(--text);
    font-size: .9rem;
    font-weight: 800;
    text-decoration: none;
}

@media (max-width: 980px) {
    h1 {
        max-width: none;
    }

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

@media (max-width: 680px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav {
        width: 100%;
        padding-bottom: .1rem;
    }

    .game-shell {
        padding: 1rem;
    }

    .game-copy {
        display: block;
    }

    .game-copy p:not(.eyebrow) {
        display: none;
    }

    h1 {
        max-width: none;
        font-size: clamp(2.2rem, 12vw, 3.6rem);
    }

    .game-card {
        min-height: calc(100svh - 150px);
        height: calc(100svh - 150px);
    }

    #gameCanvas {
        height: calc(100svh - 208px);
        min-height: 0;
        object-fit: cover;
    }

    .splash-screen,
    .cover-panel {
        inset: 58px 0 0;
        padding: .85rem;
    }

    .splash-screen {
        inset: 0;
    }

    .cover-panel {
        gap: .55rem;
        background-position: center;
    }

    .cover-panel img {
        width: min(240px, 72vw);
    }

    .cover-panel h2 {
        font-size: clamp(1.65rem, 8vw, 2.65rem);
    }

    .cover-panel p {
        max-width: 19rem;
        font-size: .9rem;
        line-height: 1.45;
    }

    .cover-panel .primary-btn {
        min-width: min(280px, 84vw);
        min-height: 70px;
        font-size: clamp(1.55rem, 8vw, 2.35rem);
    }

    .game-toolbar {
        align-items: flex-start;
    }

    .game-toolbar span {
        display: none;
    }

    .game-panel,
    .result-panel {
        inset: 72px .65rem .65rem .65rem;
        width: auto;
        max-height: calc(100% - 86px);
        overflow: auto;
        transform: none;
    }

    .choice-panel {
        inset: 72px .65rem .65rem .65rem;
        width: auto;
        transform: none;
    }

    .level-card {
        min-height: 70px;
        padding: .75rem;
    }

    .level-card strong {
        font-size: 1.45rem;
    }

    .level-card span {
        font-size: .82rem;
    }

    .panel-head {
        display: block;
    }

    .panel-head h2 {
        margin-top: .65rem;
    }

    .content-band.compact,
    .footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-links {
        justify-content: flex-start;
    }

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