@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&amp;display=swap");

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

html,
body {
    width: 100%;
    height: 100%;
}

body {
    background: #1a1a2e;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: "Press Start 2P", monospace;
}

#gameWrapper {
    position: relative;
    width: 360px;
    height: 640px;
    overflow: hidden;
    border: 3px solid #444;
    border-radius: 24px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

/* Pantalla vertical (portrait): ancho completo sin márgenes */

@media (orientation: portrait) {
    body {
        margin: 0;
        padding: 0;
        overflow: hidden;
    }
    #gameWrapper {
        width: 100vw;
        height: 100dvh;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

#ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

/* HUD score */

#hud {
    position: absolute;
    top: 16px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 16px;
}

.score-box {
    background: rgba(0, 0, 0, 0.55);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 6px 10px;
    color: #fff;
    font-size: 8px;
    line-height: 1.6;
}

.score-box span {
    color: #ffe94e;
}

/* Overlay */

#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: center;
    margin-top: 5em;
    gap: 20px;
    pointer-events: all;
}

#overlay.hidden {
    display: none;
}

.overlay-panel {
    background-color: #000;
    border-radius: 10px;
    padding: 28px 32px;
    text-align: center;
    min-width: 260px;
}

#overlay h1 {
    font-size: 20px;
    color: #ffe94e;
    text-shadow: 3px 3px 0 #b8860b;
    margin-bottom: 6px;
    letter-spacing: 2px;
}

#overlay .subtitle {
    font-size: 7px;
    color: #aaa;
    margin-bottom: 24px;
}

.scores-row {
    display: flex;
    justify-content: space-around;
    margin-bottom: 24px;
    gap: 16px;
}

.score-item {
    font-size: 7px;
    color: #ccc;
    line-height: 2;
}

.score-item b {
    color: #ffe94e;
    font-size: 14px;
    display: block;
}

#btnStart {
    font-family: "Press Start 2P", monospace;
    font-size: 11px;
    background: #ffe94e;
    color: #1a1a2e;
    border: none;
    border-radius: 6px;
    padding: 12px 28px;
    cursor: pointer;
    box-shadow: 0 4px 0 #b8860b;
    transition:
        transform 0.1s,
        box-shadow 0.1s;
    pointer-events: all;
}

#btnStart:active {
    transform: translateY(4px);
    box-shadow: none;
}

#btnStart:hover {
    background: #fff176;
}

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.hint {
    font-size: 6px;
    color: #666;
    margin-top: 10px;
}