/* KLOTZTURM – Spielfläche und HUD im Klötzchen-Look: eckige Kästen, harte Pixel-Schatten, kräftige Farben.
   Menü und Einstellungen: ../_sdk/menu.css (für alle Spiele gleich). */
:root { --ink: #1d2433; --bau: #5fd068; --boom: #ff5d47; --gold: #ffd23f; --paper: #fff; --safe-top: 0px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1d2433; 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; inset: var(--cv-cam-top, 0px) 0 var(--cv-cam-bottom, 0px) 0; z-index: 20; pointer-events: none; container-type: size; font-weight: 900; }
html[data-stream][data-game-orientation=hoch] { --safe-top: 11cqh; }
html[data-facecam="oben"][data-game-orientation] { --safe-top: 0px; }
.top { position: absolute; top: calc(var(--safe-top) + 10px); left: 10px; right: 64px; display: grid; grid-template-columns: auto auto 1fr; gap: 8px; }
.fill, .score, .teams { background: rgba(29,36,51,.86); border: 3px solid #0d1119; box-shadow: 4px 4px 0 #0d1119, inset 0 0 0 2px rgba(255,255,255,.12); padding: 6px 12px; display: grid; align-content: center; }
.lbl { font-size: 10px; letter-spacing: .18em; color: #a9b3c7; }
.fill b { font-size: 34px; line-height: 1; color: var(--gold); text-shadow: 3px 3px 0 #0d1119; }
.fill small, .score small { font-size: 12px; color: #dfe6f2; }
.bar { height: 8px; margin-top: 4px; background: #0d1119; } .bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--gold) 0 8px, #e8a90f 8px 16px); transition: width .2s; }
.score b { font-size: 20px; text-shadow: 2px 2px 0 #0d1119; } .score b i { font-style: normal; color: #a9b3c7; }
#h-time.low { color: var(--boom); animation: blink .6s steps(2) infinite; }
.teams .row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; white-space: nowrap; }
.up { color: var(--bau); } .down { color: var(--boom); } .row b { color: #fff; font-size: 15px; }
.tbar { height: 10px; background: var(--boom); border: 2px solid #0d1119; margin: 3px 0; } .tbar i { display: block; height: 100%; width: 50%; background: var(--bau); transition: width .3s; }
.tops { font-size: 11px !important; color: #dfe6f2; font-weight: 700; } .tops span { overflow: hidden; text-overflow: ellipsis; max-width: 49%; }
#h-status { position: absolute; top: calc(var(--safe-top) + 118px); left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
#h-status span { background: var(--gold); color: #1d2433; border: 3px solid #0d1119; box-shadow: 3px 3px 0 #0d1119; padding: 2px 8px; font-size: 12px; }
#banner { position: absolute; left: 50%; top: 30cqh; transform: translate(-50%, -50%) scale(.9); display: grid; justify-items: center; gap: 6px; opacity: 0; transition: opacity .2s, transform .2s; width: max-content; max-width: 92cqw; text-align: center; }
#banner.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#banner b { font-size: 34px; line-height: 1.05; text-shadow: 3px 3px 0 #0d1119, -2px -2px 0 #0d1119, 2px -2px 0 #0d1119, -2px 2px 0 #0d1119; letter-spacing: .02em; }
#banner span { background: rgba(29,36,51,.9); border: 3px solid #0d1119; padding: 3px 12px; font-size: 14px; }
#feed { position: absolute; left: 10px; bottom: 12px; display: grid; gap: 5px; width: min(300px, 70cqw); }
.fi { display: flex; gap: 6px; align-items: center; padding: 4px 10px; background: rgba(29,36,51,.88); border: 3px solid #0d1119; border-left: 8px solid #a9b3c7; font-size: 13px; animation: fin .25s steps(4); }
.fi span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .fi i { font-style: normal; }
.fi.hilf { border-left-color: var(--bau); } .fi.stoer { border-left-color: var(--boom); }
.fi:nth-child(n+4) { opacity: .6; }
@keyframes fin { from { transform: translateX(-24px); opacity: 0; } }
#pops .pop { position: absolute; transform: translate(-50%, -50%); font-size: 24px; text-shadow: 3px 3px 0 #0d1119; white-space: nowrap; animation: up 1.5s ease-out forwards; }
#pops .pop.big { font-size: 40px; }
@keyframes up { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -170%); } }
#flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
#taphint { position: absolute; left: 50%; bottom: 18cqh; transform: translateX(-50%); padding: 6px 14px; background: rgba(29,36,51,.86); border: 3px solid #0d1119; font-size: 13px; animation: blink 1.6s steps(2) infinite; white-space: nowrap; }
@keyframes blink { 50% { opacity: .55; } }
.demo #taphint, .obs #taphint, html[data-stream] #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; }
.hud-buttons button { width: 42px; height: 42px; padding: 0; border: 3px solid #0d1119; background: #2c3549; color: #fff; font-size: 17px; box-shadow: 3px 3px 0 #0d1119; cursor: pointer; }
.demo .hud-buttons, .obs .hud-buttons { display: none; }
#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: 6px 16px 6px 6px; background: #1d2433; border: 4px solid var(--gold); box-shadow: 5px 5px 0 #0d1119; }
#countdown.clock { border-color: var(--boom); }
#cd-n { width: 58px; height: 58px; display: grid; place-items: center; background: var(--gold); color: #1d2433; font-size: 38px; border: 3px solid #0d1119; }
#countdown.clock #cd-n { background: var(--boom); color: #fff; }
#cd-lbl { font-size: 18px; white-space: nowrap; }
#countdown:not([hidden]) ~ .top { opacity: .35; }
#end { position: absolute; inset: 0; display: grid; place-items: center; }
#end .card { width: min(460px, 92cqw); padding: 16px; background: #1d2433; border: 4px solid var(--gold); box-shadow: 8px 8px 0 #0d1119; display: grid; gap: 12px; text-align: center; animation: fin .3s steps(4); }
#end.lose .card { border-color: var(--boom); }
.kicker { font-size: 22px; color: var(--gold); text-shadow: 2px 2px 0 #0d1119; } #end.lose .kicker { color: var(--boom); }
.cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; } .cells div { display: grid; background: #2c3549; border: 3px solid #0d1119; padding: 6px 2px; }
.cells b { font-size: 20px; } .cells span { font-size: 10px; color: #a9b3c7; }
.lists { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; } .lists h3 { margin: 0 0 4px; font-size: 13px; } .lists ol { margin: 0; padding-left: 18px; font-size: 13px; font-weight: 700; }
.lists b { color: var(--bau); } .lists div + div b { color: var(--boom); }
#end small { color: #a9b3c7; font-weight: 700; }
#watermark { position: fixed; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 4; pointer-events: none; padding: 4px 12px; background: rgba(0,0,0,.6); font-size: 13px; font-weight: 800; white-space: nowrap; }
/* Hochformat: kompakt, Teams unter Füllstand und Siegen, Feed rechts unten, Geschenk-Anzeige links unten */
html[data-game-orientation=hoch] .top { grid-template-columns: 1fr auto; right: 62px; gap: 6px; }
html[data-game-orientation=hoch] .teams { grid-column: 1 / -1; padding: 4px 10px; }
html[data-game-orientation=hoch] .fill b { font-size: 28px; }
html[data-game-orientation=hoch] #h-status { top: calc(var(--safe-top) + 174px); }
html[data-game-orientation=hoch] #banner b { font-size: 26px; }
html[data-game-orientation=hoch] body #cv-gifts { top: auto; bottom: calc(var(--cv-cam-bottom, 0px) + 10px); transform: scale(.74); transform-origin: bottom left; }
html[data-game-orientation=hoch] #feed { left: auto; right: 10px; width: min(220px, 50cqw); }
html[data-game-orientation=hoch] #feed .fi:nth-child(n+4) { display: none; }
html[data-stream][data-game-orientation=hoch] #feed, html[data-stream][data-game-orientation=hoch] body #cv-gifts { bottom: calc(27cqh + 6px); }

/* Steuerkreuz (Selbst steuern) */
#pad { position: absolute; right: 14px; bottom: 16px; width: 168px; height: 168px; pointer-events: auto; }
#pad button { position: absolute; width: 54px; height: 54px; border: 3px solid #0d1119; background: rgba(44,53,73,.92); color: #fff; font-size: 20px; box-shadow: 3px 3px 0 #0d1119; touch-action: none; }
#pad button:active { background: #ffd23f; color: #1d2433; }
#pad [data-dir="0,-1"] { left: 57px; top: 0; } #pad [data-dir="0,1"] { left: 57px; bottom: 0; } #pad [data-dir="-1,0"] { left: 0; top: 57px; } #pad [data-dir="1,0"] { right: 0; top: 57px; }
#pad .build { left: 57px; top: 57px; background: #5fd068; font-size: 22px; }
html[data-game-orientation=hoch] #pad { bottom: calc(27cqh + 10px); transform: scale(.9); transform-origin: bottom right; }
html[data-game-orientation=hoch] #hud:has(#pad:not([hidden])) #feed { display: none; }
