@import url("https://fonts.googleapis.com/css2?family=Shippori+Mincho:wght@500;700&family=Syne:wght@700;800&family=Zen+Antique&display=swap");

:root {
  --void: #07040c;
  --ink: #fff4ea;
  --dim: #b7a4c6;
  --hot: #ff2d6a;
  --laser: #3dfff3;
  --gold: #ffc53d;
  --violet: #8b5cff;
  --vermillion: #c23b2e;
  --vermillion-deep: #6e1a14;
  --washi: #f2e4c9;
  --washi-ink: #1c120c;
  --lacquer: #2a1410;
  --yaw: 0deg;
  --pitch: 8deg;
  --punch: 0px;
  --parallax-x: 0px;
  --parallax-y: 0px;
  --heat: 0.08;
  --overdrive: 0;
  --serif-shrine: "Shippori Mincho", "Zen Antique", "Songti SC", "Noto Serif SC", serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Zen Antique", "Shippori Mincho", "PingFang SC", serif;
  background: var(--void);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.void { position: fixed; inset: 0; pointer-events: none; }

.lang-bar {
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: 70;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(7,4,12,.72);
  backdrop-filter: blur(10px);
}
.lang-btn {
  border: 0;
  min-width: 30px;
  height: 28px;
  padding: 0 7px;
  cursor: pointer;
  color: rgba(255,248,239,.62);
  background: transparent;
  font: 700 10px Syne, "PingFang SC", "PingFang TC", sans-serif;
  letter-spacing: .04em;
}
.lang-btn.active {
  color: #07040c;
  background: linear-gradient(180deg, #3dfff3, #7afff5);
  box-shadow: 0 0 14px rgba(61,255,243,.35);
}
.lang-btn:hover:not(.active) {
  color: #fff8ef;
  background: rgba(255,255,255,.08);
}
.nebula {
  position: absolute; inset: -20%;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(139, 92, 255, .35), transparent 42%),
    radial-gradient(ellipse at 18% 80%, rgba(255, 45, 106, .22), transparent 36%),
    radial-gradient(ellipse at 82% 70%, rgba(61, 255, 243, .12), transparent 32%),
    #07040c;
  transform: translate3d(var(--parallax-x), var(--parallax-y), 0) scale(1.08);
  transition: transform 120ms linear;
}
.lantern {
  position: absolute; width: 18vw; height: 18vw; border-radius: 50%;
  filter: blur(40px); opacity: .55;
}
.lantern.a { left: 8%; top: 22%; background: #ff2d6a; }
.lantern.b { right: 10%; top: 30%; background: #3dfff3; }
.fog {
  position: absolute; inset: auto 0 0;
  height: 34%;
  background: linear-gradient(transparent, rgba(7, 4, 12, .92));
}

.arena {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: start center;
  padding: 4px 0 8px;
  perspective: 1280px;
  perspective-origin: 50% 34%;
  overflow: hidden;
}
.fit-slot {
  width: min(720px, 98vw);
  overflow: hidden;
  display: flex;
  justify-content: center;
}
.fit-shell {
  width: min(680px, 96vw);
  transform-origin: top center;
  will-change: transform;
}

.cabinet {
  width: 100%;
  transform-style: preserve-3d;
  transform:
    rotateX(var(--pitch))
    rotateY(var(--yaw))
    translateZ(var(--punch));
  filter: drop-shadow(0 48px 42px rgba(0, 0, 0, .78));
  transition: transform 70ms linear;
  will-change: transform;
}
.cabinet::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -36px;
  height: 28px;
  background: radial-gradient(ellipse, rgba(0, 0, 0, .62), transparent 72%);
  transform: rotateX(90deg) translateZ(-8px);
  pointer-events: none;
}

.cabinet.shake { animation: slam .28s; }

.marquee {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 16px 8px;
  background: linear-gradient(#1a1028, #0c0814);
  border: 1px solid rgba(255, 255, 255, .12);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  transform: translateZ(56px);
}
.marquee i {
  width: 14px; height: 14px;
  border: 2px solid var(--hot);
  transform: rotate(45deg);
  box-shadow: 0 0 16px var(--hot);
}
.marquee small {
  display: block;
  font-size: 8px;
  letter-spacing: .22em;
  color: var(--dim);
}
.marquee b {
  font-family: Syne, sans-serif;
  font-size: 22px;
  letter-spacing: .04em;
  line-height: 1;
}
.marquee em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-size: 10px;
  letter-spacing: .08em;
  color: color-mix(in srgb, var(--theme-a, #3dfff3) 78%, #fff);
  opacity: .88;
}
.marquee span {
  font-size: 9px;
  letter-spacing: .16em;
  color: var(--laser);
  text-shadow: 0 0 12px var(--laser);
}

.hood {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .08), transparent 18%),
    linear-gradient(90deg, #140b1f, #09060f 12%, #09060f 88%, #140b1f);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 0 0 28px 28px;
  padding: 8px 8px 0;
  transform: translateZ(28px);
  box-shadow:
    inset 0 0 40px rgba(139, 92, 255, .18),
    0 0 80px rgba(255, 45, 106, calc(var(--overdrive) * .28));
  transform-style: preserve-3d;
}
.hood::before,.hood::after{ display: none; }

.play-bay {
  display: grid;
  grid-template-columns: minmax(88px, 118px) minmax(0, 1fr) minmax(88px, 118px);
  gap: 6px;
  align-items: stretch;
}
.side-rail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  z-index: 4;
}
.side-rail .side-plate {
  width: 100%;
  pointer-events: auto;
}
.left-rail .mission {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.left-rail .mission .ema-head { margin-bottom: 0; }
.left-rail .mission b {
  font-size: 11px;
  line-height: 1.3;
  flex: 1;
}
.right-rail .run-summary {
  flex: 1;
  min-height: 0;
}
.right-rail .stat-row {
  grid-template-columns: 1fr;
  gap: 4px;
}
.right-rail .stat-row > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  text-align: left;
  padding: 2px 0;
  border-bottom: 1px solid rgba(194,59,46,.28);
}
.right-rail .stat-row span {
  display: inline;
  margin: 0;
}
.right-rail .action-row {
  grid-template-columns: 1fr;
}
.right-rail .callout {
  position: relative;
  left: auto; right: auto; bottom: auto;
  max-width: none;
  margin-top: auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 8px;
  clip-path: polygon(0 0, 100% 0, 100% 90%, 88% 100%, 0 100%);
}
.right-rail .callout-meta p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.35;
}

.glass {
  position: relative;
  border-radius: 14px 14px 6px 6px;
  overflow: hidden;
  transform: translateZ(64px) rotateX(-6deg);
  transform-origin: 50% 100%;
  box-shadow:
    inset 0 0 40px #000,
    0 18px 40px rgba(0, 0, 0, .45),
    0 0 0 1px rgba(255, 255, 255, .18);
  isolation: isolate;
  min-width: 0;
}
.glass::after{content:"";position:absolute;inset:0;z-index:5;pointer-events:none;background:linear-gradient(118deg,rgba(255,255,255,.12),transparent 18%,transparent 67%,rgba(61,255,243,.035));mix-blend-mode:screen}

#game {
  display: block;
  width: 100%;
  aspect-ratio: 420 / 640;
  background: #050309;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.scan, .heat-veil {
  position: absolute; inset: 0; pointer-events: none;
}
.scan {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, .035) 0 1px,
    transparent 1px 4px
  );
  mix-blend-mode: overlay;
  opacity: .35;
}
.heat-veil {
  box-shadow: inset 0 0 80px rgba(255, 45, 106, calc(var(--heat) * .85));
}

.nudge-controls {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}
.nudge-controls button, .phi, .side-rail button { pointer-events: auto; }

#personaBody.persona-empty { display: none; }

/* Shared ofuda / info-seal plates */
.phi, .seed, .mult, .chain-col, .heat-col {
  position: relative;
  color: #f6e8c8;
  background:
    radial-gradient(circle at 18% 0%, rgba(255,197,61,.14), transparent 42%),
    linear-gradient(165deg, rgba(22,12,14,.88), rgba(6,3,8,.9));
  border: 1px solid rgba(194,59,46,.45);
  box-shadow: 0 8px 18px rgba(0,0,0,.4), inset 0 0 28px rgba(194,59,46,.06);
  clip-path: polygon(6% 0, 94% 0, 100% 14%, 100% 86%, 90% 100%, 10% 100%, 0 86%, 0 14%);
  padding: 8px 8px 10px;
}
.phi small, .seed small, .mult small, .chain-col small, .heat-col small {
  display: block;
  font-size: 8px;
  letter-spacing: .16em;
  color: #f0c3a0;
  font-family: Syne, sans-serif;
}
.phi b, .seed b, .mult b, .chain-col b, .heat-col b {
  font-family: var(--serif-shrine);
  font-size: 16px;
  letter-spacing: .04em;
  color: #fff4e4;
  text-shadow: 0 0 12px rgba(255,197,61,.2);
}
.phi {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 4px;
  cursor: pointer;
  border-color: rgba(255,197,61,.45);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.phi::after {
  content: "庫";
  position: absolute;
  right: 6px;
  top: 4px;
  font: 700 9px var(--serif-shrine);
  color: rgba(255,197,61,.45);
}
.seed::after { content: "種"; position: absolute; right: 6px; top: 4px; font: 700 9px var(--serif-shrine); color: rgba(194,59,46,.45); }
.mult::after { content: "倍"; position: absolute; right: 6px; top: 4px; font: 700 9px var(--serif-shrine); color: rgba(61,255,243,.4); }
.phi.score-pulse {
  animation: vaultPulse .55s ease-out;
  filter: brightness(1.35);
  box-shadow: 0 0 26px rgba(255,197,61,.45);
}
.phi:disabled { opacity: .45; cursor: default; }
.phi i { color: #ffc53d; font-style: normal; font-size: 11px; text-shadow: 0 0 8px rgba(255,197,61,.5); }

.chain-col, .heat-col {
  text-align: left;
}
.chain-col::after { content: "共"; position: absolute; right: 5px; top: 4px; font: 700 9px var(--serif-shrine); color: rgba(255,197,61,.4); }
.heat-col::after { content: "灵"; position: absolute; right: 5px; top: 4px; font: 700 9px var(--serif-shrine); color: rgba(194,59,46,.45); }
#chainTrack { display: flex; flex-direction: column-reverse; gap: 3px; margin-top: 6px; }
#chainTrack i {
  display: block; height: 7px;
  background: rgba(255, 255, 255, .08);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 8% 100%);
}
#chainTrack i.on {
  background: linear-gradient(90deg, #c23b2e, #ffc53d);
  box-shadow: 0 0 10px rgba(255,197,61,.45);
}
.heat-bar {
  height: 8px; width: 100%; margin: 6px 0 0;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(194,59,46,.3);
  clip-path: polygon(0 0, 100% 0, 98% 100%, 2% 100%);
}
.heat-bar i {
  display: block; height: 100%; width: 8%;
  background: linear-gradient(90deg, #c23b2e, #ffc53d);
  box-shadow: 0 0 12px rgba(194,59,46,.55);
}

.score-banner {
  position: absolute;
  left: 50%;
  top: 11%;
  transform: translate(-50%, 0);
  z-index: 8;
  width: min(78%, 300px);
  padding: 0;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
.score-banner .conjure-beam {
  position: absolute;
  left: 50%;
  top: -42vh;
  width: 2px;
  height: 0;
  margin-left: -1px;
  background: linear-gradient(180deg, transparent, #ffc53d, #c23b2e, transparent);
  box-shadow: 0 0 18px #ffc53d, 0 0 40px rgba(194,59,46,.55);
  opacity: 0;
  pointer-events: none;
}
.score-banner .talisman-sheet {
  position: relative;
  margin: 0 auto;
  padding: 18px 20px 28px;
  color: #f6e8c8;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,197,61,.18), transparent 42%),
    linear-gradient(165deg, rgba(18,10,12,.82), rgba(6,3,8,.88));
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  border: 1px solid rgba(194,59,46,.55);
  box-shadow:
    0 24px 50px rgba(0,0,0,.55),
    inset 0 0 0 1px rgba(242,228,201,.08),
    inset 0 0 60px rgba(194,59,46,.08);
  /* Hex-bevel top + swallowtail bottom */
  clip-path: polygon(
    8% 0, 92% 0,
    100% 10%, 100% 86%,
    92% 100%, 78% 92%, 50% 100%, 22% 92%, 8% 100%,
    0 86%, 0 10%
  );
  transform: scaleY(0.08);
  transform-origin: top center;
  opacity: 0;
  overflow: hidden;
}
.score-banner .talisman-circuit {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255,197,61,.18);
  clip-path: inherit;
  opacity: .7;
  background:
    repeating-linear-gradient(90deg, transparent 0 14px, rgba(194,59,46,.12) 14px 15px),
    repeating-linear-gradient(0deg, transparent 0 16px, rgba(61,255,243,.06) 16px 17px);
  animation: circuitPulse 2.4s linear infinite;
  pointer-events: none;
}
@keyframes circuitPulse {
  to { background-position: 30px 24px; }
}
.score-banner .talisman-crest {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: #ff6b5a;
  text-shadow: 0 0 12px rgba(194,59,46,.8);
}
.score-banner .crest-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid rgba(255,197,61,.65);
  border-radius: 50%;
  font: 700 13px var(--serif-shrine);
  color: #ffc53d;
  box-shadow: 0 0 16px rgba(255,197,61,.35);
}
.score-banner .bagua { font-size: 14px; opacity: .85; }
.score-banner .shrine-seal {
  position: absolute;
  right: 16px;
  bottom: 22px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 2px solid rgba(194,59,46,.75);
  border-radius: 50%;
  color: #ff6b5a;
  font: 700 14px var(--serif-shrine);
  opacity: .8;
  transform: rotate(-14deg);
  z-index: 1;
}
.score-banner .swallow-cut {
  display: none;
}
.score-banner small,
.score-banner b,
.score-banner span {
  position: relative;
  z-index: 1;
}
.score-banner small {
  display: block;
  font: 700 10px Syne, var(--serif-shrine), sans-serif;
  letter-spacing: .34em;
  color: #ffc53d;
  text-shadow: 0 0 10px rgba(255,197,61,.45);
}
.score-banner b {
  display: block;
  margin-top: 8px;
  font: 700 24px var(--serif-shrine);
  letter-spacing: .16em;
  color: #fff4e4;
  text-shadow: 0 0 18px rgba(255,197,61,.28);
}
.score-banner span#bannerSub {
  display: block;
  margin-top: 10px;
  padding: 0 12px;
  font: 500 13px var(--serif-shrine);
  letter-spacing: .06em;
  line-height: 1.55;
  color: rgba(242,228,201,.82);
}
.score-banner.show { opacity: 1; }
.score-banner.show .conjure-beam {
  animation: beamStrike .55s ease-out forwards;
}
.score-banner.show .talisman-sheet {
  animation: talismanUnfold .72s cubic-bezier(.2,.85,.25,1) forwards;
}
.score-banner.hot .talisman-sheet {
  border-color: rgba(255,80,90,.7);
  box-shadow: 0 24px 50px rgba(0,0,0,.55), 0 0 40px rgba(194,59,46,.28), inset 0 0 50px rgba(194,59,46,.12);
}
.score-banner.rift .talisman-sheet {
  border-color: rgba(61,255,243,.55);
  box-shadow: 0 24px 50px rgba(0,0,0,.55), 0 0 40px rgba(61,255,243,.22), inset 0 0 50px rgba(61,255,243,.08);
}
.score-banner.rift small { color: #9ef7ef; }
@keyframes beamStrike {
  0% { opacity: 0; height: 0; }
  25% { opacity: 1; height: 48vh; }
  70% { opacity: .85; height: 48vh; }
  100% { opacity: 0; height: 48vh; }
}
@keyframes talismanUnfold {
  0% { opacity: 0; transform: scaleY(0.06); filter: brightness(2.2); }
  35% { opacity: 1; transform: scaleY(1.04); filter: brightness(1.35); }
  100% { opacity: 1; transform: scaleY(1); filter: brightness(1); }
}

.chain-col, .heat-col { /* side-rail plates — no absolute overlay */ }

.callout {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 12px 10px 8px;
  background: linear-gradient(145deg, rgba(62,28,18,.92), rgba(18,8,10,.88));
  border: 1px solid rgba(194,59,46,.45);
  box-shadow: 0 12px 28px rgba(0,0,0,.45), inset 0 0 0 1px rgba(242,228,201,.08);
  clip-path: polygon(0 0, 100% 0, 100% 86%, 94% 100%, 0 100%);
}
.callout::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(242,228,201,.18);
  pointer-events: none;
}
#mascotFace, .bun-face {
  width: 34px; height: 34px; display: grid; place-items: center;
  color: var(--washi);
  font-size: 16px;
  font-family: var(--serif-shrine);
  background: radial-gradient(circle at 35% 30%, #d25548, var(--vermillion-deep));
  border: 1px solid rgba(242,228,201,.45);
  border-radius: 50% 50% 42% 42%;
  filter: drop-shadow(0 0 10px rgba(194,59,46,.55));
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}
#mascotFace.excited { transform: scale(1.18) rotate(-6deg); }
.callout-meta { min-width: 0; position: relative; z-index: 1; }
.callout-meta small {
  display: block;
  font-size: 9px;
  letter-spacing: .18em;
  color: #f0c3a0;
  margin-bottom: 2px;
  font-family: Syne, sans-serif;
}
.callout p {
  margin: 0;
  font-size: 12px;
  color: var(--washi);
  text-shadow: 0 2px 12px #000;
  line-height: 1.4;
  font-family: var(--serif-shrine);
}

.nudge-controls {
  inset: auto 10px 22%;
  display: flex; justify-content: space-between;
  pointer-events: none;
}
.nudge-controls button {
  position: relative;
  width: 76px;
  height: 76px;
  border: none;
  cursor: pointer;
  pointer-events: auto;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  transform: translateY(0);
  transition: transform 70ms, filter 70ms;
  overflow: visible;
}
.nudge-controls button::before { display: none; }

/* Shared taiji seal plate */
.flipper-control .taiji-glyph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.55));
}
.flipper-control .fish-path {
  fill: #12080c;
  stroke-width: 2.2;
  stroke-linejoin: round;
}
.flipper-control .eye { stroke: rgba(255,255,255,.35); stroke-width: 1; }
.flipper-control .key {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  z-index: 2;
  font: 800 15px Syne, sans-serif;
  letter-spacing: .14em;
  text-shadow: 0 2px 10px rgba(0,0,0,.65);
}
.flipper-control .god-mark {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 2;
  font: 700 12px var(--serif-shrine);
  letter-spacing: .2em;
  font-style: normal;
  opacity: .92;
}

/* 左阳 · vermillion / gold sun path */
.flipper-control.yang {
  transform: rotate(-6deg);
  color: #ffd27a;
}
.flipper-control.yang .fish-path {
  fill: url(#none);
  fill: #6e1a14;
  stroke: #ffc53d;
  filter: drop-shadow(0 0 10px rgba(255,197,61,.45));
  animation: yangPulse 2.8s ease-in-out infinite;
}
.flipper-control.yang .yin-eye { fill: #0a0608; }
.flipper-control.yang .god-mark { color: #ffc53d; text-shadow: 0 0 12px rgba(255,197,61,.55); }
.flipper-control.yang .key { color: #fff4e0; }
.flipper-control.yang::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px dashed rgba(255,197,61,.35);
  animation: orbitDash 8s linear infinite;
  pointer-events: none;
}

/* 右阴 · cyan / moon path */
.flipper-control.yin {
  transform: rotate(6deg);
  color: #9ef0e8;
}
.flipper-control.yin .fish-path {
  fill: #0a1c22;
  stroke: #3dfff3;
  filter: drop-shadow(0 0 10px rgba(61,255,243,.4));
  animation: yinPulse 2.8s ease-in-out infinite;
}
.flipper-control.yin .yang-eye { fill: #f6efd8; }
.flipper-control.yin .god-mark { color: #9ef0e8; text-shadow: 0 0 12px rgba(61,255,243,.5); }
.flipper-control.yin .key { color: #e8fffc; }
.flipper-control.yin::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px dashed rgba(61,255,243,.32);
  animation: orbitDash 8s linear infinite reverse;
  pointer-events: none;
}

.nudge-controls button.pressed.yang {
  transform: rotate(-6deg) translateY(4px) scale(.94);
  filter: brightness(1.35);
}
.nudge-controls button.pressed.yin {
  transform: rotate(6deg) translateY(4px) scale(.94);
  filter: brightness(1.35);
}
@keyframes yangPulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(255,197,61,.35)); }
  50% { filter: drop-shadow(0 0 16px rgba(255,197,61,.7)); }
}
@keyframes yinPulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(61,255,243,.3)); }
  50% { filter: drop-shadow(0 0 16px rgba(61,255,243,.65)); }
}
@keyframes orbitDash {
  to { transform: rotate(360deg); }
}

.flipper-control i { display: none; }
.flipper-control span.key {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  z-index: 2;
  font: 800 15px Syne, sans-serif;
  letter-spacing: .14em;
}

.console {
  display: grid;
  grid-template-columns: 88px 1fr 88px;
  gap: 8px;
  padding: 12px 10px 14px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,197,61,.08), transparent 45%),
    linear-gradient(180deg, #1a100e, #0a0608);
  border-radius: 0 0 18px 18px;
  transform: rotateX(26deg) translateZ(40px);
  transform-origin: top;
  box-shadow: 0 18px 28px rgba(0,0,0,.5), inset 0 0 40px rgba(194,59,46,.06);
  border: 1px solid rgba(194,59,46,.35);
  border-top-color: rgba(255,197,61,.2);
}
.mode, .launch-btn, .phi, .nudge-controls button, #shareBtn {
  font-family: inherit;
}
.mode {
  border: 1px solid rgba(194,59,46,.4);
  background: linear-gradient(165deg, rgba(28,14,16,.92), rgba(8,4,8,.95));
  color: #f6e8c8;
  cursor: pointer;
  padding: 8px 6px;
  clip-path: polygon(8% 0, 92% 0, 100% 16%, 100% 84%, 92% 100%, 8% 100%, 0 84%, 0 16%);
}
.mode small { display: block; font-size: 10px; color: #d7b59a; letter-spacing: .12em; }
.mode b { font-family: var(--serif-shrine); font-size: 12px; letter-spacing: .08em; }
.mode.active {
  border-color: rgba(255,197,61,.65);
  box-shadow: inset 0 0 18px rgba(194,59,46,.28), 0 0 16px rgba(255,197,61,.15);
  color: #ffc53d;
}
.cannon { display: grid; gap: 4px; }
.power-copy { display: flex; justify-content: space-between; font-size: 10px; color: #d7b59a; letter-spacing: .1em; }
.power-copy b { color: #ffc53d; font-family: var(--serif-shrine); }
.power-meter {
  height: 6px;
  background: #1a100e;
  overflow: hidden;
  border: 1px solid rgba(194,59,46,.35);
  clip-path: polygon(0 0, 100% 0, 98% 100%, 2% 100%);
}
#powerFill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #3dfff3, #c23b2e, #ffc53d);
  box-shadow: 0 0 12px rgba(255,197,61,.45);
}
.launch-btn {
  height: 56px;
  min-height: 48px;
  border: 1px solid rgba(255,197,61,.45);
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,197,61,.25), transparent 55%),
    linear-gradient(180deg, #c23b2e, #6e1a14);
  color: #fff4e4;
  box-shadow: 0 10px 24px rgba(194,59,46,.35);
  clip-path: polygon(4% 0, 96% 0, 100% 22%, 100% 78%, 96% 100%, 4% 100%, 0 78%, 0 22%);
  font-family: var(--serif-shrine);
}
.launch-btn span { display: block; font-family: var(--serif-shrine); font-size: 18px; letter-spacing: .16em; }
.launch-btn i { display: block; font-size: 9px; font-style: normal; opacity: .8; letter-spacing: .12em; }
.launch-btn.charging { filter: brightness(1.35) saturate(1.15); transform: scale(.98); }

/* Bottom dock — persona only; mission/ledger live in side rails */
.dock {
  position: relative;
  width: 100%;
  margin: 8px auto 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 6;
  pointer-events: none;
}
.dock > * { pointer-events: auto; }
.dock-planks { display: contents; }
.ema-plaque {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 12px 14px 14px;
  color: #f3e2c4;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255,197,61,.14), transparent 48%),
    repeating-linear-gradient(
      92deg,
      rgba(92,48,28,.0) 0 7px,
      rgba(194,59,46,.045) 7px 8px
    ),
    linear-gradient(165deg, rgba(62,32,20,.94), rgba(18,8,10,.96) 55%, rgba(8,4,6,.98));
  border: 1px solid rgba(194,59,46,.55);
  box-shadow:
    0 14px 28px rgba(0,0,0,.45),
    inset 0 0 0 1px rgba(242,228,201,.08),
    inset 0 -18px 36px rgba(0,0,0,.28);
  clip-path: polygon(0 0, 100% 0, 100% 88%, 94% 100%, 6% 100%, 0 88%);
}
.ema-plaque::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255,197,61,.18);
  clip-path: polygon(0 0, 100% 0, 100% 90%, 96% 100%, 4% 100%, 0 90%);
  pointer-events: none;
  z-index: 0;
}
.ema-plaque::after {
  content: "奉";
  position: absolute;
  right: 10px;
  bottom: 8px;
  font: 700 22px var(--serif-shrine);
  color: rgba(194,59,46,.22);
  letter-spacing: .18em;
  pointer-events: none;
  z-index: 0;
}
.ema-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ema-rail {
  width: 3px;
  height: 14px;
  background: linear-gradient(180deg, var(--gold), var(--vermillion));
  box-shadow: 0 0 8px rgba(194,59,46,.45);
  flex: 0 0 auto;
}
.ema-head small {
  flex: 1;
  font-size: 9px;
  letter-spacing: .22em;
  color: #f0c3a0;
  font-family: Syne, sans-serif;
}
.ema-seal {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(194,59,46,.7);
  color: #ffc53d;
  font: 700 11px var(--serif-shrine);
  background: rgba(194,59,46,.18);
  box-shadow: inset 0 0 10px rgba(194,59,46,.25);
}
.mission {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: end;
}
.left-rail .mission {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.left-rail .mission .ema-head { grid-column: auto; }
.left-rail .mission .challenge-progress { grid-column: auto; }
.left-rail .mission strong {
  align-self: flex-end;
  font-size: 11px;
}
.mission .ema-head { grid-column: 1 / -1; margin-bottom: 2px; }
.mission b {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 14px;
  line-height: 1.35;
  font-family: var(--serif-shrine);
  color: var(--washi);
  letter-spacing: .04em;
}
.mission strong {
  position: relative;
  z-index: 1;
  font-family: Syne, sans-serif;
  font-size: 13px;
  color: var(--gold);
  letter-spacing: .06em;
}
.challenge-progress {
  grid-column: 1 / -1;
  height: 4px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(194,59,46,.25);
  clip-path: polygon(0 0, 100% 0, 98% 100%, 2% 100%);
}
.challenge-progress div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--vermillion), var(--gold));
  box-shadow: 0 0 10px rgba(255,197,61,.35);
}
.run-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.stat-row > div {
  text-align: center;
  padding: 4px 2px 6px;
  border-bottom: 1px solid rgba(194,59,46,.28);
}
.run-summary span {
  display: block;
  font-size: 8px;
  color: #d7b59a;
  letter-spacing: .14em;
  margin-bottom: 2px;
}
.run-summary b {
  font-family: Syne, sans-serif;
  color: var(--washi);
  font-size: 15px;
}
.action-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#shareBtn, #shrineBtn {
  border: 1px solid rgba(242,228,201,.4);
  background:
    linear-gradient(180deg, rgba(194,59,46,.32), rgba(20,8,10,.55));
  color: var(--washi);
  cursor: pointer;
  padding: 9px 8px;
  font-family: var(--serif-shrine);
  letter-spacing: .12em;
  clip-path: polygon(6% 0, 94% 0, 100% 18%, 100% 82%, 94% 100%, 6% 100%, 0 82%, 0 18%);
}
#shareBtn:active, #shrineBtn:active {
  filter: brightness(1.12);
}
.persona-plaque {
  color: #e8d5b8;
  line-height: 1.55;
  font-size: 13px;
  font-family: var(--serif-shrine);
  letter-spacing: .03em;
}
.persona-name {
  color: #ffd7a8;
  font-weight: 700;
  font-family: var(--serif-shrine);
  letter-spacing: .08em;
  margin-bottom: 4px;
}
.persona-stats { display: none; }

.stage {
  position: fixed; inset: 0; z-index: 50;
  display: none; place-items: center;
  background: radial-gradient(circle at 50% 40%, #5a1840, #07040c 62%);
  opacity: 0;
}
.stage.show {
  display: grid;
  animation: stageInOut 1.75s ease-in-out forwards;
}
@keyframes stageInOut {
  0% { opacity: 0; }
  12% { opacity: 1; }
  72% { opacity: 1; }
  100% { opacity: 0; }
}
.stage-content { text-align: center; transform: translateZ(80px); }
.stage-code { letter-spacing: .3em; color: var(--laser); font-size: 11px; }
.stage-bunny {
  font-size: 92px; color: var(--hot); font-family: Syne, sans-serif;
  filter: drop-shadow(0 0 40px var(--hot));
  animation: pulse 0.7s infinite alternate;
}
.stage-title { font-family: var(--serif-shrine); font-size: 52px; letter-spacing: .14em; color: var(--washi); }
.stage-sub { color: #e8d5b8; max-width: 28ch; margin: 0 auto; line-height: 1.45; font-family: var(--serif-shrine); }
.continue-hint { margin-top: 16px; font-size: 11px; color: var(--dim); letter-spacing: .18em; }

.toast {
  position: fixed; z-index: 60; left: 50%; bottom: 96px;
  transform: translate(-50%, 16px);
  opacity: 0;
  min-width: 180px;
  max-width: min(82vw, 340px);
  padding: 14px 22px 20px;
  color: #f6e8c8;
  font-family: var(--serif-shrine);
  font-size: 14px;
  letter-spacing: .08em;
  text-align: center;
  line-height: 1.45;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,197,61,.16), transparent 45%),
    linear-gradient(165deg, rgba(18,10,12,.88), rgba(6,3,8,.92));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(194,59,46,.55);
  box-shadow: 0 18px 40px rgba(0,0,0,.5), inset 0 0 40px rgba(194,59,46,.08);
  clip-path: polygon(6% 0, 94% 0, 100% 12%, 100% 84%, 90% 100%, 50% 92%, 10% 100%, 0 84%, 0 12%);
  transition: opacity .22s, transform .28s;
}
.toast::before {
  content: "示";
  position: absolute;
  left: 10px; top: 8px;
  font-size: 10px;
  color: rgba(255,197,61,.65);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); animation: talismanUnfold .55s ease-out; }
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.float-num {
  position: absolute;
  font-family: var(--serif-shrine);
  font-size: 20px;
  letter-spacing: .08em;
  animation: rise 1s forwards;
  text-shadow: 0 0 16px currentColor;
}

@keyframes slam {
  20% { transform: rotateX(var(--pitch)) rotateY(var(--yaw)) translate3d(-7px, 6px, var(--punch)); }
  55% { transform: rotateX(var(--pitch)) rotateY(var(--yaw)) translate3d(8px, -4px, var(--punch)); }
}
@keyframes pulse { to { transform: scale(1.12) rotate(6deg); } }
@keyframes rise { to { opacity: 0; transform: translateY(-72px); } }
@keyframes vaultPulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@media (max-width: 1024px), (pointer: coarse), (hover: none) {
  html, body { height: 100%; height: 100dvh; overflow: hidden; }
  body.night { overscroll-behavior: none; }
  .lang-bar {
    top: 4px; right: 4px; gap: 2px; padding: 2px;
    border-color: rgba(194,59,46,.4);
    background: rgba(7,4,12,.8);
  }
  .void .lantern {
    display: block;
    opacity: .42;
    filter: blur(28px);
  }
  .void .fog { display: block; height: 28%; }
  .nebula {
    background:
      radial-gradient(ellipse at 50% 12%, rgba(194,59,46,.28), transparent 38%),
      radial-gradient(ellipse at 18% 78%, rgba(255,197,61,.16), transparent 34%),
      radial-gradient(ellipse at 82% 70%, rgba(61,255,243,.14), transparent 32%),
      radial-gradient(ellipse at 50% 40%, rgba(139,92,255,.18), transparent 45%),
      #07040c;
  }
  .arena {
    height: 100dvh;
    max-height: 100dvh;
    padding: 0;
    perspective: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .fit-slot,
  .fit-shell {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
  }
  .cabinet {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    filter: drop-shadow(0 18px 24px rgba(0,0,0,.55));
    transform: none !important;
    transition: none;
  }
  .cabinet::after { display: none; }
  .marquee {
    flex: 0 0 auto;
    padding: 6px 12px 5px;
    border-radius: 14px 14px 0 0;
    transform: none;
    gap: 8px;
    background:
      linear-gradient(180deg, rgba(194,59,46,.18), transparent 70%),
      linear-gradient(#1a1028, #0c0814);
    border-color: rgba(194,59,46,.35);
  }
  .marquee b { font-size: 15px; letter-spacing: .08em; }
  .marquee small {
    display: block;
    font-size: 8px;
    letter-spacing: .18em;
    color: #f0c3a0;
  }
  .marquee em {
    display: block;
    margin-top: 2px;
    font-size: 9px;
    letter-spacing: .06em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 52vw;
  }
  .marquee #runState {
    font-size: 9px;
    color: #ffc53d;
    text-shadow: 0 0 10px rgba(255,197,61,.35);
  }
  .hood {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 4px;
    border-radius: 0;
    transform: none;
    background:
      linear-gradient(180deg, rgba(255,197,61,.06), transparent 22%),
      linear-gradient(90deg, #140b1f, #09060f 10%, #09060f 90%, #140b1f);
    box-shadow: inset 0 0 40px rgba(194,59,46,.12);
  }
  .hood::before, .hood::after { display: none; }
  .play-bay {
    flex: 1;
    min-height: 0;
    height: 100%;
    grid-template-columns: minmax(70px, 84px) minmax(0, 1fr) minmax(70px, 84px);
    gap: 5px;
  }
  .side-rail { gap: 5px; min-height: 0; overflow: hidden; }
  .glass {
    transform: none;
    border-radius: 10px;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-shadow:
      inset 0 0 36px #000,
      0 0 0 1px rgba(255,197,61,.18),
      0 0 28px rgba(194,59,46,.18);
  }
  #game {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
    max-height: none;
  }
  .phi, .seed, .mult, .chain-col, .heat-col {
    padding: 6px 7px 8px;
    background:
      radial-gradient(circle at 18% 0%, rgba(255,197,61,.18), transparent 42%),
      linear-gradient(165deg, rgba(42,18,16,.94), rgba(8,4,8,.96));
    border-color: rgba(194,59,46,.55);
    box-shadow: 0 8px 16px rgba(0,0,0,.4), inset 0 0 20px rgba(194,59,46,.08);
  }
  .phi b, .seed b, .mult b, .chain-col b, .heat-col b { font-size: 14px; }
  .right-rail .callout {
    display: flex;
    padding: 6px 7px;
    background: linear-gradient(145deg, rgba(72,32,20,.95), rgba(18,8,10,.92));
    border-color: rgba(194,59,46,.55);
  }
  .right-rail .callout-meta p {
    -webkit-line-clamp: 2;
    font-size: 9px;
  }
  .bun-face {
    width: 30px; height: 30px; font-size: 17px;
    filter: drop-shadow(0 0 8px rgba(194,59,46,.55));
  }

  .nudge-controls {
    inset: auto 2px 21%;
    padding: 0;
  }
  .nudge-controls button {
    width: 66px;
    height: 66px;
  }
  .flipper-control .taiji-glyph {
    filter: drop-shadow(0 8px 14px rgba(0,0,0,.5));
  }
  .flipper-control.yang .fish-path {
    filter: drop-shadow(0 0 8px rgba(255,197,61,.5));
    animation: yangPulse 2.8s ease-in-out infinite;
  }
  .flipper-control.yin .fish-path {
    filter: drop-shadow(0 0 8px rgba(61,255,243,.45));
    animation: yinPulse 2.8s ease-in-out infinite;
  }
  .console {
    flex: 0 0 auto;
    transform: none;
    padding: 7px 8px 9px;
    gap: 6px;
    grid-template-columns: 64px 1fr 64px;
    border-radius: 0 0 14px 14px;
    background:
      radial-gradient(circle at 50% 0%, rgba(255,197,61,.12), transparent 45%),
      linear-gradient(180deg, #1a100e, #0a0608);
    border-color: rgba(194,59,46,.45);
  }
  .mode { padding: 5px 2px; border-color: rgba(194,59,46,.5); }
  .mode.active {
    border-color: rgba(255,197,61,.7);
    box-shadow: inset 0 0 16px rgba(194,59,46,.3), 0 0 12px rgba(255,197,61,.2);
  }
  .mode b { font-size: 10px; }
  .launch-btn {
    height: 50px;
    box-shadow: 0 10px 22px rgba(194,59,46,.4), 0 0 16px rgba(255,197,61,.15);
  }
  .launch-btn span { font-size: 16px; letter-spacing: .14em; }
  .launch-btn i { font-size: 8px; }
  .dock {
    flex: 0 0 auto;
    width: 100%;
    margin: 4px 0 0;
    gap: 4px;
    padding: 0 4px 6px;
  }
  .ema-plaque {
    padding: 7px 8px 8px;
    background:
      radial-gradient(ellipse at 50% -10%, rgba(255,197,61,.16), transparent 48%),
      repeating-linear-gradient(92deg, rgba(92,48,28,.0) 0 7px, rgba(194,59,46,.07) 7px 8px),
      linear-gradient(165deg, rgba(72,36,22,.96), rgba(18,8,10,.97) 55%, rgba(8,4,6,.98));
    border-color: rgba(194,59,46,.65);
    box-shadow: 0 8px 18px rgba(0,0,0,.45), inset 0 0 0 1px rgba(242,228,201,.1);
  }
  .ema-plaque::before { inset: 3px; border-color: rgba(255,197,61,.28); }
  .ema-plaque::after { font-size: 16px; color: rgba(194,59,46,.35); }
  .ema-head { margin-bottom: 3px; gap: 4px; }
  .ema-seal {
    width: 18px; height: 18px; font-size: 9px;
    box-shadow: 0 0 10px rgba(194,59,46,.35);
  }
  .left-rail .mission b { font-size: 10px; }
  .mission strong { font-size: 10px; color: #ffc53d; }
  .run-summary { gap: 5px; }
  .stat-row b { font-size: 12px; }
  .action-row { gap: 4px; }
  #shareBtn, #shrineBtn {
    padding: 6px 4px;
    font-size: 10px;
    border-color: rgba(255,197,61,.4);
    background: linear-gradient(180deg, rgba(194,59,46,.4), rgba(20,8,10,.55));
  }
  .persona-plaque:not(.persona-empty) {
    padding: 6px 8px;
    font-size: 11px;
    line-height: 1.35;
  }
  .toast { backdrop-filter: blur(8px); bottom: 72px; }
}

/* Short phones: still fancy, tighter chrome */
@media (max-width: 1024px) and (max-height: 740px), (pointer: coarse) and (max-height: 740px) {
  .play-bay {
    grid-template-columns: minmax(64px, 74px) minmax(0, 1fr) minmax(64px, 74px);
    gap: 4px;
  }
  .nudge-controls { inset: auto 1px 19%; }
  .nudge-controls button { width: 58px; height: 58px; }
  .launch-btn { height: 46px; }
  .right-rail .callout-meta p { -webkit-line-clamp: 1; }
  .marquee em { display: none; }
  .dock { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .cabinet { transform: none; }
}

/* ===== ECMG: ritual, boons, shrine album, sanctuary card ===== */
.ritual-veil {
  position: fixed; inset: 0; pointer-events: none; z-index: 25;
  background: radial-gradient(ellipse at 50% 70%, transparent 20%, rgba(0,0,0,.72) 100%);
  opacity: 0; transition: opacity .45s ease;
}
.ritual-veil.on { opacity: 1; }
.launch-ripple {
  position: fixed; left: 50%; top: 62%; width: 24px; height: 24px; margin: -12px;
  border-radius: 50%; border: 2px solid var(--theme-a, #3dfff3);
  pointer-events: none; z-index: 26; opacity: 0; transform: scale(.2);
}
.launch-ripple.burst {
  animation: rippleBurst .9s ease-out forwards;
}
@keyframes rippleBurst {
  0% { opacity: .9; transform: scale(.2); }
  100% { opacity: 0; transform: scale(18); }
}
#launchBtn.charging {
  box-shadow: 0 0 0 0 var(--theme-a, #3dfff3);
  animation: ritualPulse 1.1s ease-out infinite;
}
@keyframes ritualPulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--theme-a, #3dfff3) 55%, transparent); filter: brightness(1); }
  70% { box-shadow: 0 0 36px 10px color-mix(in srgb, var(--theme-a, #3dfff3) 0%, transparent); filter: brightness(1.15); }
  100% { box-shadow: 0 0 0 0 transparent; filter: brightness(1); }
}
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: rgba(8,2,4,.78); backdrop-filter: blur(10px);
  padding: 18px;
}
.modal[hidden] { display: none !important; }
.modal-panel {
  width: min(92vw, 520px);
  position: relative;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,197,61,.14), transparent 40%),
    linear-gradient(165deg, rgba(22,12,14,.9), rgba(6,3,8,.94));
  backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid rgba(194,59,46,.55);
  padding: 26px 24px 20px;
  color: #f6e8c8;
  box-shadow: 0 28px 80px rgba(0,0,0,.62), inset 0 0 60px rgba(194,59,46,.08);
  clip-path: polygon(4% 0, 96% 0, 100% 8%, 100% 92%, 94% 100%, 50% 95%, 6% 100%, 0 92%, 0 8%);
  animation: talismanUnfold .7s cubic-bezier(.2,.85,.25,1);
}
.modal-panel::before {
  content: "符";
  position: absolute;
  right: 18px;
  top: 16px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 2px solid rgba(255,197,61,.65);
  border-radius: 50%;
  color: #ffc53d;
  font: 700 14px var(--serif-shrine);
  transform: rotate(-14deg);
  box-shadow: 0 0 16px rgba(255,197,61,.3);
}
.modal-panel small {
  letter-spacing: .22em;
  color: #f0c3a0;
  font-size: 11px;
  font-family: Syne, sans-serif;
}
.modal-panel h2 {
  margin: 8px 0 6px;
  font-family: var(--serif-shrine);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--washi);
}
.modal-panel > p {
  margin: 0 0 18px;
  color: rgba(242,228,201,.7);
  font-size: 14px;
  line-height: 1.5;
  font-family: var(--serif-shrine);
}
.boon-grid { display: grid; gap: 12px; }
.boon-card {
  position: relative;
  text-align: left;
  cursor: pointer;
  background:
    radial-gradient(circle at 12% 0%, rgba(255,197,61,.12), transparent 40%),
    linear-gradient(165deg, rgba(28,14,16,.92), rgba(8,4,8,.94));
  border: 1px solid rgba(194,59,46,.45);
  color: #f6e8c8;
  padding: 14px 16px 16px;
  clip-path: polygon(3% 0, 97% 0, 100% 12%, 100% 86%, 92% 100%, 50% 93%, 8% 100%, 0 86%, 0 12%);
  box-shadow: 0 12px 28px rgba(0,0,0,.4);
  transition: transform .2s, filter .2s, border-color .2s;
}
.boon-card:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  border-color: rgba(255,197,61,.65);
}
.boon-card b {
  display: block;
  font-family: var(--serif-shrine);
  font-size: 17px;
  margin-bottom: 4px;
  letter-spacing: .1em;
  color: #ffc53d;
}
.boon-card span {
  display: block;
  font-size: 13px;
  color: rgba(242,228,201,.75);
  line-height: 1.45;
  font-family: var(--serif-shrine);
}
.relic-item, .relic-card {
  text-align: left; cursor: pointer;
  border: 1px solid rgba(194,59,46,.35);
  background: linear-gradient(160deg, rgba(58,28,18,.7), rgba(12,6,10,.85));
  color: var(--washi);
  padding: 12px;
  clip-path: polygon(0 0, 100% 0, 100% 90%, 97% 100%, 0 100%);
}
.relic-item.active { border-color: var(--gold); box-shadow: inset 0 0 0 1px rgba(255,197,61,.25); }
.relic-item.locked { opacity: .42; cursor: not-allowed; }
.relic-item b, .relic-card b { display: block; font-family: var(--serif-shrine); font-size: 15px; }
.relic-item small, .relic-card small { color: rgba(242,228,201,.55); font-size: 11px; letter-spacing: .08em; }
.shrine-panel header { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.modal-close {
  width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.2);
  background: transparent; color: #fff; font-size: 22px; cursor: pointer;
}
.shrine-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 12px; }
.shrine-tabs .tab {
  border: 1px solid rgba(194,59,46,.4);
  background: transparent;
  color: rgba(242,228,201,.75);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  letter-spacing: .1em;
  font-family: var(--serif-shrine);
}
.shrine-tabs .tab.active {
  color: var(--washi);
  background: linear-gradient(180deg, var(--vermillion), var(--vermillion-deep));
  border-color: transparent;
}
.shrine-list { display: grid; gap: 8px; max-height: 52vh; overflow: auto; }
.shrine-empty { color: rgba(242,228,201,.55); font-size: 14px; padding: 18px 4px; font-family: var(--serif-shrine); }
.card-panel { width: min(92vw, 400px); }
.card-panel canvas {
  width: 100%; height: auto; display: block; margin: 12px 0 14px;
  border: 1px solid rgba(194,59,46,.35);
}
.card-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.card-actions button {
  border: 1px solid rgba(242,228,201,.35);
  background: linear-gradient(180deg, rgba(194,59,46,.28), rgba(20,8,10,.45));
  color: var(--washi);
  padding: 10px 8px;
  cursor: pointer;
  font-size: 12px;
  letter-spacing: .08em;
  font-family: var(--serif-shrine);
}
.card-actions button:hover {
  border-color: var(--gold);
  color: var(--gold);
}
html[data-theme="theme_rain"] body { --theme-bg: #0d1117; --theme-a: #58a6ff; --theme-b: #8b5cff; }
html[data-theme="theme_bamboo"] body { --theme-bg: #04140f; --theme-a: #3dff9a; --theme-b: #c8ff7a; }
html[data-theme="theme_flare"] body { --theme-bg: #1a0a08; --theme-a: #ffc53d; --theme-b: #ff5d86; }
