/* Marktjagd — Spieloberfläche. Handy zuerst, Daumen zuerst. */

html, body { height: 100%; overscroll-behavior: none; }
body { display: flex; flex-direction: column; }

#app {
  position: relative;
  flex: 1;
  width: min(560px, 100%);
  margin-inline: auto;
  display: flex; flex-direction: column;
  min-height: 0;
}

/* ───────── HUD ───────── */

.hud {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .8rem;
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--ink-2), transparent);
  position: sticky; top: 0; z-index: 30;
}
.hud .score { font-size: 1.5rem; font-weight: 900; letter-spacing: -.03em; }
.hud .score small { display: block; font-size: .6rem; letter-spacing: .12em; color: var(--dim); font-weight: 700; text-transform: uppercase; }
.hud .streak { font-size: .85rem; font-weight: 800; color: var(--jagd); text-align: right; }
.hud .streak small { display: block; font-size: .6rem; letter-spacing: .12em; color: var(--dim); font-weight: 700; text-transform: uppercase; }

.dots { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; }
.dots i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--line); display: block;
}
.dots i.done { background: var(--bestaetigt); }
.dots i.miss { background: var(--danger); opacity: .6; }
.dots i.now  { background: var(--jagd); box-shadow: 0 0 0 4px color-mix(in srgb, var(--jagd) 22%, transparent); }
.dots i.fin  { border: 2px solid var(--jagd); background: transparent; width: 11px; height: 11px; }

/* ───────── Bildschirme ───────── */

.screen { display: none; flex: 1; min-height: 0; flex-direction: column; padding: 1rem .9rem 1.4rem; gap: 1rem; }
.screen.is-active { display: flex; animation: rise .22s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.stack { display: flex; flex-direction: column; gap: 1rem; }
.spacer { flex: 1; min-height: .5rem; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.1rem;
  box-shadow: var(--shadow);
}

/* ───────── Start ───────── */

.hero-mark { font-size: clamp(2.4rem, 13vw, 3.4rem); line-height: .95; }
.hero-sub { color: var(--muted); font-size: 1rem; margin-top: .6rem; }

.choice { display: grid; gap: .6rem; }
.choice button {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .9rem;
  text-align: left; padding: .95rem 1rem;
  background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--r);
}
.choice button[aria-pressed="true"] { border-color: var(--jagd); background: color-mix(in srgb, var(--jagd) 10%, var(--panel)); }
.choice .em { font-size: 1.5rem; }
.choice strong { display: block; font-size: 1rem; }
.choice span { display: block; color: var(--muted); font-size: .82rem; line-height: 1.35; margin-top: .15rem; }

input[type="text"] {
  width: 100%; padding: .95rem 1rem; font: inherit; color: var(--text);
  background: var(--ink-2); border: 1.5px solid var(--line); border-radius: var(--r-sm);
}
input[type="text"]:focus { outline: 2px solid var(--jagd); outline-offset: 1px; }

.fineprint { color: var(--dim); font-size: .76rem; line-height: 1.5; }

/* ───────── Hinweis / Reise ───────── */

.wave-line { display: flex; align-items: center; gap: .5rem; font-size: .78rem; color: var(--muted); }
.wave-line b { color: var(--text); }

.clue {
  border-radius: var(--r-lg);
  padding: 1.3rem 1.2rem;
  background:
    radial-gradient(120% 100% at 0% 0%, color-mix(in srgb, var(--jagd) 22%, transparent), transparent 60%),
    var(--panel);
  border: 1px solid color-mix(in srgb, var(--jagd) 30%, var(--line));
}
.clue .kicker { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--jagd); font-weight: 800; }
.clue .text { font-size: 1.32rem; font-weight: 750; line-height: 1.3; margin-top: .5rem; }
.clue .riddle { font-style: italic; }
.clue .sub { color: var(--muted); font-size: .86rem; margin-top: .55rem; }
.clue .hint { margin-top: .7rem; font-size: .84rem; color: var(--warn); }
.clue .game-tip { margin-top: .9rem; padding-top: .8rem; border-top: 1px dashed var(--line); font-size: .82rem; color: var(--muted); }
.clue .game-tip b { color: var(--text); }

/* ───────── Karte ───────── */

.mapwrap { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r); padding: .6rem; }
.mapwrap svg { width: 100%; height: auto; display: block; touch-action: manipulation; }
.bay { cursor: pointer; }
.bay rect { fill: var(--panel-2); stroke: var(--line); stroke-width: .6; rx: 1.6; transition: fill .15s; }
.bay text { font-size: 3.1px; font-weight: 800; fill: var(--muted); pointer-events: none; }
.bay.visited rect { fill: color-mix(in srgb, var(--bestaetigt) 16%, var(--panel-2)); }
.bay.target rect { fill: color-mix(in srgb, var(--jagd) 34%, var(--panel-2)); stroke: var(--jagd); stroke-width: 1; }
.bay.target text { fill: var(--text); }
.bay:active rect { fill: color-mix(in srgb, var(--jagd) 50%, var(--panel-2)); }
/* „du bist hier" (Onsite-Karte) — grüner Puls, kein Klick-Cursor im read-only Modus */
.bay.here rect { fill: color-mix(in srgb, var(--bestaetigt) 40%, var(--panel-2)); stroke: var(--bestaetigt); stroke-width: 1.2; }
.bay.here text { fill: var(--text); }
.mapwrap.readonly .bay { cursor: default; }
@keyframes hierpuls { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: no-preference) { .mapwrap.readonly .bay.here rect { animation: hierpuls 1.8s ease-in-out infinite; } }
.zone text { font-size: 2.6px; fill: var(--dim); font-weight: 700; letter-spacing: .1px; }
.map-legend { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .72rem; color: var(--dim); margin-top: .5rem; }
.map-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: .35em; vertical-align: -1px; }

/* ───────── Scanner ───────── */

.scanbox { position: relative; border-radius: var(--r); overflow: hidden; background: #000; aspect-ratio: 3/4; }
.scanbox video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanbox .frame {
  position: absolute; inset: 18% 12%; border: 3px solid var(--jagd); border-radius: 18px;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,.45);
}
.scanbox .hintline { position: absolute; left: 0; right: 0; bottom: .8rem; text-align: center; font-size: .85rem; color: #fff; text-shadow: 0 2px 8px #000; }

/* ───────── Regal in 3D ───────── */

.stage3d {
  position: relative;
  border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #161c27, #0f141c);
  aspect-ratio: 4/5;
  touch-action: none;            /* Ziehen dreht den Blick, statt die Seite zu scrollen */
}
.stage3d canvas.shelf3d { width: 100%; height: 100%; display: block; }
.stage3d .hint3d {
  position: absolute; left: .6rem; bottom: .55rem;
  font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 800;
  color: #cfd8e6; background: rgba(8,11,16,.62); padding: .3em .6em; border-radius: 999px;
  pointer-events: none;
}
.stage3d .loading3d {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-size: .86rem;
}
.arstage canvas.shelf3d { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }

/* ───────── Regal-Darstellung (Rückfallebene ohne WebGL) ───────── */

.shelf {
  background: linear-gradient(180deg, #1a2130, #141a25);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
.shelf-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
.shelf-head b { font-size: .9rem; }
.shelf-head .dep { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); font-weight: 800; }
.shelf-row {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: .6rem;
  padding: .55rem .8rem;
  border-bottom: 1px solid rgba(255,255,255,.05);
  background: linear-gradient(180deg, transparent 78%, rgba(0,0,0,.35));
}
.shelf-row:last-child { border-bottom: 0; }
.shelf-row .pos { font: 800 .72rem/1 var(--mono); color: var(--dim); text-align: center; }
.shelf-row .goods { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; font-size: 1.32rem; line-height: 1.1; min-height: 1.5rem; }
.shelf-row .goods .empty { font-size: .74rem; color: var(--danger); font-weight: 800; letter-spacing: .06em; }
.shelf-row .goods .ghost { opacity: .28; filter: grayscale(1); font-size: 1.1rem; }
.shelf-row .price {
  font: 800 .82rem/1 var(--mono); color: #14202e; background: var(--warn);
  padding: .3rem .45rem; border-radius: 4px; white-space: nowrap;
}
.shelf-row .label { font-size: .7rem; color: var(--muted); }

/* ───────── Aufgabe ───────── */

.q-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.timer { position: relative; width: 46px; height: 46px; flex: none; }
.timer svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.timer circle { fill: none; stroke-width: 5; }
.timer .bg { stroke: var(--line); }
.timer .fg { stroke: var(--jagd); stroke-linecap: round; transition: stroke-dashoffset .25s linear, stroke .3s; }
.timer.low .fg { stroke: var(--danger); }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font: 800 .82rem/1 var(--mono); }

.prompt { font-size: 1.18rem; font-weight: 750; line-height: 1.32; }
.prompt-sub { color: var(--muted); font-size: .86rem; margin-top: .3rem; }

.options { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.options.wide { grid-template-columns: 1fr; }
.opt {
  display: flex; align-items: center; gap: .7rem;
  padding: 1rem .9rem; text-align: left;
  background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--r);
  font-weight: 700; min-height: 60px;
}
.opt .em { font-size: 1.35rem; }
.opt:active { transform: scale(.975); border-color: var(--jagd); }
.opt.chosen { border-color: var(--jagd); background: color-mix(in srgb, var(--jagd) 14%, var(--panel)); }
.opt.right { border-color: var(--bestaetigt); background: color-mix(in srgb, var(--bestaetigt) 16%, var(--panel)); }
.opt.wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, var(--panel)); }
.opt[disabled] { opacity: .55; }

/* ───────── AR-Fund ───────── */

.arstage {
  position: relative; border-radius: var(--r); overflow: hidden;
  background: #0a0c11; aspect-ratio: 3/4; touch-action: manipulation;
}
.arstage video, .arstage .fauxshelf { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fauxshelf {
  background:
    repeating-linear-gradient(180deg, #263243 0 46px, #1b2331 46px 52px),
    linear-gradient(180deg, #2b3547, #141a25);
  display: grid; place-items: center;
}
.fauxshelf .rowicons { position: absolute; left: 0; right: 0; display: flex; justify-content: space-around; font-size: 1.6rem; opacity: .55; }
.arstage .prize {
  position: absolute; width: 92px; height: 92px; margin: -46px 0 0 -46px;
  display: grid; place-items: center; font-size: 2.6rem;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(255,190,120,.95), rgba(255,122,26,.35) 60%, transparent 72%);
  filter: drop-shadow(0 0 22px rgba(255,150,50,.75));
  animation: bob 2.6s ease-in-out infinite;
  transition: transform .12s ease-out;
}
@keyframes bob { 50% { transform: translateY(-8px); } }
.arstage .prize.caught { animation: pop .35s ease forwards; }
@keyframes pop { to { transform: scale(2.2); opacity: 0; } }
.arstage .arhint {
  position: absolute; left: 0; right: 0; bottom: .7rem; text-align: center;
  font-size: .84rem; color: #fff; text-shadow: 0 2px 10px #000;
}
.arstage .badge {
  position: absolute; top: .6rem; left: .6rem;
  font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 800;
  background: rgba(0,0,0,.6); padding: .3em .6em; border-radius: 999px; color: #fff;
}

/* ───────── Räumliches AR (WebXR) ───────── */

/* Der Knopf erscheint nur auf Geräten, die immersive-ar können. */
.btn-xr {
  background: linear-gradient(180deg, #9c8bff, var(--scout));
  color: #12102a; border-color: transparent; font-weight: 800;
  box-shadow: 0 10px 24px -14px rgba(139,123,255,.9);
}

/* Bild-Target-Modus (mind-ar) — eigene Vollbild-Bühne über der Seite. */
.btn-bildar {
  background: linear-gradient(180deg, #4fd7c0, #21a08c);
  color: #06231e; border-color: transparent; font-weight: 800;
}
.mindar-wrap { position: fixed; inset: 0; z-index: 100; background: #000; }
.mindar-stage { position: absolute; inset: 0; overflow: hidden; }
.mindar-stage { display: grid; }
/* Größe UND Position von Video und Canvas rechnet mind-ar selbst aus (es muss
   das Kamera-Seitenverhältnis auf den Container abbilden). Überschreibt man nur
   die Größe, passt die Position nicht mehr — das Bild sitzt dann verschoben. */
.mindar-stage video { position: absolute; }
.mindar-stage canvas { position: absolute; }
.mindar-hint {
  position: absolute; left: 50%; bottom: 8vh; transform: translateX(-50%); z-index: 3;
  max-width: min(88vw, 460px); text-align: center;
  background: rgba(8,11,16,.72); color: #fff; font: 600 .95rem/1.4 var(--font);
  padding: .7rem 1.1rem; border-radius: 999px; backdrop-filter: blur(6px);
}
.mindar-exit {
  position: absolute; top: max(1rem, env(safe-area-inset-top)); right: 1rem; z-index: 4;
  width: 46px; height: 46px; border-radius: 50%; font-size: 1.2rem;
  background: rgba(8,11,16,.72); color: #fff; backdrop-filter: blur(6px);
}

/* HUD innerhalb der XR-Session (dom-overlay). */
.xr-overlay { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.xr-overlay .xr-hint {
  position: absolute; left: 50%; bottom: 8vh; transform: translateX(-50%);
  max-width: min(88vw, 460px); text-align: center;
  background: rgba(8,11,16,.72); color: #fff; font: 600 .95rem/1.4 var(--font);
  padding: .7rem 1.1rem; border-radius: 999px; backdrop-filter: blur(6px);
}
.xr-overlay .xr-exit {
  position: absolute; top: max(1rem, env(safe-area-inset-top)); right: 1rem;
  pointer-events: auto;
  width: 46px; height: 46px; border-radius: 50%; font-size: 1.2rem;
  background: rgba(8,11,16,.72); color: #fff; backdrop-filter: blur(6px);
}

/* ───────── Foto-Auftrag ───────── */

.shot { position: relative; border-radius: var(--r); overflow: hidden; background: #05070b; aspect-ratio: 3/4; touch-action: none; }
.shot video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot canvas.shelf3d { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
.shot .reticle {
  position: absolute; left: 50%; top: 50%; width: 132px; height: 132px; margin: -66px 0 0 -66px;
  border: 2px dashed rgba(255,255,255,.55); border-radius: 50%; z-index: 3; pointer-events: none;
  transition: border-color .2s, transform .2s;
}
.shot .reticle.hot { border-color: var(--bestaetigt); border-style: solid; transform: scale(1.06); }
.shot .shotbadge {
  position: absolute; top: .6rem; left: .6rem; z-index: 4;
  font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 800;
  background: rgba(0,0,0,.62); padding: .3em .6em; border-radius: 999px; color: #fff;
}
.shot .shothint {
  position: absolute; left: 0; right: 0; bottom: .7rem; z-index: 4; text-align: center;
  font-size: .84rem; color: #fff; text-shadow: 0 2px 10px #000;
}
.shot .flashwhite {
  position: absolute; inset: 0; background: #fff; opacity: 0; z-index: 5; pointer-events: none;
  transition: opacity .12s;
}
.shot .flashwhite.on { opacity: .85; transition: none; }

.consent {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem;
}
.consent h3 { font-size: 1rem; margin-bottom: .5rem; }
.consent p { font-size: .86rem; color: var(--muted); line-height: 1.55; }
.consent ul { margin: .7rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: .84rem; line-height: 1.7; }
.consent .row { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }

.vision {
  border: 1px solid var(--line); border-radius: var(--r); padding: .9rem; background: var(--panel);
  display: grid; gap: .55rem;
}
.vision .row { display: flex; gap: .5rem; align-items: baseline; font-size: .86rem; }
.vision .row b { min-width: 7.5rem; color: var(--dim); font-weight: 700; font-size: .74rem;
  letter-spacing: .06em; text-transform: uppercase; }
.vision img { width: 100%; border-radius: var(--r-sm); display: block; }
.vision .chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.vision .chip { font-size: .76rem; background: var(--panel-2); border: 1px solid var(--line);
  padding: .2em .55em; border-radius: 999px; }
.vision .warten { color: var(--warn); font-size: .84rem; }

/* ───────── Ergebnis ───────── */

.flash {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(6,8,12,.86); backdrop-filter: blur(5px);
  padding: 1.5rem; text-align: center;
}
.flash[hidden] { display: none; }
.flash .inner { max-width: 380px; display: grid; gap: .7rem; animation: rise .24s ease both; }
.flash .big { font-size: 3.2rem; font-weight: 900; letter-spacing: -.04em; }
.flash .big.ok  { color: var(--bestaetigt); }
.flash .big.no  { color: var(--warn); }
.flash .msg { color: var(--muted); font-size: .92rem; }
.flash .consensus {
  border: 1px dashed var(--line); border-radius: var(--r-sm); padding: .7rem .8rem;
  font-size: .82rem; color: var(--muted); text-align: left;
}
.flash .consensus b { color: var(--text); }

/* ───────── Abschluss ───────── */

.coupon {
  border-radius: var(--r-lg); padding: 1.2rem; text-align: center;
  background: linear-gradient(160deg, #ff9a45, #ff6a00);
  color: #24130a;
}
.coupon .tier { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 900; opacity: .8; }
.coupon .code { font: 900 1.8rem/1 var(--mono); letter-spacing: .06em; margin: .45rem 0; }
.coupon .perk { font-weight: 750; }
.coupon .note { font-size: .72rem; opacity: .75; margin-top: .5rem; }

.tally { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; text-align: center; }
.tally div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .8rem .4rem; }
.tally b { display: block; font-size: 1.4rem; font-weight: 900; }
.tally span { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 700; }

.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px;
  padding: .7rem 1.1rem; font-size: .86rem; font-weight: 700; z-index: 70;
  box-shadow: var(--shadow); animation: rise .2s ease both;
  max-width: min(90vw, 420px); text-align: center;
}
.toast[hidden] { display: none; }

/* Tagesbucht: heute zählt sie doppelt — auf der Karte sichtbar. */
.bay.daily rect:first-of-type { stroke: var(--jagd); stroke-width: .9; stroke-dasharray: 2 1.2; }
.tag-daily { background: color-mix(in srgb, var(--jagd) 22%, transparent); color: var(--jagd); }

/* Fotojagd: Ziel, Kamera, Rückmeldung und Auslöser passen auf den Handybildschirm. */
.market-play .screen{padding:14px;animation:none}
.market-play .stack{gap:10px}
.market-play h1{font-size:1.45rem;overflow-wrap:anywhere}
.market-play .clue{padding:10px 12px}
.market-play .clue p{font-size:.93rem;line-height:1.4}
.market-play #zonenWaerme{margin-top:5px;color:var(--muted)}
.market-play #eierPlan summary{cursor:pointer;min-height:36px;padding:6px 0;font-size:.85rem}
.market-play #eierKarte{display:block;width:180px;height:180px;max-width:100%;margin:auto}
.market-play #eierVideo{width:100%;height:clamp(130px,25dvh,210px);object-fit:contain;background:#06080c;border-radius:12px}
.market-play #fotoBedienung{scroll-margin:10px}
.market-play #fotoMeldung{font-size:.93rem;line-height:1.4;font-weight:700;margin-bottom:8px}
.market-play #fotoMeldung:empty{display:none}
.market-play #ausloeser{width:100%;min-height:48px;padding:12px}
.market-play .fineprint{font-size:.73rem;line-height:1.4}

.market-play .market-brand{display:flex;align-items:center;justify-content:space-between;gap:12px}
.market-play .market-brand img{width:130px;display:block}
.market-play .market-brand span{font-size:.7rem;color:var(--muted);text-align:right}
.market-play.is-spark #ausloeser{background:#ffc644;color:#171b23;border-radius:12px;box-shadow:none}
.market-play.is-spark .coupon{border-color:#ffc644}
/* Links in der orangen Coupon-Karte erbten weiße Schrift auf hellem Gelb (zu wenig Kontrast). */
.market-play.is-spark .coupon .btn{color:#171b23}
