:root {
  --navy-950: #0b1624;
  --navy-900: #10283e;
  --navy-800: #173a58;
  --cream: #fff5de;
  --peach: #ff966f;
  --honey: #ffc75f;
  --wine: #8e3c50;
  --glass: rgba(255, 255, 255, 0.82);
  --glass-strong: rgba(255, 255, 255, 0.94);
  --ink: #182434;
  --muted: #5b6a79;
  --danger: #dd5367;
  --success: #24996f;
  --shadow: 0 18px 50px rgba(11, 22, 36, 0.24);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  font-family: Inter, ui-rounded, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--navy-950);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  min-width: 320px;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.screen--active {
  display: block;
}

.screen-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 20, 35, 0.22), rgba(5, 20, 35, 0.08) 45%, rgba(5, 20, 35, 0.28)),
    radial-gradient(circle at 50% 30%, transparent 0 40%, rgba(7, 22, 38, 0.12) 100%);
}

.screen-shade--title {
  background:
    linear-gradient(180deg, rgba(8, 24, 40, 0.02) 0 55%, rgba(8, 24, 40, 0.28) 100%);
}

.screen-shade--game {
  background: linear-gradient(180deg, rgba(7, 24, 41, 0.12), rgba(7, 24, 41, 0.18));
}

.loading-screen {
  display: none;
  place-items: center;
  background:
    radial-gradient(circle at 50% 22%, #315c7d 0, #17384f 40%, #0b1827 100%);
}

.loading-screen.screen--active {
  display: grid;
}

.loading-card {
  width: min(86vw, 560px);
  padding: 36px 32px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius-xl);
  background: rgba(11, 27, 43, 0.76);
  box-shadow: var(--shadow);
  color: white;
  text-align: center;
  backdrop-filter: blur(18px);
}

.loading-logo {
  font-size: clamp(30px, 7vw, 58px);
  font-weight: 1000;
  letter-spacing: -0.05em;
  color: var(--honey);
  text-shadow:
    0 4px 0 #8d3e32,
    0 7px 16px rgba(0, 0, 0, 0.28);
}

.loading-subtitle {
  margin-top: 8px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.loading-track {
  height: 14px;
  margin-top: 30px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.loading-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--peach), var(--honey));
  transition: width 180ms ease;
}

.loading-text {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 700;
}

.title-screen {
  background-color: #8dd8ff;
}

.title-actions {
  position: absolute;
  left: 50%;
  bottom: max(5.5%, env(safe-area-inset-bottom));
  z-index: 3;
  display: flex;
  width: min(82vw, 440px);
  transform: translateX(-50%);
  flex-direction: column;
  gap: 12px;
}

.title-actions__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
}

.game-button,
.icon-button {
  border: 0;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}

.game-button:hover,
.icon-button:hover {
  filter: brightness(1.04);
  transform: translateY(-2px);
}

.game-button:active,
.icon-button:active {
  transform: translateY(1px) scale(0.99);
}

.game-button:focus-visible,
.icon-button:focus-visible {
  outline: 4px solid rgba(255, 255, 255, 0.92);
  outline-offset: 3px;
}

.game-button {
  min-height: 58px;
  padding: 14px 24px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 18px;
  box-shadow:
    0 8px 0 rgba(74, 38, 31, 0.38),
    0 14px 28px rgba(20, 38, 58, 0.24);
  font-size: clamp(17px, 4vw, 23px);
  font-weight: 1000;
  letter-spacing: 0.02em;
}

.game-button--primary {
  color: #4a2a28;
  background: linear-gradient(180deg, #ffd878, #ff9a68);
}

.game-button--secondary {
  color: white;
  background: linear-gradient(180deg, rgba(27, 69, 101, 0.96), rgba(13, 43, 67, 0.96));
}

.game-button--small {
  width: 100%;
  min-height: 46px;
  padding: 10px 15px;
  font-size: 14px;
  border-radius: 14px;
  box-shadow: 0 5px 0 rgba(7, 25, 42, 0.4);
}

.icon-button {
  display: inline-grid;
  min-width: 48px;
  min-height: 48px;
  place-items: center;
  padding: 9px 13px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 15px;
  color: white;
  background: rgba(15, 48, 73, 0.88);
  box-shadow: 0 7px 18px rgba(8, 28, 45, 0.24);
  font-size: 21px;
  font-weight: 1000;
  backdrop-filter: blur(12px);
}

.icon-button--wide {
  font-size: 13px;
  letter-spacing: 0.04em;
}

.version-label {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 2;
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.theme-screen,
.collection-screen {
  overflow-y: auto;
  background-color: #bde8ff;
}

.page-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  width: min(1180px, calc(100% - 28px));
  margin: max(18px, env(safe-area-inset-top)) auto 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 22px;
  background: rgba(14, 49, 75, 0.76);
  color: white;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.page-header h1 {
  margin: 0;
  font-size: clamp(22px, 4.2vw, 38px);
  font-weight: 1000;
}

.page-header p {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 650;
}

.page-header__spacer {
  width: 48px;
}

.theme-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  width: min(1120px, calc(100% - 30px));
  margin: 0 auto;
  padding: 0 0 max(42px, env(safe-area-inset-bottom));
}

.theme-card {
  position: relative;
  min-height: 440px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 30px;
  background-color: #8bc7e4;
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.theme-card::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 35%, rgba(7, 22, 36, 0.84) 100%);
}

.theme-card--locked::after {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(13, 29, 43, 0.46);
  backdrop-filter: grayscale(0.35) blur(1.2px);
}

.theme-card__content {
  position: absolute;
  z-index: 2;
  right: 20px;
  bottom: 20px;
  left: 20px;
  color: white;
}

.theme-card__eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--navy-900);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.08em;
}

.theme-card__title {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1;
  font-weight: 1000;
}

.theme-card__description {
  margin: 8px 0 14px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 650;
}

.theme-card__lock {
  position: absolute;
  z-index: 3;
  top: 18px;
  right: 18px;
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.68);
  border-radius: 50%;
  color: white;
  background: rgba(10, 29, 45, 0.78);
  box-shadow: var(--shadow);
  font-size: 32px;
}

.collection-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  width: min(1180px, calc(100% - 30px));
  margin: 0 auto;
  padding: 0 0 max(44px, env(safe-area-inset-bottom));
}

.collection-card {
  min-height: 245px;
  padding: 14px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 15px 30px rgba(15, 43, 64, 0.18);
  text-align: center;
  backdrop-filter: blur(12px);
}

.collection-card--locked {
  color: #69747e;
  background: rgba(235, 239, 242, 0.78);
}

.collection-card canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  margin: 0 auto 8px;
}

.collection-card--locked canvas {
  filter: grayscale(1) contrast(0.5) opacity(0.28);
}

.collection-card__level {
  color: var(--wine);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.08em;
}

.collection-card__name {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  font-weight: 900;
}

.game-screen {
  background-color: #8ccff2;
}

.game-topbar {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: min(1260px, calc(100% - 24px));
  margin: max(10px, env(safe-area-inset-top)) auto 8px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  background: rgba(13, 44, 68, 0.74);
  color: white;
  box-shadow: 0 12px 26px rgba(11, 32, 50, 0.2);
  backdrop-filter: blur(16px);
}

.game-topbar__title {
  min-width: 0;
  text-align: center;
}

.game-topbar__title strong,
.game-topbar__title span {
  display: block;
}

.game-topbar__title strong {
  font-size: 16px;
  font-weight: 1000;
  letter-spacing: 0.08em;
}

.game-topbar__title span {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-topbar__actions {
  display: flex;
  gap: 8px;
}

.game-layout {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(130px, 190px) minmax(320px, 720px) minmax(145px, 210px);
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 22px);
  width: min(1320px, calc(100% - 22px));
  height: calc(100% - 92px);
  margin: 0 auto;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hud-card {
  padding: 15px 14px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 32px rgba(14, 45, 68, 0.18);
  text-align: center;
  backdrop-filter: blur(12px);
}

.hud-label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.08em;
}

.hud-card strong {
  display: block;
  font-size: clamp(21px, 3vw, 34px);
  font-variant-numeric: tabular-nums;
  font-weight: 1000;
}

.hud-card--preview canvas {
  display: block;
  width: min(100%, 132px);
  height: auto;
  margin: 4px auto;
}

.hud-card--preview strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-card--mission strong {
  color: var(--wine);
  font-size: 15px;
}

.hud-card--mission span:last-child {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.board-zone {
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.drop-hint {
  margin: 0 0 6px;
  padding: 6px 14px;
  border-radius: 999px;
  color: white;
  background: rgba(16, 49, 75, 0.72);
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 0.08em;
  backdrop-filter: blur(10px);
}

.board-shell {
  position: relative;
  width: min(100%, 690px);
  height: min(100%, 850px);
  min-height: 360px;
  overflow: hidden;
  border: 6px solid rgba(255, 255, 255, 0.92);
  border-radius: 38px;
  background: rgba(213, 241, 255, 0.16);
  box-shadow:
    inset 0 0 0 2px rgba(23, 61, 88, 0.08),
    0 24px 48px rgba(11, 34, 53, 0.22);
  touch-action: none;
  backdrop-filter: blur(1px);
}

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

.board-glass {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 28%),
    radial-gradient(circle at 30% 12%, rgba(255, 255, 255, 0.13), transparent 32%);
}

.modal-root {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
}

.modal-root--open {
  display: grid;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 15, 25, 0.62);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(92vw, 560px);
  max-height: min(84vh, 720px);
  overflow-y: auto;
  padding: 28px;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  background: var(--glass-strong);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  text-align: center;
}

.modal-card h2 {
  margin: 0 0 14px;
  color: var(--navy-900);
  font-size: clamp(27px, 6vw, 42px);
  font-weight: 1000;
}

.modal-body {
  color: #405161;
  line-height: 1.55;
}

.modal-body p {
  margin: 8px 0;
}

.modal-body strong {
  color: var(--wine);
}

.modal-body ol {
  margin: 12px 0;
  padding-left: 22px;
  text-align: left;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 11px;
  margin-top: 22px;
}

.modal-actions .game-button {
  min-width: 150px;
  flex: 1;
}

.toast {
  position: fixed;
  z-index: 150;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  max-width: min(90vw, 560px);
  padding: 12px 18px;
  border: 2px solid rgba(255, 255, 255, 0.66);
  border-radius: 999px;
  color: white;
  background: rgba(13, 43, 66, 0.92);
  box-shadow: var(--shadow);
  font-weight: 850;
  text-align: center;
  transform: translate(-50%, 150%);
  transition: transform 220ms ease;
  pointer-events: none;
  backdrop-filter: blur(14px);
}

.toast--show {
  transform: translate(-50%, 0);
}

@media (orientation: portrait) {
  .theme-grid {
    grid-template-columns: 1fr;
  }

  .theme-card {
    min-height: min(58vh, 560px);
  }

  .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-items: stretch;
    height: calc(100% - 82px);
    gap: 7px;
  }

  .side-panel {
    flex-direction: row;
  }

  .side-panel--left {
    order: 1;
  }

  .board-zone {
    order: 2;
    min-height: 0;
  }

  .side-panel--right {
    order: 3;
    display: grid;
    grid-template-columns: 1.15fr 1.15fr 0.7fr;
    gap: 7px;
  }

  .hud-card {
    min-width: 0;
    padding: 8px 9px;
    border-radius: 14px;
  }

  .side-panel--left .hud-card {
    flex: 1;
  }

  .hud-label {
    font-size: 9px;
  }

  .hud-card strong {
    font-size: 19px;
  }

  .hud-card--preview {
    display: grid;
    grid-template-columns: 1fr 54px;
    grid-template-rows: auto auto;
    align-items: center;
  }

  .hud-card--preview .hud-label {
    grid-column: 1 / -1;
  }

  .hud-card--preview canvas {
    grid-column: 2;
    grid-row: 2;
    width: 52px;
    margin: 0;
  }

  .hud-card--preview strong {
    grid-column: 1;
    grid-row: 2;
    font-size: 10px;
  }

  .hud-card--mission strong {
    font-size: 11px;
  }

  .hud-card--mission span:last-child {
    margin-top: 3px;
    font-size: 8px;
  }

  .board-shell {
    width: min(92vw, 620px);
    height: 100%;
    min-height: 0;
    border-width: 5px;
    border-radius: 30px;
  }

  .drop-hint {
    margin-bottom: 3px;
    padding: 4px 11px;
    font-size: 8px;
  }

  .game-button--small {
    align-self: stretch;
    height: 100%;
    min-height: 0;
    font-size: 10px;
  }
}

@media (orientation: landscape) {
  .title-actions {
    left: clamp(42px, 10vw, 170px);
    bottom: clamp(40px, 10vh, 120px);
    width: min(31vw, 420px);
    transform: none;
  }

  .collection-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .game-layout {
    padding-top: 2px;
  }
}

@media (max-width: 700px) {
  .page-header {
    align-items: start;
  }

  .page-header p {
    display: none;
  }

  .collection-card {
    min-height: 205px;
  }

  .modal-card {
    padding: 24px 18px;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .game-topbar {
    margin-top: 5px;
    padding: 5px 9px;
  }

  .game-layout {
    height: calc(100% - 63px);
  }

  .game-topbar .icon-button {
    min-width: 40px;
    min-height: 40px;
  }

  .hud-card {
    padding: 9px;
  }

  .drop-hint {
    display: none;
  }
}

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


/* ===== Version 1.12 – Character Flashcards ===== */
.collection-screen {
  position: relative;
  overflow-x: hidden;
}
.collection-screen::before,
.collection-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.collection-screen::before {
  z-index: 0;
  background:
    radial-gradient(circle at 15% 22%, rgba(255,255,255,0.95) 0 1px, transparent 2px),
    radial-gradient(circle at 30% 68%, rgba(255,243,214,0.75) 0 1px, transparent 2px),
    radial-gradient(circle at 74% 16%, rgba(255,255,255,0.9) 0 1.5px, transparent 2.6px),
    radial-gradient(circle at 86% 55%, rgba(255,241,199,0.85) 0 1px, transparent 2px),
    radial-gradient(circle at 63% 84%, rgba(255,255,255,0.82) 0 1px, transparent 2px);
  animation: mmhTwinkle 7s ease-in-out infinite;
  opacity: .42;
}
.collection-screen::after {
  z-index: 0;
  background: radial-gradient(circle at 50% -10%, rgba(255,255,255,.25), transparent 42%);
}
.collection-note {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 30px));
  margin: -4px auto 16px;
  color: rgba(255,255,255,.86);
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(0,0,0,.22);
}
.collection-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}
.collection-card {
  position: relative;
  min-height: 320px;
  padding: 12px 12px 14px;
  border: 2px solid rgba(255,255,255,.86);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.94) 0%, rgba(248,251,255,.88) 100%);
  box-shadow: 0 16px 34px rgba(15,43,64,.18), inset 0 1px 0 rgba(255,255,255,.8);
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
}
.collection-card:hover,
.collection-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 22px 40px rgba(15,43,64,.22), inset 0 1px 0 rgba(255,255,255,.95);
  border-color: rgba(255,255,255,.98);
  outline: none;
}
.collection-card--locked {
  background: linear-gradient(180deg, rgba(238,242,246,.95), rgba(226,232,237,.88));
}
.collection-card__topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.collection-card__level,
.collection-card__role {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .08em;
}
.collection-card__level {
  color: var(--wine);
  background: rgba(255,230,210,.95);
}
.collection-card__role {
  color: var(--navy-900);
  background: rgba(210,232,246,.88);
  text-align: center;
}
.collection-card--locked .collection-card__role {
  background: rgba(220,223,226,.95);
  color: #69747e;
}
.collection-card__canvas-wrap {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  margin: 8px 0 10px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255,214,191,.95) 0%, rgba(255,242,232,.72) 42%, rgba(255,255,255,0) 70%);
}
.collection-card__canvas-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,0));
}
.collection-card canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  margin: 0 auto;
}
.collection-card--locked canvas {
  filter: grayscale(1) contrast(.45) opacity(.3);
}
.collection-card__info {
  position: relative;
  z-index: 1;
}
.collection-card__name {
  display: block;
  color: var(--navy-900);
  font-size: 18px;
  line-height: 1.05;
  font-weight: 1000;
}
.collection-card__title {
  display: -webkit-box;
  margin-top: 7px;
  color: #536779;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 700;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.collection-card__sparkle {
  position: absolute;
  top: 58px;
  right: 14px;
  color: rgba(255,182,110,.92);
  font-size: 14px;
  text-shadow: 0 0 14px rgba(255,190,119,.6);
  animation: mmhPulse 3.2s ease-in-out infinite;
}
.collection-card--locked .collection-card__sparkle {
  color: rgba(156,166,176,.92);
  text-shadow: none;
}

.modal-card--character {
  width: min(92vw, 760px);
  max-height: min(88vh, 820px);
  padding: 22px 24px 20px;
  text-align: left;
}
.modal-card--character h2 {
  margin-bottom: 10px;
  text-align: center;
}
.character-modal {
  display: grid;
  grid-template-columns: minmax(240px, 290px) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}
.character-modal__hero {
  position: relative;
  min-height: 360px;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 32%, rgba(255,201,163,.92) 0%, rgba(255,244,236,.68) 36%, rgba(255,255,255,0) 72%),
    linear-gradient(180deg, rgba(255,255,255,.50) 0%, rgba(255,255,255,.16) 100%);
}
.character-modal__hero::before,
.character-modal__hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.character-modal__hero::before {
  background:
    radial-gradient(circle at 20% 18%, rgba(255,255,255,.95) 0 1px, transparent 2px),
    radial-gradient(circle at 76% 22%, rgba(255,244,218,.95) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 76%, rgba(255,255,255,.88) 0 1.2px, transparent 2px),
    radial-gradient(circle at 26% 80%, rgba(255,238,195,.9) 0 1px, transparent 2px);
  opacity: .64;
  animation: mmhTwinkle 7s ease-in-out infinite;
}
.character-modal__hero::after {
  inset: auto 18px 14px 18px;
  height: 18px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(14,49,75,.22) 0%, rgba(14,49,75,0) 72%);
  filter: blur(7px);
}
.character-modal__hero canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 340px;
  margin: 6px auto 0;
  filter: drop-shadow(0 18px 18px rgba(15,43,64,.18));
}
.character-modal__hero--locked {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(225,231,236,.96), rgba(213,220,227,.88));
}
.character-modal__lock-icon {
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: rgba(255,255,255,.74);
  color: var(--navy-900);
  font-size: 46px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 18px 34px rgba(15,43,64,.12);
}
.character-modal__kicker {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--wine);
  background: rgba(255,232,220,.9);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .1em;
}
.character-modal h3 {
  margin: 0;
  color: var(--navy-900);
  font-size: clamp(28px, 4.2vw, 42px);
  line-height: 1;
  font-weight: 1000;
}
.character-modal__lead {
  margin: 8px 0 14px;
  color: var(--wine);
  font-size: 16px;
  line-height: 1.45;
  font-weight: 900;
}
.character-modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.character-modal__tags span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--navy-900);
  background: rgba(210,232,246,.72);
  font-size: 12px;
  font-weight: 900;
}
.character-modal__desc,
.character-modal__story {
  margin: 0 0 10px;
  color: #405161;
  font-size: 14px;
  line-height: 1.65;
}
.character-modal__quote {
  margin: 14px 0 0;
  padding: 14px 16px;
  border-left: 4px solid rgba(218,116,79,.38);
  border-radius: 16px;
  background: rgba(255,248,242,.86);
  color: var(--navy-900);
  font-size: 14px;
  font-style: italic;
  font-weight: 850;
}
.modal-card--locked-profile .modal-actions .game-button,
.modal-card--character .modal-actions .game-button {
  max-width: 180px;
}

@keyframes mmhTwinkle {
  0%, 100% { opacity: .34; transform: scale(1); }
  50% { opacity: .62; transform: scale(1.01); }
}
@keyframes mmhPulse {
  0%, 100% { transform: scale(1); opacity: .72; }
  50% { transform: scale(1.12); opacity: 1; }
}

@media (max-width: 980px) {
  .collection-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .character-modal {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .modal-card--character {
    width: min(94vw, 560px);
    padding: 18px;
  }
  .character-modal__hero {
    min-height: 290px;
  }
  .character-modal__hero canvas {
    max-width: 270px;
  }
}
@media (max-width: 480px) {
  .collection-grid { gap: 12px; }
  .collection-card { min-height: 290px; padding: 11px; }
  .collection-card__name { font-size: 16px; }
  .collection-card__title { font-size: 11px; }
  .collection-note { font-size: 12px; }
}


/* ===== Version 1.13 – Story Popup + Play Tuning ===== */
.hud-card--mission strong {
  color: var(--wine);
}
.modal-card--story-intro {
  width: min(92vw, 860px);
  max-height: min(88vh, 820px);
  padding: 24px 24px 20px;
}
.modal-card--story-intro h2 {
  margin-bottom: 12px;
  text-align: center;
}
.story-intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  text-align: left;
}
.story-intro__sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.story-intro__sparkles span {
  position: absolute;
  color: rgba(255,188,110,.88);
  text-shadow: 0 0 12px rgba(255,188,110,.48);
  animation: mmhPulse 3.4s ease-in-out infinite;
}
.story-intro__sparkles span:nth-child(1) { top: 8%; left: 8%; font-size: 18px; }
.story-intro__sparkles span:nth-child(2) { top: 18%; right: 14%; font-size: 14px; animation-delay: .7s; }
.story-intro__sparkles span:nth-child(3) { bottom: 12%; left: 28%; font-size: 12px; animation-delay: 1.2s; }
.story-intro__hero {
  position: relative;
  min-height: 360px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 32%, rgba(255,209,172,.96) 0%, rgba(255,246,238,.76) 34%, rgba(255,255,255,0) 72%),
    linear-gradient(180deg, rgba(255,255,255,.46), rgba(255,255,255,.14));
  overflow: hidden;
}
.story-intro__hero::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.65);
}
.story-intro__hero::after {
  content: "";
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: 18px;
  height: 18px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(14,49,75,.22) 0%, rgba(14,49,75,0) 72%);
  filter: blur(8px);
}
.story-intro__hero canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: min(100%, 360px);
  filter: drop-shadow(0 18px 18px rgba(15,43,64,.16));
}
.story-intro__eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--wine);
  background: rgba(255,232,220,.92);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .1em;
}
.story-intro h3 {
  margin: 0;
  color: var(--navy-900);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.04;
  font-weight: 1000;
}
.story-intro__lead {
  margin: 12px 0 10px;
  color: var(--wine);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 850;
}
.story-intro__text {
  margin: 0;
  color: #405161;
  font-size: 14px;
  line-height: 1.68;
}
.story-intro__guide {
  display: grid;
  gap: 2px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(210,232,246,.55);
  color: var(--navy-900);
}
.story-intro__guide span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .09em;
  color: #5c7386;
}
.story-intro__guide strong {
  font-size: 20px;
  line-height: 1.1;
}
.story-intro__guide em {
  font-size: 13px;
  font-style: normal;
  color: #63798c;
  font-weight: 700;
}
.story-intro__quote {
  margin: 14px 0 0;
  padding: 14px 16px;
  border-left: 4px solid rgba(218,116,79,.38);
  border-radius: 16px;
  background: rgba(255,248,242,.86);
  color: var(--navy-900);
  font-size: 14px;
  font-style: italic;
  font-weight: 850;
}
@media (max-width: 760px) {
  .modal-card--story-intro {
    width: min(94vw, 560px);
    padding: 18px;
  }
  .story-intro {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .story-intro__hero {
    min-height: 290px;
  }
  .story-intro__hero canvas {
    width: min(100%, 280px);
  }
}


/* ===== Version 1.14 – Visual Novel Guide + Hard Mode ===== */
.story-guide {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  overflow: hidden;
  isolation: isolate;
}
.story-guide--open {
  display: block;
}
.story-guide__backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 24, 40, .22), rgba(8, 24, 40, .48)),
    radial-gradient(circle at 50% 32%, rgba(255,255,255,.08), transparent 44%),
    linear-gradient(135deg, #7dc8f0 0%, #9fd8f3 42%, #f6c59f 100%);
  backdrop-filter: blur(8px);
}
.story-guide__backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7,22,36,.30), transparent 26%, transparent 74%, rgba(7,22,36,.30)),
    linear-gradient(180deg, transparent 55%, rgba(7,22,36,.36));
}
.story-guide__stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.story-guide__stars span {
  position: absolute;
  color: rgba(255, 244, 211, .92);
  text-shadow: 0 0 14px rgba(255, 222, 153, .72);
  animation: storyStarTwinkle 3.4s ease-in-out infinite;
}
.story-guide__stars span:nth-child(1) { left: 12%; top: 14%; font-size: 18px; }
.story-guide__stars span:nth-child(2) { left: 42%; top: 9%; font-size: 12px; animation-delay: .7s; }
.story-guide__stars span:nth-child(3) { right: 14%; top: 23%; font-size: 16px; animation-delay: 1.1s; }
.story-guide__stars span:nth-child(4) { left: 24%; bottom: 18%; font-size: 11px; animation-delay: 1.6s; }
.story-guide__stars span:nth-child(5) { right: 28%; bottom: 12%; font-size: 14px; animation-delay: 2s; }
.story-guide__skip {
  position: absolute;
  z-index: 8;
  top: max(24px, env(safe-area-inset-top));
  right: max(28px, env(safe-area-inset-right));
  min-width: 92px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid rgba(255,255,255,.46);
  border-radius: 999px;
  color: #fff5de;
  background: rgba(13, 43, 67, .68);
  box-shadow: 0 12px 26px rgba(8, 28, 45, .22);
  backdrop-filter: blur(14px);
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: .08em;
  cursor: pointer;
}
.story-guide__character-stage {
  position: absolute;
  z-index: 3;
  top: 5%;
  bottom: 8%;
  width: min(46vw, 640px);
  transition: left .55s cubic-bezier(.22,1,.36,1), right .55s cubic-bezier(.22,1,.36,1), transform .55s cubic-bezier(.22,1,.36,1), opacity .28s ease;
}
.story-guide--left .story-guide__character-stage {
  left: 4%;
  right: auto;
}
.story-guide--right .story-guide__character-stage {
  left: auto;
  right: 4%;
}
.story-guide__character-stage canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 28px 30px rgba(8, 28, 45, .28));
}
.story-guide__character-stage--enter {
  animation: storyCharacterEnter .56s cubic-bezier(.22,1,.36,1) both;
}
.story-guide__dialogue {
  position: absolute;
  z-index: 5;
  top: 50%;
  width: min(48vw, 660px);
  min-height: 245px;
  padding: 26px 28px 22px;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(247,251,255,.88));
  box-shadow: 0 24px 54px rgba(8, 28, 45, .25), inset 0 1px 0 rgba(255,255,255,.92);
  backdrop-filter: blur(18px);
  transform: translateY(-50%);
  transition: left .55s cubic-bezier(.22,1,.36,1), right .55s cubic-bezier(.22,1,.36,1);
}
.story-guide--left .story-guide__dialogue {
  right: 5%;
  left: auto;
}
.story-guide--right .story-guide__dialogue {
  left: 5%;
  right: auto;
}
.story-guide__dialogue--enter {
  animation: storyDialogueEnter .5s cubic-bezier(.22,1,.36,1) both;
}
.story-guide__name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.story-guide__name-row strong {
  color: var(--navy-900);
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1;
  font-weight: 1000;
}
.story-guide__name-row span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--wine);
  background: rgba(255, 232, 220, .94);
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: .08em;
}
.story-guide__text {
  min-height: 96px;
  margin: 0;
  color: #354b5e;
  font-size: clamp(17px, 2vw, 24px);
  line-height: 1.62;
  font-weight: 760;
}
.story-guide__text::after {
  content: "▌";
  margin-left: 3px;
  color: var(--wine);
  animation: storyCursorBlink .75s steps(1) infinite;
}
.story-guide__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
}
.story-guide__progress {
  display: flex;
  gap: 8px;
}
.story-guide__dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(16, 40, 62, .18);
  transition: width .2s ease, background .2s ease;
}
.story-guide__dot.is-done {
  background: rgba(36, 153, 111, .55);
}
.story-guide__dot.is-active {
  width: 30px;
  background: linear-gradient(90deg, #ffd878, #ff9a68);
}
.story-guide__next {
  min-width: 118px;
  min-height: 48px;
  padding: 0 20px;
  border: 2px solid rgba(255,255,255,.86);
  border-radius: 16px;
  color: #4a2a28;
  background: linear-gradient(180deg, #ffd878, #ff9a68);
  box-shadow: 0 7px 0 rgba(74,38,31,.30), 0 14px 24px rgba(8,28,45,.18);
  font-size: 14px;
  font-weight: 1000;
  cursor: pointer;
}
.story-guide-active {
  overflow: hidden;
}

.hud-card--mission strong {
  font-size: clamp(15px, 1.35vw, 21px);
  line-height: 1.18;
  text-align: center;
}

@keyframes storyCharacterEnter {
  from { opacity: 0; transform: translateY(24px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes storyDialogueEnter {
  from { opacity: 0; transform: translateY(calc(-50% + 18px)) scale(.97); }
  to { opacity: 1; transform: translateY(-50%) scale(1); }
}
@keyframes storyStarTwinkle {
  0%,100% { opacity: .35; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1.15); }
}
@keyframes storyCursorBlink {
  0%,48% { opacity: 1; }
  49%,100% { opacity: 0; }
}

@media (max-width: 900px) {
  .story-guide__character-stage {
    top: 2%;
    bottom: 42%;
    width: 74vw;
  }
  .story-guide--left .story-guide__character-stage,
  .story-guide--right .story-guide__character-stage {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
  .story-guide__dialogue,
  .story-guide--left .story-guide__dialogue,
  .story-guide--right .story-guide__dialogue {
    left: 4%;
    right: 4%;
    top: auto;
    bottom: max(22px, env(safe-area-inset-bottom));
    width: auto;
    min-height: 230px;
    transform: none;
  }
  .story-guide__dialogue--enter {
    animation-name: storyDialogueEnterMobile;
  }
  .story-guide__text {
    min-height: 84px;
    font-size: clamp(16px, 4vw, 20px);
  }
  @keyframes storyDialogueEnterMobile {
    from { opacity: 0; transform: translateY(20px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}

@media (max-width: 560px) {
  .story-guide__skip {
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    min-width: 74px;
    min-height: 40px;
    padding: 0 14px;
  }
  .story-guide__character-stage {
    width: 92vw;
    bottom: 46%;
  }
  .story-guide__dialogue,
  .story-guide--left .story-guide__dialogue,
  .story-guide--right .story-guide__dialogue {
    left: 10px;
    right: 10px;
    padding: 20px 18px 16px;
    border-radius: 24px;
  }
  .story-guide__name-row {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 12px;
  }
  .story-guide__text {
    min-height: 96px;
    font-size: 16px;
  }
  .story-guide__next {
    min-width: 100px;
    min-height: 44px;
  }
}


/* ===== Version 1.15 – Win/Lose Character Outcomes ===== */
.outcome-celebration {
  position: fixed;
  inset: 0;
  z-index: 360;
  display: none;
  overflow: hidden;
  isolation: isolate;
}
.outcome-celebration--open { display: block; }
.outcome-celebration__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.30), transparent 34%),
    radial-gradient(circle at 50% 86%, rgba(255,216,120,.26), transparent 30%),
    linear-gradient(135deg, #75c5ee 0%, #a7def5 44%, #ffc49f 100%);
}
.outcome-celebration__backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8,24,40,.06), rgba(8,24,40,.25)),
    radial-gradient(circle at 50% 45%, transparent 0 38%, rgba(8,24,40,.12) 100%);
}
.outcome-celebration__confetti {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.outcome-celebration__glow {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 55%;
  width: min(74vw, 980px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.62) 0%, rgba(255,239,196,.28) 35%, transparent 70%);
  filter: blur(6px);
  animation: outcomeGlowPulse 2.8s ease-in-out infinite;
}
.outcome-celebration__content {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(28px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  text-align: center;
}
.outcome-celebration__eyebrow {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 0 16px;
  border: 1px solid rgba(255,255,255,.64);
  border-radius: 999px;
  color: #4a2a28;
  background: linear-gradient(180deg, rgba(255,245,222,.96), rgba(255,208,159,.94));
  box-shadow: 0 12px 28px rgba(8,28,45,.18);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: .12em;
  animation: outcomeTitleEnter .8s cubic-bezier(.22,1,.36,1) both;
}
.outcome-celebration h2 {
  margin: 12px 0 4px;
  color: #fff5de;
  font-size: clamp(42px, 6vw, 82px);
  line-height: .95;
  letter-spacing: -.04em;
  text-shadow: 0 5px 0 rgba(126,65,47,.34), 0 18px 36px rgba(8,28,45,.24);
  animation: outcomeTitleEnter .9s .08s cubic-bezier(.22,1,.36,1) both;
}
.outcome-celebration p {
  margin: 5px 0 0;
  color: #173a58;
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 850;
  animation: outcomeTitleEnter .9s .16s cubic-bezier(.22,1,.36,1) both;
}
.outcome-celebration__character {
  flex: 1;
  min-height: 0;
  width: min(88vw, 900px);
  display: grid;
  place-items: center;
  margin-top: 2px;
}
.outcome-celebration__character canvas {
  display: block;
  width: min(100%, 760px);
  max-height: 66vh;
  object-fit: contain;
  filter: drop-shadow(0 28px 34px rgba(8,28,45,.28));
  animation: outcomeCharacterRise 1.05s .14s cubic-bezier(.22,1,.36,1) both;
}
.outcome-celebration__timer {
  width: min(78vw, 560px);
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 999px;
  background: rgba(13,43,67,.20);
  box-shadow: 0 8px 20px rgba(8,28,45,.12);
}
.outcome-celebration__timer span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffd878, #ff9a68);
  transform-origin: left center;
  animation: outcomeTenSeconds 10s linear forwards;
}
.outcome-celebration-active { overflow: hidden; }

.story-guide--win .story-guide__backdrop {
  background:
    linear-gradient(180deg, rgba(8,24,40,.18), rgba(8,24,40,.42)),
    radial-gradient(circle at 50% 28%, rgba(255,255,255,.12), transparent 42%),
    linear-gradient(135deg, #73c9ef 0%, #a9def4 48%, #f8c49d 100%);
}
.story-guide--lose .story-guide__backdrop {
  background:
    linear-gradient(180deg, rgba(8,24,40,.22), rgba(8,24,40,.56)),
    radial-gradient(circle at 50% 28%, rgba(255,255,255,.06), transparent 42%),
    linear-gradient(135deg, #426e8d 0%, #6f96ad 46%, #b89a91 100%);
}
.story-guide--lose .story-guide__stars span {
  color: rgba(226,239,246,.78);
  text-shadow: 0 0 12px rgba(185,219,237,.45);
}
.story-guide--lose .story-guide__name-row span {
  color: #36596f;
  background: rgba(218,236,246,.90);
}
.story-guide--lose .story-guide__dot.is-active {
  background: linear-gradient(90deg, #9ccfe7, #b6a49e);
}
.story-guide--lose .story-guide__next {
  color: #fff5de;
  background: linear-gradient(180deg, #356586, #173a58);
  box-shadow: 0 7px 0 rgba(8,28,45,.34), 0 14px 24px rgba(8,28,45,.18);
}

@keyframes outcomeGlowPulse {
  0%,100% { opacity: .72; transform: translate(-50%, -50%) scale(.96); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
}
@keyframes outcomeTitleEnter {
  from { opacity: 0; transform: translateY(-18px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes outcomeCharacterRise {
  from { opacity: 0; transform: translateY(44px) scale(.90); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes outcomeTenSeconds {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@media (max-width: 760px) {
  .outcome-celebration h2 { font-size: clamp(36px, 10vw, 58px); }
  .outcome-celebration p { font-size: 15px; }
  .outcome-celebration__character canvas { width: min(100%, 560px); max-height: 62vh; }
}


/* ===== Version 1.16 – Character Card Gallery ===== */
.collection-screen {
  background:
    radial-gradient(circle at top, rgba(255,210,155,.12), transparent 28%),
    linear-gradient(180deg, #0f263c 0%, #132c44 45%, #11253a 100%);
}
.collection-header h1 {
  letter-spacing: .08em;
}
.collection-gallery__heading {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 36px));
  margin: 0 auto 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
.collection-gallery__eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  color: rgba(255,227,187,.92);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
}
.collection-gallery__heading h2 {
  margin: 0;
  color: #fff2df;
  font-size: clamp(26px, 4.2vw, 42px);
  line-height: 1.04;
  font-weight: 1000;
}
.collection-gallery__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.collection-gallery__meta span {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(8,18,30,.46);
  color: rgba(255,244,227,.92);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
}
.collection-note {
  width: auto;
  margin: 0;
  color: rgba(220,235,248,.82);
  font-size: 14px;
  font-weight: 700;
  text-shadow: none;
}
.collection-grid {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 36px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}
.collection-card {
  position: relative;
  min-height: 400px;
  padding: 14px 14px 16px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, rgba(12,20,30,.98) 0%, rgba(18,31,45,.98) 100%);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 22px 36px rgba(0,0,0,.22);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.collection-card:hover,
.collection-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 28px 42px rgba(0,0,0,.30);
  border-color: rgba(255,234,204,.34);
  outline: none;
}
.collection-card__surface {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255,255,255,.14), transparent 18%),
    radial-gradient(circle at 50% 30%, rgba(255,255,255,.08), transparent 52%);
}
.collection-card__serial,
.collection-card__status,
.collection-card__code,
.collection-card__footer,
.collection-card__art {
  position: relative;
  z-index: 1;
}
.collection-card__serial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,245,232,.95);
  color: #0e2438;
  font-size: 14px;
  font-weight: 1000;
}
.collection-card__status {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(6,14,22,.52);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,244,227,.96);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .08em;
}
.collection-card__code {
  margin-top: 8px;
  color: rgba(255,240,219,.62);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
}
.collection-card__art {
  position: relative;
  height: 238px;
  margin: 8px 0 14px;
  border-radius: 22px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 28%, rgba(255,255,255,.12), transparent 58%);
}
.collection-card__art::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 14px;
  height: 16px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(5,10,20,.34) 0%, rgba(5,10,20,0) 74%);
  filter: blur(6px);
}
.collection-card canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.collection-card__footer {
  display: grid;
  gap: 6px;
}
.collection-card__name {
  color: #fff6ea;
  font-size: 30px;
  line-height: .96;
  font-weight: 1000;
  text-transform: uppercase;
}
.collection-card__title {
  color: #ffd3c0;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 900;
}
.collection-card__meta {
  color: rgba(229,239,247,.74);
  font-size: 12px;
  line-height: 1.55;
  font-weight: 700;
}
.collection-card--locked {
  filter: saturate(.76);
}
.collection-card--locked canvas {
  filter: grayscale(1) contrast(.6) opacity(.4);
}
.collection-card--locked .collection-card__name,
.collection-card--locked .collection-card__title,
.collection-card--locked .collection-card__meta {
  color: rgba(231,239,245,.74);
}
.collection-card--gold { background: linear-gradient(180deg, #3e2b17 0%, #17181d 100%); }
.collection-card--blue { background: linear-gradient(180deg, #173455 0%, #131920 100%); }
.collection-card--sage { background: linear-gradient(180deg, #264536 0%, #15191b 100%); }
.collection-card--copper { background: linear-gradient(180deg, #4b271f 0%, #171518 100%); }
.collection-card--sky { background: linear-gradient(180deg, #21445b 0%, #14171b 100%); }
.collection-card--wine { background: linear-gradient(180deg, #482534 0%, #17131a 100%); }

.collection-showcase {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}
.collection-showcase--open {
  display: block;
}
.collection-showcase__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 12, 20, .78);
  backdrop-filter: blur(16px);
}
.collection-showcase__panel {
  position: absolute;
  inset: 26px;
  border-radius: 34px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  background:
    linear-gradient(135deg, rgba(183,227,255,.10) 0%, rgba(255,255,255,.02) 48%, rgba(255,215,164,.08) 100%),
    linear-gradient(180deg, #d6ebfb 0%, #d8eefc 30%, #d8ebf7 100%);
  box-shadow: 0 30px 90px rgba(0,0,0,.36);
}
.collection-showcase__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,.42) 0%, rgba(255,255,255,.08) 24%, transparent 24%, transparent 76%, rgba(255,255,255,.08) 76%, rgba(255,255,255,.42) 100%),
    linear-gradient(180deg, rgba(255,255,255,.26) 0%, rgba(255,255,255,0) 24%);
  pointer-events: none;
}
.collection-showcase__layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(240px, 290px) minmax(360px, 1fr) minmax(260px, 320px);
  gap: 20px;
  height: 100%;
  padding: 34px 38px 28px;
}
.collection-showcase__side {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.collection-showcase__side--left {
  justify-content: center;
  gap: 14px;
}
.collection-showcase__side--right {
  justify-content: center;
  gap: 10px;
}
.collection-showcase__serial {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: #12304a;
  font-size: 16px;
  font-weight: 1000;
  letter-spacing: .08em;
}
.collection-showcase__theme {
  color: #5b7589;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
}
.collection-showcase__factlist {
  display: grid;
  gap: 12px;
}
.collection-showcase__fact {
  padding: 14px 16px;
  border-radius: 22px;
  background: rgba(255,255,255,.44);
  border: 1px solid rgba(13, 43, 67, .08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
.collection-showcase__fact small,
.collection-showcase__info-block small {
  display: block;
  margin-bottom: 6px;
  color: #72879a;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .14em;
}
.collection-showcase__fact strong {
  display: block;
  color: #14314a;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 900;
}
.collection-showcase__back {
  margin-top: 6px;
}
.collection-showcase__center {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
}
.collection-showcase__glow {
  position: absolute;
  width: 72%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,205,158,.92) 0%, rgba(255,241,220,.6) 26%, rgba(255,255,255,0) 66%);
  filter: blur(6px);
}
.collection-showcase__card-stack {
  position: absolute;
  inset: auto auto 8% 50%;
  transform: translateX(-50%);
  width: min(72%, 340px);
  height: 68%;
}
.collection-showcase__card-stack span {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.22);
}
.collection-showcase__card-stack span:first-child { transform: rotate(-6deg) translate(-18px, 8px); }
.collection-showcase__card-stack span:last-child { transform: rotate(5deg) translate(18px, 6px); }
.collection-showcase__center canvas {
  position: relative;
  z-index: 2;
  width: min(100%, 520px);
  max-height: 88%;
  filter: drop-shadow(0 22px 24px rgba(19,49,73,.20));
}
.collection-showcase__kicker {
  display: inline-flex;
  width: fit-content;
  min-height: 38px;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255,244,231,.82);
  color: #b15b3c;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .14em;
}
.collection-showcase__side--right h3 {
  margin: 0;
  color: #17314a;
  font-size: clamp(40px, 4.2vw, 68px);
  line-height: .94;
  font-weight: 1000;
}
.collection-showcase__title {
  margin: 0;
  color: #bc6546;
  font-size: 18px;
  line-height: 1.42;
  font-weight: 900;
}
.collection-showcase__intro {
  margin: 2px 0 0;
  color: #375167;
  font-size: 15px;
  line-height: 1.75;
  font-weight: 700;
}
.collection-showcase__info-block {
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255,255,255,.48);
  border: 1px solid rgba(13, 43, 67, .08);
}
.collection-showcase__info-block p,
.collection-showcase__info-block blockquote {
  margin: 0;
  color: #29455c;
  font-size: 14px;
  line-height: 1.72;
  font-weight: 700;
}
.collection-showcase__info-block blockquote {
  font-style: italic;
}
.collection-showcase__close,
.collection-showcase__nav {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(8,18,30,.76);
  color: #fff2df;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}
.collection-showcase__close { top: 18px; right: 18px; font-size: 24px; }
.collection-showcase__nav { top: 50%; transform: translateY(-50%); font-size: 38px; }
.collection-showcase__nav--prev { left: 16px; }
.collection-showcase__nav--next { right: 16px; }
.collection-showcase__panel[data-locked="true"] .collection-showcase__center canvas {
  filter: grayscale(1) opacity(.45) drop-shadow(0 18px 22px rgba(19,49,73,.12));
}

@media (max-width: 1260px) {
  .collection-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .collection-showcase__layout { grid-template-columns: 240px 1fr 280px; padding: 30px 28px 24px; }
}
@media (max-width: 980px) {
  .collection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .collection-showcase__panel { inset: 18px; }
  .collection-showcase__layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    overflow-y: auto;
    padding: 24px 22px 28px;
  }
  .collection-showcase__side--left { order: 2; }
  .collection-showcase__center { order: 1; min-height: 420px; }
  .collection-showcase__side--right { order: 3; }
  .collection-showcase__nav { width: 52px; height: 52px; font-size: 32px; }
}
@media (max-width: 700px) {
  .collection-gallery__heading { flex-direction: column; align-items: flex-start; }
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(1280px, calc(100% - 22px)); }
  .collection-card { min-height: 350px; }
  .collection-card__name { font-size: 22px; }
  .collection-card__art { height: 208px; }
  .collection-showcase__panel { inset: 12px; border-radius: 24px; }
  .collection-showcase__center { min-height: 340px; }
  .collection-showcase__close { top: 12px; right: 12px; }
}


/* ===== Version 1.17 – Character collection performance cleanup ===== */
body.showcase-lock {
  overflow: hidden;
}
.collection-screen {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-bottom: max(34px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 8%, rgba(247, 196, 126, 0.14) 0%, rgba(247, 196, 126, 0) 28%),
    radial-gradient(circle at 50% 22%, rgba(110, 168, 215, 0.16) 0%, rgba(110, 168, 215, 0) 34%),
    linear-gradient(180deg, #173b5a 0%, #13334e 30%, #102b42 64%, #0d2338 100%);
}
.collection-screen .screen-shade {
  display: none;
}
.collection-header {
  position: sticky;
  top: 10px;
  z-index: 5;
  background: rgba(16, 44, 67, 0.9);
  backdrop-filter: none;
}
.collection-gallery__heading {
  margin-bottom: 16px;
}
.collection-gallery__heading h2 {
  max-width: 1040px;
  text-shadow: 0 2px 10px rgba(0,0,0,.16);
}
.collection-note {
  color: rgba(232, 241, 248, 0.92);
}
.collection-grid {
  padding: 0 0 44px;
  align-content: start;
}
.collection-card {
  min-height: 392px;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 12px 24px rgba(3, 11, 20, .2);
  transition: transform .16s ease, border-color .16s ease;
}
.collection-card:hover,
.collection-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 14px 26px rgba(3,11,20,.22);
}
.collection-card__surface {
  background: linear-gradient(180deg, rgba(255,255,255,.09), transparent 18%);
}
.collection-card__art {
  height: 252px;
  margin: 10px 0 12px;
  background: radial-gradient(circle at 50% 26%, rgba(255,255,255,.08), rgba(255,255,255,0) 60%);
}
.collection-card__art::after {
  left: 18%;
  right: 18%;
  bottom: 10px;
  height: 14px;
  filter: blur(4px);
}
.collection-card canvas {
  image-rendering: auto;
}
.collection-card__name {
  font-size: 24px;
  line-height: 1;
}
.collection-card__title {
  font-size: 14px;
}
.collection-card__meta {
  font-size: 13px;
}
.collection-showcase__backdrop {
  background: rgba(8, 14, 24, 0.76);
  backdrop-filter: none;
}
.collection-showcase__panel {
  inset: 22px;
  border-radius: 32px;
  border: 1px solid rgba(255,255,255,.1);
  background:
    radial-gradient(circle at 50% 18%, rgba(255,206,147,.12), rgba(255,206,147,0) 23%),
    linear-gradient(180deg, #112a40 0%, #102638 52%, #0d1e2e 100%);
  box-shadow: 0 24px 60px rgba(0,0,0,.34);
}
.collection-showcase__panel::before {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0) 18%);
}
.collection-showcase__layout {
  grid-template-columns: minmax(220px, 260px) minmax(420px, 1fr) minmax(270px, 320px);
  gap: 16px;
  padding: 28px 30px 24px;
}
.collection-showcase__serial {
  background: rgba(255,244,227,.96);
  color: #12304a;
}
.collection-showcase__theme,
.collection-showcase__fact small,
.collection-showcase__info-block small {
  color: rgba(188, 209, 226, 0.76);
}
.collection-showcase__fact {
  padding: 13px 15px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: none;
}
.collection-showcase__fact strong {
  color: #f3f8fc;
  font-size: 17px;
}
.collection-showcase__center {
  min-height: 0;
}
.collection-showcase__glow {
  width: 70%;
  background: radial-gradient(circle, rgba(255,198,133,.28) 0%, rgba(255,228,197,.12) 22%, rgba(255,255,255,0) 62%);
  filter: blur(10px);
}
.collection-showcase__card-stack {
  display: none;
}
.collection-showcase__center canvas {
  width: min(100%, 640px);
  max-height: min(78vh, 920px);
  filter: drop-shadow(0 18px 24px rgba(3,11,20,.28));
}
.collection-showcase__kicker {
  background: rgba(255, 232, 208, 0.94);
  color: #c06b47;
}
.collection-showcase__side--right h3 {
  color: #f5f8fc;
  font-size: clamp(44px, 5vw, 72px);
}
.collection-showcase__title {
  color: #ffc49f;
}
.collection-showcase__intro,
.collection-showcase__info-block p,
.collection-showcase__info-block blockquote {
  color: rgba(231, 240, 248, 0.92);
}
.collection-showcase__info-block {
  padding: 14px 16px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
}
.collection-showcase__close,
.collection-showcase__nav {
  background: rgba(9, 22, 34, 0.92);
  box-shadow: 0 8px 20px rgba(0,0,0,.2);
}
.collection-showcase__nav {
  width: 54px;
  height: 54px;
  font-size: 34px;
}
.collection-showcase__panel[data-locked="true"] .collection-showcase__center canvas {
  filter: grayscale(1) opacity(.42) drop-shadow(0 14px 20px rgba(3,11,20,.2));
}
@media (max-width: 1260px) {
  .collection-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .collection-showcase__layout {
    grid-template-columns: 220px 1fr 280px;
  }
}
@media (max-width: 980px) {
  .collection-header {
    position: relative;
    top: auto;
  }
  .collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .collection-showcase__panel {
    inset: 14px;
  }
  .collection-showcase__layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
    padding: 20px 18px 24px;
  }
  .collection-showcase__center {
    min-height: 400px;
  }
  .collection-showcase__center canvas {
    width: min(100%, 520px);
    max-height: 60vh;
  }
}
@media (max-width: 700px) {
  .collection-grid {
    width: min(1280px, calc(100% - 22px));
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .collection-card {
    min-height: 330px;
    border-radius: 24px;
    padding: 12px 12px 14px;
  }
  .collection-card__art {
    height: 200px;
  }
  .collection-card__name {
    font-size: 20px;
  }
  .collection-card__title,
  .collection-card__meta {
    font-size: 12px;
  }
  .collection-showcase__side--right h3 {
    font-size: clamp(34px, 10vw, 52px);
  }
}


/* ===== Version 1.18 – Definitive character gallery fix ===== */
.collection-screen {
  min-height: 100dvh;
  height: 100dvh;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  background-color: #102a41 !important;
  background-image:
    radial-gradient(circle at 50% 0%, rgba(255, 201, 132, 0.14) 0%, rgba(255, 201, 132, 0) 28%),
    radial-gradient(circle at 15% 22%, rgba(77, 144, 197, 0.20) 0%, rgba(77, 144, 197, 0) 32%),
    linear-gradient(180deg, #173b5a 0%, #14344f 34%, #102b43 68%, #0d2338 100%) !important;
  background-attachment: scroll !important;
  background-position: center !important;
  background-size: cover !important;
  padding-bottom: max(64px, env(safe-area-inset-bottom)) !important;
}
.collection-screen .screen-shade {
  display: none !important;
}
.collection-header {
  position: relative !important;
  top: auto !important;
  background: rgba(12, 37, 58, 0.94) !important;
  border-color: rgba(255,255,255,.18) !important;
  box-shadow: 0 12px 26px rgba(3,12,22,.20) !important;
  backdrop-filter: none !important;
}
.collection-gallery__heading {
  width: min(1260px, calc(100% - 36px)) !important;
  margin: 4px auto 20px !important;
}
.collection-gallery__heading h2 {
  max-width: 1000px;
  color: #fff4e5 !important;
  font-size: clamp(28px, 4vw, 48px) !important;
  text-shadow: none !important;
}
.collection-gallery__eyebrow {
  color: #f4c991 !important;
}
.collection-note {
  color: rgba(235,244,250,.88) !important;
}
.collection-grid {
  width: min(1260px, calc(100% - 36px)) !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 18px !important;
  padding: 0 0 72px !important;
  margin: 0 auto !important;
}
.collection-card {
  min-height: 430px !important;
  border-radius: 26px !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  box-shadow: 0 10px 22px rgba(2,9,17,.18) !important;
  transition: transform .14s ease, border-color .14s ease !important;
  will-change: auto !important;
}
.collection-card:hover,
.collection-card:focus-visible {
  transform: translateY(-2px) !important;
  border-color: rgba(255,226,190,.34) !important;
  box-shadow: 0 12px 24px rgba(2,9,17,.20) !important;
}
.collection-card__surface {
  background: linear-gradient(180deg, rgba(255,255,255,.07), transparent 16%) !important;
}
.collection-card__art {
  height: 286px !important;
  margin: 10px 0 12px !important;
  background: radial-gradient(circle at 50% 34%, rgba(255,255,255,.07), rgba(255,255,255,0) 62%) !important;
}
.collection-card__art::after {
  filter: blur(3px) !important;
  opacity: .72;
}
.collection-card__name {
  font-size: 26px !important;
}
.collection-card__title {
  font-size: 14px !important;
}
.collection-card__meta {
  font-size: 13px !important;
}

.collection-showcase__backdrop {
  background: rgba(4, 10, 18, 0.84) !important;
  backdrop-filter: none !important;
}
.collection-showcase__panel {
  inset: 20px !important;
  border-radius: 30px !important;
  overflow: hidden !important;
  background-color: #0e2538 !important;
  background-image:
    radial-gradient(circle at 50% 18%, rgba(255, 198, 127, 0.15) 0%, rgba(255, 198, 127, 0) 26%),
    radial-gradient(circle at 50% 55%, rgba(63, 123, 171, 0.12) 0%, rgba(63, 123, 171, 0) 36%),
    linear-gradient(180deg, #122f48 0%, #10283d 48%, #0d2133 100%) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  box-shadow: 0 22px 56px rgba(0,0,0,.34) !important;
}
.collection-showcase__panel::before {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0) 16%) !important;
}
.collection-showcase__layout {
  grid-template-columns: minmax(215px, 255px) minmax(460px, 1fr) minmax(270px, 330px) !important;
  gap: 18px !important;
  padding: 28px 30px 24px !important;
}
.collection-showcase__fact,
.collection-showcase__info-block {
  background: rgba(255,255,255,.045) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  box-shadow: none !important;
}
.collection-showcase__fact strong,
.collection-showcase__side--right h3 {
  color: #f5f8fb !important;
}
.collection-showcase__theme,
.collection-showcase__fact small,
.collection-showcase__info-block small {
  color: rgba(188,211,227,.78) !important;
}
.collection-showcase__title {
  color: #ffc49f !important;
}
.collection-showcase__intro,
.collection-showcase__info-block p,
.collection-showcase__info-block blockquote {
  color: rgba(233,241,247,.92) !important;
}
.collection-showcase__center {
  min-height: 0 !important;
}
.collection-showcase__glow {
  width: 76% !important;
  background: radial-gradient(circle, rgba(255,193,118,.24) 0%, rgba(255,226,190,.10) 24%, rgba(255,255,255,0) 66%) !important;
  filter: blur(8px) !important;
}
.collection-showcase__card-stack {
  display: none !important;
}
.collection-showcase__center canvas {
  width: min(100%, 760px) !important;
  max-height: 84vh !important;
  filter: drop-shadow(0 18px 24px rgba(0,0,0,.26)) !important;
}
.collection-showcase__close,
.collection-showcase__nav {
  background: rgba(7,18,29,.94) !important;
  box-shadow: 0 8px 18px rgba(0,0,0,.20) !important;
}
.collection-showcase__panel[data-locked="true"] .collection-showcase__center canvas {
  filter: grayscale(1) opacity(.42) drop-shadow(0 14px 18px rgba(0,0,0,.18)) !important;
}

@media (max-width: 1120px) {
  .collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .collection-showcase__layout {
    grid-template-columns: 220px minmax(360px, 1fr) 270px !important;
    padding: 24px 22px 22px !important;
  }
}
@media (max-width: 860px) {
  .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .collection-showcase__panel {
    inset: 12px !important;
    overflow-y: auto !important;
  }
  .collection-showcase__layout {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto !important;
    overflow: visible !important;
  }
  .collection-showcase__center {
    order: 1 !important;
    min-height: 470px !important;
  }
  .collection-showcase__side--left {
    order: 2 !important;
  }
  .collection-showcase__side--right {
    order: 3 !important;
  }
  .collection-showcase__center canvas {
    width: min(100%, 600px) !important;
    max-height: 62vh !important;
  }
}
@media (max-width: 560px) {
  .collection-grid {
    width: min(100% - 20px, 520px) !important;
    gap: 12px !important;
  }
  .collection-card {
    min-height: 340px !important;
    padding: 11px !important;
  }
  .collection-card__art {
    height: 205px !important;
  }
  .collection-card__name {
    font-size: 20px !important;
  }
  .collection-card__title,
  .collection-card__meta {
    font-size: 11px !important;
  }
}

/* ===== Version 2.0 – Two-theme character archive ===== */
.collection-loading {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 28px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 24px;
  background: rgba(7,18,29,.48);
  color: rgba(255,244,227,.92);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .04em;
  text-align: center;
}
.collection-card[data-theme-id="2"] .collection-card__code {
  color: rgba(202, 239, 183, .82);
}
.collection-card[data-theme-id="2"] .collection-card__serial {
  background: rgba(238, 247, 221, .96);
}
.collection-theme-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 14px 0 0;
  padding: 14px 4px 4px;
  border-bottom: 1px solid rgba(255,255,255,.13);
  color: #fff4e5;
}
.collection-theme-divider > div {
  display: grid;
  gap: 4px;
}
.collection-theme-divider span {
  color: #f4c991;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .16em;
}
.collection-theme-divider strong {
  font-size: clamp(20px, 2.5vw, 30px);
  line-height: 1.08;
  font-weight: 1000;
}
.collection-theme-divider em {
  color: rgba(226,239,247,.72);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .06em;
  white-space: nowrap;
}
@media (max-width: 620px) {
  .collection-theme-divider {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}


/* ===== Version 2.0.1 – Compact theme-filtered character collection ===== */
.collection-screen {
  background: #12314a !important;
}
.collection-header {
  position: relative !important;
  width: min(1320px, calc(100% - 28px)) !important;
  margin: 16px auto 14px !important;
  min-height: 84px !important;
  padding: 14px 18px !important;
  border-radius: 24px !important;
  background: #0f2a40 !important;
  box-shadow: none !important;
}
.collection-header h1 {
  font-size: clamp(32px, 4vw, 50px) !important;
  line-height: .95 !important;
}
.collection-header p {
  margin-top: 5px !important;
  color: rgba(226,239,247,.74) !important;
  font-size: 13px !important;
}
.collection-theme-tabs {
  width: min(1320px, calc(100% - 28px));
  margin: 0 auto 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}
.collection-theme-tab {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 15px;
  background: #173c59;
  color: rgba(241,247,251,.76);
  cursor: pointer;
  box-shadow: none;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.collection-theme-tab:hover,
.collection-theme-tab:focus-visible {
  border-color: rgba(255,218,166,.44);
  outline: none;
}
.collection-theme-tab--active {
  border-color: #f1c486;
  background: #f4e6d2;
  color: #173149;
}
.collection-theme-tab span {
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: .06em;
  white-space: nowrap;
}
.collection-theme-tab strong {
  min-width: 42px;
  text-align: right;
  font-size: 12px;
  font-weight: 1000;
  opacity: .82;
}
.collection-active-theme {
  width: min(1320px, calc(100% - 28px));
  min-height: 68px;
  margin: 0 auto 14px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 4px 12px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.collection-active-theme > div {
  min-width: 0;
}
.collection-active-theme span {
  display: block;
  margin-bottom: 5px;
  color: #f3c98e;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .15em;
}
.collection-active-theme h2 {
  margin: 0;
  color: #fff2df;
  font-size: clamp(22px, 2.5vw, 32px);
  line-height: 1.05;
  font-weight: 1000;
}
.collection-active-theme > strong {
  flex: 0 0 auto;
  color: rgba(225,238,246,.72);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
  white-space: nowrap;
}
.collection-gallery__heading,
.collection-theme-divider,
.collection-card__code,
.collection-card__meta {
  display: none !important;
}
.collection-grid {
  width: min(1320px, calc(100% - 28px)) !important;
  margin: 0 auto !important;
  padding: 0 0 42px !important;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 12px !important;
}
.collection-loading {
  min-height: 120px !important;
  border-radius: 18px !important;
  background: #102c43 !important;
  border-color: rgba(255,255,255,.08) !important;
  box-shadow: none !important;
}
.collection-card {
  min-height: 342px !important;
  padding: 11px 11px 13px !important;
  border-radius: 20px !important;
  box-shadow: none !important;
  contain: layout paint style;
  content-visibility: auto;
  contain-intrinsic-size: 342px 230px;
  transition: border-color .12s ease !important;
}
.collection-card:hover,
.collection-card:focus-visible {
  transform: none !important;
  box-shadow: none !important;
  border-color: rgba(255,224,184,.42) !important;
}
.collection-card__surface {
  background: linear-gradient(180deg, rgba(255,255,255,.055), transparent 18%) !important;
}
.collection-card__topline {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.collection-card__serial,
.collection-card__status {
  position: static !important;
  inset: auto !important;
}
.collection-card__serial {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 54px !important;
  height: 32px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  font-size: 13px !important;
}
.collection-card__status {
  max-width: 62%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 7px 10px !important;
  border-radius: 999px !important;
  font-size: 10px !important;
}
.collection-card__art {
  height: 226px !important;
  margin: 4px 0 8px !important;
  background: transparent !important;
}
.collection-card__art::after {
  display: none !important;
}
.collection-card canvas {
  width: 100% !important;
  height: 100% !important;
}
.collection-card__footer {
  gap: 5px !important;
}
.collection-card__name {
  font-size: 21px !important;
  line-height: 1.02 !important;
}
.collection-card__title {
  display: -webkit-box;
  min-height: 30px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: rgba(233,241,246,.72) !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
}

@media (max-width: 1180px) {
  .collection-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 900px) {
  .collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 680px) {
  .collection-header,
  .collection-theme-tabs,
  .collection-active-theme,
  .collection-grid {
    width: min(100% - 18px, 620px) !important;
  }
  .collection-header {
    margin-top: 9px !important;
    min-height: 72px !important;
    border-radius: 18px !important;
    padding: 10px 12px !important;
  }
  .collection-header h1 {
    font-size: 30px !important;
  }
  .collection-theme-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .collection-theme-tab {
    min-height: 44px;
    padding: 8px 11px;
  }
  .collection-active-theme {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    min-height: auto;
  }
  .collection-active-theme h2 {
    font-size: 21px;
  }
  .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
  }
  .collection-card {
    min-height: 286px !important;
    border-radius: 16px !important;
    padding: 9px !important;
    contain-intrinsic-size: 286px 170px;
  }
  .collection-card__art {
    height: 174px !important;
  }
  .collection-card__serial {
    min-width: 44px !important;
    height: 28px !important;
    font-size: 11px !important;
  }
  .collection-card__status {
    font-size: 9px !important;
    padding: 6px 8px !important;
  }
  .collection-card__name {
    font-size: 17px !important;
  }
  .collection-card__title {
    min-height: 28px;
    font-size: 10px !important;
  }
}


/* ===== CATCH THE MOONLIGHT · SP SUN X1 skin ===== */
:root {
  --navy-950: #160824;
  --navy-900: #241039;
  --navy-800: #3a1b58;
  --cream: #fff4d2;
  --peach: #e6a9ff;
  --honey: #f4c66f;
  --wine: #8b4bb7;
  --ink: #24152e;
  --muted: #786888;
  --danger: #df7c9e;
  --success: #d8b05e;
  --shadow: 0 18px 50px rgba(15, 4, 31, .32);
  background: #160824;
}
.loading-screen { background: radial-gradient(circle at 50% 20%, #54247b 0, #26103e 48%, #12061f 100%); }
.loading-card { border-color: rgba(244,198,111,.5); background: rgba(25,9,42,.82); }
.loading-logo { color: #f4d080; text-shadow: 0 3px 0 #653b8d, 0 8px 22px rgba(0,0,0,.45); }
.loading-track { background: rgba(255,255,255,.14); }
.loading-bar { background: linear-gradient(90deg,#a86ee0,#f4ca78); }
.title-screen { background-color: #1c0a32; background-size: 100% 100%; }
.screen-shade--title { background: linear-gradient(180deg,transparent 0 68%,rgba(20,7,34,.08) 100%); }
.title-actions { width: min(84vw, 430px); gap: 10px; }
.title-actions .game-button { min-height: 52px; border-radius: 16px; font-size: clamp(14px,3.6vw,20px); letter-spacing: .05em; }
.game-button--primary { color: #3a2050; border-color: rgba(255,242,205,.95); background: linear-gradient(180deg,#ffe7a1,#e7b65c); box-shadow: 0 6px 0 rgba(91,54,120,.55),0 12px 24px rgba(0,0,0,.24); }
.game-button--secondary { color: #fff7ff; border-color: rgba(220,185,255,.6); background: linear-gradient(180deg,rgba(89,48,125,.96),rgba(40,18,65,.98)); box-shadow: 0 6px 0 rgba(17,5,29,.5),0 12px 24px rgba(0,0,0,.22); }
.icon-button { color: #fff5da; border: 1px solid rgba(236,202,255,.48); background: rgba(47,20,72,.88); box-shadow: 0 8px 18px rgba(0,0,0,.22); }
.title-actions__row { grid-template-columns: 1fr auto; }
.version-label { color: rgba(255,239,203,.7); text-shadow: 0 2px 8px #170528; }
.theme-screen, .collection-screen { background-color: #1b0b2e; }
.theme-screen .screen-shade, .collection-screen .screen-shade { background: linear-gradient(180deg,rgba(15,5,26,.66),rgba(24,8,39,.84)); }
.page-header { color: #fff4df; }
.page-header h1 { color: #f4d080; }
.page-header p { color: rgba(255,244,255,.76); }
.theme-card { border-color: rgba(237,204,255,.48); background-color: #2b1244; box-shadow: 0 18px 46px rgba(0,0,0,.34); }
.theme-card::before { background: linear-gradient(180deg,rgba(13,5,24,.02) 20%,rgba(19,7,31,.9) 100%); }
.theme-card__eyebrow { background: rgba(245,220,160,.96); color: #38224b; }
.theme-card__title { color: #fff4d7; }
.collection-theme-tabs, .collection-active-theme { display: none !important; }
.collection-screen { background: radial-gradient(circle at 50% 0%,#43205f 0,#1c0c2e 54%,#130720 100%) !important; }
.collection-screen .screen-shade { background: transparent !important; }
.collection-progress, #collectionProgress { color: #f0d4ff; }
.collection-grid { gap: 14px; }
.collection-theme-divider { border-color: rgba(235,204,255,.22); color: #f6e5ff; }
.collection-theme-divider strong { color: #f3cf80; }
.collection-card { border-color: rgba(232,203,255,.27); box-shadow: 0 12px 26px rgba(5,1,14,.28); }
.collection-card__name { color: #fff0cc; }
.collection-card__title, .collection-card__meta { color: rgba(244,228,255,.72); }
.collection-card--gold { background: linear-gradient(180deg,#573b68 0%,#20102e 100%); }
.collection-card--blue { background: linear-gradient(180deg,#35254e 0%,#171023 100%); }
.collection-card--sage { background: linear-gradient(180deg,#3e3151 0%,#191222 100%); }
.collection-card--copper { background: linear-gradient(180deg,#5a354c 0%,#1b1023 100%); }
.collection-card--sky { background: linear-gradient(180deg,#3c2d60 0%,#171023 100%); }
.collection-card--wine { background: linear-gradient(180deg,#552946 0%,#1a0f20 100%); }
.collection-showcase__panel { background: radial-gradient(circle at 50% 22%,#402052,#1a0c2b 70%); border-color: rgba(235,201,255,.28); }
.collection-showcase__side, .collection-showcase__name, .collection-showcase__title, .collection-showcase__intro, .collection-showcase__info-block p, .collection-showcase__quote { color: #f8edff; }
.collection-showcase__serial, .collection-showcase__theme, .collection-showcase__kicker, .collection-showcase__fact small, .collection-showcase__info-block small { color: #e9c77a; }
.game-screen { background-color: #1e0c34; }
.screen-shade--game { background: linear-gradient(180deg,rgba(20,7,34,.28),rgba(19,6,31,.36)); }
.game-topbar { border-color: rgba(240,204,255,.28); background: rgba(28,10,47,.82); box-shadow: 0 12px 26px rgba(0,0,0,.28); }
.game-topbar__title strong { color: #f4cf7d; }
.game-topbar__title span { color: rgba(255,242,255,.78); }
.hud-card { border-color: rgba(238,205,255,.42); background: rgba(35,16,54,.86); color: #fff4e2; box-shadow: 0 14px 32px rgba(0,0,0,.24); }
.hud-label { color: #d4b5e8; }
.hud-card strong { color: #ffe0a0; }
.board-shell { border-color: rgba(245,210,255,.68); background: rgba(22,8,36,.12); box-shadow: 0 20px 48px rgba(4,0,12,.42), inset 0 0 0 1px rgba(255,255,255,.15); }
.drop-hint { color: #fff0cc; background: rgba(39,16,62,.78); border-color: rgba(244,208,128,.4); }
.board-glass { background: linear-gradient(180deg,rgba(33,10,54,.05),rgba(17,5,29,.10)); }
.modal-root { background: rgba(12,4,22,.72); }
.modal-card { border-color: rgba(243,210,255,.42); background: linear-gradient(180deg,#3b2054,#1b0c2c); color: #fff4e3; }
.modal-card h2 { color: #f4cf7d; }
.modal-body { color: rgba(255,245,255,.9); }
.story-guide__backdrop { background: linear-gradient(180deg,rgba(17,5,29,.74),rgba(21,7,35,.88)),radial-gradient(circle at 50% 28%,rgba(178,112,238,.24),transparent 48%),linear-gradient(135deg,#45205f,#180928 72%); }
.story-guide__backdrop::after { background: linear-gradient(90deg,rgba(12,4,22,.28),transparent 26%,transparent 74%,rgba(12,4,22,.28)),linear-gradient(180deg,transparent 55%,rgba(12,4,22,.42)); }
.story-guide__dialogue { border-color: rgba(255,231,183,.64); background: linear-gradient(180deg,rgba(42,21,62,.96),rgba(27,12,43,.96)); box-shadow: 0 24px 54px rgba(0,0,0,.38); }
.story-guide__name-row strong { color: #f4cf7d; }
.story-guide__name-row span { color: #fff0cb; background: rgba(119,74,151,.74); }
.story-guide__text { color: #fff5ff; }
.story-guide__text::after { color: #f4cf7d; }
.story-guide__dot { background: rgba(255,255,255,.22); }
.story-guide__dot.is-done { background: rgba(212,174,105,.58); }
.story-guide__dot.is-active { background: linear-gradient(90deg,#f4cf7d,#c28cf1); }
.story-guide__next { color: #39224e; background: linear-gradient(180deg,#ffe7a1,#e5b35c); box-shadow: 0 7px 0 rgba(73,42,97,.48),0 14px 24px rgba(0,0,0,.28); }
.story-guide__skip { color: #fff5dc; background: rgba(44,18,66,.84); border-color: rgba(245,213,255,.5); }
.outcome-celebration__backdrop { background: radial-gradient(circle at 50% 34%,rgba(246,204,119,.23),transparent 36%),linear-gradient(145deg,#291044 0%,#1a092b 50%,#35104c 100%); }
.outcome-celebration__backdrop::after { background: linear-gradient(180deg,rgba(8,2,17,.04),rgba(8,2,17,.28)); }
.outcome-celebration__eyebrow { color: #482a5e; background: linear-gradient(180deg,#fff0bd,#e9bc63); }
.outcome-celebration h2 { color: #ffedba; text-shadow: 0 4px 0 rgba(75,34,97,.5),0 18px 36px rgba(0,0,0,.34); }
.outcome-celebration p { color: #f8e9ff; }
.story-guide--win .story-guide__backdrop { background: linear-gradient(180deg,rgba(18,6,31,.65),rgba(19,6,34,.86)),radial-gradient(circle at 50% 28%,rgba(255,218,142,.22),transparent 44%),linear-gradient(135deg,#43205e,#19092b 100%); }
.story-guide--lose .story-guide__backdrop { background: linear-gradient(180deg,rgba(19,7,33,.72),rgba(19,7,33,.9)),radial-gradient(circle at 50% 28%,rgba(171,132,199,.14),transparent 42%),linear-gradient(135deg,#34204a,#160a23); }
.story-guide--lose .story-guide__name-row span { color: #f3e3ff; background: rgba(104,71,125,.72); }
.story-guide--lose .story-guide__dot.is-active { background: linear-gradient(90deg,#bda0d5,#e3bf79); }
.story-guide--lose .story-guide__next { color: #39224e; background: linear-gradient(180deg,#e3d3f5,#c5a4e0); }
.collection-loading { color: #f0dcff; }
@media (orientation: landscape) {
  .title-actions { left: auto; right: clamp(24px,5vw,88px); bottom: clamp(22px,5vh,64px); width: min(31vw,390px); }
}
@media (orientation: portrait) {
  .title-actions { bottom: max(4.2%,env(safe-area-inset-bottom)); width: min(84vw,420px); }
  .title-actions .game-button { min-height: 48px; }
  .title-actions__row .icon-button { min-height: 42px; }
  .collection-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .title-actions { gap: 8px; }
  .title-actions .game-button { min-height: 46px; padding: 10px 16px; }
  .title-actions__row { gap: 8px; }
  .title-actions__row .icon-button { padding: 8px 10px; min-height: 42px; font-size: 11px; }
}



/* ===== Version 1.0.1 base – Desktop title actions + compact help modal ===== */
@media (orientation: landscape) and (min-width: 900px) {
  .title-actions {
    left: 50%;
    right: auto;
    bottom: clamp(18px, 3.2vh, 34px);
    width: min(94vw, 1120px);
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: minmax(190px, 1.15fr) minmax(175px, 1fr) minmax(220px, 1.15fr) 48px;
    align-items: center;
    gap: 12px;
  }

  .title-actions__row { display: contents; }

  .title-actions .game-button,
  .title-actions .icon-button {
    min-width: 0;
    min-height: 48px;
    height: 48px;
    padding: 9px 13px;
    border-radius: 13px;
    font-size: clamp(12px, 1vw, 15px);
    letter-spacing: .025em;
    line-height: 1.15;
    box-shadow: 0 4px 0 rgba(17,5,29,.42), 0 8px 16px rgba(0,0,0,.18);
  }

  .title-actions .icon-button--wide { font-size: clamp(11px, .9vw, 13px); }
  .title-actions #titleSoundButton { width: 48px; padding: 0; font-size: 19px; }
  .version-label { bottom: 8px; }
}

@media (orientation: landscape) and (min-width: 900px) and (max-height: 680px) {
  .title-actions { bottom: 14px; gap: 8px; }
  .title-actions .game-button,
  .title-actions .icon-button { min-height: 42px; height: 42px; padding-top: 7px; padding-bottom: 7px; }
  .title-actions #titleSoundButton { width: 42px; }
}

.modal-card--help {
  width: min(94vw, 1080px);
  max-height: min(92dvh, 860px);
  overflow: hidden;
  padding: clamp(16px, 2vw, 26px) clamp(18px, 2.6vw, 34px);
  border-width: 1px;
  border-radius: 24px;
}

.modal-card--help h2 {
  margin: 0 0 14px;
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.12;
  letter-spacing: .015em;
}

.modal-card--help .modal-body { line-height: 1.4; }
.help-content { display: grid; gap: 12px; text-align: left; }
.help-welcome {
  margin: 0 !important;
  color: rgba(255,245,255,.92);
  font-size: clamp(13px, 1.25vw, 16px);
  line-height: 1.42;
  text-align: center;
}
.help-welcome strong { color: #d8a4ff !important; }
.help-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
  counter-reset: help-step;
}
.help-steps li {
  position: relative;
  min-height: 52px;
  margin: 0;
  padding: 9px 12px 9px 40px;
  border: 1px solid rgba(224,193,255,.15);
  border-radius: 13px;
  background: rgba(255,255,255,.055);
  color: rgba(255,245,255,.9);
  font-size: clamp(12px, 1.12vw, 14px);
  line-height: 1.38;
  counter-increment: help-step;
}
.help-steps li::before {
  content: counter(help-step);
  position: absolute;
  left: 11px;
  top: 9px;
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  color: #39224e;
  background: linear-gradient(180deg,#ffe7a1,#e5b35c);
  font-size: 11px;
  font-weight: 950;
}
.help-steps li strong { color: #f1cf83 !important; }
.help-steps li:nth-child(5) { grid-column: 1 / -1; }
.help-mission {
  display: grid;
  gap: 4px;
  padding: 11px 16px;
  border: 1px solid rgba(241,207,131,.35);
  border-radius: 14px;
  background: linear-gradient(90deg,rgba(241,207,131,.12),rgba(181,126,224,.1));
  text-align: center;
}
.help-mission span {
  color: #e9c77a;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .12em;
}
.help-mission strong {
  color: #fff3d1 !important;
  font-size: clamp(13px, 1.2vw, 16px);
  line-height: 1.35;
}
.help-controls {
  margin: 0 !important;
  color: rgba(255,245,255,.78);
  font-size: clamp(11px, 1vw, 13px);
  line-height: 1.4;
  text-align: center;
}
.help-controls strong { color: #d8a4ff !important; }
.modal-card--help .modal-actions {
  gap: 9px;
  margin-top: 14px;
}
.modal-card--help .modal-actions .game-button {
  flex: 0 1 auto;
  min-width: 132px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 11px;
  font-size: 12px;
  letter-spacing: .035em;
  box-shadow: 0 3px 0 rgba(17,5,29,.38), 0 7px 14px rgba(0,0,0,.16);
}

@media (max-width: 700px) {
  .modal-card--help {
    width: min(94vw, 560px);
    max-height: 94dvh;
    padding: 15px 14px;
    border-radius: 18px;
  }
  .modal-card--help h2 { font-size: clamp(19px, 5vw, 25px); margin-bottom: 10px; }
  .help-content { gap: 9px; }
  .help-welcome { font-size: 12px; line-height: 1.36; }
  .help-steps { grid-template-columns: 1fr; gap: 6px; }
  .help-steps li,
  .help-steps li:nth-child(5) {
    grid-column: auto;
    min-height: 0;
    padding: 7px 9px 7px 35px;
    font-size: 11.5px;
    line-height: 1.3;
  }
  .help-steps li::before { left: 8px; top: 7px; width: 19px; height: 19px; font-size: 10px; }
  .help-mission { padding: 8px 10px; }
  .help-mission strong { font-size: 12px; }
  .help-controls { font-size: 10.5px; }
  .modal-card--help .modal-actions { margin-top: 10px; gap: 7px; }
  .modal-card--help .modal-actions .game-button { min-width: 0; min-height: 36px; padding: 7px 10px; font-size: 10.5px; }
}


/* ================================================================
   CATCH THE MOONLIGHT v1.0.3 – Responsive story layouts
   Desktop menu lift, compact mobile HUD, one-line mission, centered
   full-body visual-novel characters.
   ================================================================ */

/* Main menu: lift the row so it no longer crowds the bottom edge. */
@media (orientation: landscape) and (min-width: 900px) {
  .title-actions {
    bottom: clamp(66px, 7.4vh, 88px) !important;
    width: min(94vw, 1120px) !important;
    gap: 10px !important;
  }
  .title-actions .game-button,
  .title-actions .icon-button {
    height: 46px !important;
    min-height: 46px !important;
    font-size: clamp(11px, .88vw, 14px) !important;
  }
  .title-actions #titleSoundButton {
    width: 46px !important;
    min-width: 46px !important;
  }
  .version-label { bottom: 9px !important; }
}

/* Gameplay header: exactly one title line, no second subtitle. */
.game-topbar__title {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-topbar__title strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #f4cf7d;
  font-size: clamp(11px, 1.05vw, 16px);
  line-height: 1.15;
  letter-spacing: .055em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.game-topbar__title span { display: none !important; }

/* Mission must remain a single line on desktop and mobile. */
.hud-card--mission { min-width: 0; }
.hud-card--mission #missionPair {
  display: block;
  width: 100%;
  overflow: hidden;
  color: #f4cf7d;
  font-size: clamp(10px, .82vw, 13px) !important;
  line-height: 1.15 !important;
  letter-spacing: -.025em;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap !important;
}

/* Use available viewport height instead of fixed guessed heights. */
.game-screen.screen--active {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.game-topbar {
  flex: 0 0 auto;
  margin: 6px auto 5px;
}
.game-layout {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  margin: 0 auto;
  padding-top: 0;
  padding-bottom: 5px;
}
.board-zone { min-height: 0; }
.board-shell { min-height: 0; }

/* Portrait main menu: preserve the poster ratio and keep actions grouped. */
@media (orientation: portrait) {
  .title-screen {
    background-repeat: no-repeat;
    background-position: center top;
    background-size: 100% 100% !important;
    background-color: #1c0a32;
  }
  .title-actions {
    left: 50% !important;
    right: auto !important;
    bottom: max(24px, calc(env(safe-area-inset-bottom) + 18px)) !important;
    width: min(92vw, 470px) !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  .title-actions > .game-button {
    width: 100%;
    min-height: 44px !important;
    height: 44px;
    padding: 8px 13px !important;
    border-radius: 13px !important;
    font-size: clamp(12px, 3.2vw, 15px) !important;
    letter-spacing: .025em !important;
  }
  .title-actions__row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 42px !important;
    gap: 7px !important;
  }
  .title-actions__row .icon-button--wide {
    min-height: 40px !important;
    height: 40px !important;
    padding: 6px 9px !important;
    border-radius: 12px !important;
    font-size: 10px !important;
    white-space: nowrap;
  }
  .title-actions__row #titleSoundButton {
    width: 42px !important;
    min-width: 42px !important;
    min-height: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    font-size: 17px !important;
  }
  .version-label { bottom: 6px !important; font-size: 8px !important; }
}

/* Compact portrait gameplay: all HUD, board, preview and goal fit one screen. */
@media (orientation: portrait) and (max-width: 900px) {
  .game-screen.screen--active {
    padding-left: max(4px, env(safe-area-inset-left));
    padding-right: max(4px, env(safe-area-inset-right));
  }
  .game-topbar {
    width: calc(100% - 12px) !important;
    min-height: 42px;
    margin: 4px auto 4px !important;
    padding: 4px 7px !important;
    gap: 6px !important;
    border-radius: 13px !important;
  }
  .game-topbar > .icon-button,
  .game-topbar__actions .icon-button {
    min-width: 34px !important;
    min-height: 34px !important;
    width: 34px;
    height: 34px;
    padding: 4px !important;
    border-radius: 10px !important;
    font-size: 16px !important;
  }
  .game-topbar__title strong {
    font-size: clamp(9px, 2.65vw, 12px) !important;
    letter-spacing: .025em !important;
  }
  .game-topbar__actions { gap: 5px !important; }
  .game-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    gap: 5px !important;
    width: calc(100% - 10px) !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 0 0 4px !important;
  }
  .side-panel { min-width: 0; gap: 5px !important; }
  .side-panel--left {
    order: 1 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    flex-direction: row !important;
  }
  .board-zone {
    order: 2 !important;
    display: flex !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    justify-content: flex-start !important;
    gap: 3px !important;
  }
  .drop-hint {
    flex: 0 0 auto;
    margin: 0 !important;
    padding: 3px 9px !important;
    font-size: 7px !important;
    line-height: 1.15;
  }
  .board-shell {
    flex: 1 1 auto;
    width: min(100%, 560px) !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100%;
    border-width: 3px !important;
    border-radius: 18px !important;
  }
  .side-panel--right {
    order: 3 !important;
    display: grid !important;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.2fr) 62px !important;
    gap: 5px !important;
    align-items: stretch;
  }
  .hud-card {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 5px 4px !important;
    border-width: 1px !important;
    border-radius: 10px !important;
    box-shadow: 0 5px 12px rgba(0,0,0,.18) !important;
  }
  .hud-label {
    margin: 0 0 1px !important;
    font-size: 7px !important;
    line-height: 1.15 !important;
    letter-spacing: .025em !important;
  }
  .side-panel--left .hud-card strong {
    font-size: clamp(13px, 4vw, 18px) !important;
    line-height: 1.05 !important;
  }
  .hud-card--preview {
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    grid-template-rows: auto 1fr !important;
    align-items: center !important;
    column-gap: 3px;
  }
  .hud-card--preview .hud-label { grid-column: 1 / -1 !important; }
  .hud-card--preview canvas {
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: 32px !important;
    max-width: 32px !important;
    height: 32px !important;
    margin: 0 !important;
  }
  .hud-card--preview strong {
    grid-column: 2 !important;
    grid-row: 2 !important;
    min-width: 0;
    font-size: 8px !important;
    line-height: 1.05 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  .hud-card--mission #missionPair {
    font-size: clamp(7px, 2.05vw, 9px) !important;
    letter-spacing: -.045em !important;
    line-height: 1.12 !important;
    white-space: nowrap !important;
  }
  .hud-card--mission span:last-child {
    margin-top: 3px !important;
    font-size: 6.5px !important;
    line-height: 1.1 !important;
  }
  .side-panel--right .game-button--small {
    min-width: 0 !important;
    width: 100% !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: 4px 2px !important;
    border-width: 1px !important;
    border-radius: 10px !important;
    font-size: 8px !important;
    line-height: 1.15 !important;
    letter-spacing: 0 !important;
    white-space: normal;
    box-shadow: 0 4px 0 rgba(17,5,29,.38) !important;
  }
}

/* Short landscape phones: keep the playfield central and the side HUD narrow. */
@media (orientation: landscape) and (max-height: 560px) {
  .game-screen.screen--active { padding: 3px 0; }
  .game-topbar {
    min-height: 38px;
    margin: 2px auto 3px !important;
    padding: 3px 7px !important;
    border-radius: 11px !important;
  }
  .game-topbar > .icon-button,
  .game-topbar__actions .icon-button {
    min-width: 31px !important;
    min-height: 31px !important;
    width: 31px;
    height: 31px;
    padding: 3px !important;
    font-size: 14px !important;
  }
  .game-topbar__title strong { font-size: 10px !important; }
  .game-layout {
    grid-template-columns: 78px minmax(0, 1fr) 104px !important;
    grid-template-rows: minmax(0, 1fr) !important;
    gap: 5px !important;
    width: calc(100% - 10px) !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 0 0 2px !important;
  }
  .side-panel--left,
  .side-panel--right {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
  }
  .hud-card { padding: 5px 4px !important; border-width: 1px !important; border-radius: 9px !important; }
  .hud-label { font-size: 6px !important; }
  .hud-card strong { font-size: 14px !important; }
  .hud-card--preview canvas { width: 34px !important; height: 34px !important; }
  .hud-card--mission #missionPair { font-size: 8px !important; }
  .hud-card--mission span:last-child { font-size: 6px !important; }
  .drop-hint { display: none !important; }
  .board-zone { min-height: 0 !important; height: 100% !important; }
  .board-shell { width: 100% !important; height: 100% !important; min-height: 0 !important; border-width: 3px !important; border-radius: 15px !important; }
  .game-button--small { min-height: 34px !important; height: 34px !important; padding: 4px !important; font-size: 8px !important; }
}

/* ===== v1.0.3: responsive visual-novel layout shared by intro and outcomes ===== */
/* Desktop: restore the alternating composition from the original game. */
.story-guide__character-stage,
.story-guide--left .story-guide__character-stage,
.story-guide--right .story-guide__character-stage {
  position: absolute !important;
  z-index: 3;
  top: 4.5% !important;
  bottom: 5% !important;
  width: min(45vw, 680px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: left .48s cubic-bezier(.22,1,.36,1), right .48s cubic-bezier(.22,1,.36,1), opacity .24s ease;
}
.story-guide--left .story-guide__character-stage {
  left: 3.5% !important;
  right: auto !important;
  transform: none !important;
}
.story-guide--right .story-guide__character-stage {
  left: auto !important;
  right: 3.5% !important;
  transform: none !important;
}
.story-guide__character-stage canvas {
  display: block !important;
  width: auto !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  aspect-ratio: 4 / 5;
  object-fit: contain !important;
  object-position: center center !important;
  filter: drop-shadow(0 16px 24px rgba(0,0,0,.28));
}
.story-guide--left .story-guide__character-stage--enter {
  animation: storyCharacterFromLeft .48s cubic-bezier(.22,1,.36,1) both !important;
}
.story-guide--right .story-guide__character-stage--enter {
  animation: storyCharacterFromRight .48s cubic-bezier(.22,1,.36,1) both !important;
}

.story-guide__dialogue,
.story-guide--left .story-guide__dialogue,
.story-guide--right .story-guide__dialogue {
  position: absolute !important;
  z-index: 5;
  top: 50% !important;
  bottom: auto !important;
  width: min(46vw, 690px) !important;
  min-height: 0 !important;
  max-height: 78vh !important;
  overflow: auto !important;
  padding: clamp(20px, 2.1vw, 30px) clamp(20px, 2.3vw, 34px) 20px !important;
  border-radius: 24px !important;
  transform: translateY(-50%) !important;
  background: linear-gradient(180deg, rgba(42,21,62,.97), rgba(27,12,43,.97)) !important;
  border: 1px solid rgba(255,231,183,.64) !important;
  box-shadow: 0 24px 54px rgba(0,0,0,.38) !important;
  transition: left .48s cubic-bezier(.22,1,.36,1), right .48s cubic-bezier(.22,1,.36,1), opacity .24s ease;
}
.story-guide--left .story-guide__dialogue {
  left: auto !important;
  right: 4.5% !important;
}
.story-guide--right .story-guide__dialogue {
  left: 4.5% !important;
  right: auto !important;
}
.story-guide--left .story-guide__dialogue--enter {
  animation: storyDialogueFromRight .44s cubic-bezier(.22,1,.36,1) both !important;
}
.story-guide--right .story-guide__dialogue--enter {
  animation: storyDialogueFromLeft .44s cubic-bezier(.22,1,.36,1) both !important;
}
.story-guide__name-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
}
.story-guide__name-row strong {
  color: #f4cf7d !important;
  font-size: clamp(18px, 1.8vw, 25px) !important;
}
.story-guide__name-row span {
  min-height: 27px !important;
  padding: 0 11px !important;
  color: #fff0cb !important;
  background: rgba(119,74,151,.74) !important;
  font-size: 9px !important;
  letter-spacing: .045em !important;
}
.story-guide__text {
  min-height: 0 !important;
  margin: 0 !important;
  color: #fff5ff !important;
  font-size: clamp(15px, 1.32vw, 19px) !important;
  line-height: 1.52 !important;
  font-weight: 620 !important;
}
.story-guide__text::after { color: #f4cf7d !important; }
.story-guide__footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-top: 17px !important;
}
.story-guide__progress { display: flex !important; gap: 6px !important; flex-wrap: wrap; }
.story-guide__dot { width: 7px !important; height: 7px !important; }
.story-guide__dot.is-active { width: 22px !important; }
.story-guide__next {
  min-width: 94px !important;
  min-height: 38px !important;
  padding: 0 14px !important;
  border-width: 1px !important;
  border-radius: 12px !important;
  color: #39224e !important;
  background: linear-gradient(180deg,#ffe7a1,#e5b35c) !important;
  box-shadow: 0 4px 0 rgba(73,42,97,.42), 0 8px 14px rgba(0,0,0,.18) !important;
  font-size: 11px !important;
}
.story-guide__skip {
  top: max(16px, env(safe-area-inset-top)) !important;
  right: max(18px, env(safe-area-inset-right)) !important;
  min-width: 68px !important;
  min-height: 34px !important;
  padding: 0 12px !important;
  font-size: 10px !important;
}
@keyframes storyCharacterFromLeft {
  from { opacity: 0; transform: translateX(-22px) translateY(8px) scale(.97); }
  to { opacity: 1; transform: translateX(0) translateY(0) scale(1); }
}
@keyframes storyCharacterFromRight {
  from { opacity: 0; transform: translateX(22px) translateY(8px) scale(.97); }
  to { opacity: 1; transform: translateX(0) translateY(0) scale(1); }
}
@keyframes storyDialogueFromRight {
  from { opacity: 0; transform: translate(18px,-50%) scale(.985); }
  to { opacity: 1; transform: translate(0,-50%) scale(1); }
}
@keyframes storyDialogueFromLeft {
  from { opacity: 0; transform: translate(-18px,-50%) scale(.985); }
  to { opacity: 1; transform: translate(0,-50%) scale(1); }
}

/* Mobile: same dialogue data and sequence, but centered full-body idol above the box. */
@media (max-width: 900px) {
  .story-guide__character-stage,
  .story-guide--left .story-guide__character-stage,
  .story-guide--right .story-guide__character-stage {
    top: 1.5% !important;
    bottom: 34% !important;
    left: 50% !important;
    right: auto !important;
    width: min(90vw, 440px) !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
  }
  .story-guide__character-stage canvas {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    aspect-ratio: 4 / 5;
    object-fit: contain !important;
  }
  .story-guide__character-stage--enter {
    animation: storyCharacterMobileIn .42s cubic-bezier(.22,1,.36,1) both !important;
  }
  .story-guide__dialogue,
  .story-guide--left .story-guide__dialogue,
  .story-guide--right .story-guide__dialogue {
    top: auto !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-height: 33vh !important;
    overflow: auto !important;
    padding: 11px 13px 10px !important;
    border-radius: 16px !important;
    transform: none !important;
  }
  .story-guide__dialogue--enter,
  .story-guide--left .story-guide__dialogue--enter,
  .story-guide--right .story-guide__dialogue--enter {
    animation: storyDialogueMobileIn .38s ease both !important;
  }
  .story-guide__name-row { flex-direction: row !important; align-items: center !important; gap: 7px !important; margin-bottom: 6px !important; }
  .story-guide__name-row strong { flex: 0 0 auto; font-size: 15px !important; }
  .story-guide__name-row span { max-width: 68%; min-height: 22px !important; padding: 0 8px !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px !important; }
  .story-guide__text { min-height: 0 !important; font-size: clamp(12px, 3.55vw, 14.5px) !important; line-height: 1.36 !important; font-weight: 620 !important; }
  .story-guide__footer { margin-top: 7px !important; gap: 8px !important; }
  .story-guide__progress { gap: 4px !important; }
  .story-guide__dot { width: 5px !important; height: 5px !important; }
  .story-guide__dot.is-active { width: 16px !important; }
  .story-guide__next { min-width: 75px !important; min-height: 32px !important; padding: 0 10px !important; border-radius: 9px !important; font-size: 9px !important; }
  .story-guide__skip { top: max(8px, env(safe-area-inset-top)) !important; right: max(9px, env(safe-area-inset-right)) !important; min-width: 56px !important; min-height: 29px !important; font-size: 9px !important; }
  @keyframes storyCharacterMobileIn {
    from { opacity: 0; transform: translate(-50%, 12px) scale(.97); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
  }
  @keyframes storyDialogueMobileIn {
    from { opacity: 0; transform: translateY(10px) scale(.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}

/* Short landscape phones: compact centered character plus a compact dialogue card. */
@media (max-width: 900px) and (orientation: landscape) {
  .story-guide__character-stage,
  .story-guide--left .story-guide__character-stage,
  .story-guide--right .story-guide__character-stage {
    top: 1% !important;
    bottom: 43% !important;
    width: min(44vh, 250px) !important;
  }
  .story-guide__dialogue,
  .story-guide--left .story-guide__dialogue,
  .story-guide--right .story-guide__dialogue {
    bottom: max(6px, env(safe-area-inset-bottom)) !important;
    max-height: 43vh !important;
    padding: 7px 10px 6px !important;
  }
  .story-guide__name-row { margin-bottom: 3px !important; }
  .story-guide__text { font-size: 11px !important; line-height: 1.25 !important; }
  .story-guide__footer { margin-top: 4px !important; }
  .story-guide__next { min-height: 28px !important; }
}

/* Keep the home action group clear of the phone bottom gesture area. */
@media (orientation: portrait) and (max-width: 900px) {
  .title-actions {
    bottom: max(42px, calc(env(safe-area-inset-bottom) + 32px)) !important;
  }
  /* Put the dialogue card directly below the centered idol, not against the bottom edge. */
  .story-guide__dialogue,
  .story-guide--left .story-guide__dialogue,
  .story-guide--right .story-guide__dialogue {
    top: 65% !important;
    bottom: auto !important;
    max-height: 33vh !important;
  }
}

/* Keep next idol portrait and name as one compact visual unit on phones. */
@media (orientation: portrait) and (max-width: 900px) {
  .hud-card--preview {
    display: grid !important;
    grid-template-columns: 30px max-content !important;
    grid-template-rows: auto 32px !important;
    justify-content: center !important;
    align-content: center !important;
    align-items: center !important;
    column-gap: 5px !important;
    row-gap: 1px !important;
    padding: 4px 5px !important;
  }
  .hud-card--preview .hud-label { grid-column: 1 / -1 !important; grid-row: 1 !important; text-align: center !important; }
  .hud-card--preview canvas {
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: 30px !important;
    height: 30px !important;
    margin: 0 !important;
  }
  .hud-card--preview strong {
    grid-column: 2 !important;
    grid-row: 2 !important;
    max-width: 100% !important;
    font-size: clamp(7px, 2.1vw, 9px) !important;
    line-height: 1.1 !important;
    text-align: left !important;
    white-space: nowrap !important;
  }
}

html, body, #app { height: 100dvh; min-height: 100dvh; }

/* ===== v1.0.4 · MOONLIGHT SUPPORT tools ===== */
.support-tools {
  --support-gold: #f3d184;
  display: flex;
  width: min(100%, 510px);
  flex: 0 0 auto;
  flex-direction: column;
  gap: 5px;
  margin: 0 auto 7px;
  padding: 7px 9px 8px;
  border: 1px solid rgba(244, 216, 159, .42);
  border-radius: 15px;
  background: rgba(31, 13, 49, .84);
  box-shadow: 0 8px 22px rgba(8, 2, 16, .2);
  color: #fff5e4;
  backdrop-filter: blur(12px);
}

.support-tools[hidden] { display: none !important; }
.support-tools-slot {
  position: relative;
  display: flex;
  flex: 0 0 66px;
  width: min(100%, 510px);
  height: 66px;
  min-height: 66px;
  margin: 0 auto 5px;
  align-items: stretch;
}
.support-tools-placeholder {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px dashed rgba(244, 216, 159, .22);
  border-radius: 13px;
  color: rgba(255, 242, 218, .48);
  background: rgba(31, 13, 49, .24);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .11em;
  text-align: center;
}
.support-tools-placeholder[hidden] { display: none !important; }
.support-tools__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
  color: var(--support-gold);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .12em;
}
.support-tools__header span {
  color: rgba(255, 242, 218, .72);
  font-size: 8px;
  letter-spacing: .06em;
}
.support-tools__buttons {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}
.support-tool {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 1px 6px;
  min-width: 0;
  min-height: 42px;
  max-width: 160px;
  flex: 1 1 0;
  overflow: hidden;
  padding: 5px 7px 7px;
  border: 1px solid rgba(244, 216, 159, .3);
  border-radius: 10px;
  background: linear-gradient(155deg, rgba(93, 59, 119, .96), rgba(43, 22, 63, .98));
  color: #fff6e7;
  cursor: pointer;
  text-align: left;
  transition: transform 130ms ease, border-color 130ms ease, background 130ms ease, opacity 130ms ease;
}
.support-tool:hover { transform: translateY(-1px); border-color: rgba(255, 225, 158, .8); }
.support-tool:active { transform: translateY(1px); }
.support-tool:focus-visible { outline: 2px solid #ffe5a5; outline-offset: 2px; }
.support-tool__icon {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 224, 157, .15);
  color: var(--support-gold);
  font-size: 17px;
  font-weight: 900;
}
.support-tool__name {
  grid-column: 2;
  grid-row: 1;
  overflow: hidden;
  color: #fff4df;
  font-size: 8px;
  font-weight: 950;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-tool__timer {
  grid-column: 3;
  grid-row: 1;
  color: var(--support-gold);
  font-size: 9px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}
.support-tool__track {
  grid-column: 1 / -1;
  grid-row: 2;
  display: block;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255,255,255,.15);
}
.support-tool__track i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c79bf2, #f3d184);
  transition: width 120ms linear;
}
.support-tool.is-expiring {
  border-color: rgba(255, 140, 125, .8);
  background: linear-gradient(155deg, rgba(117, 54, 74, .97), rgba(53, 20, 45, .98));
  animation: supportExpirePulse .85s ease-in-out infinite alternate;
}
.support-tool.is-expiring .support-tool__timer { color: #ffaaa0; }
.support-tool.is-expiring .support-tool__track i { background: #f18b81; }
.support-tools__mode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 27px;
  padding: 3px 5px 0;
  color: #ffe6ad;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .045em;
}
.support-tools__mode[hidden] { display: none !important; }
.support-tools__cancel {
  flex: 0 0 auto;
  min-height: 25px;
  padding: 3px 10px;
  border: 1px solid rgba(255, 227, 177, .5);
  border-radius: 8px;
  background: rgba(255, 255, 255, .1);
  color: #fff5e4;
  cursor: pointer;
  font-size: 8px;
  font-weight: 950;
}
.support-tools.is-selecting .support-tool { opacity: .64; }
.support-tools.is-selecting .support-tool.is-selected { opacity: 1; border-color: #ffe2a0; }
@keyframes supportExpirePulse {
  from { box-shadow: 0 0 0 rgba(241, 139, 129, 0); }
  to { box-shadow: 0 0 12px rgba(241, 139, 129, .28); }
}

@media (orientation: portrait) and (max-width: 900px) {
  .support-tools {
    width: min(100%, 520px);
    margin: 0 auto 4px;
    padding: 5px 6px 6px;
    border-radius: 11px;
    gap: 4px;
  }
  .support-tools__header { font-size: 7px; }
  .support-tools__header span { font-size: 7px; }
  .support-tools__buttons { gap: 4px; }
  .support-tool {
    min-height: 36px;
    max-width: none;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    gap: 1px 4px;
    padding: 3px 4px 5px;
    border-radius: 8px;
  }
  .support-tool__icon { width: 18px; height: 18px; font-size: 13px; border-radius: 6px; }
  .support-tool__name { font-size: clamp(6px, 1.8vw, 7.5px); }
  .support-tool__timer { font-size: 7px; }
  .support-tools__mode { min-height: 24px; font-size: 7px; }
  .support-tools__cancel { min-height: 22px; padding: 2px 8px; font-size: 7px; }
}

/* Support panel shares the board column without covering the active playfield. */
.board-zone { min-height: 0; gap: 0; }
.board-zone > .board-shell {
  flex: 1 1 0;
  width: min(100%, 690px);
  height: auto;
  min-height: 320px;
  max-height: 100%;
}
@media (orientation: portrait) {
  .board-zone > .board-shell {
    width: min(92vw, 620px);
    min-height: 0;
    height: auto;
  }
}
@media (max-height: 640px) {
  .support-tools { padding-top: 4px; padding-bottom: 5px; margin-bottom: 3px; }
  .support-tool { min-height: 34px; }
}


/* v1.0.7: reserve a fixed support row so its appearance/expiry never resizes the canvas. */
.support-tools-slot { flex-basis: 66px; height: 66px; min-height: 66px; }
.support-tools {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
  margin: 0;
  padding: 4px 7px;
  gap: 3px;
  box-sizing: border-box;
}
.support-tools__header { flex: 0 0 9px; min-height: 9px; line-height: 1; }
.support-tools__buttons { flex: 1 1 auto; min-height: 0; }
.support-tool { min-height: 34px; transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease; }
.support-tools__mode {
  position: absolute;
  z-index: 3;
  top: 3px;
  left: 8px;
  right: 8px;
  height: 12px;
  min-height: 12px;
  padding: 0;
  justify-content: center;
  background: transparent;
  font-size: 7px;
  line-height: 1;
  pointer-events: none;
}
.support-tools__cancel {
  position: absolute;
  top: -2px;
  right: 0;
  min-height: 17px;
  padding: 1px 7px;
  font-size: 7px;
  pointer-events: auto;
}
.support-tools.is-selecting .support-tools__header { visibility: hidden; }
.support-tools-placeholder { flex: 1 1 auto; }
@media (orientation: portrait) and (max-width: 900px) {
  .support-tools-slot { flex-basis: 51px; height: 51px; min-height: 51px; margin-bottom: 3px; }
  .support-tools { padding: 3px 5px; gap: 2px; border-radius: 9px; }
  .support-tools__header { flex-basis: 7px; min-height: 7px; font-size: 6px; }
  .support-tools__header span { font-size: 6px; }
  .support-tool { min-height: 27px; padding: 2px 3px 4px; gap: 1px 3px; border-radius: 7px; }
  .support-tool__icon { width: 16px; height: 16px; font-size: 11px; }
  .support-tool__name { font-size: clamp(5.8px, 1.65vw, 7px); }
  .support-tool__timer { font-size: 6px; }
  .support-tools__mode { top: 2px; left: 6px; right: 6px; font-size: 6px; }
  .support-tools__cancel { top: -2px; min-height: 15px; padding: 0 5px; font-size: 6px; }
  .support-tools-placeholder { font-size: 6px; letter-spacing: .07em; border-radius: 9px; }
}
@media (max-height: 640px) {
  .support-tools-slot { flex-basis: 48px; height: 48px; min-height: 48px; }
}

/* Help dialog: compact Moonlight Support reference. */
.help-support {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid rgba(220, 187, 245, .28);
  border-radius: 14px;
  background: rgba(255, 255, 255, .055);
}
.help-support > strong { display: block; margin-bottom: 8px; color: #f3d184; font-size: 12px; letter-spacing: .04em; }
.help-support ul { margin: 0 0 8px; padding-left: 18px; }
.help-support li { margin: 4px 0; }
.help-support li b { color: #f4d58b; }
.help-support p { margin: 8px 0 0; font-size: .92em; line-height: 1.48; }

.support-tools.has-new-reward {
  border-color: rgba(255, 229, 164, .72);
  box-shadow: 0 0 0 1px rgba(243, 209, 132, .12), 0 8px 22px rgba(8, 2, 16, .2);
}
.support-tool.is-new {
  animation: none !important;
  border-color: rgba(255, 229, 164, .98);
  box-shadow: inset 0 0 0 1px rgba(255, 229, 164, .18), 0 0 10px rgba(243, 209, 132, .16);
}
.support-tool.is-expiring {
  animation: none !important;
  border-color: rgba(255, 170, 160, .78);
  background: linear-gradient(155deg, rgba(117, 54, 74, .97), rgba(53, 20, 45, .98));
  box-shadow: inset 0 0 0 1px rgba(255, 170, 160, .08);
}
.toast--support {
  top: max(78px, calc(env(safe-area-inset-top) + 70px));
  bottom: auto;
  padding: 8px 14px;
  border: 1px solid rgba(244, 216, 159, .62);
  border-radius: 13px;
  color: #fff4df;
  background: rgba(39, 19, 58, .96);
  font-size: 12px;
  transform: translate(-50%, -150%);
}
.toast--support.toast--show { transform: translate(-50%, 0); }


/* v1.0.5: desktop NEXT IDOL is a centered portrait stack; mobile preview stays as-is. */
@media (min-width: 901px) {
  .hud-card--preview {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: center !important;
  }
  .hud-card--preview .hud-label,
  .hud-card--preview strong {
    width: 100%;
    text-align: center !important;
  }
  .hud-card--preview canvas {
    display: block !important;
    width: min(100%, 132px) !important;
    height: auto !important;
    margin: 7px auto 5px !important;
    align-self: center !important;
  }
  .hud-card--preview strong {
    margin: 2px auto 0 !important;
    line-height: 1.2;
  }
}

/* ================================================================
   v1.0.6 · MY MOONLIGHT tribute player (victory-only screen)
   ================================================================ */
.tribute-screen {
  position: fixed;
  inset: 0;
  z-index: 430;
  display: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(12px, 2vh, 22px);
  overflow: hidden;
  padding: max(20px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  color: #fff5ff;
  background:
    radial-gradient(circle at 18% 18%, rgba(151, 92, 195, .24), transparent 32%),
    radial-gradient(circle at 82% 78%, rgba(201, 145, 77, .13), transparent 30%),
    linear-gradient(145deg, #170824 0%, #28123f 48%, #14071f 100%);
  isolation: isolate;
}
.tribute-screen--open { display: grid; }
.tribute-screen__ambient {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: .4;
  background-image:
    radial-gradient(circle at 12% 34%, rgba(255,224,163,.58) 0 1px, transparent 2px),
    radial-gradient(circle at 76% 18%, rgba(219,183,255,.52) 0 1px, transparent 2px),
    radial-gradient(circle at 88% 65%, rgba(255,224,163,.42) 0 1px, transparent 2px),
    radial-gradient(circle at 38% 88%, rgba(219,183,255,.35) 0 1px, transparent 2px);
  background-size: 230px 210px, 280px 250px, 310px 280px, 260px 240px;
}
.tribute-screen__header,
.tribute-screen__footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(100%, 1320px);
  margin: 0 auto;
}
.tribute-screen__footer { justify-content: center; }
.tribute-screen__eyebrow {
  color: #e8cc92;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .22em;
}
.tribute-screen__header-actions { display: flex; align-items: center; gap: 9px; }
.tribute-screen__sound,
.tribute-screen__skip,
.tribute-screen__continue,
.tribute-player__play,
.tribute-player__replay {
  border: 1px solid rgba(239,211,255,.24);
  color: #fff4dc;
  background: rgba(62,35,82,.62);
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.tribute-screen__sound:hover,
.tribute-screen__skip:hover,
.tribute-screen__continue:hover,
.tribute-player__play:hover,
.tribute-player__replay:hover { transform: translateY(-1px); border-color: rgba(245,211,137,.65); }
.tribute-screen__sound {
  width: 38px;
  height: 36px;
  border-radius: 11px;
  font-size: 16px;
}
.tribute-screen__skip {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 11px;
  color: rgba(255,245,255,.78);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .09em;
}
.tribute-screen__main {
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(380px, 1.1fr);
  align-items: center;
  gap: clamp(30px, 5vw, 84px);
  width: min(100%, 1180px);
  min-height: 0;
  margin: 0 auto;
}
.tribute-player {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}
.tribute-player__vinyl-wrap {
  position: relative;
  display: grid;
  width: clamp(220px, 27vw, 370px);
  aspect-ratio: 1;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 50%;
}
.tribute-player__vinyl-glow {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: rgba(198,137,255,.26);
  filter: blur(30px);
  opacity: .55;
  transition: opacity .35s ease, transform .35s ease;
}
.tribute-screen.is-playing .tribute-player__vinyl-glow {
  opacity: .9;
  transform: scale(1.08);
}
.tribute-player__vinyl {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  filter: drop-shadow(0 18px 32px rgba(0,0,0,.38));
  animation: tributeVinylSpin 15s linear infinite;
  animation-play-state: paused;
  user-select: none;
  -webkit-user-drag: none;
}
.tribute-screen.is-playing .tribute-player__vinyl { animation-play-state: running; }
@keyframes tributeVinylSpin { to { transform: rotate(360deg); } }
.tribute-player__track { display: grid; gap: 4px; }
.tribute-player__kicker {
  color: #d6b6e7;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .24em;
}
.tribute-player__track h1 {
  margin: 0;
  color: #f7d78f;
  font-size: clamp(26px, 3.2vw, 42px);
  font-weight: 1000;
  letter-spacing: .035em;
  line-height: 1;
  text-shadow: 0 3px 18px rgba(236,184,100,.18);
}
.tribute-player__subtitle {
  margin: 1px 0 0;
  color: #fff4dc;
  font-size: clamp(11px, 1.1vw, 14px);
  font-weight: 800;
  letter-spacing: .2em;
}
.tribute-player__artist {
  margin: 0;
  color: #cbb4dc;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .16em;
}
.tribute-player__controls { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 4px; }
.tribute-player__play {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255,239,196,.62);
  border-radius: 50%;
  color: #40264f;
  background: linear-gradient(180deg,#ffe5a0,#d9a64d);
  box-shadow: 0 6px 18px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.75);
  font-size: 19px;
  font-weight: 950;
}
.tribute-player__replay {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: #eee1f6;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .09em;
}
.tribute-player__timeline { width: min(100%, 360px); display: grid; gap: 5px; }
.tribute-player__timeline input[type="range"] {
  width: 100%;
  height: 5px;
  margin: 0;
  border-radius: 99px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(90deg,#f2cd7f var(--seek-progress, 0%), rgba(255,255,255,.2) var(--seek-progress, 0%));
  cursor: pointer;
}
.tribute-player__timeline input[type="range"]::-webkit-slider-thumb {
  width: 12px; height: 12px; border: 2px solid #fff1c9; border-radius: 50%; appearance: none; -webkit-appearance: none; background: #c58bed; box-shadow: 0 0 0 4px rgba(197,139,237,.14);
}
.tribute-player__timeline input[type="range"]::-moz-range-thumb {
  width: 10px; height: 10px; border: 2px solid #fff1c9; border-radius: 50%; background: #c58bed; box-shadow: 0 0 0 4px rgba(197,139,237,.14);
}
.tribute-player__time { display: flex; justify-content: space-between; color: #bda8ca; font-size: 9px; font-variant-numeric: tabular-nums; }
.tribute-player__status { min-height: 15px; margin: 0; color: #bea9cd; font-size: 10px; line-height: 1.35; }
.tribute-lyrics {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: min(520px, 68vh);
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 4vw, 54px);
  border: 1px solid rgba(232,203,255,.18);
  border-radius: 26px;
  background: linear-gradient(145deg,rgba(57,33,78,.72),rgba(28,13,43,.68));
  box-shadow: 0 24px 70px rgba(0,0,0,.22), inset 0 1px rgba(255,255,255,.055);
  backdrop-filter: blur(15px);
}
.tribute-lyrics__heading { display: grid; gap: 7px; margin-bottom: clamp(28px, 5vh, 54px); }
.tribute-lyrics__heading span { color: #c3a4d8; font-size: 9px; font-weight: 950; letter-spacing: .22em; }
.tribute-lyrics__heading strong { color: #f1cf8a; font-size: clamp(20px, 2.2vw, 30px); letter-spacing: .08em; }
.tribute-lyrics__stage { display: grid; align-content: center; gap: clamp(17px, 3vh, 27px); min-height: 190px; }
.tribute-lyrics__line {
  min-height: 1.4em;
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
  transition: opacity .22s ease, transform .22s ease, color .22s ease;
}
.tribute-lyrics__line--previous,
.tribute-lyrics__line--next { color: rgba(225,207,238,.42); font-size: clamp(13px, 1.35vw, 17px); line-height: 1.5; }
.tribute-lyrics__line--current {
  color: #fff3d0;
  font-size: clamp(21px, 2.35vw, 31px);
  font-weight: 850;
  line-height: 1.42;
  text-shadow: 0 0 24px rgba(247,208,132,.16);
}
.tribute-lyrics__line--current.is-instrumental { color: #d4b6e9; font-size: 18px; font-weight: 650; letter-spacing: .18em; }
.tribute-lyrics__ending {
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid rgba(242,207,132,.3);
  border-radius: 13px;
  color: #f8dfaa;
  background: rgba(225,181,100,.08);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}
.tribute-lyrics__ending[hidden] { display: none !important; }
.tribute-lyrics__signature { margin-top: auto; padding-top: 28px; color: rgba(205,181,221,.62); font-size: 8px; font-weight: 900; letter-spacing: .2em; }
.tribute-screen__footer {
  color: rgba(209,188,224,.64);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .2em;
}
.tribute-screen__continue {
  min-height: 38px;
  padding: 0 20px;
  border: 1px solid rgba(245,216,154,.65);
  border-radius: 11px;
  color: #38234b;
  background: linear-gradient(180deg,#ffe7a5,#dfb05d);
  box-shadow: 0 5px 15px rgba(0,0,0,.24);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
}
/* Result action sits directly below the lyric card on both layouts. */
.tribute-lyrics > .tribute-screen__continue {
  display: flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex: 0 0 auto;
  margin: 16px auto 0;
  text-align: center;
}
.tribute-screen.autoplay-blocked .tribute-player__play { animation: tributePlayPulse 1.5s ease-in-out infinite; }
@keyframes tributePlayPulse { 50% { box-shadow: 0 0 0 9px rgba(245,210,135,.1), 0 6px 18px rgba(0,0,0,.28); } }
.tribute-active { overflow: hidden !important; }

@media (max-width: 760px) and (orientation: portrait) {
  .tribute-screen {
    gap: 8px;
    padding: max(10px, env(safe-area-inset-top)) max(11px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(11px, env(safe-area-inset-left));
  }
  .tribute-screen__header { gap: 8px; }
  .tribute-screen__eyebrow { font-size: 8px; letter-spacing: .14em; }
  .tribute-screen__header-actions { gap: 6px; }
  .tribute-screen__sound { width: 32px; height: 31px; border-radius: 9px; font-size: 14px; }
  .tribute-screen__skip { min-height: 31px; padding: 0 9px; font-size: 8px; }
  .tribute-screen__main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: 9px;
    min-height: 0;
  }
  .tribute-player {
    display: grid;
    grid-template-columns: minmax(112px, 34vw) minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    align-content: center;
    align-items: center;
    justify-items: center;
    column-gap: 12px;
    row-gap: 4px;
    min-height: 0;
    padding: 3px 2px;
  }
  .tribute-player__vinyl-wrap {
    grid-column: 1;
    grid-row: 1 / span 4;
    width: min(34vw, 210px);
    align-self: center;
    margin: 0;
  }
  .tribute-player__track { grid-column: 2; grid-row: 1; width: 100%; text-align: left; align-self: end; }
  .tribute-player__kicker { font-size: 7px; letter-spacing: .13em; }
  .tribute-player__track h1 { font-size: clamp(17px, 5vw, 24px); line-height: 1.05; }
  .tribute-player__subtitle { font-size: 8px; letter-spacing: .12em; }
  .tribute-player__artist { font-size: 7px; letter-spacing: .1em; }
  .tribute-player__controls { grid-column: 2; grid-row: 2; justify-self: start; margin: 3px 0 0; }
  .tribute-player__play { width: 36px; height: 36px; font-size: 15px; }
  .tribute-player__replay { min-height: 30px; padding: 0 10px; font-size: 8px; }
  .tribute-player__timeline { grid-column: 2; grid-row: 3; width: 100%; gap: 4px; }
  .tribute-player__time { font-size: 8px; }
  .tribute-player__status { grid-column: 2; grid-row: 4; justify-self: stretch; min-height: 0; font-size: 8px; line-height: 1.25; text-align: left; }
  .tribute-lyrics {
    min-height: 0;
    padding: 13px 15px 12px;
    border-radius: 17px;
    justify-content: flex-start;
  }
  .tribute-lyrics__heading { gap: 3px; margin-bottom: 10px; }
  .tribute-lyrics__heading span { font-size: 7px; letter-spacing: .17em; }
  .tribute-lyrics__heading strong { font-size: 14px; }
  .tribute-lyrics__stage { gap: 8px; min-height: 0; flex: 1; align-content: center; }
  .tribute-lyrics__line--previous,
  .tribute-lyrics__line--next { font-size: clamp(10px, 2.9vw, 12px); line-height: 1.35; }
  .tribute-lyrics__line--current { font-size: clamp(15px, 4.2vw, 20px); line-height: 1.35; }
  .tribute-lyrics__line--current.is-instrumental { font-size: 12px; }
  .tribute-lyrics__signature { padding-top: 8px; font-size: 6px; letter-spacing: .12em; }
  .tribute-lyrics__ending { margin-top: 8px; padding: 8px; font-size: 9px; }
  .tribute-lyrics__signature + .tribute-screen__continue { min-height: 32px; margin-top: 9px; padding: 0 18px; border-radius: 9px; font-size: 8px; }
  .tribute-screen__footer { justify-content: center; font-size: 6px; letter-spacing: .1em; }
}

@media (max-width: 760px) and (orientation: landscape) {
  .tribute-screen { gap: 7px; padding: 7px 14px; }
  .tribute-screen__eyebrow { font-size: 7px; }
  .tribute-screen__sound { width: 29px; height: 28px; }
  .tribute-screen__skip { min-height: 28px; font-size: 7px; }
  .tribute-screen__main { grid-template-columns: minmax(220px, .8fr) minmax(280px, 1.2fr); gap: 14px; }
  .tribute-player { display: grid; grid-template-columns: minmax(105px, 24vh) minmax(0,1fr); grid-template-rows: repeat(4, auto); gap: 3px 9px; }
  .tribute-player__vinyl-wrap { grid-column: 1; grid-row: 1 / span 4; width: min(24vh, 190px); }
  .tribute-player__track { grid-column: 2; grid-row: 1; text-align: left; }
  .tribute-player__track h1 { font-size: clamp(16px, 3.4vh, 23px); }
  .tribute-player__kicker, .tribute-player__artist { font-size: 6px; }
  .tribute-player__subtitle { font-size: 7px; }
  .tribute-player__controls { grid-column: 2; grid-row: 2; justify-self: start; margin: 0; }
  .tribute-player__play { width: 30px; height: 30px; font-size: 12px; }
  .tribute-player__replay { min-height: 27px; font-size: 7px; }
  .tribute-player__timeline { grid-column: 2; grid-row: 3; width: 100%; }
  .tribute-player__status { grid-column: 2; grid-row: 4; font-size: 7px; text-align: left; }
  .tribute-lyrics { min-height: 0; padding: 11px 16px; border-radius: 16px; }
  .tribute-lyrics__heading { margin-bottom: 8px; }
  .tribute-lyrics__heading strong { font-size: 15px; }
  .tribute-lyrics__stage { min-height: 0; gap: 7px; }
  .tribute-lyrics__line--previous, .tribute-lyrics__line--next { font-size: 10px; }
  .tribute-lyrics__line--current { font-size: 16px; }
  .tribute-lyrics__signature { padding-top: 7px; font-size: 6px; }
  .tribute-lyrics__signature + .tribute-screen__continue { min-height: 28px; margin-top: 6px; font-size: 7px; }
  .tribute-screen__footer { justify-content: center; font-size: 6px; }
}

/* v1.0.7: remove the low-contrast pale serial/status strip from idol cards. */
.collection-card__serial,
.collection-card__status { display: none !important; }
.tribute-screen__header { justify-content: flex-end; }
.tribute-screen__eyebrow { display: none !important; }

/* ================================================================
   v1.0.8 – Help dialog with two compact tabs and reliable exit
   Desktop and mobile share content/actions but keep responsive sizing.
   ================================================================ */
.modal-card--help {
  width: min(94vw, 980px);
  max-height: min(90dvh, 780px);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  padding: clamp(15px, 2vw, 25px);
  border-width: 1px;
  border-radius: 22px;
  text-align: left;
}

.modal-card--help h2 {
  flex: 0 0 auto;
  margin: 0 54px 13px 0;
  color: #f4cf7d;
  font-size: clamp(20px, 2.35vw, 31px);
  line-height: 1.14;
  letter-spacing: .015em;
  text-align: left;
}

.modal-card__close {
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 12px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(244, 218, 255, .48);
  border-radius: 12px;
  color: #fff4df;
  background: rgba(255,255,255,.075);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}
.modal-card__close:hover {
  border-color: rgba(255, 224, 157, .85);
  background: rgba(255, 222, 151, .14);
}
.modal-card__close:active { transform: scale(.96); }
.modal-card__close[hidden] { display: none !important; }

.modal-card--help .modal-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  color: rgba(255, 245, 255, .92);
  line-height: 1.38;
}

.help-dialog {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  gap: 10px;
}

.help-tabs {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(220, 187, 245, .2);
  border-radius: 14px;
  background: rgba(12, 4, 22, .28);
}

.help-tab {
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: rgba(239, 223, 250, .78);
  background: transparent;
  font: inherit;
  font-size: clamp(10px, 1.1vw, 13px);
  font-weight: 900;
  letter-spacing: .025em;
  line-height: 1.15;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.help-tab:hover { color: #fff4df; background: rgba(255,255,255,.06); }
.help-tab.is-active {
  color: #3b2451;
  border-color: rgba(255, 231, 176, .9);
  background: linear-gradient(180deg, #ffe7a5, #e7b95f);
  box-shadow: 0 3px 9px rgba(0,0,0,.18);
}

.help-panel {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 198, 131, .55) rgba(255,255,255,.05);
}
.help-panel.is-active { display: flex; flex-direction: column; gap: 9px; }
.help-panel[hidden] { display: none !important; }
.help-panel::-webkit-scrollbar { width: 5px; }
.help-panel::-webkit-scrollbar-track { background: rgba(255,255,255,.04); border-radius: 99px; }
.help-panel::-webkit-scrollbar-thumb { background: rgba(232, 198, 131, .55); border-radius: 99px; }

.help-story-intro { display: grid; gap: 5px; }
.help-welcome {
  margin: 0 !important;
  color: #fff4e2;
  font-size: clamp(12px, 1.18vw, 15px);
  line-height: 1.35;
  text-align: left;
}
.help-welcome strong { color: #dcaeff !important; }
.help-story-copy {
  margin: 0 !important;
  color: rgba(245, 234, 251, .84);
  font-size: clamp(11px, 1.02vw, 13px);
  line-height: 1.4;
}
.help-section-label {
  flex: 0 0 auto;
  color: #f2d28c;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .13em;
}
.help-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 9px;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
  counter-reset: help-step;
}
.help-steps li {
  position: relative;
  min-width: 0;
  min-height: 43px;
  margin: 0;
  padding: 8px 9px 8px 34px;
  border: 1px solid rgba(224,193,255,.16);
  border-radius: 11px;
  color: rgba(255,245,255,.9);
  background: rgba(255,255,255,.055);
  font-size: clamp(10.5px, .98vw, 12.5px);
  line-height: 1.34;
  counter-increment: help-step;
}
.help-steps li:nth-child(5) { grid-column: 1 / -1; }
.help-steps li::before {
  content: counter(help-step);
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 50%;
  color: #39224e;
  background: linear-gradient(180deg, #ffe7a1, #e5b35c);
  font-size: 10px;
  font-weight: 950;
}
.help-steps li strong { color: #f1cf83 !important; }
.help-story-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 8px;
  align-items: stretch;
  margin-top: auto;
}
.help-mission {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid rgba(241,207,131,.35);
  border-radius: 12px;
  background: linear-gradient(90deg,rgba(241,207,131,.12),rgba(181,126,224,.1));
  text-align: left;
}
.help-mission span {
  color: #e9c77a;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .11em;
}
.help-mission strong {
  color: #fff3d1 !important;
  font-size: clamp(10.5px, 1vw, 13px);
  line-height: 1.32;
}
.help-controls {
  display: flex;
  align-items: center;
  margin: 0 !important;
  padding: 8px 10px;
  border: 1px solid rgba(220,187,245,.13);
  border-radius: 12px;
  color: rgba(255,245,255,.78);
  background: rgba(255,255,255,.035);
  font-size: clamp(10px, .92vw, 12px);
  line-height: 1.38;
}
.help-controls strong { color: #d8a4ff !important; }

.help-support-intro {
  margin: 0 !important;
  color: rgba(245, 234, 251, .88);
  font-size: clamp(11px, 1.05vw, 13px);
  line-height: 1.4;
}
.help-support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.help-skill-card {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid rgba(224,193,255,.17);
  border-radius: 12px;
  background: rgba(255,255,255,.055);
}
.help-skill-card__combo {
  color: #d9b7f5;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .1em;
}
.help-skill-card > strong { color: #f3d58d; font-size: clamp(11px, 1.08vw, 13px); }
.help-skill-card p {
  margin: 0 !important;
  color: rgba(255,245,255,.83);
  font-size: clamp(10px, .95vw, 12px);
  line-height: 1.35;
}
.help-support-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 10px;
}
.help-support-rules > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 9px;
  border-left: 2px solid rgba(231, 190, 105, .72);
  background: rgba(255,255,255,.035);
}
.help-support-rules b { color: #f2d28c; font-size: 9px; letter-spacing: .06em; }
.help-support-rules span { color: rgba(245,234,251,.78); font-size: 10px; line-height: 1.32; }
.help-support-note {
  margin: 0 !important;
  color: rgba(232, 214, 243, .72);
  font-size: 10px;
  line-height: 1.35;
}

.modal-card--help .modal-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(224,193,255,.13);
}
.modal-card--help .modal-actions .game-button {
  flex: 0 0 auto;
  min-width: 116px;
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 10.5px;
  letter-spacing: .025em;
}
.modal-card--help .modal-actions .game-button[hidden] { display: none !important; }

@media (max-width: 700px) {
  .modal-root { padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom)); }
  .modal-card--help {
    width: min(96vw, 560px);
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
    padding: 12px 11px 10px;
    border-radius: 17px;
  }
  .modal-card--help h2 {
    margin: 0 42px 9px 1px;
    font-size: clamp(16px, 4.2vw, 21px);
    line-height: 1.15;
  }
  .modal-card__close { top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 9px; font-size: 19px; }
  .help-dialog { gap: 7px; }
  .help-tabs { gap: 5px; padding: 3px; border-radius: 11px; }
  .help-tab { min-height: 35px; padding: 6px 5px; border-radius: 8px; font-size: clamp(8.5px, 2.4vw, 10.5px); letter-spacing: 0; }
  .help-panel.is-active { gap: 7px; }
  .help-story-intro { gap: 4px; }
  .help-welcome { font-size: 11.5px; line-height: 1.3; }
  .help-story-copy { font-size: 10.5px; line-height: 1.32; }
  .help-section-label { font-size: 9px; }
  .help-steps { grid-template-columns: 1fr; gap: 5px; }
  .help-steps li,
  .help-steps li:nth-child(5) {
    grid-column: auto;
    min-height: 0;
    padding: 6px 8px 6px 31px;
    border-radius: 9px;
    font-size: 10px;
    line-height: 1.28;
  }
  .help-steps li::before { top: 6px; left: 7px; width: 17px; height: 17px; font-size: 9px; }
  .help-story-bottom { grid-template-columns: 1fr; gap: 5px; }
  .help-mission { padding: 7px 9px; gap: 3px; }
  .help-mission span { font-size: 8px; }
  .help-mission strong { font-size: 10.5px; }
  .help-controls { padding: 6px 8px; font-size: 9.5px; line-height: 1.3; }
  .help-support-intro { font-size: 10.5px; line-height: 1.32; }
  .help-support-grid { gap: 6px; }
  .help-skill-card { gap: 3px; padding: 7px 8px; border-radius: 9px; }
  .help-skill-card__combo { font-size: 8px; }
  .help-skill-card > strong { font-size: 10px; line-height: 1.2; }
  .help-skill-card p { font-size: 9px; line-height: 1.28; }
  .help-support-rules { gap: 5px 7px; }
  .help-support-rules > div { padding: 5px 7px; }
  .help-support-rules b { font-size: 8px; }
  .help-support-rules span { font-size: 9px; line-height: 1.25; }
  .help-support-note { font-size: 9px; line-height: 1.28; }
  .modal-card--help .modal-actions { gap: 6px; margin-top: 7px; padding-top: 7px; }
  .modal-card--help .modal-actions .game-button { min-width: 0; min-height: 33px; padding: 6px 10px; font-size: 9.5px; }
}

@media (max-height: 700px) {
  .modal-card--help { max-height: calc(100dvh - 16px); }
  .modal-card--help .help-panel { scrollbar-width: thin; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .modal-card--help { width: min(96vw, 1050px); max-height: calc(100dvh - 12px); padding: 9px 13px 8px; }
  .modal-card--help h2 { margin-bottom: 6px; font-size: 18px; }
  .modal-card__close { top: 6px; right: 7px; width: 30px; height: 30px; }
  .help-dialog { gap: 5px; }
  .help-tab { min-height: 30px; padding: 4px 8px; font-size: 9px; }
  .help-panel.is-active { gap: 5px; }
  .help-welcome { font-size: 10px; }
  .help-story-copy, .help-steps li { font-size: 9px; }
  .help-steps li { min-height: 32px; padding-top: 5px; padding-bottom: 5px; }
  .help-steps li::before { top: 5px; }
  .help-skill-card { padding: 5px 7px; }
  .help-support-rules span, .help-skill-card p { font-size: 8px; }
  .modal-card--help .modal-actions { margin-top: 5px; padding-top: 5px; }
}

/* Short landscape phones: use four compact columns to keep each help tab visible. */
@media (max-height: 560px) and (orientation: landscape) {
  .help-dialog { gap: 4px; }
  .help-panel.is-active { gap: 4px; }
  .help-story-intro { gap: 2px; }
  .help-welcome { font-size: 9.5px; line-height: 1.25; }
  .help-story-copy { font-size: 8.6px; line-height: 1.22; }
  .help-steps { gap: 4px 6px; }
  .help-steps li {
    min-height: 28px;
    padding: 4px 7px 4px 27px;
    font-size: 8.3px;
    line-height: 1.2;
  }
  .help-steps li::before { top: 4px; left: 6px; width: 15px; height: 15px; font-size: 8px; }
  .help-story-bottom { gap: 5px; }
  .help-mission { padding: 5px 7px; }
  .help-mission span { font-size: 7px; }
  .help-mission strong { font-size: 8.8px; }
  .help-controls { padding: 5px 7px; font-size: 8px; line-height: 1.2; }

  .help-support-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .help-skill-card { padding: 5px 6px; gap: 2px; }
  .help-skill-card__combo { font-size: 7.5px; }
  .help-skill-card > strong { font-size: 8.5px; }
  .help-skill-card p { font-size: 7.5px; line-height: 1.2; }
  .help-support-rules { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .help-support-rules > div { padding: 4px 5px; }
  .help-support-rules b { font-size: 7px; }
  .help-support-rules span { font-size: 7.4px; line-height: 1.2; }
  .help-support-note { font-size: 7.5px; line-height: 1.2; }
  .help-support-intro { font-size: 9px; line-height: 1.25; }
}


/* v1.0.9 · NEXT IDOL CHOICE picker */
.modal-card--next-idol-choice { width: min(560px, calc(100vw - 28px)); }
.next-idol-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 6px; }
.next-idol-choice {
  display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 7px; border: 1px solid rgba(244,216,159,.3); border-radius: 14px;
  color: #fff5e4; background: linear-gradient(155deg, rgba(91,58,117,.96), rgba(42,21,63,.98)); cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}
.next-idol-choice:hover, .next-idol-choice:focus-visible { border-color: #f3d184; box-shadow: 0 0 0 2px rgba(243,209,132,.14); outline: none; }
.next-idol-choice img { display: block; width: min(100%, 112px); height: 116px; object-fit: contain; }
.next-idol-choice strong { color: #f5d78e; font-size: 12px; line-height: 1.15; text-align: center; }
.next-idol-choice span { color: rgba(255,245,228,.68); font-size: 8px; font-weight: 850; letter-spacing: .1em; }
@media (max-width: 480px) {
  .next-idol-choice-grid { gap: 6px; }
  .next-idol-choice { padding: 8px 4px; border-radius: 10px; }
  .next-idol-choice img { height: 92px; }
  .next-idol-choice strong { font-size: 10px; }
  .next-idol-choice span { font-size: 7px; }
}


/* v1.0.10 · compact, premium result action buttons */
.modal-card--result {
  width: min(92vw, 600px);
  padding: clamp(18px, 3vw, 28px);
  border-radius: 22px;
}
.modal-card--result h2 {
  margin-bottom: 12px;
  font-size: clamp(20px, 2.2vw, 29px);
  line-height: 1.15;
  letter-spacing: .035em;
}
.modal-card--result .modal-body {
  font-size: clamp(13px, 1.2vw, 15px);
  line-height: 1.45;
}
.modal-card--result .modal-body p { margin: 7px 0; }
.modal-card--result .modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 18px;
}
.modal-card--result--three .modal-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.modal-card--result .modal-actions .game-button {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 8px;
  border-radius: 12px;
  font-size: clamp(10px, 1vw, 12px);
  line-height: 1.1;
  letter-spacing: .015em;
  white-space: nowrap;
  box-shadow: 0 4px 0 rgba(17, 5, 29, .34);
}
@media (max-width: 480px) {
  .modal-card--result {
    width: min(94vw, 430px);
    padding: 18px 13px 15px;
    border-radius: 17px;
  }
  .modal-card--result h2 {
    margin-bottom: 9px;
    font-size: clamp(17px, 4.8vw, 21px);
  }
  .modal-card--result .modal-body {
    font-size: 12px;
    line-height: 1.4;
  }
  .modal-card--result .modal-body p { margin: 5px 0; }
  .modal-card--result .modal-actions { gap: 6px; margin-top: 13px; }
  .modal-card--result .modal-actions .game-button {
    min-height: 40px;
    padding: 8px 3px;
    border-radius: 10px;
    font-size: clamp(8.5px, 2.7vw, 10.5px);
    letter-spacing: 0;
  }
}

/* v1.1.0 · Persistent VI / EN language control */
.language-switch {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(255, 238, 199, .42);
  border-radius: 999px;
  background: rgba(25, 11, 43, .82);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .24);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.language-switch button {
  min-width: 34px;
  min-height: 27px;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  color: rgba(255, 245, 222, .78);
  background: transparent;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}
.language-switch button.is-active {
  color: #382047;
  background: linear-gradient(135deg, #fff1bd, #f1c66f);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.language-switch button:focus-visible {
  outline: 2px solid #fff2c8;
  outline-offset: 2px;
}

/* Keep the language selector clear of screen-specific controls. */
.story-guide--open .story-guide__skip {
  right: max(112px, calc(env(safe-area-inset-right) + 104px)) !important;
}
#app:has(#themeScreen.screen--active) .page-header > button:last-child {
  margin-right: 96px;
}
#app:has(#gameScreen.screen--active) .game-topbar__actions {
  margin-right: 96px;
}
#app:has(#tributeScreen.tribute-screen--open) .tribute-screen__header-actions {
  margin-right: 96px;
}
#app:has(.collection-showcase--open) .collection-showcase__close {
  right: 106px !important;
}
@media (max-width: 600px) {
  #app:has(.modal-root--open) .modal-card__close {
    right: 98px !important;
  }
  .story-guide--open .story-guide__skip {
    right: max(100px, calc(env(safe-area-inset-right) + 94px)) !important;
  }
}
