:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --ink: #eef7ff;
  --blue: #59c9ff;
  --yellow: #ffd447;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 10%, #264a82 0, transparent 28%),
    radial-gradient(circle at 85% 80%, #322c72 0, transparent 30%),
    #081426;
}

.game-shell { width: min(1100px, 96vw); padding: 22px 0 26px; }

header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 14px;
}

h1 { margin: 0; font-size: clamp(26px, 4vw, 44px); letter-spacing: .04em; }
.eyebrow { margin: 0 0 3px; color: var(--blue); font-weight: 800; letter-spacing: .22em; font-size: 11px; }
.help { color: #a9bed4; font-size: 13px; text-align: right; padding-bottom: 5px; }

.screen-wrap {
  position: relative;
  border: 3px solid rgba(255,255,255,.82);
  border-radius: 18px;
  overflow: hidden;
  background: #6ed4ff;
  box-shadow: 0 24px 80px rgba(0,0,0,.42), 0 0 0 8px rgba(89,201,255,.08);
}

canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; touch-action: none; }

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(rgba(5,16,35,.22), rgba(5,16,35,.72));
  backdrop-filter: blur(3px);
  transition: opacity .25s;
}
.overlay.hidden { opacity: 0; pointer-events: none; }

.card {
  width: min(420px, 84%);
  padding: 28px;
  text-align: center;
  border: 2px solid rgba(255,255,255,.75);
  border-radius: 20px;
  background: rgba(9,25,54,.91);
  box-shadow: 0 16px 50px rgba(0,0,0,.38);
}
.card h2 { margin: 10px 0 8px; font-size: 28px; }
.card p { color: #c2d5e9; line-height: 1.65; }
.hero-icon {
  width: 68px; height: 68px; margin: auto; display: grid; place-items: center;
  border-radius: 18px; color: #10233e; background: var(--yellow);
  font: 900 38px/1 system-ui; transform: rotate(-5deg); box-shadow: 6px 6px 0 #ea7b31;
}

button {
  border: 0; cursor: pointer; color: #10213b; background: var(--yellow);
  font: 800 17px/1 "Microsoft YaHei", sans-serif;
  border-radius: 12px; padding: 14px 25px;
  box-shadow: 0 5px 0 #d98028; transition: transform .08s, box-shadow .08s;
}
button:active { transform: translateY(4px); box-shadow: 0 1px 0 #d98028; }

.toast {
  position: absolute; top: 76px; left: 50%; transform: translate(-50%, -14px);
  opacity: 0; pointer-events: none; padding: 9px 18px; border-radius: 999px;
  color: #17233b; background: rgba(255,255,255,.92); font-weight: 900;
  transition: .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.touch-controls { display: none; justify-content: space-between; margin-top: 15px; }
.touch-controls button { width: 72px; height: 58px; padding: 0; user-select: none; touch-action: none; }
.move-pad { display: flex; gap: 12px; }
.touch-controls .jump { width: 92px; background: #ff7b68; box-shadow: 0 5px 0 #b84246; color: white; }

@media (max-width: 760px), (pointer: coarse) {
  .game-shell { width: 100vw; padding: 8px 8px 16px; }
  header { margin: 0 4px 8px; }
  .help { display: none; }
  .screen-wrap { border-radius: 12px; border-width: 2px; }
  .touch-controls { display: flex; }
  .card { padding: 20px; }
  .card h2 { font-size: 22px; }
}
