* { box-sizing: border-box; }

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

#app { text-align: center; padding: 16px; }

h1 { margin: 0 0 16px; font-size: 1.1rem; letter-spacing: 0.05em; color: #feae34; }
h1 span { color: #5a6988; font-size: 0.6rem; }

canvas {
    display: block;
    margin: 0 auto;
    /* Nearest-neighbor upscaling: each game pixel stays a sharp square */
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    border: 4px solid #333c57;
    box-shadow: 0 0 0 4px #1a1c2c, 0 0 0 8px #5a6988;
    cursor: none; /* replaced by the in-game pixel crosshair */
    touch-action: none; /* no scroll / pinch zoom on touch screens: the canvas handles touches */
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

#fullscreen {
    padding: 2px 6px;
    border: 2px solid #5a6988;
    background: #333c57;
    color: #f4f4f4;
    font-family: inherit;
    font-size: 0.55rem;
    cursor: pointer;
}
#fullscreen:hover { background: #5a6988; }

/* Compact mode (phones, small windows, fullscreen): the canvas fills the window */
body.compact { display: block; min-height: 100dvh; overflow: hidden; }
body.compact #app { padding: 0; width: 100vw; height: 100dvh; display: flex; align-items: center; justify-content: center; }
body.compact h1, body.compact .hint { display: none; }
body.compact canvas { border: none; box-shadow: none; }

/* License key prompt (locked web edition) */
#license-box {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(26, 28, 44, 0.92);
    color: #f4f4f4;
    font-size: 0.65rem;
}
#license-box input {
    width: min(90vw, 420px);
    padding: 8px;
    border: 2px solid #5a6988;
    background: #333c57;
    color: #feae34;
    font-family: inherit;
    font-size: 0.65rem;
}
#license-box button { margin: 0 6px; padding: 6px 10px; border: 2px solid #5a6988; background: #333c57; color: #f4f4f4; font-family: inherit; font-size: 0.6rem; cursor: pointer; }
#license-box button:hover { background: #5a6988; }
#license-box.gate { gap: 10px; text-align: center; padding: 20px; }
#license-box.gate p { margin: 0; max-width: 460px; line-height: 1.8; }
#license-box.gate .error { color: #e43b44; }
#license-box.gate .or { color: #8b9bb4; margin-top: 14px; }
#license-box.gate button.primary { background: #feae34; color: #1a1c2c; border-color: #ffcd75; }
#license-box.gate .button { display: inline-block; margin: 4px 6px; padding: 8px 12px; border: 2px solid #5a6988; background: #333c57; color: #f4f4f4; text-decoration: none; font-size: 0.6rem; }
#license-box.gate .button:hover { background: #5a6988; }

/* Portrait phone: ask to rotate */
#rotate {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.8;
    background: #1a1c2c;
    color: #feae34;
}
@media (orientation: portrait) and (max-width: 900px) and (pointer: coarse) {
    #rotate { display: flex; }
}

.hint { margin-top: 20px; font-size: 0.55rem; line-height: 2; color: #8b9bb4; }

kbd {
    padding: 2px 6px;
    border: 2px solid #5a6988;
    background: #333c57;
    color: #f4f4f4;
    font-family: inherit;
    font-size: 0.55rem;
}
