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

html, body {
    background: #0F0A05;
}

body {
    font-family: 'Space Mono', monospace;
    color: #F2EDD7;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 12px 16px;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70vmin;
    height: 70vmin;
    background-image: url('../../../images/logo-badge-transparent.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.06;
    pointer-events: none;
    z-index: 0;
}

.home-logo {
    position: fixed;
    top: 16px;
    left: 16px;
    opacity: 0.6;
    transition: opacity 0.2s;
    display: block;
    z-index: 10;
}
.home-logo:hover { opacity: 1; }
.home-logo img {
    height: 36px;
    width: auto;
    display: block;
}

.game-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: min(520px, calc(100vw - 32px), calc((100vh - 110px) * 0.75));
    width: min(520px, calc(100vw - 32px), calc((100dvh - 110px) * 0.75));
}

#game-hud {
    background: #0F3347;
    border: 3px solid #E8C84A;
    border-bottom: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 2px 10px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.hud-item { color: #9fb8c4; white-space: nowrap; }
.hud-item span { color: #F2EDD7; margin-left: 3px; }
.hud-hi span { color: #E8C84A; }
.hud-bonus span { color: #D4694A; }

.arcade-cabinet {
    background: #000;
    border: 3px solid #E8C84A;
    box-shadow: 0 0 22px rgba(212, 105, 74, 0.45);
    line-height: 0;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    touch-action: none;
}

.help {
    margin-top: 8px;
    font-size: 11px;
    color: #9fb8c4;
    text-align: center;
}

/* ---- Touch controls (shown on touch devices) ---- */
#touch-controls {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 12px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
body.touch #touch-controls { display: flex; }
body.touch .help { display: none; }

.dpad {
    display: grid;
    grid-template-columns: repeat(3, 52px);
    grid-template-rows: repeat(3, 40px);
    gap: 4px;
}
.tc {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: #F2EDD7;
    background: #1B4F6B;
    border: 2px solid #E8C84A;
    border-radius: 6px;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}
.tc.on { background: #D4694A; }
.tc-up    { grid-column: 2; grid-row: 1; }
.tc-left  { grid-column: 1; grid-row: 2; }
.tc-right { grid-column: 3; grid-row: 2; }
.tc-down  { grid-column: 2; grid-row: 3; }
.tc-sound { grid-column: 3; grid-row: 1; font-size: 9px; }
.tc-jump {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    font-size: 15px;
    background: #A8442A;
}
