/* RÜBER! – Spielfläche und HUD. Menü und Einstellungen: ../_sdk/menu.css (für alle Spiele gleich). */
:root { --ink: #0b0c0e; --lime: #d1ff69; --coral: #ff5d47; --paper: #f4f4ef; --muted: #a3a7ab; --edge: #ffffff24; --head: 'Space Grotesk', system-ui, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #070a14; color: var(--paper); font-family: system-ui, 'Segoe UI', sans-serif; -webkit-tap-highlight-color: transparent; user-select: none; }
#game { position: fixed; left: 0; top: var(--cv-cam-top, 0px); width: 100%; height: calc(100% - var(--cv-cam-top, 0px) - var(--cv-cam-bottom, 0px)); display: block; touch-action: none; }
[hidden] { display: none !important; }
#hud { position: fixed; left: 0; right: 0; top: var(--cv-cam-top, 0px); bottom: var(--cv-cam-bottom, 0px); z-index: 10; pointer-events: none; }
:root { --safe-top: 0px; }
html[data-stream][data-game-orientation=hoch] { --safe-top: 11cqh; }
html[data-facecam="oben"][data-game-orientation] { --safe-top: 0px; }

.hud-top { position: absolute; top: calc(var(--safe-top) + 8px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; width: min(520px, 94cqw); }
.h-dist { display: grid; place-items: center; min-width: 74px; padding: 4px 10px; border-radius: 16px; border: 2px solid var(--lime); background: rgba(11,12,14,.78); box-shadow: 4px 4px 0 #d1ff6933; }
.h-dist b { font: 700 30px/1 var(--head); color: var(--lime); }
.h-dist span { font: 700 10px var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.h-stage { flex: 1; display: grid; gap: 4px; padding: 6px 10px; border-radius: 14px; border: 2px solid var(--edge); background: rgba(11,12,14,.72); font: 700 12px var(--head); }
.h-time { position: relative; height: 16px; border-radius: 99px; background: #ffffff14; overflow: hidden; }
.h-time i { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(90deg, #6fe3a0, var(--lime)); border-radius: 99px; transition: width .2s linear; }
.h-time b { position: relative; display: block; text-align: center; font: 700 11px/16px var(--head); color: #0b0c0e; }
.h-time.low i { background: linear-gradient(90deg, var(--coral), #ffb04a); }
.h-time.low { animation: blink .6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .6; } }
.h-pfand { padding: 8px 10px; border-radius: 14px; border: 2px solid var(--edge); background: rgba(11,12,14,.72); font: 700 14px var(--head); white-space: nowrap; }
.h-pfand b { color: #6fe3a0; }
.hud-status { position: absolute; top: calc(var(--safe-top) + 64px); left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.hud-status span { padding: 3px 9px; border-radius: 999px; background: rgba(11,12,14,.78); border: 1px solid var(--edge); font: 700 12px var(--head); }
.hud-buttons { position: absolute; top: calc(var(--safe-top) + 64px); left: 8px; display: flex; flex-direction: column; gap: 6px; pointer-events: auto; }
.hud-buttons button { width: 40px; height: 40px; padding: 0; border-radius: 12px; border: 2px solid var(--edge); background: rgba(11,12,14,.75); color: #fff; font-size: 17px; cursor: pointer; }
.hud-buttons button.on { border-color: var(--lime); background: rgba(209,255,105,.25); box-shadow: 0 0 12px rgba(209,255,105,.4); }
.demo .hud-buttons, .obs .hud-buttons { display: none; }

#feed { position: absolute; right: 8px; top: calc(var(--safe-top) + 64px); width: min(210px, 46cqw); display: grid; gap: 5px; }
.feed-item { display: flex; align-items: center; gap: 7px; padding: 5px 9px; border-radius: 10px; background: rgba(11,12,14,.8); border: 1px solid var(--edge); border-left: 4px solid var(--coral); font-size: 12px; animation: slideIn .25s ease-out; transition: opacity .5s, transform .5s; }
.feed-item.is-hilf { border-left-color: var(--lime); }
.feed-item.is-neutral { border-left-color: #ff7ab6; }
.feed-item > span { font-size: 18px; }
.feed-item b { display: block; font: 700 12px var(--head); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item small { color: var(--muted); font-size: 11px; }
.feed-item.out { opacity: 0; transform: translateX(30px); }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } }
#pops { position: absolute; left: 50%; top: 42%; transform: translateX(-50%); display: grid; gap: 4px; justify-items: center; }
.pop { font: 700 18px var(--head); text-shadow: 0 2px 0 #000, 0 0 10px #000; animation: pop 1.6s ease-out forwards; white-space: nowrap; }
@keyframes pop { 0% { opacity: 0; transform: translateY(10px) scale(.9); } 15% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-24px); } }
#banner { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); width: max-content; max-width: 94cqw; text-align: center; opacity: 0; pointer-events: none; }
#banner b { display: block; font: 700 clamp(30px, 9cqw, 60px)/1 var(--head); letter-spacing: -.02em; text-shadow: 0 4px 0 #000, 0 0 24px rgba(0,0,0,.7); }
#banner small { display: block; margin-top: 6px; font: 700 clamp(13px, 3.6cqw, 18px) var(--head); color: #fff; text-shadow: 0 2px 0 #000; }
#banner.show { animation: bannerIn 2s ease-out forwards; }
@keyframes bannerIn { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }

#revive { position: absolute; left: 50%; bottom: calc(18cqh + 10px); transform: translateX(-50%); width: min(360px, 90cqw); padding: 14px 16px; border-radius: 18px; border: 2px solid #ff7ab6; background: rgba(11,12,14,.88); box-shadow: 6px 6px 0 #ff7ab633; text-align: center; animation: pulse 0.9s ease-in-out infinite; }
#revive b { display: block; font: 700 22px var(--head); color: #ff7ab6; }
#revive span { display: block; font-size: 13px; color: #cfd2d4; }
.rv-bar { height: 10px; margin: 10px 0 0; border-radius: 99px; background: #ffffff14; overflow: hidden; }
.rv-bar i { display: block; height: 100%; width: 100%; background: #ff7ab6; transition: width .2s linear; }
#revive em { position: absolute; right: 14px; top: 10px; font: 700 26px var(--head); font-style: normal; color: #fff; }
@keyframes pulse { 50% { box-shadow: 6px 6px 0 #ff7ab633, 0 0 30px #ff7ab655; } }

#result { position: absolute; inset: 0; display: flex; padding: 16px; pointer-events: auto; background: rgba(7,10,20,.55); }
.res-card { margin: auto; width: min(420px, 100%); padding: 20px 18px; border-radius: 22px; border: 2px solid var(--lime); background: rgba(18,20,23,.95); box-shadow: 10px 10px 0 #d1ff6933; text-align: center; animation: cardIn .3s ease-out; }
@keyframes cardIn { from { transform: scale(.92); opacity: 0; } }
.res-kicker { display: inline-block; padding: 4px 12px; border-radius: 8px; background: var(--lime); color: var(--ink); font: 700 14px var(--head); letter-spacing: .1em; transform: rotate(-2deg); }
.res-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 16px 0 12px; }
.res-stats div { padding: 8px 4px; border-radius: 12px; background: #ffffff0a; }
.res-stats b { display: block; font: 700 26px var(--head); color: var(--lime); }
.res-stats span { font-size: 11px; color: var(--muted); }
.res-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.res-lists h3 { margin: 0 0 4px; font: 700 14px var(--head); }
.res-lists ol { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.res-lists small { color: var(--muted); }
.res-again { margin-top: 14px; width: 100%; padding: 13px; border-radius: 14px; border: 2px solid var(--ink); background: var(--lime); color: var(--ink); font: 700 18px var(--head); cursor: pointer; box-shadow: 4px 4px 0 #ffffff40; }
.res-card > small { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
#watermark { position: fixed; left: 50%; top: calc(var(--cv-cam-top, 0px) + 13cqh); transform: translateX(-50%); z-index: 24; pointer-events: none; padding: 4px 12px; border-radius: 999px; background: rgba(0,0,0,.55); font: 800 13px system-ui; white-space: nowrap; }
@container cv-game (min-aspect-ratio: 1/1) { #revive { bottom: 24px; } }

/* ===== Fortschritt: Menü-Level, Laden, Aufgaben, Erfolge, Hinweise ===== */
.cv-stats .lv { display: flex; justify-content: space-between; align-items: baseline; }
.cv-stats .lv span { color: #d1ff69; font: 700 13px var(--head); text-transform: uppercase; letter-spacing: .06em; }
.cv-stats .lv b { color: #f4f4ef; font: 700 13px var(--head); }
.lv-bar, .laden .bar { height: 8px; margin: 6px 0; border-radius: 99px; background: #ffffff14; overflow: hidden; }
.lv-bar i, .laden .bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #ffd166, #d1ff69); }
.laden .bar.big { height: 12px; }
.lv-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.laden { width: min(620px, 100%); }
.laden-acorns { padding: 6px 12px; border-radius: 999px; background: #ffffff10; border: 2px solid #ffffff24; font: 700 15px var(--head); white-space: nowrap; }
.laden-acorns b { color: #ffd166; }
.laden-pane { margin-top: 10px; max-height: min(70cqh, 640px); overflow-y: auto; padding-right: 2px; }
.laden-pane h3 { margin: 16px 0 8px; font: 700 15px var(--head); color: #d1ff69; }
.laden-pane .muted { color: #a3a7ab; font-size: 13px; margin: 4px 0 10px; }
.shop-grid { display: grid; gap: 8px; }
.shop-grid.items { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.shop-card { position: relative; padding: 10px; border-radius: 14px; border: 2px solid #ffffff1f; background: #ffffff07; }
.shop-card.is-active { border-color: #d1ff69; box-shadow: 4px 4px 0 #d1ff6933; }
.shop-card.item { display: grid; justify-items: center; gap: 6px; text-align: center; }
.shop-card.item b { font: 700 13px var(--head); }
.i-icon { font-size: 30px; line-height: 1; height: 34px; display: grid; place-items: center; }
.swatch { display: inline-block; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff4; }
.shop-card.world { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; }
.shop-card.world.is-locked { opacity: .82; }
.w-icon { font-size: 40px; text-align: center; }
.shop-card.world b { font: 700 17px var(--head); }
.shop-card.world p { margin: 2px 0 4px; font-size: 13px; color: #cfd2d4; }
.shop-card.world small { font-size: 12px; color: #a3a7ab; }
.laden-pane button { padding: 8px 12px; border-radius: 10px; border: 2px solid #0b0c0e; background: #d1ff69; color: #0b0c0e; font: 700 13px var(--head); cursor: pointer; white-space: nowrap; }
.laden-pane button:disabled { background: #ffffff14; color: #a3a7ab; border-color: #ffffff1f; cursor: not-allowed; }
.tag { padding: 5px 10px; border-radius: 999px; background: #ffffff14; font: 700 12px var(--head); color: #a3a7ab; white-space: nowrap; }
.tag.on { background: #d1ff69; color: #0b0c0e; }
.tasks { display: grid; gap: 8px; }
.task { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 2px solid #ffffff1f; background: #ffffff07; }
.task > span { font-size: 26px; text-align: center; }
.task b { font: 700 14px var(--head); }
.task small { color: #a3a7ab; font-size: 12px; }
.task em { font: 700 13px var(--head); color: #ffd166; font-style: normal; white-space: nowrap; }
.task.done { border-color: #6fe3a0; background: #6fe3a012; }
.task.locked > span { filter: grayscale(1); opacity: .5; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stat-grid div { padding: 8px; border-radius: 12px; background: #ffffff0a; text-align: center; }
.stat-grid b { display: block; font: 700 20px var(--head); color: #d1ff69; }
.stat-grid span { font-size: 11px; color: #a3a7ab; }
.res-tasks { display: grid; gap: 4px; margin-top: 12px; text-align: left; font-size: 12px; color: #cfd2d4; }
.res-tasks .done { color: #6fe3a0; }
.res-tasks b { color: #a3a7ab; font-weight: 700; }
#toasts { position: fixed; left: 50%; top: calc(var(--cv-cam-top, 0px) + 22cqh); transform: translateX(-50%); z-index: 70; display: grid; gap: 6px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 16px; border: 2px solid #ffd166; background: rgba(18,20,23,.94); box-shadow: 5px 5px 0 #ffd16640; animation: toastIn .35s ease-out; transition: opacity .4s, transform .4s; }
.toast > span { font-size: 28px; }
.toast small { display: block; font: 700 10px var(--head); letter-spacing: .14em; text-transform: uppercase; color: #ffd166; }
.toast b { font: 700 15px var(--head); }
.toast em { margin-left: 8px; font-style: normal; font-weight: 800; color: #d1ff69; }
.toast.out { opacity: 0; transform: translateY(-10px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.95); } }
/* Tag-Welten: HUD etwas heller abgesetzt */
html:not([data-welt="stadt"]) .h-stage, html:not([data-welt="stadt"]) .h-pfand, html:not([data-welt="stadt"]) .feed-item { background: rgba(11,12,14,.7); }
html:not([data-welt="stadt"]) body { background: #9ad8ff; }
@container cv-game (max-aspect-ratio: 3/4) {
  #feed { width: min(170px, 42cqw); }
  #feed .feed-item:nth-child(n+4) { display: none; }
  .feed-item { padding: 4px 7px; } .feed-item > span { font-size: 15px; }
}

/* Hochformat auf dem Handy (17.11.2026): Krümel unten frei halten – Geschenk-Anzeige höher und kleiner,
   „Rettet Krümel!“ nach oben unter die Anzeige, Feed kompakter. Zeitbalken-Zahl auch bei leerem Balken lesbar. */
html[data-game-orientation=hoch] body #cv-gifts { top: calc(var(--cv-cam-top, 0px) + var(--safe-top) + 27cqh); transform: scale(.82); transform-origin: top left; }
html[data-game-orientation=hoch] #revive { bottom: auto; top: calc(var(--safe-top) + 74px); left: calc(50% + 26px); width: min(300px, 78cqw); padding: 10px 14px; }
html[data-game-orientation=hoch] #revive b { font-size: 19px; }
html[data-game-orientation=hoch] #feed { width: min(168px, 42cqw); }
html[data-game-orientation=hoch] #feed .feed-item:nth-child(n+3) { display: none; }
.h-time b { color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
html[data-game-orientation=hoch] #hud:has(#revive:not([hidden])) #feed { opacity: 0; }

/* Klarer Blick auf die nächste Spur, gemeinsame Stream- und Facecam-Fläche. */
.hud-top { top: calc(var(--safe-top) + max(10px, env(safe-area-inset-top))); gap: 8px; }
.h-stage { border-color: #ffffff30; background: #111919db; box-shadow: 0 4px 16px #0002; }
.h-dist { background: #101712eb; } .h-pfand { background: #111919db; }
.hud-buttons { left: auto; right: max(12px, env(safe-area-inset-right)); top: calc(var(--safe-top) + 78px); flex-direction: row; gap: 7px; }
.hud-buttons button { width: 38px; height: 38px; background: #10181bdb; border-width: 1px; box-shadow: 0 3px 12px #0002; }
.hud-status { top: calc(var(--safe-top) + 80px); left: 12px; transform: none; max-width: calc(100% - 164px); flex-wrap: wrap; }
#feed { top: calc(var(--safe-top) + 126px); }
#revive { pointer-events: auto; animation: none; border-width: 1px; background: #12191cf0; box-shadow: 0 8px 32px #0005; padding-right: 45px; }
#revive span { margin-top: 5px; line-height: 1.4; }
#revive .rv-cause { margin: 0 0 5px; font: 700 11px var(--head); color: var(--coral); letter-spacing: .08em; }
#hud:has(#revive:not([hidden])) #banner { visibility: hidden; }
.rv-restart { margin-top: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--lime); color: var(--ink); font: 700 15px var(--head); cursor: pointer; }
.rv-restart small { display: block; margin-top: 2px; font: 500 10px system-ui; }
.rv-restart:focus-visible, .hud-buttons button:focus-visible { outline: 3px solid white; outline-offset: 3px; }
html[data-game-orientation=hoch] #revive { top: calc(var(--safe-top) + 130px); left: 50%; width: min(340px, 92cqw); }
.res-card { max-height: calc(100% - 20px); overflow-y: auto; }
@container cv-game (max-height: 520px) {
  html body #cv-gifts { top: calc(var(--cv-cam-top, 0px) + 126px); width: 205px; transform: scale(.68); transform-origin: top left; }
  #banner b { font-size: 32px; } #banner small { font-size: 13px; }
  #revive { bottom: 12px; width: min(360px, 66cqw); padding: 10px 44px 10px 12px; }
  #revive b { font-size: 18px; } #revive span { font-size: 12px; }
  .res-card { width: min(540px, 100%); padding: 14px; } .res-stats { margin: 8px 0; }
  .res-tasks { display: none; } .res-again { margin-top: 8px; padding: 9px; }
}

/* Politur 24.11.2026: Geschenk-Banner nicht hinter der Ergebniskarte hervorschauen lassen */
body:has(#result:not([hidden])) #banner { opacity: 0 !important; }
