:root {
  --bg: #eaf4f7;
  --bg2: #d6eaf0;
  --ink: #12304a;
  --muted: #4b6578;
  --accent: #f29a1f;
  --accent-ink: #5a3300;
  --card: #ffffffd9;
  --line: #b9d3de;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

body { overflow: hidden; }

/* 整页：普通模式下就是页面本身；水面模式下被放进 canvas */
.page {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 15% -10%, #ffffff 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 110%, var(--bg2) 0%, transparent 60%),
    repeating-linear-gradient(135deg, transparent 0 22px, #ffffff33 22px 23px),
    var(--bg);
}

.hero {
  flex: 1;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 8vh 16px 32px;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: .18em;
  color: var(--muted);
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(36px, 8vw, 64px);
  line-height: 1.1;
  letter-spacing: -.02em;
}

.hl {
  color: #0f6f9a;
  background: linear-gradient(transparent 62%, #ffcf7a 62% 92%, transparent 92%);
}

.lede {
  margin: 0 0 32px;
  font-size: 18px;
  color: var(--muted);
}

.wish {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 10px 30px #12304a14;
}

.wish label { display: block; margin-bottom: 10px; font-weight: 600; }

.row { display: flex; gap: 10px; }

.wish input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.wish input:focus { outline: 2px solid #0f6f9a; outline-offset: 1px; }

button, .btn {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  text-decoration: none;
  cursor: pointer;
}

.wish button, .btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

button:hover, .btn:hover { filter: brightness(1.05); }
button:focus-visible, .btn:focus-visible { outline: 2px solid #0f6f9a; outline-offset: 2px; }

.wish-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.wish-list:empty { display: none; }

.wish-list li {
  padding: 4px 12px;
  border-radius: 999px;
  background: #fff3dc;
  border: 1px solid #f5c779;
  font-size: 14px;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 16px;
  font-size: 13px;
  color: var(--muted);
}

.status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #9aa9b3;
  vertical-align: 1px;
}

.status.on::before { background: #27a36b; }
.status.off::before { background: var(--accent); }

/* 水面模式：canvas 盖满整个窗口，页面在它里面 */
canvas.stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
}

/* 效果选择 */
.fx { margin: 0 0 24px; }
.fx h2 { margin: 0 0 10px; font-size: 15px; letter-spacing: .04em; }
.fx-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: #ffffffcc;
}
.chip[aria-pressed="true"] { background: #12304a; border-color: #12304a; color: #fff; }
.chip.orig::after {
  content: "原创";
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 6px;
  font-size: 10px;
  vertical-align: 2px;
  background: #ffcf7a;
  color: #5a3300;
}
.chip:disabled { opacity: .45; cursor: not-allowed; }
.fx-desc { min-height: 1.6em; margin: 10px 0 0; font-size: 14px; color: var(--muted); }

/* 小游戏 */
.games { margin: 32px 0 0; }
.games-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.games h2 { margin: 0 0 10px; font-size: 15px; letter-spacing: .04em; }
.score { margin: 0; font-size: 14px; color: var(--muted); }
.score b { color: var(--ink); font-variant-numeric: tabular-nums; }
.game-stage {
  position: relative;
  height: 380px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 10px 30px #12304a14;
  user-select: none;
  touch-action: manipulation;
}

/* 不支持时的替代：点击处一圈 CSS 波纹 */
.ring {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid #0f6f9a88;
  border-radius: 50%;
  pointer-events: none;
  animation: ring 900ms ease-out forwards;
}

@keyframes ring {
  to { transform: scale(14); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ring { display: none; }
}

@media (max-width: 520px) {
  .row { flex-direction: column; }
  .lede br { display: none; }
}
