:root {
    --bg: #07060f;
    --panel: #120f24;
    --line: #2b2550;
    --text: #e9e6ff;
    --muted: #8d87b8;
    --neon: #33f0ff;
    --neon2: #ff3fa4;
    --good: #7cff6b;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: transparent;
    font-family: 'Courier New', monospace;
    color: var(--text);
    user-select: none;
    overflow: hidden;
}

#app {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
}
#app[hidden] { display: none; }

.cabinet {
    width: min(760px, 94vw);
    background: var(--panel);
    border: 2px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 0 40px rgba(51, 240, 255, 0.15);
    padding: 14px 18px 12px;
}

.marquee {
    text-align: center;
    font-size: 26px;
    font-weight: bold;
    letter-spacing: 10px;
    color: var(--neon);
    text-shadow: 0 0 10px var(--neon);
    margin-bottom: 12px;
}

.screen { display: none; }
.screen.active { display: block; }

#game-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    max-height: 62vh;
    overflow-y: auto;
}

.card {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.card h3 { margin: 0; color: var(--neon2); font-size: 17px; }
.card p { margin: 0; font-size: 12px; color: var(--muted); flex: 1; }
.card .keys { font-size: 11px; color: var(--muted); }
.card .scores { font-size: 11px; color: var(--good); }
.card .buttons { display: flex; gap: 6px; }

button {
    flex: 1;
    font-family: inherit;
    font-size: 13px;
    padding: 7px 8px;
    background: transparent;
    color: var(--neon);
    border: 1px solid var(--neon);
    border-radius: 5px;
    cursor: pointer;
}
button:hover { background: var(--neon); color: var(--bg); }
button.duo { color: var(--neon2); border-color: var(--neon2); }
button.duo:hover { background: var(--neon2); color: var(--bg); }

.screen-wrap { position: relative; }

canvas {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 70vh;
    background: #000;
    border-radius: 6px;
    image-rendering: pixelated;
}

#overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(5, 4, 12, 0.9);
    border-radius: 6px;
    text-align: center;
}
#overlay[hidden] { display: none; }

/* Bestenliste im Stil alter Automaten */
#hs { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hs-title { font-size: 22px; font-weight: bold; color: #ffe066; text-shadow: 0 0 8px #ff9a3a; letter-spacing: 2px; }
.hs-sub { font-size: 16px; color: #7cff6b; font-weight: bold; }
.hs-wait { font-size: 18px; color: var(--neon); }
.hs-help { font-size: 12px; color: var(--muted); }
.hs-entry { display: flex; gap: 14px; margin: 6px 0; }
.hs-entry span { width: 48px; height: 60px; display: flex; align-items: center; justify-content: center; font-size: 44px; font-weight: bold;
    color: #e9e6ff; border-bottom: 4px solid #4a4580; }
.hs-entry span.on { color: #ffe066; border-color: #ffe066; animation: blink 0.6s steps(2) infinite; }
.hs-list { display: flex; flex-direction: column; gap: 2px; font-size: 17px; font-weight: bold; white-space: pre; }
.hs-row { display: grid; grid-template-columns: 44px 70px 110px; color: var(--c); }
.hs-row span:last-child { text-align: right; }
.hs-row.mine { background: rgba(255, 255, 255, 0.12); animation: blink 0.8s steps(2) infinite; }

.center { text-align: center; padding: 50px 10px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.center button { flex: none; width: 180px; }
.big { font-size: 28px; font-weight: bold; color: var(--neon); text-shadow: 0 0 8px var(--neon); }
.muted { color: var(--muted); font-size: 13px; margin: 0; }
.hint { text-align: center; font-size: 12px; color: var(--muted); margin-top: 8px; }
.blink { animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }
