* { box-sizing: border-box; }
:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: rgba(10, 20, 34, 0.84);
  --panel-2: rgba(17, 31, 52, 0.92);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f8fafc;
  --muted: #a7b5c8;
  --accent: #fb923c;
  --accent-2: #38bdf8;
}
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 16% 14%, rgba(56, 189, 248, 0.18), transparent 34%),
    radial-gradient(circle at 86% 6%, rgba(251, 146, 60, 0.20), transparent 30%),
    linear-gradient(145deg, #07111f 0%, #10243c 48%, #201126 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button {
  border: 0;
  cursor: pointer;
  color: #08111f;
  font-weight: 800;
  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.45); }
.wrap {
  width: min(1120px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 22px;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px 18px 10px 10px;
  background: var(--panel);
  backdrop-filter: blur(14px);
}
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; }
#restartBtn {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f97316, #facc15);
}
.hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}
.pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
}
.pill span { color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.pill strong { font-size: 1.25rem; color: #fff; }
.stage-shell {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: #07111f;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}
#game-stage {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 300px;
}
#game-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.controls {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(210px, 1fr);
  gap: 10px 12px;
  align-items: center;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px 10px 18px 18px;
  background: var(--panel);
}
#jumpBtn, #rewardBtn {
  min-height: 50px;
  border-radius: 14px;
  padding: 0 18px;
  font-size: 0.95rem;
}
#jumpBtn { background: linear-gradient(135deg, #38bdf8, #2dd4bf); }
#rewardBtn { background: linear-gradient(135deg, #fb923c, #fde047); }
#statusText {
  grid-column: 1 / -1;
  color: #e2e8f0;
  font-weight: 800;
  min-height: 24px;
}
#controlsHint, .reward-note {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}
.reward-note { text-align: right; }
@media (max-width: 720px) {
  .wrap { width: min(100vw - 16px, 680px); padding-top: 8px; }
  .top { align-items: flex-start; padding: 13px; }
  #restartBtn { min-height: 38px; padding: 0 13px; }
  .hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pill { min-height: 46px; }
  #game-stage { min-height: 240px; }
  .controls { grid-template-columns: 1fr; padding: 12px; }
  .reward-note { text-align: left; }
}
