/* LICHT AUS – Grusel-Look: fast schwarz, warmes Taschenlampen-Bernstein für Team Licht, dunkles Rot für Team Dunkel.
   Menü und Einstellungen: ../_sdk/menu.css (für alle Spiele gleich). */
:root { --ink: #0b0a0d; --licht: #ffc35a; --dunkel: #e0303f; --paper: #efe7d6; --mute: #9b9282; --safe-top: 0px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; 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; }

/* Bild-Effekte über dem Spiel */
#fx { position: fixed; inset: var(--cv-cam-top, 0px) 0 var(--cv-cam-bottom, 0px) 0; z-index: 10; pointer-events: none; }
#fx > div { position: absolute; inset: 0; }
#vignette { background: radial-gradient(ellipse at 50% 50%, transparent 45%, rgba(0,0,0,.55) 78%, rgba(0,0,0,.9) 100%); }
#danger { background: radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(150,0,10,.65) 100%); opacity: 0; }
#grain { opacity: .09; background-size: 160px 160px; mix-blend-mode: screen; animation: grain .5s steps(4) infinite; }
@keyframes grain { 0% { background-position: 0 0; } 25% { background-position: -40px 30px; } 50% { background-position: 50px -20px; } 75% { background-position: -20px -50px; } }
#flash { background: #fff; opacity: 0; }
#fade { background: #000; opacity: 0; }
html[data-bg="gruen"] #fx, html[data-bg="durchsichtig"] #fx { display: none; }

#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: 800; }
html[data-stream][data-game-orientation=hoch] { --safe-top: 11cqh; }
html[data-facecam="oben"][data-game-orientation] { --safe-top: 0px; }
.panel, .fuses, .life, .teams { background: rgba(10,8,10,.72); border: 1px solid rgba(255,195,90,.22); border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.6); backdrop-filter: blur(3px); }
.top { position: absolute; top: calc(var(--safe-top) + 10px); left: 10px; right: 64px; display: grid; grid-template-columns: auto auto 1fr; gap: 8px; }
.fuses, .life, .teams { padding: 6px 12px; display: grid; align-content: center; }
.lbl { font-size: 10px; letter-spacing: .2em; color: var(--mute); }
.fuses b { font-size: 30px; line-height: 1; color: var(--licht); text-shadow: 0 0 14px rgba(255,180,60,.55); }
#h-slots { display: flex; gap: 4px; margin-top: 5px; }
#h-slots i { width: 14px; height: 8px; border-radius: 3px; background: #2a2420; border: 1px solid #4a4038; }
#h-slots i.carry { background: #8a6420; border-color: var(--licht); }
#h-slots i.in { background: var(--licht); box-shadow: 0 0 8px var(--licht); border-color: #fff2c8; }
.fuses small, .life small { font-size: 12px; color: #d9cfbd; font-weight: 700; }
.life b { font-size: 18px; letter-spacing: 1px; }
.batt { height: 7px; margin: 5px 0 3px; background: #1d1916; border-radius: 4px; overflow: hidden; width: 110px; }
.batt i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ffcf6e, #ffe9b0); transition: width .3s; }
.batt i.low { background: var(--dunkel); animation: blink .7s steps(2) infinite; }
#h-time.low { color: var(--dunkel); 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(--licht); } .down { color: var(--dunkel); } .row b { color: #fff; font-size: 15px; }
.tbar { height: 8px; background: var(--dunkel); border-radius: 4px; overflow: hidden; margin: 4px 0; } .tbar i { display: block; height: 100%; width: 50%; background: var(--licht); transition: width .3s; }
.tops { font-size: 11px !important; color: #d9cfbd; font-weight: 700; } .tops span { overflow: hidden; text-overflow: ellipsis; max-width: 49%; }
#h-status { position: absolute; top: calc(var(--safe-top) + 92px); left: 10px; display: flex; gap: 6px; flex-wrap: wrap; max-width: 70cqw; }
#h-status span { background: rgba(10,8,10,.8); color: var(--paper); border: 1px solid rgba(255,255,255,.15); border-radius: 20px; padding: 3px 10px; font-size: 12px; }
#h-status span.bad { border-color: var(--dunkel); color: #ffb0b6; } #h-status span.good { border-color: var(--licht); color: #ffe3ad; }
#h-status span.seen { background: var(--dunkel); color: #fff; animation: blink .5s steps(2) infinite; }
#banner { position: absolute; left: 50%; top: 32cqh; transform: translate(-50%, -50%) scale(.94); display: grid; justify-items: center; gap: 6px; opacity: 0; transition: opacity .35s, transform .35s; width: max-content; max-width: 92cqw; text-align: center; }
#banner.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#banner b { font-family: Georgia, 'Times New Roman', serif; font-size: 36px; line-height: 1.05; letter-spacing: .04em; text-shadow: 0 0 18px rgba(0,0,0,.9), 0 2px 2px #000; }
#banner span { background: rgba(10,8,10,.78); border-radius: 20px; padding: 3px 14px; font-size: 14px; }
#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; background: rgba(10,8,10,.7); border-radius: 8px; border-left: 4px solid var(--mute); font-size: 13px; animation: fin .3s ease-out; }
.fi span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .fi i { font-style: normal; }
.fi.hilf { border-left-color: var(--licht); } .fi.stoer { border-left-color: var(--dunkel); }
.fi:nth-child(n+4) { opacity: .55; }
@keyframes fin { from { transform: translateX(-20px); opacity: 0; } }
#kompass { position: absolute; left: 50%; top: calc(var(--safe-top) + 100px); transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; color: var(--licht); text-shadow: 0 0 12px rgba(255,180,60,.8); }
#k-arrow { font-style: normal; font-size: 40px; display: block; transition: transform .1s linear; }
#k-dist { font-size: 13px; }
#stamina { position: absolute; left: 50%; bottom: 14cqh; transform: translateX(-50%); width: 140px; height: 5px; background: rgba(255,255,255,.12); border-radius: 3px; overflow: hidden; }
#stamina i { display: block; height: 100%; background: #d9cfbd; }
#taphint { position: absolute; left: 50%; bottom: 18cqh; transform: translateX(-50%); padding: 6px 14px; background: rgba(10,8,10,.75); border-radius: 20px; font-size: 13px; animation: blink 1.6s steps(2) infinite; white-space: nowrap; }
@keyframes blink { 50% { opacity: .5; } }
.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: 1px solid rgba(255,255,255,.18); border-radius: 10px; background: rgba(20,17,20,.85); color: #fff; font-size: 17px; cursor: pointer; }
.demo .hud-buttons, .obs .hud-buttons { display: none; }
#end { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
#end .card { width: min(460px, 92cqw); padding: 18px; background: rgba(10,8,10,.9); border: 1px solid var(--licht); border-radius: 14px; box-shadow: 0 0 60px rgba(255,180,60,.25); display: grid; gap: 12px; text-align: center; animation: fin .4s ease-out; }
#end.lose .card { border-color: var(--dunkel); box-shadow: 0 0 60px rgba(200,20,40,.3); }
.kicker { font-family: Georgia, serif; font-size: 22px; color: var(--licht); } #end.lose .kicker { color: var(--dunkel); }
.cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; } .cells div { display: grid; background: #1a1618; border-radius: 8px; padding: 6px 2px; }
.cells b { font-size: 20px; } .cells span { font-size: 10px; color: var(--mute); }
.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(--licht); } .lists div + div b { color: var(--dunkel); }
#end small { color: var(--mute); font-weight: 700; }
#watermark { position: fixed; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 24; pointer-events: none; padding: 4px 12px; background: rgba(0,0,0,.6); font-size: 13px; font-weight: 800; white-space: nowrap; }
/* Geschenk-Anzeige im Grusel-Look */
body #cv-gifts { filter: sepia(.25) saturate(.9); }

/* Hochformat: kompakt, Teams unter Sicherungen und Leben, 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] .fuses b { font-size: 26px; }
html[data-game-orientation=hoch] #h-status { top: calc(var(--safe-top) + 156px); }
html[data-game-orientation=hoch] #kompass { top: calc(var(--safe-top) + 190px); }
html[data-game-orientation=hoch] #banner b { font-size: 27px; }
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); }

/* Selbst steuern am Handy: Steuer-Hinweise */
#touchhint { position: absolute; inset: auto 0 10cqh 0; display: flex; justify-content: space-between; padding: 0 8cqw; font-size: 12px; color: rgba(255,255,255,.45); pointer-events: none; }
#stick { position: absolute; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); pointer-events: none; }
#stick i { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(255,255,255,.3); }

/* Im Schrank: Blick durch die Lamellen */
#slats { opacity: 0; transition: opacity .35s; background: linear-gradient(90deg, transparent 49.2%, rgba(0,0,0,.97) 49.2% 50.8%, transparent 50.8%), linear-gradient(90deg, #000 0, rgba(0,0,0,.85) 12%, transparent 30%, transparent 70%, rgba(0,0,0,.85) 88%, #000 100%), repeating-linear-gradient(176deg, rgba(10,7,5,.93) 0 17px, rgba(0,0,0,.05) 17px 34px); }
#hidebtn { position: absolute; left: 50%; bottom: 20cqh; transform: translateX(-50%); pointer-events: auto; padding: 10px 18px; border-radius: 24px; border: 1px solid var(--licht); background: rgba(10,8,10,.85); color: var(--licht); font: 800 15px system-ui, sans-serif; cursor: pointer; }
.obs #hidebtn, .demo #hidebtn { display: none; }
/* Stream-Hochformat: rechts zwischen 52 und 74 % liegen TikToks Knöpfe → Feed in die freie Mitte neben die Geschenk-Anzeige */
html[data-stream][data-game-orientation=hoch] #feed { right: auto; left: 30cqw; width: 50cqw; }
/* Aufgeräumt: kleine Effekt-Symbole, schmalere Einblendung (läuft nicht über die Geschenk-Anzeige) */
#h-status span { padding: 2px 8px; font-size: 13px; }
#banner { max-width: min(54cqw, 680px); }
#banner b { font-size: 30px; }
#banner span { font-size: 13px; }
html[data-game-orientation=hoch] #banner { max-width: 88cqw; top: 36cqh; }
html[data-game-orientation=hoch] #banner b { font-size: 24px; }
/* Geschenke-Liste (gemeinsamer Baustein) in den Spielfarben */
:root { --cv-feed-help: #ffc35a; --cv-feed-stoer: #e0303f; --cv-feed-bg: rgba(10,8,10,.78); }
