/* /play — shared styles. Reuses the site's paper/ink palette and red accent. */
:root {
  --bg: #f3f1eb;
  --text: #1c1915;
  --text-2: #6e665c;
  --text-3: #9a9388;
  --accent: #b5382a;
  --accent-bg: #f0e4e2;
  --surface: #e9e5dd;
  --line: #d2ccc2;
  --display: "STKaiti", "KaiTi SC", "KaiTi", "Songti SC", serif;
  --heading: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", serif;
  --body: "PingFang SC", -apple-system, "Helvetica Neue", "Noto Sans CJK SC", sans-serif;
  --ok: #2d8a4e;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141210;
    --text: #ddd6c9;
    --text-2: #857d72;
    --text-3: #5a544b;
    --accent: #d4513d;
    --accent-bg: #261c1a;
    --surface: #1e1c18;
    --line: #2e2924;
  }
}

:root[data-theme="dark"] {
  --bg: #141210;
  --text: #ddd6c9;
  --text-2: #857d72;
  --text-3: #5a544b;
  --accent: #d4513d;
  --accent-bg: #261c1a;
  --surface: #1e1c18;
  --line: #2e2924;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 18% 12%, rgba(120, 104, 82, 0.035), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(120, 104, 82, 0.03), transparent 46%);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 96px;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  font-size: 14px;
  color: var(--text-3);
}
.site-nav a { color: var(--text-3); text-decoration: none; }
.site-nav a:hover { color: var(--accent); }
.site-nav .nav-brand {
  font-family: var(--heading);
  color: var(--text-2);
  letter-spacing: 0.05em;
}
.site-nav .nav-links { display: flex; gap: 18px; }
.site-nav .nav-links a[aria-current="page"] { color: var(--accent); }

.play-head { text-align: center; padding: 28px 0 34px; }
.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.play-head h1 {
  font-family: var(--display);
  font-size: clamp(30px, 7vw, 42px);
  line-height: 1.25;
  margin: 0;
  letter-spacing: 0.04em;
  font-weight: 400;
}
.lede {
  max-width: 34em;
  margin: 12px auto 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-2);
}

.game-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 22px 24px;
  margin: 18px 0 0;
}

.game-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.prompt {
  text-align: center;
  font-family: var(--heading);
  font-size: 16px;
  line-height: 1.6;
  margin: 16px 0 18px;
  color: var(--text);
}

.glyph-stage {
  width: 132px;
  height: 132px;
  margin: 0 auto 20px;
}
.glyph-stage svg { width: 100%; height: 100%; display: block; fill: var(--text); }

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
}

.option {
  appearance: none;
  min-height: 76px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.option:hover:not(:disabled) { border-color: var(--accent); }
.option:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.option:disabled { cursor: default; opacity: 0.9; }
.option .opt-char {
  display: block;
  font-family: var(--display);
  font-size: 34px;
  line-height: 1.2;
}
.option .opt-pinyin {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-3);
}
.option.correct { border-color: var(--ok); background: rgba(45, 138, 78, 0.1); }
.option.wrong { border-color: var(--accent); background: var(--accent-bg); }

.feedback {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  text-align: center;
  font-size: 14px;
  line-height: 1.7;
}
.feedback.good { background: rgba(45, 138, 78, 0.09); color: var(--ok); }
.feedback.bad { background: var(--accent-bg); color: var(--accent); }
.feedback a { color: inherit; text-underline-offset: 3px; }

.game-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  appearance: none;
  display: inline-block;
  min-height: 42px;
  padding: 9px 20px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font-family: var(--body);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.btn:hover { background: var(--accent-bg); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn[disabled] { opacity: 0.45; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent); opacity: 0.9; }
.btn-ghost { border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.score-big {
  text-align: center;
  font-family: var(--heading);
  font-size: 30px;
  margin: 6px 0 4px;
}
.result-note {
  text-align: center;
  font-size: 14px;
  color: var(--text-2);
  margin: 4px 0 10px;
}
.result-list {
  text-align: center;
  font-size: 14px;
  color: var(--text-2);
  margin: 6px 0 0;
}
.result-list a { margin: 0 2px; }

.hint {
  margin: 18px 0 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-3);
}
.hint a { color: var(--text-3); }

.site-foot {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-3);
}
.site-foot a { color: var(--text-3); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }

/* ---------- hub ---------- */
.play-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}
.play-card {
  display: block;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}
.play-card:hover, .play-card:focus-visible {
  border-color: var(--accent);
  background: var(--accent-bg);
  transform: translateY(-2px);
  outline: none;
}
.play-card .pc-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.play-card .pc-index { font-size: 11px; letter-spacing: 0.14em; color: var(--accent); }
.play-card .pc-glyph {
  font-family: var(--display);
  font-size: 30px;
  line-height: 1;
  color: var(--text-3);
}
.play-card h2 {
  font-family: var(--heading);
  font-size: 19px;
  font-weight: 600;
  margin: 10px 0 6px;
  letter-spacing: 0.03em;
}
.play-card p { margin: 0; font-size: 13px; line-height: 1.7; color: var(--text-2); }
.play-card .pc-meta {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  color: var(--accent);
}
.play-card-wide { grid-column: 1 / -1; }

/* ---------- timeline ---------- */
.tl-axis {
  display: flex;
  justify-content: space-between;
  margin: 0 2px 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.tl-slots {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}
.tl-slot {
  position: relative;
  aspect-ratio: 1 / 1;
  min-width: 0;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
.tl-slot.over { border-color: var(--accent); background: var(--accent-bg); }
.tl-slot.ok { border-style: solid; border-color: var(--ok); background: rgba(45, 138, 78, 0.08); }
.tl-slot.bad { border-style: solid; border-color: var(--accent); background: var(--accent-bg); }
.tl-slot.revealed { padding-bottom: 15px; }
.tl-slot .slot-no {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 10px;
  line-height: 1;
  color: var(--text-3);
}
.tl-slot .stage-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  text-align: center;
  font-size: 9px;
  line-height: 1.1;
  color: var(--text-3);
}
.tl-slot .stage-label.ok { color: var(--ok); }
.tl-slot .stage-label.bad { color: var(--accent); }
.tl-slot > svg { width: 100%; height: 100%; display: block; fill: var(--text); }
.tl-slot > .tile-kaishu {
  font-family: var(--display);
  font-size: clamp(20px, 6vw, 30px);
  line-height: 1;
  color: var(--text);
}

.tl-pool {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-width: 440px;
  margin: 0 auto;
}
.tl-pool:empty { display: none; }

.tile {
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1 / 1;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tile:hover { border-color: var(--accent); }
.tile.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tile svg { width: 100%; height: 100%; display: block; fill: var(--text); }
.tile .tile-kaishu {
  font-family: var(--display);
  font-size: clamp(22px, 6vw, 32px);
  line-height: 1;
  color: var(--text);
}
.tile .tile-tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  text-align: center;
  font-size: 9px;
  line-height: 1.1;
  color: var(--text-3);
}

/* ---------- assemble ---------- */
.asm-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: 4px 0 0;
}
.asm-target {
  width: 104px;
  flex: 0 0 auto;
  text-align: center;
}
.asm-target svg {
  width: 100%;
  height: auto;
  opacity: 0.3;
  fill: var(--text);
  display: block;
}
.asm-target .asm-caption {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-3);
}
.asm-board {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  width: min(292px, 66vw);
}
.asm-slot {
  aspect-ratio: 1 / 1;
  min-width: 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.asm-slot.over { border-color: var(--accent); background: var(--accent-bg); }
.asm-slot.ok { border-style: solid; border-color: var(--ok); background: rgba(45, 138, 78, 0.08); }
.asm-slot.bad { border-style: solid; border-color: var(--accent); background: var(--accent-bg); }
.asm-slot .asm-piece { width: 100%; height: 100%; }
.asm-slot .asm-piece svg { border: 0; border-radius: 0; background: transparent; }

.asm-pool {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  min-height: 68px;
}
.asm-piece {
  appearance: none;
  width: 66px;
  height: 66px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  overflow: hidden;
}
.asm-piece svg { width: 100%; height: 100%; display: block; fill: var(--text); }
.asm-piece.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.asm-piece:hover { border-color: var(--accent); }

/* ---------- odd one out ---------- */
.oo-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
}
.oo-card {
  appearance: none;
  padding: 18px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.oo-card:hover:not(:disabled) { border-color: var(--accent); }
.oo-card:disabled { cursor: default; }
.oo-card .oo-char {
  display: block;
  font-family: var(--display);
  font-size: 40px;
  line-height: 1.15;
}
.oo-card .oo-pinyin { display: block; font-size: 12px; color: var(--text-3); }
.oo-card.correct { border-color: var(--ok); background: rgba(45, 138, 78, 0.1); }
.oo-card.wrong { border-color: var(--accent); background: var(--accent-bg); }

@media (max-width: 560px) {
  .page { padding: 0 16px 76px; }
  .play-grid { grid-template-columns: 1fr; }
  .game-shell { padding: 18px 14px 20px; border-radius: 12px; }
  .glyph-stage { width: 116px; height: 116px; }
  .option { min-height: 70px; }
  .option .opt-char { font-size: 30px; }
  .tl-slots, .tl-pool { gap: 6px; }
  .site-nav { gap: 10px; }
  .site-nav .nav-links { gap: 12px; }
  .asm-wrap { gap: 10px; }
  .asm-target { width: 74px; }
  .asm-board { width: min(236px, 58vw); }
  .asm-piece { width: 54px; height: 54px; }
  .oo-card .oo-char { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- gacha ---------- */
.gacha-page { max-width: 860px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wallet-bar {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-2);
}
.wallet-item { display: inline-flex; align-items: baseline; gap: 5px; }
.wallet-label { font-size: 11px; letter-spacing: 0.12em; color: var(--text-3); }
.wallet-item strong {
  font-family: var(--heading);
  font-size: 22px;
  line-height: 1;
  color: var(--accent);
}
.wallet-unit { font-size: 12px; color: var(--text-3); }
.wallet-earn { margin-left: auto; font-size: 12px; color: var(--accent); text-decoration: none; }
.wallet-earn:hover { text-decoration: underline; text-underline-offset: 3px; }

.gacha-tabs {
  display: flex;
  gap: 4px;
  margin: 14px 0 0;
  border-bottom: 1px solid var(--line);
}
.gacha-tab {
  appearance: none;
  margin-bottom: -1px;
  padding: 9px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-2);
  font-family: var(--body);
  font-size: 14px;
  cursor: pointer;
}
.gacha-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.gacha-tab:hover { color: var(--accent); }
.gacha-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.gacha-panel { padding-top: 4px; }
.gacha-prompt { margin-bottom: 12px; }
.gacha-actions { margin-top: 0; }
.gacha-hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-3);
}
.gacha-notice {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
}
.gacha-notice.good { background: rgba(45, 138, 78, 0.09); color: var(--ok); }
.gacha-notice.warn { background: var(--accent-bg); color: var(--accent); }

.pack-stage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 18px 0 4px;
}
.pack-stage:empty { min-height: 128px; }
.pack-stage:empty::before {
  content: "开一包，看看今天的字形。";
  font-size: 13px;
  color: var(--text-3);
}

.gcard {
  --rarity: var(--text-3);
  appearance: none;
  flex: 0 0 118px;
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 0;
  background: transparent;
  perspective: 700px;
  cursor: pointer;
  animation: gcard-in 0.35s ease both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.gcard.r-N { --rarity: var(--text-3); }
.gcard.r-R, .acard.r-R, .gacha-detail.r-R { --rarity: #5f7d62; }
.gcard.r-SR, .acard.r-SR, .gacha-detail.r-SR { --rarity: var(--accent); }
.gcard.r-SSR, .acard.r-SSR, .gacha-detail.r-SSR { --rarity: #b07d2a; }
.gcard.r-N, .acard.r-N, .gacha-detail.r-N { --rarity: var(--text-3); }

.gcard-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.45s ease;
}
.gcard.flipped .gcard-inner { transform: rotateY(180deg); }
.gcard:hover:not(.flipped) .gcard-inner { transform: translateY(-2px); }
.gcard:focus-visible { outline: none; }
.gcard:focus-visible .gcard-face { outline: 2px solid var(--accent); outline-offset: 2px; }

.gcard-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 12px 7px 8px;
  overflow: hidden;
  border: 2px solid var(--rarity);
  border-radius: 12px;
  background: var(--bg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.gcard-back { transform: rotateY(180deg); background: var(--surface); }
.gcard-front img {
  display: block;
  width: 82%;
  height: 64%;
  object-fit: contain;
}
.gcard-rarity {
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--rarity);
  color: #fff;
  font-size: 9px;
  line-height: 1.6;
  letter-spacing: 0.06em;
}
.gcard-kaishu {
  font-family: var(--display);
  font-size: 38px;
  line-height: 1.15;
  color: var(--text);
}
.gcard-pinyin { font-size: 12px; color: var(--text-3); }
.gcard-cat {
  max-width: 100%;
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-2);
  text-align: center;
}
.gcard-copies { margin-top: 2px; font-size: 9px; color: var(--text-3); }

@keyframes gcard-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.pack-legend {
  margin: 10px 0 0;
  text-align: center;
  font-size: 11px;
  line-height: 1.8;
  color: var(--text-3);
}
.legend-r { font-weight: 600; }
.legend-r.r-N { color: var(--text-3); }
.legend-r.r-R { color: #5f7d62; }
.legend-r.r-SR { color: var(--accent); }
.legend-r.r-SSR { color: #b07d2a; }

.album-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 14px 0 12px;
  font-size: 13px;
  color: var(--text-2);
}
.album-toolbar strong { color: var(--accent); }
.album-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
}
.album-filter input { accent-color: var(--accent); }

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
}
.acard {
  --rarity: var(--line);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1.08;
  padding: 5px 3px 3px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 3px solid var(--rarity);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
}
button.acard { cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
button.acard:hover, button.acard:focus-visible {
  border-color: var(--rarity);
  transform: translateY(-1px);
  outline: none;
}
button.acard:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.acard.locked { background: var(--surface); opacity: 0.55; }
.acard img {
  display: block;
  width: 80%;
  height: 56%;
  object-fit: contain;
}
.acard-char {
  margin-top: 2px;
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.1;
}
.acard-q {
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
  color: var(--text-3);
}
.acard-rarity {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 8px;
  letter-spacing: 0.05em;
  color: var(--rarity);
}
.acard-count {
  position: absolute;
  top: 1px;
  right: 3px;
  font-size: 9px;
  color: var(--text-3);
}
.album-empty {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}

.gacha-detail {
  --rarity: var(--line);
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 16px 40px 16px 16px;
  border: 2px solid var(--rarity);
  border-radius: 12px;
  background: var(--bg);
}
.detail-glyph { flex: 0 0 auto; width: 96px; }
.detail-glyph img { display: block; width: 100%; height: auto; }
.detail-body { min-width: 0; }
.detail-name { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; }
#detailChar { font-family: var(--display); font-size: 32px; line-height: 1.1; }
.detail-pinyin { font-size: 13px; color: var(--text-3); }
.rarity-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--rarity);
  color: #fff;
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: 0.06em;
}
.detail-cat { margin: 5px 0 0; font-size: 13px; color: var(--text-2); }
.detail-own { margin: 3px 0 0; font-size: 12px; color: var(--text-3); }
.detail-link { display: inline-block; margin-top: 8px; font-size: 13px; }
.detail-close {
  position: absolute;
  top: 5px;
  right: 8px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font-size: 22px;
  line-height: 1.4;
  cursor: pointer;
}
.detail-close:hover { color: var(--accent); }
.detail-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* reward box shared by the four games */
.reward-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px dashed var(--accent);
  border-radius: 10px;
  background: var(--accent-bg);
  text-align: center;
}
.reward-line { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text); }
.reward-line strong { color: var(--accent); font-size: 18px; }
.reward-line.reward-muted { color: var(--text-2); font-size: 13px; }
.reward-btn { margin-top: 0; }

@media (max-width: 560px) {
  .gacha-page { padding-left: 16px; padding-right: 16px; }
  .wallet-earn { margin-left: 0; }
  .gcard { flex-basis: calc((100% - 20px) / 3); }
  .gcard-kaishu { font-size: 32px; }
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 6px; }
  .gacha-detail { gap: 10px; padding: 14px 34px 14px 12px; }
  .detail-glyph { width: 68px; }
  #detailChar { font-size: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  .gcard { animation: none; }
  .gcard-inner, button.acard { transition: none; }
  .gcard.flipped .gcard-inner { transform: rotateY(180deg); }
}
