:root {
  --ink: #f6f3ef;
  --muted: #a8a3b1;
  --panel: rgba(20, 19, 29, .78);
  --line: rgba(255, 255, 255, .12);
  --accent: #ff4f87;
  --accent-2: #ffbd69;
  --cyan: #74ddd6;
  --bg: #090910;
  --display: "Arial Narrow", "Pretendard", "Noto Sans KR", sans-serif;
  --body: "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--body); background: radial-gradient(circle at 15% 5%, #24182c 0, transparent 33%), radial-gradient(circle at 95% 100%, #10252a 0, transparent 35%), var(--bg); overflow-x: hidden; }
button { font: inherit; color: inherit; }
button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
button:not(:disabled) { cursor: pointer; }
[hidden] { display: none !important; }

.noise { position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .045; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E"); }
#app { min-height: 100vh; }
.topbar { position: fixed; z-index: 30; top: 0; left: 0; right: 0; height: 76px; padding: 0 clamp(18px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; background: linear-gradient(180deg, rgba(9,9,16,.94), rgba(9,9,16,.2)); pointer-events: none; }
.topbar button, .topbar-actions { pointer-events: auto; }
.brand-button { display: flex; align-items: center; gap: 12px; padding: 0; border: 0; background: none; text-align: left; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; color: #111; font: 900 13px var(--display); letter-spacing: -.06em; background: var(--ink); clip-path: polygon(10% 0,100% 0,90% 100%,0 100%); }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font: 800 12px var(--display); letter-spacing: .2em; }
.brand-copy small { color: var(--muted); font-size: 9px; letter-spacing: .09em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.route-count { color: var(--muted); font: 700 10px var(--display); letter-spacing: .16em; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: rgba(10,10,18,.5); transition: .2s; }
.icon-button:hover { border-color: var(--ink); transform: rotate(8deg); }

main { min-height: 100vh; }
.screen { display: none; min-height: 100vh; padding: 104px clamp(18px, 4vw, 64px) 38px; opacity: 0; }
.screen.is-active { display: block; animation: screen-in .46s ease forwards; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.eyebrow { margin: 0 0 14px; color: var(--accent-2); font: 800 10px var(--display); letter-spacing: .25em; }

.title-screen { position: relative; overflow: hidden; display: none; align-items: center; }
.title-screen.is-active { display: flex; }
.title-content { position: relative; z-index: 3; width: min(820px, 72vw); padding-left: clamp(0px, 5vw, 80px); }
.title-content h1 { margin: 0; font: 900 clamp(54px, 9vw, 132px)/.78 var(--display); letter-spacing: -.075em; text-transform: uppercase; }
.title-content h1 span, .title-content h1 em { display: block; }
.title-content h1 em { margin-left: clamp(30px, 9vw, 140px); color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.72); font-style: normal; }
.title-lead { max-width: 560px; margin: 36px 0 28px; color: #c9c5cf; font-size: 15px; line-height: 1.8; }
.title-actions { display: flex; align-items: center; gap: 24px; }
.primary-button, .play-button { position: relative; min-height: 52px; padding: 0 22px; border: 0; color: #170d12; background: var(--accent); font-weight: 900; overflow: hidden; transition: transform .2s, filter .2s; }
.primary-button::before, .play-button::before { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 25%, rgba(255,255,255,.28), transparent 70%); transform: translateX(-110%); transition: transform .45s; }
.primary-button:hover::before, .play-button:hover::before { transform: translateX(110%); }
.primary-button:hover, .play-button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.primary-button { display: inline-flex; align-items: center; gap: 30px; clip-path: polygon(0 0, 94% 0, 100% 28%, 100% 100%, 6% 100%, 0 72%); }
.primary-button kbd { color: rgba(18,8,13,.55); font: 800 9px var(--display); letter-spacing: .12em; }
.text-button { padding: 8px 0; border: 0; border-bottom: 1px solid var(--line); color: var(--muted); background: none; }
.emotion-marquee { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 42px; }
.emotion-marquee span { padding: 7px 11px; border: 1px solid var(--line); color: var(--muted); font-size: 10px; animation: soft-pulse 4s calc(var(--i) * .2s) ease-in-out infinite; }
@keyframes soft-pulse { 50% { color: var(--ink); border-color: rgba(255,255,255,.3); } }
.title-rule-card { position: absolute; z-index: 4; right: clamp(18px, 5vw, 90px); bottom: clamp(30px, 8vh, 100px); width: min(290px, 26vw); display: grid; grid-template-columns: 34px 1fr; gap: 16px 10px; padding: 22px; border: 1px solid var(--line); background: rgba(9,9,16,.56); backdrop-filter: blur(16px); }
.rule-number { color: var(--accent); font: 900 11px var(--display); }
.title-rule-card p { margin: 0; color: #c0bbc6; font-size: 12px; line-height: 1.55; }
.title-orbit { position: absolute; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; }
.title-orbit::before { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 28px var(--accent); }
.orbit-a { width: min(68vw, 960px); aspect-ratio: 1; right: -20vw; top: -32vw; animation: spin 22s linear infinite; }
.orbit-a::before { left: 8%; top: 67%; }
.orbit-b { width: min(45vw, 620px); aspect-ratio: 1; left: -18vw; bottom: -28vw; animation: spin 30s linear infinite reverse; }
.orbit-b::before { right: 14%; top: 22%; background: var(--cyan); box-shadow: 0 0 28px var(--cyan); }
@keyframes spin { to { transform: rotate(360deg); } }

.roster-screen { max-width: 1500px; margin: 0 auto; }
.screen-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin: 12px 0 32px; }
.screen-heading h2 { margin: 0; font: 900 clamp(34px, 5vw, 72px)/1 var(--display); letter-spacing: -.055em; }
.screen-heading > p { margin: 0 0 4px; color: var(--muted); font-size: 12px; line-height: 1.7; text-align: right; }
.roster-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.roster-card { position: relative; min-height: 370px; padding: 0; border: 1px solid var(--line); background: #13121a; overflow: hidden; text-align: left; isolation: isolate; transition: transform .25s, border-color .25s; }
.roster-card:hover { transform: translateY(-5px); border-color: var(--character-color); }
.roster-card::after { content: ""; position: absolute; z-index: 1; inset: 38% 0 0; background: linear-gradient(180deg, transparent, rgba(7,7,12,.9) 43%, #090910); }
.roster-card img { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 18%; filter: saturate(.85) contrast(1.04); transition: transform .5s, filter .4s; }
.roster-card:hover img { transform: scale(1.035); filter: saturate(1.05) contrast(1.03); }
.roster-fallback { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--character-color) 48%, #17131f), #0c0c12 72%); }
.roster-fallback span { font: 900 110px var(--display); color: rgba(255,255,255,.12); }
.card-index { position: absolute; z-index: 3; top: 16px; left: 16px; padding: 5px 8px; color: #111; background: var(--character-color); font: 900 9px var(--display); letter-spacing: .1em; }
.completion-stamp { position: absolute; z-index: 3; top: 15px; right: 15px; padding: 6px 9px; border: 1px solid rgba(255,255,255,.45); color: white; font: 800 9px var(--display); letter-spacing: .12em; transform: rotate(3deg); }
.roster-card-copy { position: absolute; z-index: 4; left: 20px; right: 20px; bottom: 18px; }
.roster-card-copy small { color: var(--character-color); font: 800 9px var(--display); letter-spacing: .14em; }
.roster-card-copy small b { padding: 3px 5px; color: #111; background: var(--character-color); font: inherit; }
.roster-card-copy h3 { margin: 5px 0 7px; font: 900 30px var(--display); letter-spacing: -.035em; }
.roster-card-copy p { margin: 0; color: #c8c3cc; font-size: 11px; line-height: 1.55; }
.roster-card-copy .card-cta { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: #f2edf3; font: 800 10px var(--display); letter-spacing: .08em; }
.compound-teaser { margin-top: 14px; padding: 18px 22px; border: 1px dashed var(--line); display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.compound-teaser > div { display: flex; align-items: center; gap: 14px; }
.lock-icon { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); }
.compound-teaser strong, .compound-teaser small { display: block; }
.compound-teaser strong { color: var(--ink); font-size: 12px; }
.compound-teaser small { margin-top: 4px; font-size: 10px; }
.coming-soon { font: 800 9px var(--display); letter-spacing: .2em; }

.battle-screen { padding: 88px 28px 24px; }
.battle-hud { height: 50px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; max-width: 1480px; margin: 0 auto 10px; }
.back-button { justify-self: start; padding: 8px 0; border: 0; color: var(--muted); background: none; font-size: 11px; }
.back-button:hover { color: var(--ink); }
.turn-track { display: flex; gap: 8px; }
.turn-dot { width: 34px; height: 4px; background: rgba(255,255,255,.12); transition: .3s; }
.turn-dot.is-done { background: var(--accent); }
.turn-dot.is-current { background: var(--accent-2); box-shadow: 0 0 12px rgba(255,189,105,.45); }
.reserve-chip { justify-self: end; display: flex; align-items: baseline; gap: 4px; padding: 8px 12px; border: 1px solid var(--line); background: rgba(10,10,17,.6); }
.reserve-chip span { margin-right: 7px; color: var(--muted); font-size: 9px; }
.reserve-chip strong { color: var(--cyan); font: 900 18px var(--display); }
.reserve-chip small { color: var(--muted); font-size: 9px; }
.reserve-chip.is-low { border-color: #ff826d; animation: reserve-warning 1s ease-in-out infinite; }
@keyframes reserve-warning { 50% { box-shadow: 0 0 0 3px rgba(255, 90, 90, .09); } }
.battle-layout { max-width: 1480px; height: calc(100vh - 172px); min-height: 640px; margin: 0 auto; display: grid; grid-template-columns: minmax(360px, .95fr) minmax(270px, .54fr) minmax(540px, 1.26fr); grid-template-rows: minmax(250px, 1fr) auto; gap: 10px; }
.date-stage { position: relative; grid-row: 1 / 3; min-height: 0; overflow: hidden; border: 1px solid var(--line); background: radial-gradient(circle at 50% 26%, color-mix(in srgb, var(--character-color, #6cc) 40%, #15121d), #090910 70%); isolation: isolate; }
.date-stage::before { content: ""; position: absolute; z-index: 1; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(7,7,12,.94) 95%), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 100%, 52px 100%; }
.portrait-wrap { position: absolute; inset: 0; }
.portrait-wrap img { position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: center 18%; z-index: 0; }
.portrait-fallback { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle, color-mix(in srgb, var(--character-color, #6cc) 48%, #1c1722), #090910 72%); }
.portrait-fallback span { color: rgba(255,255,255,.14); font: 900 160px var(--display); }
.character-plaque { position: absolute; z-index: 3; left: 26px; right: 26px; bottom: 24px; }
.character-tags { display: flex; align-items: center; gap: 10px; }
.character-tags > span { color: var(--character-color); font: 800 9px var(--display); letter-spacing: .15em; }
.mbti-badge { padding: 4px 6px; color: #111; background: var(--character-color); font: 900 8px var(--display); letter-spacing: .08em; }
.character-plaque h2 { margin: 6px 0 8px; font: 900 clamp(38px, 4.5vw, 70px)/.9 var(--display); letter-spacing: -.055em; }
.character-plaque p { margin: 0; max-width: 420px; color: #d0ccd4; font-size: 11px; line-height: 1.55; }
.stage-ambient { position: absolute; z-index: -1; width: 250px; height: 250px; border-radius: 50%; filter: blur(70px); opacity: .36; }
.ambient-one { top: -80px; left: -90px; background: var(--character-color); }
.ambient-two { right: -100px; bottom: 12%; background: var(--accent); }
.reaction-burst { position: absolute; z-index: 8; top: 26%; left: 50%; width: max-content; transform: translate(-50%, 10px) rotate(-3deg); padding: 10px 15px; border: 1px solid currentColor; color: var(--accent-2); background: rgba(8,8,14,.9); box-shadow: 0 10px 35px rgba(0,0,0,.38); font: 900 14px var(--display); letter-spacing: .08em; opacity: 0; pointer-events: none; }
.reaction-burst.is-visible { animation: burst 4.6s ease both; }
@keyframes burst { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.8) rotate(-3deg); } 8%, 84% { opacity: 1; transform: translate(-50%, 0) scale(1) rotate(-3deg); } 100% { opacity: 0; transform: translate(-50%, -8px) rotate(-3deg); } }

.status-panel { grid-row: 1 / 3; display: flex; flex-direction: column; min-height: 0; padding: 20px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(18px); }
.status-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; }
.status-heading span { font: 800 10px var(--display); letter-spacing: .18em; }
.status-heading small { color: var(--accent-2); font-size: 9px; }
.gauge-block + .gauge-block { margin-top: 17px; }
.gauge-label { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; }
.gauge-label span { color: var(--muted); font-size: 10px; }
.gauge-label strong { font: 900 20px var(--display); }
.gauge-track { position: relative; height: 7px; background: rgba(255,255,255,.08); overflow: visible; }
.gauge-fill { height: 100%; width: 0; transition: width .55s cubic-bezier(.2,.8,.2,1); }
.affinity .gauge-fill { background: linear-gradient(90deg, #e33871, var(--accent)); box-shadow: 0 0 16px rgba(255,79,135,.35); }
.guard .gauge-fill { background: linear-gradient(90deg, #7257ff, #a98fff); }
.ok-line, .reject-line { position: absolute; top: -3px; bottom: -3px; width: 1px; background: rgba(255,255,255,.52); }
.ok-line { left: 75%; }.reject-line { left: 80%; }
.capacity-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.capacity-copy { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.capacity-copy strong { color: var(--cyan); }
.capacity-pips { display: flex; gap: 4px; margin-top: 10px; }
.capacity-pips i { flex: 1; height: 14px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.045); transition: .25s; }
.capacity-pips i.is-used { border-color: transparent; background: var(--character-color); }
.capacity-pips.is-danger i.is-used { background: #ff6c65; }
.tell-card { margin-top: 18px; padding: 13px; border-left: 2px solid var(--character-color); background: rgba(255,255,255,.045); }
.tell-card span { color: var(--character-color); font: 800 8px var(--display); letter-spacing: .16em; }
.tell-card p { margin: 7px 0 0; color: #c6c2ca; font-size: 10px; line-height: 1.55; }
.tell-card em { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.08); color: #85818c; font-size: 8px; line-height: 1.45; font-style: normal; }
.battle-log { min-height: 0; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); list-style: none; overflow: auto; }
.battle-log:empty::after { content: "아직 낸 카드가 없다."; color: #77737e; font-size: 9px; }
.battle-log li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 7px; margin-bottom: 8px; color: var(--muted); font-size: 9px; }
.battle-log i { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: #111; background: var(--emotion-color); font-style: normal; font-weight: 900; }
.battle-log span { min-width: 0; }
.battle-log span small { display: block; margin-top: 2px; overflow: hidden; color: #77737e; font-size: 7px; white-space: nowrap; text-overflow: ellipsis; }
.battle-log b { color: var(--delta-color, var(--muted)); font: 800 9px var(--display); }

.dialogue-panel { position: relative; padding: 22px 24px; border: 1px solid var(--line); background: rgba(16,15,24,.9); overflow: auto; }
.speaker-row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.speaker-row span { color: var(--character-color); font-weight: 900; font-size: 12px; }
.speaker-row small { color: #77737e; font-size: 9px; }
.npc-line { margin: 0; font-size: clamp(14px, 1.15vw, 17px); line-height: 1.78; word-break: keep-all; }
.subtext-line, .player-response { display: flex; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.subtext-line span, .player-response span { flex: 0 0 auto; color: var(--accent-2); font: 900 9px var(--display); }
.subtext-line p, .player-response p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.player-response { border: 0; padding: 10px 12px; background: rgba(255,79,135,.06); }
.player-response span { color: var(--accent); }
.player-response p { color: #ded9e1; }
.npc-reaction { margin-top: 8px; padding: 11px 12px; border-left: 2px solid var(--character-color); background: color-mix(in srgb, var(--character-color) 8%, transparent); }
.reaction-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reaction-header > span { min-width: 0; overflow: hidden; color: var(--character-color); font: 900 8px var(--display); letter-spacing: .08em; white-space: nowrap; text-overflow: ellipsis; }
.reaction-deltas { flex: 0 0 auto; display: flex; gap: 5px; }
.reaction-deltas b { padding: 4px 6px; border: 1px solid rgba(255,255,255,.12); color: #c8c3cc; background: rgba(7,7,12,.5); font: 900 8px var(--display); }
.reaction-deltas b.is-good { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 45%, transparent); }
.reaction-deltas b.is-bad { color: #ff8079; border-color: rgba(255,128,121,.4); }
.reaction-quote { margin: 9px 0 0; color: #ece8ef; font-size: 11px; line-height: 1.55; }
.reaction-analysis { margin-top: 9px; padding: 9px 10px; border: 1px solid rgba(255,255,255,.08); background: rgba(7,7,12,.36); }
.reaction-analysis > span { display: block; margin-bottom: 5px; color: var(--accent-2); font: 900 8px var(--display); letter-spacing: .08em; }
.reaction-analysis p { margin: 0; color: #d8d4dc; font-size: 10px; line-height: 1.55; }
.reaction-analysis small { display: block; margin-top: 7px; padding-top: 7px; border-top: 1px solid rgba(255,255,255,.07); color: #8d8893; font-size: 8px; line-height: 1.45; }

.deck-panel { padding: 18px 20px 16px; border: 1px solid var(--line); background: rgba(13,12,20,.94); }
.deck-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 12px; }
.deck-heading > div > span { color: var(--accent); font: 800 8px var(--display); letter-spacing: .17em; }
.deck-heading h3 { margin: 4px 0 0; font-size: 13px; }
.intensity-control { display: flex; align-items: center; gap: 4px; }
.intensity-control > span { margin-right: 5px; color: var(--muted) !important; font-size: 9px !important; letter-spacing: 0 !important; }
.intensity-control button { width: 28px; height: 25px; padding: 0; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 800 9px var(--display); }
.intensity-control button.is-active { color: #111; border-color: var(--accent-2); background: var(--accent-2); }
.intensity-control button:disabled { opacity: .28; cursor: not-allowed; }
.emotion-deck { display: grid; grid-template-columns: repeat(8, minmax(55px, 1fr)); gap: 6px; }
.emotion-card { position: relative; min-width: 0; height: 82px; padding: 8px 5px 7px; border: 1px solid rgba(255,255,255,.11); background: linear-gradient(160deg, color-mix(in srgb, var(--emotion-color) 13%, #17151f), #111019); transition: transform .18s, border-color .18s, filter .18s; overflow: hidden; }
.emotion-card::before { content: ""; position: absolute; width: 42px; height: 42px; left: 50%; top: -22px; border-radius: 50%; background: var(--emotion-color); opacity: .12; transform: translateX(-50%); }
.emotion-card:hover:not(:disabled) { transform: translateY(-4px); border-color: var(--emotion-color); }
.emotion-card.is-selected { border-color: var(--emotion-color); box-shadow: inset 0 -3px 0 var(--emotion-color), 0 8px 24px rgba(0,0,0,.25); transform: translateY(-3px); }
.emotion-card:disabled { opacity: .28; filter: grayscale(.6); cursor: not-allowed; }
.emotion-glyph { display: grid; place-items: center; width: 30px; height: 30px; margin: 0 auto 6px; border-radius: 50%; color: #101016; background: var(--emotion-color); font: 900 14px var(--display); }
.emotion-card strong, .emotion-card small { display: block; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emotion-card strong { font-size: 10px; }.emotion-card small { margin-top: 2px; color: var(--muted); font-size: 7px; }
.player-line-preview { min-width: 0; min-height: 38px; margin: 8px 0 0; padding: 7px 10px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; border-left: 2px solid rgba(255,255,255,.16); background: rgba(255,255,255,.035); }
.player-line-preview span { color: var(--muted); font: 900 8px var(--display); letter-spacing: .08em; white-space: nowrap; }
.player-line-preview q { quotes: "“" "”"; min-width: 0; color: #918c97; font-size: 9px; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.player-line-preview.is-ready { border-left-color: var(--accent); background: rgba(255,79,135,.055); }
.player-line-preview.is-ready q { color: #e3dee6; }
.play-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.cost-preview { display: flex; align-items: baseline; gap: 7px; }
.cost-preview span { color: var(--muted); font-size: 9px; }.cost-preview strong { color: var(--cyan); font: 900 18px var(--display); }.cost-preview small { color: #77737e; font-size: 8px; }
.play-button { min-width: 230px; display: flex; align-items: center; justify-content: space-between; gap: 28px; clip-path: polygon(0 0, 94% 0, 100% 30%, 100% 100%, 0 100%); }
.play-button:disabled { color: #716c75; background: #292630; cursor: not-allowed; }
.play-button b { font-size: 18px; }

.result-screen { position: relative; display: none; align-items: center; justify-content: center; overflow: hidden; }
.result-screen.is-active { display: flex; }
.result-backdrop { position: absolute; inset: 0; background-position: center 20%; background-size: cover; filter: saturate(.55) brightness(.25) blur(4px); transform: scale(1.04); }
.result-backdrop::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, transparent, rgba(8,8,14,.82) 72%); }
.result-card { position: relative; z-index: 2; width: min(590px, 92vw); padding: clamp(28px, 5vw, 60px); border: 1px solid var(--line); background: rgba(13,12,20,.86); backdrop-filter: blur(22px); text-align: center; }
.result-stamp { width: max-content; margin: 0 auto 24px; padding: 8px 22px; border: 3px solid var(--accent); color: var(--accent); font: 900 clamp(40px, 7vw, 76px)/1 var(--display); letter-spacing: -.05em; transform: rotate(-3deg); }
.result-stamp.is-reject { color: #8d88a0; border-color: #8d88a0; transform: rotate(3deg); }
.result-card h2 { margin: 0; font: 900 clamp(28px, 4vw, 46px)/1.05 var(--display); letter-spacing: -.04em; }
.result-card blockquote { margin: 22px auto; color: #d1ccd4; font-size: 13px; line-height: 1.8; word-break: keep-all; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 26px 0; background: var(--line); border: 1px solid var(--line); }
.result-stats div { padding: 14px 6px; background: rgba(15,14,22,.92); }
.result-stats span, .result-stats strong { display: block; }
.result-stats span { color: var(--muted); font: 800 7px var(--display); letter-spacing: .13em; }.result-stats strong { margin-top: 5px; font: 900 19px var(--display); }
.result-actions { display: flex; justify-content: center; gap: 10px; }
.ghost-button { min-height: 48px; padding: 0 18px; border: 1px solid var(--line); background: transparent; font-weight: 800; font-size: 11px; transition: .2s; }
.ghost-button:hover { border-color: var(--ink); background: rgba(255,255,255,.05); }

.modal { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 20px; }
.modal-scrim { position: absolute; inset: 0; border: 0; background: rgba(5,5,10,.82); backdrop-filter: blur(8px); }
.help-sheet { position: relative; width: min(760px, 95vw); max-height: 90vh; overflow: auto; padding: clamp(26px, 5vw, 48px); border: 1px solid var(--line); background: #12111a; }
.close-button { position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border: 1px solid var(--line); background: transparent; font-size: 20px; }
.help-sheet h2 { max-width: 560px; margin: 0 0 26px; font: 900 clamp(27px, 4vw, 43px)/1.08 var(--display); letter-spacing: -.04em; }
.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.help-grid article { padding: 16px; border: 1px solid var(--line); }
.help-grid b { color: var(--accent); font: 900 11px var(--display); }.help-grid h3 { margin: 13px 0 7px; font-size: 12px; }.help-grid p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.win-rule { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 14px 16px; background: rgba(255,79,135,.08); }
.win-rule span { padding: 5px 9px; color: #111; background: var(--accent); font: 900 10px var(--display); }.win-rule p { margin: 0; font-size: 11px; }
.type-rule { display: flex; align-items: flex-start; gap: 14px; margin-top: 10px; padding: 14px 16px; border: 1px solid rgba(116,221,214,.2); background: rgba(116,221,214,.045); }
.type-rule span { flex: 0 0 auto; color: var(--cyan); font: 900 9px var(--display); letter-spacing: .12em; }.type-rule p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.reset-progress { margin-top: 22px; color: var(--muted); }
.loading-state { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; align-content: center; gap: 14px; background: var(--bg); transition: opacity .3s; }
.loading-state.is-hidden { opacity: 0; pointer-events: none; }
.loading-ring { width: 38px; height: 38px; border: 2px solid rgba(255,255,255,.13); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.loading-state p { color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.toast { position: fixed; z-index: 90; left: 50%; bottom: 28px; max-width: min(460px, 90vw); padding: 11px 16px; border: 1px solid var(--line); background: rgba(17,16,24,.94); color: #d9d4dd; font-size: 10px; line-height: 1.5; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .25s; }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 1250px) {
  .roster-grid { grid-template-columns: repeat(3, 1fr); }
  .battle-screen { padding-inline: 16px; }
  .battle-layout { height: auto; min-height: 0; grid-template-columns: minmax(300px, .9fr) minmax(480px, 1.25fr); grid-template-rows: minmax(430px, 56vh) auto auto; }
  .date-stage { grid-row: 1 / 2; }.status-panel { grid-row: 2 / 4; }.dialogue-panel { grid-column: 2; grid-row: 1; align-self: end; margin: 12px; z-index: 5; max-height: 48%; background: rgba(12,11,18,.88); }.deck-panel { grid-column: 2; grid-row: 2 / 4; align-self: start; }
  .emotion-deck { grid-template-columns: repeat(4, 1fr); }.emotion-card { height: 70px; }
}

@media (max-width: 1000px) and (min-width: 861px) {
  .roster-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .topbar { height: 52px; padding-inline: 12px; }.brand-copy small, .route-count { display: none; }
  .screen { padding: 72px 14px 26px; }
  .title-screen { align-items: flex-start; padding-top: 23vh; }
  .title-content { width: 100%; padding: 0; }.title-content h1 { font-size: clamp(51px, 16vw, 86px); }.title-content h1 em { margin: 8px 0 0 12vw; }.title-lead { margin-top: 30px; font-size: 13px; }.title-actions { align-items: flex-start; flex-direction: column; gap: 12px; }.emotion-marquee { margin-top: 28px; }
  .title-rule-card { display: none; }.orbit-a { width: 115vw; right: -65vw; top: -10vw; }.orbit-b { width: 80vw; }
  .screen-heading { align-items: flex-start; flex-direction: column; }.screen-heading > p { text-align: left; }.roster-grid { grid-template-columns: 1fr; }.roster-card { min-height: 430px; }.compound-teaser { align-items: flex-start; gap: 12px; flex-direction: column; }
  .battle-screen { height: 100vh; height: 100dvh; min-height: 0; padding: 54px 6px 6px; overflow: hidden; }
  .battle-hud { height: 30px; grid-template-columns: auto 1fr auto; margin-bottom: 4px; }.back-button { padding: 4px 0; font-size: 0; }.back-button::before { content: "←"; font-size: 16px; }.turn-track { justify-self: center; gap: 4px; }.turn-dot { width: 20px; height: 3px; }.reserve-chip span, .reserve-chip small { display: none; }.reserve-chip { padding: 4px 8px; }.reserve-chip strong { font-size: 15px; }
  .battle-layout { display: grid; height: calc(100vh - 94px); height: calc(100dvh - 94px); min-height: 0; grid-template-columns: minmax(0, 43fr) minmax(0, 57fr); grid-template-rows: minmax(0, 1fr) 54px 220px; gap: 4px; overflow: hidden; }
  .date-stage { grid-column: 1; grid-row: 1; min-height: 0; }.date-stage::before { background: linear-gradient(180deg, transparent 48%, rgba(7,7,12,.96) 94%), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 100%, 40px 100%; }.portrait-wrap img { object-position: center 16%; }.character-plaque { left: 8px; right: 8px; bottom: 9px; }.character-tags > span { display: none; }.character-plaque h2 { margin: 5px 0 0; font-size: clamp(24px, 8vw, 31px); }.character-plaque p { display: none; }.reaction-burst { top: 12%; max-width: calc(100% - 12px); padding: 7px 8px; white-space: normal; text-align: center; font-size: 9px; }
  .dialogue-panel { grid-column: 2; grid-row: 1; align-self: stretch; min-height: 0; max-height: none; margin: 0; padding: 9px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }.speaker-row { gap: 6px; margin-bottom: 7px; }.speaker-row span { font-size: 10px; }.speaker-row small { font-size: 7px; }.npc-line { font-size: clamp(11px, 3.05vw, 12px); line-height: 1.5; overflow-wrap: anywhere; }.subtext-line, .player-response { gap: 6px; margin-top: 8px; padding-top: 7px; }.subtext-line span, .player-response span { font-size: 8px; }.subtext-line p, .player-response p { font-size: 9px; line-height: 1.4; }.player-response { padding: 7px; }.npc-reaction { margin-top: 6px; padding: 7px; }.reaction-header { display: block; }.reaction-header > span { display: block; font-size: 7px; }.reaction-deltas { margin-top: 5px; gap: 3px; }.reaction-deltas b { padding: 3px 4px; font-size: 7px; }.reaction-quote { margin-top: 6px; font-size: 9px; line-height: 1.4; }.reaction-analysis { margin-top: 6px; padding: 6px; }.reaction-analysis > span { margin-bottom: 3px; font-size: 7px; }.reaction-analysis p { font-size: 8px; line-height: 1.4; }.reaction-analysis small { margin-top: 5px; padding-top: 5px; font-size: 7px; line-height: 1.35; }
  .status-panel { grid-column: 1 / 3; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr 1.25fr; align-items: center; gap: 8px; min-height: 0; padding: 6px 8px; }.status-heading, .tell-card, .battle-log { display: none; }.gauge-block + .gauge-block { margin: 0; }.gauge-label { margin-bottom: 4px; }.gauge-label span { font-size: 8px; }.gauge-label strong { font-size: 14px; }.gauge-track { height: 4px; }.capacity-block { margin: 0; padding: 0; border: 0; }.capacity-copy { font-size: 7px; }.capacity-pips { gap: 2px; margin-top: 5px; }.capacity-pips i { height: 7px; }
  .deck-panel { grid-column: 1 / 3; grid-row: 3; min-height: 0; padding: 7px 8px 8px; overflow: hidden; }.deck-heading { min-height: 25px; align-items: center; margin-bottom: 5px; }.deck-heading > div:first-child > span, .intensity-control > span { display: none; }.deck-heading h3 { margin: 0; font-size: 10px; }.intensity-control { gap: 3px; }.intensity-control button { width: 32px; height: 26px; }.emotion-deck { grid-template-columns: repeat(4, 1fr); gap: 4px; }.emotion-card { height: 48px; padding: 4px 3px; }.emotion-glyph { width: 20px; height: 20px; margin: 0 auto 2px; font-size: 10px; }.emotion-card strong { font-size: 9px; }.emotion-card small { display: none; }.player-line-preview { height: 22px; min-height: 22px; margin-top: 4px; padding: 3px 6px; gap: 5px; }.player-line-preview span { font-size: 7px; }.player-line-preview q { display: block; overflow: hidden; color: #8f8994; font-size: 8px; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }.play-row { display: grid; grid-template-columns: minmax(82px, auto) minmax(0, 1fr); align-items: stretch; gap: 5px; margin-top: 5px; }.cost-preview { min-width: 0; align-items: center; gap: 4px; overflow: hidden; }.cost-preview span { display: none; }.cost-preview strong { font-size: 14px; }.cost-preview small { overflow: hidden; font-size: 7px; line-height: 1.2; }.play-button { width: 100%; min-width: 0; min-height: 40px; padding: 0 11px; gap: 8px; font-size: 10px; }.play-button b { font-size: 14px; }
  .result-screen { height: 100vh; height: 100dvh; min-height: 0; padding: 58px 10px 10px; }.result-card { max-height: calc(100dvh - 68px); padding: 20px 15px; overflow: auto; }.result-card .eyebrow { margin-bottom: 9px; }.result-stamp { margin-bottom: 12px; padding: 5px 16px; font-size: 44px; }.result-card h2 { font-size: 25px; }.result-card blockquote { margin: 13px auto; font-size: 11px; line-height: 1.5; }.result-stats { margin: 14px 0; }.result-stats div { padding: 9px 4px; }.result-actions { flex-direction: row; gap: 6px; }.result-actions button { width: auto; min-height: 40px; flex: 1; justify-content: center; padding-inline: 9px; font-size: 9px; }.help-grid { grid-template-columns: 1fr; }
}

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