/* ============================================================
   Mc Doooonels – Der Weg des Cheeseburgers
   Oberfläche (alles über dem 3D-Bild)
   ============================================================ */

:root {
  --rot: #b3202a;
  --rot-dunkel: #7d141c;
  --gold: #f5b70a;
  --gold-hell: #ffd34d;
  --glas: rgba(255, 255, 255, 0.92);
  --text: #1d1d1f;
  --blau: #4fc3f7;
  --gruen: #2e9d4f;
  --schatten: 0 10px 30px rgba(0, 0, 0, 0.25);
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; height: 100%; overflow: hidden; background: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  overscroll-behavior: none;
}

#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#ui { position: fixed; inset: 0; pointer-events: none; }
#ui button, #ui .clickable { pointer-events: auto; }

/* ---------- Kopfzeile ---------- */
#hud {
  position: absolute; top: calc(10px + var(--safe-top)); left: 12px; right: 12px;
  display: flex; align-items: center; gap: 10px; opacity: 0; transition: opacity .4s;
}
#hud.show { opacity: 1; }
#progress {
  background: var(--glas); border-radius: 999px; padding: 6px 14px 6px 8px;
  display: flex; align-items: center; gap: 10px; box-shadow: var(--schatten);
  font-weight: 700; font-size: 15px;
}
#progress .ing { font-size: 22px; line-height: 1; }
#progress .bar { width: 120px; height: 8px; border-radius: 4px; background: #e3e3e3; overflow: hidden; }
#progress .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--rot)); transition: width .25s; }
#progress small { font-weight: 600; color: #666; }
#burgerDots { display: flex; gap: 4px; margin-left: 4px; }
#burgerDots span { width: 10px; height: 10px; border-radius: 50%; background: #ddd; }
#burgerDots span.done { background: var(--gold); }
#burgerDots span.now { background: var(--rot); }
.spacer { flex: 1; }

.btn {
  border: 0; border-radius: 999px; padding: 12px 22px; font: inherit; font-weight: 800; font-size: 17px;
  background: var(--rot); color: #fff; box-shadow: 0 4px 0 var(--rot-dunkel), var(--schatten);
  cursor: pointer; transition: transform .08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--rot-dunkel); }
.btn.gold { background: var(--gold); color: #3a2a00; box-shadow: 0 4px 0 #b07f00, var(--schatten); }
.btn.hell { background: var(--glas); color: var(--text); box-shadow: 0 3px 0 #bbb, var(--schatten); }
.btn.klein { padding: 8px 14px; font-size: 14px; }
#skipBtn { display: none; }
body.praesentation #skipBtn { display: inline-block; }

/* ---------- Aufgabenhinweis ---------- */
#hint {
  position: absolute; top: calc(64px + var(--safe-top)); left: 50%; transform: translate(-50%, -10px);
  background: rgba(20, 20, 20, 0.78); color: #fff; border-radius: 999px; padding: 10px 20px;
  font-weight: 700; font-size: 18px; opacity: 0; transition: opacity .3s, transform .3s; white-space: nowrap;
  display: flex; align-items: center; gap: 10px; max-width: 92vw;
}
#hint.show { opacity: 1; transform: translate(-50%, 0); }
#hint .ico { font-size: 24px; }

/* ---------- Mini-Spiel-Widgets ---------- */
#layer { position: absolute; inset: 0; }

.gauge {
  position: absolute; background: var(--glas); border-radius: 14px; padding: 10px; box-shadow: var(--schatten);
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 800; font-size: 14px;
}
.gauge .track { position: relative; background: #ddd; border-radius: 8px; overflow: hidden; }
.gauge.v .track { width: 26px; height: 220px; }
.gauge.h .track { width: 300px; height: 26px; }
.gauge .zone { position: absolute; opacity: .85; }
.gauge .fill { position: absolute; left: 0; bottom: 0; background: rgba(0,0,0,.25); }
.gauge .needle { position: absolute; background: #111; box-shadow: 0 0 0 2px #fff; border-radius: 2px; }
.gauge.v .needle { left: -4px; right: -4px; height: 5px; }
.gauge.h .needle { top: -4px; bottom: -4px; width: 5px; }
.gauge .val { font-variant-numeric: tabular-nums; }

.counter {
  position: absolute; top: calc(64px + var(--safe-top)); right: 16px; background: var(--glas); border-radius: 14px;
  padding: 8px 14px; font-weight: 900; font-size: 22px; box-shadow: var(--schatten); font-variant-numeric: tabular-nums;
}
.counter small { display: block; font-size: 11px; font-weight: 700; color: #666; text-transform: uppercase; letter-spacing: .05em; }

.bigbtn {
  position: absolute; width: 130px; height: 130px; border-radius: 50%; border: 0;
  background: radial-gradient(circle at 35% 30%, #ff6b6b, var(--rot) 60%, var(--rot-dunkel));
  color: #fff; font: inherit; font-weight: 900; font-size: 18px; box-shadow: 0 8px 0 #5a0d13, var(--schatten);
  pointer-events: auto; touch-action: none;
}
.bigbtn.gold { background: radial-gradient(circle at 35% 30%, #ffe27a, var(--gold) 60%, #b07f00); color: #3a2a00; box-shadow: 0 8px 0 #7a5800, var(--schatten); }
.bigbtn:active, .bigbtn.down { transform: translateY(5px); box-shadow: 0 3px 0 #5a0d13, var(--schatten); }

.ringprog { position: absolute; pointer-events: none; }

.chips { position: absolute; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.chip {
  background: var(--glas); border-radius: 14px; padding: 10px 14px; font-weight: 800; font-size: 16px;
  box-shadow: var(--schatten); border: 3px solid transparent; pointer-events: auto; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 84px;
}
.chip .e { font-size: 30px; }
.chip.ok { border-color: var(--gruen); opacity: .55; }
.chip.bad { animation: shake .35s; border-color: var(--rot); }
.chip.off { opacity: .35; pointer-events: none; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

.label3d {
  position: absolute; transform: translate(-50%, -100%); background: var(--glas); border-radius: 10px;
  padding: 4px 10px; font-weight: 800; font-size: 14px; box-shadow: var(--schatten); white-space: nowrap;
}

/* ---------- Toast ---------- */
.toast {
  position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%) scale(.6);
  font-size: 44px; font-weight: 900; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.35), 0 0 20px rgba(0,0,0,.35);
  opacity: 0; animation: toast 1.1s ease-out forwards; white-space: nowrap;
}
.toast.bad { color: #ffb3b3; }
@keyframes toast {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  70% { opacity: 1; transform: translate(-50%, -60%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(1); }
}

/* ---------- Dialog (Sprechblase) ---------- */
#dialog {
  position: absolute; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translate(-50%, 30px);
  width: min(720px, 92vw); background: var(--glas); border-radius: var(--radius); padding: 16px 20px 14px;
  box-shadow: var(--schatten); opacity: 0; transition: opacity .3s, transform .3s;
}
#dialog.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; cursor: pointer; }
#dialog .who { font-weight: 900; color: var(--rot); font-size: 15px; text-transform: uppercase; letter-spacing: .04em; }
#dialog .txt { font-size: 20px; line-height: 1.4; margin-top: 4px; min-height: 28px; }
#dialog .weiter { text-align: right; font-size: 13px; color: #888; font-weight: 700; margin-top: 4px; }

/* ---------- Infokarte ---------- */
#card {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.35); opacity: 0; transition: opacity .3s; padding: 20px;
}
#card.show { opacity: 1; pointer-events: auto; }
#card .box {
  width: min(620px, 94vw); max-height: 88vh; overflow: auto; background: #fff; border-radius: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4); transform: translateY(20px) scale(.97); transition: transform .3s;
}
#card.show .box { transform: none; }
#card .head { background: linear-gradient(135deg, var(--rot), var(--rot-dunkel)); color: #fff; padding: 18px 22px 16px; position: relative; }
#card .kicker { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
#card h2 { margin: 4px 0 0; font-size: 26px; line-height: 1.15; }
#card .em { position: absolute; right: 18px; top: 12px; font-size: 46px; }
#card .body { padding: 16px 22px 20px; font-size: 17px; line-height: 1.5; }
#card .facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
#card .fact { background: #fff4d6; border: 1px solid #f3d27a; border-radius: 10px; padding: 6px 10px; font-weight: 700; font-size: 14px; }
#card .actions { display: flex; justify-content: flex-end; margin-top: 14px; }

/* ---------- Vollbild-Seiten (Titel, Karte) ---------- */
#screen { position: absolute; inset: 0; display: none; pointer-events: auto; }
#screen.show { display: block; }

.title {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 14px; text-align: left; color: #fff; padding: 20px 20px 20px 6vw;
  background: linear-gradient(90deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.45) 45%, rgba(0,0,0,0) 70%);
}
.title p { max-width: 46vw !important; }
.title .row { justify-content: flex-start !important; }
.title .logo { width: 150px; height: 120px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.4)); }
.title h1 { margin: 0; font-size: clamp(34px, 6vw, 64px); font-weight: 900; letter-spacing: -.01em; text-shadow: 0 4px 20px rgba(0,0,0,.5); }
.title h1 span { color: var(--gold-hell); }
.title p { margin: 0; font-size: clamp(16px, 2.2vw, 22px); max-width: 640px; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.title .row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.title label { display: flex; gap: 8px; align-items: center; font-weight: 700; background: rgba(0,0,0,.35); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.title input { width: 20px; height: 20px; accent-color: var(--gold); }

.map { position: absolute; inset: 0; background: #fbf7ef; overflow: auto; padding: calc(20px + var(--safe-top)) 20px calc(20px + var(--safe-bottom)); }
.map h1 { margin: 0 0 4px; font-size: 30px; }
.map .sub { color: #555; margin: 0 0 16px; font-size: 16px; }
.map .chains { display: flex; flex-direction: column; gap: 12px; }
.map .chain { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 16px; padding: 10px 12px; box-shadow: 0 2px 10px rgba(0,0,0,.08); overflow-x: auto; }
.map .chain .ing { min-width: 110px; font-weight: 900; font-size: 16px; display: flex; flex-direction: column; align-items: center; }
.map .chain .ing .e { font-size: 34px; }
.map .step { background: #f2f2f2; border-radius: 12px; padding: 8px 10px; min-width: 120px; cursor: pointer; border: 2px solid transparent; }
.map .step:hover { border-color: var(--gold); }
.map .step b { display: block; font-size: 14px; }
.map .step small { color: #666; font-size: 12px; }
.map .arrow { color: #bbb; font-size: 22px; font-weight: 900; }
.map .step.end { background: #fff0f0; white-space: nowrap; }
.map .step { flex-shrink: 0; }
.map .foot { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Teleport ---------- */
#fade { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: radial-gradient(circle, #fff 0%, #bff1ff 35%, #2aa8e0 70%, #0a2a6a 100%); }
#fade.on { pointer-events: auto; }
#fade .ring { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px; border-radius: 50%; border: 6px solid rgba(255,255,255,.9); }
#fade .txt { position: absolute; left: 0; right: 0; top: 60%; text-align: center; color: #fff; font-weight: 900; font-size: 30px; text-shadow: 0 2px 10px rgba(0,0,0,.4); }

/* ---------- Hochformat ---------- */
#rotate {
  position: fixed; inset: 0; background: #111; color: #fff; display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px; font-size: 22px; font-weight: 800; text-align: center; z-index: 50; pointer-events: auto;
}
#rotate .phone { font-size: 70px; animation: drehen 2s infinite; }
@keyframes drehen { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (max-width: 900px) { #rotate { display: flex; } }

#loading { position: fixed; inset: 0; background: #b3202a; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 24px; z-index: 60; transition: opacity .5s; }
