@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --black: #050505;
    --dark: #0b0b0b;
    --dark-soft: #121212;

    --gold: #d4af37;
    --gold-light: #f1cc60;
    --gold-dark: #8d711d;

    --white: #ffffff;
    --gray: #9b9b9b;

    --border: rgba(212, 175, 55, 0.18);

    --transition: 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;

    font-family: "Exo 2", sans-serif;

    background:
        radial-gradient(
            circle at 50% 20%,
            rgba(212, 175, 55, 0.08),
            transparent 35%
        ),
        var(--black);

    color: var(--white);

    overflow-x: hidden;
}

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

button {
    font: inherit;
}


/* =========================
   FONDO
   ========================= */

.background-glow {
    position: fixed;

    width: 700px;
    height: 700px;

    left: 50%;
    top: 40%;

    transform: translate(-50%, -50%);

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(212, 175, 55, 0.09),
            rgba(212, 175, 55, 0.02) 40%,
            transparent 70%
        );

    pointer-events: none;

    animation: backgroundPulse 6s ease-in-out infinite;
}

@keyframes backgroundPulse {

    0%,
    100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.08);
    }
}


/* =========================
   HEADER
   ========================= */

.game-header {
    width: 100%;
    max-width: 1250px;

    margin: auto;

    padding: 25px 35px;

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

    position: relative;

    z-index: 5;
}


/* Marca */

.brand {
    display: flex;
    align-items: center;

    gap: 15px;
}

.brand img {
    width: 55px;

    filter:
        drop-shadow(0 0 10px rgba(212, 175, 55, 0.25));
}

.brand span {
    color: var(--gold);

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 3px;
}

.brand p {
    margin-top: 2px;

    font-size: 18px;

    font-weight: 800;

    letter-spacing: 1px;
}


/* Volver */

.back-button {
    padding: 10px 16px;

    color: var(--gray);

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

    border-radius: 4px;

    font-size: 12px;

    font-weight: 600;

    transition: var(--transition);
}

.back-button:hover {
    color: var(--gold);

    border-color: rgba(212, 175, 55, 0.4);

    background: rgba(212, 175, 55, 0.03);

    transform: translateX(-3px);
}


/* =========================
   WRAPPER
   ========================= */

.game-wrapper {
    width: 100%;

    min-height: calc(100vh - 160px);

    padding: 25px 20px 60px;

    display: flex;

    justify-content: center;

    position: relative;

    z-index: 2;
}


/* =========================
   PANEL
   ========================= */

.game-panel {
    width: 100%;

    max-width: 760px;
}


/* =========================
   INFO
   ========================= */

.game-info {
    margin-bottom: 22px;

    display: grid;

    grid-template-columns: 1fr auto 1fr;

    align-items: end;

    gap: 25px;
}


/* Scores */

.score-box {
    display: flex;

    flex-direction: column;
}

.score-box:last-child {
    text-align: right;
}

.score-box span {
    margin-bottom: 4px;

    color: var(--gray);

    font-size: 9px;

    font-weight: 700;

    letter-spacing: 2px;
}

.score-box strong {
    color: var(--gold);

    font-size: 31px;

    font-weight: 800;

    line-height: 1;
}


/* Título */

.game-title {
    text-align: center;
}

.game-title span {
    color: var(--gold);

    font-size: 11px;

    font-weight: 700;

    letter-spacing: 6px;
}

.game-title h1 {
    margin-top: -2px;

    font-size: 34px;

    line-height: 1;

    font-weight: 900;

    letter-spacing: 3px;
}


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

.canvas-container {
    width: 100%;

    aspect-ratio: 1 / 1;

    position: relative;

    overflow: hidden;

    border: 1px solid rgba(212, 175, 55, 0.22);

    border-radius: 7px;

    background: #050505;

    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.015),
        0 30px 80px rgba(0, 0, 0, 0.45),
        0 0 35px rgba(212, 175, 55, 0.04);
}


/* Línea dorada superior */

.canvas-container::before {
    content: "";

    position: absolute;

    z-index: 4;

    top: 0;
    left: 15%;

    width: 70%;
    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            var(--gold),
            transparent
        );

    box-shadow:
        0 0 10px rgba(212, 175, 55, 0.25);
}


/* Canvas */

canvas {
    width: 100%;
    height: 100%;

    display: block;

    background:
        linear-gradient(
            rgba(255, 255, 255, 0.015) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.015) 1px,
            transparent 1px
        ),
        #050505;

    background-size: 30px 30px;
}


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

.game-overlay {
    position: absolute;

    inset: 0;

    z-index: 10;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    padding: 40px;

    text-align: center;

    background:
        radial-gradient(
            circle at center,
            rgba(212, 175, 55, 0.08),
            transparent 45%
        ),
        rgba(3, 3, 3, 0.93);

    backdrop-filter: blur(4px);

    transition:
        opacity 0.4s ease,
        visibility 0.4s ease;
}

.game-overlay.hidden {
    opacity: 0;

    visibility: hidden;

    pointer-events: none;
}


/* Logo */

.game-overlay img {
    width: 110px;

    margin-bottom: 22px;

    filter:
        drop-shadow(0 0 15px rgba(212, 175, 55, 0.3));

    animation: novaFloat 3s ease-in-out infinite;
}

@keyframes novaFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }

}


/* Texto */

.game-overlay h2 {
    margin-bottom: 15px;

    font-size: clamp(35px, 7vw, 58px);

    line-height: 1;

    font-weight: 900;

    letter-spacing: 3px;
}

.game-overlay > p:not(.game-over-label) {
    margin-bottom: 32px;

    color: var(--gray);

    font-size: 15px;

    line-height: 1.8;
}


/* Botón */

.game-overlay button {
    min-width: 210px;

    padding: 14px 24px;

    cursor: pointer;

    color: #050505;

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

    border-radius: 3px;

    background:
        linear-gradient(
            135deg,
            var(--gold-light),
            var(--gold),
            #a88625
        );

    font-size: 12px;

    font-weight: 800;

    letter-spacing: 1px;

    box-shadow:
        0 0 25px rgba(212, 175, 55, 0.1);

    transition: var(--transition);
}

.game-overlay button:hover {
    transform: translateY(-3px);

    box-shadow:
        0 0 25px rgba(212, 175, 55, 0.28),
        0 12px 30px rgba(0, 0, 0, 0.4);
}


/* Controles debajo del botón */

.game-overlay > span {
    margin-top: 22px;

    color: #666;

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 2px;
}


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

.game-over-label {
    margin-bottom: 12px;

    color: var(--gold);

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 4px;
}

.final-score {
    margin: 8px 0 30px;

    display: flex;

    flex-direction: column;

    align-items: center;
}

.final-score span {
    color: var(--gray);

    font-size: 9px;

    font-weight: 700;

    letter-spacing: 2px;
}

.final-score strong {
    margin-top: 3px;

    color: var(--gold);

    font-size: 48px;

    line-height: 1;

    font-weight: 900;
}


/* =========================
   CONTROLES
   ========================= */

.controls-info {
    margin-top: 20px;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 15px;

    color: #555;
}

.controls-info div {
    display: flex;

    gap: 5px;
}

.controls-info span {
    font-size: 11px;

    text-transform: uppercase;
}

kbd {
    min-width: 30px;
    height: 30px;

    padding: 0 7px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    color: #b8b8b8;

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

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

    border-radius: 4px;

    background:
        linear-gradient(
            180deg,
            #171717,
            #0d0d0d
        );

    font-size: 11px;

    font-family: inherit;

    box-shadow:
        0 2px 0 #000;
}


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

footer {
    padding: 20px 20px 35px;

    position: relative;

    z-index: 2;

    text-align: center;
}

footer span {
    color: #555;

    font-size: 9px;

    font-weight: 700;

    letter-spacing: 3px;
}

footer p {
    margin-top: 3px;

    color: var(--gold);

    font-size: 8px;

    font-weight: 700;

    letter-spacing: 3px;
}


/* =========================
   SELECCIÓN
   ========================= */

::selection {
    background: var(--gold);

    color: var(--black);
}


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

@media (max-width: 700px) {

    .game-header {
        padding: 18px 20px;
    }

    .brand img {
        width: 45px;
    }

    .brand span {
        font-size: 8px;
    }

    .brand p {
        font-size: 15px;
    }

    .game-wrapper {
        padding-top: 15px;
    }

    .game-info {
        gap: 10px;
    }

    .score-box strong {
        font-size: 25px;
    }

    .game-title h1 {
        font-size: 27px;
    }

    .game-title span {
        font-size: 9px;

        letter-spacing: 4px;
    }

}


@media (max-width: 480px) {

    .back-button {
        font-size: 0;
    }

    .back-button::after {
        content: "←";

        font-size: 17px;
    }

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

        align-items: center;
    }

    .game-title {
        grid-column: 1 / -1;

        grid-row: 1;

        margin-bottom: 12px;
    }

    .score-box {
        grid-row: 2;
    }

    .game-overlay {
        padding: 25px;
    }

    .game-overlay img {
        width: 85px;
    }

    .game-overlay h2 {
        font-size: 35px;
    }

    .controls-info {
        gap: 8px;
    }

    kbd {
        min-width: 27px;
        height: 27px;

        padding: 0 5px;

        font-size: 10px;
    }

}