:root {
    --bg: #0d0b1a;
    --fg: #e9e4ff;
    --muted: #8f87b3;
    --accent: #ffcf4a;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--fg);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    overscroll-behavior: none;
}

.loading {
    display: grid;
    place-items: center;
    height: 100vh;
    color: var(--muted);
}

.game-wrap {
    max-width: 800px;
    margin: 0 auto;
    padding: 12px 8px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.game-canvas {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 4 / 3;
    height: auto;
    display: block;
    border-radius: 10px;
    box-shadow: 0 0 0 1px #2a2450, 0 12px 40px rgba(0, 0, 0, .5);
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.help {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    line-height: 1.8;
}

kbd {
    font-family: inherit;
    font-size: 12px;
    padding: 1px 6px;
    border: 1px solid #3a3366;
    border-bottom-width: 2px;
    border-radius: 4px;
    background: #1a1633;
    color: var(--fg);
}

/* ---------- Touch-Steuerung (nur auf Touchgeräten) ---------- */

.touch-controls {
    display: none;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.tc-group { display: flex; gap: 12px; }

.tc {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 2px solid #3a3366;
    background: #1a1633;
    color: var(--fg);
    font-size: 26px;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

.tc-flap {
    width: 120px;
    border-radius: 38px;
    font-size: 17px;
    font-weight: 700;
    border-color: #6b5a1a;
    color: var(--accent);
}

.tc.pressed { background: #2c2655; transform: scale(.96); }

@media (pointer: coarse) {
    .touch-controls { display: flex; }
    .help { display: none; }
}

/* ---------- Blazor-Fehleranzeige ---------- */

#blazor-error-ui {
    background: #5c1020;
    color: #fff;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
    padding: .6rem 1.25rem;
    position: fixed;
    z-index: 1000;
}

#blazor-error-ui a { color: #ffd; margin-left: .75rem; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

.notfound { padding: 2rem; text-align: center; }
