:root {
  --ink: #5a5f88;
  --ink-soft: #8a8fb4;
  --ink-faint: #aeb2cf;
  --grad: linear-gradient(115deg, #7fa4f0 0%, #ad8fec 48%, #ee8db6 100%);
  --grad-soft: linear-gradient(115deg, #97b7f6 0%, #bda3f2 50%, #f3a3c6 100%);
  --glass: linear-gradient(150deg, rgba(255, 255, 255, .80), rgba(255, 255, 255, .44));
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --ww: 300px;
  --font: ui-rounded, "SF Pro Rounded", "PingFang TC", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #e9e5fa;
}

body {
  position: fixed;
  inset: 0;
  font-family: var(--font);
  color: var(--ink);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }

#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#stage { position: absolute; inset: 0; touch-action: none; }

/* ---------- 遊戲中的資訊列：只在井的上下，不蓋住任何一格 ---------- */
#ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--sat) + 8px) 12px calc(var(--sab) + 6px);
  pointer-events: none;
  transition: opacity .5s ease;
}
body[data-state="boot"] #ui,
body[data-state="title"] #ui { opacity: 0; }
body[data-state="boot"] #ui *,
body[data-state="title"] #ui * { pointer-events: none !important; }

#top {
  width: var(--ww);
  min-width: 236px;
  max-width: 100%;
  height: 60px;
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.lbl {
  font-size: 10.5px;
  letter-spacing: .26em;
  margin-right: -.26em;
  color: var(--ink-soft);
  font-weight: 500;
  white-space: nowrap;
}
.score { display: flex; flex-direction: column; line-height: 1; padding-bottom: 1px; }
#score {
  margin-top: 6px;
  font-size: 30px;
  font-weight: 300;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}
.grow { flex: 1; }
.next { display: flex; flex-direction: column; align-items: center; line-height: 1; }
#nextSlot { width: 68px; height: 44px; margin-top: 4px; }
.icon-btn {
  pointer-events: auto;
  width: 38px; height: 38px;
  margin-bottom: 3px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .9);
  background: var(--glass);
  box-shadow: 0 4px 14px rgba(110, 120, 180, .18), inset 0 1px 0 #fff;
  display: grid; place-items: center;
  padding: 0;
  color: var(--ink-soft);
  transition: transform .15s;
}
.icon-btn:active { transform: scale(.9); }

#wellSlot { flex: 1; width: 100%; min-height: 0; margin: 8px 0 6px; }

#tray {
  width: var(--ww);
  min-width: 236px;
  max-width: 100%;
  height: 58px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: opacity .3s;
}
#tray.coaching > * { opacity: 0; pointer-events: none !important; transition: opacity .3s; }
.stat { display: flex; flex-direction: column; align-items: center; min-width: 52px; line-height: 1; transition: opacity .3s; }
.stat b { margin-top: 6px; font-size: 19px; font-weight: 400; font-variant-numeric: tabular-nums; }

/* ---------- 三顆魔法寶石：心、星、月 ---------- */
#hearts { display: flex; gap: 0; pointer-events: auto; transition: opacity .3s; }
.heart {
  position: relative;
  width: 52px; height: 54px;
  border: 0; background: none; padding: 0;
  display: grid; place-items: center;
  touch-action: none;
}
/* 寶石座：用掉之後留下一圈空的座 */
.heart::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 1.5px dashed rgba(165, 170, 212, .6);
  opacity: 0;
  transition: opacity .4s .25s;
}
.heart.used::before { opacity: 1; }
.heart svg {
  width: 46px; height: 46px;
  overflow: visible;
  filter: drop-shadow(0 3px 6px rgba(190, 140, 215, .38));
  transition: transform .4s cubic-bezier(.3, 1.6, .5, 1), opacity .4s, filter .4s;
}
#hearts[data-mood="sleep"] .heart:not(.used) svg {
  opacity: .55;
  transform: scale(.82);
  filter: saturate(.5) drop-shadow(0 2px 4px rgba(150, 150, 200, .25));
}
#hearts[data-mood="ready"] .heart:not(.used) svg { animation: floaty 3.2s ease-in-out infinite; }
#hearts[data-mood="urgent"] .heart:not(.used) svg { animation: throb .82s ease-in-out infinite; }
.heart:nth-child(2) svg { animation-delay: -.5s !important; }
.heart:nth-child(3) svg { animation-delay: -1s !important; }
.heart.used svg {
  opacity: 0;
  transform: scale(.4);
  filter: none;
  animation: none !important;
}
.heart.pop svg { animation: heartpop .5s cubic-bezier(.2, .9, .3, 1) !important; }
#hearts.nope { animation: nope .34s ease; }

@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-2deg) } 50% { transform: translateY(-3px) rotate(2deg) } }
@keyframes throb {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 3px 6px rgba(225, 130, 200, .45)); }
  50% { transform: scale(1.16); filter: drop-shadow(0 0 12px rgba(245, 150, 215, .95)) drop-shadow(0 0 4px #fff); }
}
@keyframes heartpop { 0% { transform: scale(1); opacity: 1 } 40% { transform: scale(1.6) rotate(8deg); opacity: 1 } 100% { transform: scale(.4); opacity: 0 } }
@keyframes nope { 0%, 100% { transform: translateX(0) } 25% { transform: translateX(-5px) } 75% { transform: translateX(5px) } }

/* ---------- 浮在井上的字 ---------- */
#wellBox { position: fixed; pointer-events: none; overflow: visible; }
.pop {
  position: absolute;
  left: 50%;
  white-space: nowrap;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: .16em;
  margin-right: -.16em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 #fff) drop-shadow(0 0 9px rgba(255, 255, 255, .95)) drop-shadow(0 0 3px rgba(255, 255, 255, .9));
  animation: popUp 1.25s cubic-bezier(.2, .9, .3, 1) forwards;
}
.pop.big { font-size: 32px; letter-spacing: .22em; animation-duration: 1.6s; }
.pop.gain { font-size: 15px; font-weight: 500; letter-spacing: .06em; }
.pop.combo { font-size: 16px; font-weight: 600; letter-spacing: .12em; }
.pop.lvl { font-size: 26px; font-weight: 300; letter-spacing: .3em; animation-duration: 1.7s; }
.pop.gem { font-size: 20px; font-weight: 500; letter-spacing: .3em; margin-right: -.3em; animation-duration: 1.7s; }
@keyframes popUp {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(.55); }
  16% { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
  28% { transform: translate(-50%, -2px) scale(1); }
  72% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -36px) scale(1); }
}

#hint, .note {
  position: fixed;
  left: 50%;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .3s ease, transform .35s cubic-bezier(.3, 1.4, .5, 1);
}
#hint {
  transform: translate(-50%, 8px) scale(.94);
  padding: 8px 15px;
  border-radius: 18px;
  font-size: 13.5px;
  letter-spacing: .08em;
  background: rgba(255, 255, 255, .88);
  border: 1px solid #fff;
  box-shadow: 0 8px 22px rgba(120, 110, 180, .26);
}
#hint::after {
  content: "";
  position: absolute; left: 50%; bottom: -5px;
  width: 10px; height: 10px;
  background: rgba(255, 255, 255, .92);
  transform: translateX(-50%) rotate(45deg);
  border-radius: 2px;
}
#hint.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

.note {
  transform: translate(-50%, -50%) scale(.94);
  display: flex; align-items: center; gap: 12px;
  padding: 9px 20px 9px 12px;
  border-radius: 24px;
  font-size: 15px;
  letter-spacing: .1em;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: 0 8px 24px rgba(110, 120, 180, .2), inset 0 1px 0 #fff;
}
.note.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* 過關時，底下那一條換成「第 N 關 · 寶石名 · 一句話」 */
#lvCard { gap: 10px; padding: 8px 20px; flex-wrap: nowrap; }
#lvNo { font-size: 11px; letter-spacing: .22em; color: var(--ink-soft); }
#lvGem {
  font-size: 19px; font-weight: 500; letter-spacing: .2em; margin-right: -.2em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
#lvLine { font-style: normal; font-size: 12px; letter-spacing: .06em; color: var(--ink-soft); max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
#coach .glyph, .g {
  position: relative;
  flex: none;
  width: 34px; height: 30px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .7);
  box-shadow: inset 0 0 0 1px rgba(160, 165, 210, .22);
}
#coach .glyph b, .g b {
  position: absolute; left: 50%; top: 50%;
  width: 11px; height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 3px rgba(190, 160, 240, .22);
}
#coach .glyph svg { display: none; position: absolute; left: 2px; top: 0; width: 30px; height: 30px; overflow: visible; }
#coach .glyph[data-g="gem"] svg { display: block; animation: floaty 2.4s ease-in-out infinite; }
#coach .glyph[data-g="gem"] b { display: none; }
[data-g="slide"] b, .g-slide b { animation: gSlide 1.5s ease-in-out infinite; }
[data-g="tap"] b, .g-tap b { animation: gTap 1.1s ease-out infinite; }
[data-g="flick"] b, .g-flick b { animation: gFlick 1.15s cubic-bezier(.6, 0, .9, .4) infinite; }
.g-drag b { animation: gDrag 1.9s ease-in-out infinite; }
@keyframes gSlide { 0%, 100% { transform: translateX(-9px) } 50% { transform: translateX(9px) } }
@keyframes gTap {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(190, 160, 240, .5); }
  30% { transform: scale(.72); }
  60% { transform: scale(1); box-shadow: 0 0 0 9px rgba(190, 160, 240, 0); }
}
@keyframes gFlick { 0% { transform: translateY(-8px); opacity: 0 } 18% { opacity: 1 } 55% { transform: translateY(9px); opacity: 1 } 70%, 100% { transform: translateY(9px); opacity: 0 } }
@keyframes gDrag { 0% { transform: translateY(-8px); opacity: 0 } 15% { opacity: 1 } 80% { transform: translateY(8px); opacity: 1 } 100% { transform: translateY(8px); opacity: 0 } }

/* ---------- 覆蓋層 ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: calc(var(--sat) + 20px) 22px calc(var(--sab) + 20px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .4s ease, visibility 0s .4s;
}
.overlay.show { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .4s ease; }
.overlay.veil { background: radial-gradient(120% 90% at 50% 45%, rgba(236, 232, 250, .55), rgba(226, 226, 248, .78)); }

/* ---------- 開頭的獻詞 ---------- */
#dedicate { background: radial-gradient(120% 90% at 50% 45%, rgba(244, 238, 252, .92), rgba(232, 232, 250, .96)); z-index: 30; transition: opacity .9s ease, visibility 0s .9s; }
#dedicate.show { transition: opacity .3s ease; }
.dedi { display: flex; flex-direction: column; align-items: center; text-align: center; transform: translateY(-4vh); }
.dedi-gem {
  width: 74px; height: 74px; overflow: visible;
  filter: drop-shadow(0 6px 16px rgba(235, 140, 190, .5));
  animation: dediGem 1.1s cubic-bezier(.2, 1.3, .3, 1) both, floaty 3.2s ease-in-out 1.1s infinite;
}
.dedi-line {
  margin: 22px 0 0;
  font-size: clamp(22px, 6.6vw, 28px);
  font-weight: 300;
  letter-spacing: .34em;
  margin-right: -.34em;
  color: var(--ink);
  animation: dediText 1.2s ease .35s both;
}
.dedi-line b, .kicker b {
  font-weight: 500;
  background: linear-gradient(115deg, #f08fb8, #b88cf0);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.dedi-rule {
  display: block; margin-top: 18px;
  width: 120px; height: 1px;
  background: linear-gradient(90deg, transparent, #c9a8ee, #f3a3c6, transparent);
  animation: dediRule 1.2s ease .7s both;
}
@keyframes dediGem { 0% { opacity: 0; transform: scale(.3) rotate(-18deg) } 100% { opacity: 1; transform: none } }
@keyframes dediText { 0% { opacity: 0; transform: translateY(10px); letter-spacing: .6em } 100% { opacity: 1; transform: none } }
@keyframes dediRule { 0% { opacity: 0; transform: scaleX(0) } 100% { opacity: 1; transform: none } }

.title-wrap {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 40px 30px 36px;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .80), rgba(255, 255, 255, .52) 55%, rgba(255, 255, 255, 0));
  transform: translateY(-3vh);
}
.kicker {
  margin: 0 0 14px;
  font-size: 14px;
  letter-spacing: .34em;
  margin-right: -.34em;
  color: var(--ink-soft);
}
.kicker::before, .kicker::after { content: "♡"; margin: 0 .7em; font-size: 11px; color: #e7a0c4; letter-spacing: 0; }
.link-btn {
  appearance: none; -webkit-appearance: none;
  border: 0; background: none;
  padding: 10px 14px;
  font-size: 13.5px;
  letter-spacing: .14em;
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: rgba(180, 160, 230, .6);
  text-underline-offset: 5px;
}
.link-btn span { margin-left: .5em; font-variant-numeric: tabular-nums; color: #c18be0; text-decoration: none; display: inline-block; }
h1 {
  margin: 0;
  font-size: clamp(50px, 17vw, 72px);
  font-weight: 200;
  line-height: 1.1;
  letter-spacing: .2em;
  margin-right: -.2em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 12px rgba(255, 255, 255, .95));
}
.en {
  margin: 12px 0 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .62em;
  margin-right: -.62em;
  color: var(--ink-soft);
}
.title-btns { display: flex; flex-direction: column; gap: 12px; margin-top: 42px; }
.best { margin: 22px 0 0; font-size: 13px; letter-spacing: .16em; color: var(--ink-soft); }
.best b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; margin-left: .3em; }

.pill {
  appearance: none; -webkit-appearance: none;
  min-width: 200px;
  height: 54px;
  padding: 0 28px 0 calc(28px + .32em);
  border-radius: 27px;
  border: 1px solid rgba(255, 255, 255, .95);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .32em;
  color: #fff;
  background: var(--grad-soft);
  box-shadow: 0 10px 26px rgba(162, 132, 226, .36), inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -8px 16px rgba(255, 255, 255, .12);
  text-shadow: 0 1px 2px rgba(120, 90, 190, .35);
  transition: transform .16s cubic-bezier(.3, 1.6, .5, 1), box-shadow .16s;
}
.pill:active { transform: scale(.95); box-shadow: 0 5px 14px rgba(162, 132, 226, .34), inset 0 1px 0 rgba(255, 255, 255, .7); }
.pill.ghost {
  color: var(--ink);
  background: var(--glass);
  text-shadow: none;
  box-shadow: 0 6px 18px rgba(110, 120, 180, .15), inset 0 1px 0 #fff;
}
#btnStart, #btnResume { animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { box-shadow: 0 10px 26px rgba(162, 132, 226, .36), inset 0 1px 0 rgba(255, 255, 255, .7), 0 0 0 0 rgba(200, 170, 245, .45); } 50% { box-shadow: 0 10px 26px rgba(162, 132, 226, .36), inset 0 1px 0 rgba(255, 255, 255, .7), 0 0 0 12px rgba(200, 170, 245, 0); } }

.card {
  width: min(330px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 24px 22px 22px;
  border-radius: 30px;
  text-align: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, .62));
  border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: 0 22px 60px rgba(105, 112, 175, .26), inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  backdrop-filter: blur(16px) saturate(1.15);
  transform: translateY(16px) scale(.96);
  transition: transform .5s cubic-bezier(.2, 1.25, .3, 1);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  scrollbar-width: none;
}
.card::-webkit-scrollbar { display: none; }
.overlay.show .card { transform: none; }
.card h2 { margin: 0 0 4px; font-size: 20px; font-weight: 400; letter-spacing: .3em; margin-right: -.3em; }
.card .pill { width: 100%; }

.howto { width: 100%; display: grid; gap: 6px; margin: 2px 0 2px; }
.howto > div {
  display: flex; align-items: center; gap: 12px;
  padding: 5px 12px 5px 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .5);
  font-size: 14.5px;
  letter-spacing: .08em;
}
.howto span { flex: 1; text-align: left; }
.howto em { font-style: normal; color: var(--ink-soft); font-size: 13.5px; }
.g-heart { display: grid; place-items: center; }
.g-heart svg { width: 30px; height: 30px; overflow: visible; }
.keys { display: none; margin: 0; font-size: 11.5px; letter-spacing: .04em; color: var(--ink-faint); }
@media (hover: hover) and (pointer: fine) { .keys { display: block; } }

.rows { width: 100%; padding: 2px 6px; }
.row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 15px; letter-spacing: .08em; }
.sw {
  position: relative;
  width: 48px; height: 29px;
  border-radius: 15px;
  border: 0; padding: 0;
  background: rgba(140, 146, 185, .3);
  transition: background .25s;
}
.sw::after {
  content: "";
  position: absolute; left: 3px; top: 3px;
  width: 23px; height: 23px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(80, 90, 150, .3);
  transition: transform .28s cubic-bezier(.3, 1.5, .5, 1);
}
.sw[aria-checked="true"] { background: var(--grad-soft); }
.sw[aria-checked="true"]::after { transform: translateX(19px); }
.mute-note { margin: -4px 0 2px; font-size: 11.5px; color: var(--ink-faint); letter-spacing: .04em; }

.pill.small { min-width: 0; height: 46px; padding: 0 10px 0 calc(10px + .2em); font-size: 15px; letter-spacing: .2em; }
.pair { width: 100%; display: flex; gap: 10px; }
.pair .pill { flex: 1; }

/* ---------- 水晶少女圖鑑 ---------- */
.card.wide { width: min(360px, 100%); }
.book-sub { margin: -4px 0 4px; font-size: 12.5px; letter-spacing: .06em; color: var(--ink-soft); }
.book-grid { width: 100%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin: 4px 0 8px; }
.book-item {
  position: relative;
  aspect-ratio: 1 / 2;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .95);
  background: linear-gradient(180deg, rgba(255, 255, 255, .75), rgba(236, 232, 252, .7));
  box-shadow: 0 4px 12px rgba(120, 120, 190, .14);
  overflow: hidden;
  padding: 0;
  display: grid; place-items: center;
}
.book-item canvas { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; image-rendering: crisp-edges; }
.book-item i {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 9px 0 3px;
  font-style: normal; font-size: 10px; letter-spacing: .08em; text-align: center;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .92) 55%);
}
.book-item.locked { background: linear-gradient(180deg, rgba(232, 230, 248, .6), rgba(220, 222, 244, .6)); box-shadow: none; }
.book-item.locked::before { content: "?"; font-size: 20px; font-weight: 300; color: var(--ink-faint); }
.book-item.locked i { color: var(--ink-faint); background: none; }
.book-item.new { animation: breathe 2.2s ease-in-out infinite; }

.girl-card { gap: 4px; padding-top: 18px; }
#girlCanvas {
  width: min(48vw, 168px); height: auto;
  image-rendering: pixelated; image-rendering: crisp-edges;
  filter: drop-shadow(0 8px 18px rgba(150, 130, 210, .3));
}
.girl-no { margin: 8px 0 0; font-size: 11.5px; letter-spacing: .3em; margin-right: -.3em; color: var(--ink-soft); }
.girl-card h2 {
  margin: 2px 0 0; font-size: 26px; font-weight: 400;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.girl-en { margin: 0; font-size: 11px; letter-spacing: .34em; margin-right: -.34em; color: var(--ink-faint); text-transform: uppercase; }
.girl-line { margin: 12px 0 14px; font-size: 15.5px; letter-spacing: .12em; line-height: 1.7; }
.girl-line::before { content: "「"; color: var(--ink-faint); }
.girl-line::after { content: "」"; color: var(--ink-faint); }
.over-met { margin: -6px 0 8px; font-size: 12.5px; letter-spacing: .08em; color: var(--ink-soft); }
.over-met:empty { display: none; }

.over-kicker { margin: 4px 0 0; font-size: 13px; letter-spacing: .5em; margin-right: -.5em; color: var(--ink-soft); }
.over-score {
  margin: 2px 0 0;
  font-size: 58px; font-weight: 200; line-height: 1.05;
  font-variant-numeric: tabular-nums;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.over-new { margin: 0; font-size: 14px; letter-spacing: .3em; color: #e486b0; animation: glowText 1.4s ease-in-out infinite; }
@keyframes glowText { 0%, 100% { opacity: .65 } 50% { opacity: 1 } }
.over-meta { margin: 6px 0 0; display: flex; gap: 14px; justify-content: center; font-size: 12.5px; letter-spacing: .08em; color: var(--ink-soft); }
.over-meta b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.over-word { margin: 8px 0 12px; font-size: 15px; letter-spacing: .16em; }

/* ---------- 其他 ---------- */
#rotate, #fail {
  position: absolute; inset: 0;
  display: none;
  place-items: center;
  text-align: center;
  padding: 30px;
  background: linear-gradient(160deg, #ece7fb, #e2effb 55%, #fbe8ee);
  font-size: 15px; letter-spacing: .1em; line-height: 1.9;
  z-index: 50;
}
#fail:not([hidden]) { display: grid; }
#rotate i {
  display: block; margin: 0 auto 18px;
  width: 44px; height: 74px;
  border-radius: 10px;
  border: 2px solid var(--ink-soft);
  animation: turn 2.2s ease-in-out infinite;
}
@keyframes turn { 0%, 20% { transform: rotate(90deg) } 60%, 100% { transform: rotate(0) } }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  #rotate { display: grid; }
}

@media (max-height: 600px) {
  #top { height: 52px; }
  #score { font-size: 25px; }
  #tray { height: 50px; }
  .heart { width: 46px; height: 48px; }
  .heart svg { width: 40px; height: 40px; }
  #nextSlot { height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  #btnStart, #btnResume, .over-new { animation: none; }
}
