/* ══════════════════════════════════════════════════════════════════
   MEOW MEMORY — STORY MODE, CINEMATICS & BOSS POWERS
   A royal-lavender layer on top of the warm paper game shell.
   ══════════════════════════════════════════════════════════════════ */

/* ── story entry banner inside the mode chooser ── */
.story-banner {
  position: relative;
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  width: 100%;
  margin: 4px 0 18px;
  padding: 13px 18px 13px 13px;
  text-align: right;
  color: #f8efff;
  border: 1.5px solid rgba(222, 204, 255, .36);
  border-radius: 24px;
  background:
    radial-gradient(72% 130% at 4% 50%, rgba(186, 155, 255, .34), transparent 58%),
    radial-gradient(60% 140% at 100% 0%, rgba(255, 213, 138, .18), transparent 55%),
    linear-gradient(125deg, #302548 0%, #49336c 48%, #35254f 100%);
  box-shadow:
    0 7px 0 rgba(60, 39, 73, .15),
    0 25px 50px -26px rgba(51, 31, 70, .65),
    inset 0 1px 0 rgba(255, 255, 255, .16);
  overflow: hidden;
  isolation: isolate;
  transition: transform .42s var(--ease-spring), box-shadow .42s var(--ease-out), border-color .3s;
}
.story-banner:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 220, 155, .55);
  box-shadow:
    0 10px 0 rgba(60, 39, 73, .13),
    0 34px 58px -28px rgba(43, 24, 61, .75),
    inset 0 1px 0 rgba(255, 255, 255, .22);
}
.story-banner:active { transform: translateY(-1px) scale(.997); }
.story-banner-glow {
  position: absolute;
  inset: -30% auto auto 19%;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(173, 132, 255, .34), transparent 68%);
  filter: blur(8px);
  animation: story-banner-breathe 7s ease-in-out infinite;
  z-index: -1;
}
.story-banner-art {
  position: relative;
  height: 102px;
  border-radius: 18px;
  border: 1px solid rgba(255, 244, 224, .16);
  background:
    radial-gradient(circle at 55% 28%, rgba(255, 241, 215, .18), transparent 45%),
    linear-gradient(160deg, rgba(255, 247, 235, .1), rgba(183, 152, 231, .06));
  overflow: hidden;
}
.story-banner-art::before {
  content: '';
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  border: 1px dashed rgba(246, 227, 255, .22);
}
.story-banner-cat {
  position: absolute;
  display: block;
  width: 60px; height: 60px;
  padding: 3px;
  border-radius: 50%;
  background: rgba(255, 248, 237, .9);
  border: 1.5px solid rgba(255, 235, 205, .4);
  box-shadow: 0 5px 12px rgba(20, 10, 32, .35);
}
.story-banner-cat svg { width: 100%; height: 100%; display: block; }
.story-banner-cat.sb1 { width: 74px; height: 74px; left: 48px; top: 12px; z-index: 4; }
.story-banner-cat.sb2 { width: 48px; height: 48px; left: 17px; top: 44px; z-index: 3; transform: rotate(-9deg); }
.story-banner-cat.sb3 { width: 49px; height: 49px; right: 16px; top: 39px; z-index: 3; transform: rotate(8deg); }
.story-banner-cat.sb4 { width: 42px; height: 42px; right: 45px; top: 7px; z-index: 2; transform: rotate(5deg); }
.story-banner-star {
  position: absolute;
  left: 9px; top: 8px;
  color: #ffd58a;
  font-size: 18px;
  text-shadow: 0 0 16px rgba(255, 213, 138, .75);
  animation: story-twinkle 2.8s ease-in-out infinite;
}
.story-banner-copy { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.story-banner-kicker {
  display: inline-flex; align-items: center; gap: 6px;
  color: #d8c4ff;
  font-size: 10.5px; font-weight: 800;
}
.story-banner-kicker .ico { width: 13px; height: 13px; color: #ffd58a; }
.story-banner-copy strong {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.3vw, 30px);
  font-weight: 800;
  line-height: 1.2;
  color: #fff9ef;
}
.story-banner-copy > span:last-child {
  color: rgba(246, 235, 255, .68);
  font-size: 11.5px; font-weight: 500; line-height: 1.7;
}
.story-banner-progress {
  align-self: start;
  margin-top: 5px;
  padding: 5px 10px;
  border-radius: 99px;
  border: 1px solid rgba(255, 239, 210, .2);
  color: rgba(255, 240, 213, .78);
  background: rgba(255, 246, 230, .07);
  font-size: 10px; font-weight: 700; white-space: nowrap;
}
.story-banner-go {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 16px;
  border-radius: 14px;
  color: #3f2c20;
  background: linear-gradient(135deg, #ffe6ac, #f0c264);
  box-shadow: 0 4px 0 #bd8d3d, 0 8px 18px rgba(32, 18, 42, .3);
  font-family: var(--font-display);
  font-size: 13px; font-weight: 800; white-space: nowrap;
  transition: transform .3s var(--ease-spring), filter .3s;
}
.story-banner:hover .story-banner-go { transform: translateX(-4px); filter: brightness(1.04); }
.story-banner-go .ico { width: 15px; height: 15px; }
@keyframes story-banner-breathe { 0%, 100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.16); opacity: 1; } }

/* ── story map modal ── */
.modal.story-modal-wrap { width: min(1180px, 96vw); }
.story-modal {
  color: #f7efff;
  border-color: rgba(220, 199, 255, .32);
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(159, 119, 229, .24), transparent 58%),
    radial-gradient(70% 60% at 0% 100%, rgba(255, 205, 130, .09), transparent 60%),
    linear-gradient(150deg, #2c2342 0%, #241b37 52%, #1c152c 100%);
  box-shadow:
    0 44px 100px -38px rgba(12, 6, 22, .86),
    inset 0 1px 0 rgba(255, 255, 255, .1);
  scrollbar-color: rgba(201, 176, 245, .3) transparent;
}
.story-modal .modal-close {
  color: #e9dcff;
  background: rgba(255, 245, 230, .08);
  border-color: rgba(232, 219, 255, .18);
}
.story-modal .modal-close:hover { color: #2c2241; background: #fff8ed; }
.story-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.story-modal .modal-kicker { color: rgba(226, 208, 255, .54); }
.story-modal .kicker-line { background: rgba(221, 201, 255, .4); }
.story-modal-head h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 800;
  line-height: 1.12;
  color: #fff8eb;
  letter-spacing: -.02em;
}
.story-modal-head p {
  max-width: 570px;
  margin-top: 4px;
  color: rgba(228, 215, 247, .58);
  font-size: 12px; line-height: 1.8;
}
.story-globe {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 132px; height: 132px;
  margin: -4px 0 0 4px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 243, 218, .3), transparent 44%),
    radial-gradient(circle at 50% 60%, rgba(144, 105, 213, .43), transparent 65%),
    #3b2d58;
  border: 1px solid rgba(232, 212, 255, .26);
  box-shadow: 0 18px 38px rgba(10, 5, 20, .4), inset 0 0 28px rgba(178, 139, 246, .18);
}
.story-globe-ring {
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  border: 1px dashed rgba(238, 219, 255, .3);
  animation: story-spin 28s linear infinite;
}
.story-globe-cat { width: 80px; height: 80px; z-index: 2; filter: drop-shadow(0 7px 13px rgba(15, 7, 26, .4)); }
.story-globe-cat svg { width: 100%; height: 100%; display: block; }
.story-globe-star { position: absolute; color: #ffd58a; font-size: 16px; text-shadow: 0 0 14px rgba(255, 213, 138, .8); }
.story-globe-star.s1 { top: 17px; right: 24px; animation: story-twinkle 2.4s .3s ease-in-out infinite; }
.story-globe-star.s2 { bottom: 22px; left: 20px; font-size: 12px; animation: story-twinkle 3.1s ease-in-out infinite; }
.story-progress-bar {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(229, 212, 255, .14);
  background: rgba(255, 247, 234, .045);
}
.story-progress-stat { display: flex; align-items: center; gap: 9px; }
.story-progress-stat.is-align-end { justify-content: flex-end; text-align: left; }
.story-progress-icon {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 10px;
  color: #ffd58a;
  background: rgba(255, 213, 138, .11);
  border: 1px solid rgba(255, 224, 164, .18);
}
.story-progress-icon .ico { width: 15px; height: 15px; }
.story-progress-stat b { display: block; font-family: var(--font-display); font-size: 15px; line-height: 1.1; color: #fff8eb; }
.story-progress-stat span { display: block; color: rgba(226, 211, 246, .5); font-size: 9.5px; }
.story-progress-track { height: 7px; border-radius: 99px; background: rgba(255, 248, 237, .09); overflow: hidden; }
.story-progress-track span {
  display: block; width: 0%; height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8f6bd1, #caa8ff 48%, #ffd58a);
  box-shadow: 0 0 16px rgba(193, 156, 255, .55);
  transition: width .8s var(--ease-out);
}
.story-map-wrap {
  position: relative;
  padding: 15px;
  border-radius: 20px;
  border: 1px solid rgba(225, 207, 255, .11);
  background:
    radial-gradient(circle at 50% 10%, rgba(146, 105, 212, .11), transparent 54%),
    rgba(255, 247, 235, .025);
  overflow: hidden;
}
.story-map-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(225, 211, 255, .12) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: .25;
  pointer-events: none;
}
.story-map-path {
  position: absolute;
  left: 8%; right: 8%;
  top: 32%; height: 38%;
  border-radius: 50%;
  border-top: 1.5px dashed rgba(210, 187, 250, .2);
  transform: rotate(-2deg);
  pointer-events: none;
}
.story-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}
.story-node {
  --accent: #b79aff;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 172px;
  padding: 11px 11px 10px;
  text-align: right;
  border-radius: 17px;
  border: 1.5px solid rgba(232, 216, 255, .13);
  background:
    radial-gradient(90% 100% at 50% 0%, color-mix(in srgb, var(--accent) 19%, transparent), transparent 68%),
    linear-gradient(160deg, rgba(255, 249, 239, .075), rgba(255, 248, 235, .025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 10px 22px -16px rgba(5, 3, 12, .75);
  overflow: hidden;
  transition: transform .35s var(--ease-spring), border-color .3s, background .3s, box-shadow .3s;
}
.story-node::before {
  content: '';
  position: absolute;
  inset: auto 18% -36px;
  height: 74px;
  border-radius: 50%;
  background: var(--accent);
  filter: blur(32px);
  opacity: .13;
  pointer-events: none;
}
.story-node.is-unlocked { cursor: pointer; }
.story-node.is-unlocked:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 20px 34px -19px color-mix(in srgb, var(--accent) 55%, transparent);
}
.story-node.is-current {
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent), 0 18px 34px -20px color-mix(in srgb, var(--accent) 50%, transparent);
}
.story-node.is-locked { opacity: .53; filter: saturate(.55); cursor: default; }
.story-node.is-complete { background: radial-gradient(90% 100% at 50% 0%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%), linear-gradient(160deg, rgba(255, 249, 239, .09), rgba(255, 248, 235, .03)); }
.story-node-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; min-height: 18px; }
.story-node-num {
  display: inline-grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 8px;
  color: #2b213c;
  background: color-mix(in srgb, var(--accent) 88%, #fff 12%);
  font-family: var(--font-display);
  font-size: 10.5px; font-weight: 800;
}
.story-node.is-locked .story-node-num { color: rgba(255, 248, 238, .65); background: rgba(255, 248, 238, .13); }
.story-node-state { display: inline-flex; align-items: center; gap: 3px; color: rgba(235, 220, 255, .46); font-size: 8.5px; font-weight: 700; }
.story-node-state .ico { width: 10px; height: 10px; }
.story-node.is-complete .story-node-state { color: #ffd58a; }
.story-node-avatar {
  position: relative;
  width: 61px; height: 61px;
  margin: 4px auto 1px;
  padding: 3px;
  border-radius: 50%;
  border: 1px solid rgba(255, 242, 220, .2);
  background: rgba(255, 247, 235, .12);
  box-shadow: 0 7px 16px rgba(7, 3, 14, .35);
}
.story-node-avatar svg { width: 100%; height: 100%; display: block; }
.story-node.is-locked .story-node-avatar svg { filter: grayscale(.35); }
.story-node-title { text-align: center; margin-top: 3px; }
.story-node-title b { display: block; font-family: var(--font-display); font-size: 13.5px; line-height: 1.2; color: #fff7ea; }
.story-node-title span { display: block; margin-top: 1px; color: rgba(235, 220, 255, .47); font-size: 8.5px; }
.story-node-ability {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  align-self: center;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 99px;
  color: color-mix(in srgb, var(--accent) 72%, #fff 28%);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  font-size: 8px; font-weight: 700;
}
.story-node-ability .ico { width: 10px; height: 10px; }
.story-node-stars { display: flex; justify-content: center; gap: 3px; margin-top: auto; padding-top: 5px; }
.story-node-stars i {
  width: 11px; height: 11px;
  display: block;
  background: #ffd58a;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 94%, 50% 72%, 21% 94%, 32% 57%, 2% 35%, 39% 35%);
  opacity: .22;
}
.story-node-stars i.is-full { opacity: 1; filter: drop-shadow(0 0 5px rgba(255, 213, 138, .5)); }
.story-node-lock {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background: rgba(28, 21, 44, .32);
  backdrop-filter: blur(1.5px);
}
.story-node-lock span {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 12px;
  color: rgba(255, 244, 229, .7);
  background: rgba(27, 19, 42, .72);
  border: 1px solid rgba(255, 239, 217, .18);
}
.story-node-lock .ico { width: 15px; height: 15px; }
.story-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.story-continue { min-width: 210px; }
.story-modal .subtle-btn { color: rgba(238, 224, 255, .68); border-color: rgba(232, 216, 255, .16); background: rgba(255, 248, 236, .04); }
.story-modal .subtle-btn:hover { color: #fff8eb; border-color: rgba(255, 222, 167, .36); }
.story-footer-note { margin-inline-start: auto; color: rgba(224, 208, 244, .42); font-size: 9.5px; }

/* ── cinematic stage ── */
.story-stage {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 40px);
  color: #fff8ee;
  background: #130d20;
  overflow: hidden;
  isolation: isolate;
}
.story-stage[hidden] { display: none !important; }
.story-stage.is-open { animation: story-stage-in .7s var(--ease-out) both; }
.story-stage-sky {
  position: absolute;
  inset: -10%;
  z-index: -3;
  background:
    radial-gradient(55% 45% at 50% 28%, rgba(146, 102, 218, .42), transparent 63%),
    radial-gradient(45% 36% at 16% 74%, rgba(86, 121, 183, .22), transparent 70%),
    radial-gradient(40% 34% at 84% 18%, rgba(255, 193, 123, .12), transparent 70%),
    linear-gradient(160deg, #19112b 0%, #2d2149 44%, #141021 100%);
  animation: story-sky-drift 22s ease-in-out infinite alternate;
}
.story-stage-sky::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 14% 19%, rgba(255,255,255,.72) 0 1px, transparent 1.5px),
    radial-gradient(circle at 74% 14%, rgba(255,235,192,.7) 0 1px, transparent 1.5px),
    radial-gradient(circle at 63% 42%, rgba(239,220,255,.65) 0 1px, transparent 1.6px),
    radial-gradient(circle at 33% 52%, rgba(255,255,255,.55) 0 1px, transparent 1.5px),
    radial-gradient(circle at 86% 66%, rgba(255,224,168,.6) 0 1px, transparent 1.5px);
  background-size: 280px 240px, 340px 310px, 420px 380px, 240px 290px, 390px 330px;
  opacity: .58;
}
.story-stage-sky::after {
  content: '';
  position: absolute;
  left: 50%; top: 47%;
  width: min(74vw, 900px); height: min(74vw, 900px);
  border-radius: 50%;
  border: 1px solid rgba(222, 198, 255, .12);
  box-shadow: 0 0 0 46px rgba(222, 198, 255, .035), 0 0 0 110px rgba(222, 198, 255, .025);
  transform: translate(-50%, -50%);
}
.story-stage-vignette {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(9, 5, 17, .58) 100%);
}
.story-sky-orb {
  position: absolute;
  left: 50%; top: 34%;
  width: 230px; height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 213, 255, .24), rgba(153, 111, 218, .06) 48%, transparent 70%);
  transform: translate(-50%, -50%);
  filter: blur(4px);
  animation: story-orb-pulse 7s ease-in-out infinite;
}
.story-sky-star { position: absolute; color: #ffd58a; text-shadow: 0 0 20px rgba(255, 213, 138, .85); animation: story-twinkle 3.2s ease-in-out infinite; }
.story-sky-star.s1 { top: 18%; right: 16%; font-size: 17px; }
.story-sky-star.s2 { top: 28%; left: 19%; font-size: 12px; animation-delay: .8s; }
.story-sky-star.s3 { bottom: 27%; right: 25%; font-size: 11px; animation-delay: 1.5s; }
.story-sky-star.s4 { top: 11%; left: 43%; font-size: 14px; animation-delay: .3s; }
.story-sky-star.s5 { bottom: 17%; left: 12%; font-size: 9px; animation-delay: 2.1s; }
.story-sky-hill {
  position: absolute;
  left: -10%; right: -10%;
  bottom: -19%;
  height: 42%;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(180deg, rgba(53, 40, 78, .85), rgba(19, 13, 31, 1));
  filter: blur(1px);
}
.story-sky-hill.h1 { transform: rotate(-3deg); opacity: .7; }
.story-sky-hill.h2 { bottom: -25%; left: 20%; right: -25%; opacity: .8; transform: rotate(4deg); }
.story-sky-mist {
  position: absolute;
  left: 10%; right: 10%; bottom: 8%;
  height: 25%;
  background: radial-gradient(ellipse at 50% 100%, rgba(183, 154, 239, .2), transparent 68%);
  filter: blur(18px);
}
.story-intro-title {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(.96);
}
.story-stage.is-intro .story-intro-title { visibility: visible; animation: story-title-in 2.4s var(--ease-out) both; }
.story-intro-title > span {
  color: rgba(238, 222, 255, .52);
  font-size: clamp(10px, 1.4vw, 14px);
  font-weight: 800;
  letter-spacing: .44em;
}
.story-intro-title strong {
  font-family: var(--font-display);
  font-size: clamp(38px, 7vw, 88px);
  font-weight: 800;
  line-height: 1.1;
  color: #fff8eb;
  text-shadow: 0 10px 40px rgba(139, 98, 206, .5);
}
.story-intro-title em {
  margin-top: 8px;
  color: rgba(239, 222, 255, .62);
  font-size: clamp(11px, 1.5vw, 15px);
  font-style: normal;
  letter-spacing: .08em;
}
.story-stage.is-intro .story-stage-content { opacity: 0; visibility: hidden; pointer-events: none; }
.story-stage-content {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 660px);
  align-items: end;
  gap: clamp(10px, 3vw, 40px);
  width: min(1020px, 94vw);
  opacity: 1;
  transition: opacity .5s var(--ease-out), visibility .5s;
}
.story-stage.is-intro .story-stage-content { visibility: hidden; }
.story-portrait-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 300px;
  padding-bottom: 4px;
}
.story-portrait-halo {
  position: absolute;
  bottom: 16%; left: 50%;
  width: 280px; height: 280px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(184, 146, 255, .35), rgba(131, 91, 196, .1) 46%, transparent 70%);
  filter: blur(2px);
  animation: story-orb-pulse 6s ease-in-out infinite;
}
.story-portrait-ring {
  position: absolute;
  bottom: 8%; left: 50%;
  width: 250px; height: 250px;
  border-radius: 50%;
  border: 1px dashed rgba(239, 222, 255, .2);
  transform: translateX(-50%) rotate(-8deg);
  animation: story-spin 34s linear infinite reverse;
}
.story-portrait {
  position: relative;
  z-index: 2;
  width: clamp(180px, 21vw, 270px);
  height: clamp(180px, 21vw, 270px);
  filter: drop-shadow(0 18px 24px rgba(8, 4, 16, .55));
  animation: story-portrait-float 6s ease-in-out infinite;
}
.story-portrait svg { width: 100%; height: 100%; display: block; }
.story-narrator-glyph {
  display: grid;
  place-items: center;
  width: 100%; height: 100%;
  color: #ffd58a;
  font-family: var(--font-display);
  font-size: 96px;
  text-shadow: 0 0 45px rgba(255, 213, 138, .55);
  animation: story-twinkle 3s ease-in-out infinite;
}
.story-special-title {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background: radial-gradient(circle at 50% 50%, rgba(31, 19, 49, .58), rgba(8, 4, 16, .84));
  transition: opacity .45s var(--ease-out), visibility .45s;
}
.story-special-title.is-on { opacity: 1; visibility: visible; }
.story-special-title span { color: rgba(255, 226, 173, .65); font-size: 10px; font-weight: 800; letter-spacing: .3em; }
.story-special-title strong {
  max-width: 90vw;
  text-align: center;
  color: #fff5df;
  font-family: var(--font-display);
  font-size: clamp(34px, 6vw, 76px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -.02em;
  text-shadow: 0 0 38px rgba(255, 201, 105, .35);
  transform: scale(.94);
  transition: transform .7s var(--ease-spring);
}
.story-special-title.is-on strong { transform: scale(1); }
.story-stage.is-transforming .story-stage-content { visibility: hidden; opacity: 0; pointer-events: none; }
.final-transformation {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 44%, rgba(137, 93, 211, .3), rgba(7, 3, 14, .94) 58%),
    #07030e;
  opacity: 0;
  visibility: hidden;
  transition: opacity .65s var(--ease-out), visibility .65s;
}
.final-transformation.is-on { opacity: 1; visibility: visible; }
.final-transform-shake, .final-transformation.is-on { animation: final-screen-shake 4.6s .4s ease-in-out both; }
.final-aura {
  position: absolute;
  left: 50%; top: 40%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.final-aura.a1 {
  width: min(66vw, 760px); height: min(66vw, 760px);
  background: radial-gradient(circle, rgba(161, 113, 239, .25), transparent 64%);
  filter: blur(12px);
  animation: final-aura-pulse 2.8s ease-in-out infinite;
}
.final-aura.a2 {
  width: min(44vw, 490px); height: min(44vw, 490px);
  border: 1px solid rgba(203, 169, 255, .22);
  box-shadow: 0 0 0 28px rgba(203, 169, 255, .035), 0 0 0 74px rgba(203, 169, 255, .02);
  animation: final-aura-pulse 2.8s .2s ease-in-out infinite reverse;
}
.final-aura.a3 {
  width: min(33vw, 350px); height: min(33vw, 350px);
  background: radial-gradient(circle, rgba(255, 211, 139, .14), transparent 68%);
  filter: blur(6px);
}
.final-stars {
  position: absolute;
  top: 18%; left: 50%;
  color: #ffd58a;
  font-size: clamp(22px, 3vw, 40px);
  text-shadow: 0 0 32px rgba(255, 213, 138, .8);
  animation: story-twinkle 1.7s ease-in-out infinite;
}
.final-portrait {
  position: relative;
  z-index: 2;
  width: clamp(150px, 20vw, 240px);
  height: clamp(150px, 20vw, 240px);
  margin-bottom: 12px;
  filter: drop-shadow(0 0 38px rgba(159, 114, 237, .58)) drop-shadow(0 21px 22px rgba(3, 1, 7, .5));
  animation: final-portrait-glow 2.4s ease-in-out infinite;
}
.final-portrait svg { width: 100%; height: 100%; display: block; }
.final-portrait svg .cat-pupil { filter: drop-shadow(0 0 7px #c7a4ff) brightness(1.22); }
.final-portrait svg .cat-eyes { filter: drop-shadow(0 0 10px rgba(179, 139, 255, .75)); }
.final-kicker { position: relative; z-index: 2; color: rgba(228, 207, 255, .5); font-size: 10px; font-weight: 800; letter-spacing: .46em; }
.final-transformation strong {
  position: relative;
  z-index: 2;
  max-width: 92vw;
  font-family: var(--font-display);
  font-size: clamp(31px, 6.6vw, 82px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.02em;
  color: #fff6e1;
  text-shadow: 0 0 42px rgba(255, 203, 113, .33), 0 0 80px rgba(151, 103, 229, .3);
  transform: scale(.94);
  transition: transform .9s var(--ease-spring);
}
.final-transformation.is-on strong { transform: scale(1); }
.final-transformation em {
  position: relative;
  z-index: 2;
  margin-top: 9px;
  color: rgba(231, 214, 255, .57);
  font-size: clamp(9px, 1.4vw, 12px);
  font-style: normal;
  letter-spacing: .05em;
}
@keyframes final-screen-shake {
  0%, 12%, 100% { translate: 0 0; }
  2% { translate: -3px 2px; } 4% { translate: 3px -2px; } 6% { translate: -2px -1px; }
  8% { translate: 2px 1px; } 10% { translate: -1px 2px; } 13% { translate: 0 0; }
}
@keyframes final-aura-pulse { 0%, 100% { opacity: .6; scale: .96; } 50% { opacity: 1; scale: 1.05; } }
@keyframes final-portrait-glow {
  0%, 100% { filter: drop-shadow(0 0 30px rgba(159, 114, 237, .45)) drop-shadow(0 21px 22px rgba(3, 1, 7, .5)); transform: translateY(0); }
  50% { filter: drop-shadow(0 0 54px rgba(179, 137, 255, .78)) drop-shadow(0 21px 22px rgba(3, 1, 7, .5)); transform: translateY(-5px); }
}
.story-portrait svg .cat-eyes,
.story-portrait svg .cat-brows,
.story-portrait svg .cat-mouth { transform-box: fill-box; transform-origin: center; transition: transform .35s var(--ease-spring), opacity .3s; }
.story-portrait svg .cat-brow { opacity: 0; }
.story-portrait svg.expr-happy .cat-eyes { transform: scaleY(.66); }
.story-portrait svg.expr-happy .cat-mouth { transform: translateY(1px) scaleX(1.18); }
.story-portrait svg.expr-surprised .cat-eyes { transform: scale(1.08); }
.story-portrait svg.expr-surprised .cat-mouth { transform: scale(.7) translateY(2px); }
.story-portrait svg.expr-angry .cat-eyes { transform: scaleY(.82) rotate(3deg); }
.story-portrait svg.expr-angry .cat-brow-l { opacity: 1; transform: rotate(14deg) translateY(1px); }
.story-portrait svg.expr-angry .cat-brow-r { opacity: 1; transform: rotate(-14deg) translateY(1px); }
.story-portrait svg.expr-confident .cat-eyes { transform: scaleY(.9); }
.story-portrait svg.expr-confident .cat-brow-l { opacity: .85; transform: translateY(-2px) rotate(-7deg); }
.story-portrait svg.expr-sad .cat-eyes { transform: translateY(2px) scaleY(.86); }
.story-portrait svg.expr-sad .cat-brow-l { opacity: .8; transform: rotate(-13deg); }
.story-portrait svg.expr-sad .cat-brow-r { opacity: .8; transform: rotate(13deg); }
.story-portrait svg.expr-mysterious .cat-pupil { filter: drop-shadow(0 0 6px #b79aff) brightness(1.1); }
.story-portrait svg.expr-mysterious .cat-eyes { transform: scaleY(.55); }
.story-portrait svg.expr-mysterious .cat-brow-l,
.story-portrait svg.expr-mysterious .cat-brow-r { opacity: .6; transform: translateY(2px); }
.story-expression-chip {
  position: relative;
  z-index: 3;
  margin-top: -8px;
  padding: 4px 11px;
  border-radius: 99px;
  color: rgba(247, 233, 255, .76);
  background: rgba(255, 248, 235, .08);
  border: 1px solid rgba(236, 219, 255, .19);
  font-size: 9.5px; font-weight: 700;
  backdrop-filter: blur(10px);
}
.story-dialogue-panel {
  position: relative;
  padding: clamp(18px, 2.4vw, 28px);
  border-radius: 24px;
  border: 1.5px solid rgba(255, 245, 230, .72);
  color: var(--ink);
  background:
    radial-gradient(100% 100% at 100% 0%, rgba(255, 239, 212, .75), transparent 58%),
    linear-gradient(145deg, rgba(255, 251, 243, .97), rgba(247, 237, 227, .96));
  box-shadow: 0 30px 70px -28px rgba(4, 2, 10, .74), inset 0 1px 0 rgba(255, 255, 255, .9);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  animation: story-panel-in .55s .12s var(--ease-spring) both;
}
.story-dialogue-panel::before {
  content: '';
  position: absolute;
  top: 24px; right: -10px;
  width: 18px; height: 18px;
  background: #fdf7ee;
  border-right: 1.5px solid rgba(255, 245, 230, .72);
  border-top: 1.5px solid rgba(255, 245, 230, .72);
  transform: rotate(45deg);
}
.story-speaker-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.story-speaker {
  font-family: var(--font-display);
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 800;
  color: var(--plum-deep);
}
.story-chapter-tag {
  padding: 4px 9px;
  border-radius: 99px;
  color: #87652b;
  background: rgba(240, 194, 100, .17);
  border: 1px solid rgba(194, 139, 47, .18);
  font-size: 9px; font-weight: 700;
}
.story-dialogue-text {
  position: relative;
  min-height: 70px;
  margin: 0;
  color: #4a374f;
  font-size: clamp(16px, 1.8vw, 21px);
  font-weight: 600;
  line-height: 2;
  letter-spacing: -.005em;
}
.story-dialogue-text::after {
  content: '';
  display: inline-block;
  width: 2px; height: 1.05em;
  margin-inline-start: 2px;
  vertical-align: -.16em;
  background: var(--plum);
  opacity: 0;
}
.story-dialogue-text.is-typing::after { opacity: .55; animation: story-caret .75s steps(2) infinite; }
.story-dialogue-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
}
.story-dialogue-hint { color: rgba(92, 70, 96, .43); font-size: 9.5px; font-weight: 600; }
.story-dialogue-actions { display: flex; align-items: center; gap: 7px; }
.story-dialogue-actions .btn { padding: 9px 16px; font-size: 12px; }
.story-dialogue-actions .subtle-btn { font-size: 10px; }
.story-cinematic-hint {
  position: absolute;
  bottom: max(15px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  color: rgba(235, 219, 255, .34);
  font-size: 9px;
  letter-spacing: .04em;
  white-space: nowrap;
}
.story-stage.is-ending .story-stage-content { visibility: hidden; opacity: 0; pointer-events: none; }
.story-ending-card {
  position: relative;
  z-index: 6;
  width: min(720px, 92vw);
  padding: clamp(24px, 4vw, 44px);
  text-align: center;
  border-radius: 30px;
  border: 1.5px solid rgba(255, 229, 177, .38);
  background:
    radial-gradient(100% 90% at 50% 0%, rgba(255, 213, 138, .17), transparent 56%),
    radial-gradient(100% 90% at 50% 100%, rgba(153, 112, 218, .22), transparent 58%),
    linear-gradient(160deg, rgba(43, 31, 65, .97), rgba(25, 17, 41, .98));
  box-shadow: 0 40px 90px -28px rgba(3, 1, 8, .8), inset 0 1px 0 rgba(255, 255, 255, .12);
  animation: story-ending-in .9s var(--ease-spring) both;
}
.story-ending-card[hidden] { display: none !important; }
.ending-kicker { color: rgba(255, 227, 173, .6); font-size: 10px; font-weight: 800; letter-spacing: .38em; }
.story-ending-card h2 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(36px, 6.5vw, 72px);
  font-weight: 800;
  line-height: 1;
  color: #fff4d9;
  text-shadow: 0 0 34px rgba(255, 206, 122, .34);
  letter-spacing: -.02em;
}
.story-ending-card > p { margin: 4px 0 0; color: rgba(255, 242, 218, .6); font-size: 12px; font-weight: 700; letter-spacing: .16em; }
.ending-cats { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; margin: 18px 0 12px; }
.ending-cats span {
  width: 53px; height: 53px;
  padding: 3px;
  border-radius: 50%;
  background: rgba(255, 248, 235, .9);
  border: 1px solid rgba(255, 231, 188, .4);
  box-shadow: 0 7px 14px rgba(4, 2, 10, .32);
  animation: ending-cat-pop .55s var(--ease-spring) both;
}
.ending-cats svg { width: 100%; height: 100%; display: block; }
.ending-copy { max-width: 440px; margin: 0 auto !important; color: rgba(240, 225, 255, .65) !important; font-size: 12px !important; font-weight: 500 !important; line-height: 1.9; letter-spacing: 0 !important; }
.ending-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; margin-top: 20px; }

/* ── boss powers in the board ── */
.boss-shadow-world {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: #040207;
  transition: opacity 1.05s var(--ease-out), visibility 1.05s;
}
.boss-shadow-world.is-active { opacity: 1; visibility: visible; }
.boss-shadow-world.is-restoring { opacity: 0; visibility: visible; }
.shadow-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 46%, rgba(80, 53, 120, .24), rgba(3, 2, 6, .985) 58%),
    repeating-linear-gradient(115deg, transparent 0 14px, rgba(175, 145, 230, .018) 14px 15px);
}
.shadow-eye {
  position: absolute;
  top: 45%;
  width: clamp(42px, 6vw, 76px);
  height: clamp(19px, 2.5vw, 33px);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #f1e3ff 0 13%, #a981ef 28%, #5c3b9d 55%, transparent 72%);
  box-shadow: 0 0 32px 10px rgba(143, 99, 226, .38);
  animation: shadow-blink 4.2s ease-in-out infinite;
}
.shadow-eye.eye-l { left: 36%; transform: rotate(-7deg); }
.shadow-eye.eye-r { right: 36%; transform: rotate(7deg); animation-delay: .08s; }
.shadow-mist { position: absolute; width: 70%; height: 32%; border-radius: 50%; filter: blur(34px); background: rgba(127, 84, 190, .15); animation: shadow-mist-move 6s ease-in-out infinite alternate; }
.shadow-mist.m1 { left: -14%; bottom: -8%; }
.shadow-mist.m2 { right: -17%; top: 8%; animation-delay: 1.4s; }
.shadow-whisper {
  position: absolute;
  left: 50%; bottom: 12%;
  transform: translateX(-50%);
  color: rgba(221, 198, 255, .48);
  font-size: clamp(9px, 1.2vw, 12px);
  font-weight: 700;
  letter-spacing: .16em;
  text-shadow: 0 0 14px rgba(168, 126, 238, .48);
  white-space: nowrap;
}
/* During Zill's night, the score and controls stay above the blackout. */
.game-screen.is-night .game-top,
.game-screen.is-night .hud,
.game-screen.is-night .game-status-row,
.game-screen.is-night .game-action-row,
.game-screen.is-night .energy-row {
  position: relative;
  z-index: 35;
}
/* The board sits just above the blackout and is dimmed, so card backs stay
   faintly readable without revealing any card faces. */
.game-screen.is-night .board-shell.is-shadowed {
  z-index: 32;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  filter: brightness(.38) saturate(.78);
  transition: filter .9s var(--ease-out), opacity .9s var(--ease-out);
}
.game-screen.is-night .game-top .game-icon,
.game-screen.is-night .game-brand,
.game-screen.is-night .player-card,
.game-screen.is-night .turn-message,
.game-screen.is-night .game-mode-chip,
.game-screen.is-night .combo-chip,
.game-screen.is-night .game-action-row,
.game-screen.is-night .energy-row {
  text-shadow: 0 1px 18px rgba(5, 2, 10, .9);
}
.board-shell.is-shadowed .memory-card:not(.is-cleared) .card-back {
  fill-opacity: .94;
  filter: brightness(1.18) saturate(.92);
  box-shadow: 0 0 0 1px rgba(196, 170, 255, .1), 0 0 18px rgba(130, 96, 202, .08);
}
.board-shell.is-shadowed .memory-card:not(.is-cleared) .card-back-art { opacity: .74; }
.freeze-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 3px;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 48%, rgba(228, 245, 255, .14), transparent 45%),
    linear-gradient(145deg, rgba(158, 205, 242, .34), rgba(188, 173, 244, .22) 52%, rgba(121, 173, 222, .38));
  border: 1.5px solid rgba(227, 246, 255, .75);
  box-shadow: inset 0 0 60px rgba(208, 240, 255, .55), 0 0 38px rgba(142, 194, 234, .4);
  backdrop-filter: blur(3px) saturate(.8);
  -webkit-backdrop-filter: blur(3px) saturate(.8);
  opacity: 0;
}
.freeze-overlay[hidden] { display: none !important; }
.freeze-overlay.is-active { animation: freeze-in .55s var(--ease-out) both; }
.freeze-overlay strong {
  color: #355a7f;
  font-family: var(--font-display);
  font-size: clamp(21px, 4vw, 29px);
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}
.freeze-overlay > span:not(.freeze-ring):not(.freeze-crystal) {
  color: rgba(48, 84, 116, .7);
  font-size: 10px; font-weight: 700;
}
.freeze-ring { position: absolute; border-radius: 50%; border: 1.5px solid rgba(236, 250, 255, .64); }
.freeze-ring.r1 { width: 180px; height: 180px; animation: freeze-ring 3s ease-out infinite; }
.freeze-ring.r2 { width: 270px; height: 270px; animation: freeze-ring 3s .7s ease-out infinite; }
.freeze-crystal {
  position: absolute;
  width: 16px; height: 42px;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(178,222,250,.4));
  clip-path: polygon(50% 0, 100% 25%, 78% 100%, 22% 100%, 0 25%);
  filter: drop-shadow(0 0 8px rgba(215, 243, 255, .8));
  animation: crystal-float 3.4s ease-in-out infinite;
}
.freeze-crystal.c1 { left: 12%; top: 25%; transform: rotate(-17deg); }
.freeze-crystal.c2 { right: 14%; top: 18%; height: 32px; animation-delay: .6s; transform: rotate(18deg); }
.freeze-crystal.c3 { right: 24%; bottom: 13%; height: 25px; animation-delay: 1.1s; transform: rotate(-9deg); }
.boss-ability-callout {
  position: absolute;
  top: 50%; left: 50%;
  z-index: 9;
  width: min(310px, 80%);
  padding: 15px 18px;
  text-align: center;
  border-radius: 18px;
  border: 1.5px solid rgba(255, 232, 190, .34);
  background: linear-gradient(160deg, rgba(43, 29, 61, .97), rgba(24, 15, 38, .98));
  box-shadow: 0 22px 45px -18px rgba(4, 2, 10, .8), inset 0 1px 0 rgba(255, 255, 255, .14);
  color: #fff6e7;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: boss-callout-in .5s var(--ease-spring) both;
}
.boss-ability-callout[hidden] { display: none !important; }
.boss-ability-kicker { display: block; color: rgba(255, 218, 148, .7); font-size: 8.5px; font-weight: 800; letter-spacing: .22em; }
.boss-ability-callout strong { display: block; margin: 3px 0 1px; font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.boss-ability-sub { display: block; color: rgba(236, 220, 255, .62); font-size: 9.5px; line-height: 1.6; }
.board-shell.is-expanding { animation: board-expand-bump .7s var(--ease-spring); }
.board-shell.is-boss-shuffling { animation: boss-shuffle-wiggle .55s var(--ease-smooth); }
.board-shell.is-expanding .memory-card:nth-last-child(-n+6) { animation: new-row-deal .65s var(--ease-spring) both; }
.board-shell.is-expanding .memory-card:nth-last-child(-n+6):nth-child(odd) { animation-delay: .05s; }
.game-mode-chip.is-story { background: rgba(131, 94, 192, .16); border-color: rgba(151, 112, 211, .32); color: #68468e; }

/* ── story results ── */
.result-chapter-stars { display: flex; justify-content: center; gap: 7px; margin-top: 10px; }
.result-chapter-stars[hidden] { display: none !important; }
.result-chapter-stars i {
  width: 26px; height: 26px;
  display: block;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 94%, 50% 72%, 21% 94%, 32% 57%, 2% 35%, 39% 35%);
  background: rgba(128, 95, 131, .17);
  transition: transform .4s var(--ease-spring), background .3s;
}
.result-chapter-stars i.is-full {
  background: linear-gradient(160deg, #ffe7a6, #e8b24d);
  filter: drop-shadow(0 4px 8px rgba(194, 139, 47, .35));
  transform: scale(1.08);
}
.result-chapter-stars i.is-new { animation: chapter-star-pop .65s .16s var(--ease-spring) both; }
.btn-story { background: linear-gradient(135deg, #8b6acb, #6d4baa); color: #fff8eb; box-shadow: 0 4px 0 #533882, 0 10px 20px -10px rgba(72, 42, 112, .5); }
.btn-story:hover { filter: brightness(1.05); }
.results-story-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  margin: 12px auto 0;
  padding: 8px 13px;
  border-radius: 11px;
  color: var(--plum-deep);
  border: 1px solid rgba(112, 77, 119, .19);
  background: rgba(255, 250, 240, .46);
  font-size: 10.5px; font-weight: 700;
  transition: background .25s, transform .25s;
}
.results-story-link:hover { background: rgba(255, 250, 240, .78); transform: translateY(-1px); }
.results-story-link[hidden] { display: none !important; }

/* ── launch notices ── */
.launch-layer {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(32, 20, 41, .38);
  backdrop-filter: blur(14px) saturate(.9);
  -webkit-backdrop-filter: blur(14px) saturate(.9);
  opacity: 0;
  visibility: hidden;
  transition: opacity .45s var(--ease-out), visibility .45s;
}
.launch-layer.is-open { opacity: 1; visibility: visible; }
.launch-layer[hidden] { display: none !important; }
.launch-card {
  width: min(480px, 94vw);
  padding: clamp(24px, 4vw, 36px);
  text-align: center;
  border-radius: 27px;
  border: 1.5px solid rgba(255, 250, 240, .9);
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(248, 231, 212, .9), transparent 58%),
    radial-gradient(80% 70% at 0% 100%, rgba(221, 226, 242, .78), transparent 62%),
    linear-gradient(145deg, #fffaf2, #f8ede0);
  box-shadow: 0 35px 70px -25px rgba(35, 20, 38, .55), inset 0 1px 0 #fff;
  animation: modal-in .5s var(--ease-spring) both;
}
.launch-icon {
  display: grid; place-items: center;
  width: 58px; height: 58px;
  margin: 0 auto 13px;
  border-radius: 19px;
  color: var(--plum-deep);
  background: linear-gradient(145deg, #f3e8ff, #e4d6f5);
  border: 1px solid rgba(128, 101, 201, .18);
  box-shadow: 0 6px 0 rgba(120, 88, 143, .09);
}
.launch-icon .ico { width: 25px; height: 25px; }
.launch-kicker { color: rgba(92, 67, 95, .5); font-size: 9.5px; font-weight: 800; letter-spacing: .14em; }
.launch-card h2 { margin: 4px 0 0; font-family: var(--font-display); font-size: clamp(23px, 4vw, 31px); font-weight: 800; line-height: 1.2; color: var(--ink); }
.launch-card p { margin: 8px auto 0; max-width: 380px; color: rgba(77, 57, 80, .62); font-size: 12px; line-height: 1.9; }
.launch-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 19px; }
.launch-actions .btn { min-width: 130px; justify-content: center; }
.launch-choice {
  padding: 10px 22px;
  border-radius: 13px;
  border: 1.5px solid rgba(98, 74, 106, .2);
  color: var(--ink-soft);
  background: rgba(255, 252, 246, .6);
  font-family: var(--font-display);
  font-size: 12.5px; font-weight: 800;
  transition: transform .25s var(--ease-spring), background .25s, border-color .25s;
}
.launch-choice:hover { transform: translateY(-2px); border-color: rgba(112, 77, 119, .38); background: #fffaf1; }
.launch-choice.is-primary { background: linear-gradient(135deg, #a98ade, #8065c9); color: #fff9ef; border-color: #7050b4; box-shadow: 0 4px 0 #5d43a0; }
.launch-choice.is-primary:hover { background: linear-gradient(135deg, #b69aeb, #8a70d4); }
.launch-small { margin-top: 12px; color: rgba(92, 70, 96, .4); font-size: 9px; }
.launch-dev-badge { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 8px; padding: 4px 9px; border-radius: 99px; color: #946b24; background: rgba(240, 194, 100, .2); border: 1px solid rgba(194, 139, 47, .2); font-size: 9px; font-weight: 800; }

/* ── shared animations ── */
@keyframes story-stage-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes story-sky-drift { from { transform: scale(1.02) translateY(0); } to { transform: scale(1.07) translateY(-1.5%); } }
@keyframes story-orb-pulse { 0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: .7; } 50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; } }
@keyframes story-twinkle { 0%, 100% { opacity: .35; transform: scale(.82); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes story-spin { to { transform: rotate(360deg); } }
@keyframes story-title-in { 0% { opacity: 0; transform: scale(.9); } 22%, 74% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.03); } }
@keyframes story-portrait-float { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-9px) rotate(1deg); } }
@keyframes story-panel-in { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes story-caret { 50% { opacity: 0; } }
@keyframes story-ending-in { from { opacity: 0; transform: translateY(25px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes ending-cat-pop { from { opacity: 0; transform: translateY(12px) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes shadow-blink { 0%, 38%, 44%, 100% { transform: scaleY(1); } 40%, 42% { transform: scaleY(.12); } }
@keyframes shadow-mist-move { from { transform: translateX(-4%) scale(1); } to { transform: translateX(5%) scale(1.12); } }
@keyframes freeze-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes freeze-ring { 0% { transform: scale(.7); opacity: 0; } 25% { opacity: .85; } 100% { transform: scale(1.12); opacity: 0; } }
@keyframes crystal-float { 0%, 100% { translate: 0 0; opacity: .65; } 50% { translate: 0 -9px; opacity: 1; } }
@keyframes boss-callout-in { from { opacity: 0; transform: translate(-50%, -50%) scale(.8); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes boss-shuffle-wiggle { 0%, 100% { transform: rotate(0) translateX(0); } 20% { transform: rotate(-.8deg) translateX(-3px); } 45% { transform: rotate(.7deg) translateX(3px); } 70% { transform: rotate(-.4deg) translateX(-1px); } }
@keyframes board-expand-bump { 0%, 100% { transform: scale(1); } 35% { transform: scale(1.018); } }
@keyframes new-row-deal { from { opacity: 0; transform: translateY(-22px) scale(.82); } to { opacity: 1; transform: none; } }
@keyframes chapter-star-pop { from { opacity: 0; transform: scale(.2) rotate(-25deg); } to { opacity: 1; transform: scale(1.08) rotate(0); } }

/* ── responsive ── */
@media (max-width: 980px) {
  .story-banner { grid-template-columns: 145px minmax(0, 1fr) auto; }
  .story-banner-progress { display: none; }
  .story-banner-art { height: 92px; }
  .story-banner-cat.sb1 { width: 65px; height: 65px; left: 38px; top: 12px; }
  .story-banner-cat.sb2 { width: 43px; height: 43px; left: 12px; top: 42px; }
  .story-banner-cat.sb3 { width: 43px; height: 43px; right: 12px; top: 40px; }
  .story-banner-cat.sb4 { width: 37px; height: 37px; right: 37px; top: 5px; }
  .story-map { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .story-stage-content { grid-template-columns: minmax(190px, 250px) minmax(0, 1fr); }
  .story-portrait { width: clamp(170px, 24vw, 235px); height: clamp(170px, 24vw, 235px); }
}
@media (max-width: 760px) {
  .story-banner { grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 10px; border-radius: 20px; }
  .story-banner-art { height: 82px; }
  .story-banner-cat.sb1 { width: 56px; height: 56px; left: 28px; top: 11px; }
  .story-banner-cat.sb2 { width: 36px; height: 36px; left: 7px; top: 39px; }
  .story-banner-cat.sb3 { width: 38px; height: 38px; right: 7px; top: 38px; }
  .story-banner-cat.sb4 { width: 32px; height: 32px; right: 28px; top: 3px; }
  .story-banner-copy strong { font-size: 21px; }
  .story-banner-copy > span:last-child { display: none; }
  .story-banner-go { grid-column: 1 / -1; justify-content: center; width: 100%; padding: 9px; font-size: 12px; }
  .story-modal-head { gap: 8px; }
  .story-globe { width: 88px; height: 88px; }
  .story-globe-cat { width: 55px; height: 55px; }
  .story-modal-head p { font-size: 11px; }
  .story-progress-bar { grid-template-columns: 1fr; gap: 7px; }
  .story-progress-stat.is-align-end { justify-content: flex-start; text-align: right; flex-direction: row-reverse; }
  .story-progress-track { order: 3; }
  .story-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story-node { min-height: 166px; }
  .story-footer { gap: 8px; }
  .story-footer-note { margin-inline-start: 0; width: 100%; text-align: center; }
  .story-stage { padding: 12px; }
  .story-stage-content { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 0; width: min(560px, 94vw); max-height: calc(100svh - 22px); }
  .story-portrait-wrap { min-height: 0; height: clamp(150px, 27vh, 230px); flex: none; }
  .story-portrait { width: clamp(145px, 27vh, 210px); height: clamp(145px, 27vh, 210px); }
  .story-portrait-halo { width: 200px; height: 200px; bottom: 8%; }
  .story-portrait-ring { width: 190px; height: 190px; bottom: 4%; }
  .story-expression-chip { margin-top: -4px; }
  .story-dialogue-panel { border-radius: 20px; padding: 16px; min-height: 190px; }
  .story-dialogue-panel::before { display: none; }
  .story-dialogue-text { min-height: 64px; font-size: 15.5px; line-height: 1.95; }
  .story-dialogue-hint { display: none; }
  .story-dialogue-footer { justify-content: flex-end; padding-top: 8px; }
  .story-cinematic-hint { display: none; }
  .story-intro-title strong { font-size: clamp(34px, 10vw, 56px); }
  .story-ending-card { padding: 22px 16px; border-radius: 24px; }
  .ending-cats span { width: 43px; height: 43px; }
  .shadow-eye.eye-l { left: 29%; }
  .shadow-eye.eye-r { right: 29%; }
}
@media (max-width: 430px) {
  .story-banner { grid-template-columns: 90px minmax(0, 1fr); }
  .story-banner-art { height: 74px; }
  .story-banner-cat.sb1 { width: 47px; height: 47px; left: 21px; top: 12px; }
  .story-banner-cat.sb2 { width: 31px; height: 31px; left: 5px; top: 38px; }
  .story-banner-cat.sb3 { width: 32px; height: 32px; right: 5px; top: 37px; }
  .story-banner-cat.sb4 { width: 28px; height: 28px; right: 20px; top: 2px; }
  .story-node { min-height: 158px; padding: 9px 8px; }
  .story-node-avatar { width: 52px; height: 52px; }
  .story-node-title b { font-size: 12px; }
  .story-node-ability { font-size: 7.5px; padding: 2px 5px; }
  .story-dialogue-panel { min-height: 174px; }
  .story-speaker { font-size: 17px; }
  .story-dialogue-text { font-size: 14.5px; }
  .story-dialogue-actions .btn { padding: 8px 13px; font-size: 11px; }
  .story-dialogue-actions .subtle-btn { padding: 6px 8px; font-size: 9px; }
  .ending-actions .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .story-banner-glow, .story-globe-ring, .story-portrait, .story-portrait-halo, .story-portrait-ring,
  .story-sky-orb, .story-sky-star, .story-stage-sky, .shadow-eye, .shadow-mist, .freeze-crystal,
  .freeze-ring, .story-sky-star, .story-banner-star { animation: none !important; }
  .story-node, .story-banner, .story-dialogue-panel, .story-ending-card { transition: none !important; }
}
