:root {
  --ink: #21170f;
  --paper: #fff4d6;
  --sun: #ffd35a;
  --red: #df3d2f;
  --blue: #2477c7;
  --green: #249a55;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(255, 211, 90, 0.28), transparent 34%),
    linear-gradient(180deg, #89d8ff 0%, #f9e7ad 64%, #8ecf65 64%);
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

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

.eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 72px);
  line-height: 0.95;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 650px;
}

.controls span,
.hud span {
  padding: 8px 10px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: rgba(255, 250, 239, 0.9);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.game-frame {
  position: relative;
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: 8px;
  background: #7dd7ff;
  box-shadow: 12px 12px 0 var(--ink);
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  outline: none;
  image-rendering: pixelated;
}

.hud {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.hud span {
  min-width: 112px;
}

.start-button {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  min-width: 180px;
  padding: 12px 18px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background: var(--sun);
  box-shadow: 5px 5px 0 var(--ink);
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.start-button:hover {
  transform: translate(-50%, -2px);
}

.start-button:active {
  transform: translate(-50%, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.start-button.hidden {
  display: none;
}

@media (max-width: 760px) {
  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .controls {
    justify-content: flex-start;
  }

  .hud {
    align-items: flex-start;
    flex-direction: column;
    right: auto;
  }
}
