/* ===========================================================================
   강령전쟁 — HUD
   Rule: the FIELD owns the screen. Two anchored slabs (core banner on top,
   command altar on the bottom) carry everything that must ALWAYS be visible;
   everything else lives behind a drawer. The previous build showed every stat
   at once, which read as a debug console rather than a game.
   =========================================================================== */
@font-face {
  font-family: 'Pretendard';
  src: local('Pretendard'), local('Pretendard Variable');
  font-weight: 100 900;
}

:root {
  --void:      #07060b;
  --ink:       #ece8f6;
  --dim:       #9089a6;
  --faint:     #5f5875;

  --demon:     #ff4d3d;
  --demon-lo:  #7d1c17;
  --human:     #4fb2f0;
  --human-lo:  #16496e;
  --gold:      #e0b64f;
  --ok:        #6bd39a;

  --slab:      linear-gradient(180deg, rgba(22,19,30,.96), rgba(13,11,19,.97));
  --edge:      rgba(255,255,255,.10);
  --edge-hot:  rgba(224,182,79,.5);
  --font: 'Pretendard', -apple-system, 'Segoe UI', 'Noto Sans KR', sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--void); color: var(--ink);
  font-family: var(--font); font-feature-settings: 'tnum';
  -webkit-font-smoothing: antialiased;
}
#app { height: 100%; }
.screen { display: none; height: 100%; position: relative; }
.screen.active { display: flex; }
.dim { color: var(--dim); }
.hint { color: var(--dim); font-size: 12px; }

/* ============================ select screen ============================ */
#screen-select, #screen-result {
  flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 20px; overflow-y: auto;
}
.select-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(700px 520px at 14% 45%, rgba(255,77,61,.13), transparent 68%),
    radial-gradient(700px 520px at 86% 45%, rgba(79,178,240,.13), transparent 68%),
    radial-gradient(900px 300px at 50% 0%, rgba(224,182,79,.06), transparent 70%);
}
.title-block { text-align: center; position: relative; z-index: 1; }
.title-rule { height: 1px; width: 190px; margin: 0 auto; background: linear-gradient(90deg, transparent, var(--edge-hot), transparent); }
.title-block h1 {
  margin: 12px 0 6px; font-size: 46px; letter-spacing: 16px; font-weight: 900; text-indent: 16px;
  background: linear-gradient(100deg, var(--demon) 8%, var(--gold) 50%, var(--human) 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 24px rgba(224,182,79,.18));
}
.subtitle { margin: 0 0 12px; color: var(--dim); font-size: 12.5px; letter-spacing: 2px; }

.commander-grid { display: grid; grid-template-columns: repeat(6, 152px); gap: 8px; justify-content: center; position: relative; z-index: 1; }
.faction-head { display: none; }
.cmd-card {
  position: relative; overflow: hidden; padding: 0;
  background: #0b0910; border: 1px solid var(--edge); border-radius: 2px;
  cursor: pointer; text-align: left; height: 246px;
  display: flex; flex-direction: column; color: var(--ink); font-family: var(--font);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.cmd-art { position: absolute; inset: 0; }
.cmd-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; filter: saturate(.85) contrast(1.05) brightness(.9); transition: transform .5s cubic-bezier(.2,.8,.3,1), filter .25s; }
.cmd-card::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(0deg, rgba(7,6,11,.97) 12%, rgba(7,6,11,.55) 42%, rgba(7,6,11,.06) 78%); }
.cmd-card:hover { transform: translateY(-4px); border-color: var(--edge-hot); }
.cmd-card:hover .cmd-art img { transform: scale(1.06); filter: saturate(1) contrast(1.08) brightness(1); }
.cmd-card.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 14px 40px rgba(0,0,0,.7); }
.cmd-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; z-index: 2; background: var(--faint); }
.cmd-card[data-faction=demon]::before { background: linear-gradient(180deg, var(--demon), var(--demon-lo)); }
.cmd-card[data-faction=human]::before { background: linear-gradient(180deg, var(--human), var(--human-lo)); }
.cmd-plate { position: relative; z-index: 3; margin-top: auto; padding: 10px 11px 11px; }
.cmd-epithet { font-size: 9px; color: var(--gold); letter-spacing: 2.5px; }
.cmd-name { font-size: 20px; font-weight: 800; letter-spacing: 1px; margin-top: 1px; }
.cmd-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; }
.tag { font-size: 9px; padding: 1px 5px; border: 1px solid rgba(255,255,255,.16); color: rgba(236,232,246,.66); letter-spacing: .5px; }

.briefing {
  position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 118px;
  gap: 18px; width: 952px; max-width: 96vw; padding: 14px 16px;
  background: var(--slab); border: 1px solid var(--edge); border-left: 2px solid var(--faint);
  animation: bfIn .28s ease;
}
.briefing[hidden] { display: none; }
.briefing[data-faction=demon] { border-left-color: var(--demon); }
.briefing[data-faction=human] { border-left-color: var(--human); }
@keyframes bfIn { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
.bf-head { display: flex; align-items: baseline; gap: 10px; }
.bf-name { font-size: 21px; font-weight: 800; letter-spacing: 1px; }
.bf-epithet { font-size: 10px; color: var(--gold); letter-spacing: 3px; }
.bf-desc { margin: 7px 0 9px; font-size: 12.5px; color: var(--dim); line-height: 1.65; }
.bf-mech { border-top: 1px solid var(--edge); padding-top: 8px; }
.bf-mech-label { color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: 1px; margin-right: 8px; }
.bf-mech-desc { font-size: 11.5px; color: #b6aecd; line-height: 1.6; }
.bf-vs { display: flex; flex-direction: column; align-items: center; gap: 3px; border-left: 1px solid var(--edge); padding-left: 16px; }
.bf-vs-label { font-size: 9px; letter-spacing: 3px; color: var(--faint); }
.bf-foe-art { width: 72px; height: 72px; object-fit: cover; object-position: 50% 20%; border: 1px solid var(--edge); filter: saturate(.6) brightness(.8); }
.bf-foe-name { font-size: 13px; font-weight: 700; margin-top: 2px; }
.bf-foe-ep { font-size: 9px; color: var(--faint); letter-spacing: 1.5px; text-align: center; }

.select-footer { display: flex; align-items: center; gap: 18px; position: relative; z-index: 1; }
.diff-pick { display: flex; gap: 6px; position: relative; z-index: 1; }
.diff-btn {
  background: rgba(0,0,0,.35); border: 1px solid var(--edge); color: var(--dim);
  font-family: var(--font); font-size: 11px; padding: 6px 14px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 118px;
}
.diff-btn b { font-size: 12px; font-weight: 700; letter-spacing: 2px; }
.diff-btn em { font-style: normal; font-size: 9.5px; color: var(--faint); }
.diff-btn.on { border-color: var(--gold); color: var(--ink); background: rgba(224,182,79,.08); }

/* ============================ buttons ============================ */
.btn-primary {
  background: linear-gradient(180deg, rgba(60,52,84,.9), rgba(30,26,44,.9));
  color: var(--ink); border: 1px solid var(--edge); border-radius: 2px;
  padding: 10px 22px; font-family: var(--font); font-size: 13px; font-weight: 700;
  letter-spacing: 2px; cursor: pointer; transition: border-color .14s, box-shadow .14s;
}
.btn-primary.lg { padding: 13px 40px; font-size: 14px; }
.btn-primary:disabled { opacity: .35; cursor: not-allowed; }
.btn-primary:not(:disabled):hover { border-color: var(--gold); box-shadow: 0 0 22px rgba(224,182,79,.18); }
.btn-ghost {
  background: transparent; color: var(--dim); border: 1px solid var(--edge); border-radius: 2px;
  padding: 6px 10px; font-family: var(--font); font-size: 10.5px; cursor: pointer;
}
.btn-ghost.wide { width: 100%; }
.btn-ghost:not(:disabled):hover { color: var(--ink); border-color: var(--edge-hot); }
.btn-ghost:disabled { opacity: .3; cursor: not-allowed; }

/* ============================ battle ============================ */
#screen-battle { display: none; }
#screen-battle.active { display: block; }
#field { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------------- top: core banner ---------------- */
/* Full-width band, not a floating card. At min(1180px,97vw) the slab left a dead
   margin on both sides of a 1600px screen and its edges did not line up with the
   dex/quote panels pinned to the viewport — the whole top read as a stray dialog
   instead of a command bar. The faction tint now starts at the actual screen edge,
   so "who is on which side" is readable before any text is. */
.hud-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: grid; grid-template-columns: 1fr 190px 1fr; gap: 18px;
  padding: 9px 20px 11px; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(122,32,44,.30) 0%, rgba(122,32,44,0) 22%),
    linear-gradient(270deg, rgba(30,78,110,.30) 0%, rgba(30,78,110,0) 22%),
    var(--slab);
  border-bottom: 1px solid var(--edge);
  box-shadow: 0 10px 34px rgba(0,0,0,.55);
}
.hud-side { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hud-side.right { flex-direction: row-reverse; }
.hud-face {
  width: 44px; height: 44px; flex: none; object-fit: cover; object-position: 50% 18%;
  border: 1px solid var(--edge); border-radius: 2px; background: #000;
}
.hud-side.left .hud-face { border-left: 2px solid var(--demon); }
.hud-side.right .hud-face { border-right: 2px solid var(--human); }
.hud-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hud-side.right .hud-col { align-items: flex-end; }
.hud-name { font-size: 11.5px; font-weight: 700; letter-spacing: .5px; white-space: nowrap; }
.hud-name em { font-style: normal; color: var(--faint); font-size: 9.5px; margin-left: 5px; }
.bar { position: relative; height: 12px; width: 100%; background: rgba(255,255,255,.06); border: 1px solid var(--edge); overflow: hidden; }
.bar.bast { height: 5px; }
.bar i { position: absolute; inset: 0; width: 100%; transition: width .18s linear; }
.bar.rev i { right: 0; left: auto; }
.hud-side.left .bar i { background: linear-gradient(90deg, var(--demon-lo), var(--demon)); }
.hud-side.right .bar i { background: linear-gradient(270deg, var(--human-lo), var(--human)); }
.hud-res { font-size: 14px; color: var(--gold); font-weight: 700; white-space: nowrap; }
.hud-res::before { content: '◆'; font-size: 10px; opacity: .8; margin-right: 4px; }
.hud-res em { font-style: normal; font-size: 9.5px; color: var(--dim); font-weight: 400; margin-left: 6px; }

.hud-clock { text-align: center; }
#clock { font-size: 22px; font-weight: 800; letter-spacing: 2px; }
.wave-ring { height: 3px; background: rgba(255,255,255,.09); margin: 4px 0 3px; overflow: hidden; }
#wave-fill { display: block; height: 100%; width: 0%; background: var(--gold); }
#phase-label { font-size: 9.5px; color: var(--faint); letter-spacing: 3px; }
#phase-label.hot { color: var(--gold); animation: pulse 1.1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }

/* ---------------- side panels ---------------- */
.dex-panel {
  position: absolute; top: 82px; left: 20px; z-index: 4; width: 178px;
  display: flex; flex-direction: column; gap: 3px; pointer-events: none;
}
.dex-title { font-size: 9px; letter-spacing: 3px; color: var(--dim); margin-bottom: 3px; text-shadow: 0 1px 3px #000; }
.dex-row {
  background: rgba(14,12,20,.86); border: 1px solid var(--edge); border-left: 2px solid var(--demon);
  padding: 4px 7px; font-size: 10px; display: flex; gap: 5px; align-items: baseline;
}

.foe-quote {
  position: absolute; top: 82px; right: 20px; z-index: 4; width: 262px;
  background: rgba(14,12,20,.9); border: 1px solid var(--edge); border-right: 2px solid var(--human);
  padding: 8px 11px 9px; backdrop-filter: blur(8px);
  animation: quoteIn .45s cubic-bezier(.2,.9,.3,1);
}
.foe-quote[hidden] { display: none; }
@keyframes quoteIn { from { opacity: 0; transform: translateX(18px) } to { opacity: 1; transform: none } }
.fq-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
#fq-who { font-size: 9.5px; letter-spacing: 2px; color: var(--human); }
.fq-tag { font-size: 8.5px; color: var(--faint); }
.foe-quote blockquote { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink); }
.foe-quote blockquote::before { content: '“'; color: var(--faint); }
.foe-quote blockquote::after { content: '”'; color: var(--faint); }
.fq-stat { margin-top: 5px; font-size: 9.5px; color: var(--dim); }

/* ---------------- bottom: command altar ---------------- */
/* The altar keeps a max width — a 1600px-wide input invites essays, and the
   receipt chips need to sit near the text they explain — but it is now anchored
   as a full-width plinth so it reads as part of the frame, not a floating card. */
.hud-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  background: linear-gradient(180deg, rgba(10,9,14,.55), var(--slab) 22%);
  border-top: 1px solid var(--edge);
  box-shadow: 0 -12px 40px rgba(0,0,0,.6);
  padding: 8px 20px 10px;
  display: flex; flex-direction: column; gap: 7px;
}
.hud-bottom > * { width: min(1420px, 100%); margin-inline: auto; }
.altar-head { display: flex; align-items: center; gap: 10px; min-height: 20px; flex-wrap: wrap; }
.altar-label { font-size: 9px; letter-spacing: 4px; color: var(--faint); flex: none; }
.signal-row, .suggest-row { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.sig {
  font-size: 9.5px; padding: 2px 8px;
  border: 1px solid var(--edge-hot); color: var(--gold); background: rgba(224,182,79,.09);
}
.sig.off { border-color: var(--edge); color: var(--faint); background: none; }
/* intensity dots replace a false-precision percentage */
.sig i { font-style: normal; margin-left: 5px; letter-spacing: -1px; opacity: .85; font-size: 8px; }
.sg {
  background: rgba(0,0,0,.35); border: 1px dashed var(--edge); color: var(--dim);
  font-family: var(--font); font-size: 10px; padding: 2px 8px; cursor: pointer;
  display: inline-flex; align-items: baseline; gap: 5px; max-width: 280px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sg em { font-style: normal; font-size: 8.5px; color: var(--gold); letter-spacing: 1px; flex: none; }
.sg:hover { border-style: solid; border-color: var(--gold); color: var(--ink); background: rgba(224,182,79,.07); }

.cast-row { display: grid; grid-template-columns: 1fr auto auto; gap: 9px; align-items: stretch; }
#prompt-input {
  background: rgba(0,0,0,.5); border: 1px solid var(--edge);
  color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.4;
  padding: 9px 12px; resize: none; outline: none; height: 44px;
  transition: border-color .15s, box-shadow .15s;
}
#prompt-input::placeholder { color: var(--faint); }
#prompt-input:focus { border-color: var(--gold); box-shadow: 0 0 22px rgba(224,182,79,.14) inset; }
.tier-pick { display: flex; flex-direction: column; gap: 2px; }
.tier-btn {
  background: rgba(0,0,0,.35); border: 1px solid var(--edge); color: var(--dim);
  font-family: var(--font); font-size: 9.5px; padding: 2px 9px; cursor: pointer;
  display: flex; gap: 6px; align-items: baseline; justify-content: space-between; min-width: 80px;
}
.tier-btn i { font-style: normal; color: var(--gold); }
.tier-btn.on { border-color: var(--gold); color: var(--ink); background: rgba(224,182,79,.1); }
.btn-cast {
  width: 112px; cursor: pointer;
  background: linear-gradient(180deg, rgba(224,182,79,.26), rgba(224,182,79,.07));
  border: 1px solid var(--edge-hot); color: var(--gold);
  font-family: var(--font); font-size: 13px; font-weight: 800; letter-spacing: 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  transition: box-shadow .15s, background .15s;
}
.btn-cast small { font-size: 10px; font-weight: 700; letter-spacing: 0; opacity: .9; }
.btn-cast:hover { box-shadow: 0 0 26px rgba(224,182,79,.3); background: linear-gradient(180deg, rgba(224,182,79,.38), rgba(224,182,79,.12)); }
.btn-cast.poor { border-color: rgba(255,77,61,.55); color: #ff9c92; background: linear-gradient(180deg, rgba(255,77,61,.16), rgba(255,77,61,.04)); }
/* command lock: summons are instant, so the ONLY pacing signal is this countdown */
.btn-cast.locked {
  border-color: rgba(255,255,255,.16); color: rgba(255,255,255,.42);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow: none; cursor: default;
}
.btn-cast.locked:hover { box-shadow: none; background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); }

/* one-line receipt: sentence fragment -> effect */
.receipt { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; min-height: 19px; }
.sp {
  display: inline-flex; align-items: baseline; gap: 4px;
  border: 1px solid rgba(255,255,255,.13); border-left: 2px solid var(--ok);
  padding: 1px 6px; background: rgba(255,255,255,.03);
}
.sp b { font-size: 10px; font-weight: 700; color: var(--ink); }
.sp.vis { border-left-color: var(--gold); }
.sp i { font-style: normal; font-size: 8.5px; color: var(--dim); }
.sp.tgt { border-left-color: var(--human); }
.sp.dead { border-left-color: var(--faint); border-style: dashed; opacity: .7; }
.sp.dead b { color: var(--dim); font-weight: 500; }
.sp.void { border-left-color: var(--demon); }
.sp.void b { color: #ff9c92; text-decoration: line-through; }
.receipt .more { font-size: 9.5px; color: var(--faint); }

.altar-foot { display: flex; gap: 9px; align-items: center; }
.altar-foot .upgrade-row { margin-left: auto; }   /* doctrines anchor to the right edge */
/* Engrave slots are a 3-card hand, not a stretch region. At flex:1 three EMPTY
   slots ate ~60% of a 1600px altar, which made the most valuable row on screen
   look like filler. Fixed width keeps the hand compact and leaves the right side
   to the doctrine row. */
.card-slots { display: flex; gap: 5px; flex: none; width: 372px; }
.card {
  width: 120px; flex: none; background: rgba(0,0,0,.4); border: 1px solid var(--edge); padding: 4px 7px;
  color: var(--ink); font-family: var(--font); text-align: left; cursor: pointer; min-height: 28px;
  display: flex; align-items: center; gap: 6px; overflow: hidden;
}
.card:not(.empty):hover { border-color: var(--gold); background: rgba(224,182,79,.07); }
.card.empty { cursor: default; justify-content: center; color: var(--faint); font-size: 9.5px; border-style: dashed; }
.card-name { font-size: 10.5px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-cost { font-size: 9.5px; color: var(--gold); flex: none; }
.card-ch { width: 6px; height: 6px; border-radius: 50%; flex: none; background: #e4d6b4; }
.card-ch.arcane { background: #b08cf0; }
.btn-ghost.on { color: var(--gold); border-color: var(--gold); }
.upgrade-row { display: flex; gap: 4px; }
.upg-btn {
  background: rgba(0,0,0,.4); border: 1px solid var(--edge); color: var(--dim);
  font-family: var(--font); font-size: 9.5px; padding: 4px 8px; cursor: pointer;
  display: flex; gap: 5px; align-items: center;
}
.upg-btn b { color: var(--ink); font-weight: 600; }
.upg-btn:not(:disabled):hover { border-color: var(--gold); }
.upg-btn:disabled { opacity: .35; cursor: not-allowed; }
.upg-btn.owned { border-color: var(--ok); }
.upg-btn.owned b { color: var(--ok); }

/* ---------------- drawer: what is not always needed ---------------- */
.drawer-tab {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 100%;
  background: var(--slab); border: 1px solid var(--edge); border-bottom: none;
  color: var(--dim); font-family: var(--font); font-size: 9.5px; letter-spacing: 2px;
  padding: 3px 16px; cursor: pointer; border-radius: 3px 3px 0 0;
}
.drawer-tab:hover { color: var(--gold); border-color: var(--edge-hot); }
.drawer { display: none; gap: 14px; padding-top: 8px; margin-top: 2px; border-top: 1px solid var(--edge); grid-template-columns: 1.1fr 1fr; }
.drawer.open { display: grid; }
.drawer h4 { margin: 0 0 4px; font-size: 9px; letter-spacing: 3px; color: var(--faint); font-weight: 500; }
.drawer-col { min-width: 0; }
.detail { font-size: 10.5px; color: var(--dim); line-height: 1.7; }
.detail b { color: var(--ink); }
.detail .warn { color: var(--gold); }
.detail .good { color: var(--ok); }
.log { font-size: 10px; line-height: 1.65; max-height: 96px; overflow-y: auto; }
.log div { color: var(--dim); border-bottom: 1px solid rgba(255,255,255,.04); padding: 1px 0; }
.log .l-demon { color: #ff8b82; }
.log .l-human { color: #8ccbf5; }
.log .l-hot { color: var(--gold); }

.chip { display: inline-block; font-size: 9px; padding: 1px 5px; margin-right: 3px; border: 1px solid var(--edge); color: var(--dim); }
.chip.role-guard { border-color: #4d6f96; color: #a5c8e6; }
.chip.role-raider { border-color: #9a4e60; color: #e6a2ad; }
.chip.role-artillery { border-color: #96833f; color: #e0cf9d; }
.capnote { color: var(--gold); font-size: 9.5px; }

/* ---------------- feedback ---------------- */
.banner {
  position: absolute; left: 50%; top: 30%; transform: translate(-50%, -6px);
  z-index: 7; pointer-events: none; opacity: 0;
  padding: 9px 20px; font-size: 14px; font-weight: 700;
  border: 1px solid var(--edge); background: rgba(12,10,18,.95);
  transition: opacity .16s ease, transform .16s ease;
}
.banner.show { opacity: 1; transform: translate(-50%, 0); }
.banner.bad { color: #ffb3aa; border-color: var(--demon); box-shadow: 0 0 26px rgba(255,77,61,.28); }
.banner.ok  { color: var(--ok); border-color: rgba(107,211,154,.5); box-shadow: 0 0 26px rgba(107,211,154,.2); }
@keyframes shakeX { 0%,100%{transform:translateX(0)} 15%{transform:translateX(-5px)} 30%{transform:translateX(5px)} 45%{transform:translateX(-3px)} 60%{transform:translateX(3px)} 80%{transform:translateX(-1px)} }
.shake { animation: shakeX .32s ease; }

.cast-flash { position: absolute; inset: 0; z-index: 6; pointer-events: none; display: flex; align-items: center; justify-content: center; opacity: 0; }
.cast-flash.go { animation: castFlash 1.25s ease-out forwards; }
.cast-flash div { font-size: 27px; font-weight: 800; letter-spacing: 3px; color: var(--gold); text-shadow: 0 0 40px rgba(224,182,79,.65); padding: 0 40px; text-align: center; max-width: 76%; }
@keyframes castFlash { 0%{opacity:0;transform:scale(.94)} 18%{opacity:1;transform:scale(1)} 70%{opacity:1} 100%{opacity:0;transform:scale(1.05) translateY(-14px)} }

/* ============================ result ============================ */
#result-title { font-size: 44px; letter-spacing: 14px; margin: 0; text-indent: 14px; position: relative; z-index: 1; }
.result-body { color: var(--dim); font-size: 13px; text-align: center; line-height: 2; position: relative; z-index: 1; }
.result-body b { color: var(--ink); }

/* ---------------- post-match recap ---------------- */
/* The sentences are the run. Showing them back — next to what they actually became —
   is the only way the player can learn the language of the game. */
.recap {
  margin: 14px auto 0; border-collapse: collapse; font-size: 11.5px;
  width: min(880px, 94vw); position: relative; z-index: 1;
}
.recap th {
  font-size: 9px; letter-spacing: 2px; color: var(--faint); font-weight: 400;
  text-align: left; padding: 0 10px 5px; border-bottom: 1px solid var(--edge);
}
.recap td { padding: 5px 10px; border-bottom: 1px solid rgba(255,255,255,.05); }
.recap .rc-text { color: var(--ink); }
.recap .rc-mid { color: var(--dim); white-space: nowrap; }
.recap .rc-look { color: var(--gold); white-space: nowrap; }
.recap .rc-cost { color: var(--gold); text-align: right; white-space: nowrap; }
