/* The Hollow - Stile (frueher inline in index.html) */
:root { --red:#c8281e; --bone:#d9d2c3; --dim:#8a8478; }
* { box-sizing:border-box; }
html,body { margin:0; height:100%; overflow:hidden; background:#000; color:var(--bone);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; user-select:none; }
canvas { display:block; }
.hidden { display:none !important; }

/* ---------- HUD ---------- */
#hud { position:fixed; inset:0; pointer-events:none; }
#vignette { position:absolute; inset:0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 45%, rgba(0,0,0,.75) 100%); }
#danger { position:absolute; inset:0; opacity:0;
  background: radial-gradient(ellipse at center, rgba(170,0,0,0) 38%, rgba(170,0,0,.45) 70%, rgba(110,0,0,.9) 100%);
  box-shadow: inset 0 0 120px 30px rgba(140,0,0,.65); }
#objective { position:absolute; top:18px; left:20px; padding:10px 14px; min-width:220px;
  background:rgba(0,0,0,.45); border-left:3px solid var(--red); }
#objective .label { font-size:11px; letter-spacing:.25em; color:var(--dim); }
#objText { font-size:15px; margin-top:3px; }
#keys { margin-top:8px; display:flex; gap:8px; }
.keyslot { width:26px; height:26px; border:1px solid #444; border-radius:4px; display:flex;
  align-items:center; justify-content:center; font-size:15px; color:#333; background:rgba(0,0,0,.4); }
.keyslot.got { color:var(--c); border-color:var(--c); box-shadow:0 0 8px var(--c); }
#batteryBox { position:absolute; left:20px; bottom:22px; }
#battery { display:flex; align-items:center; gap:10px; }
.bicon { width:64px; height:24px; border:2px solid var(--bone); border-radius:3px; padding:2px; position:relative; }
.bicon::after { content:""; position:absolute; right:-7px; top:6px; width:4px; height:8px; background:var(--bone); border-radius:0 2px 2px 0; }
#bfill { height:100%; width:100%; background:#7bd36a; transition:background .3s; }
#bpct { font-size:20px; font-variant-numeric:tabular-nums; min-width:56px; }
#bstate { font-size:11px; letter-spacing:.2em; color:var(--dim); margin-top:6px; }
#bstate.warn { color:#ff5a3c; animation:blink .8s steps(2) infinite; }
#stamina { width:140px; height:4px; background:rgba(255,255,255,.12); margin-top:8px; }
#sfill { height:100%; width:100%; background:#bcb6a6; }
@keyframes blink { 50% { opacity:.25; } }
#crosshair { position:absolute; left:50%; top:50%; width:4px; height:4px; margin:-2px 0 0 -2px;
  border-radius:50%; background:rgba(255,255,255,.55); }
#crosshair.active { width:8px; height:8px; margin:-4px 0 0 -4px; background:transparent; border:2px solid #fff; }
#prompt { position:absolute; left:50%; top:calc(50% + 34px); transform:translateX(-50%);
  font-size:16px; padding:6px 12px; background:rgba(0,0,0,.55); border-radius:4px; white-space:nowrap; }
#prompt b { display:inline-block; border:1px solid var(--bone); border-radius:3px; padding:0 6px; margin-right:6px; }
#toast { position:absolute; left:50%; bottom:90px; transform:translateX(-50%); font-size:17px;
  padding:8px 16px; background:rgba(0,0,0,.6); border-radius:4px; opacity:0; transition:opacity .3s; white-space:nowrap; }
#toast.show { opacity:1; }
#fade { position:absolute; inset:0; background:#000; opacity:0; }
#flash { position:absolute; inset:0; background:#a00; opacity:0; mix-blend-mode:multiply; }

/* ---------- Screens ---------- */
.screen { position:fixed; inset:0; z-index:10; display:flex; flex-direction:column; align-items:center; justify-content:safe center; overflow-y:auto;
  background:radial-gradient(ellipse at center, rgba(20,10,10,.82), rgba(0,0,0,.96)); text-align:center; padding:16px; }
.screen h1 { font-family: Georgia, "Times New Roman", serif; font-weight:normal; letter-spacing:.35em;
  font-size:clamp(40px, 9vw, 92px); margin:0 0 6px; color:var(--bone); text-shadow:0 0 24px rgba(200,40,30,.55); }
.screen h1.gross { font-size:clamp(32px,7vw,64px); }
.screen p.klein { font-size:12px; }
.screen p.version { opacity:.6; margin-top:14px; }
.screen h2 { font-family: Georgia, serif; font-weight:normal; letter-spacing:.2em; font-size:clamp(26px,5vw,44px); margin:0 0 10px; }
.screen p { color:var(--dim); max-width:560px; line-height:1.5; margin:6px 0; }
.tag { letter-spacing:.3em; font-size:12px; color:var(--red); margin-bottom:26px; }
.controls { display:grid; grid-template-columns:auto auto; gap:6px 18px; margin:22px 0; text-align:left; font-size:14px; }
.controls kbd { display:inline-block; min-width:26px; text-align:center; border:1px solid #6d675c; border-radius:3px;
  padding:1px 6px; font-family:inherit; color:var(--bone); }
button { pointer-events:auto; font:inherit; letter-spacing:.2em; font-size:15px; color:var(--bone); background:transparent;
  border:1px solid var(--bone); padding:12px 34px; margin:8px; cursor:pointer; transition:background .2s, color .2s; }
button:hover { background:var(--bone); color:#000; }
.stats { font-size:15px; color:var(--bone); margin:8px 0 18px; }
#death h2 { color:var(--red); }
html, body, canvas { touch-action:none; -webkit-touch-callout:none; -webkit-tap-highlight-color:transparent; }

/* ---------- Touch controls (shown only on touch devices) ---------- */
.ctrl-touch { display:none; }
body.touch .ctrl-touch { display:grid; }
body.touch .ctrl-desk { display:none; }
#touch { position:fixed; inset:0; z-index:5; }
#touch .zone { position:absolute; top:0; bottom:0; }
#stickBase { position:absolute; width:130px; height:130px; margin:-65px 0 0 -65px; border-radius:50%;
  border:2px solid rgba(217,210,195,.35); background:rgba(0,0,0,.25); display:none; pointer-events:none; }
#stickKnob { position:absolute; left:50%; top:50%; width:56px; height:56px; margin:-28px 0 0 -28px; border-radius:50%;
  background:rgba(217,210,195,.45); }
#stickHint { position:absolute; left:calc(14px + env(safe-area-inset-left)); bottom:calc(16px + env(safe-area-inset-bottom)); font-size:11px; letter-spacing:.15em;
  color:rgba(217,210,195,.45); pointer-events:none; }
.tbtn { position:absolute; margin:0; padding:0; border-radius:50%; width:74px; height:74px; font-size:12px; letter-spacing:.08em;
  background:rgba(0,0,0,.4); border:2px solid rgba(217,210,195,.5); color:var(--bone); display:flex; align-items:center; justify-content:center; }
.tbtn:hover { background:rgba(0,0,0,.4); color:var(--bone); }
.tbtn.on { background:rgba(217,210,195,.85); color:#000; }
#tE { right:calc(24px + env(safe-area-inset-right)); bottom:calc(36px + env(safe-area-inset-bottom)); width:88px; height:88px; font-size:13px; }
#tE.ready { border-color:#fff; box-shadow:0 0 18px rgba(255,255,255,.55); background:rgba(217,210,195,.25); }
#tF { right:calc(126px + env(safe-area-inset-right)); bottom:calc(24px + env(safe-area-inset-bottom)); }
#tRun { right:calc(36px + env(safe-area-inset-right)); bottom:calc(140px + env(safe-area-inset-bottom)); }
#tPause { right:calc(16px + env(safe-area-inset-right)); top:calc(14px + env(safe-area-inset-top)); width:46px; height:46px; font-size:14px; }
body.touch #batteryBox { left:auto; bottom:auto; right:calc(76px + env(safe-area-inset-right)); top:calc(16px + env(safe-area-inset-top)); text-align:right; }
body.touch #battery { justify-content:flex-end; }
body.touch #stamina { margin-left:auto; width:110px; }
body.touch #objective { top:calc(14px + env(safe-area-inset-top)); left:calc(14px + env(safe-area-inset-left)); min-width:0; max-width:46vw; padding:8px 10px; }
body.touch #objText { font-size:13px; }
body.touch #toast { bottom:auto; top:26%; font-size:15px; max-width:80vw; white-space:normal; text-align:center; }
body.touch #prompt { font-size:14px; }
body.touch #prompt b { display:none; }
#rotate { display:none; position:fixed; left:0; right:0; top:0; z-index:20; padding:10px; text-align:center; font-size:13px;
  background:rgba(120,10,6,.85); color:#fff; pointer-events:none; }
@media (orientation: portrait) { body.touch #rotate { display:block; } }
@media (max-height: 500px) {
  .screen h1 { font-size:clamp(30px, 8vh, 60px); } .tag { margin-bottom:10px; } .controls { margin:10px 0; }
  .screen p { margin:3px 0; font-size:13px; } button { padding:9px 26px; margin:5px; }
}
