* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: #06101a;
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif; color: #cfe8f5; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#hud { position: fixed; inset: 0; pointer-events: none; }
#hud-top { position: absolute; top: 10px; left: 12px; right: 12px;
  display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.gauge { display: flex; align-items: center; gap: 6px; }
.lab { font-size: 11px; letter-spacing: 0.12em; color: #7fb8cf; }
.bar { width: 110px; height: 12px; border-radius: 7px; background: #0c2433;
  border: 1px solid #1e415a; overflow: hidden; }
#bar-oxygen, #bar-hull, #bar-scan { height: 100%; border-radius: 6px; width: 100%;
  transition: width 0.25s; }
#bar-oxygen { background: linear-gradient(90deg, #2fbf9b, #7ce0c2); }
#bar-hull { background: linear-gradient(90deg, #d9a441, #ffd23d); }
.bar.scan #bar-scan { background: linear-gradient(90deg, #4d8fd1, #9fe0ff); }
#hud-stats { margin-left: auto; text-align: right; font-size: 12px; line-height: 1.7;
  color: #7fb8cf; text-shadow: 0 1px 3px #000; }
#hud-stats b { color: #eef7fb; font-size: 15px; }

#hud-msg { position: absolute; top: 16%; left: 50%; transform: translateX(-50%);
  font-size: clamp(15px, 2.6vw, 22px); font-weight: 600; color: #bdf3de;
  text-shadow: 0 0 14px #17c99b, 0 2px 4px #000; opacity: 0; transition: opacity 0.5s;
  text-align: center; max-width: 92%; }

#touch-pad { position: absolute; right: 10px; bottom: 12px; display: flex; gap: 8px;
  pointer-events: auto; touch-action: none; user-select: none; }
.tcol { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.tcol-mid { gap: 8px; }
.tbtn { pointer-events: auto; touch-action: none; -webkit-user-select: none; user-select: none;
  width: 56px; height: 46px; border-radius: 12px; font-size: 17px; color: #cfe8f5;
  background: rgba(13, 40, 58, 0.55); border: 1px solid rgba(111, 184, 214, 0.5);
  backdrop-filter: blur(2px); display: flex; flex-direction: column; align-items: center;
  justify-content: center; line-height: 1; }
.tbtn small { font-size: 8px; letter-spacing: 0.1em; color: #7fb8cf; margin-top: 3px; }
.tbtn.big { width: 68px; height: 68px; border-radius: 50%; border-color: rgba(124, 224, 194, 0.7);
  color: #7ce0c2; font-size: 22px; }
.tbtn.on { background: rgba(60, 130, 160, 0.75); }

.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 90% at 50% 10%, rgba(10, 34, 50, 0.55), rgba(3, 12, 20, 0.92));
  z-index: 10; }
.panel { max-width: 640px; width: min(92%, 640px); padding: 28px 30px; text-align: center;
  background: rgba(9, 28, 42, 0.86); border: 1px solid #23506d; border-radius: 18px;
  box-shadow: 0 0 60px rgba(30, 120, 160, 0.25); }
.panel h1 { font-size: clamp(30px, 6vw, 46px); letter-spacing: 0.06em; color: #ffd98f;
  text-shadow: 0 0 24px rgba(255, 190, 90, 0.5); margin-bottom: 12px; }
.panel .tag { font-size: 15px; line-height: 1.55; color: #b9d9e8; margin-bottom: 14px; }
.keys { list-style: none; font-size: 13px; color: #86b6cc; line-height: 2; margin-bottom: 18px; }
.keys b { color: #ffd98f; }
.bigbtn { pointer-events: auto; font-size: 19px; font-weight: 700; letter-spacing: 0.04em;
  color: #06202e; background: linear-gradient(180deg, #8fe3c2, #4cc9a0);
  border: none; padding: 14px 34px; border-radius: 30px; cursor: pointer;
  box-shadow: 0 0 30px rgba(80, 200, 160, 0.45); }
.bigbtn:hover { filter: brightness(1.12); }
#end-text { font-size: 16px; line-height: 1.8; color: #b9d9e8; margin-bottom: 18px; }
#end-text b { color: #ffd98f; font-size: 20px; }
@media (max-width: 640px) {
  .bar { width: 74px; }
  #hud-stats { font-size: 10px; margin-left: 0; width: 100%; text-align: left; }
  .tbtn { width: 46px; height: 40px; font-size: 14px; }
  .tbtn.big { width: 58px; height: 58px; }
}
