/* Arena edition: clear ownership, visible dice, persistent combat results. */
:root {
  --arena-ink: #07120f;
  --arena-paper: #f3ead4;
  --arena-soft: #bac9bc;
  --arena-gold: #e6c57c;
  --player: #72f0be;
  --player-dark: #153f32;
  --enemy: #ff9598;
  --enemy-dark: #54262d;
  --arena-line: #cdb27735;
}

body {
  background-color: var(--arena-ink);
  color: var(--arena-paper);
  font-size: 15px;
  background-image: radial-gradient(ellipse at 12% 0, #1e5d4438, transparent 60%), radial-gradient(ellipse at 96% 25%, #422a5730, transparent 55%);
}
body[data-screen="setup"] {
  background-image: linear-gradient(180deg, #06100cc7 0, #0b1914d9 520px, #0b1914f5 1100px), url("assets/necrolith-arena-v2.png");
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
}
body[data-screen="battle"] { background-color: #08120f; }
.masthead { max-width: 1600px; padding: 20px 36px; border-color: var(--arena-line); background: #07120d80; }
.brand strong { color: #f2e5c4; font-size: 25px; }
.brand small { color: var(--arena-gold); }
.brand img { filter: drop-shadow(0 0 12px #c6aa623c); }
.nav-button { font-size: 13px; color: #d5decb; }
.nav-actions { gap: 24px; }
.icon-button { width: 38px; height: 38px; }
main { max-width: 1600px; padding: 0 36px 36px; }
.site-footer { max-width: 1600px; padding-inline: 36px; color: #a5b59c; }
.eyebrow { color: #e5c77e; font-size: 11px; }
.ambient { opacity: .35; }
.quiet-button, .secondary-button { font-size: 13px; min-height: 42px; }
.quiet-button { background: #14261ca6; color: #d7e2c9; border-color: #8e9c6b70; }
.quiet-button:hover { background: #284434; }
.primary-button {
  position: relative;
  min-height: 52px;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: .01em;
  color: #112019;
  border: 1px solid #f5d999;
  border-radius: 5px;
  background: linear-gradient(180deg, #f2d394, #cda664);
  box-shadow: 0 4px 0 #664b24, 0 7px 24px #e0b66a14, inset 0 1px 0 #fff7d9a8;
  transition: background .16s, transform .16s, box-shadow .16s;
}
.primary-button:hover:not(:disabled) { background: linear-gradient(180deg, #ffe4aa, #e2bc79); transform: translateY(-1px); box-shadow: 0 5px 0 #664b24, 0 8px 30px #e0b66a28; }
.primary-button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #664b24; }
.primary-button:disabled { box-shadow: none; opacity: .44; }

/* Choose a team: generous names and a strong selected state. */
.collection-intro { padding: 42px 0 31px; }
.collection-intro h1 { font-size: clamp(42px, 4.2vw, 64px); color: #fff3d8; text-shadow: 0 3px 24px #000b; }
.collection-intro h1 em { color: #ead092; }
.intro-text { color: #cfdbca; font-size: 15px; max-width: 700px; }
.setup-toolbar { padding: 15px 0 20px; border-color: #cbb17c44; }
.collection-title h2 { color: #eee4ca; font-size: 26px; }
.collection-title span { color: #b9c8ac; font-size: 12px; }
.mode-toggle { border-color: #a4af8460; background: #0a1a13cc; border-radius: 4px; }
.mode-toggle button { font-size: 12px; min-height: 34px; }
.mode-toggle button.active { background: #ddc38d; color: #12241b; font-weight: 700; border-radius: 2px; }
.roster { gap: 19px; }
.roster-card { background: linear-gradient(155deg, #203a2cf5, #122219fa); border: 1px solid #a8996657; border-radius: 7px; box-shadow: 0 7px 20px #0003; overflow: hidden; }
.roster-card:hover { border-color: #e6c789; box-shadow: 0 9px 30px #0005, 0 0 16px #cdb27413; }
.roster-card.selected { border-color: #a0f4cc; background: #244b36; box-shadow: 0 0 0 2px #7debbb55, 0 9px 30px #06150bb3; }
.roster-card .card-info { padding: 14px 15px 15px; }
.roster-card h3 { color: #f5e9ca; font-size: 25px; margin-bottom: 13px; }
.species { color: #b8c6aa; font-size: 10px; letter-spacing: .09em; }
.pick-marker { width: 29px; height: 29px; font-size: 14px; border-width: 2px; }
.selected .pick-marker { background: var(--player); border-color: #dbffed; color: #092719; }
.defence-badge { font-size: 12px; color: #d0dcc2; }
.defence-badge b { font-size: 17px; color: #eff5d2; }
.card-view { color: #c5d3b6; font-size: 11px; }
.team-tray { border-color: #c9ae6c8c; border-top: 2px solid #dec283; background: #0c1b13f5; border-radius: 7px 7px 0 0; padding: 17px 20px; }
.tray-label strong { font-size: 22px; }
.tray-label span { font-size: 12px; color: #b4c6a5; }
.tray-slot { min-height: 56px; font-size: 12px; border-color: #7b966875; border-radius: 3px; }
.tray-slot.filled { border-color: #7ed5a36b; background: #214730; color: #eaf4d8; }
.prototype-note { color: #ead0a3; font-size: 13px; line-height: 1.65; background: #462d154d; border-color: #caa05d6b; }

/* Battle scoreboard. The colour and written side label always agree. */
.arena-heading { padding: 19px 0; border-color: #c6ae7130; }
.arena-heading h1 { font-size: 28px; }
.tag { font-size: 11px; padding: 5px 10px; background: #10251c; border-color: #9caa7b55; color: #cfddc2; }
.match-scoreboard { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 18px; padding: 20px 0 17px; }
.score-team { --side-color: var(--player); display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; min-width: 0; }
.score-team.enemy { --side-color: var(--enemy); justify-content: flex-end; text-align: right; }
.score-label { color: var(--side-color); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.score-team > b { color: #f4efdc; font-size: 19px; line-height: 1.2; }
.score-team .life-tokens { display: inline-flex; gap: 5px; align-items: center; }
.life-tokens i { display: inline-block; width: 12px; height: 17px; border: 1px solid var(--side-color); border-radius: 2px 2px 5px 5px; transform: skew(-6deg); }
.life-tokens i.alive { background: var(--side-color); box-shadow: 0 0 11px color-mix(in srgb, var(--side-color) 30%, transparent); }
.life-tokens i.fallen { opacity: .27; background: transparent; }
.duel-heading { text-align: center; color: #e9d49f; font-family: var(--serif); font-size: 23px; line-height: 1.2; }
.duel-heading small { display: block; margin-top: 4px; font-family: var(--body); font-size: 10px; text-transform: uppercase; letter-spacing: .15em; color: #aebea6; }

/* The command owner stays visible above the arena. */
.turn-banner {
  --turn-color: var(--arena-gold);
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 19px;
  padding: 17px 22px;
  border: 1px solid #b89f6559;
  border-left: 5px solid var(--turn-color);
  border-radius: 7px;
  background: linear-gradient(100deg, #273526f5, #12231cf5);
  box-shadow: 0 7px 24px #0003;
  position: relative;
  z-index: 4;
}
.turn-banner[data-owner="player"] { --turn-color: var(--player); border-color: #5edb9f66; border-left-color: var(--player); background: linear-gradient(100deg, #123d2ef5, #10271ff5); }
.turn-banner[data-owner="opponent"] { --turn-color: var(--enemy); border-color: #ef85855e; border-left-color: var(--enemy); background: linear-gradient(100deg, #43232bf5, #211e25f5); }
.turn-banner[data-owner="result"] { --turn-color: #f2ce7d; background: linear-gradient(100deg, #42351ef5, #1c251cf5); }
.turn-emblem { display: grid; place-items: center; width: 54px; height: 54px; flex: 0 0 54px; color: var(--turn-color); font-size: 28px; border: 1px solid currentColor; border-radius: 50%; background: #07130d55; box-shadow: 0 0 25px #0003; }
.turn-emblem svg { width: 28px; height: 28px; }
.turn-kicker { font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .14em; color: var(--turn-color); margin-bottom: 3px; }
.turn-banner h2 { font-family: var(--body); font-size: clamp(20px,2vw,26px); font-weight: 750; line-height: 1.25; color: #fff3db; }
.turn-banner p { color: #d1decb; font-size: 14px; line-height: 1.55; margin-top: 4px; }
.turn-banner[data-owner="opponent"] p { color: #e0c8cc; }
.turn-step { margin-left: auto; flex: 0 0 auto; border: 1px solid #c3c7a93d; border-radius: 4px; padding: 7px 10px; background: #07130d60; color: #d7ddc6; font-size: 11px; font-weight: 650; letter-spacing: .06em; text-align: center; }

/* Original card portraits stay precisely framed: do not alter this crop. */
.stage-fighter .portrait, .mini-card .portrait { aspect-ratio: 1.87; min-height: 0; height: auto; }
.stage-fighter .portrait img, .mini-card .portrait img { width: 110.6%; left: -5.3%; top: -74.3%; max-width: none; height: auto; }

.arena-layout { display: grid; grid-template-columns: minmax(0,1fr) 248px; gap: 24px; align-items: start; }
.battle-main { padding: 0; min-width: 0; }
.scene-arena {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 0;
  border: 1px solid #c5a36a61;
  border-radius: 9px 9px 0 0;
  background-color: #12211d;
  background-image: linear-gradient(180deg, #06130d48, #04110c16 35%, #050e0cb3), url("assets/necrolith-arena-v2.png");
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 80px #020a07b0, 0 16px 45px #0004;
  padding: 25px 24px 17px;
}
.scene-arena::before {
  content: ""; position: absolute; pointer-events: none; z-index: -1; inset: -70px;
  background-image: radial-gradient(circle at 15% 24%, #b9ffd7aa 0 1px, transparent 2px),radial-gradient(circle at 72% 34%, #ffe8bbbd 0 1px, transparent 2px),radial-gradient(circle at 37% 58%, #e0d4a575 0 1px, transparent 3px),radial-gradient(circle at 83% 78%, #e1ccff94 0 1px, transparent 2px),radial-gradient(circle at 46% 16%, #b2ebd2a1 0 1px, transparent 2px);
  background-size: 247px 211px, 310px 270px, 191px 243px, 337px 217px, 283px 313px;
  opacity: .6;
  animation: arena-drift 26s linear infinite;
}
.scene-arena::after { content: ""; position: absolute; pointer-events: none; z-index: -1; inset: 0; background: radial-gradient(ellipse at 15% 70%, #4ac99c24, transparent 48%),radial-gradient(ellipse at 88% 65%, #d2658f20, transparent 45%); }
.battlefield { display: grid; grid-template-columns: minmax(0,1fr) 66px minmax(0,1fr); gap: 17px; align-items: center; max-width: 870px; margin: 0 auto; min-height: 340px; }
.stage-fighter { --side-color: var(--player); --side-shadow: #59e1a633; width: 100%; max-width: 370px; justify-self: center; border: 1px solid #60b99594; border-top: 3px solid var(--side-color); border-radius: 7px; background: #09241be8; box-shadow: 0 13px 30px #0009, 0 0 20px var(--side-shadow); transition: box-shadow .25s, border-color .25s; grid-row: auto; grid-column: auto; }
.stage-fighter.enemy { --side-color: var(--enemy); --side-shadow: #ed758b30; border-color: #d77b877d; border-top-color: var(--side-color); background: #2a171eea; }
.stage-fighter.player { grid-column: auto; }
.stage-fighter .fighter-head { padding: 16px 17px 13px; }
.fighter-head .owner, .fighter-head .owner.enemy { color: var(--side-color); font-size: 10px; letter-spacing: .1em; font-weight: 800; gap: 8px; margin-bottom: 9px; }
.fighter-head .owner span:last-child { font-size: 9px; padding: 3px 6px; border-radius: 3px; border: 1px solid color-mix(in srgb, var(--side-color) 40%, transparent); background: #0003; }
.fighter-head h2 { font-size: clamp(25px,2.6vw,35px); color: #fff1d1; line-height: 1.1; margin-bottom: 6px; overflow-wrap: anywhere; text-shadow: 0 2px 9px #0006; }
.stage-fighter .species { color: #c4d4bc; font-size: 10px; }
.stage-fighter.enemy .species { color: #ddbcc2; }
.fighter-footer { padding: 15px 17px 16px; }
.defence-line { color: #d2e1c8; font-size: 11px; font-weight: 650; letter-spacing: .025em; gap: 8px; margin-bottom: 9px; }
.defence-line b { font: 800 28px/1 var(--body); color: #fff5df; }
.defence-line b span { font: 500 15px/1 var(--body); color: #aabda5; }
.stage-fighter.enemy .defence-line { color: #e6c7ce; }
.health-track { height: 11px; border-radius: 4px; background: #020b08; border: 1px solid #afc8aa33; box-shadow: inset 0 1px 3px #000a; }
.health-track span { border-radius: 3px; background: linear-gradient(90deg, #26a772, #a0f7ce); box-shadow: 0 0 12px #77efb366; transition: width .8s cubic-bezier(.22,.61,.36,1); }
.stage-fighter.enemy .health-track span { background: linear-gradient(90deg, #a5344e, #ff9f9c); box-shadow: 0 0 12px #ed7a9d66; }
.health-track span.low { background: linear-gradient(90deg, #d78431, #ffe298); }
.special-label { color: #c5d4b8; font-size: 11px; margin-top: 13px; min-height: 17px; }
.special-label span { color: #dbbd7b; flex-shrink: 0; }
.fighter-view { top: auto; bottom: 116px; right: 10px; width: 31px; height: 31px; font-size: 18px; background: #102218ed; border: 1px solid #efd39c75; color: #ffedc9; }
.stage-fighter.acting { box-shadow: 0 0 0 2px var(--side-color), 0 0 37px var(--side-shadow), 0 18px 33px #000b; }
.stage-fighter.attacking .fighter-head .owner span:last-child { background: var(--side-color); color: #11231b; }
.stage-fighter.defending { border-bottom: 3px solid #92ccf1; }
.stage-fighter.defending .fighter-head .owner span:last-child { background: #2b5d7e; border-color: #8dc9ef; color: #e5f6ff; }
.stage-fighter.fallen { filter: grayscale(.85) saturate(.3); border-color: #6a6b65; box-shadow: 0 10px 30px #0009; }
.stage-fighter.fallen .portrait { opacity: .5; }
.empty-fighter { min-height: 337px; padding: 25px; border-style: dashed; border-width: 1px; background: #081d17c4; color: #b4c5ac; box-shadow: inset 0 0 50px #0003; }
.empty-fighter.enemy { background: #251721bd; }
.empty-fighter h2 { color: #e2d4b4; font-size: 29px; }
.empty-fighter p { font-size: 13px; max-width: 235px; color: #b8cbb0; }
.empty-fighter img { opacity: .6; width: 60px; }
.duel-vs { align-self: center; text-align: center; font: 600 26px/1.2 var(--serif); color: #f5dba4; text-shadow: 0 2px 15px #000; position: relative; }
.duel-vs::before, .duel-vs::after { content: ""; display: block; width: 1px; height: 38px; background: linear-gradient(transparent, #e5c78599); margin: 0 auto 13px; }
.duel-vs::after { transform: rotate(180deg); margin: 13px auto 0; }
.duel-vs small { display: block; font: 600 9px/1.5 var(--body); letter-spacing: .08em; color: #d5c69e; margin-top: 7px; }
.scene-locked { position: relative; display: block; text-align: center; color: #d1d8bf; font-size: 11px; letter-spacing: .045em; padding: 15px 6px 0; text-shadow: 0 2px 6px #000; }
.impact-number { position: absolute; z-index: 3; left: 50%; top: 49%; transform: translate(-50%,-50%); min-width: 90px; text-align: center; color: #ffe9bc; pointer-events: none; filter: drop-shadow(0 4px 5px #000); }
.impact-number b { display: block; font: 900 clamp(46px,5vw,72px)/.95 var(--body); letter-spacing: -.07em; color: #fff0cf; -webkit-text-stroke: 1px #8e2938; text-shadow: 0 0 25px #dd4d639c, 0 4px 0 #742837; }
.impact-number small { display: inline-block; color: #fff1d3; font: 850 11px/1.4 var(--body); letter-spacing: .1em; text-transform: uppercase; padding: 4px 8px; margin-top: 7px; background: #4b1e29ed; border: 1px solid #e1908c8c; border-radius: 3px; white-space: nowrap; }
.impact-number.blocked b { color: #bbedff; -webkit-text-stroke-color: #244e6f; text-shadow: 0 0 25px #6ecce8aa, 0 4px 0 #173f61; font-size: clamp(30px,3.8vw,49px); letter-spacing: -.04em; }
.impact-number.blocked small { background: #17374ded; border-color: #a8e8ff8c; }
.impact-number.defeat b { font-size: clamp(32px,3.8vw,53px); color: #ffc6b3; letter-spacing: -.035em; }

/* The action and its arithmetic share one large, legible command deck. */
.command-deck { border: 1px solid #c5a36a61; border-top: 3px solid #dfc58a; border-radius: 0 0 9px 9px; background: linear-gradient(130deg, #173226f5, #101f19fb 70%); box-shadow: 0 10px 34px #0005; overflow: hidden; }
.command-deck .battle-console, .battle-console {
  display: block; min-width: 0; text-align: left; padding: 25px 25px 23px; background: transparent; border: 0;
  grid-row: auto; grid-column: auto;
}
.command-heading { margin-bottom: 19px; }
.battle-console .command-heading h2, .command-heading h2 { max-width: none; font: 750 25px/1.25 var(--body); color: #fff0d1; }
.command-heading p { color: #c3d3bc; margin-top: 7px; font-size: 14px; line-height: 1.7; max-width: 760px; }
.command-grid { display: grid; grid-template-columns: minmax(0,1.08fr) minmax(240px,.92fr); gap: 25px; align-items: start; }
.command-main { min-width: 0; }
.command-main > .primary-button, .battle-console .primary-button { width: 100%; max-width: none; padding: 15px 18px; min-height: 55px; font-size: 15px; gap: 10px; margin-top: 10px; }
.command-main .console-copy, .battle-console .console-copy { max-width: none; color: #c2d0b7; font-size: 14px; min-height: 0; margin: 10px 0 15px; }
.calculation-panel { min-width: 0; padding: 18px; border: 1px solid #b8c49d3d; border-radius: 6px; background: #06160f9e; box-shadow: inset 0 1px 15px #0002; }
.calculation-panel h3 { font: 700 14px/1.4 var(--body); letter-spacing: .02em; color: #ead59e; margin-bottom: 11px; }
.calculation-panel p { font-size: 13px; color: #bdcdb2; line-height: 1.65; }
.calculation-steps { display: grid; gap: 0; }
.calc-row { display: flex; justify-content: space-between; align-items: center; gap: 13px; border-bottom: 1px solid #8da57229; padding: 10px 0; font-size: 13px; color: #c9d6be; line-height: 1.45; }
.calc-row b { font-size: 17px; color: #f4edcf; white-space: nowrap; }
.calc-row:last-child { border-bottom: 0; }
.calc-total { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 14px; margin: 13px -3px 0; border: 1px solid #d1b5766b; border-radius: 4px; background: #b4964930; color: #f3d796; font-size: 13px; font-weight: 750; }
.calc-total b { font: 850 31px/1 var(--body); color: #ffedb4; }
.calc-total small { font-size: 11px; font-weight: 500; }
.attack-progress { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 19px; }
.progress-step { display: flex; align-items: center; gap: 7px; flex: 1 1 0; min-width: 80px; padding: 8px 9px; border: 1px solid #8fa17d36; border-radius: 4px; background: #07180f50; color: #8ea584; font-size: 11px; line-height: 1.3; }
.progress-step.active { color: #fff0bf; background: #a6822c2b; border-color: #d0b16d85; box-shadow: inset 0 2px 0 #e2c485; }
.progress-step.done { color: #a4eec5; background: #27664225; border-color: #5eb58650; }
.progress-step > span:first-child { font-weight: 850; }
.dice-tray { gap: 18px; margin: 5px 0 16px; min-height: 130px; justify-content: center; }
.dice-group { gap: 7px; min-width: 82px; }
.dice { width: 75px; height: 75px; padding: 13px; gap: 6px; border-radius: 13px; border: 1px solid #e7ffe178; --dice-color: #287d50; box-shadow: inset 0 -5px 0 #0005, inset 0 2px 0 #ffffff34, 0 7px 13px #0006, 0 0 23px #4ad3830b; }
.dice.red { --dice-color: #c44851; border-color: #ffd1c77a; }
.dice.blue { --dice-color: #277eaf; border-color: #d0f1ff78; }
.dice .pip { background: #fff6dc; box-shadow: 0 1px 2px #0007; }
.die-number { font: 850 30px/1 var(--body); color: #fff2cf; text-shadow: 0 2px 8px #0008; font-variant-numeric: tabular-nums; }
.dice-group > small, .dice-group > label { font-size: 10px; font-weight: 700; line-height: 1.4; letter-spacing: .08em; text-transform: uppercase; color: #c2d0b5; text-align: center; }
.dice-group:has(.dice.green) > small { color: #a4efc5; }
.dice-group:has(.dice.red) > small { color: #ffb3aa; }
.dice-group:has(.dice.blue) > small { color: #a1ddff; }
.dice.unknown { font-size: 38px; color: #ffedc2; }
.dice.small { width: 33px; height: 33px; border-radius: 6px; padding: 6px; gap: 3px; box-shadow: inset 0 -2px 0 #0003, 0 2px 5px #0003; }
.dice.rolling, .roll-shake .dice:not(.small) { animation: arena-dice-roll .16s linear infinite; }
.dice.rolling:nth-child(2n) { animation-direction: reverse; }
.roll-explanation { font-size: 14px; color: #c3d4b9; line-height: 1.65; text-align: center; max-width: 440px; margin: 0 auto 13px; }
.roll-explanation strong { color: #f3d897; }
.initiative-board { max-width: none; gap: 8px; margin: 8px 0 15px; }
.initiative-row { padding: 12px 13px; gap: 10px; border-radius: 4px; background: #143728; border-color: #61b9894d; font-size: 12px; }
.initiative-row:nth-child(2) { background: #361f26; border-color: #da8a8f3d; }
.initiative-row > span { width: auto; min-width: 70px; color: #d6e7c9; }
.initiative-row:nth-child(2) > span { color: #efcdd2; }
.initiative-row b { font: 850 28px/1 var(--body); color: #ffe3a0; }
.initiative-dice { gap: 6px; }
.manual-controls { justify-content: flex-start; font-size: 12px; margin-top: 17px; gap: 8px; color: #b2c7a3; }
.manual-controls input { width: 17px; height: 17px; }
.manual-panel { gap: 12px; margin: 12px 0; justify-content: center; }
.manual-panel label { font-size: 11px; gap: 6px; color: #c6d5bc; }
.manual-panel select { width: 70px; min-height: 42px; font-size: 18px; padding: 7px 9px; background: #071a10; border-color: #a6bd847a; }
.battle-console .special-button { max-width: none; min-height: 43px; font-size: 13px; margin-top: 14px; border-radius: 4px; background: #5a2c6b36; border-color: #c493dd6b; color: #e3bcf7; }
.special-note { font-size: 11px; line-height: 1.55; margin-top: 8px; color: #c4a7cf; }
.waiting-state { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 49px; color: #e6c9c9; font-size: 14px; margin-top: 12px; border: 1px dashed #c785873d; border-radius: 4px; background: #44242e2e; }
.waiting-state i, .waiting-state .dot { width: 6px; height: 6px; border-radius: 50%; background: #e8b3b6; animation: arena-wait 1.2s ease-in-out infinite; }
.waiting-state i:nth-child(2), .waiting-state .dot:nth-child(2) { animation-delay: .15s; }
.waiting-state i:nth-child(3), .waiting-state .dot:nth-child(3) { animation-delay: .3s; }

/* Results stay large and present until the player advances. */
.outcome-title { font: 800 clamp(25px,3vw,35px)/1.2 var(--body); color: #ffe2a1; margin: 0 0 9px; }
.result-summary { font-size: 15px; line-height: 1.7; color: #e0e6d0; margin-bottom: 17px; }
.damage-comparison { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; margin: 15px 0; }
.defence-change { --change-color: var(--player); display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; padding: 13px 9px; border: 1px solid #75bfa856; background: #17392c90; border-radius: 5px; text-align: center; }
.defence-change.opponent, .defence-change.enemy { --change-color: var(--enemy); border-color: #de889854; background: #3a242e8a; }
.defence-change > span:first-child { flex: 0 0 100%; color: var(--change-color); font-size: 11px; font-weight: 800; line-height: 1.35; letter-spacing: .06em; margin-bottom: 0; }
.defence-change .before { font: 600 25px/1 var(--body); color: #a2b6a0; }
.defence-change .arrow { font: 400 22px/1 var(--body); color: #c7ae75; }
.defence-change .after { font: 850 34px/1 var(--body); color: #fff0d4; }
.defence-change small { color: #c2d1b7; font-size: 11px; }
.defence-change > span > small { display: block; margin-top: 3px; font-weight: 500; line-height: 1.35; letter-spacing: 0; }
.defence-change > strong { display: block; flex: 0 0 100%; color: var(--change-color); font: 750 11px/1.3 var(--body); letter-spacing: .035em; }
.effect-list { margin: 13px 0 15px; padding-left: 20px; color: #dbbde9; font-size: 13px; line-height: 1.7; }
.effect-list li { margin: 5px 0; }
.next-step-note { font-size: 13px; color: #e3d3a9; line-height: 1.65; margin-top: 16px; padding: 11px 13px; background: #c8a35913; border-left: 2px solid #d2b675; }
.inline-choice { margin: 13px 0 17px; }
.choice-label { display: block; color: #e8d3a5; font-size: 13px; font-weight: 700; margin-bottom: 12px; line-height: 1.5; }
.inline-choice .mini-deck { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.inline-choice .mini-card { width: 100%; min-width: 0; }
.inline-choice .mini-card .mini-details { padding: 8px; }
.inline-choice .mini-card strong { font-size: 17px; }
.inline-choice .card-back { min-height: 126px; }
.mini-card { border-radius: 4px; overflow: hidden; background: #173629; border-color: #8aad7759; }
.mini-card strong { color: #f2e5c6; font-size: 18px; }
.mini-card small { color: #c2d3b2; font-size: 11px; }
.mini-card.selectable { border: 2px solid #b2e0a3; box-shadow: 0 0 14px #80d68a14; }
.mini-card.selectable:hover { border-color: #e7ffca; transform: translateY(-4px); box-shadow: 0 0 18px #85dc9635; }
.mini-card.active { border-color: var(--arena-gold); box-shadow: 0 0 0 2px #d8b96e40; }
.card-back { background: radial-gradient(ellipse, #344731, #12291b); min-height: 110px; }
.card-back::before { border-color: #d7bd7659; }
.card-back::after { border-color: #d7bd7630; }
.card-back img { opacity: .8; height: 49px; }
.card-back span { color: #d3c390; font-size: 9px; }
.mini-card .back-index { color: #dac68f; font-size: 17px; }
.mini-card.selectable .card-back { background: radial-gradient(ellipse, #44633b, #173520); }
.team-panels { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin-top: 21px; }
.team-panel { min-width: 0; padding: 15px 16px 17px; border: 1px solid #80aa8345; border-radius: 6px; background: #0e271c94; }
.team-panel:nth-child(2) { border-color: #bd7c8145; background: #281b2299; }
.team-panel h3 { font: 750 13px/1.4 var(--body); color: var(--player); text-transform: uppercase; letter-spacing: .09em; }
.team-panel:nth-child(2) h3 { color: var(--enemy); }
.team-panel > p { font-size: 11px; color: #aabda0; margin-top: 4px; margin-bottom: 12px; }
.team-panel .mini-deck { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.team-panel .mini-card { width: 100%; min-width: 0; }
.team-panel .mini-card strong { font-size: 15px; }
.team-panel .mini-card small { font-size: 10px; }
.team-panel .mini-details { padding: 8px; }
.team-panel .card-back { min-height: 103px; }

/* The chronicle supports the action without competing with it. */
.battle-sidebar { display: block; padding: 0; border-left: 0; min-width: 0; }
.chronicle { padding: 17px 15px; background: #10271b8c; border: 1px solid #9da97742; border-radius: 7px; }
.chronicle > summary { cursor: pointer; color: #dfcd9b; font: 650 14px/1.5 var(--body); letter-spacing: .025em; }
.chronicle > summary::marker { color: #beac74; }
.chronicle[open] > summary { margin-bottom: 12px; }
.battle-log { max-height: 540px; gap: 0; padding-right: 4px; }
.log-entry { font-size: 12px; color: #b7c9a9; line-height: 1.65; padding: 12px 0; }
.log-entry .log-mark { font-size: 11px; color: #9bb985; }
.log-entry.special { color: #dab8eb; }
.log-entry.defeat,.log-entry.finish { color: #efcf91; }
.quick-help { border: 1px solid #9b9f7040; border-radius: 6px; padding: 17px 15px; background: #1c2a1e90; margin-top: 15px; }
.quick-help h3 { color: #dfcc9c; font-size: 20px; margin-bottom: 9px; }
.quick-help p { font-size: 12px; color: #b9c9ab; line-height: 1.75; margin: 8px 0; }
.quick-help strong { color: #e4ddbb; }
.quick-help button { margin-top: 9px; }
.quick-help ol, .quick-help ul { padding-left: 19px; color: #bcccae; font-size: 12px; line-height: 1.8; }
.quick-help li { margin-bottom: 5px; }
.sidebar-title { font-size: 12px; }
.sidebar-subtitle { font-size: 11px; }
.rules-demo { padding: 20px; margin: 25px 0; border: 1px solid #c4aa726e; border-radius: 6px; background: #0e2217; }
.rules-demo h3 { color: #edce8c; font-size: 24px; margin-bottom: 10px; }
.rules-demo p { color: #c8d6bc; font-size: 14px; }
.demo-dice { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; margin: 20px 0; }
.demo-result { padding: 16px; color: #ffe1a4; font-size: 17px; text-align: center; border: 1px solid #d7b56a4f; background: #bea15d1a; border-radius: 4px; }
.demo-result b { font-size: 27px; }
.modal-body .rule-step p { font-size: 14px; color: #cad8bf; }
.modal-body .assumptions ul { font-size: 13px; }
.codex-grid .roster-card h3 { font-size: 21px; }
.victory { background: radial-gradient(ellipse at 50% 25%, #bb964e22, transparent 70%); }
.victory h1 { color: #f9dea1; text-shadow: 0 4px 32px #0009; }
.victory p { color: #c5d5b8; font-size: 15px; }
.victory-actions .primary-button, .victory-actions .secondary-button { min-width: 200px; }

.stage-fighter.player.attack-lunge { animation: arena-lunge-player .5s cubic-bezier(.3,.8,.3,1); z-index: 3; }
.stage-fighter.enemy.attack-lunge { animation: arena-lunge-enemy .5s cubic-bezier(.3,.8,.3,1); z-index: 3; }
.stage-fighter.hit-flash { animation: arena-hit .6s ease-out; }
.stage-fighter.shield-pulse { animation: arena-shield .7s ease-out; }
.stage-fighter.fall-away { animation: arena-fall .8s ease-out forwards; }
.impact-number.impact-pop, .impact-pop .impact-number { animation: arena-impact .55s cubic-bezier(.2,.8,.3,1); }
@keyframes arena-drift { from { transform: translate3d(0,25px,0); } to { transform: translate3d(-30px,-60px,0); } }
@keyframes arena-dice-roll { 0% { transform: rotate(-10deg) translateY(-3px); } 50% { transform: rotate(13deg) translateY(3px); } 100% { transform: rotate(-10deg) translateY(-3px); } }
@keyframes arena-wait { 0%,80%,100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
@keyframes arena-lunge-player { 0%,100% { transform: translateX(0) rotate(0); } 45% { transform: translateX(24px) rotate(2deg) scale(1.025); } }
@keyframes arena-lunge-enemy { 0%,100% { transform: translateX(0) rotate(0); } 45% { transform: translateX(-24px) rotate(-2deg) scale(1.025); } }
@keyframes arena-hit { 0% { filter: brightness(1); } 25% { filter: brightness(1.7) sepia(.25); transform: translateX(5px); } 42% { transform: translateX(-5px); } 60% { transform: translateX(3px); } 100% { filter: brightness(1); transform: translateX(0); } }
@keyframes arena-shield { 0%,100% { box-shadow: 0 0 20px var(--side-shadow); } 40% { box-shadow: 0 0 0 5px #b5e9ff9c, 0 0 60px #57baff8c; filter: brightness(1.25); } }
@keyframes arena-fall { 0% { transform: translateY(0); opacity: 1; } 60% { transform: translateY(8px) rotate(-2deg); } 100% { transform: translateY(5px); opacity: .65; } }
@keyframes arena-impact { 0% { transform: translate(-50%,-40%) scale(.5); opacity: 0; } 32% { transform: translate(-50%,-60%) scale(1.2); opacity: 1; } 100% { transform: translate(-50%,-50%) scale(1); opacity: 1; } }

@media (min-width: 1600px) {
  .roster { grid-template-columns: repeat(7,minmax(0,1fr)); }
  .roster-card h3 { font-size: 24px; }
  .scene-arena { padding-block: 30px 19px; }
  .battlefield { max-width: 920px; }
}
@media (max-width: 1220px) {
  .masthead { padding-inline: 25px; }
  main { padding-inline: 25px; }
  .arena-layout { grid-template-columns: minmax(0,1fr) 220px; gap: 20px; }
  .scene-arena { padding: 22px 18px 15px; }
  .battlefield { grid-template-columns: minmax(0,1fr) 44px minmax(0,1fr); gap: 12px; min-height: 300px; }
  .fighter-head h2 { font-size: 29px; }
  .stage-fighter .fighter-head,.fighter-footer { padding-inline: 13px; }
  .command-deck .battle-console { padding: 22px; }
  .command-grid { grid-template-columns: minmax(0,1fr) minmax(220px,.92fr); gap: 19px; }
  .dice { width: 66px; height: 66px; padding: 11px; gap: 5px; }
  .dice-tray { gap: 13px; }
  .dice-group { min-width: 70px; }
  .team-panels { gap: 12px; }
  .team-panel { padding: 13px 11px; }
  .team-panel .mini-card strong { font-size: 14px; }
  .turn-banner { padding-inline: 18px; }
}
@media (max-width: 1050px) {
  .arena-layout { grid-template-columns: minmax(0,1fr); }
  .battle-sidebar { display: grid; grid-template-columns: 1.25fr 1fr; gap: 18px; padding: 0; border: 0; }
  .battle-log { max-height: 230px; }
  .quick-help { margin-top: 0; }
  .battlefield { grid-template-columns: minmax(0,1fr) 65px minmax(0,1fr); max-width: 850px; }
  .stage-fighter { max-width: 350px; }
  .fighter-head h2 { font-size: 32px; }
  .command-grid { grid-template-columns: minmax(0,1.1fr) minmax(230px,.9fr); }
  .dice { width: 75px; height: 75px; padding: 13px; gap: 6px; }
  .dice.small { width: 33px; height: 33px; padding: 6px; gap: 3px; }
  .team-panel .mini-card strong { font-size: 17px; }
  .score-team { gap: 7px 11px; }
  .score-team > b { font-size: 17px; }
  .score-label { letter-spacing: .1em; }
}
@media (max-width: 760px) {
  .masthead { padding: 17px 20px; }
  .brand strong { font-size: 22px; }
  .nav-actions { gap: 14px; }
  .nav-button { font-size: 12px; }
  main { padding: 0 20px 28px; }
  .collection-intro h1 { font-size: 47px; }
  .intro-text { font-size: 14px; }
  .roster { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
  .roster-card h3 { font-size: 23px; }
  .match-scoreboard { gap: 10px; padding-block: 15px; }
  .score-team { gap: 4px 8px; }
  .score-label { flex-basis: 100%; font-size: 10px; }
  .score-team > b { font-size: 15px; }
  .life-tokens i { width: 10px; height: 14px; }
  .duel-heading { font-size: 21px; }
  .turn-banner { padding: 14px 15px; gap: 12px; margin-bottom: 15px; }
  .turn-banner h2 { font-size: 22px; }
  .turn-banner p { font-size: 13px; }
  .turn-emblem { width: 44px; height: 44px; flex-basis: 44px; font-size: 24px; }
  .turn-step { max-width: 80px; font-size: 10px; padding: 6px 7px; }
  .scene-arena { padding: 19px 15px 14px; }
  .battlefield { grid-template-columns: minmax(0,1fr) 35px minmax(0,1fr); gap: 10px; min-height: 0; }
  .stage-fighter { grid-row: auto; grid-column: auto; min-width: 0; }
  .stage-fighter.player { grid-column: auto; }
  .stage-fighter.enemy { grid-column: auto; }
  .stage-fighter .fighter-head { padding: 13px 12px 11px; }
  .fighter-head h2 { font-size: 29px; }
  .fighter-head .owner { font-size: 9px; letter-spacing: .06em; flex-wrap: wrap; gap: 5px; }
  .fighter-head .owner span:last-child { font-size: 8px; }
  .fighter-footer { padding: 13px 12px; }
  .defence-line { font-size: 10px; }
  .defence-line b { font-size: 24px; }
  .special-label { font-size: 10px; min-height: 28px; line-height: 1.45; }
  .special-label span { display: none; }
  .duel-vs { font-size: 21px; }
  .duel-vs small { font-size: 8px; }
  .duel-vs::before,.duel-vs::after { height: 25px; }
  .empty-fighter { min-height: 270px; padding: 18px 12px; }
  .empty-fighter h2 { font-size: 24px; }
  .empty-fighter p { font-size: 12px; }
  .empty-fighter img { width: 45px; }
  .fighter-view { width: 27px; height: 27px; bottom: 116px; }
  .command-grid { grid-template-columns: minmax(0,1fr); gap: 19px; }
  .command-deck .battle-console { padding: 22px; }
  .command-heading h2, .battle-console .command-heading h2 { font-size: 24px; }
  .command-main { width: 100%; }
  .calculation-panel { padding: 15px 18px; }
  .calc-row { padding: 8px 0; font-size: 14px; }
  .calc-total { margin-top: 10px; }
  .dice-tray { min-height: 140px; gap: 24px; margin-bottom: 14px; }
  .dice-group { min-width: 86px; }
  .dice { width: 78px; height: 78px; }
  .die-number { font-size: 31px; }
  .dice-group > small { font-size: 10px; }
  .initiative-board { max-width: 440px; margin-inline: auto; }
  .inline-choice .mini-deck { gap: 12px; }
  .inline-choice .mini-card strong { font-size: 20px; }
  .inline-choice .card-back { min-height: 138px; }
  .team-panels { gap: 12px; }
  .team-panel .mini-deck { gap: 6px; }
  .team-panel .mini-card strong { font-size: 13px; }
  .team-panel .mini-card small { font-size: 9px; }
  .team-panel .mini-details { padding: 7px 5px; }
  .team-panel .card-back { min-height: 90px; }
  .team-panel .card-back span { font-size: 7px; }
  .team-panel .card-back img { height: 34px; }
  .battle-sidebar { grid-template-columns: 1fr; gap: 14px; }
  .battle-log { max-height: 260px; }
  .scene-locked { font-size: 10px; }
  .site-footer { padding-inline: 20px; }
}
@media (max-width: 520px) {
  body[data-screen="setup"] { background-attachment: scroll; }
  .masthead { padding: 15px 13px; gap: 12px; }
  .brand { gap: 8px; }
  .brand strong { font-size: 18px; }
  .brand small { font-size: 8px; }
  .brand img { width: 27px; height: 34px; }
  .nav-actions { gap: 10px; }
  .nav-button { font-size: 11px; }
  .icon-button { width: 31px; height: 31px; }
  #open-rules { max-width: 48px; }
  main { padding: 0 12px 24px; }
  .collection-intro { padding: 28px 3px 24px; }
  .collection-intro h1 { font-size: 43px; }
  .collection-title h2 { font-size: 23px; }
  .collection-title span { font-size: 10px; }
  .intro-text { font-size: 14px; }
  .roster { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .roster-card h3 { font-size: 24px; }
  .roster-card .card-info { padding: 12px; }
  .roster .roster-card .card-info { padding-bottom: 34px; }
  .mode-toggle button { font-size: 10px; padding-inline: 8px; }
  .quiet-button { padding-inline: 10px; font-size: 12px; }
  .team-tray { padding: 12px; gap: 10px; }
  .team-tray > .primary-button { min-height: 48px; font-size: 14px; }
  .tray-slot { padding: 7px; min-height: 43px; font-size: 11px; }
  .arena-heading { gap: 8px; padding-block: 15px; }
  .arena-heading h1 { font-size: 24px; }
  .tag { font-size: 9px; padding: 4px 7px; }
  .match-scoreboard { gap: 7px; padding-block: 13px; }
  .score-team { gap: 5px; }
  .score-label { font-size: 9px; letter-spacing: .08em; }
  .score-team > b { font-size: 13px; }
  .life-tokens { gap: 3px!important; }
  .life-tokens i { width: 8px; height: 12px; }
  .duel-heading { font-size: 19px; }
  .duel-heading small { font-size: 8px; letter-spacing: .08em; }
  .turn-banner { gap: 10px; padding: 13px 12px; border-left-width: 4px; border-radius: 5px; }
  .turn-emblem { width: 35px; height: 35px; flex-basis: 35px; font-size: 20px; }
  .turn-emblem svg { width: 20px; height: 20px; }
  .turn-kicker { font-size: 9px; letter-spacing: .09em; }
  .turn-banner h2 { font-size: 19px; }
  .turn-banner p { font-size: 12px; line-height: 1.55; }
  .turn-step { display: none; }
  .scene-arena { padding: 14px 9px 12px; }
  .battlefield { grid-template-columns: minmax(0,1fr) 22px minmax(0,1fr); gap: 6px; }
  .fighter-head h2 { font-size: clamp(22px,5.7vw,28px); }
  .stage-fighter { border-radius: 5px; border-top-width: 3px; }
  .stage-fighter .fighter-head { padding: 10px 9px; }
  .fighter-head .owner { font-size: 8px; min-height: 33px; margin-bottom: 7px; align-content: start; }
  .fighter-head .owner span:first-child { flex-basis: 100%; }
  .fighter-head .owner span:last-child { font-size: 7px; padding: 2px 4px; }
  .stage-fighter .species { font-size: 8px; }
  .fighter-footer { padding: 11px 9px; }
  .defence-line { font-size: 8px; line-height: 1.4; gap: 4px; }
  .defence-line > span { max-width: 72px; }
  .defence-line b { font-size: 23px; white-space: nowrap; }
  .defence-line b span { font-size: 12px; }
  .health-track { height: 9px; }
  .special-label { font-size: 8px; margin-top: 9px; min-height: 24px; }
  .duel-vs { font-size: 15px; }
  .duel-vs small { display: none; }
  .duel-vs::before,.duel-vs::after { height: 22px; margin-block: 8px; }
  .empty-fighter { min-height: 265px; padding: 18px 10px; }
  .empty-fighter h2 { font-size: 22px; }
  .empty-fighter p { font-size: 10px; }
  .empty-fighter img { width: 38px; }
  .fighter-view { bottom: 104px; width: 24px; height: 24px; font-size: 15px; right: 7px; }
  .scene-locked { font-size: 9px; letter-spacing: .01em; padding-top: 12px; }
  .impact-number { top: 53%; min-width: 75px; }
  .impact-number b { font-size: 50px; }
  .impact-number small { font-size: 8px; padding: 3px 5px; }
  .impact-number.blocked b,.impact-number.defeat b { font-size: 29px; }
  .command-deck .battle-console { padding: 19px 15px 20px; }
  .command-heading { margin-bottom: 16px; }
  .command-heading h2,.battle-console .command-heading h2 { font-size: 22px; }
  .command-heading p { font-size: 13px; line-height: 1.7; }
  .command-main > .primary-button,.battle-console .primary-button { min-height: 55px; font-size: 14px; padding: 14px 12px; }
  .attack-progress { gap: 5px; margin-bottom: 16px; }
  .progress-step { min-width: 0; padding: 8px 6px; gap: 4px; font-size: 10px; }
  .dice-tray { gap: 19px; min-height: 132px; }
  .dice-group { min-width: 74px; }
  .dice { width: 70px; height: 70px; padding: 12px; gap: 5px; }
  .die-number { font-size: 29px; }
  .dice-group > small { font-size: 9px; letter-spacing: .05em; }
  .dice.small { width: 31px; height: 31px; padding: 5px; gap: 3px; }
  .initiative-row { padding: 10px; }
  .initiative-row > span { min-width: 65px; font-size: 11px; }
  .initiative-dice { gap: 4px; }
  .initiative-row b { font-size: 25px; }
  .roll-explanation { font-size: 13px; }
  .calculation-panel { padding: 14px; }
  .calc-row { font-size: 13px; }
  .calc-row b { font-size: 17px; }
  .calc-total { font-size: 12px; }
  .calc-total b { font-size: 29px; }
  .inline-choice .mini-deck { gap: 7px; }
  .inline-choice .mini-card strong { font-size: 17px; }
  .inline-choice .mini-card small { font-size: 10px; }
  .inline-choice .mini-card .mini-details { padding: 8px 6px; }
  .inline-choice .card-back { min-height: 122px; }
  .card-back span { font-size: 8px; }
  .mini-card .back-index { font-size: 15px; }
  .damage-comparison { gap: 8px; }
  .defence-change { gap: 6px; padding: 12px 7px; }
  .defence-change > span:first-child { font-size: 10px; }
  .defence-change .before { font-size: 23px; }
  .defence-change .after { font-size: 32px; }
  .outcome-title { font-size: 27px; }
  .result-summary { font-size: 14px; }
  .team-panels { grid-template-columns: 1fr; gap: 12px; margin-top: 16px; }
  .team-panel { padding: 14px; }
  .team-panel .mini-deck { gap: 9px; }
  .team-panel .mini-card strong { font-size: 16px; }
  .team-panel .mini-card small { font-size: 10px; }
  .team-panel .mini-details { padding: 8px; }
  .team-panel .card-back { min-height: 110px; }
  .team-panel .card-back img { height: 40px; }
  .team-panel .card-back span { font-size: 8px; }
  .rules-demo { padding: 15px; }
  .demo-dice { gap: 13px; }
  .demo-result { font-size: 15px; }
  .site-footer { padding-inline: 14px; }
  .victory-actions { max-width: 330px; }
}
@media (max-width: 360px) {
  .brand strong { font-size: 16px; }
  .brand img { width: 23px; }
  .nav-actions { gap: 7px; }
  .nav-button { font-size: 10px; }
  .score-team > b { font-size: 12px; }
  .score-label { letter-spacing: .03em; }
  .fighter-head h2 { font-size: 21px; }
  .fighter-head .owner { letter-spacing: .025em; }
  .defence-line { font-size: 7px; }
  .defence-line b { font-size: 21px; }
  .command-deck .battle-console { padding-inline: 12px; }
  .dice-tray { gap: 12px; }
  .dice-group { min-width: 67px; }
  .dice { width: 63px; height: 63px; padding: 11px; gap: 4px; }
  .dice.small { width: 28px; height: 28px; padding: 5px; gap: 2px; }
  .initiative-row { padding-inline: 8px; }
  .initiative-row > span { min-width: 59px; }
  .inline-choice .mini-card strong { font-size: 15px; }
}
/* Keep the arena and its controls in the same glance. */
.duel-heading { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.duel-heading > span { display: block; font: 650 9px/1.3 var(--body); letter-spacing: .15em; color: #b7c5aa; }
.duel-heading > strong { display: block; font: 500 24px/1.1 var(--serif); color: #ead39c; }
.duel-vs > b { display: block; line-height: 1.1; }
.duel-vs > span { display: block; margin-top: 8px; font: 700 8px/1.4 var(--body); letter-spacing: .03em; color: #e3cf9d; overflow-wrap: anywhere; }
.fighter-art { position: relative; }
.fighter-art .impact-number { top: 50%; }
.fighter-head .owner > b { display: inline-flex; align-items: center; font-size: 9px; line-height: 1.2; padding: 3px 5px; border: 1px solid color-mix(in srgb, var(--side-color) 40%, transparent); border-radius: 3px; background: #0003; color: var(--side-color); }
.stage-fighter.attacking .fighter-head .owner > b { background: var(--side-color); color: #11231b; }
.stage-fighter.defending .fighter-head .owner > b { background: #2b5d7e; border-color: #8dc9ef; color: #e5f6ff; }
.quick-help h2 { font: 650 21px/1.25 var(--serif); color: #ead4a3; }
.chronicle > summary > span { color: #a6b99b; font-size: 11px; margin-left: 7px; }

@media (min-width: 1150px) {
  body[data-screen="battle"] .masthead { padding-block: 11px; }
  body[data-screen="battle"] .brand img { height: 36px; width: 31px; }
  body[data-screen="battle"] .brand strong { font-size: 22px; }
  body[data-screen="battle"] .arena-heading { padding-block: 11px; }
  body[data-screen="battle"] .arena-heading h1 { font-size: 25px; }
  body[data-screen="battle"] .arena-heading > .quiet-button { min-height: 34px; padding-block: 6px; }
  .match-scoreboard { padding-block: 13px; gap: 14px; }
  .score-team { gap: 7px 10px; }
  .score-team > b { font-size: 16px; }
  .score-label { font-size: 10px; }
  .life-tokens i { width: 10px; height: 14px; }
  .duel-heading { gap: 3px; }
  .duel-heading > strong { font-size: 22px; }
  .turn-banner { margin-bottom: 15px; padding: 12px 17px; gap: 13px; }
  .turn-emblem { width: 43px; height: 43px; flex-basis: 43px; font-size: 25px; }
  .turn-kicker { font-size: 10px; }
  .turn-banner h2 { font-size: 22px; }
  .turn-banner p { font-size: 14px; line-height: 1.4; margin-top: 3px; }
  .arena-layout { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .battle-main { display: grid; grid-template-columns: minmax(0,.95fr) minmax(0,1.05fr); grid-template-areas: "scene commands" "reserves commands"; gap: 16px 20px; align-items: start; }
  .scene-arena { grid-area: scene; padding: 17px 15px 12px; border-radius: 8px; }
  .battlefield { grid-template-columns: minmax(0,1fr) 36px minmax(0,1fr); gap: 10px; min-height: 0; max-width: none; }
  .stage-fighter { max-width: none; }
  .stage-fighter .fighter-head { padding: 8px 10px 7px; }
  .fighter-head .owner { font-size: 8px; line-height: 1.2; margin-bottom: 4px; gap: 4px; min-height: 0; }
  .fighter-head .owner > b { font-size: 8px; padding: 2px 4px; }
  .fighter-head h2 { font-size: clamp(23px,1.9vw,29px); margin-bottom: 3px; line-height: 1.05; }
  .stage-fighter .species { font-size: 8px; line-height: 1.25; }
  .fighter-footer { padding: 10px 11px; }
  .defence-line { margin-bottom: 6px; font-size: 8px; gap: 5px; }
  .defence-line > span { max-width: 110px; }
  .defence-line b { font-size: 25px; white-space: nowrap; }
  .defence-line b span { font-size: 12px; }
  .health-track { height: 9px; }
  .special-label { min-height: 0; font-size: 9px; line-height: 1.3; margin-top: 7px; }
  .fighter-view { bottom: 91px; width: 25px; height: 25px; right: 7px; font-size: 16px; }
  .duel-vs { font-size: 22px; }
  .duel-vs::before,.duel-vs::after { height: 22px; margin-block: 9px; }
  .scene-locked { padding-top: 10px; font-size: 10px; line-height: 1.5; letter-spacing: 0; }
  .empty-fighter { min-height: 285px; padding: 22px 12px; }
  .empty-fighter h2 { font-size: 25px; }
  .empty-fighter p { font-size: 12px; }
  .empty-fighter img { width: 46px; }
  .command-deck { grid-area: commands; border-radius: 8px; }
  .command-deck .battle-console { padding: 18px; }
  .command-grid { grid-template-columns: minmax(0,1.14fr) minmax(185px,.86fr); gap: 15px; }
  .command-heading { margin-bottom: 13px; }
  .battle-console .command-heading h2 { font-size: 22px; line-height: 1.2; }
  .command-heading p { font-size: 14px; line-height: 1.5; margin-top: 7px; }
  .attack-progress { margin-bottom: 15px; gap: 7px; }
  .progress-step { padding: 7px 8px; font-size: 11px; min-width: 0; }
  .dice-tray { min-height: 116px; gap: 9px; margin: 6px 0 12px; }
  .dice-group { min-width: 64px; gap: 6px; flex: 0 1 75px; }
  .dice { width: 63px; height: 63px; padding: 11px; gap: 4px; }
  .dice.small { width: 29px; height: 29px; padding: 5px; gap: 2px; }
  .dice-group > small { font-size: 9px; letter-spacing: .025em; }
  .die-number { font-size: 28px; }
  .initiative-row { padding: 9px 8px; gap: 7px; }
  .initiative-row > span { min-width: 55px; font-size: 11px; }
  .initiative-dice { gap: 3px; }
  .initiative-row b { font-size: 23px; }
  .calculation-panel { padding: 13px; }
  .calculation-panel p { font-size: 14px; line-height: 1.5; }
  .calculation-panel .eyebrow { font-size: 10px; }
  .calc-row { font-size: 13px; gap: 8px; padding: 9px 0; }
  .calc-row > span { min-width: 0; }
  .calc-row > b { font-size: 16px; white-space: normal; text-align: right; max-width: 65%; }
  .calc-total { padding: 10px; gap: 8px; flex-wrap: wrap; margin-top: 11px; font-size: 13px; }
  .calc-total b { font-size: 25px; line-height: 1.15; }
  .calculation-panel .roll-explanation { font-size: 13px; margin: 13px 0 0; }
  .calculation-panel .quiet-button { margin-top: 12px; font-size: 12px; padding-inline: 9px; }
  .command-main > .primary-button,.battle-console .primary-button { min-height: 50px; padding: 12px 10px; font-size: 14px; margin-top: 9px; }
  .manual-controls { margin-top: 12px; }
  .next-step-note { font-size: 13px; line-height: 1.5; padding: 9px 10px; margin-top: 12px; }
  .damage-comparison { margin: 11px 0; gap: 8px; }
  .damage-comparison:has(> .defence-change:only-child) { grid-template-columns: 1fr; }
  .defence-change { padding: 9px 7px; gap: 7px; }
  .defence-change .before { font-size: 22px; }
  .defence-change .after { font-size: 29px; }
  .defence-change > span:first-child { font-size: 10px; }
  .inline-choice { margin: 10px 0 13px; }
  .inline-choice .mini-deck { gap: 6px; }
  .inline-choice .mini-card .mini-details { padding: 7px 5px; }
  .inline-choice .mini-card strong { font-size: 15px; overflow-wrap: anywhere; }
  .inline-choice .mini-card small { font-size: 9px; }
  .inline-choice .card-back { min-height: 115px; }
  .inline-choice .card-back img { height: 34px; }
  .inline-choice .card-back span { font-size: 7px; letter-spacing: .07em; }
  .team-panels { grid-area: reserves; margin-top: 0; gap: 12px; }
  .team-panel { padding: 12px 10px; }
  .team-panel h3 { font-size: 11px; }
  .team-panel > p { font-size: 10px; margin-bottom: 9px; line-height: 1.4; }
  .team-panel .mini-deck { gap: 6px; }
  .team-panel .mini-details { padding: 6px 4px; }
  .team-panel .mini-card strong { font-size: 13px; overflow-wrap: anywhere; }
  .team-panel .mini-card small { font-size: 9px; }
  .team-panel .card-back { min-height: 90px; }
  .team-panel .card-back img { height: 33px; }
  .team-panel .card-back span { font-size: 6px; letter-spacing: .07em; }
  .battle-sidebar { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); align-items: start; gap: 13px 20px; }
  .quick-help { margin-top: 0; padding: 15px 17px; }
  .quick-help p { margin-block: 6px; font-size: 13px; line-height: 1.5; }
  .quick-help .secondary-button,.quick-help .quiet-button { margin-top: 7px; }
  .chronicle { padding: 15px 17px; }
  .battle-log { max-height: 230px; }
  .battle-sidebar .save-note { grid-column: 1 / -1; margin: 0; font-size: 12px; }
}
@media (max-width: 1149px) {
  .arena-layout { grid-template-columns: minmax(0,1fr); }
  .turn-banner { position: sticky; top: 0; z-index: 8; box-shadow: 0 5px 22px #0008; }
  .scene-arena { padding-block: 14px 10px; }
  .battlefield { min-height: 0; max-width: 730px; }
  .stage-fighter { max-width: 300px; }
  .stage-fighter .fighter-head { padding-block: 8px; }
  .fighter-head h2 { font-size: 27px; margin-bottom: 3px; }
  .fighter-head .owner { margin-bottom: 4px; min-height: 0; }
  .fighter-footer { padding-block: 9px; }
  .special-label { min-height: 0; margin-top: 7px; }
  .scene-locked { padding-top: 9px; }
  .empty-fighter { min-height: 255px; }
  .command-deck { scroll-margin-top: 135px; }
  .battle-sidebar { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 15px; }
  .quick-help { margin-top: 0; }
}
@media (max-width: 760px) {
  .duel-vs > span { font-size: 7px; line-height: 1.35; }
  .fighter-head .owner > b { font-size: 8px; padding: 2px 4px; }
  .battle-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  body[data-screen="battle"] .masthead { padding-block: 10px; }
  .arena-heading { padding-block: 10px; }
  .match-scoreboard { padding-block: 10px; }
  .duel-heading > span { font-size: 7px; letter-spacing: .07em; }
  .duel-heading > strong { font-size: 19px; }
  .turn-banner { padding-block: 10px; margin-bottom: 10px; }
  .turn-banner h2 { font-size: 18px; }
  .turn-banner p { font-size: 12px; line-height: 1.4; }
  .scene-arena { padding: 10px 7px 8px; }
  .battlefield { gap: 6px; grid-template-columns: minmax(0,1fr) 21px minmax(0,1fr); }
  .stage-fighter .fighter-head { padding: 7px 7px 6px; }
  .fighter-head .owner { font-size: 7px; gap: 3px; margin-bottom: 3px; }
  .fighter-head .owner > b { font-size: 7px; padding: 1px 3px; }
  .fighter-head h2 { font-size: clamp(20px,5.5vw,25px); line-height: 1.05; }
  .stage-fighter .species { font-size: 7px; line-height: 1.2; }
  .fighter-footer { padding: 8px 7px; }
  .defence-line { margin-bottom: 6px; }
  .defence-line b { font-size: 22px; }
  .special-label { margin-top: 6px; font-size: 8px; min-height: 0; line-height: 1.3; }
  .fighter-view { bottom: 85px; }
  .duel-vs > span { display: none; }
  .empty-fighter { min-height: 215px; padding: 15px 9px; }
  .empty-fighter h2 { font-size: 20px; }
  .scene-locked { font-size: 9px; padding-top: 8px; line-height: 1.4; }
  .command-deck { scroll-margin-top: 130px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none!important; transition: none!important; scroll-behavior: auto!important; }
  .stage-fighter.fall-away { opacity: .65; }
  .impact-number { transform: translate(-50%,-50%); }
  .waiting-state i,.waiting-state .dot { opacity: .75; }
}

/* Ability help keeps the selected mode, play instructions and card comparison distinct. */
.special-instructions { margin: 0 0 14px; padding-left: 22px; color: #c1cbb5; font-size: 13px; line-height: 1.8; }
.special-instructions li + li { margin-top: 9px; }
.special-instructions li::marker { color: var(--gold-light); font-weight: 600; }
.special-difference { margin-top: 14px; border-top: 1px solid #71815c45; }
.special-difference > summary { padding: 12px 0; font-family: var(--body); font-size: 12px; line-height: 1.6; color: #bec5ad; cursor: pointer; }
.special-difference > p { padding-bottom: 10px; }
.special-item .special-instructions { font-size: 12px; margin-top: 9px; }
.special-item .special-use-note { margin-top: 12px; }
.detail-copy .special-mode-note strong { color: var(--gold-light); }

/* Every fighting beast carries its own ability control and readable state. */
.abilities-intro { display: flex; gap: 13px; align-items: flex-start; padding: 15px 18px; margin-bottom: 22px; border: 1px solid #86c89b65; border-radius: 6px; background: #183d2b80; color: #d0e6c6; font-size: 13px; line-height: 1.7; }
.abilities-intro > span { color: var(--player); font-size: 22px; line-height: 1.3; }
.abilities-intro strong { color: #e6f5d7; }
.fighter-art { position: relative; }
.stage-fighter .fighter-view { top: 9px; right: 9px; bottom: auto; }
.ability-panel { margin-top: 14px; padding: 12px; border: 1px solid #809e8052; border-radius: 5px; background: #071b13c9; text-align: left; }
.ability-heading { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 5px 9px; margin-bottom: 9px; font-size: 10px; line-height: 1.45; }
.ability-heading > span { color: #b5c9ad; text-transform: uppercase; letter-spacing: .07em; }
.ability-heading > b { color: #c4d0b8; font-weight: 750; }
.ability-panel[data-ability-state="ready"] { border-color: #8df1b98c; background: #153d2de0; }
.ability-panel[data-ability-state="ready"] .ability-heading > b { color: #a5f8cf; }
.ability-panel[data-ability-state="armed"] { border-color: #edca7f8c; background: #3d331bba; }
.ability-panel[data-ability-state="armed"] .ability-heading > b { color: #ffe09a; }
.ability-panel[data-ability-state="automatic"] .ability-heading > b { color: #bde4ff; }
.ability-button { display: block; width: 100%; min-height: 44px; padding: 11px 10px; border: 1px solid #a5f3cd; border-radius: 4px; background: linear-gradient(180deg,#a8f4cc,#70cfa1); color: #092619; font-size: 12px; line-height: 1.4; font-weight: 800; text-align: center; overflow-wrap: anywhere; box-shadow: 0 3px 0 #164d35; }
.ability-button:hover:not(:disabled) { background: #c3ffde; border-color: #ebfff4; }
.ability-button:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 0 #164d35; }
.ability-button:disabled { opacity: 1; color: #b6c5ae; background: #1a2b21; border-color: #81987860; box-shadow: none; }
.ability-panel[data-ability-state="armed"] .ability-button:disabled { color: #f4dba3; background: #514323; border-color: #e3c57a70; }
.ability-description, .detail-copy .ability-description { margin-top: 10px; font-size: 11px; line-height: 1.65; color: #c0d0b7; }
.ability-name { display: block; color: #f1dfb2; font: 500 17px/1.3 var(--serif); }
.automatic-label { display: block; margin-top: 6px; color: #b4c5b2; font-size: 10px; }
.ability-effects { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.ability-effects span { padding: 4px 6px; color: #e9d7a0; background: #86703b32; border: 1px solid #d5b46559; border-radius: 3px; font-size: 10px; line-height: 1.4; }
.ability-roll-reminder { padding: 12px 14px; margin: 12px 0; border-left: 3px solid var(--player); background: #77e8ac12; color: #c9dfbc; font-size: 12px; line-height: 1.7; }
.ability-roll-reminder strong { color: #c1f8db; }
.ability-roll-reminder.activated { border-left-color: var(--arena-gold); background: #dfbd6f16; }
.ability-roll-reminder.activated strong { color: #f4d790; }
.ability-guide-label { display: block; margin: 10px 0 5px; color: #bddfbf; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.detail-copy .ability-panel { margin: 18px 0; }
.detail-copy .ability-button { font-size: 14px; }

/* Printed-card links open the shop separately from the game. */
.shop-link, .rules-download-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 11px 14px; border: 1px solid #dfc58a; border-radius: 4px; font-size: 13px; line-height: 1.45; font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.shop-link { color: #13241b; background: linear-gradient(180deg,#f1d595,#c7a565); box-shadow: 0 2px 0 #604923; }
.shop-link:hover { color: #0a1b12; background: #ffe3a4; border-color: #ffeac0; }
.rules-download-link { color: #e6e8cd; background: #173325; border-color: #8caa7c8c; }
.rules-download-link:hover { color: #f7f4d9; background: #284b34; border-color: #b7d49d; }
.rules-download-link > span { white-space: nowrap; }
.codex-card-shop { padding: 0 10px 11px; }
.codex-buy-link { display: flex; width: 100%; font-size: 11px; padding: 10px 8px; gap: 5px; }
.codex-card-shop small, .codex-shop-actions small, .printed-card-offer small { display: block; margin-top: 8px; color: #b1c1a6; font-size: 10px; line-height: 1.55; }
.codex-card-shop small { text-align: center; }
.codex-shop-banner { display: grid; grid-template-columns: minmax(0,1fr) minmax(210px,.7fr); align-items: center; gap: 22px; padding: 20px; margin-bottom: 24px; border: 1px solid #cbae6a70; border-radius: 7px; background: linear-gradient(125deg,#2a3c29,#14291f); }
.codex-shop-banner h3, .printed-card-offer h3 { color: #f2dfb0; font-size: 25px; line-height: 1.2; margin: 5px 0 10px; }
.codex-shop-banner p:not(.eyebrow), .printed-card-offer p:not(.eyebrow) { color: #c9d5bc; font-size: 12px; line-height: 1.75; }
.codex-shop-banner strong, .printed-card-offer strong { color: #f0e5c6; }
.codex-shop-actions { display: grid; gap: 10px; }
.codex-shop-actions small { margin-top: 0; text-align: center; }
.detail-card-column { min-width: 0; }
.printed-card-offer { margin-top: 18px; padding: 18px; border: 1px solid #c8ac6970; border-radius: 6px; background: #263c28; }
.printed-card-offer .printed-card-price { margin-bottom: 10px; }
.printed-card-offer .shop-link { display: flex; margin-top: 15px; width: 100%; }
.rulebook-download { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; margin-bottom: 23px; padding: 16px 18px; border: 1px solid #8eaa7370; border-radius: 6px; background: #193224; }
.rulebook-download h3 { color: #e9dcaf; font-size: 22px; margin-bottom: 5px; }
.rulebook-download p { color: #c4d2b7; font-size: 12px; line-height: 1.6; }
@media (max-width: 600px) {
  .codex-shop-banner { grid-template-columns: minmax(0,1fr); gap: 16px; padding: 16px; }
  .codex-shop-banner h3, .printed-card-offer h3 { font-size: 23px; }
  .codex-shop-actions { grid-template-columns: minmax(0,1fr); }
  .codex-buy-link { font-size: 11px; }
  .printed-card-offer { padding: 15px; }
  .rulebook-download { padding: 15px; }
  .rulebook-download .rules-download-link { width: 100%; }
}
@media (max-width: 760px) {
  .ability-panel { padding: 10px 8px; margin-top: 11px; }
  .ability-heading { font-size: 9px; margin-bottom: 8px; }
  .ability-description { font-size: 11px; }
  .ability-button { font-size: 12px; padding: 10px 7px; }
  .ability-name { font-size: 16px; }
  .abilities-intro { padding: 12px 14px; font-size: 12px; }
}
