* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
    margin: 0; height: 100%; height: 100dvh; overflow: hidden;
    background: #000; color: #fff;
    font-family: Arial, sans-serif;
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
    touch-action: none; overscroll-behavior: none;
}
[hidden] { display: none !important; }

/* 100dvh statt 100%/inset:0 als Höhe: auf dem iPhone bleibt sonst so viel Platz reserviert, wie OHNE
   Safari-Leiste da wäre, und die Leiste schneidet den oberen Teil einfach ab (Ida&Odo main.js gleicht das
   zusätzlich per window.visualViewport aus, siehe dort — Vollbild ganz ohne Leiste geht auf dem iPhone nur
   über "Zum Home-Bildschirm" mit den apple-mobile-web-app-*-Metatags in index.html). */
#stage { position: fixed; top: 0; left: 0; width: 100%; height: 100%; height: 100dvh; }
.screen { position: absolute; inset: 0; }

.btn {
    font: bold 20px Arial, sans-serif;
    padding: 14px 34px;
    border: none; border-radius: 10px;
    background: #ffcc00; color: #000;
    box-shadow: 0 4px #aa8800;
    cursor: pointer;
}
.btn:active { box-shadow: none; transform: translateY(4px); }
.btn-quiet { background: transparent; color: #ffcc00; box-shadow: none; border: 2px solid #ffcc00; }

/* Ton an/aus: nur ausserhalb der Runde sichtbar (siehe show() in main.js), wie bei Rechnen/Sentenced */
#sound-toggle {
    position: absolute; top: 10px; left: 10px; z-index: 30;
    width: 36px; height: 36px; padding: 0;
    border: 2px solid #ffcc00; border-radius: 50%;
    background: rgba(0, 0, 0, .55); color: #fff;
    font-size: 17px; line-height: 1; cursor: pointer;
}
#sound-toggle.off { opacity: .6; }

/* Sprachumschalter: oben rechts, wie Ton-Knopf nur zwischen den Runden sichtbar (wie bei Rechnen/Sentenced) */
#lang-switch {
    position: absolute; top: 10px; right: 10px; z-index: 30;
    display: flex; border: 2px solid #ffcc00; border-radius: 16px; overflow: hidden;
    background: rgba(0, 0, 0, .55);
}
.lang-btn {
    font: bold 14px Arial, sans-serif; letter-spacing: .04em;
    padding: 6px 12px; border: 0; background: transparent; color: #ffcc00; cursor: pointer;
}
.lang-btn.active { background: #ffcc00; color: #000; }

/* ── Bitte drehen ── */
#rotate-hint {
    position: fixed; inset: 0; z-index: 100;
    display: none; flex-direction: column; align-items: center; justify-content: center;
    background: #000; text-align: center; padding: 0 30px;
}
#rotate-hint .phone { font-size: 54px; animation: rotate-nudge 1.6s ease-in-out infinite; margin-bottom: 18px; }
#rotate-hint p { color: #ffcc00; font: bold 17px Arial, sans-serif; line-height: 1.5; margin: 0; }
@keyframes rotate-nudge { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(90deg); } }
/* schmal + hoch = Hochformat: Spiel sperren (Querformat-taugliche Breite reicht sonst) */
@media (max-aspect-ratio: 1/1) {
    #rotate-hint { display: flex; }
    #stage { display: none; }
}

/* ── Start / Ende (Hochformat-tauglich, da vor/nach dem Drehen sichtbar sein koennen) ── */
#start-screen, #result-screen {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 24px; text-align: center; gap: 14px;
}
#start-screen h1, #result-screen h2 { color: #ffcc00; margin: 0; line-height: 1.15; }
#start-screen h1 { font-size: 26px; }
#start-screen h1 .hl { font-size: 36px; display: block; }
#result-screen h2 { font-size: 30px; }
#start-screen .info { opacity: .8; font-size: 15px; line-height: 1.5; max-width: 420px; margin: 0 0 6px; }
.best-line { color: #ffcc00; font-size: 14px; opacity: .85; }
.ios-hint { color: #999; font-size: 13px; line-height: 1.4; max-width: 320px; margin-top: 10px; }
.build-tag { color: #555; font-size: 11px; margin-top: 14px; }
.big-time { font: 900 56px 'Arial Black', Arial, sans-serif; color: #ffcc00; margin: 4px 0; }
.big-time small { font-size: 20px; color: #fff; }
.new-best { color: #6bffa0; font-weight: bold; font-size: 17px; margin: 0; }

/* ── Runde ── */
#game-screen { background: #000; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#hud {
    position: absolute; top: 0; left: 0; right: 0; z-index: 5;
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; pointer-events: none;
}
#hud > * { pointer-events: auto; }
#quit-button {
    width: 34px; height: 34px; padding: 0;
    border: 2px solid rgba(255, 255, 255, .5); border-radius: 50%;
    background: rgba(0, 0, 0, .45); color: #fff;
    font-size: 15px; line-height: 1; cursor: pointer;
}
#odo-count, #gift-count, #timer {
    font: bold 18px Arial, sans-serif; color: #ffcc00;
    background: rgba(0, 0, 0, .45); border-radius: 10px; padding: 5px 12px;
    text-shadow: 0 1px 2px #000;
}
.odo-icon { height: 22px; width: auto; vertical-align: middle; margin-bottom: 2px; }
#toast {
    position: absolute; top: 44%; left: 50%; transform: translate(-50%, -50%);
    font: 900 30px 'Arial Black', Arial, sans-serif; color: #ffcc00;
    text-shadow: 0 3px 0 #000; z-index: 6; pointer-events: none;
    animation: toast-pop .5s ease-out both;
}
@keyframes toast-pop { from { transform: translate(-50%, -50%) scale(.4); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }

/* Odo rufen: erscheint nur, wenn man direkt vor dem Schutthaufen steht */
#call-odo-button {
    position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%);
    z-index: 6; font-size: 16px; padding: 12px 22px;
    animation: toast-pop .3s ease-out both;
}
