/* ═══════════════════════════════════════════════════════════════
   学域万象 · ACADEMIA MYRIAD
   A dark academic card game — ink, paper, brass.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --ink: #06100d;
  --ink-2: #091511;
  --ink-3: #0d1c16;
  --ink-4: #12231c;
  --panel: rgba(12, 26, 20, .88);
  --panel-solid: #0d1c16;
  --panel-soft: rgba(19, 37, 29, .62);
  --paper: #e9e1cf;
  --paper-2: #ded3bc;
  --paper-3: #cfc1a5;
  --charcoal: #1b201b;
  --text: #ddd6c7;
  --text-dim: #a4a99e;
  --muted: #7f897e;
  --gold: #cbb076;
  --gold-2: #f0d79a;
  --gold-3: #9d8151;
  --gold-faint: rgba(203, 176, 118, .16);
  --line: rgba(211, 187, 137, .18);
  --line-strong: rgba(211, 187, 137, .34);
  --green: #70a38a;
  --red: #bd695d;
  --red-2: #e18b7a;
  --blue: #7896bc;
  --shadow: 0 26px 60px rgba(0, 0, 0, .48);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --display: "Cinzel", "Noto Serif SC", serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Liberation Mono", monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }

html { background: var(--ink); }

body {
  min-width: 320px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  background:
    radial-gradient(ellipse 70% 90% at 78% 46%, rgba(39, 80, 63, .24), transparent 58%),
    radial-gradient(ellipse 55% 60% at 12% 22%, rgba(133, 106, 54, .12), transparent 65%),
    linear-gradient(145deg, #07110e 0%, #040b09 65%, #06100d 100%);
  overflow-x: hidden;
}

body.modal-open { overflow: hidden; }

button, input, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: rgba(203, 176, 118, .28); color: #fff8e7; }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ───────────────────────── ambient ───────────────────────── */

.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ambient-wash {
  position: absolute; inset: -20%;
  background:
    radial-gradient(circle at 69% 34%, rgba(95, 151, 127, .12), transparent 26%),
    radial-gradient(circle at 82% 70%, rgba(198, 159, 86, .08), transparent 25%),
    radial-gradient(circle at 28% 84%, rgba(57, 98, 82, .11), transparent 31%);
  filter: blur(16px);
}
.ambient-grid {
  position: absolute; inset: 0;
  opacity: .21;
  background-image:
    linear-gradient(rgba(157, 129, 81, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(157, 129, 81, .08) 1px, transparent 1px);
  background-size: 76px 76px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 45%, black 0%, transparent 78%);
}
.ambient-grid::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(234, 219, 189, .5) .6px, transparent .8px);
  background-size: 31px 33px;
  opacity: .2;
  mask-image: linear-gradient(120deg, transparent 0%, black 45%, transparent 100%);
}
.ambient-vignette {
  position: absolute; inset: 0;
  box-shadow: inset 0 0 28vmin 10vmin rgba(0, 0, 0, .56);
  background: linear-gradient(180deg, rgba(0, 0, 0, .14), transparent 22%, transparent 74%, rgba(0, 0, 0, .42));
}

/* ───────────────────────── base components ───────────────────────── */

#app { position: relative; z-index: 1; min-height: 100dvh; }

.screen { display: none; min-height: 100dvh; }
.screen.is-active { display: flex; animation: screenIn .52s var(--ease-out) both; }

.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--display); font-size: 10px; font-weight: 600;
  letter-spacing: .23em; text-transform: uppercase; color: var(--gold);
}
.eyebrow-rule { display: inline-block; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }

h1, h2, h3, h4, p { margin: 0; }
b, strong { font-weight: 600; }

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 22px;
  border: 1px solid var(--line-strong);
  font-size: 13px; font-weight: 600; letter-spacing: .06em;
  transition: all .28s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; transition: transform .28s var(--ease); }
.btn:hover svg { transform: translateX(2px); }
.btn--primary {
  color: #1b1a12;
  border-color: #e5ca8c;
  background: linear-gradient(135deg, #eed8a4 0%, #cbb076 52%, #ad8e51 100%);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .54);
}
.btn--primary::before {
  content: ""; position: absolute; inset: 3px; border: 1px solid rgba(30, 25, 12, .22); pointer-events: none;
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(0, 0, 0, .35), 0 0 28px rgba(203, 176, 118, .16), inset 0 1px rgba(255, 255, 255, .6); }
.btn--primary:active { transform: translateY(0); }
.btn--primary:disabled { filter: grayscale(.55) brightness(.64); box-shadow: none; transform: none; }
.btn--ghost {
  color: var(--gold-2); border-color: var(--line-strong);
  background: linear-gradient(140deg, rgba(203, 176, 118, .09), rgba(203, 176, 118, .015));
}
.btn--ghost:hover { border-color: var(--gold); background: rgba(203, 176, 118, .12); transform: translateY(-2px); }
.btn--danger { color: #e3b3a8; border-color: rgba(189, 105, 93, .34); background: rgba(117, 55, 45, .15); }
.btn--danger:hover { color: #f4d4cc; border-color: rgba(207, 126, 110, .6); background: rgba(133, 63, 52, .24); }
.btn:focus-visible, .round-button:focus-visible, .nav-link:focus-visible, .school-item:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }
.btn--large { min-height: 52px; padding: 0 28px; font-size: 14px; }
.btn--full { width: 100%; }

.round-button {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--line); color: var(--text-dim);
  background: rgba(7, 17, 13, .48);
  transition: .25s var(--ease);
}
.round-button svg { width: 16px; height: 16px; }
.round-button:hover { color: var(--gold-2); border-color: var(--line-strong); background: rgba(203, 176, 118, .08); }
.round-button--danger:hover { color: var(--red-2); border-color: rgba(189, 105, 93, .42); background: rgba(189, 105, 93, .08); }

.nav-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 2px 6px;
  color: var(--text-dim); font-size: 12px; letter-spacing: .08em;
  border-bottom: 1px solid transparent;
  transition: .25s var(--ease);
}
.nav-link svg { width: 14px; height: 14px; opacity: .8; }
.nav-link:hover { color: var(--gold-2); border-color: var(--line-strong); }
.nav-link--compact { padding: 6px 10px; border: 1px solid transparent; }
.nav-link--compact:hover { border-color: var(--line); background: rgba(203, 176, 118, .04); }

.dot { opacity: .45; }
.hidden { display: none !important; }
[hidden] { display: none !important; }

/* ───────────────────────── title ───────────────────────── */

.screen--title {
  flex-direction: column;
  padding: 0 clamp(24px, 4.4vw, 72px);
  overflow: hidden;
  position: relative;
}
.screen--title::before {
  content: "學"; position: absolute; right: -4vw; top: 2%; z-index: -1;
  font-family: var(--serif); font-size: min(72vw, 960px); font-weight: 900; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(201, 175, 117, .05);
  transform: rotate(-8deg); pointer-events: none;
}

.site-head {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 86px; border-bottom: 1px solid rgba(203, 176, 118, .14);
  position: relative; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-seal {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  color: var(--gold-2); font-family: var(--serif); font-size: 23px; font-weight: 700;
  border: 1px solid rgba(203, 176, 118, .6);
  background: linear-gradient(145deg, rgba(203, 176, 118, .16), transparent);
  box-shadow: inset 0 0 0 4px rgba(6, 16, 13, .8), inset 0 0 0 5px rgba(203, 176, 118, .21);
}
.brand-word { display: flex; flex-direction: column; line-height: 1.1; }
.brand-word b { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: .16em; color: #eadfcb; }
.brand-word small { margin-top: 5px; font-family: var(--display); font-size: 7.5px; letter-spacing: .3em; color: var(--gold-3); }
.site-nav { display: flex; align-items: center; gap: 30px; }

.title-layout {
  flex: 1;
  width: min(100%, 1510px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(500px, 1.02fr) minmax(440px, .98fr);
  align-items: center;
  gap: 4vw;
  padding: 24px 0 18px;
  position: relative;
}
.title-copy { position: relative; z-index: 3; max-width: 680px; }

.title-logo {
  margin: 22px 0 22px;
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(78px, 9.2vw, 145px);
  line-height: .92; letter-spacing: -.075em;
  color: #ece2cf;
  text-shadow: 0 8px 50px rgba(0, 0, 0, .35);
  display: flex; align-items: baseline;
}
.title-logo span { display: inline-block; }
.title-logo em {
  display: inline-block; font-style: normal; margin-left: .035em;
  color: transparent;
  background: linear-gradient(140deg, #f8e7bb 0%, #d3b578 36%, #a88950 70%, #e8ce92 100%);
  -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, .35));
  position: relative;
}
.title-logo em::after {
  content: ""; position: absolute; right: .05em; bottom: .02em;
  width: .36em; height: .36em; border-right: 2px solid rgba(231, 199, 131, .5); border-bottom: 2px solid rgba(231, 199, 131, .5);
  transform: translateY(.2em);
}
.title-kicker {
  font-family: var(--serif); font-size: clamp(18px, 1.6vw, 23px); font-weight: 500;
  letter-spacing: .08em; color: #e3d8c3;
}
.title-kicker::before { content: "「"; color: var(--gold-3); margin-right: .1em; }
.title-kicker::after { content: "」"; color: var(--gold-3); margin-left: .1em; }
.title-lede {
  max-width: 560px; margin-top: 18px;
  color: #9da69a; font-size: 14px; line-height: 1.9; letter-spacing: .015em;
}
.title-lede b { color: var(--gold-2); font-family: var(--display); font-weight: 500; padding: 0 .1em; }

.title-actions { display: flex; gap: 13px; flex-wrap: wrap; margin-top: 34px; }

.title-stats {
  display: flex; align-items: stretch; gap: 0; margin-top: 40px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  width: min(100%, 515px);
}
.stat { flex: 1; padding: 16px 20px 15px; border-right: 1px solid var(--line); }
.stat:first-child { padding-left: 0; }
.stat:last-child { border-right: 0; }
.stat strong {
  display: block; font-family: var(--display); font-size: 23px; font-weight: 500;
  letter-spacing: .03em; color: var(--gold-2); line-height: 1.1;
}
.stat span { display: block; margin-top: 5px; font-size: 10px; letter-spacing: .18em; color: var(--muted); }
.source-note { margin-top: 19px; color: #626d63; font-size: 10px; letter-spacing: .04em; }

.title-visual {
  height: min(72vh, 680px);
  min-height: 490px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.crest {
  position: absolute; left: 50%; top: 48%;
  width: min(43vw, 610px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  opacity: .94;
}
.crest::before {
  content: ""; position: absolute; inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(31, 65, 50, .4), rgba(7, 17, 13, .05) 64%, transparent 70%);
  filter: blur(8px);
}
.crest-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(203, 176, 118, .2); }
.crest-ring--outer { inset: 0; border-style: dashed; border-color: rgba(203, 176, 118, .17); animation: slowSpin 90s linear infinite; }
.crest-ring--mid { inset: 8%; border-color: rgba(203, 176, 118, .25); }
.crest-ring--inner { inset: 23%; border-color: rgba(203, 176, 118, .38); box-shadow: 0 0 60px rgba(77, 134, 108, .08), inset 0 0 60px rgba(77, 134, 108, .08); }
.crest-radial {
  position: absolute; inset: 3%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(203, 176, 118, .17) 0deg .22deg, transparent .22deg 10deg);
  mask-image: radial-gradient(circle, transparent 0 34%, black 34.5% 36%, transparent 36.5% 100%);
  opacity: .55;
}
.crest-ticks { position: absolute; inset: 0; }
.crest-tick {
  position: absolute; left: 50%; top: 50%; width: 1px; height: calc(min(43vw, 610px) * .5 - 30px);
  transform-origin: 50% 0;
  pointer-events: none;
}
.crest-tick::after {
  content: attr(data-glyph);
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%) rotate(180deg);
  color: rgba(203, 176, 118, .44); font-family: var(--serif); font-size: 14px;
}
.crest-tick::before {
  content: ""; position: absolute; bottom: 0; left: 0; width: 1px; height: 10px;
  background: rgba(203, 176, 118, .35);
}
.crest-core {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 31%; aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid rgba(203, 176, 118, .46); border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(6, 16, 13, .38), 0 0 0 8px rgba(203, 176, 118, .15), 0 0 70px rgba(55, 117, 91, .22);
  background: radial-gradient(circle at 45% 34%, rgba(28, 58, 46, .92), rgba(5, 14, 11, .96));
}
.crest-core span { color: var(--gold-2); font-family: var(--serif); font-size: clamp(62px, 7.5vw, 100px); font-weight: 700; line-height: 1; text-shadow: 0 0 34px rgba(203, 176, 118, .22); }
.crest-core small { font-family: var(--display); font-size: 7px; letter-spacing: .35em; color: var(--gold-3); margin-top: 7px; }
.crest-words {
  position: absolute; inset: 0;
  font-family: var(--display); font-size: 7.5px; letter-spacing: .38em; color: rgba(203, 176, 118, .35);
}
.crest-words span { position: absolute; }
.crest-words span:nth-child(1) { left: 24%; top: 5%; }
.crest-words span:nth-child(2) { right: 1%; top: 42%; transform: rotate(90deg); }
.crest-words span:nth-child(3) { left: 33%; bottom: 3%; }
.crest-words span:nth-child(4) { left: 0%; top: 45%; transform: rotate(-90deg); }

.title-orbit-note {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-family: var(--display); font-size: 8px; letter-spacing: .32em; color: rgba(203, 176, 118, .37);
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
}
.title-orbit-note::before, .title-orbit-note::after { content: ""; width: 28px; height: 1px; background: linear-gradient(90deg, transparent, rgba(203,176,118,.3)); }
.title-orbit-note::after { transform: scaleX(-1); }
.title-orbit-note--top { top: 4%; }
.title-orbit-note--bottom { bottom: 4%; }

.card-fan { position: absolute; width: 100%; height: 100%; left: 0; top: 6%; z-index: 2; pointer-events: none; }
.card-fan .card {
  position: absolute; left: 50%; top: 47%;
  transform-origin: 50% 120%;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .55), 0 4px 10px rgba(0, 0, 0, .3);
  pointer-events: auto;
  transition: transform .45s var(--ease), filter .4s;
  filter: saturate(.92) brightness(.96);
}
.card-fan .card:nth-child(1) { transform: translate(-120%, -50%) rotate(-12deg) scale(.92); z-index: 1; }
.card-fan .card:nth-child(2) { transform: translate(-68%, -55%) rotate(-4deg) scale(1); z-index: 3; }
.card-fan .card:nth-child(3) { transform: translate(-22%, -48%) rotate(8deg) scale(.94); z-index: 2; }
.card-fan .card:nth-child(4) { transform: translate(28%, -42%) rotate(16deg) scale(.87); z-index: 1; }
.card-fan .card:hover { filter: saturate(1.05) brightness(1.06); }
.card-fan .card:nth-child(2):hover { transform: translate(-68%, -59%) rotate(-4deg) scale(1.04); }
.card-fan .card:nth-child(1):hover { transform: translate(-123%, -53%) rotate(-12deg) scale(.96); }
.card-fan .card:nth-child(3):hover { transform: translate(-22%, -52%) rotate(8deg) scale(.98); }

.title-foot {
  border-top: 1px solid rgba(203, 176, 118, .14);
  min-height: 74px; width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  position: relative; z-index: 4;
}
.title-foot p { color: #5e6960; font-family: var(--serif); font-size: 10px; letter-spacing: .08em; white-space: nowrap; flex: none; }
.discipline-marquee { display: flex; align-items: center; gap: clamp(8px, 1vw, 15px); flex-wrap: nowrap; overflow: hidden; }
.discipline-marquee span {
  display: inline-flex; align-items: center; gap: 5px;
  color: #6d786d; font-size: 9px; letter-spacing: .07em; white-space: nowrap; flex: none;
  transition: color .3s;
}
.discipline-marquee span:hover { color: var(--gold); }
.discipline-marquee i {
  display: grid; place-items: center; width: 18px; height: 18px;
  border: 1px solid color-mix(in srgb, var(--sc) 45%, transparent);
  color: var(--sc); font-family: var(--serif); font-style: normal; font-size: 10px;
}

/* ───────────────────────── cards ───────────────────────── */

.card {
  --cw: 154px;
  border: 0;
  font-family: var(--sans);
  -webkit-tap-highlight-color: transparent;
  --sc: #b7a075;
  --sc-deep: #3d3728;
  position: relative;
  width: var(--cw);
  height: calc(var(--cw) * 1.455);
  flex: 0 0 auto;
  border-radius: calc(var(--cw) * .047);
  padding: 0;
  color: var(--charcoal);
  background: linear-gradient(155deg, #f1eadb 0%, var(--paper) 48%, #ddd2bc 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,.7) inset,
    0 0 0 1px rgba(64, 51, 27, .55),
    0 0 0 3px rgba(7, 17, 13, .8),
    0 0 0 4px rgba(203, 176, 118, .28),
    0 10px 24px rgba(0, 0, 0, .35);
  text-align: left;
  isolation: isolate;
  overflow: hidden;
  transition: transform .26s var(--ease), box-shadow .26s var(--ease), filter .26s;
}
.card::before {
  content: ""; position: absolute; inset: 5px; z-index: 5; pointer-events: none;
  border: 1px solid rgba(66, 53, 30, .24);
  border-radius: calc(var(--cw) * .025);
}
.card::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  opacity: .4; mix-blend-mode: multiply;
}
.card:hover { transform: translateY(-4px); }
.card[role="button"] { cursor: pointer; }
.card[role="button"]:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 4px; }
.card__code-label { opacity: .47; font-family: var(--sans); letter-spacing: .05em; margin-right: 2px; }
.hand .card__code-label, .major-grid .card__code-label { display: none; }
.hand .card__code { font-size: 8.4px; letter-spacing: .015em; }
.detail-flavor { margin-top: 7px; padding-top: 6px; border-top: 1px solid rgba(203,176,118,.1); color: #757d70; font-family: var(--serif); font-size: 9px; letter-spacing: .04em; }

.card--rarity-tk {
  box-shadow:
    0 1px 0 rgba(255,255,255,.8) inset,
    0 0 0 1px rgba(82, 60, 22, .65),
    0 0 0 3px rgba(7, 17, 13, .8),
    0 0 0 5px rgba(224, 190, 111, .62),
    0 0 26px rgba(213, 175, 93, .16),
    0 12px 26px rgba(0, 0, 0, .4);
}
.card--rarity-k {
  box-shadow:
    0 1px 0 rgba(255,255,255,.75) inset,
    0 0 0 1px rgba(92, 51, 42, .7),
    0 0 0 3px rgba(7, 17, 13, .8),
    0 0 0 4px rgba(164, 91, 77, .55),
    0 10px 24px rgba(0, 0, 0, .35);
}
.card--rarity-t::after { opacity: .53; }

.card__code-strip {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 7px;
  height: calc(var(--cw) * .142);
  padding: 0 calc(var(--cw) * .052) 0 calc(var(--cw) * .255);
  color: rgba(236, 220, 187, .76);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--sc-deep) 88%, #08110e), #152019 80%),
    #122019;
  border-bottom: 1px solid rgba(203, 176, 118, .22);
}
.card__code-strip::after {
  content: ""; position: absolute; left: 9%; right: 7%; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(203, 176, 118, .38), transparent);
}
.card__code {
  display: flex; align-items: center; gap: 2px;
  font-family: var(--mono); font-size: calc(var(--cw) * .056); letter-spacing: .025em;
  white-space: nowrap; color: rgba(243, 230, 203, .88);
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.card__code b { font-weight: 500; }
.card__code em { font-style: normal; color: var(--gold-2); font-weight: 700; }
.card__rarity {
  display: inline-flex; align-items: center; flex: none;
  font-size: calc(var(--cw) * .043); font-weight: 600; letter-spacing: .05em;
  color: color-mix(in srgb, var(--gold-2) 74%, #fff 10%);
  opacity: .86;
}
.card--rarity-k .card__rarity { color: #e4a18e; }
.card--rarity-tk .card__rarity { color: #f1d99a; }

.card__cost {
  position: absolute; z-index: 8; left: calc(var(--cw) * .035); top: calc(var(--cw) * .024);
  display: grid; place-items: center;
  width: calc(var(--cw) * .19); height: calc(var(--cw) * .19);
  border-radius: 50%;
  color: #f5eedf;
  font-family: var(--display); font-size: calc(var(--cw) * .112); font-weight: 600; line-height: 1;
  background:
    radial-gradient(circle at 36% 28%, color-mix(in srgb, var(--sc) 44%, #fff 9%), var(--sc) 35%, var(--sc-deep) 100%);
  border: 1px solid rgba(255, 244, 218, .55);
  box-shadow: 0 0 0 3px rgba(7, 17, 13, .8), 0 0 0 4px color-mix(in srgb, var(--sc) 45%, transparent), 0 4px 10px rgba(0, 0, 0, .35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.card__cost--discount { color: #d8f0cd; }
.card__cost--up { color: #ffc4b4; }

.card__art {
  position: relative; z-index: 1;
  height: calc(var(--cw) * .53);
  overflow: hidden;
  background:
    radial-gradient(circle at 68% 28%, color-mix(in srgb, var(--sc) 45%, transparent), transparent 40%),
    radial-gradient(circle at 20% 88%, color-mix(in srgb, var(--sc) 20%, transparent), transparent 50%),
    linear-gradient(155deg, color-mix(in srgb, var(--sc-deep) 90%, #0b1511), color-mix(in srgb, var(--sc-deep) 58%, #0d1713));
  border-bottom: 1px solid rgba(60, 47, 25, .35);
}
.card__art::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(rgba(255, 245, 220, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 245, 220, .06) 1px, transparent 1px);
  background-size: calc(var(--cw) * .13) calc(var(--cw) * .13);
  mask-image: radial-gradient(circle at 62% 42%, black, transparent 72%);
}
.card__art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(5, 12, 9, .4));
}
.card__rings {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--cw) * .42); height: calc(var(--cw) * .42);
  transform: translate(-50%, -50%);
  border: 1px solid color-mix(in srgb, var(--sc) 50%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 calc(var(--cw) * .033) color-mix(in srgb, var(--sc) 10%, transparent), 0 0 0 calc(var(--cw) * .047) color-mix(in srgb, var(--sc) 20%, transparent);
  opacity: .7;
}
.card__rings::before, .card__rings::after {
  content: ""; position: absolute; background: color-mix(in srgb, var(--sc) 65%, transparent);
}
.card__rings::before { left: 50%; top: -34%; width: 1px; height: 168%; }
.card__rings::after { top: 50%; left: -34%; height: 1px; width: 168%; }
.card__glyph {
  position: absolute; z-index: 1; left: 50%; top: 49%; transform: translate(-50%, -50%);
  font-family: var(--serif); font-weight: 700;
  font-size: calc(var(--cw) * .39); line-height: 1;
  color: color-mix(in srgb, var(--sc) 58%, #f4e6c8);
  opacity: .8;
  text-shadow: 0 4px 20px rgba(0, 0, 0, .35);
}
.card__school-icon {
  position: absolute; z-index: 2; right: calc(var(--cw) * .055); top: calc(var(--cw) * .055);
  width: calc(var(--cw) * .115); height: calc(var(--cw) * .115);
  color: color-mix(in srgb, var(--sc) 55%, #f3e7cc);
  opacity: .83;
}
.card__art-code {
  position: absolute; z-index: 2; left: calc(var(--cw) * .06); bottom: calc(var(--cw) * .05);
  font-family: var(--mono); font-size: calc(var(--cw) * .037); letter-spacing: .12em;
  color: rgba(244, 233, 207, .46);
}
.card__art-school {
  position: absolute; z-index: 2; right: calc(var(--cw) * .052); bottom: calc(var(--cw) * .045);
  font-family: var(--serif); font-size: calc(var(--cw) * .052); letter-spacing: .14em;
  color: rgba(244, 233, 207, .63);
}
.card__body {
  position: relative; z-index: 2;
  padding: calc(var(--cw) * .052) calc(var(--cw) * .065) 0;
  min-height: 0;
}
.card__name {
  font-family: var(--serif); font-weight: 700;
  font-size: calc(var(--cw) * .1); line-height: 1.24; letter-spacing: -.01em;
  min-height: calc(var(--cw) * .13);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.card__name--long { font-size: calc(var(--cw) * .086); letter-spacing: -.025em; }
.card__name--xlong { font-size: calc(var(--cw) * .073); line-height: 1.3; letter-spacing: -.03em; -webkit-line-clamp: 2; min-height: calc(var(--cw) * .12); }
.card__rule {
  margin-top: calc(var(--cw) * .036);
  font-size: calc(var(--cw) * .056); line-height: 1.55; color: #4b4d43;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card__rule .kw {
  font-weight: 700; color: color-mix(in srgb, var(--sc-deep) 70%, #111);
  border-bottom: 1px dotted color-mix(in srgb, var(--sc) 55%, transparent);
}
.card__keywords {
  display: flex; flex-wrap: wrap; gap: 3px; margin-top: calc(var(--cw) * .03);
}
.card__keyword {
  font-size: calc(var(--cw) * .044); line-height: 1.4; font-weight: 600; letter-spacing: .04em;
  padding: 1px calc(var(--cw) * .028);
  color: color-mix(in srgb, var(--sc-deep) 80%, #0d1611);
  background: color-mix(in srgb, var(--sc) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--sc) 40%, transparent);
}
.card__footer {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0;
  height: calc(var(--cw) * .158);
  display: flex; align-items: center; justify-content: flex-start; gap: calc(var(--cw) * .026);
  padding: 0 calc(var(--cw) * .055);
  background: linear-gradient(0deg, rgba(206, 193, 166, .7), rgba(233, 225, 207, .3) 80%, transparent);
  font-size: calc(var(--cw) * .047); color: #696554;
}
.card__footer > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__type { letter-spacing: .13em; }
.card__stats {
  display: flex; align-items: center; gap: calc(var(--cw) * .02);
  order: -1; margin-right: auto; flex: none;
}
.card__stat {
  display: flex; align-items: center; justify-content: center;
  min-width: calc(var(--cw) * .145); height: calc(var(--cw) * .138);
  padding: 0 calc(var(--cw) * .02);
  font-family: var(--display); font-size: calc(var(--cw) * .087); font-weight: 600; line-height: 1;
  color: #f5ecdb;
  background: linear-gradient(145deg, #334239, #111d17);
  border: 1px solid rgba(216, 190, 137, .4);
  box-shadow: 0 2px 6px rgba(0,0,0,.24), inset 0 1px rgba(255,255,255,.08);
  gap: 2px;
}
.card__stat i { font-family: var(--sans); font-size: calc(var(--cw) * .043); font-style: normal; font-weight: 500; opacity: .65; }
.card__stat--hp { background: linear-gradient(145deg, #60362f, #271613); border-color: rgba(211, 153, 134, .42); }
.card__stat--hp i { opacity: .75; }
.card--spell .card__art { height: calc(var(--cw) * .55); }
.card--spell .card__footer .card__type { color: color-mix(in srgb, var(--sc-deep) 72%, #111); font-weight: 600; }
.card--spell .card__art-glyph { font-size: calc(var(--cw) * .3); }

.card--mini { --cw: 158px; }
.card--mini .card__rule { -webkit-line-clamp: 2; }
.card--display { --cw: clamp(220px, 19vw, 260px); }
.card--fan { --cw: clamp(172px, 14.3vw, 218px); }
.card--reward { --cw: clamp(166px, 15vw, 196px); }

.card--playable { cursor: pointer; }
.card--playable:hover { filter: brightness(1.045); }
.card--unaffordable { filter: grayscale(.56) brightness(.66); }
.card--unaffordable .card__cost { filter: brightness(.8); }
.card--selected {
  outline: 2px solid var(--gold-2); outline-offset: 4px;
  box-shadow: 0 0 32px rgba(203, 176, 118, .27), 0 20px 44px rgba(0, 0, 0, .45);
  transform: translateY(-8px);
}
.card--chain-ready .card__code-strip::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(203, 176, 118, .24), transparent);
  animation: chainSweep 2s infinite;
}
.card--chain-ready { box-shadow: 0 0 0 1px rgba(68, 53, 28, .7), 0 0 0 3px rgba(7,17,13,.8), 0 0 0 5px rgba(218, 185, 109, .8), 0 0 26px rgba(213, 175, 93, .32), 0 12px 26px rgba(0,0,0,.38); }

/* ───────────────────────── academy ───────────────────────── */

.screen--academy { flex-direction: column; height: 100dvh; overflow: hidden; }
.sub-head {
  flex: none; min-height: 82px; padding: 0 clamp(18px, 3vw, 42px);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 13, 10, .45);
  position: relative; z-index: 4;
}
.back-button {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-dim); font-size: 12px; letter-spacing: .07em;
  transition: .25s;
}
.back-button svg { width: 17px; height: 17px; }
.back-button:hover { color: var(--gold-2); }
.sub-head-title { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sub-head-title .eyebrow { font-size: 8px; letter-spacing: .26em; }
.sub-head-title h2 { font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: .16em; color: #ece2ce; }
.sub-head-actions { justify-self: end; display: flex; align-items: center; gap: 20px; }

.academy-layout {
  flex: 1; min-height: 0;
  width: min(100%, 1580px); margin: 0 auto;
  display: grid; grid-template-columns: 210px minmax(0, 1fr) 346px;
  gap: 20px; padding: 20px clamp(18px, 3vw, 42px) 24px;
}

.school-rail {
  min-height: 0; display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  padding-right: 18px;
}
.rail-heading { display: flex; align-items: baseline; justify-content: space-between; padding: 4px 6px 12px; border-bottom: 1px solid var(--line); }
.rail-heading span { font-family: var(--serif); font-size: 14px; letter-spacing: .13em; color: var(--text); }
.rail-heading small { font-family: var(--display); font-size: 7px; letter-spacing: .18em; color: var(--gold-3); }
.school-list { overflow-y: auto; min-height: 0; margin-top: 8px; padding-right: 3px; scrollbar-width: thin; scrollbar-color: rgba(203,176,118,.25) transparent; }
.school-item {
  width: 100%; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px;
  min-height: 38px; padding: 5px 7px; text-align: left; color: var(--text-dim);
  border-left: 2px solid transparent; border-bottom: 1px solid rgba(203,176,118,.06);
  transition: .2s var(--ease);
}
.school-item:hover { background: rgba(203,176,118,.055); color: #e7dcc6; }
.school-item.is-active { color: var(--gold-2); background: linear-gradient(90deg, rgba(203,176,118,.1), transparent); border-left-color: var(--sc, var(--gold)); }
.school-item__seal {
  display: grid; place-items: center; width: 27px; height: 27px;
  border: 1px solid color-mix(in srgb, var(--sc) 32%, transparent);
  font-family: var(--serif); font-size: 13px; color: var(--sc);
  background: color-mix(in srgb, var(--sc) 6%, transparent);
}
.school-item.is-active .school-item__seal { border-color: color-mix(in srgb, var(--sc) 65%, transparent); background: color-mix(in srgb, var(--sc) 12%, transparent); }
.school-item__name { display: flex; flex-direction: column; line-height: 1.3; font-size: 12px; }
.school-item__name small { font-family: var(--display); font-size: 6.5px; letter-spacing: .15em; opacity: .45; margin-top: 2px; }
.school-item__count { font-family: var(--display); font-size: 9px; color: var(--muted); }
.school-item.is-active .school-item__count { color: var(--gold); }
.school-item--all { margin-bottom: 4px; }
.school-item--all .school-item__seal { color: var(--gold); border-color: rgba(203,176,118,.35); }

.rail-foot {
  margin-top: 12px; padding-top: 13px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; color: #626c62;
}
.rail-seal { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 1px solid rgba(203,176,118,.3); color: var(--gold-dim); font-family: var(--serif); font-size: 15px; transform: rotate(-3deg); }
.rail-foot p { font-family: var(--serif); font-size: 9px; line-height: 1.55; letter-spacing: .07em; }
.rail-foot b { color: #a99a7b; font-weight: 500; }

.browse-panel {
  min-width: 0; min-height: 0; display: flex; flex-direction: column;
  padding: 0 4px;
}
.browse-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 1px 2px 13px; border-bottom: 1px solid var(--line); }
.browse-top .eyebrow { font-size: 7.5px; letter-spacing: .21em; color: var(--gold-3); }
.browse-top h3 { margin-top: 5px; font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: .1em; color: #e8ddc9; }
.browse-tools { display: flex; align-items: center; gap: 7px; flex-wrap: nowrap; }
.search-box {
  position: relative; display: flex; align-items: center;
  width: clamp(168px, 17vw, 245px); height: 36px;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(203,176,118,.03);
  transition: .25s;
}
.search-box:focus-within { border-color: var(--gold); background: rgba(203,176,118,.06); }
.search-box svg { width: 14px; height: 14px; margin-left: 9px; color: var(--muted); }
.search-box input { width: 100%; height: 100%; padding: 0 25px 0 8px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 11px; letter-spacing: .03em; }
.search-box input::placeholder { color: #626b61; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 21px; height: 21px; border-radius: 50%; color: var(--muted); font-size: 15px; opacity: 0; pointer-events: none; transition: .2s; }
.search-box.has-value .search-clear { opacity: 1; pointer-events: auto; }
.search-clear:hover { color: var(--gold); background: rgba(203,176,118,.1); }
.select-box {
  height: 36px; padding: 0 25px 0 9px;
  border: 1px solid var(--line); border-radius: 0;
  color: var(--text-dim); background: var(--ink-3);
  font-size: 10px; letter-spacing: .04em; outline: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold-3) 50%), linear-gradient(135deg, var(--gold-3) 50%, transparent 50%);
  background-position: calc(100% - 12px) 15px, calc(100% - 8px) 15px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.select-box:focus { border-color: var(--line-strong); color: var(--text); }
.icon-tile {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--gold-dim); background: transparent;
  transition: .25s;
}
.icon-tile svg { width: 15px; height: 15px; }
.icon-tile:hover { color: var(--gold-2); border-color: var(--line-strong); background: rgba(203,176,118,.06); }

.browse-summary { display: flex; align-items: center; justify-content: space-between; padding: 10px 2px 9px; color: #6c756c; font-size: 9.5px; letter-spacing: .06em; }
.browse-summary p { display: flex; align-items: center; gap: 7px; }
.browse-summary p::before { content: ""; width: 4px; height: 4px; transform: rotate(45deg); background: var(--gold-3); }
.browse-summary span { color: #5b655b; font-family: var(--serif); }

.major-grid {
  min-height: 0; flex: 1; overflow-y: auto; overflow-x: hidden;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: start; align-items: start; grid-auto-rows: max-content; gap: 20px 16px;
  padding: 8px 7px 24px 3px;
  scrollbar-width: thin; scrollbar-color: rgba(203,176,118,.3) transparent;
  outline: none;
}
.major-grid .card { width: 100%; height: auto; aspect-ratio: 1 / 1.455; --cw: 0px; cursor: pointer; }
.major-grid .card:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 4px; }
.major-grid .card .card__rings { width: 68px; height: 68px; box-shadow: 0 0 0 5px color-mix(in srgb, var(--sc) 11%, transparent), 0 0 0 8px color-mix(in srgb, var(--sc) 18%, transparent); }
.major-grid .card .card__code { font-size: 9px; }
.major-grid .card .card__rarity { font-size: 7.5px; }
.major-grid .card .card__name { font-size: 14px; min-height: 18px; }
.major-grid .card .card__name--long { font-size: 12.5px; }
.major-grid .card .card__name--xlong { font-size: 11px; min-height: 28px; }
.major-grid .card .card__rule { font-size: 9.5px; line-height: 1.55; margin-top: 6px; }
.major-grid .card .card__keyword { font-size: 7.5px; padding: 1px 3px; }
.major-grid .card .card__footer { font-size: 8px; }
.major-grid .card .card__art-code { font-size: 6.5px; }
.major-grid .card .card__art-school { font-size: 9px; }
.major-grid .card .card__school-icon { width: 17px; height: 17px; }
.major-grid .card .card__glyph { font-size: 62px; }
.major-grid .card .card__stat { min-width: 25px; height: 23px; font-size: 14px; padding: 0 4px; }
.major-grid .card .card__stat i { font-size: 7px; }
.major-grid .card .card__cost { width: 30px; height: 30px; font-size: 18px; left: 5px; top: 4px; }
.major-grid .card .card__code-strip { height: 23px; padding-left: 40px; padding-right: 7px; }
.major-grid .card .card__art { height: 39.5%; }
.major-grid .card .card__body { padding: 8px 10px 0; }
.major-grid .card .card__stats { gap: 4px; margin-right: auto; }
.major-grid .card .card__footer { height: 25px; padding: 0 9px; gap: 5px; }
.major-grid .card .card__rule { -webkit-line-clamp: 2; }
.major-grid .card:hover { transform: translateY(-5px); }
.major-grid .card.is-selected {
  outline: 1px solid var(--gold); outline-offset: 4px;
  box-shadow: 0 0 0 1px rgba(64,51,27,.5), 0 0 0 3px rgba(7,17,13,.8), 0 0 0 4px rgba(203,176,118,.8), 0 0 35px rgba(203,176,118,.2), 0 14px 30px rgba(0,0,0,.45);
}
.major-grid .card.is-selected::before { border-color: rgba(203,176,118,.45); }
.major-divider { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; color: #697366; font-family: var(--serif); font-size: 10px; letter-spacing: .16em; }
.major-divider::before, .major-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }

.browse-foot { flex: none; display: flex; justify-content: center; padding-top: 7px; }
.load-more {
  display: inline-flex; align-items: center; gap: 11px; padding: 10px 28px;
  border: 1px solid var(--line); color: var(--gold); font-size: 11px; letter-spacing: .1em;
  transition: .25s; background: rgba(203,176,118,.025);
}
.load-more small { font-family: var(--display); font-size: 6.5px; letter-spacing: .18em; opacity: .5; }
.load-more:hover { border-color: var(--line-strong); background: rgba(203,176,118,.07); }
.load-more:disabled { opacity: .35; cursor: default; }

.detail-rail {
  min-height: 0; display: flex; flex-direction: column;
  border-left: 1px solid var(--line);
  padding-left: 25px;
}
.detail-top { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.detail-top .eyebrow { font-size: 7px; letter-spacing: .2em; color: var(--gold-3); }
.detail-top h3 { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: .1em; margin-top: 3px; color: #e9dfca; }
.detail-index { font-family: var(--mono); font-size: 9px; color: #6d766b; padding-top: 7px; }
.detail-close { display: none; position: absolute; z-index: 4; top: -1px; right: -4px; width: 28px; height: 28px; border: 1px solid var(--line); color: #869083; font-size: 16px; background: var(--ink-3); }
.detail-close:hover { color: var(--gold-2); border-color: var(--gold-3); }
.detail-card-slot {
  height: clamp(288px, 32.5vh, 310px); display: grid; place-items: center;
  padding: 12px 0 10px; flex: none;
}
.detail-card-slot .card { --cw: clamp(164px, 12.7vw, 184px); cursor: default; }
.detail-card-slot .card:hover { transform: none; }
.detail-card-slot .card::before { pointer-events: none; }
.detail-body { min-height: 0; flex: 1 1 auto; overflow-y: auto; padding: 0 3px 10px 1px; scrollbar-width: thin; scrollbar-color: rgba(203,176,118,.22) transparent; }
.detail-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding-top: 8px; }
.detail-title-row h3 { font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: .02em; color: #efe5d1; }
.detail-title-row p { color: #747e73; font-size: 9px; letter-spacing: .08em; margin-top: 2px; }
.school-badge { flex: none; padding: 3px 7px; border: 1px solid color-mix(in srgb, var(--sc) 42%, transparent); color: var(--sc); font-family: var(--serif); font-size: 10px; letter-spacing: .08em; }
.detail-ability { margin-top: 12px; padding: 11px 12px; border-left: 2px solid var(--sc, var(--gold)); background: linear-gradient(90deg, rgba(203,176,118,.07), transparent); color: #b9b8aa; font-size: 11px; line-height: 1.65; }
.detail-ability b { color: #ded1b7; }
.detail-ability small { display: block; color: #707a6f; font-size: 8px; letter-spacing: .14em; margin-bottom: 3px; font-family: var(--sans); }
.detail-powers { margin-top: 2px; }
.power-line { display: flex; gap: 9px; padding: 9px 0; border-bottom: 1px solid rgba(203,176,118,.1); }
.power-mark { width: 25px; height: 25px; display: grid; place-items: center; flex: none; border: 1px solid var(--line); color: var(--gold); margin-top: 2px; }
.power-mark svg { width: 12px; height: 12px; }
.power-line > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.power-line small { font-size: 7.5px; letter-spacing: .13em; color: #636e63; font-family: var(--display); }
.power-line b { font-family: var(--serif); font-size: 12px; font-weight: 600; color: #ddd2bb; margin-top: 1px; }
.power-line p { font-size: 9.5px; color: #858e81; line-height: 1.55; margin-top: 1px; }
.deck-preview { margin: 11px 0 12px; padding: 10px 11px 9px; border: 1px solid rgba(203,176,118,.13); background: rgba(5,13,10,.28); }
.deck-preview-head { display: flex; justify-content: space-between; color: #99947f; font-size: 9px; letter-spacing: .1em; }
.deck-preview-head span:last-child { font-family: var(--display); color: var(--gold-dim); }
.deck-preview-bar { display: flex; gap: 3px; margin: 7px 0 5px; }
.deck-preview-bar i { display: block; height: 2px; flex: 1; background: rgba(203,176,118,.18); }
.deck-preview-bar i:nth-child(1) { flex: 4; background: var(--gold-3); }
.deck-preview-bar i:nth-child(2) { flex: 1; background: rgba(95, 148, 124, .55); }
.deck-preview p { color: #687268; font-size: 8.5px; letter-spacing: .03em; }
.detail-rail > #btn-start-run { flex: none; margin-top: 8px; margin-bottom: 2px; }
.detail-body .btn { margin-top: 1px; margin-bottom: 10px; }

/* ───────────────────────── battle layout ───────────────────────── */

.screen--battle { flex-direction: column; height: 100dvh; overflow: hidden; }
.battle-head {
  flex: none; height: 58px; padding: 0 clamp(14px, 2vw, 28px);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(7,17,13,.85), rgba(7,17,13,.42));
  position: relative; z-index: 20;
}
.battle-brand { display: flex; align-items: center; gap: 9px; min-width: 176px; }
.brand-seal--small { width: 30px; height: 30px; font-size: 16px; box-shadow: inset 0 0 0 3px rgba(6,16,13,.8), inset 0 0 0 4px rgba(203,176,118,.21); }
.battle-brand-word { display: flex; flex-direction: column; line-height: 1.05; }
.battle-brand-word b { font-family: var(--serif); font-size: 12px; letter-spacing: .15em; color: #dfd4be; font-weight: 600; }
.battle-brand-word small { font-family: var(--display); font-size: 6px; letter-spacing: .22em; color: var(--gold-3); margin-top: 3px; }
.act-tracker { display: flex; align-items: center; gap: 0; }
.act-item { display: flex; align-items: center; color: #606b61; }
.act-item__dot {
  display: grid; place-items: center; width: 22px; height: 22px;
  border: 1px solid rgba(203,176,118,.22); border-radius: 50%;
  font-family: var(--display); font-size: 8px; color: #778076;
  background: rgba(6,15,12,.6); position: relative; z-index: 1;
}
.act-item__label { margin-left: 7px; font-family: var(--serif); font-size: 9px; letter-spacing: .08em; white-space: nowrap; }
.act-item__line { width: clamp(18px, 2.7vw, 45px); height: 1px; background: rgba(203,176,118,.15); margin: 0 10px; }
.act-item.is-done .act-item__dot { border-color: var(--gold-3); color: var(--gold-3); }
.act-item.is-done .act-item__label { color: #9c947f; }
.act-item.is-current .act-item__dot { border-color: var(--gold); color: var(--ink); background: var(--gold); box-shadow: 0 0 16px rgba(203,176,118,.2); }
.act-item.is-current .act-item__label { color: var(--gold-2); }
.act-item.is-done .act-item__line { background: linear-gradient(90deg, var(--gold-3), rgba(203,176,118,.14)); }
.battle-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 200px; }

.battle-layout {
  flex: 1; min-height: 0;
  width: min(100%, 1760px); margin: 0 auto;
  display: grid; grid-template-columns: 209px minmax(0, 1fr) 224px;
  gap: 14px; padding: 11px clamp(12px, 1.7vw, 24px) 10px;
}
.battle-side { min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.battle-side--left { padding-top: 2px; }
.battle-side--right { padding-top: 2px; }

.panel {
  position: relative;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(19, 38, 30, .72), rgba(7, 16, 13, .62));
  box-shadow: inset 0 1px rgba(239, 219, 174, .035);
}
.panel::before {
  content: ""; position: absolute; top: 0; left: 0; width: 12px; height: 1px; background: var(--gold-3);
}
.panel-kicker { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 9px 11px 0; }
.panel-kicker span { font-family: var(--serif); font-size: 9.5px; letter-spacing: .11em; color: #a49a83; }
.panel-kicker small { font-family: var(--display); font-size: 5.5px; letter-spacing: .18em; color: #5f685f; }

.mission-panel { padding-bottom: 11px; }
.mission-panel h3 { padding: 7px 11px 0; color: #e5dbc7; font-family: var(--serif); font-size: 15px; font-weight: 600; letter-spacing: .06em; }
.mission-panel p { padding: 2px 11px 0; color: #939b8e; font-size: 9.5px; line-height: 1.55; }
.mission-progress { display: flex; align-items: center; gap: 7px; margin: 9px 11px 0; }
.mission-progress::before { content: ""; position: absolute; }
.mission-bar { height: 3px; flex: 1; background: rgba(203,176,118,.13); overflow: hidden; position: relative; }
.mission-bar::after { content: ""; position: absolute; right: 0; top: 0; height: 100%; width: var(--progress, 0%); background: linear-gradient(90deg, var(--gold-3), var(--gold-2)); transition: width .6s var(--ease); }
.mission-progress span { font-family: var(--display); font-size: 7px; letter-spacing: .07em; color: var(--gold-3); }
.mission-reward { display: flex; align-items: center; gap: 5px; margin: 8px 11px 0; padding-top: 7px; border-top: 1px solid rgba(203,176,118,.09); color: #d3bd8a; font-size: 8.5px; }
.mission-reward svg { width: 10px; height: 10px; opacity: .7; }
.mission-panel.is-complete .mission-bar::after { background: linear-gradient(90deg, #5e987d, #a5d4b9); }
.mission-panel.is-complete .mission-reward { color: #93bca1; }
.mission-panel.is-complete .mission-reward svg { animation: pulseSoft 2s infinite; }

.mentor-panel { padding-bottom: 10px; }
.mentor-head { display: flex; align-items: center; gap: 9px; padding: 7px 11px 4px; }
.mentor-seal { display: grid; place-items: center; width: 32px; height: 32px; flex: none; font-family: var(--serif); font-size: 16px; color: var(--sc, var(--gold)); border: 1px solid color-mix(in srgb, var(--sc, var(--gold)) 38%, transparent); background: color-mix(in srgb, var(--sc, var(--gold)) 7%, transparent); }
.mentor-head > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.mentor-head b { font-family: var(--serif); font-size: 11px; color: #d8ceba; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mentor-head span { font-family: var(--mono); font-size: 7.5px; color: #727a6f; letter-spacing: .05em; margin-top: 1px; }
.mentor-trait { padding: 7px 11px 0; border-top: 1px solid rgba(203,176,118,.09); margin: 4px 11px 0; }
.mentor-trait small { display: block; font-family: var(--display); font-size: 6px; letter-spacing: .16em; color: #606960; }
.mentor-trait b { display: block; font-family: var(--serif); font-weight: 600; font-size: 10px; color: var(--gold); margin-top: 2px; }
.mentor-trait p { font-size: 8.7px; color: #828c80; line-height: 1.5; }

.keyword-panel { padding-bottom: 7px; flex: 1; min-height: 0; overflow: hidden; }
.keyword-legend { display: flex; flex-direction: column; padding: 5px 11px 0; gap: 0; }
.keyword-legend span { display: flex; align-items: center; gap: 6px; padding: 4px 0; color: #7c857a; font-size: 8px; border-bottom: 1px solid rgba(203,176,118,.06); white-space: nowrap; }
.keyword-legend b { width: 28px; color: #b9a77e; font-family: var(--serif); font-weight: 600; font-size: 9px; }
.keyword-legend span::after { content: "?"; display: grid; place-items: center; margin-left: auto; width: 11px; height: 11px; border: 1px solid rgba(203,176,118,.18); border-radius: 50%; color: #5e695e; font-size: 7px; }

.arena {
  position: relative; min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  border: 1px solid rgba(203,176,118,.15);
  background:
    radial-gradient(ellipse 56% 46% at 50% 48%, rgba(38, 79, 63, .2), transparent 68%),
    radial-gradient(ellipse 80% 80% at 50% 50%, rgba(12, 28, 21, .45), rgba(4, 11, 9, .75));
  overflow: hidden;
}
.arena::before {
  content: ""; position: absolute; inset: 10px;
  border: 1px solid rgba(203,176,118,.075); pointer-events: none;
}
.arena::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,.3), transparent 12%, transparent 88%, rgba(0,0,0,.3));
}
.arena-frame {
  position: absolute; left: 50%; top: 50%; width: 78%; aspect-ratio: 2.15;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(203,176,118,.08); border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(203,176,118,.018), 0 0 0 39px rgba(203,176,118,.045);
  pointer-events: none;
}
.arena-stars { position: absolute; inset: 0; opacity: .24; background-image: radial-gradient(circle, rgba(235,216,177,.65) .55px, transparent .8px); background-size: 43px 47px; mask-image: linear-gradient(180deg, transparent, black 20%, black 80%, transparent); pointer-events: none; }

.duel-row {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex: none;
  padding: 10px 18px 6px;
}
.duel-row--enemy { padding-top: 9px; padding-bottom: 3px; }
.duel-row--player { padding-bottom: 5px; }
.hero-block { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 300px; }
.hero-portrait {
  position: relative; flex: none; display: grid; place-items: center;
  width: 43px; height: 43px; border-radius: 50%;
  color: var(--sc, var(--gold-2));
  font-family: var(--serif); font-size: 20px; font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--sc, var(--gold)) 55%, transparent);
  background:
    radial-gradient(circle at 40% 30%, color-mix(in srgb, var(--sc, var(--gold)) 28%, transparent), rgba(5, 13, 10, .92) 65%);
  box-shadow: inset 0 0 0 4px rgba(5, 13, 10, .68), inset 0 0 0 5px color-mix(in srgb, var(--sc, var(--gold)) 18%, transparent), 0 0 18px rgba(0,0,0,.25);
}
.hero-portrait--enemy { color: #d7a095; border-color: rgba(189, 105, 93, .56); background: radial-gradient(circle at 40% 30%, rgba(112, 52, 44, .38), rgba(10, 14, 12, .95) 68%); box-shadow: inset 0 0 0 4px rgba(5, 13, 10, .68), inset 0 0 0 5px rgba(189,105,93,.17), 0 0 18px rgba(0,0,0,.25); }
.hero-portrait-ring { position: absolute; inset: -5px; border: 1px dashed color-mix(in srgb, var(--sc, var(--gold)) 35%, transparent); border-radius: 50%; animation: slowSpin 26s linear infinite reverse; }
.hero-portrait--enemy .hero-portrait-ring { border-color: rgba(189,105,93,.28); }
.hero-info { min-width: 0; }
.hero-name-row { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.hero-side { font-size: 7px; letter-spacing: .12em; color: var(--gold-3); border: 1px solid rgba(203,176,118,.24); padding: 0 4px; line-height: 14px; }
.hero-name-row b { font-family: var(--serif); font-weight: 600; font-size: 14px; color: #e4dac6; letter-spacing: .03em; max-width: 188px; overflow: hidden; text-overflow: ellipsis; }
.hero-block--enemy .hero-name-row b { color: #e6c7c0; }
.hp-line { display: flex; align-items: center; gap: 7px; margin-top: 4px; }
.hp-track { width: clamp(88px, 10vw, 150px); height: 5px; background: rgba(0,0,0,.4); border: 1px solid rgba(203,176,118,.12); position: relative; }
.hp-fill { height: 100%; background: linear-gradient(90deg, #7baf91, #c1e0b8); transition: width .55s var(--ease); box-shadow: 0 0 9px rgba(122, 171, 143, .3); }
.hero-block--enemy .hp-fill { background: linear-gradient(90deg, #a65349, #df9480); box-shadow: 0 0 9px rgba(187, 94, 78, .2); }
.hp-number { font-family: var(--display); font-size: 10px; letter-spacing: .05em; color: #b6b9a7; }
.hero-block--enemy .hp-number { color: #c49c91; }
.hero-subline { margin-top: 2px; display: flex; gap: 5px; color: #626d62; font-size: 7.5px; letter-spacing: .04em; white-space: nowrap; }
.hero-subline span:first-child { font-family: var(--mono); }

.enemy-hand { display: flex; align-items: center; justify-content: center; gap: 0; flex: 1; min-width: 0; height: 38px; }
.card-back {
  width: 25px; height: 35px; margin-left: -5px;
  border-radius: 3px; border: 1px solid rgba(203,176,118,.35);
  background:
    radial-gradient(circle at 50% 50%, rgba(203,176,118,.24) 0 2px, transparent 2.5px),
    linear-gradient(145deg, #193227, #0b1813);
  box-shadow: 2px 2px 0 rgba(0,0,0,.2);
  position: relative;
}
.card-back::before { content: "學"; position: absolute; inset: 0; display: grid; place-items: center; color: rgba(203,176,118,.55); font-family: var(--serif); font-size: 10px; }
.card-back:nth-child(2n) { transform: translateY(2px) rotate(2deg); }
.card-back:nth-child(3n) { transform: translateY(-1px) rotate(-2deg); }
.enemy-hand-more { margin-left: 7px; font-family: var(--display); font-size: 8px; color: #6a7469; }

.resource-block { display: flex; align-items: center; gap: 12px; flex: none; }
.resource-label { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.resource-label span { font-size: 7px; letter-spacing: .12em; color: #666f65; }
.resource-label b { font-family: var(--display); font-size: 10px; color: #a8a48f; font-weight: 500; margin-top: 3px; }
.mana-pips { display: flex; align-items: center; gap: 2px; height: 16px; }
.pip { display: block; width: 5px; height: 9px; border-radius: 1px 1px 2px 2px; transform: skewX(-12deg); background: rgba(203,176,118,.12); border: 1px solid rgba(203,176,118,.2); transition: .25s var(--ease); }
.pip.is-available { background: linear-gradient(180deg, #f3dfab, #ae8d53); border-color: rgba(240, 215, 154, .6); box-shadow: 0 0 6px rgba(203,176,118,.25); }
.pip.is-full { background: linear-gradient(180deg, #879d7f, #4e6757); border-color: rgba(121, 158, 128, .3); }
.pip.is-empty { opacity: .3; }
.pip.is-friendly.is-available { background: linear-gradient(180deg, #a9d3bc, #5b9a7c); border-color: rgba(112, 163, 138, .55); }
.enemy-hand + .resource-block .pip.is-available { background: linear-gradient(180deg, #dca89c, #975446); border-color: rgba(189,105,93,.45); }

.deck-counter { display: flex; align-items: center; gap: 4px; color: #747d72; }
.deck-counter svg { width: 13px; height: 13px; opacity: .7; }
.deck-counter b { font-family: var(--display); font-size: 10px; font-weight: 500; }
.boss-power {
  width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(189,105,93,.25);
  color: #b57b6d; background: rgba(93,42,35,.14); position: relative;
}
.boss-power::after { content: "技"; font-family: var(--serif); font-size: 10px; }
.boss-power span { display: none; }
.boss-power:hover { border-color: rgba(189,105,93,.5); }

.board-zone { position: relative; z-index: 3; display: flex; align-items: center; justify-content: center; flex: 1; min-height: 0; padding: 2px 16px; }
.board { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 1.5vw, 20px); width: 100%; height: 100%; max-width: 520px; }
.board-caption { position: absolute; left: 18px; top: 50%; transform: translateY(-50%) rotate(-90deg) translateX(-50%); transform-origin: left center; display: flex; flex-direction: column; align-items: center; gap: 4px; color: rgba(203,176,118,.23); pointer-events: none; }
.board-caption span { font-family: var(--serif); font-size: 8px; letter-spacing: .15em; white-space: nowrap; }
.board-caption small { font-family: var(--display); font-size: 5px; letter-spacing: .15em; opacity: .6; }
.board-caption--right { left: auto; right: 18px; transform: translateY(-50%) rotate(90deg) translateX(50%); transform-origin: right center; }
.board-zone--enemy { padding-top: 0; padding-bottom: 1px; }
.board-zone--player { padding-top: 1px; padding-bottom: 0; }

.slot {
  position: relative; width: clamp(95px, 8.3vw, 123px); height: clamp(118px, 10.5vw, 153px);
  flex: 0 0 auto; border-radius: 9px;
  border: 1px dashed rgba(203,176,118,.22);
  background: radial-gradient(ellipse at 50% 45%, rgba(78, 117, 96, .14), transparent 75%);
  display: grid; place-items: center;
  transition: border-color .25s, background .25s, box-shadow .25s;
}
.slot::before {
  content: attr(data-seat); position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-family: var(--serif); font-size: 28px; color: rgba(203,176,118,.1); font-weight: 600;
}
.slot::after {
  content: ""; position: absolute; inset: 12%; border: 1px solid rgba(203,176,118,.045); border-radius: 50%;
}
.board-zone--enemy .slot { border-color: rgba(189,105,93,.18); }
.board-zone--enemy .slot::before { color: rgba(189,105,93,.055); }
.slot.is-targetable { border: 1px solid var(--gold); background: rgba(203,176,118,.09); box-shadow: 0 0 20px rgba(203,176,118,.14); cursor: crosshair; }
.slot.is-targetable::after { border-color: rgba(203,176,118,.35); animation: pulseSoft 1.7s infinite; }
.board-zone--enemy .slot.is-targetable { border-color: #d3887a; background: rgba(189,105,93,.1); box-shadow: 0 0 20px rgba(189,105,93,.14); }
.slot.is-targetable::before { color: rgba(203,176,118,.3); }
.slot.is-bad-target { opacity: .3; }

.unit {
  position: absolute; inset: 0; z-index: 2; overflow: hidden;
  border-radius: 7px;
  color: var(--charcoal);
  background: linear-gradient(150deg, #eee6d5, #dbcfb8);
  border: 1px solid rgba(70, 52, 26, .62);
  box-shadow: 0 0 0 2px rgba(8, 16, 13, .75), 0 0 0 3px color-mix(in srgb, var(--sc) 25%, transparent), 0 10px 20px rgba(0,0,0,.38);
  transition: transform .23s var(--ease), box-shadow .23s, filter .2s;
  cursor: default;
}
.unit::after { content: ""; position: absolute; pointer-events: none; inset: 0; background: linear-gradient(180deg, transparent 48%, rgba(5,12,9,.25)); }
.unit--enemy { background: linear-gradient(150deg, #e9dfd1, #d4c3b1); border-color: rgba(87, 43, 35, .62); box-shadow: 0 0 0 2px rgba(8,16,13,.75), 0 0 0 3px rgba(163, 87, 73, .35), 0 10px 20px rgba(0,0,0,.38); }
.unit__top {
  position: relative; z-index: 2; height: 16px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px; background: #15231c; border-bottom: 1px solid rgba(203,176,118,.2);
  color: rgba(240,225,194,.75); font-family: var(--mono); font-size: 6px; letter-spacing: .02em;
}
.unit--enemy .unit__top { background: #291915; border-color: rgba(189,105,93,.22); color: rgba(240,210,197,.7); }
.unit__top b { font-weight: 500; }
.unit__art { position: relative; z-index: 1; height: 57px; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--sc) 28%, transparent), transparent 70%), linear-gradient(160deg, color-mix(in srgb, var(--sc-deep) 82%, #17251d), #19251e); }
.unit__art::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,244,212,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255,244,212,.055) 1px, transparent 1px); background-size: 12px 12px; mask-image: radial-gradient(circle, black, transparent 80%); }
.unit__glyph { position: relative; z-index: 1; font-family: var(--serif); font-weight: 700; font-size: 31px; line-height: 1; color: color-mix(in srgb, var(--sc) 54%, #f0e4c7); opacity: .9; text-shadow: 0 3px 12px rgba(0,0,0,.35); }
.unit__school-icon { position: absolute; right: 4px; top: 4px; width: 11px; height: 11px; color: color-mix(in srgb, var(--sc) 45%, #f1e2c5); opacity: .65; }
.unit__name {
  position: relative; z-index: 2; padding: 3px 5px 0; font-family: var(--serif); font-size: 9px; font-weight: 700;
  line-height: 1.25; height: 27px; overflow: hidden; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.unit__name--long { font-size: 8px; }
.unit__name--xlong { font-size: 7.3px; }
.unit__tags { position: absolute; z-index: 2; left: 3px; bottom: 3px; display: flex; gap: 2px; flex-wrap: wrap; max-width: 60%; }
.unit__tag { font-family: var(--serif); font-size: 6px; line-height: 10px; padding: 0 2px; background: rgba(21,35,28,.8); color: #e5d5ac; border: 1px solid rgba(203,176,118,.25); }
.unit__tag--shield { color: #c4e3d3; border-color: rgba(112,163,138,.45); }
.unit__tag--taunt { color: #ddb6a8; border-color: rgba(189,105,93,.35); }
.unit__stat {
  position: absolute; z-index: 4; bottom: -4px;
  display: flex; align-items: center; justify-content: center;
  min-width: 24px; height: 20px; padding: 0 3px;
  font-family: var(--display); font-size: 12px; font-weight: 600; line-height: 1;
  color: #f2eadb; background: linear-gradient(145deg, #35453a, #101b15);
  border: 1px solid rgba(203,176,118,.38);
  box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.unit__stat--atk { left: 3px; }
.unit__stat--hp { right: 3px; background: linear-gradient(145deg, #60332b, #27130f); border-color: rgba(218,147,126,.45); }
.unit__stat i { font-family: var(--sans); font-size: 6px; font-style: normal; margin-left: 1px; opacity: .65; }
.unit.is-ready { cursor: pointer; }
.unit.is-ready::before {
  content: ""; position: absolute; z-index: 5; inset: -3px; border-radius: 9px; border: 1px solid rgba(209, 185, 124, .7);
  box-shadow: 0 0 16px rgba(203,176,118,.24); pointer-events: none; animation: readyPulse 2.6s infinite;
}
.unit.is-selected { transform: translateY(-7px); box-shadow: 0 0 0 2px rgba(8,16,13,.75), 0 0 0 4px var(--gold), 0 0 30px rgba(203,176,118,.3), 0 18px 28px rgba(0,0,0,.45); cursor: pointer; }
.unit.is-selected::before { display: none; }
.unit.is-sleeping { filter: saturate(.75) brightness(.82); }
.unit.is-sleeping::before { content: "Z"; position: absolute; z-index: 6; top: 18px; right: 3px; color: rgba(241,228,199,.63); font-family: var(--display); font-size: 8px; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.unit--enemy.is-ready { cursor: default; }
.unit--enemy.is-ready::before { border-color: rgba(189,105,93,.45); animation: none; }
.unit.is-spell-target { outline: 2px solid var(--gold); outline-offset: 3px; cursor: crosshair; }
.unit.is-hit { animation: hitShake .34s var(--ease); }
.unit.is-attacking-up { animation: lungeUp .34s var(--ease); z-index: 8; }
.unit.is-attacking-down { animation: lungeDown .34s var(--ease); z-index: 8; }
.unit.is-summoning { animation: summonIn .42s var(--ease-out); }
.unit.is-dying { animation: unitDie .38s var(--ease) forwards; pointer-events: none; }
.unit.is-silenced { filter: grayscale(.8); }

.hero-block.is-targetable .hero-portrait { outline: 2px solid var(--gold); outline-offset: 4px; box-shadow: 0 0 26px rgba(203,176,118,.22); cursor: crosshair; }
.hero-block--enemy.is-targetable .hero-portrait { outline-color: var(--red-2); box-shadow: 0 0 26px rgba(189,105,93,.22); }
.hero-block.is-bad-target { opacity: .5; }
.hero-block.is-hit .hero-portrait { animation: hitShake .34s var(--ease); }
.unit.is-targetable { outline: 2px solid var(--gold); outline-offset: 4px; cursor: crosshair; box-shadow: 0 0 0 2px rgba(8,16,13,.8), 0 0 0 4px rgba(203,176,118,.4), 0 0 24px rgba(203,176,118,.2); }
.unit.is-spell-target { outline: 2px solid var(--gold-2); outline-offset: 4px; cursor: crosshair; box-shadow: 0 0 0 2px rgba(8,16,13,.8), 0 0 0 4px rgba(203,176,118,.36), 0 0 30px rgba(240, 215, 154, .24); z-index: 5; }
.unit.is-spell-target::after { animation: pulseSoft 1.4s infinite; }
.board-zone--enemy .unit.is-targetable { outline-color: var(--red-2); box-shadow: 0 0 0 2px rgba(8,16,13,.8), 0 0 0 4px rgba(189,105,93,.4), 0 0 24px rgba(189,105,93,.2); }
.deck-count-card { position: relative; }
.deck-count-card > .card-mini-slot { position: absolute; right: -5px; bottom: 17px; }

.enemy-hand { pointer-events: none; }
.midline {
  position: relative; z-index: 4; display: flex; align-items: center; gap: 18px;
  flex: none; height: 37px; padding: 0 21px;
}
.midline-rule { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(203,176,118,.25), transparent); }
.turn-chip { display: flex; align-items: center; gap: 7px; color: var(--gold-2); white-space: nowrap; }
.turn-chip span { font-family: var(--serif); font-size: 10px; letter-spacing: .08em; }
.turn-chip small { font-family: var(--display); font-size: 6px; letter-spacing: .16em; color: #6e776b; border-left: 1px solid rgba(203,176,118,.22); padding-left: 7px; }
.turn-chip.is-enemy { color: #d49b8c; }
.chain-chip, .focus-chip { display: flex; align-items: center; gap: 6px; color: #a89b7e; white-space: nowrap; }
.chain-mark, .focus-mark { display: grid; place-items: center; width: 20px; height: 20px; font-family: var(--serif); font-size: 9px; border: 1px solid rgba(203,176,118,.23); color: var(--gold-3); }
.chain-chip > div, .focus-chip > div { display: flex; flex-direction: column; line-height: 1.15; }
.chain-chip small, .focus-chip small { font-family: var(--display); font-size: 5.5px; letter-spacing: .12em; color: #606a5f; }
.chain-chip b, .focus-chip b { font-family: var(--serif); font-size: 8.5px; font-weight: 500; color: #a99c82; margin-top: 1px; }
.chain-chip.is-hot .chain-mark { color: var(--gold-2); border-color: rgba(203,176,118,.65); background: rgba(203,176,118,.1); box-shadow: 0 0 12px rgba(203,176,118,.14); animation: pulseSoft 1.4s infinite; }
.chain-chip.is-hot b { color: var(--gold-2); }
.focus-chip b { color: var(--sc, var(--gold)); }

.player-resources { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.hero-power-card {
  display: flex; align-items: center; gap: 6px; min-width: 144px; height: 40px; padding: 4px 7px 4px 5px;
  border: 1px solid rgba(203,176,118,.23);
  color: #cabd9e; background: linear-gradient(135deg, rgba(203,176,118,.09), rgba(203,176,118,.02));
  text-align: left; transition: .22s var(--ease); position: relative;
}
.hero-power-card:hover:not(:disabled) { border-color: rgba(203,176,118,.52); background: linear-gradient(135deg, rgba(203,176,118,.16), rgba(203,176,118,.04)); transform: translateY(-1px); }
.hero-power-card:disabled { opacity: .46; }
.hero-power-card.is-unaffordable { opacity: .6; }
.hero-power-card.is-active { border-color: var(--gold); box-shadow: 0 0 17px rgba(203,176,118,.17); }
.hero-power-icon { width: 27px; height: 27px; flex: none; display: grid; place-items: center; border: 1px solid rgba(203,176,118,.22); background: rgba(6,15,12,.42); color: var(--gold); }
.hero-power-icon svg { width: 14px; height: 14px; }
.hero-power-copy { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.hero-power-copy small { display: flex; align-items: center; gap: 5px; font-family: var(--display); font-size: 5.5px; letter-spacing: .07em; color: #6e766a; white-space: nowrap; }
.hero-power-copy small em { display: grid; place-items: center; width: 13px; height: 13px; font-style: normal; font-family: var(--display); font-size: 7px; color: #1b1a12; background: var(--gold); border-radius: 50%; }
.hero-power-copy b { font-family: var(--serif); font-size: 9.5px; font-weight: 600; color: #cabea2; margin-top: 1px; white-space: nowrap; }
.hero-power-status { position: absolute; right: 6px; top: 4px; font-size: 6px; letter-spacing: .06em; color: #6c776b; }
.mana-cluster { display: flex; flex-direction: column; gap: 4px; }
.mana-heading { display: flex; align-items: baseline; gap: 8px; }
.mana-heading span { font-size: 7px; letter-spacing: .12em; color: #697267; }
.mana-heading b { font-family: var(--display); font-size: 10px; color: #b7ad93; font-weight: 500; }
.mana-cluster .pip { width: 6px; height: 11px; }
.player-resources .deck-counter { margin-left: 2px; }

.hand-area {
  position: relative; z-index: 10; flex: none; min-height: 0; height: clamp(186px, 30vh, 230px);
  padding: 0 72px 0 40px;
  display: flex; align-items: flex-end; justify-content: center;
  --hand-fan: 0;
}
.hand-ambient { position: absolute; left: 8%; right: 8%; bottom: -75px; height: 155px; background: radial-gradient(ellipse at 50% 100%, rgba(203,176,118,.09), transparent 65%); pointer-events: none; }
.hand { position: relative; width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; padding: 4px 5px 16px; }
.hand .card {
  --cw: clamp(118px, 9.3vw, 142px);
  margin-left: clamp(-27px, -1.8vw, -12px);
  transform-origin: 50% 100%;
  cursor: pointer;
  transition: transform .24s var(--ease), filter .24s, box-shadow .24s;
  z-index: 1;
}
.hand .card:first-child { margin-left: 0; }
.hand .card:nth-child(1) { transform: translateY(7px) rotate(-2.7deg); }
.hand .card:nth-child(2) { transform: translateY(2px) rotate(-1.4deg); }
.hand .card:nth-child(3) { transform: translateY(0) rotate(-.4deg); }
.hand .card:nth-child(4) { transform: translateY(1px) rotate(.7deg); }
.hand .card:nth-child(5) { transform: translateY(4px) rotate(1.8deg); }
.hand .card:nth-child(6) { transform: translateY(8px) rotate(2.8deg); }
.hand .card:nth-child(7) { transform: translateY(12px) rotate(3.6deg); }
.hand .card:nth-child(n+8) { transform: translateY(15px) rotate(4deg); }
.hand .card:hover { transform: translateY(-27px) rotate(0deg) scale(1.055); z-index: 20; box-shadow: 0 0 0 1px rgba(64,51,27,.5), 0 0 0 3px rgba(7,17,13,.8), 0 0 0 4px rgba(203,176,118,.6), 0 26px 50px rgba(0,0,0,.55); }
.hand .card.is-selected { transform: translateY(-22px) scale(1.035); z-index: 21; }
.hand .card.is-unplayable { cursor: default; }
.hand .card.is-unplayable:hover { transform: translateY(-2px) rotate(0deg); filter: grayscale(.5) brightness(.7); }
.hand .card.is-unaffordable { cursor: pointer; }
.hand .card.is-new { animation: cardDrawIn .55s var(--ease-out) both; }
.hand-help { position: absolute; right: 18px; bottom: 13px; color: rgba(188, 181, 160, .33); font-size: 8px; letter-spacing: .06em; pointer-events: none; text-align: right; }
.hand-empty { display: flex; flex-direction: column; align-items: center; gap: 5px; color: rgba(203,176,118,.22); font-family: var(--serif); font-size: 11px; letter-spacing: .15em; padding-bottom: 30px; }
.hand-empty::before { content: ""; width: 44px; height: 1px; background: rgba(203,176,118,.16); }

.target-hint {
  position: absolute; z-index: 30; left: 50%; bottom: clamp(180px, 26vh, 220px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px; padding: 8px 10px 8px 16px;
  border: 1px solid rgba(203,176,118,.52); background: rgba(7,17,13,.94);
  color: var(--gold-2); font-size: 10px; letter-spacing: .05em; white-space: nowrap;
  box-shadow: 0 8px 30px rgba(0,0,0,.4), 0 0 24px rgba(203,176,118,.08);
  animation: bannerIn .25s var(--ease-out);
}
.target-hint::before { content: ""; width: 5px; height: 5px; transform: rotate(45deg); background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.target-hint button { border: 1px solid rgba(203,176,118,.28); color: #aaa28d; font-size: 9px; padding: 3px 7px; letter-spacing: .05em; }
.target-hint button:hover { color: var(--gold-2); border-color: var(--gold-3); }
.target-hint small { font-family: var(--display); font-size: 7px; opacity: .4; margin-left: 3px; }
.turn-banner {
  position: absolute; z-index: 28; left: 50%; top: 49%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 18px 50px 16px; color: #efe3c8; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(5,13,10,.92) 20%, rgba(5,13,10,.92) 80%, transparent);
  border-top: 1px solid rgba(203,176,118,.3); border-bottom: 1px solid rgba(203,176,118,.3);
  animation: bannerIn .38s var(--ease-out);
}
.turn-banner span { font-family: var(--serif); font-size: 21px; letter-spacing: .22em; text-shadow: 0 0 24px rgba(203,176,118,.18); }
.turn-banner small { font-family: var(--display); font-size: 7px; letter-spacing: .3em; color: var(--gold-3); }

.focus-panel { padding-bottom: 9px; }
.focus-block { display: flex; align-items: center; gap: 8px; padding: 8px 11px 0; }
.focus-emblem { display: grid; place-items: center; width: 36px; height: 36px; flex: none; color: var(--sc, var(--gold)); border: 1px solid color-mix(in srgb, var(--sc, var(--gold)) 33%, transparent); font-family: var(--serif); font-size: 18px; background: color-mix(in srgb, var(--sc, var(--gold)) 7%, transparent); }
.focus-block > div { min-width: 0; }
.focus-block b { display: block; font-family: var(--serif); font-size: 12px; color: #d8cdb8; font-weight: 600; }
.focus-block p { color: #7f887c; font-size: 8.5px; line-height: 1.45; margin-top: 2px; }

.chain-panel { padding-bottom: 9px; min-height: 115px; }
.chain-track { display: flex; align-items: center; gap: 4px; height: 29px; padding: 8px 11px 0; }
.chain-node { flex: 1; height: 4px; background: rgba(203,176,118,.12); position: relative; }
.chain-node.is-filled { background: linear-gradient(90deg, var(--gold-3), var(--gold-2)); box-shadow: 0 0 7px rgba(203,176,118,.2); }
.chain-node.is-current { animation: pulseSoft 1.7s infinite; }
.chain-track-label { font-family: var(--mono); font-size: 7px; color: #7e7968; margin-left: 3px; white-space: nowrap; }
.chain-panel p { padding: 5px 11px 0; color: #727c71; font-size: 8.3px; line-height: 1.5; }

.log-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.battle-log { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 11px 8px; scrollbar-width: thin; scrollbar-color: rgba(203,176,118,.16) transparent; }
.log-entry { position: relative; padding: 5px 0 5px 10px; border-bottom: 1px solid rgba(203,176,118,.055); color: #7d877a; font-size: 8.3px; line-height: 1.45; }
.log-entry::before { content: ""; position: absolute; left: 0; top: 10px; width: 3px; height: 3px; background: #5a6659; transform: rotate(45deg); }
.log-entry b { color: #b8ad95; font-weight: 500; }
.log-entry--gold { color: #b6a477; }
.log-entry--gold::before { background: var(--gold-3); box-shadow: 0 0 5px rgba(203,176,118,.3); }
.log-entry--red { color: #b48478; }
.log-entry--red::before { background: #a25d51; }
.log-entry--green { color: #8da98f; }
.log-entry--green::before { background: #668d76; }
.log-empty { color: #566057; font-family: var(--serif); font-size: 9px; letter-spacing: .08em; padding: 10px 0; }

.pile-row { display: flex; gap: 5px; }
.pile-button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; height: 29px; border: 1px solid rgba(203,176,118,.12); color: #768075; font-size: 8px; transition: .2s; }
.pile-button svg { width: 11px; height: 11px; opacity: .65; }
.pile-button b { font-family: var(--display); font-size: 8px; color: #9f967f; font-weight: 500; }
.pile-button:hover { border-color: var(--line-strong); color: #b7ac91; background: rgba(203,176,118,.04); }

.end-turn-btn {
  flex: none; position: relative; display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: 57px; padding: 8px 10px 8px 17px; overflow: hidden;
  color: #1b1a12;
  border: 1px solid #e4c88a;
  background: linear-gradient(118deg, #efd9a2, #cbb076 55%, #a5854b 100%);
  box-shadow: 0 6px 19px rgba(0,0,0,.25), inset 0 1px rgba(255,255,255,.5);
  transition: .25s var(--ease);
}
.end-turn-btn::before { content: ""; position: absolute; inset: 3px; border: 1px solid rgba(38,29,12,.2); pointer-events: none; }
.end-turn-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(0,0,0,.32), 0 0 30px rgba(203,176,118,.14); }
.end-turn-btn:disabled { opacity: .44; filter: saturate(.5) brightness(.8); }
.end-turn-copy { display: flex; flex-direction: column; text-align: left; line-height: 1.1; }
.end-turn-copy b { font-family: var(--serif); font-size: 14px; letter-spacing: .13em; font-weight: 700; }
.end-turn-copy small { font-family: var(--display); font-size: 6px; letter-spacing: .23em; margin-top: 4px; opacity: .6; }
.end-turn-arrow { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid rgba(38,29,12,.25); }
.end-turn-arrow svg { width: 13px; height: 13px; }
.end-turn-btn.is-enemy { color: #b7aca0; border-color: rgba(189,105,93,.3); background: rgba(69,35,29,.33); box-shadow: none; opacity: 1; }
.end-turn-btn.is-enemy .end-turn-arrow { border-color: rgba(189,105,93,.22); }
.end-turn-btn.is-enemy .end-turn-copy small { color: #9e6e61; }
.end-turn-btn.is-enemy::before { border-color: rgba(189,105,93,.1); }
.end-turn-btn.is-enemy .end-turn-arrow svg { animation: spin 2s linear infinite; }

/* ───────────────────────── overlay / modal ───────────────────────── */

.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 26px;
  background: rgba(1, 6, 4, .76);
  backdrop-filter: blur(9px) saturate(.8);
  animation: overlayIn .28s var(--ease-out);
  overflow-y: auto;
}
.overlay.is-closing { animation: overlayOut .2s var(--ease) forwards; }
.overlay__panel {
  position: relative;
  width: min(100%, 620px);
  max-height: calc(100dvh - 52px);
  overflow-y: auto;
  border: 1px solid rgba(203,176,118,.3);
  background:
    radial-gradient(ellipse at 50% -10%, rgba(74, 109, 87, .17), transparent 42%),
    linear-gradient(160deg, #101f19, #07110e 64%);
  box-shadow: 0 34px 90px rgba(0,0,0,.64), 0 0 0 1px rgba(255,255,255,.02) inset;
  animation: modalIn .42s var(--ease-out);
  scrollbar-width: thin; scrollbar-color: rgba(203,176,118,.25) transparent;
}
.overlay__panel::before { content: ""; position: absolute; inset: 9px; border: 1px solid rgba(203,176,118,.08); pointer-events: none; }
.overlay__panel--rules { display: flex; flex-direction: column; overflow: hidden; }
.overlay__panel--rules .overlay__top, .overlay__panel--rules .overlay__foot { flex: none; }
.overlay__panel--rules .overlay__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(203,176,118,.25) transparent; }
.overlay__panel--wide { width: min(100%, 980px); }
.overlay__panel--rules { width: min(100%, 760px); }
.overlay__panel--deck { width: min(100%, 850px); }
.overlay__panel--intro { width: min(100%, 800px); }
.overlay__panel--reward { width: min(100%, 920px); }
.overlay__panel--result { width: min(100%, 590px); }
.overlay__panel--confirm { width: min(100%, 530px); }
.overlay__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 28px 32px 19px; border-bottom: 1px solid rgba(203,176,118,.14); }
.overlay__top .eyebrow { font-size: 8px; letter-spacing: .22em; color: var(--gold-3); }
.overlay__top h2 { margin-top: 6px; font-family: var(--serif); font-size: clamp(24px, 3vw, 31px); font-weight: 600; line-height: 1.25; letter-spacing: .08em; color: #ede2cd; }
.overlay__top p { margin-top: 5px; color: #7b8579; font-size: 11px; }
.modal-close { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid rgba(203,176,118,.23); color: #899184; font-size: 14px; transition: .22s; }
.modal-close:hover { color: var(--gold-2); border-color: var(--gold-3); background: rgba(203,176,118,.07); }
.overlay__body { padding: 23px 32px 30px; }
.overlay__foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 17px 32px 26px; border-top: 1px solid rgba(203,176,118,.13); }
.overlay__foot .btn:first-child { margin-right: auto; }

.rules-body { font-size: 11px; line-height: 1.8; color: #a1a99c; }
.rules-body h3 { display: flex; align-items: center; gap: 9px; margin: 22px 0 8px; font-family: var(--serif); font-size: 15px; color: #e2d6c0; letter-spacing: .06em; }
.rules-body h3:first-child { margin-top: 0; }
.rules-body h3::before { content: attr(data-n); display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid rgba(203,176,118,.26); color: var(--gold); font-family: var(--display); font-size: 8px; }
.rules-body p { margin: 7px 0; }
.rules-body b { color: var(--gold-2); font-weight: 500; }
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 9px; }
.rules-keyword { border: 1px solid rgba(203,176,118,.13); padding: 12px 13px; background: rgba(203,176,118,.025); }
.rules-keyword h4 { font-family: var(--serif); font-size: 13px; color: var(--gold); margin-bottom: 3px; letter-spacing: .06em; }
.rules-keyword p { margin: 0; color: #899286; font-size: 10px; line-height: 1.65; }
.rule-note { margin-top: 17px; padding: 11px 13px; border-left: 2px solid var(--gold-3); background: rgba(203,176,118,.045); color: #ac9f83; font-size: 10px; line-height: 1.65; }

.intro-layout { display: grid; grid-template-columns: 258px 1fr; gap: 30px; align-items: start; }
.intro-foe { border: 1px solid rgba(203,176,118,.14); padding: 19px 18px; background: rgba(203,176,118,.025); }
.intro-foe .hero-portrait { width: 70px; height: 70px; font-size: 31px; margin: 0 auto 12px; }
.intro-foe h3 { font-family: var(--serif); text-align: center; font-size: 19px; letter-spacing: .06em; color: #e9c9c1; }
.intro-foe .enemy-title { display: block; text-align: center; font-size: 8px; letter-spacing: .16em; color: #8e756c; margin-top: 3px; }
.intro-foe .enemy-quote { margin-top: 15px; padding-top: 12px; border-top: 1px solid rgba(203,176,118,.12); color: #857e70; font-family: var(--serif); font-size: 11px; line-height: 1.75; text-align: center; }
.intro-foe .enemy-spec { display: flex; flex-direction: column; gap: 4px; margin-top: 15px; }
.intro-foe .enemy-spec span { font-size: 8px; color: #6f796d; display: flex; justify-content: space-between; }
.intro-foe .enemy-spec b { color: #c1a37f; font-family: var(--display); font-weight: 500; font-size: 9px; }
.intro-info h3 { font-family: var(--serif); font-size: 24px; letter-spacing: .08em; color: #e8ddc8; line-height: 1.3; }
.intro-info > p { margin-top: 7px; color: #818b7e; font-size: 11px; }
.intro-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 17px; }
.intro-meta-cell { border: 1px solid rgba(203,176,118,.12); padding: 10px 12px; background: rgba(203,176,118,.025); }
.intro-meta-cell small { display: block; font-family: var(--display); font-size: 7px; letter-spacing: .13em; color: #687267; }
.intro-meta-cell b { display: block; font-family: var(--serif); font-size: 12px; color: #baa98b; font-weight: 500; margin-top: 4px; }
.mission-briefing { margin-top: 14px; display: flex; align-items: flex-start; gap: 10px; border-left: 2px solid var(--sc, var(--gold)); padding: 10px 12px; background: rgba(203,176,118,.045); }
.mission-briefing svg { width: 15px; height: 15px; color: var(--gold); margin-top: 2px; flex: none; }
.mission-briefing b { font-family: var(--serif); font-size: 12px; color: #dfd3ba; display: block; }
.mission-briefing p { color: #8b9487; font-size: 10px; margin-top: 2px; }
.intro-note { margin-top: 12px; color: #626c61; font-size: 9px; line-height: 1.6; }

.reward-body { text-align: center; }
.reward-body > p { max-width: 470px; margin: 0 auto 20px; color: #899285; font-size: 11px; line-height: 1.8; }
.reward-grid { display: flex; justify-content: center; gap: clamp(13px, 2.7vw, 28px); }
.reward-option { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.reward-option .card { transition: transform .25s var(--ease), filter .25s; cursor: pointer; }
.reward-option .card:hover { transform: translateY(-8px) scale(1.01); filter: brightness(1.05); }
.reward-option .card.is-chosen { outline: 2px solid var(--gold-2); outline-offset: 5px; box-shadow: 0 0 30px rgba(203,176,118,.23), 0 20px 40px rgba(0,0,0,.4); }
.reward-pick { font-size: 8px; letter-spacing: .13em; color: #8f836d; }
.after-battle { display: flex; align-items: center; justify-content: center; gap: 21px; margin-bottom: 23px; }
.after-battle .seal-mark { display: grid; place-items: center; width: 46px; height: 46px; background: var(--gold); color: var(--ink); font-family: var(--serif); font-size: 22px; transform: rotate(-4deg); box-shadow: 0 0 0 4px rgba(203,176,118,.14); }
.after-battle h2 { font-family: var(--serif); font-size: 28px; letter-spacing: .12em; color: #eddfc7; text-align: left; }
.after-battle p { margin-top: 3px; color: #7d887a; font-size: 10px; text-align: left; }
.reward-blessing { display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(203,176,118,.18); padding: 6px 12px; margin-bottom: 18px; color: #ac9d80; font-size: 9px; letter-spacing: .06em; }
.reward-blessing svg { width: 12px; height: 12px; color: var(--gold); }
.reward-actions { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }

.result-body { text-align: center; padding: 32px 44px 35px; }
.result-emblem { width: 82px; height: 82px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(203,176,118,.34); color: var(--gold-2); font-family: var(--serif); font-size: 37px; background: radial-gradient(circle at 40% 30%, rgba(203,176,118,.16), transparent 68%); box-shadow: 0 0 0 7px rgba(203,176,118,.05), 0 0 60px rgba(203,176,118,.08); }
.result-body.is-loss .result-emblem { border-color: rgba(189,105,93,.35); color: #d79787; background: radial-gradient(circle at 40% 30%, rgba(189,105,93,.16), transparent 68%); }
.result-body h2 { font-family: var(--serif); font-size: clamp(26px, 3.2vw, 38px); font-weight: 600; letter-spacing: .13em; color: #eee3cf; }
.result-body > p { margin-top: 8px; color: #858e80; font-size: 11px; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 25px auto 25px; max-width: 420px; background: rgba(203,176,118,.14); border: 1px solid rgba(203,176,118,.14); }
.result-stat { background: #0b1813; padding: 13px 8px; }
.result-stat b { display: block; font-family: var(--display); color: var(--gold-2); font-size: 20px; font-weight: 500; }
.result-stat span { display: block; margin-top: 3px; color: #6d776b; font-size: 8px; letter-spacing: .1em; }
.result-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.result-deck-note { margin-top: 21px; color: #5d685d; font-size: 8px; letter-spacing: .08em; }

.deck-summary { display: flex; gap: 20px; margin-bottom: 17px; align-items: center; }
.deck-summary-chip { display: flex; align-items: baseline; gap: 5px; color: #7e877a; font-size: 9px; }
.deck-summary-chip b { font-family: var(--display); font-size: 17px; font-weight: 500; color: var(--gold); }
.deck-tabs { display: flex; gap: 2px; border-bottom: 1px solid rgba(203,176,118,.13); margin-bottom: 16px; }
.deck-tab { padding: 8px 15px; color: #727c70; font-size: 10px; border-bottom: 1px solid transparent; margin-bottom: -1px; letter-spacing: .08em; }
.deck-tab.is-active { color: var(--gold-2); border-color: var(--gold); }
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.deck-empty { grid-column: 1 / -1; text-align: center; padding: 40px 0; color: #5b655b; font-family: var(--serif); font-size: 12px; letter-spacing: .1em; }
.deck-section { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; color: #8d856f; font-size: 9px; letter-spacing: .1em; padding: 7px 0 1px; }
.deck-section::after { content: ""; flex: 1; height: 1px; background: rgba(203,176,118,.1); }
.deck-count-card { display: flex; flex-direction: column; gap: 6px; }
.deck-count-card .card { --cw: 132px; }
.deck-count-card > span { color: #777f73; font-family: var(--mono); font-size: 8px; text-align: center; }
.card-mini-slot { position: relative; }
.card-mini-slot .qty { position: absolute; bottom: -5px; right: -5px; z-index: 6; min-width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #1a1a12; font-family: var(--display); font-size: 10px; border: 2px solid #0b1813; }

.confirm-body p { color: #9ba497; font-size: 11px; line-height: 1.8; }
.confirm-body .confirm-em { color: #d8c7a4; font-family: var(--serif); }

.mission-sheet { display: flex; gap: 15px; padding: 17px; border: 1px solid var(--line); background: rgba(203,176,118,.04); }
.mission-sheet-icon { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--gold); }
.mission-sheet-icon svg { width: 17px; height: 17px; }
.mission-sheet-main { flex: 1; min-width: 0; }
.mission-sheet-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mission-sheet-title h3 { font-family: var(--serif); font-size: 19px; color: #e4d8c2; letter-spacing: .04em; }
.mission-sheet-title span { font-family: var(--display); font-size: 10px; color: var(--gold); letter-spacing: .06em; }
.mission-sheet-main > p { color: #8b9487; font-size: 10px; margin-top: 4px; }
.mission-sheet .mission-progress { margin: 11px 0 0; }
.mission-sheet .mission-reward { margin: 9px 0 0; }
.mission-sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 11px; }
.mission-sheet-grid .intro-meta-cell { min-height: 92px; }
.mission-sheet-grid .intro-meta-cell b { line-height: 1.6; }
.mission-sheet-grid .intro-meta-cell p { color: #778274; font-size: 9px; line-height: 1.5; margin-top: 3px; }

/* ───────────────────────── toast / tooltip / floats ───────────────────────── */

#toast-root { position: fixed; z-index: 200; left: 50%; bottom: calc(clamp(186px, 30vh, 230px) + 14px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 8px; max-width: min(90vw, 520px);
  padding: 9px 17px; color: #d8cdb8; font-size: 10px; letter-spacing: .035em;
  background: rgba(9, 21, 16, .95); border: 1px solid rgba(203,176,118,.28);
  box-shadow: 0 10px 25px rgba(0,0,0,.38);
  animation: toastIn .25s var(--ease-out);
}
.toast::before { content: ""; width: 4px; height: 4px; flex: none; background: var(--gold); transform: rotate(45deg); }
.toast--warn { border-color: rgba(189,105,93,.36); color: #d3a89e; }
.toast--warn::before { background: var(--red); }
.toast--good { border-color: rgba(107,157,128,.35); color: #afcbb8; }
.toast--good::before { background: var(--green); }
.toast.is-out { animation: toastOut .2s ease forwards; }

.tooltip {
  position: fixed; z-index: 300; max-width: 250px; padding: 8px 11px;
  color: #c8bda7; background: rgba(6, 14, 11, .97); border: 1px solid rgba(203,176,118,.28);
  box-shadow: 0 8px 25px rgba(0,0,0,.4); font-size: 9px; line-height: 1.65;
  pointer-events: none; transform: translate(-50%, -100%);
}

.float-text {
  position: fixed; z-index: 250; pointer-events: none;
  font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--gold-2);
  text-shadow: 0 2px 8px rgba(0,0,0,.7); animation: floatAway .9s var(--ease-out) forwards;
}
.float-text--damage { color: #ef9e89; font-size: 27px; }
.float-text--heal { color: #9fd0b1; }
.float-text--shield { color: #c5dfec; font-family: var(--serif); font-size: 13px; letter-spacing: .08em; }

.chain-toast {
  position: fixed; z-index: 220; left: 50%; top: 44%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--gold-2); text-align: center; pointer-events: none;
  animation: chainToast 1.2s var(--ease-out) forwards;
  text-shadow: 0 3px 20px rgba(0,0,0,.7);
}
.chain-toast b { font-family: var(--serif); font-size: 22px; letter-spacing: .2em; font-weight: 600; }
.chain-toast small { font-family: var(--display); font-size: 7px; letter-spacing: .26em; color: #ac9567; }

/* animations */

@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlayOut { to { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.982); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }
@keyframes bannerIn { from { opacity: 0; transform: translate(-50%, -46%) scale(.98); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes floatAway { 0% { opacity: 0; transform: translate(-50%, 8px) scale(.8); } 20% { opacity: 1; transform: translate(-50%, -5px) scale(1.05); } 100% { opacity: 0; transform: translate(-50%, -48px) scale(.95); } }
@keyframes chainToast { 0% { opacity: 0; transform: translate(-50%, -42%) scale(.94); } 16% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -54%) scale(1.02); } }
@keyframes cardDrawIn { from { opacity: 0; transform: translateY(42px) scale(.88); } to { opacity: 1; } }
@keyframes summonIn { from { opacity: 0; transform: translateY(16px) scale(.84); filter: blur(3px) brightness(1.4); } to { opacity: 1; transform: none; filter: none; } }
@keyframes unitDie { 0% { opacity: 1; transform: scale(1); filter: none; } 40% { opacity: .9; transform: scale(1.03); filter: sepia(1) saturate(1.3); } 100% { opacity: 0; transform: scale(.8) translateY(14px); filter: sepia(1) brightness(.6); } }
@keyframes hitShake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-5px) rotate(-1.5deg); } 42% { transform: translateX(4px) rotate(1deg); } 65% { transform: translateX(-3px); } 82% { transform: translateX(2px); } }
@keyframes lungeUp { 0%,100% { transform: translateY(0); } 45% { transform: translateY(-26px) scale(1.035); } }
@keyframes lungeDown { 0%,100% { transform: translateY(0); } 45% { transform: translateY(24px) scale(1.035); } }
@keyframes readyPulse { 0%,100% { opacity: .46; } 50% { opacity: .9; } }
@keyframes pulseSoft { 0%,100% { opacity: .58; } 50% { opacity: 1; } }
@keyframes slowSpin { to { transform: rotate(360deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes chainSweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.reveal-1 { animation: revealUp .8s .05s var(--ease-out) both; }
.reveal-2 { animation: revealUp .9s .14s var(--ease-out) both; }
.reveal-3 { animation: revealUp .85s .26s var(--ease-out) both; }
.reveal-4 { animation: revealUp .8s .38s var(--ease-out) both; }
.reveal-5 { animation: revealUp .8s .48s var(--ease-out) both; }
@keyframes revealUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: none; } }

/* ───────────────────────── responsive ───────────────────────── */

@media (max-width: 1390px) {
  .title-layout { grid-template-columns: minmax(460px, 1fr) minmax(390px, .9fr); gap: 2vw; }
  .academy-layout { grid-template-columns: 192px minmax(0, 1fr) 314px; gap: 16px; }
  .major-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .battle-layout { grid-template-columns: 188px minmax(0, 1fr) 210px; gap: 10px; }
  .hand-area { padding-left: 24px; padding-right: 58px; }
  .hero-block { max-width: 255px; }
  .hero-name-row b { max-width: 150px; font-size: 13px; }
  .player-resources { gap: 8px; }
  .hero-power-card { min-width: 132px; }
}

@media (max-width: 1160px) {
  .battle-head-actions .objective-toggle { display: flex; align-items: center; justify-content: center; gap: 3px; width: auto; min-width: 44px; padding: 0 4px; }
  .battle-head-actions .objective-toggle svg { width: 13px; height: 13px; flex: none; }
  .battle-head-actions .objective-toggle-count { position: static; display: inline; min-width: 0; height: auto; padding: 0; border: 0; background: transparent; color: var(--gold); font-size: 7px; }
  .battle-head-actions .objective-toggle.is-complete .objective-toggle-count { background: transparent; color: #9ecab0; }
  .screen--title { padding: 0 28px; }
  .title-layout { grid-template-columns: 1.05fr .95fr; }
  .title-logo { font-size: clamp(74px, 10vw, 112px); }
  .title-visual { min-height: 440px; }
  .crest { width: min(47vw, 520px); }
  .crest-tick { height: calc(min(47vw, 520px) * .5 - 30px); }
  .site-nav { gap: 18px; }
  .academy-layout { grid-template-columns: 174px minmax(0, 1fr) 286px; padding-inline: 20px; gap: 13px; }
  .school-item { grid-template-columns: 25px 1fr auto; gap: 7px; }
  .school-item__seal { width: 24px; height: 24px; font-size: 12px; }
  .browse-tools { gap: 5px; }
  .search-box { width: 150px; }
  .select-box { font-size: 9px; width: 94px; }
  .detail-rail { padding-left: 17px; }
  .detail-card-slot { height: 292px; }
  .battle-layout { grid-template-columns: minmax(0, 1fr) 205px; }
  .battle-side--left { display: none; }
  .battle-head { gap: 12px; }
  .act-item__label { font-size: 8px; }
  .board { max-width: 470px; }
  .slot { width: 106px; height: 137px; }
  .unit__art { height: 50px; }
  .unit__glyph { font-size: 28px; }
  .unit__name { height: 25px; font-size: 8.5px; }
}

@media (max-width: 940px) {
  .site-head { min-height: 70px; }
  .screen--title { overflow-y: auto; }
  .title-layout { grid-template-columns: 1fr; padding-top: 30px; gap: 20px; }
  .title-copy { max-width: 680px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; }
  .title-logo { justify-content: center; margin: 17px 0 18px; }
  .eyebrow { justify-content: center; }
  .title-lede { max-width: 590px; }
  .title-stats { margin-top: 27px; text-align: left; }
  .source-note { margin-top: 13px; }
  .title-visual { height: 430px; min-height: 360px; margin-top: -74px; opacity: .9; }
  .crest { width: min(75vw, 470px); }
  .crest-tick { height: calc(min(75vw, 470px) * .5 - 30px); }
  .card-fan .card { transform-origin: 50% 160%; }
  .card-fan .card:nth-child(1) { display: none; }
  .card-fan .card:nth-child(2) { transform: translate(-80%, -55%) rotate(-7deg) scale(.78); }
  .card-fan .card:nth-child(3) { transform: translate(-32%, -52%) rotate(4deg) scale(.76); }
  .card-fan .card:nth-child(4) { transform: translate(12%, -47%) rotate(13deg) scale(.7); }
  .title-foot { flex-direction: column; justify-content: center; gap: 8px; padding: 16px 0; text-align: center; }
  .title-foot p { font-size: 9px; }
  .discipline-marquee { justify-content: center; gap: 12px; }
  .discipline-marquee span:nth-child(n+8) { display: none; }
  .title-orbit-note { display: none; }

  .sub-head { grid-template-columns: 1fr auto; min-height: 68px; padding-inline: 18px; }
  .sub-head-title { display: none; }
  .sub-head-actions { gap: 8px; }
  .sub-head .nav-link { display: none; }
  .academy-layout { grid-template-columns: 160px minmax(0, 1fr); padding: 12px 16px 16px; gap: 13px; }
  .school-rail { padding-right: 12px; }
  .detail-rail {
    position: fixed; z-index: 60; right: 0; top: 0; bottom: 0; width: min(370px, 88vw);
    padding: 20px 22px; border-left: 1px solid var(--line-strong);
    background: linear-gradient(155deg, #101f19, #07110e);
    box-shadow: -25px 0 60px rgba(0,0,0,.5);
    transform: translateX(102%); transition: transform .36s var(--ease);
  }
  .detail-rail.is-open { transform: none; }
  .detail-close { display: grid; place-items: center; }
  .detail-top { position: relative; padding-right: 32px; }
  .screen--academy::after { content: "点击专业查看档案"; position: absolute; left: 18px; bottom: 9px; color: #59645a; font-size: 8px; letter-spacing: .08em; }
  .major-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px 12px; }
  .browse-tools .select-box { display: none; }
  .browse-top h3 { font-size: 18px; }
  .browse-top { align-items: center; }
  .browse-top .eyebrow { display: none; }
  .browse-top > div:first-child { display: flex; align-items: center; min-width: 76px; }
  .search-box { width: clamp(140px, 25vw, 210px); }
  .major-grid .card .card__rule { display: -webkit-box; font-size: 9.5px; line-height: 1.5; margin-top: 5px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .major-grid .card .card__body { padding-top: 7px; }
  .major-grid .card .card__name { min-height: 16px; }

  .battle-head { height: 52px; padding-inline: 13px; gap: 8px; }
  .battle-brand { min-width: unset; }
  .battle-brand-word { display: none; }
  .act-item__label { display: none; }
  .act-item__line { width: 25px; margin-inline: 4px; }
  .act-item__dot { width: 19px; height: 19px; font-size: 7px; }
  .battle-head-actions { min-width: unset; gap: 4px; }
  .battle-head-actions .nav-link { display: none; }
  .battle-head-actions .round-button { width: 30px; height: 30px; }
  .battle-layout { grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 7px 8px 7px; }
  .battle-side--right { display: none; }
  .battle-head-actions .nav-link { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; font-size: 0; border: 1px solid var(--line); }
  .battle-head-actions .nav-link svg { width: 14px; height: 14px; }
  .battle-head-actions .objective-toggle { display: flex; }
  .duel-row--player .mobile-end-turn { display: flex; align-items: center; justify-content: center; flex: none; min-width: 68px; height: 36px; padding: 0 9px; color: #1b1a12; font-family: var(--serif); font-size: 11px; font-weight: 700; letter-spacing: .05em; border: 1px solid #e4c88a; background: linear-gradient(120deg, #efd9a2, #cbb076); box-shadow: 0 4px 12px rgba(0,0,0,.25); }
  .mobile-end-turn:disabled { opacity: .45; filter: saturate(.5) brightness(.75); }
  .hand { overflow-x: auto; overflow-y: hidden; justify-content: flex-start; padding: 3px 8px 12px; scrollbar-width: none; }
  .hand::-webkit-scrollbar { display: none; }
  .hand .card { margin-left: -4px; }
  .hand .card:first-child { margin-left: 0; }
  .hand-help { display: none; }
  .target-hint { bottom: calc(164px + 12px); }
  .duel-row { padding-inline: 12px; }
  .hero-block { max-width: 210px; gap: 7px; }
  .hero-portrait { width: 35px; height: 35px; font-size: 17px; }
  .hero-name-row b { font-size: 11px; max-width: 112px; }
  .hero-side { display: none; }
  .hero-subline { font-size: 6.5px; }
  .hp-track { width: 85px; }
  .enemy-hand { display: none; }
  .resource-block { gap: 7px; }
  .resource-label { display: none; }
  .mana-pips { max-width: 75px; overflow: hidden; }
  .boss-power { width: 23px; height: 23px; }
  .board-zone { padding-inline: 6px; }
  .board { max-width: 400px; gap: 9px; }
  .slot { width: 92px; height: 123px; }
  .unit__art { height: 43px; }
  .unit__glyph { font-size: 25px; }
  .unit__name { height: 23px; font-size: 7.7px; padding-top: 2px; }
  .unit__top { font-size: 5.2px; height: 14px; }
  .unit__stat { min-width: 20px; height: 18px; font-size: 10px; }
  .unit__tags { display: none; }
  .midline { gap: 9px; padding-inline: 12px; height: 31px; }
  .turn-chip span { font-size: 9px; }
  .turn-chip small { display: none; }
  .chain-chip small, .focus-chip small { display: none; }
  .chain-chip b, .focus-chip b { font-size: 8px; margin: 0; }
  .chain-mark, .focus-mark { width: 17px; height: 17px; font-size: 8px; }
  .player-resources { gap: 6px; }
  .hero-power-card { min-width: 112px; padding-right: 5px; }
  .hero-power-icon { width: 23px; height: 23px; }
  .hero-power-copy b { font-size: 8.5px; }
  .hero-power-status { display: none; }
  .mana-heading span { display: none; }
  .hand-area { height: 164px; padding: 0 45px 0 16px; }
  .hand .card { --cw: 104px; margin-left: -27px; }
  .hand-help { display: none; }
  .hand-empty { font-size: 9px; }

  .overlay { padding: 15px; }
  .overlay__top { padding: 23px 23px 16px; }
  .overlay__body { padding: 19px 23px 23px; }
  .overlay__foot { padding: 15px 23px 21px; }
  .intro-layout { grid-template-columns: 205px 1fr; gap: 20px; }
  .reward-grid { gap: 11px; }
  .reward-option .card { --cw: 150px; }
  .overlay__panel--reward { width: min(100%, 620px); }
}

.mobile-end-turn { display: none; }
.objective-toggle { display: none; position: relative; }
.objective-toggle-count {
  position: absolute; right: -4px; top: -5px;
  min-width: 20px; height: 13px; padding: 0 3px;
  display: grid; place-items: center;
  font-family: var(--display); font-size: 6px; letter-spacing: .02em;
  color: var(--ink); background: var(--gold); border: 1px solid var(--ink);
}
.objective-toggle.is-complete .objective-toggle-count { background: #99c7ad; }

@media (max-width: 700px) {
  .screen--title { padding: 0 17px; }
  .site-head { min-height: 62px; }
  .brand-seal { width: 34px; height: 34px; font-size: 19px; }
  .brand-word b { font-size: 14px; }
  .site-nav .nav-link { display: none; }
  .title-logo { font-size: clamp(62px, 18vw, 92px); }
  .title-kicker { font-size: 16px; }
  .title-lede { font-size: 12px; line-height: 1.8; margin-top: 13px; }
  .title-actions { margin-top: 24px; gap: 8px; }
  .btn--large { min-height: 46px; padding: 0 19px; font-size: 12px; }
  .title-stats { margin-top: 24px; }
  .stat { padding: 12px 10px; }
  .stat strong { font-size: 19px; }
  .stat span { font-size: 8px; letter-spacing: .11em; }
  .title-visual { height: 360px; min-height: 300px; margin-top: -50px; }
  .card-fan .card:nth-child(1), .card-fan .card:nth-child(4) { display: none; }
  .card-fan .card:nth-child(2) { transform: translate(-92%, -56%) rotate(-7deg) scale(.65); }
  .card-fan .card:nth-child(3) { transform: translate(-20%, -52%) rotate(6deg) scale(.66); }
  .discipline-marquee { gap: 8px 10px; }
  .discipline-marquee span { font-size: 8px; }
  .discipline-marquee span:nth-child(n+7) { display: none; }
  .title-foot { padding: 12px 0 14px; }
  .source-note { font-size: 8px; }

  .academy-layout { grid-template-columns: minmax(0, 1fr); min-width: 0; padding: 10px 12px 14px; }
  .school-rail { display: block; border-right: 0; padding: 0; min-width: 0; }
  .browse-panel { width: 100%; min-width: 0; overflow: hidden; }
  .browse-top { flex-wrap: wrap; align-items: flex-start; gap: 8px; }
  .browse-tools { width: 100%; }
  .search-box { width: auto; flex: 1; }
  .rail-heading, .rail-foot, .school-item__count { display: none; }
  .school-list { display: flex; overflow-x: auto; gap: 5px; margin: 0 -3px 8px; padding: 0 3px 8px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .school-list::-webkit-scrollbar { display: none; }
  .school-item { width: auto; min-width: max-content; grid-template-columns: 20px auto; min-height: 30px; padding: 3px 8px; border: 1px solid rgba(203,176,118,.11); }
  .school-item__seal { width: 20px; height: 20px; font-size: 10px; }
  .school-item__name small { display: none; }
  .school-item__name { font-size: 10px; }
  .school-item.is-active { border-color: rgba(203,176,118,.5); }
  .browse-panel { min-height: 0; }
  .browse-top { padding-bottom: 8px; gap: 8px; }
  .browse-top h3 { font-size: 16px; letter-spacing: .05em; }
  .browse-top > div:first-child { min-width: auto; }
  .search-box { width: min(43vw, 185px); }
  .icon-tile { display: none; }
  .browse-summary { font-size: 8px; }
  .browse-summary span { display: none; }
  .major-grid { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 10px; padding: 5px 4px 18px; }
  .major-grid .card .card__name { font-size: 13px; }
  .major-grid .card .card__name--long { font-size: 11.5px; }
  .major-grid .card .card__name--xlong { font-size: 10px; }
  .detail-rail { width: 92vw; padding: 17px 18px; }
  .detail-close { display: grid; place-items: center; }
  .detail-top { position: relative; padding-right: 32px; }
  .detail-card-slot { height: 272px; }
  .detail-top h3 { font-size: 17px; }

  .battle-head { height: 48px; }
  .battle-brand .brand-seal { width: 28px; height: 28px; font-size: 15px; }
  .battle-head-actions { gap: 3px; }
  .battle-head-actions .nav-link { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; font-size: 0; border: 1px solid var(--line); }
  .battle-head-actions .nav-link svg { width: 14px; height: 14px; }
  .battle-head-actions .round-button { width: 28px; height: 28px; }
  #btn-battle-sound { display: none; }
  .battle-layout { grid-template-columns: minmax(0, 1fr); padding: 5px 5px 6px; }
  .battle-side--right { display: none; }
  .mobile-end-turn { display: flex; align-items: center; justify-content: center; flex: none; min-width: 62px; height: 34px; padding: 0 8px; color: #1b1a12; font-family: var(--serif); font-size: 10px; font-weight: 700; letter-spacing: .05em; border: 1px solid #e4c88a; background: linear-gradient(120deg, #efd9a2, #cbb076); box-shadow: 0 4px 12px rgba(0,0,0,.25); }
  .mobile-end-turn:disabled { opacity: .45; filter: saturate(.5) brightness(.75); }
  .end-turn-copy b { font-size: 11px; }
  .end-turn-copy small { font-size: 5px; }
  .end-turn-arrow { display: none; }
  .duel-row { padding: 7px 8px 3px; }
  .hero-block { max-width: 185px; gap: 6px; }
  .hero-portrait { width: 31px; height: 31px; font-size: 14px; }
  .hero-name-row b { font-size: 10px; max-width: 108px; }
  .hero-subline span:first-child { display: none; }
  .hp-track { width: 74px; height: 4px; }
  .hp-number { font-size: 8px; }
  .resource-block { gap: 5px; }
  .mana-pips { max-width: 48px; gap: 1px; }
  .mana-pips .pip { width: 4px; height: 8px; }
  .deck-counter { display: none; }
  .boss-power { display: none; }
  .board-zone { padding-inline: 2px; }
  .board { max-width: 340px; gap: 6px; }
  .slot { width: 84px; height: 114px; }
  .unit__top { height: 12px; font-size: 4.6px; padding-inline: 2px; }
  .unit__art { height: 38px; }
  .unit__glyph { font-size: 22px; }
  .unit__name { height: 23px; font-size: 7px; padding: 2px 2px 0; }
  .unit__stat { min-width: 18px; height: 16px; font-size: 9px; padding: 0 2px; }
  .unit__stat--atk { left: 2px; }
  .unit__stat--hp { right: 2px; }
  .board-caption { display: none; }
  .midline { padding-inline: 7px; gap: 7px; height: 27px; }
  .midline-rule { display: none; }
  .turn-chip small { display: none; }
  .focus-chip { margin-left: auto; }
  .chain-chip small, .focus-chip small { display: none; }
  .player-resources { gap: 5px; margin-left: auto; }
  .hero-power-card { min-width: 76px; height: 32px; padding: 2px 4px; gap: 4px; }
  .hero-power-icon { width: 20px; height: 20px; }
  .hero-power-copy small { display: none; }
  .hero-power-copy b { font-size: 7.5px; max-width: 44px; overflow: hidden; text-overflow: ellipsis; }
  .hero-power-status { display: none; }
  .mana-heading span { display: none; }
  .mana-heading b { font-size: 8px; }
  .mana-pips { max-width: 42px; }
  .hand-area { height: 186px; padding: 0 10px 0 3px; }
  .hand { justify-content: flex-start; overflow-x: auto; overflow-y: hidden; padding: 4px 6px 12px; scrollbar-width: none; }
  .hand::-webkit-scrollbar { display: none; }
  .hand .card { --cw: 100px; margin-left: -6px; }
  .hand .card:first-child { margin-left: 0; }
  .hand .card:nth-child(n) { transform: translateY(0) rotate(0deg); }
  .hand .card:hover { transform: translateY(0) rotate(0) scale(1); }
  .hand .card:nth-child(n+6) { --cw: 100px; }
  .target-hint { bottom: calc(186px + 10px); max-width: 92vw; white-space: normal; }
  .hand-help { display: none; }
  .target-hint { bottom: 145px; font-size: 9px; padding: 7px 8px 7px 12px; gap: 9px; }
  .turn-banner { padding: 12px 28px; }
  .turn-banner span { font-size: 16px; }

  .overlay { padding: 8px; align-items: flex-end; }
  .overlay__panel { max-height: calc(100dvh - 16px); border-color: rgba(203,176,118,.36); }
  .overlay__top { padding: 18px 17px 13px; }
  .overlay__top h2 { font-size: 22px; }
  .overlay__body { padding: 16px 17px 19px; }
  .overlay__foot { padding: 12px 17px 17px; }
  .rules-grid { grid-template-columns: 1fr; }
  .intro-layout { grid-template-columns: 1fr; gap: 15px; }
  .intro-foe { display: grid; grid-template-columns: 58px 1fr; align-items: center; gap: 11px; padding: 13px; }
  .intro-foe .hero-portrait { width: 52px; height: 52px; font-size: 23px; margin: 0; grid-row: span 2; }
  .intro-foe h3 { text-align: left; font-size: 16px; }
  .intro-foe .enemy-title { text-align: left; }
  .intro-foe .enemy-quote, .intro-foe .enemy-spec { display: none; }
  .intro-info h3 { font-size: 20px; }
  .intro-meta { margin-top: 11px; }
  .intro-meta-cell { padding: 8px 9px; }
  .intro-meta-cell b { font-size: 10px; }
  .mission-briefing { margin-top: 10px; }
  .reward-grid { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 7px 4px 15px; gap: 14px; }
  .reward-option .card { --cw: 142px; }
  .reward-body > p { font-size: 10px; }
  .after-battle { gap: 12px; }
  .after-battle h2 { font-size: 23px; }
  .after-battle .seal-mark { width: 38px; height: 38px; font-size: 18px; }
  .result-body { padding: 25px 19px 28px; }
  .result-stats { max-width: 300px; }
  .result-actions { flex-direction: column; align-items: stretch; }
  .result-actions .btn { width: 100%; }
  .deck-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .deck-count-card .card { --cw: 100%; width: 100%; aspect-ratio: 1/1.455; }
  .deck-summary { margin-bottom: 11px; gap: 13px; }
  #toast-root { bottom: calc(186px + 12px); }
}

@media (max-height: 730px) and (min-width: 941px) {
  .battle-head { height: 50px; }
  .battle-layout { padding-top: 7px; padding-bottom: 6px; }
  .duel-row { padding-top: 6px; padding-bottom: 1px; }
  .hero-portrait { width: 37px; height: 37px; font-size: 18px; }
  .hero-name-row b { font-size: 12px; }
  .hand-area { height: 210px; }
  .hand .card { --cw: clamp(108px, 8.5vw, 126px); }
  .slot { height: clamp(108px, 10.1vw, 139px); }
  .unit__art { height: 48px; }
  .board { max-width: 485px; }
  .midline { height: 33px; }
  .battle-layout { grid-template-columns: 196px minmax(0, 1fr) 214px; }
  .motif-panel { display: none; }
  .detail-card-slot { height: 292px; }
  .title-logo { font-size: clamp(72px, 8.7vw, 124px); }
  .title-visual { min-height: 430px; height: min(70vh, 570px); }
  .title-stats { margin-top: 24px; }
  .title-actions { margin-top: 25px; }
  .title-lede { margin-top: 13px; }
  .source-note { margin-top: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
