* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #101827;
  --panel: rgba(20, 31, 50, 0.82);
  --ink: #eff6ff;
  --muted: #a7b4c9;
  --accent: #ffd166;
  --accent-2: #64d2ff;
  --danger: #ff5d6c;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(100, 210, 255, 0.16), transparent 34rem),
    radial-gradient(circle at 90% 8%, rgba(255, 209, 102, 0.12), transparent 28rem),
    linear-gradient(180deg, #0d1423 0%, #15253a 60%, #0b1020 100%);
}

.shell {
  width: min(1120px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 26px 0 42px;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1;
  text-shadow: 0 4px 0 #742f3b, 0 10px 28px rgba(0, 0, 0, 0.28);
}

.subtitle {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
}

.tips {
  display: grid;
  gap: 6px;
  min-width: 210px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.tips span {
  color: var(--muted);
  font-size: 14px;
}

.game-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: rgba(10, 16, 27, 0.66);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 700;
}

.hud b {
  color: var(--accent);
}

button {
  cursor: pointer;
  color: #142033;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  font-weight: 900;
  box-shadow: 0 4px 0 #b77820;
}

#restartBtn {
  margin-left: auto;
  padding: 8px 18px;
}

button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #b77820;
}

.canvas-wrap {
  position: relative;
  background: #65b7ff;
}

canvas {
  display: block;
  width: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.message {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  font-size: clamp(24px, 4vw, 46px);
  font-weight: 1000;
  line-height: 1.25;
  color: white;
  background: rgba(7, 12, 22, 0.58);
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
}

.hidden {
  display: none;
}

.mobile-controls {
  display: none;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.mobile-controls button {
  width: 66px;
  height: 54px;
  font-size: 24px;
}

.mobile-controls .jump {
  width: 92px;
  background: var(--accent-2);
  box-shadow: 0 4px 0 #277897;
}

.mobile-controls .fire {
  background: #ff8a3d;
  box-shadow: 0 4px 0 #9f4c1f;
}

.level-list {
  margin-top: 24px;
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: var(--panel);
}

.level-list h2 {
  margin: 0 0 14px;
}

.level-list ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px 28px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
}

.level-list li::marker {
  color: var(--accent);
  font-weight: 900;
}

@media (max-width: 720px) {
  .hero {
    display: block;
  }

  .tips {
    margin-top: 16px;
  }

  .mobile-controls {
    display: flex;
  }
}
