/* game.css - Lumenfall palette: abyss indigo, mint glow, amber sub, magenta hazards. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  background: #03101a; color: #cfeef7;
  -webkit-user-select: none; user-select: none;
}
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.panel {
  position: absolute; padding: 10px 14px; border-radius: 10px;
  background: rgba(4, 22, 34, 0.72); border: 1px solid rgba(64, 178, 200, 0.35);
  backdrop-filter: blur(3px); font-size: 14px; min-width: 160px;
}
.panel.tl { top: 12px; left: 12px; }
.panel.tr { top: 12px; right: 12px; min-width: 200px; }
.panel.bl { bottom: 12px; left: 12px; }
.row { display: flex; justify-content: space-between; gap: 16px; line-height: 1.7; }
.lbl { color: #6fc7d8; letter-spacing: 0.12em; font-size: 11px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.bar-row .lbl { width: 58px; }
.bar { flex: 1; height: 10px; border-radius: 6px; background: rgba(20, 60, 80, 0.6); overflow: hidden; }
.bar div { height: 100%; width: 100%; border-radius: 6px; transition: width 0.25s; }
#bar-o2 { background: linear-gradient(90deg, #2fffd0, #7cf6ff); }
#bar-hull { background: linear-gradient(90deg, #ffc23c, #ffe9a8); }
#bar-energy { background: linear-gradient(90deg, #3fa9ff, #9bd2ff); }

#toast {
  position: absolute; top: 18%; left: 50%; transform: translateX(-50%);
  padding: 8px 22px; border-radius: 20px; font-size: 16px; letter-spacing: 0.05em;
  background: rgba(8, 40, 52, 0.85); border: 1px solid rgba(58, 255, 196, 0.5);
  color: #a8ffdf; opacity: 0; transition: opacity 0.3s; white-space: nowrap;
}
#toast.show { opacity: 1; }

.corner-btn {
  position: absolute; bottom: 14px; right: 14px; width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid rgba(64, 178, 200, 0.5);
  background: rgba(4, 22, 34, 0.72); color: #cfeef7; font-size: 18px; cursor: pointer;
  pointer-events: auto;
}
.corner-btn:hover { background: rgba(20, 60, 80, 0.9); }

#touch {
  position: fixed; left: 0; right: 0; bottom: 64px; z-index: 6;
  display: flex; justify-content: space-between; padding: 0 10px;
  pointer-events: none;
}
.tc-cluster { display: flex; gap: 8px; pointer-events: auto; }
.tc {
  width: 62px; height: 52px; border-radius: 10px; font-size: 10px; line-height: 1.35;
  background: rgba(8, 40, 56, 0.55); border: 1px solid rgba(94, 200, 224, 0.45);
  color: #9fdcea; cursor: pointer; touch-action: none;
}
.tc.on, .tc:active { background: rgba(47, 255, 208, 0.35); color: #eafff6; }
@media (hover: hover) and (min-width: 900px) { #touch { opacity: 0.45; } }

.overlay {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center;
  justify-content: center; background: rgba(2, 10, 18, 0.78); backdrop-filter: blur(4px);
}
.overlay.hidden, .hidden { display: none; }
.card {
  max-width: 620px; width: calc(100% - 32px); padding: 28px 30px; border-radius: 16px;
  background: linear-gradient(160deg, rgba(10, 44, 62, 0.97), rgba(4, 20, 32, 0.97));
  border: 1px solid rgba(58, 255, 196, 0.35); box-shadow: 0 0 60px rgba(20, 160, 140, 0.25);
  text-align: center;
}
.card h1 { font-size: 44px; letter-spacing: 0.18em; color: #a8ffdf; text-shadow: 0 0 24px rgba(47, 255, 208, 0.6); }
.card h2 { font-size: 26px; letter-spacing: 0.14em; color: #7cf6ff; }
.card .tag { color: #6fc7d8; margin: 6px 0 18px; font-style: italic; }
.rules p { text-align: left; font-size: 14px; line-height: 1.65; margin: 8px 0; color: #bfe6f2; }
.rules b { color: #a8ffdf; }
.big-btn {
  margin-top: 18px; padding: 14px 34px; font-size: 17px; letter-spacing: 0.1em;
  border-radius: 30px; border: none; cursor: pointer; font-weight: 700;
  background: linear-gradient(90deg, #22c98a, #2fffd0); color: #032018;
  box-shadow: 0 0 28px rgba(47, 255, 208, 0.45);
}
.big-btn:hover { filter: brightness(1.15); }
#flash {
  position: fixed; inset: 0; pointer-events: none; z-index: 8; opacity: 0;
  background: radial-gradient(circle at 50% 50%, transparent 45%, rgba(255, 40, 30, 0.55) 100%);
  transition: opacity 0.45s;
}
#flash.on { opacity: 1; transition: opacity 0.05s; }
#v-dir { display: inline-block; color: #a8ffdf; }
.score-line { font-size: 20px; color: #ffe9a8; margin-top: 10px; }
#end-score { font-size: 30px; color: #a8ffdf; }
