* { box-sizing: border-box; }
:root {
  color-scheme: dark;
  --panel: rgba(11, 18, 32, 0.84);
  --panel-2: rgba(17, 28, 48, 0.92);
  --line: rgba(255,255,255,0.13);
  --text: #f8fafc;
  --muted: #a8b5c8;
  --green: #86efac;
  --cyan: #67e8f9;
}
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 6%, rgba(134, 239, 172, 0.18), transparent 32%),
    radial-gradient(circle at 82% 0%, rgba(103, 232, 249, 0.18), transparent 30%),
    linear-gradient(145deg, #08111f 0%, #102033 52%, #0f2a20 100%);
}
button {
  border: 0;
  cursor: pointer;
  color: #06131f;
  font-weight: 850;
  transition: transform 140ms ease, opacity 140ms ease, filter 140ms ease;
}
button:active { transform: translateY(1px) scale(0.99); }
button:disabled { cursor: not-allowed; opacity: 0.48; filter: grayscale(0.35); }
.wrap { width: min(1080px, calc(100vw - 28px)); margin: 0 auto; padding: 18px 0 22px; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 20px 20px 12px 12px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 55px rgba(0,0,0,0.25);
}
h1 { margin: 0; font-size: clamp(1.45rem, 3vw, 2.35rem); letter-spacing: 0; }
p { margin: 0; }
.top p { margin-top: 4px; color: var(--muted); font-size: 0.95rem; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
#toggleBtn, #rewardBtn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #86efac, #22d3ee);
  box-shadow: 0 12px 30px rgba(34, 211, 238, 0.14);
}
#rewardBtn { background: linear-gradient(135deg, #fde047, #86efac); }
.hud { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 10px 0; }
.hud-card {
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hud-card span { color: var(--muted); font-size: 0.82rem; font-weight: 800; }
.hud-card strong { color: #fff; font-size: 1.1rem; text-align: right; }
.stage-shell { overflow: hidden; border: 1px solid rgba(255,255,255,0.16); border-radius: 16px; background: #07111f; box-shadow: 0 24px 80px rgba(0,0,0,0.35); }
#game-stage { width: 100%; aspect-ratio: 16 / 9; min-height: 340px; }
#game-stage canvas { display: block; width: 100%; height: 100%; }
.tip { margin-top: 10px; color: #d9e4f2; line-height: 1.45; font-weight: 700; }
#rewardNote { color: var(--muted); font-weight: 650; }
@media (max-width: 760px) {
  .wrap { width: min(100vw - 16px, 680px); padding-top: 8px; }
  .top { align-items: flex-start; padding: 13px; }
  .hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hud-card { min-height: 48px; }
  .top-actions { width: 100%; }
  #toggleBtn, #rewardBtn { flex: 1 1 150px; }
  #game-stage { min-height: 300px; }
}
