:root {
  --bg: #05060a;
  --ink: #e8e6dd;
  --dim: #8a8a82;
  --accent: #7cf9c2;
  --accent2: #4a7cff;
  --warn: #ff5a6e;
  --panel: rgba(12, 14, 22, 0.82);
  --line: rgba(124, 249, 194, 0.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "SF Mono", "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#game {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  cursor: crosshair;
}

.overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(20,24,38,0.55), rgba(5,6,10,0.92));
  backdrop-filter: blur(3px);
  z-index: 10;
}
.overlay.hidden { display: none; }

.panel {
  text-align: center;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 48px 56px;
  border-radius: 18px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.02), 0 30px 80px rgba(0,0,0,0.6);
  max-width: 92vw;
}
.panel.small { padding: 36px 44px; }

.logo {
  font-size: clamp(40px, 9vw, 84px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--ink);
}
.logo span { color: var(--accent); }
.logo.small { font-size: clamp(28px, 6vw, 52px); }

.tag {
  margin-top: 10px;
  color: var(--dim);
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.primary, .ghost {
  display: block;
  margin: 28px auto 0;
  width: 220px;
  padding: 14px 20px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.primary {
  background: var(--accent);
  color: #062018;
  border: none;
  box-shadow: 0 0 24px rgba(124,249,194,0.35);
}
.primary:hover { transform: translateY(-2px); box-shadow: 0 0 36px rgba(124,249,194,0.55); }
.ghost {
  background: transparent;
  color: var(--dim);
  border: 1px solid rgba(255,255,255,0.12);
  width: 220px;
}
.ghost:hover { color: var(--ink); border-color: var(--accent); }

.controls {
  margin-top: 30px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 26px;
  color: var(--dim);
  font-size: 13px;
  text-align: left;
  max-width: 360px;
  margin-left: auto; margin-right: auto;
}
.controls b { color: var(--accent); font-weight: 700; }

.credit {
  margin-top: 28px;
  color: rgba(138,138,130,0.6);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* HUD */
#hud {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 5;
}
#hud.hidden { display: none; }

.mute {
  position: fixed; top: 20px; right: 20px;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--panel); color: var(--ink);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 18px; cursor: pointer; z-index: 6;
  pointer-events: auto;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s ease;
}
.mute:hover { border-color: var(--accent); }

.hud-top {
  position: absolute; top: 22px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 56px;
}
.stat { text-align: center; }
.stat .label { display:block; color: var(--dim); font-size: 11px; letter-spacing: 0.28em; }
.stat .value { display:block; color: var(--ink); font-size: 30px; font-weight: 800; margin-top: 2px; }

.hud-bottom {
  position: absolute; bottom: 22px; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.bar {
  position: relative;
  width: min(420px, 70vw); height: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; overflow: hidden;
}
.bar .fill {
  position: absolute; inset: 0;
  width: 100%;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  transition: width 0.18s ease, background 0.2s ease;
}
.bar.low .fill { background: linear-gradient(90deg, #ff5a6e, #ffb05a); }
.bartext {
  position: relative; z-index: 2;
  display: block; text-align: center; line-height: 16px;
  font-size: 11px; font-weight: 700; color: #06120c;
  mix-blend-mode: screen;
}
.hint { color: var(--dim); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; }

.result {
  display: flex; gap: 64px; justify-content: center; margin-top: 26px;
}
.result .label { display:block; color: var(--dim); font-size: 11px; letter-spacing: 0.28em; }
.result .value { display:block; color: var(--accent); font-size: 38px; font-weight: 800; }

@media (max-width: 560px) {
  .hud-top { gap: 28px; }
  .controls { grid-template-columns: 1fr; }
}