:root {
  --amber: #ffb454; --teal: #46f5c8; --red: #ff3355;
  --ink: #0a0b10; --paper: #d8d2c4;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; overflow: hidden; background: #000;
  font-family: "Trebuchet MS", "Gill Sans", Verdana, sans-serif; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

#hud { position: fixed; inset: 0; pointer-events: none; color: var(--paper);
  text-shadow: 0 1px 3px #000; }
#hud-top { position: absolute; top: 10px; left: 12px; display: flex; gap: 8px;
  flex-wrap: wrap; }
.hud-chip { background: rgba(8, 9, 14, 0.62); border: 1px solid #2a2f3d;
  border-radius: 8px; padding: 5px 10px; font-size: 13px; letter-spacing: 1px; }
.hud-chip b { color: var(--amber); font-size: 15px; }
#hud-bars { position: absolute; left: 12px; bottom: 14px; width: 150px; }
.bar-label { font-size: 10px; letter-spacing: 2px; opacity: 0.75; margin-bottom: 2px; }
.bar { height: 8px; background: rgba(20, 22, 30, 0.7); border: 1px solid #2a2f3d;
  border-radius: 5px; margin-bottom: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, #7a5a1e, var(--amber)); transition: width .25s; }
#b-stam { background: linear-gradient(90deg, #1d6b52, var(--teal)); }
#h-prompt { position: absolute; left: 50%; top: 64%; transform: translateX(-50%);
  background: rgba(8, 9, 14, 0.72); border: 1px solid #3a3f4d; color: var(--amber);
  padding: 7px 14px; border-radius: 8px; font-size: 15px; letter-spacing: 1px; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px;
  margin: -3px; border-radius: 50%; background: rgba(216, 210, 196, 0.55); }
#danger-vignette { position: absolute; inset: 0; opacity: 0; transition: opacity .3s;
  background: radial-gradient(ellipse at center,
    rgba(255, 30, 60, 0) 38%, rgba(190, 10, 40, 0.55) 100%); }

#overlay { position: fixed; inset: 0; display: flex; align-items: center;
  justify-content: center; background:
  radial-gradient(ellipse at 50% 38%, rgba(28, 18, 10, 0.92), rgba(2, 2, 5, 0.97));
  z-index: 10; }
#ov-card { max-width: 560px; width: min(92vw, 560px); text-align: center;
  color: var(--paper); padding: 28px 26px; border: 1px solid #33291c;
  border-radius: 16px; background: rgba(10, 9, 8, 0.75);
  box-shadow: 0 0 60px rgba(255, 140, 40, 0.12); }
#ov-title { font-size: clamp(30px, 8vw, 52px); letter-spacing: 8px;
  color: var(--amber); text-shadow: 0 0 18px rgba(255, 140, 40, 0.6); }
#ov-text { margin: 14px 0; font-size: 15px; line-height: 1.55; }
#ov-help { list-style: none; text-align: left; margin: 0 auto 18px;
  display: inline-block; font-size: 13.5px; line-height: 1.8; color: #b8c4b0; }
#ov-help b { color: var(--teal); }
#ov-btn { font: inherit; font-size: 17px; letter-spacing: 2px; cursor: pointer;
  color: #14100a; background: linear-gradient(180deg, #ffd08a, var(--amber));
  border: none; padding: 12px 30px; border-radius: 10px;
  box-shadow: 0 0 24px rgba(255, 160, 60, 0.45); }
#ov-btn:hover { filter: brightness(1.12); }

#touch-ui { position: fixed; inset: 0; z-index: 9; pointer-events: none;
  user-select: none; -webkit-user-select: none; touch-action: none; }
#stick { position: absolute; left: 18px; bottom: 20px; width: 118px; height: 118px;
  border-radius: 50%; background: rgba(20, 24, 34, 0.42);
  border: 2px solid rgba(120, 140, 170, 0.35); pointer-events: auto; }
#stick i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px;
  margin: -26px; border-radius: 50%; background: rgba(180, 190, 210, 0.35);
  border: 2px solid rgba(200, 210, 230, 0.5); }
#look-pad { position: absolute; right: 0; top: 0; width: 55%; height: 100%;
  pointer-events: auto; }
#touch-ui button { pointer-events: auto; font: inherit; cursor: pointer;
  color: var(--paper); background: rgba(20, 24, 34, 0.55);
  border: 2px solid rgba(255, 180, 84, 0.5); border-radius: 12px;
  font-size: 14px; letter-spacing: 1px; padding: 12px 14px; }
#t-interact { position: absolute !important; right: 20px; bottom: 150px;
  width: 62px; height: 62px; border-radius: 50% !important; font-size: 20px !important; }
#t-light { position: absolute !important; right: 22px; bottom: 82px; }
#t-sprint { position: absolute !important; right: 100px; bottom: 30px; }
@media (max-width: 640px) {
  #hud-top { top: 6px; left: 8px; }
  .hud-chip { font-size: 11px; padding: 4px 7px; }
  #h-prompt { top: 58%; font-size: 13px; }
}
