* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d1117; color: #f2f2f2;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none;
  touch-action: none; -webkit-user-select: none; user-select: none; }
#c { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
.hidden { display: none !important; }

/* Start-/Pause-Overlay */
#overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(20,24,32,.72), rgba(8,10,14,.92)); z-index: 20; padding: 16px; }
.card { width: min(560px, 100%); max-height: 100%; overflow: auto; background: rgba(22,26,34,.92);
  border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 22px 22px 18px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.logo { font-size: 44px; line-height: 1; }
h1 { margin: 8px 0 2px; font-size: 26px; letter-spacing: .3px; }
.sub { margin: 0 0 16px; color: #ffb4ab; font-size: 14px; }
#loading { margin: 10px 0 16px; }
.bar { height: 8px; background: rgba(255,255,255,.1); border-radius: 8px; overflow: hidden; }
#barFill { height: 100%; width: 0; background: linear-gradient(90deg, #d32f2f, #ff8a65); transition: width .2s; }
#loadText { font-size: 13px; color: #b9c0cc; margin-top: 8px; }
#btnStart { font-size: 20px; font-weight: 700; padding: 14px 34px; border: 0; border-radius: 14px; cursor: pointer;
  color: #fff; background: linear-gradient(180deg, #e53935, #b71c1c); box-shadow: 0 6px 18px rgba(183,28,28,.45);
  margin: 4px 0 14px; }
#btnStart:active { transform: translateY(1px); }
.help { font-size: 13.5px; line-height: 1.55; color: #cfd6e2; text-align: left; background: rgba(255,255,255,.04);
  border-radius: 12px; padding: 10px 12px; }
.help .mob { display: none; }
body.touch .help .mob { display: block; }
body.touch .help .desk { display: none; }
kbd { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 4px; background: #2d3340;
  border: 1px solid #454d5c; font-size: 12px; text-align: center; }
.opts { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; margin-top: 12px; font-size: 13px; color: #b9c0cc; }
.opts input[type=range] { vertical-align: middle; width: 110px; }
.link { background: none; border: 0; color: #ff8a65; margin-top: 10px; font-size: 14px; cursor: pointer; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 8; }
#room { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.45); padding: 6px 14px; border-radius: 20px; font-size: 14px; font-weight: 600;
  letter-spacing: .2px; white-space: nowrap; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px;
  border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 0 0 2px rgba(0,0,0,.35); }
#prompt { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); background: rgba(0,0,0,.6);
  padding: 8px 14px; border-radius: 10px; font-size: 15px; }
body.touch #prompt { display: none; }
.hudbtn { pointer-events: auto; position: absolute; top: calc(8px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right));
  width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 22px; }

/* Touch */
#touch { position: fixed; inset: 0; z-index: 6; }
#stickZone { position: absolute; left: 0; bottom: 0; width: 45%; height: 70%; }
#lookZone { position: absolute; right: 0; top: 0; width: 55%; height: 100%; }
#stickBase { position: absolute; width: 130px; height: 130px; margin: -65px 0 0 -65px; border-radius: 50%;
  background: rgba(255,255,255,.10); border: 2px solid rgba(255,255,255,.25); left: 110px; bottom: 40px; top: auto;
  opacity: .55; transition: opacity .15s; }
#stickBase.active { opacity: 1; }
#stickKnob { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%;
  background: rgba(255,255,255,.55); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.tbtn { position: absolute; border: 0; color: #fff; font-weight: 700; border-radius: 50%; z-index: 7;
  background: rgba(211,47,47,.85); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
#btnAction { right: calc(28px + env(safe-area-inset-right)); bottom: calc(40px + env(safe-area-inset-bottom));
  width: 96px; height: 96px; font-size: 16px; }
#btnRun { right: calc(140px + env(safe-area-inset-right)); bottom: calc(34px + env(safe-area-inset-bottom));
  width: 58px; height: 58px; font-size: 24px; background: rgba(40,44,52,.7); }
#btnRun.on { background: rgba(255,138,101,.9); }

.opts select { font: inherit; color: #f2f2f2; background: #2d3340; border: 1px solid #454d5c; border-radius: 8px;
  padding: 4px 6px; margin-left: 4px; }
#qInfo { margin-top: 8px; font-size: 12px; color: #8f98a8; }
#btnView { right: calc(140px + env(safe-area-inset-right)); bottom: calc(34px + env(safe-area-inset-bottom));
  width: 58px; height: 58px; font-size: 24px; background: rgba(40,44,52,.7); }
#btnNight { right: calc(62px + env(safe-area-inset-right)); font-size: 20px; }
#btnBlau { right: calc(206px + env(safe-area-inset-right)); bottom: calc(34px + env(safe-area-inset-bottom));
  width: 58px; height: 58px; font-size: 24px; background: rgba(40,44,52,.7); }
#btnBlau.on { background: rgba(40,90,255,.9); }

.credits { font-size: 11px; opacity: 0.7; margin: 6px 0 2px; }
.credits a { color: inherit; }
