/* WOLKENTREPPE – Spielfläche und HUD. Menü und Einstellungen: ../_sdk/menu.css (für alle Spiele gleich). */
:root { --ink: #0b0c0e; --lime: #d1ff69; --coral: #ff5d47; --gold: #ffd166; --paper: #f4f4ef; --muted: #a3a7ab; --edge: #ffffff24; --head: 'Space Grotesk', system-ui, sans-serif; --safe-top: 0px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0c0e; color: var(--paper); font-family: system-ui, 'Segoe UI', sans-serif; -webkit-tap-highlight-color: transparent; user-select: none; }
html[data-bg="gruen"], html[data-bg="gruen"] body { background: #00ff00; }
html[data-bg="durchsichtig"], html[data-bg="durchsichtig"] body { background: transparent; }
#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: 20; pointer-events: none; container-type: size; }
html[data-game-orientation=hoch] { --safe-top: 11cqh; }
html[data-facecam="oben"] { --safe-top: 0px; }

/* Oben: Stufenzähler und Team-Leiste */
.top { position: absolute; top: calc(var(--safe-top) + 10px); left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: stretch; width: min(640px, 94cqw); }
.alt { display: grid; justify-items: center; align-content: center; min-width: 128px; padding: 6px 14px 7px; border-radius: 18px; border: 2px solid var(--lime); background: rgba(11,12,14,.8); box-shadow: 5px 5px 0 #d1ff6933; }
.alt .biome { font: 700 11px var(--head); letter-spacing: .04em; color: #e9ecef; white-space: nowrap; }
.alt .num { display: flex; align-items: baseline; gap: 4px; }
.alt .num b { font: 800 38px/1 var(--head); color: var(--lime); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.alt .num small { font: 700 14px var(--head); color: var(--muted); }
.alt .lbl { font: 700 9px var(--head); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.teams { flex: 1; display: grid; gap: 5px; align-content: center; padding: 8px 12px; border-radius: 18px; border: 2px solid var(--edge); background: rgba(11,12,14,.74); min-width: 0; }
.t-row { display: flex; justify-content: space-between; gap: 8px; font: 800 12px var(--head); white-space: nowrap; }
.t-up { color: var(--lime); } .t-down { color: var(--coral); }
.t-row b { font-size: 16px; color: #fff; font-variant-numeric: tabular-nums; }
.t-bar { height: 10px; border-radius: 99px; background: var(--coral); overflow: hidden; box-shadow: inset 0 0 0 1px #0004; }
.t-bar i { display: block; height: 100%; width: 50%; background: linear-gradient(90deg, #a6e64a, var(--lime)); border-radius: 99px; transition: width .4s ease; }
.tops { font: 700 11px var(--head); color: #dfe3e6; }
.tops span { overflow: hidden; text-overflow: ellipsis; max-width: 49%; }
.tops b { color: #fff; }
html[data-game-orientation=hoch] .top { flex-direction: column; width: min(420px, 92cqw); gap: 6px; }
html[data-game-orientation=hoch] .alt { grid-template-columns: auto auto; column-gap: 10px; justify-content: center; padding: 4px 14px; }
html[data-game-orientation=hoch] .alt .biome { grid-column: 1 / -1; }
html[data-game-orientation=hoch] .alt .lbl { align-self: center; }
#h-status { position: absolute; top: calc(var(--safe-top) + 92px); left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
html[data-game-orientation=hoch] #h-status { top: calc(var(--safe-top) + 150px); }
#h-status .st { padding: 3px 10px; border-radius: 999px; background: rgba(11,12,14,.8); border: 1px solid var(--edge); font: 700 12px var(--head); }

/* Höhenmesser rechts */
.meter { position: absolute; right: 14px; top: 26cqh; bottom: 16cqh; width: 34px; display: grid; grid-template-rows: auto 1fr; justify-items: center; gap: 4px; }
.m-top { font-size: 18px; }
.m-track { position: relative; width: 10px; border-radius: 99px; background: rgba(11,12,14,.6); border: 1px solid var(--edge); }
.m-track i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 99px; background: linear-gradient(0deg, #86d16f, #9fd2ff 30%, #ff9a7a 55%, #8f9be0 75%, var(--gold)); transition: height .2s linear; }
.m-track em { position: absolute; left: -7px; right: -7px; height: 3px; border-radius: 2px; background: var(--lime); transform: translateY(50%); }
.m-track em.rec { background: var(--gold); }
.m-track em.rec::after { content: '🏁'; position: absolute; right: 16px; top: -9px; font-size: 13px; font-style: normal; }
#m-me { position: absolute; left: 50%; width: 22px; height: 22px; border-radius: 50%; background: #fbfbf7; border: 3px solid #15161c; transform: translate(-50%, 50%); box-shadow: 0 0 0 2px var(--coral); transition: bottom .2s linear; }

/* Sturz-Zähler – der Clip-Moment */
#fall { position: absolute; left: 50%; top: 50cqh; width: max-content; max-width: 94cqw; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 4px; animation: fallIn .25s ease-out; }
#fall b { font: 900 64px/1 var(--head); color: var(--coral); -webkit-text-stroke: 3px #0b0c0e; paint-order: stroke fill; text-shadow: 6px 6px 0 #0b0c0e; font-variant-numeric: tabular-nums; }
#fall.big b { font-size: 104px; animation: shakeTxt .12s infinite; }
#fall span { padding: 4px 12px; border-radius: 999px; background: rgba(11,12,14,.85); font: 800 15px var(--head); border: 2px solid var(--coral); white-space: nowrap; }
@keyframes fallIn { from { transform: translate(-50%, -50%) scale(1.8); opacity: 0; } }
@keyframes shakeTxt { 50% { transform: translate(2px, -2px) rotate(-1deg); } }
#flash { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
#flash.on { animation: flash .35s ease-out; }
@keyframes flash { from { opacity: .42; } to { opacity: 0; } }

/* Banner, Feed, Zahlen */
#banner { position: absolute; left: 50%; top: 27cqh; width: max-content; max-width: 92cqw; transform: translate(-50%, -50%) scale(.9); display: grid; justify-items: center; gap: 4px; opacity: 0; transition: opacity .25s, transform .25s; text-align: center; }
#banner.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#banner b { font: 900 34px/1.05 var(--head); -webkit-text-stroke: 2px #0b0c0e; paint-order: stroke fill; text-shadow: 4px 4px 0 #0b0c0e; letter-spacing: .01em; }
#banner span { padding: 3px 12px; border-radius: 999px; background: rgba(11,12,14,.8); font: 700 14px var(--head); }
#feed { position: absolute; left: 10px; bottom: 12px; display: grid; gap: 4px; width: min(300px, 70cqw); }
.fi { display: flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 12px; background: rgba(11,12,14,.78); border-left: 4px solid #ffffff55; font: 700 13px var(--head); animation: feedIn .3s ease-out; overflow: hidden; }
.fi span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi.hoch { border-left-color: var(--lime); } .fi.runter { border-left-color: var(--coral); }
.fi:nth-child(n+4) { opacity: .6; }
@keyframes feedIn { from { transform: translateX(-30px); opacity: 0; } }
#pops .pop { position: absolute; transform: translate(-50%, -50%); font: 900 22px var(--head); -webkit-text-stroke: 2px #0b0c0e; paint-order: stroke fill; white-space: nowrap; animation: popUp 1.6s ease-out forwards; }
#pops .pop.big { font-size: 36px; }
@keyframes popUp { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1); } }
#taphint { position: absolute; left: 50%; bottom: 16cqh; transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; background: rgba(11,12,14,.72); font: 700 13px var(--head); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.demo #taphint, .obs #taphint { display: none; }

.hud-buttons { position: absolute; top: calc(var(--safe-top) + 10px); right: 10px; display: flex; flex-direction: column; gap: 6px; pointer-events: auto; }
html[data-game-orientation=quer] .hud-buttons { flex-direction: row; }
html[data-game-orientation=quer] .top { left: calc(50% - 40px); }
html[data-game-orientation=hoch] .meter { top: calc(var(--safe-top) + 200px); }
.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:hover { border-color: var(--lime); }
.demo .hud-buttons, .obs .hud-buttons { display: none; }

/* Gipfel-Tafel */
#summit { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.sum-card { width: min(460px, 90cqw); padding: 18px 20px; border-radius: 22px; background: rgba(11,12,14,.9); border: 3px solid var(--gold); box-shadow: 8px 8px 0 #ffd16644; display: grid; gap: 12px; text-align: center; animation: fallIn .4s ease-out; margin-top: 18cqh; }
.sum-kicker { font: 900 30px var(--head); color: var(--gold); }
.sum-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sum-stats div { display: grid; padding: 6px; border-radius: 12px; background: #ffffff0d; }
.sum-stats b { font: 800 24px var(--head); } .sum-stats span { font: 700 11px var(--head); color: var(--muted); }
.sum-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.sum-lists h3 { margin: 0 0 4px; font: 800 13px var(--head); }
.sum-lists ol { margin: 0; padding-left: 18px; font: 700 13px var(--head); }
.sum-lists b { color: var(--lime); } .sum-lists div + div b { color: var(--coral); }
.sum-card small { color: var(--muted); font-weight: 600; }

/* Geschenk-Anzeige im Hochformat unten links, damit Hops in der Mitte frei bleibt */
html[data-game-orientation=hoch] body #cv-gifts { transform: scale(.8); transform-origin: top left; }
#watermark { position: fixed; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 4; pointer-events: none; padding: 4px 12px; border-radius: 999px; background: rgba(0,0,0,.6); font-size: 13px; font-weight: 800; white-space: nowrap; }

html[data-game-orientation=hoch] #banner { top: 35cqh; }
html[data-game-orientation=hoch] #fall { top: 64cqh; }
html[data-game-orientation=hoch] #fall b { font-size: 54px; }
html[data-game-orientation=hoch] #fall.big b { font-size: 84px; }
html[data-game-orientation=hoch] #banner b { font-size: 28px; }
@container (max-width: 980px) { html[data-game-orientation=quer] .top { left: 10px; transform: none; width: calc(100cqw - 160px); } }

/* Siegstand und Countdown */
.score { display: grid; justify-items: center; align-content: center; gap: 2px; padding: 6px 12px; border-radius: 18px; border: 2px solid var(--gold); background: rgba(11,12,14,.8); box-shadow: 5px 5px 0 #ffd16633; min-width: 112px; }
.sc-lbl { font: 700 9px var(--head); letter-spacing: .18em; color: var(--muted); }
#h-score, .sum-score { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; justify-content: center; }
.sc-up { font: 900 24px/1 var(--head); color: var(--lime); } .sc-down { font: 900 24px/1 var(--head); color: var(--coral); } .sc-colon { font: 900 20px/1 var(--head); color: #fff; }
.sc-hist { display: flex; gap: 2px; width: 100%; justify-content: center; margin-top: 2px; }
.sc-hist i { font-style: normal; font: 800 9px/14px var(--head); width: 14px; height: 14px; border-radius: 4px; text-align: center; color: #0b0c0e; }
.sc-hist i.w { background: var(--lime); } .sc-hist i.l { background: var(--coral); }
#h-time { font: 800 14px var(--head); color: #fff; font-variant-numeric: tabular-nums; }
#h-time.low { color: var(--coral); animation: pulse .6s ease-in-out infinite; }
html[data-game-orientation=hoch] .top { display: grid; grid-template-columns: 1fr 1fr; }
html[data-game-orientation=hoch] .top .teams { grid-column: 1 / -1; }
html[data-game-orientation=hoch] .score { min-width: 0; }
.sum-score { justify-content: center; }
.sum-score .sc-up, .sum-score .sc-down { font-size: 34px; }
#summit.lose .sum-card { border-color: var(--coral); box-shadow: 8px 8px 0 #ff5d4744; }
#summit.lose .sum-kicker { color: var(--coral); }
.sum-kicker { font-size: 24px !important; }
.sum-stats { grid-template-columns: repeat(4, 1fr) !important; }

/* Countdown ganz oben (Gipfel halten / Zeit läuft ab) */
#countdown { position: absolute; top: calc(var(--safe-top) + 6px); left: 50%; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 12px; padding: 8px 18px 8px 8px; border-radius: 999px; background: rgba(11,12,14,.92); border: 3px solid var(--gold); box-shadow: 0 0 0 4px #ffd16633, 0 0 40px #ffd16666; animation: cdIn .35s ease-out; }
#countdown.clock { border-color: var(--coral); box-shadow: 0 0 0 4px #ff5d4733, 0 0 40px #ff5d4766; }
#countdown.beat { transform: translateX(-50%) scale(1.08); }
#countdown { transition: transform .12s ease-out; }
#cd-ring { --p: 100; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--gold) calc(var(--p) * 1%), #ffffff1a 0); }
#countdown.clock #cd-ring { background: conic-gradient(var(--coral) calc(var(--p) * 1%), #ffffff1a 0); }
#cd-ring b { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: #0b0c0e; font: 900 38px/1 var(--head); color: #fff; font-variant-numeric: tabular-nums; }
.cd-txt { display: grid; gap: 2px; }
#cd-lbl { font: 900 20px var(--head); color: var(--gold); letter-spacing: .02em; white-space: nowrap; }
#countdown.clock #cd-lbl { color: var(--coral); }
#cd-sub { font: 700 13px var(--head); color: #e9ecef; white-space: nowrap; }
@keyframes cdIn { from { transform: translateX(-50%) translateY(-30px) scale(.7); opacity: 0; } }
html[data-game-orientation=hoch] #countdown { padding: 6px 14px 6px 6px; gap: 8px; }
html[data-game-orientation=hoch] #cd-ring { width: 60px; height: 60px; } html[data-game-orientation=hoch] #cd-ring b { width: 48px; height: 48px; font-size: 30px; }
html[data-game-orientation=hoch] #cd-lbl { font-size: 16px; }
#countdown:not([hidden]) ~ .top { opacity: .35; }
html[data-game-orientation=hoch] #taphint { bottom: auto; top: 62cqh; font-size: 12px; }

/* TikTok-Hochformat: TikTok überdeckt oben 12 %, unten 26 % (Kommentare, Geschenke) und rechts 52–74 % (Symbole).
   Alles Wichtige liegt deshalb zwischen 12 % und 74 % und nicht rechts unten. */
html[data-game-orientation=hoch] .meter { top: calc(var(--safe-top) + 160px); bottom: 50cqh; right: 10px; }
html[data-game-orientation=hoch] #feed { bottom: 27cqh; width: min(250px, 62cqw); }
html[data-game-orientation=hoch] #feed .fi { font-size: 12px; padding: 3px 8px; }
html[data-game-orientation=hoch] #feed .fi:nth-child(n+4) { display: none; }
html[data-game-orientation=hoch] #taphint { top: auto; bottom: 27cqh; left: auto; right: 15cqw; transform: none; }
html[data-game-orientation=hoch] .sum-card { margin-top: 0; margin-bottom: 14cqh; }
html[data-facecam="oben"][data-game-orientation=hoch] #feed { bottom: 27cqh; }

/* ---------- Hochformat, überarbeitet (17.11.2026) ----------
   Handy (direkt gespielt): volle Fläche, kompakte Anzeige oben, Feed unten.
   Stream-Fenster (html[data-stream]): zusätzlich TikTok-Ränder frei (oben 11 %, unten 27 %). */
html[data-game-orientation=hoch] { --safe-top: 0px; }
html[data-stream][data-game-orientation=hoch] { --safe-top: 11cqh; }
html[data-facecam="oben"][data-game-orientation=hoch] { --safe-top: 0px; }
html[data-game-orientation=hoch] .top { top: calc(var(--safe-top) + 8px); left: 8px; transform: none; width: calc(100cqw - 62px); display: grid; grid-template-columns: 1fr auto; gap: 5px; }
html[data-game-orientation=hoch] .alt { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; column-gap: 6px; padding: 3px 10px 5px; border-radius: 14px; box-shadow: 3px 3px 0 #d1ff6933; min-width: 0; }
html[data-game-orientation=hoch] .alt .biome { flex-basis: 100%; text-align: center; font-size: 10px; }
html[data-game-orientation=hoch] .alt .num b { font-size: 28px; }
html[data-game-orientation=hoch] .alt .num small { font-size: 12px; white-space: nowrap; }
html[data-game-orientation=hoch] .alt .lbl { display: none; }
html[data-game-orientation=hoch] .score { padding: 3px 10px; border-radius: 14px; box-shadow: 3px 3px 0 #ffd16633; }
html[data-game-orientation=hoch] .sc-lbl, html[data-game-orientation=hoch] #h-score .sc-hist { display: none; }
html[data-game-orientation=hoch] #h-score .sc-up, html[data-game-orientation=hoch] #h-score .sc-down { font-size: 20px; }
html[data-game-orientation=hoch] #h-time { font-size: 12px; }
html[data-game-orientation=hoch] .teams { padding: 5px 10px; border-radius: 14px; gap: 3px; }
html[data-game-orientation=hoch] .t-row { font-size: 10px; }
html[data-game-orientation=hoch] .t-row b { font-size: 13px; }
html[data-game-orientation=hoch] .t-bar { height: 7px; }
html[data-game-orientation=hoch] .tops { font-size: 10px; }
html[data-game-orientation=hoch] .hud-buttons { top: calc(var(--safe-top) + 8px); right: 8px; gap: 5px; }
html[data-game-orientation=hoch] .hud-buttons button { width: 36px; height: 36px; font-size: 15px; border-radius: 10px; }
html[data-game-orientation=hoch] #h-status { top: calc(var(--safe-top) + 132px); }
html[data-game-orientation=hoch] .meter { top: calc(var(--safe-top) + 140px); bottom: 30cqh; right: 10px; }
html[data-game-orientation=hoch] body #cv-gifts { top: calc(var(--cv-cam-top, 0px) + var(--safe-top) + 21cqh); transform: scale(.78); }
html[data-game-orientation=hoch] #feed { bottom: 10px; width: min(250px, 66cqw); }
html[data-game-orientation=hoch] #feed .fi:nth-child(n+4) { display: none; }
html[data-game-orientation=hoch] #taphint { top: auto; bottom: 30cqh; left: 50%; right: auto; transform: translateX(-50%); }
html[data-game-orientation=hoch] #banner b { font-size: 24px; }
html[data-game-orientation=hoch] #banner span { font-size: 12px; }
html[data-game-orientation=hoch] .sum-card { margin: 0; }
html[data-game-orientation=hoch] #countdown { top: calc(var(--safe-top) + 4px); }
/* Stream-Fenster im Hochformat: unten liegen TikTok-Kommentare, rechts die Symbole */
html[data-stream][data-game-orientation=hoch] .meter { bottom: 50cqh; }
html[data-stream][data-game-orientation=hoch] #feed { bottom: 27cqh; }
html[data-stream][data-game-orientation=hoch] #feed .fi:nth-child(n+3) { display: none; }
html[data-stream] #taphint { display: none; }
html[data-stream][data-game-orientation=hoch] .sum-card { margin-bottom: 14cqh; }
html[data-game-orientation=hoch] #countdown { max-width: calc(100cqw - 70px); left: calc(50% - 26px); }
html[data-game-orientation=hoch] #cd-sub { font-size: 11px; white-space: normal; }
