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

:root {

    --bg: #071019;

    --panel: #0d1823;

    --panel-light: #142332;

    --accent: #36e7b4;

    --accent-2: #4da3ff;

    --text: #f4f8fb;

    --muted: #8fa4b7;

    --danger: #ff5573;
}

html,
body {

    width: 100%;
    height: 100%;
}

body {

    overflow: hidden;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    color: var(--text);

    background:

        radial-gradient(
            circle at 50% 20%,
            #132a39 0%,
            transparent 40%
        ),

        radial-gradient(
            circle at 20% 80%,
            #10253a 0%,
            transparent 30%
        ),

        var(--bg);
}

button {

    font-family: inherit;

    cursor: pointer;

    border: none;
}

.game-wrapper {

    width: min(1500px, 100%);

    height: 100vh;

    margin: auto;

    display: flex;

    flex-direction: column;

    padding: 12px 18px;
}


/* =========================================
   TOP BAR
========================================= */

.top-bar {

    height: 48px;

    display: flex;

    justify-content: space-between;

    align-items: center;

    flex-shrink: 0;
}

.brand {

    font-size: 14px;

    letter-spacing: 2px;

    font-weight: 700;

    color: #b8c9d7;
}

.brand strong {

    color: var(--accent);
}

.brand-dot {

    display: inline-block;

    width: 8px;

    height: 8px;

    margin-right: 8px;

    border-radius: 50%;

    background: var(--accent);

    box-shadow:
        0 0 12px var(--accent);
}

.top-controls {

    display: flex;

    gap: 8px;
}

.small-button {

    padding: 8px 12px;

    border-radius: 8px;

    background:
        rgba(255,255,255,.06);

    color: #c6d5e1;

    font-size: 11px;

    font-weight: 700;

    letter-spacing: .7px;

    transition: .2s;
}

.small-button:hover {

    background:
        rgba(255,255,255,.12);

    color: white;
}


/* =========================================
   SCORE
========================================= */

.scoreboard {

    height: 82px;

    display: flex;

    justify-content: center;

    align-items: center;

    gap: 30px;

    flex-shrink: 0;
}

.player-score,
.cpu-score {

    min-width: 100px;

    display: flex;

    flex-direction: column;

    align-items: center;
}

.player-label {

    font-size: 10px;

    letter-spacing: 2px;

    color: var(--muted);

    margin-bottom: 3px;
}

#playerScore,
#cpuScore {

    font-size: 42px;

    line-height: 1;

    font-weight: 800;
}

#playerScore {

    color: var(--accent);

    text-shadow:
        0 0 20px rgba(54,231,180,.3);
}

#cpuScore {

    color: var(--accent-2);

    text-shadow:
        0 0 20px rgba(77,163,255,.3);
}

.score-divider {

    font-size: 26px;

    color: #506171;

    margin-top: 12px;
}


/* =========================================
   CANVAS
========================================= */

.canvas-container {

    position: relative;

    width: 100%;

    flex: 1;

    min-height: 250px;

    display: flex;

    align-items: center;

    justify-content: center;
}

canvas {

    display: block;

    width: 100%;

    height: 100%;

    border-radius: 18px;

    box-shadow:

        0 20px 70px rgba(0,0,0,.45),

        inset
        0 0 0 1px
        rgba(255,255,255,.05);
}


/* =========================================
   BOTTOM
========================================= */

.bottom-bar {

    height: 34px;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: space-between;

    color: #617689;

    font-size: 9px;

    font-weight: 700;

    letter-spacing: 1.5px;
}

#difficultyIndicator {

    color: var(--accent);
}


/* =========================================
   MESSAGE
========================================= */

.message-overlay {

    pointer-events: none;

    position: absolute;

    inset: 0;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    text-align: center;
}

.message-overlay.hidden {

    display: none;
}

#messageTitle {

    font-size:
        clamp(32px, 5vw, 72px);

    font-weight: 900;

    letter-spacing: 4px;

    text-shadow:
        0 8px 30px
        rgba(0,0,0,.5);

    animation:
        messagePop .35s ease-out;
}

#messageSubtitle {

    margin-top: 8px;

    color: #b9c8d4;

    font-size: 13px;

    letter-spacing: 2px;
}

@keyframes messagePop {

    from {

        opacity: 0;

        transform:
            scale(.65);
    }

    to {

        opacity: 1;

        transform:
            scale(1);
    }
}


/* =========================================
   OVERLAYS
========================================= */

.screen-overlay {

    position: fixed;

    z-index: 20;

    inset: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background:
        rgba(3, 8, 13, .78);

    backdrop-filter:
        blur(12px);
}

.screen-overlay.hidden {

    display: none;
}


/* =========================================
   CARDS
========================================= */

.menu-card,
.dialog-card {

    position: relative;

    width:
        min(430px, 94vw);

    padding: 38px;

    border:
        1px solid
        rgba(255,255,255,.08);

    border-radius: 24px;

    background:

        linear-gradient(
            145deg,
            rgba(21,36,50,.97),
            rgba(8,17,26,.98)
        );

    box-shadow:

        0 30px 100px
        rgba(0,0,0,.65),

        inset
        0 1px 0
        rgba(255,255,255,.04);

    animation:
        cardIn .35s ease-out;
}

@keyframes cardIn {

    from {

        opacity: 0;

        transform:
            translateY(20px)
            scale(.97);
    }

    to {

        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}


/* =========================================
   LOGO
========================================= */

.menu-glow {

    position: absolute;

    top: -100px;

    left: 50%;

    width: 220px;

    height: 220px;

    transform:
        translateX(-50%);

    background:
        rgba(54,231,180,.08);

    filter: blur(70px);

    pointer-events: none;
}

.game-logo {

    position: relative;

    text-align: center;

    line-height: .85;

    margin-bottom: 24px;
}

.game-logo span,
.game-logo strong {

    display: block;

    font-size:
        clamp(45px, 11vw, 72px);

    font-weight: 900;

    font-style: italic;

    letter-spacing: -4px;
}

.game-logo span {

    color: white;
}

.game-logo strong {

    color: var(--accent);

    text-shadow:
        0 0 35px
        rgba(54,231,180,.25);
}

.game-logo small {

    display: block;

    margin-top: 15px;

    color: #6d8294;

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 7px;
}

.menu-description {

    position: relative;

    max-width: 300px;

    margin:
        0 auto 28px;

    text-align: center;

    color: #8ea3b5;

    font-size: 13px;

    line-height: 1.6;
}


/* =========================================
   BUTTONS
========================================= */

.main-button {

    width: 100%;

    height: 52px;

    border-radius: 11px;

    color: #06120f;

    background:
        var(--accent);

    font-size: 13px;

    font-weight: 900;

    letter-spacing: 1.5px;

    box-shadow:
        0 8px 25px
        rgba(54,231,180,.15);

    transition:
        transform .15s,
        box-shadow .15s,
        filter .15s;
}

.main-button:hover {

    transform:
        translateY(-2px);

    box-shadow:
        0 12px 35px
        rgba(54,231,180,.25);

    filter:
        brightness(1.08);
}

.main-button:active {

    transform:
        translateY(1px);
}

.menu-row {

    display: flex;

    gap: 10px;

    margin-top: 10px;
}

.menu-button {

    min-height: 52px;

    flex: 1;

    padding: 8px 14px;

    border:
        1px solid
        rgba(255,255,255,.07);

    border-radius: 11px;

    color: #9db0bf;

    background:
        rgba(255,255,255,.035);

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 1px;

    transition: .2s;
}

.menu-button:hover {

    background:
        rgba(255,255,255,.08);

    color: white;

    border-color:
        rgba(255,255,255,.14);
}

.menu-button strong {

    display: block;

    margin-top: 5px;

    color: var(--accent);

    font-size: 10px;
}

.menu-button.wide {

    width: 100%;

    margin-top: 10px;
}

.version {

    margin-top: 25px;

    text-align: center;

    color: #405465;

    font-size: 8px;

    letter-spacing: 1.5px;
}


/* =========================================
   CONTROLS
========================================= */

.dialog-card h2 {

    text-align: center;

    margin-bottom: 26px;

    font-size: 23px;

    letter-spacing: 3px;
}

.control-item {

    display: flex;

    justify-content: space-between;

    align-items: center;

    min-height: 58px;

    padding: 10px 0;

    border-bottom:
        1px solid
        rgba(255,255,255,.05);

    color: #a5b6c4;

    font-size: 12px;
}

.keys {

    display: flex;

    gap: 5px;
}

kbd {

    min-width: 29px;

    height: 29px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    border-radius: 6px;

    background: #192b3b;

    border:
        1px solid
        #2a4052;

    color: white;

    font-size: 10px;

    font-weight: 800;

    box-shadow:
        0 3px 0
        #071019;
}

.mouse-icon {

    font-size: 23px;
}

.dialog-card .main-button {

    margin-top: 24px;
}


/* =========================================
   PAUSE
========================================= */

.pause-card {

    text-align: center;
}

.pause-icon {

    width: 58px;

    height: 58px;

    margin:
        0 auto 15px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    color: var(--accent);

    background:
        rgba(54,231,180,.08);

    font-size: 25px;
}

.pause-card h2 {

    margin-bottom: 22px;
}


/* =========================================
   GAME OVER
========================================= */

.result-icon {

    text-align: center;

    font-size: 54px;

    margin-bottom: 10px;
}

.result-title {

    text-align: center;

    font-size: 37px;

    font-weight: 900;

    letter-spacing: 3px;

    color: var(--accent);
}

.final-score {

    display: flex;

    justify-content: center;

    gap: 16px;

    margin: 22px 0;

    font-size: 45px;

    font-weight: 900;
}

.final-score span:first-child {

    color: var(--accent);
}

.final-score span:last-child {

    color: var(--accent-2);
}


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

@media (max-height: 650px) {

    .scoreboard {
        height: 60px;
    }

    #playerScore,
    #cpuScore {
        font-size: 32px;
    }

    .top-bar {
        height: 40px;
    }

    .bottom-bar {
        height: 27px;
    }
}

@media (max-width: 600px) {

    .game-wrapper {
        padding: 8px;
    }

    .top-controls {
        gap: 4px;
    }

    .small-button {
        padding: 7px;
        font-size: 9px;
    }

    .scoreboard {
        gap: 12px;
    }

    .player-score,
    .cpu-score {
        min-width: 70px;
    }

    .menu-card,
    .dialog-card {
        padding: 28px 22px;
    }
}