:root {
  color-scheme: dark;
  --ink: #f8fbff;
  --muted: #b9c8d6;
  --panel: rgba(12, 18, 30, 0.48);
  --panel-strong: rgba(12, 18, 30, 0.72);
  --rim: rgba(255, 255, 255, 0.18);
  --gold: #ffd36c;
  --aqua: #58e3d2;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 211, 108, 0.24), transparent 26rem),
    radial-gradient(circle at 82% 18%, rgba(88, 227, 210, 0.26), transparent 24rem),
    linear-gradient(135deg, #0b1020 0%, #13233a 42%, #1e3f55 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.game-shell {
  width: min(100vw, 1120px);
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 22px;
}

.stage-wrap {
  position: relative;
  width: min(100%, 960px);
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 1px solid var(--rim);
  border-radius: 8px;
  background: #101828;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
}

.hud {
  position: absolute;
  z-index: 3;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  pointer-events: none;
}

.score-card,
.icon-button {
  min-width: 82px;
  border: 1px solid var(--rim);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.score-card {
  height: 56px;
  padding: 8px 13px;
  border-radius: 8px;
}

.score-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.score-card strong {
  display: block;
  margin-top: 4px;
  font-size: 27px;
  line-height: 1;
}

.icon-button {
  width: 48px;
  height: 48px;
  margin-left: auto;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  font: 800 16px/1 Inter, sans-serif;
  pointer-events: auto;
}

.icon-button:hover {
  background: var(--panel-strong);
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  padding: 28px;
  text-align: center;
  background: linear-gradient(180deg, rgba(7, 12, 23, 0.1), rgba(7, 12, 23, 0.45));
}

.overlay.hidden {
  display: none;
}

.mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--gold), #ff8c6a 48%, var(--aqua));
  color: #102033;
  font-size: 34px;
  font-weight: 800;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.6rem, 8vw, 5.8rem);
  line-height: 0.92;
  letter-spacing: 0;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.36);
}

p {
  max-width: 470px;
  margin: 0;
  color: #d7e5ee;
  font-size: clamp(1rem, 2.3vw, 1.18rem);
  line-height: 1.55;
}

button {
  border: 0;
}

#startBtn {
  min-width: 158px;
  height: 48px;
  padding: 0 22px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffe29a, #ff976f);
  color: #182031;
  cursor: pointer;
  font: 800 15px/1 Inter, sans-serif;
  box-shadow: 0 14px 34px rgba(255, 151, 111, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

#startBtn:hover {
  transform: translateY(-1px);
}

.controls {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.controls span {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.07);
  color: #d7e5ee;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 680px) {
  body {
    overflow: auto;
  }

  .game-shell {
    min-height: 100svh;
    padding: 10px;
  }

  .stage-wrap {
    width: 100%;
    aspect-ratio: 9 / 14;
  }

  .score-card {
    min-width: 68px;
    height: 50px;
    padding: 8px 10px;
  }

  .score-card strong {
    font-size: 23px;
  }
}
