:root {
  --ink: #171319;
  --ink-soft: #251b24;
  --ink-lift: #30222d;
  --paper: #f7eedc;
  --paper-muted: #d9cdbd;
  --cherry: #d74358;
  --cherry-bright: #f2606c;
  --mint: #68c9ad;
  --mint-pale: #b8efdc;
  --gold: #edbd62;
  --gold-pale: #ffe3a5;
  --line: rgba(247, 238, 220, 0.16);
  --line-strong: rgba(247, 238, 220, 0.3);
  --shadow: 0 24px 70px rgba(4, 2, 7, 0.38);
  --font-sans: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-display: "Arial Black", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-serif: Georgia, "Times New Roman", "Songti SC", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ink);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--paper);
  font-family: var(--font-sans);
  background:
    linear-gradient(115deg, rgba(215, 67, 88, 0.09), transparent 38%),
    radial-gradient(circle at 50% -20%, #4d2b36 0, #2a1b24 35%, #171319 72%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.stage-lights {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.light {
  position: absolute;
  top: -12vh;
  width: 28vw;
  height: 115vh;
  opacity: 0.17;
  filter: blur(4px);
  transform-origin: top center;
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%);
}

.light-a {
  left: 12%;
  background: linear-gradient(to bottom, rgba(255, 232, 173, 0.95), transparent 88%);
  transform: rotate(11deg);
}

.light-b {
  left: 43%;
  width: 21vw;
  opacity: 0.12;
  background: linear-gradient(to bottom, rgba(255, 110, 128, 0.8), transparent 88%);
  transform: rotate(-5deg);
}

.light-c {
  right: 9%;
  background: linear-gradient(to bottom, rgba(111, 213, 183, 0.72), transparent 88%);
  transform: rotate(-13deg);
}

.stage-floor {
  position: absolute;
  right: -10%;
  bottom: -12vh;
  left: -10%;
  height: 33vh;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(255, 236, 196, 0.24) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 236, 196, 0.17) 1px, transparent 1px);
  background-size: 66px 34px;
  transform: perspective(340px) rotateX(58deg);
  mask-image: linear-gradient(to top, #000 40%, transparent 100%);
}

.app-shell {
  width: min(760px, calc(100% - 24px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0 18px;
}

.topbar {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--paper);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  margin-right: 13px;
  place-items: center;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 24px;
  transform: rotate(-5deg);
  background: var(--gold);
  box-shadow: 6px 6px 0 var(--cherry);
  border-radius: 4px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.brand-kicker,
.eyebrow,
.label {
  color: var(--paper-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  gap: 9px;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  cursor: pointer;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(247, 238, 220, 0.035);
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease, background 160ms ease;
}

.icon-button:hover {
  color: var(--gold-pale);
  border-color: var(--gold);
  background: rgba(237, 189, 98, 0.08);
  transform: translateY(-1px);
}

.icon-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.mobile-score {
  display: flex;
  margin-left: auto;
  margin-right: 22px;
  flex-direction: column;
  text-align: right;
}

.mobile-score span {
  color: var(--paper-muted);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.mobile-score strong {
  color: var(--gold-pale);
  font-family: var(--font-display);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

.stage-layout {
  display: flex;
  justify-content: center;
  padding-top: 18px;
}

.left-rail,
.right-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.identity-panel,
.score-panel,
.next-panel,
.collection-panel,
.tip-strip {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(25, 19, 26, 0.55);
  backdrop-filter: blur(14px);
}

.identity-panel {
  min-height: 420px;
  padding: 20px 19px 15px;
  border-color: rgba(237, 189, 98, 0.25);
  background:
    linear-gradient(155deg, rgba(215, 67, 88, 0.13), transparent 36%),
    rgba(22, 17, 23, 0.72);
}

.identity-panel::before {
  position: absolute;
  top: 13px;
  right: 13px;
  bottom: 13px;
  left: 13px;
  content: "";
  pointer-events: none;
  border: 1px solid rgba(247, 238, 220, 0.07);
}

.poster-slip {
  display: flex;
  position: relative;
  z-index: 1;
  justify-content: space-between;
  margin: -20px -19px 21px;
  padding: 8px 19px;
  color: var(--ink);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  background: var(--mint-pale);
}

.identity-panel .eyebrow {
  position: relative;
  z-index: 1;
  max-width: 150px;
  line-height: 1.5;
}

.identity-panel h1 {
  position: relative;
  z-index: 1;
  margin: 15px 0 0;
  line-height: 0.83;
}

.title-en {
  display: block;
  color: var(--gold-pale);
  font-family: var(--font-display);
  font-size: clamp(70px, 7.5vw, 104px);
  font-weight: 900;
  letter-spacing: -0.055em;
  text-shadow: 5px 5px 0 rgba(215, 67, 88, 0.7);
}

.title-cn {
  display: block;
  margin-top: 16px;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.poster-line {
  position: relative;
  z-index: 1;
  margin: 11px 0 0;
  color: var(--cherry-bright);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.poster-art {
  position: relative;
  height: 138px;
  margin-top: 15px;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(237, 189, 98, 0.28);
  border-radius: 50%;
}

.orbit-one {
  top: 8px;
  left: 50%;
  width: 130px;
  height: 105px;
  transform: translateX(-50%) rotate(-18deg);
}

.orbit-two {
  top: 22px;
  left: 50%;
  width: 170px;
  height: 76px;
  transform: translateX(-50%) rotate(16deg);
}

.cat-seal {
  position: absolute;
  top: 15px;
  left: 50%;
  width: 100px;
  height: 100px;
  transform: translateX(-50%);
  border: 2px solid var(--gold);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.24), transparent 20%),
    linear-gradient(145deg, var(--cherry-bright), #8d2741);
  box-shadow: 0 0 0 6px rgba(215, 67, 88, 0.12);
}

.cat-ear {
  position: absolute;
  top: -14px;
  width: 38px;
  height: 38px;
  border: 2px solid var(--gold);
  background: var(--cherry);
  transform: rotate(45deg);
}

.ear-left {
  left: 3px;
  border-radius: 5px 1px 1px 1px;
}

.ear-right {
  right: 3px;
  border-radius: 1px 5px 1px 1px;
}

.cat-eye {
  position: absolute;
  top: 43px;
  width: 9px;
  height: 13px;
  border-radius: 50%;
  background: var(--ink);
}

.eye-left {
  left: 29px;
}

.eye-right {
  right: 29px;
}

.cat-nose {
  position: absolute;
  top: 61px;
  left: 50%;
  width: 9px;
  height: 7px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--gold-pale);
  border-radius: 1px 50% 50% 50%;
}

.poster-ten {
  position: absolute;
  right: 7px;
  bottom: 5px;
  color: transparent;
  font-family: var(--font-display);
  font-size: 55px;
  font-weight: 900;
  letter-spacing: -0.06em;
  -webkit-text-stroke: 1px rgba(247, 238, 220, 0.24);
  transform: rotate(-11deg);
}

.poster-star {
  position: absolute;
  color: var(--gold);
  font-size: 16px;
}

.star-one {
  top: 17px;
  left: 7px;
}

.star-two {
  right: 10px;
  bottom: 23px;
  font-size: 10px;
}

.poster-footer {
  display: flex;
  position: relative;
  z-index: 1;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 12px;
  color: rgba(247, 238, 220, 0.48);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.11em;
  border-top: 1px solid rgba(247, 238, 220, 0.1);
}

.barcode {
  width: 52px;
  height: 15px;
  opacity: 0.6;
  background: repeating-linear-gradient(90deg, var(--paper) 0 1px, transparent 1px 3px, var(--paper) 3px 4px, transparent 4px 7px);
}

.score-panel {
  padding: 17px 18px 15px;
}

.score-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.score-main strong {
  color: var(--gold-pale);
  font-family: var(--font-display);
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.score-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 13px;
  padding-top: 10px;
  color: var(--paper-muted);
  font-size: 9px;
  letter-spacing: 0.1em;
  border-top: 1px solid var(--line);
}

.score-meta b {
  margin-left: 3px;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}

.level-progress {
  margin-top: 14px;
}

.level-progress > span {
  display: block;
  margin-bottom: 7px;
  color: var(--mint-pale);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.progress-track {
  height: 3px;
  overflow: hidden;
  background: rgba(247, 238, 220, 0.1);
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cherry-bright), var(--gold));
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.game-column {
  display: flex;
  width: min(100%, 560px);
  min-width: 0;
  margin: 0 auto;
  flex-direction: column;
  align-items: stretch;
}

.board-wrap {
  position: relative;
  width: 100%;
}

.board-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 700 / 860;
  isolation: isolate;
  border: 1px solid rgba(255, 229, 187, 0.38);
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% -18%, rgba(255, 216, 157, 0.15), transparent 42%),
    linear-gradient(180deg, #261722, #171218 68%, #130e14);
  box-shadow:
    0 0 0 6px #292028,
    0 0 0 7px rgba(247, 238, 220, 0.12),
    var(--shadow);
}

.board-frame::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  pointer-events: none;
  opacity: 0.32;
  background:
    linear-gradient(90deg, transparent 0 49.9%, rgba(247, 238, 220, 0.1) 50%, transparent 50.1%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(247, 238, 220, 0.025) 40px);
}

.board-frame::after {
  position: absolute;
  inset: 8px;
  z-index: 1;
  content: "";
  pointer-events: none;
  border: 1px solid rgba(247, 238, 220, 0.06);
}

#gameCanvas {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: none;
}

.board-ribbon {
  display: flex;
  position: absolute;
  top: 80px;
  z-index: 4;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.15em;
  writing-mode: vertical-rl;
  pointer-events: none;
  background: var(--gold);
}

.board-ribbon-left {
  left: -24px;
  width: 24px;
  height: 125px;
  border-radius: 4px 0 0 4px;
}

.board-ribbon-right {
  right: -24px;
  width: 24px;
  height: 86px;
  color: var(--ink);
  background: var(--mint);
  border-radius: 0 4px 4px 0;
}

.board-watermark {
  position: absolute;
  right: 7%;
  bottom: 8%;
  z-index: 1;
  color: rgba(247, 238, 220, 0.035);
  font-family: var(--font-display);
  line-height: 0.8;
  text-align: right;
  pointer-events: none;
}

.board-watermark span {
  font-size: 220px;
  font-weight: 900;
}

.board-watermark small {
  display: block;
  font-size: 16px;
  letter-spacing: 0.2em;
}

.danger-label {
  display: flex;
  position: absolute;
  top: 10.5%;
  right: 3.4%;
  left: 3.4%;
  z-index: 3;
  align-items: center;
  gap: 8px;
  color: rgba(247, 238, 220, 0.34);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.14em;
  pointer-events: none;
}

.danger-label::after {
  flex: 1;
  height: 1px;
  content: "";
  background: repeating-linear-gradient(90deg, rgba(242, 96, 108, 0.38) 0 5px, transparent 5px 10px);
}

.danger-label i {
  width: 5px;
  height: 5px;
  background: var(--cherry);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--cherry);
}

.board-live {
  display: flex;
  position: absolute;
  top: 2.4%;
  left: 50%;
  z-index: 3;
  align-items: center;
  gap: 7px;
  color: rgba(247, 238, 220, 0.52);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.18em;
  transform: translateX(-50%);
  pointer-events: none;
}

.live-dot {
  width: 5px;
  height: 5px;
  background: var(--cherry-bright);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(242, 96, 108, 0.12);
  animation: live-pulse 1.7s ease-in-out infinite;
}

@keyframes live-pulse {
  50% {
    opacity: 0.4;
    transform: scale(0.75);
  }
}

.combo-burst {
  display: flex;
  position: absolute;
  top: 18%;
  right: 5%;
  z-index: 6;
  flex-direction: column;
  align-items: flex-end;
  opacity: 0;
  transform: translateY(8px) rotate(-5deg);
  pointer-events: none;
  transition: opacity 180ms ease, transform 220ms ease;
}

.combo-burst.is-visible {
  opacity: 1;
  transform: translateY(0) rotate(-5deg);
}

.combo-burst span {
  color: var(--mint-pale);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.combo-burst strong {
  color: var(--gold-pale);
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
  text-shadow: 2px 2px 0 var(--cherry);
}

.merge-toast {
  position: absolute;
  top: 23%;
  left: 50%;
  z-index: 7;
  padding: 7px 12px;
  opacity: 0;
  color: var(--ink);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  transform: translate(-50%, 10px) rotate(-2deg);
  pointer-events: none;
  background: var(--gold-pale);
  border-radius: 2px;
  box-shadow: 4px 4px 0 var(--cherry);
}

.merge-toast.is-visible {
  animation: toast-in 1.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes toast-in {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) rotate(-2deg) scale(0.9);
  }
  15%,
  72% {
    opacity: 1;
    transform: translate(-50%, 0) rotate(-2deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -12px) rotate(-2deg) scale(1);
  }
}

.start-curtain,
.game-over {
  display: flex;
  position: absolute;
  inset: 0;
  z-index: 10;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.start-curtain {
  background:
    linear-gradient(90deg, rgba(247, 238, 220, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(247, 238, 220, 0.05) 1px, transparent 1px),
    rgba(19, 14, 20, 0.78);
  background-size: 44px 44px;
  backdrop-filter: blur(2px);
  transition: opacity 360ms ease, visibility 360ms ease;
}

.start-curtain.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.curtain-mark {
  display: flex;
  position: relative;
  width: min(62%, 250px);
  aspect-ratio: 1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transform: rotate(-3deg);
  border: 1px solid rgba(237, 189, 98, 0.5);
}

.curtain-mark::before,
.curtain-mark::after {
  position: absolute;
  width: 100%;
  height: 1px;
  content: "";
  background: rgba(237, 189, 98, 0.5);
}

.curtain-mark::before {
  top: 50%;
  left: calc(-100% - 14px);
}

.curtain-mark::after {
  top: 50%;
  right: calc(-100% - 14px);
}

.curtain-mark span {
  color: var(--cherry-bright);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.3em;
}

.curtain-mark strong {
  color: var(--paper);
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 46px);
  letter-spacing: -0.05em;
}

.primary-button {
  display: inline-flex;
  min-height: 47px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 27px;
  padding: 0 22px;
  cursor: pointer;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  border: 0;
  border-radius: 3px;
  background: var(--gold);
  box-shadow: 5px 5px 0 var(--cherry);
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.primary-button:hover {
  background: var(--gold-pale);
  transform: translate(-1px, -1px);
  box-shadow: 7px 7px 0 var(--cherry);
}

.primary-button:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--cherry);
}

.primary-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.curtain-caption {
  margin-top: 21px;
  color: rgba(247, 238, 220, 0.45);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.game-over {
  visibility: hidden;
  padding: 32px;
  opacity: 0;
  background:
    linear-gradient(145deg, rgba(215, 67, 88, 0.13), transparent 42%),
    rgba(19, 14, 20, 0.94);
  backdrop-filter: blur(7px);
  transition: opacity 300ms ease, visibility 300ms ease;
}

.game-over.is-visible {
  visibility: visible;
  opacity: 1;
}

.over-eyebrow {
  color: var(--cherry-bright);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.game-over h2 {
  margin: 9px 0 6px;
  color: var(--paper);
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 700;
}

.game-over > p {
  max-width: 260px;
  margin: 0;
  color: var(--paper-muted);
  font-size: 12px;
}

.final-score {
  display: flex;
  width: min(260px, 78%);
  justify-content: space-between;
  margin-top: 24px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.final-score span,
.final-meta span {
  color: var(--paper-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.final-score strong {
  color: var(--gold-pale);
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
}

.final-meta {
  display: flex;
  width: min(260px, 78%);
  justify-content: space-between;
  margin-top: 12px;
}

.final-meta b {
  margin-left: 4px;
  color: var(--paper);
  font-size: 10px;
}

.board-footer {
  display: flex;
  align-items: center;
  justify-content: stretch;
  padding: 19px 3px 0;
}

.drop-hint {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(247, 238, 220, 0.36);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.mouse-shape {
  display: grid;
  width: 17px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(247, 238, 220, 0.3);
  border-radius: 9px;
}

.mouse-shape i {
  display: block;
  width: 1px;
  height: 5px;
  background: var(--gold);
}

.hint-line {
  width: 20px;
  height: 1px;
  background: rgba(247, 238, 220, 0.16);
}

.space-key {
  padding: 4px 6px;
  border: 1px solid rgba(247, 238, 220, 0.2);
  border-radius: 2px;
}

.drop-button {
  display: inline-flex;
  width: 100%;
  height: 46px;
  align-items: center;
  gap: 7px;
  justify-content: center;
  padding: 0 14px;
  cursor: pointer;
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  border: 0;
  border-radius: 3px;
  background: var(--mint);
  transition: background 150ms ease, transform 150ms ease;
}

.drop-button:hover {
  background: var(--mint-pale);
  transform: translateY(-1px);
}

.drop-button svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.next-panel {
  padding: 16px 17px 14px;
  background:
    radial-gradient(circle at 82% 28%, rgba(237, 189, 98, 0.1), transparent 36%),
    rgba(25, 19, 26, 0.55);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.section-heading h2 {
  margin: 5px 0 0;
  color: var(--paper);
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1;
}

.number-stamp {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: var(--ink);
  font-size: 8px;
  font-weight: 900;
  transform: rotate(4deg);
  background: var(--gold);
}

.next-display {
  display: flex;
  position: relative;
  align-items: center;
  gap: 13px;
  min-height: 105px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.sprite-preview {
  --sprite-x: 0%;
  --sprite-y: 0%;
  flex: 0 0 auto;
  aspect-ratio: 1;
  background-image: url("assets/ten-photos.webp");
  background-repeat: no-repeat;
  background-position: var(--sprite-x) var(--sprite-y);
  background-size: 400% 300%;
}

.next-sprite {
  width: 90px;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.24));
  animation: candidate-breathe 4.8s ease-in-out infinite;
  transition: opacity 120ms ease, transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.next-sprite.is-leaving {
  opacity: 0;
  transform: translateY(7px) rotate(4deg) scale(0.9);
  animation: none;
}

.next-sprite.is-arriving {
  animation: candidate-arrive 420ms cubic-bezier(0.22, 1, 0.36, 1), candidate-breathe 4.8s 420ms ease-in-out infinite;
}

@keyframes candidate-arrive {
  0% {
    opacity: 0;
    transform: translateY(-9px) rotate(-4deg) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(0) scale(1);
  }
}

@keyframes candidate-breathe {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-4px) rotate(1deg);
  }
}

.next-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.next-copy span {
  color: var(--mint-pale);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.next-copy strong {
  overflow: hidden;
  margin-top: 3px;
  color: var(--paper);
  font-family: var(--font-serif);
  font-size: 18px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.next-copy i {
  width: 24px;
  height: 2px;
  margin-top: 8px;
  background: var(--cherry);
}

.next-display::after {
  position: absolute;
  right: 0;
  bottom: 6px;
  width: 38%;
  height: 1px;
  content: "";
  opacity: 0.36;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.collection-panel {
  padding: 16px 17px 12px;
}

.collection-count {
  color: var(--gold-pale);
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.02em;
}

.collection-count span {
  font-size: 24px;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.collection-item {
  position: relative;
  padding-top: 100%;
  overflow: hidden;
  border: 1px solid rgba(247, 238, 220, 0.08);
  border-radius: 4px;
  background-color: rgba(247, 238, 220, 0.03);
}

.collection-item .sprite-preview {
  position: absolute;
  inset: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  opacity: 0.13;
  filter: grayscale(1);
  transition: opacity 260ms ease, filter 260ms ease, transform 260ms ease;
}

.collection-item.is-found .sprite-preview {
  opacity: 1;
  filter: none;
}

.collection-item.is-new {
  animation: item-pop 560ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes item-pop {
  0% {
    transform: scale(0.7) rotate(-8deg);
    box-shadow: 0 0 0 0 rgba(237, 189, 98, 0.8);
  }
  55% {
    transform: scale(1.1) rotate(3deg);
    box-shadow: 0 0 0 5px rgba(237, 189, 98, 0);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

.collection-item::after {
  display: grid;
  position: absolute;
  inset: 0;
  place-items: center;
  content: attr(data-number);
  color: rgba(247, 238, 220, 0.38);
  font-size: 7px;
  font-weight: 900;
}

.collection-item.is-found::after {
  display: none;
}

.collection-note {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  margin-top: 10px;
  padding-top: 9px;
  color: var(--paper-muted);
  font-size: 8px;
  line-height: 1.35;
  border-top: 1px solid var(--line);
}

.collection-note svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  color: var(--gold);
}

.tip-strip {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  color: var(--ink);
  border-color: transparent;
  background: var(--mint-pale);
}

.tip-index {
  padding: 3px 5px;
  color: var(--paper);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.09em;
  background: var(--ink);
}

.tip-strip p {
  flex: 1;
  margin: 0;
  font-size: 9px;
  font-weight: 800;
}

.tip-strip svg {
  width: 15px;
  height: 15px;
}

.page-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 0 0;
  color: rgba(247, 238, 220, 0.3);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.14em;
  border-top: 1px solid rgba(247, 238, 220, 0.08);
  margin-top: 18px;
}

.footer-dots {
  width: 5px;
  height: 5px;
  background: var(--cherry);
  border-radius: 50%;
}

body.is-shaking .board-frame {
  animation: board-shake 300ms ease;
}

@keyframes board-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px) rotate(-0.15deg);
  }
  50% {
    transform: translateX(3px) rotate(0.15deg);
  }
  75% {
    transform: translateX(-1px);
  }
}

@media (max-width: 1180px) {
  .app-shell {
    width: min(910px, calc(100% - 40px));
  }

  .stage-layout {
    grid-template-columns: minmax(440px, 530px) minmax(210px, 250px);
    gap: 28px;
  }

  .left-rail {
    display: none;
  }

  .mobile-score {
    display: flex;
    margin-left: auto;
    margin-right: 20px;
    flex-direction: column;
    text-align: right;
  }

  .mobile-score span {
    color: var(--paper-muted);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.15em;
  }

  .mobile-score strong {
    color: var(--gold-pale);
    font-family: var(--font-display);
    font-size: 22px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
  }
}

@media (max-width: 780px) {
  .app-shell {
    width: min(560px, calc(100% - 28px));
    padding-top: 12px;
  }

  .topbar {
    min-height: 58px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 20px;
    box-shadow: 4px 4px 0 var(--cherry);
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .brand-kicker {
    font-size: 8px;
  }

  .mobile-score {
    margin-right: 12px;
  }

  .mobile-score strong {
    font-size: 18px;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .stage-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 15px;
  }

  .right-rail {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: 12px;
  }

  .next-panel,
  .collection-panel {
    min-width: 0;
  }

  .next-display {
    min-height: 80px;
  }

  .next-sprite {
    width: 62px;
  }

  .next-copy strong {
    font-size: 15px;
  }

  .collection-grid {
    margin-top: 10px;
    padding-top: 9px;
  }

  .collection-note,
  .tip-strip {
    display: none;
  }

  .board-ribbon {
    display: none;
  }

  .board-footer {
    padding-top: 14px;
  }

  .page-footer {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .app-shell {
    width: calc(100% - 20px);
    padding-top: 8px;
  }

  .topbar {
    min-height: 54px;
  }

  .brand-copy strong {
    font-size: 16px;
  }

  .brand-kicker {
    display: none;
  }

  .brand-mark {
    width: 35px;
    height: 35px;
    margin-right: 9px;
    font-size: 18px;
  }

  .mobile-score {
    margin-right: 9px;
  }

  .mobile-score strong {
    font-size: 16px;
  }

  .top-actions {
    gap: 5px;
  }

  .icon-button {
    width: 35px;
    height: 35px;
  }

  .icon-button svg {
    width: 15px;
    height: 15px;
  }

  .stage-layout {
    gap: 18px;
    padding-top: 11px;
  }

  .board-frame {
    box-shadow:
      0 0 0 4px #292028,
      0 0 0 5px rgba(247, 238, 220, 0.12),
      0 18px 45px rgba(4, 2, 7, 0.35);
  }

  .curtain-mark {
    width: 170px;
  }

  .curtain-mark strong {
    font-size: 32px;
  }

  .game-over h2 {
    font-size: 34px;
  }

  .drop-hint {
    display: none;
  }

  .board-footer {
    justify-content: flex-end;
  }

  .drop-button {
    width: 100%;
    height: 43px;
    justify-content: center;
  }

  .right-rail {
    grid-template-columns: 1fr 1.4fr;
  }

  .next-panel,
  .collection-panel {
    padding: 13px 12px 11px;
  }

  .section-heading h2 {
    font-size: 16px;
  }

  .next-display {
    gap: 7px;
  }

  .next-sprite {
    width: 54px;
  }

  .next-copy span {
    font-size: 7px;
  }

  .next-copy strong {
    font-size: 14px;
  }

  .collection-grid {
    gap: 3px;
  }

  .collection-count span {
    font-size: 19px;
  }

  .page-footer {
    flex-wrap: wrap;
    row-gap: 6px;
    font-size: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
