:root {
  --nacht: #141b2d;
  --karte: rgba(20, 27, 45, 0.92);
  --text: #f3f1ea;
  --gold: #ffb300;
  --gruen: #43a047;
  --rand: rgba(255, 255, 255, 0.14);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--nacht); color: var(--text);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
#welt { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; z-index: 0; }
#hud, #wort, #beute-text, #panel { z-index: 1; }

#hud { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 50%; transform: translateX(-50%);
  backdrop-filter: blur(6px);
  display: flex; gap: 14px; align-items: center; padding: 8px 16px; border-radius: 999px;
  background: var(--karte); border: 1px solid var(--rand); font-weight: 600; white-space: nowrap; max-width: calc(100% - 24px); }
#hud-zeit { color: var(--gold); font-variant-numeric: tabular-nums; }
#hud-zeit:empty { display: none; }

#wort { position: fixed; inset: 0; display: grid; place-items: center; background: var(--nacht);
  font-size: clamp(42px, 12vw, 96px); font-weight: 800; letter-spacing: 0.02em; }

#beute-text { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); transform: translateX(-50%);
  width: min(92%, 520px); padding: 14px 18px; border-radius: 16px; background: var(--karte); border: 1px solid var(--rand);
  text-align: center; }
#beute-text b { display: block; font-size: clamp(30px, 8vw, 48px); line-height: 1.1; }
#beute-text span { display: block; margin-top: 4px; color: #d7d3c8; }

#panel { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92%, 520px);
  max-height: calc(100% - 40px); overflow: auto; padding: 22px; border-radius: 18px;
  background: var(--karte); border: 1px solid var(--rand); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); }
#panel[hidden] { display: none; }
#panel h1 { margin: 0 0 10px; font-size: 28px; color: var(--gold); }
#panel h2 { margin: 0 0 8px; font-size: 21px; }
#panel p { margin: 0 0 12px; }
.frage { font-size: 19px; font-weight: 600; }
.klein { font-size: 14px; color: #b9b5aa; }
.gross { font-size: 40px; font-weight: 800; text-align: center; color: var(--gold); }

.knoepfe { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
button { flex: 1 1 auto; min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--rand);
  background: #26304a; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
button.haupt { background: var(--gold); color: #1b2631; border-color: transparent; }
button:active { transform: scale(0.98); }

input { width: 100%; min-height: 52px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--rand);
  background: #0f1524; color: var(--text); font: inherit; font-size: 22px; }
input:focus { outline: 2px solid var(--gold); }

.liste { margin: 10px 0; padding-left: 26px; }
.liste li { padding: 3px 0; }
.liste li span { display: inline-block; width: 1.4em; }
.liste li em { float: right; font-style: normal; color: #b9b5aa; }
.liste li.ok { color: #8bd48e; }
.liste li.halb { color: #ffd54a; }

/* Mini-Karte */
#karte { position: fixed; z-index: 1; right: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  width: 170px; height: 116px; border-radius: 10px; background: rgba(20, 27, 45, 0.85); border: 1px solid var(--rand); }

/* Symbole */
.mitte { text-align: center; }
.sym { display: block; font-size: 30px; line-height: 1.1; }
.unter { display: block; font-size: 13px; font-weight: 500; color: #cfcabd; }
.schritte { display: flex; gap: 6px; list-style: none; padding: 0; margin: 14px 0; counter-reset: s; }
.schritte li { flex: 1; text-align: center; position: relative; }
.schritte li + li::before { content: "›"; position: absolute; left: -6px; top: 6px; color: var(--gold); font-size: 20px; }
.knoepfe.symbole button { padding: 10px 8px; }
.route { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0 4px; font-size: 26px; }
.route span { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.1; }
.route small { font-size: 11px; color: var(--gold); font-weight: 700; }
#panel button { font-size: 20px; }
#ab-pass { flex: 0 0 72px; font-size: 26px; }

/* Abruf-Fortschritt */
.punkte { display: flex; gap: 6px; justify-content: center; margin: 4px 0 10px; }
.punkte i { width: 12px; height: 12px; border-radius: 50%; background: #3a4560; }
.punkte i.voll { background: var(--gold); }
.punkte i.jetzt { background: transparent; outline: 2px solid var(--gold); }

/* Ergebnis */
.saecke { display: flex; flex-wrap: nowrap; gap: 2px; justify-content: center; font-size: min(28px, calc((100vw - 80px) / 14)); }
.saecke span { position: relative; }
.saecke span.leer { opacity: 0.3; filter: grayscale(1); }
.saecke span.stern::after { content: "⭐"; position: absolute; right: -4px; top: -6px; font-size: 14px; }
.gross small { font-size: 24px; color: var(--text); margin-left: 8px; }
details { margin: 6px 0; }
summary { cursor: pointer; color: #b9b5aa; font-size: 14px; text-align: center; }

/* ---- Heist-Look ---- */
:root { --glas: rgba(14, 20, 38, 0.82); }
#panel { background: var(--glas); backdrop-filter: blur(10px); border: 1px solid rgba(255, 179, 0, 0.28);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset; animation: rein 0.28s ease-out; }
@keyframes rein { from { opacity: 0; transform: translate(-50%, -46%) scale(0.97); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
#panel h1 { font-size: 34px; letter-spacing: 0.01em; background: linear-gradient(90deg, #ffd54a, #ff9a3c); -webkit-background-clip: text; background-clip: text; color: transparent; }
button { transition: transform 0.08s, background 0.15s, box-shadow 0.15s; }
button:hover { background: #313d5e; }
button.haupt { background: linear-gradient(180deg, #ffc533, #ff9f1a); box-shadow: 0 4px 0 #b36b00, 0 8px 18px rgba(255, 159, 26, 0.3); }
button.haupt:hover { background: linear-gradient(180deg, #ffd04f, #ffab33); }
button.haupt:active { transform: translateY(3px); box-shadow: 0 1px 0 #b36b00; }
#hud { background: var(--glas); border-color: rgba(255, 179, 0, 0.3); }
#hud.pop { animation: pop 0.45s ease-out; }
@keyframes pop { 0% { transform: translateX(-50%) scale(1); } 35% { transform: translateX(-50%) scale(1.22); background: #ffb300; color: #1b2631; } 100% { transform: translateX(-50%) scale(1); } }
#hud.pop #hud-zeit { color: inherit; }
#wort { background: radial-gradient(circle at 50% 45%, #1d2a4d, var(--nacht) 70%); }
#beute-text { background: var(--glas); backdrop-filter: blur(8px); }

#blitz { position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0; }
#blitz.an { animation: blitz 0.6s ease-out; }
@keyframes blitz { 0% { opacity: 1; } 100% { opacity: 0; } }
#meldung { position: fixed; z-index: 4; left: 50%; top: 38%; transform: translate(-50%, -50%); pointer-events: none;
  font-size: clamp(36px, 11vw, 80px); font-weight: 900; color: #ff5a5a; text-shadow: 0 4px 0 #5c0f0f, 0 0 30px rgba(255, 60, 60, 0.6); white-space: nowrap; }
#meldung.zeigen { animation: meldung 1.1s ease-out; }
@keyframes meldung { 0% { transform: translate(-50%, -50%) scale(0.4) rotate(-6deg); opacity: 0; } 25% { transform: translate(-50%, -50%) scale(1.15) rotate(2deg); opacity: 1; } 100% { transform: translate(-50%, -60%) scale(1); opacity: 0.9; } }
#konfetti { position: fixed; inset: 0; z-index: 5; pointer-events: none; width: 100%; height: 100%; }
#ton { position: fixed; z-index: 2; top: calc(env(safe-area-inset-top, 0px) + 10px); right: 10px; flex: none; min-height: 40px; width: 40px; padding: 0;
  border-radius: 50%; background: var(--glas); font-size: 18px; }
.rang { margin: 0 0 6px; text-align: center; font-size: 26px; font-weight: 800; color: var(--gold); }
@media (prefers-reduced-motion: reduce) { #panel, #hud.pop, #meldung.zeigen { animation: none; } }
