﻿:root {
  color-scheme: light;
  --bg: #f4f1e8;
  --paper: #fffdf7;
  --panel: #fffdf7;
  --ink: #30372f;
  --line: #30372f;
  --muted: #7b7d6f;
  --lime: #d9ea90;
  --accent: #b9dd7c;
  --orange: #ed754d;
  --shadow: 4px 4px 0 #30372f;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background-image: linear-gradient(#8d927515 1px, transparent 1px), linear-gradient(90deg, #8d927515 1px, transparent 1px);
  background-size: 24px 24px;
}
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; border: 0; transition: background .16s, transform .16s, box-shadow .16s; }
button:disabled { cursor: default; opacity: .5; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #df704b; outline-offset: 4px; }
select:focus-visible { outline: 2px solid #df704b; outline-offset: 2px; }
button, input, select { border-radius: 7px; }
button:active:not(:disabled) { transform: translate(1px, 1px); }
button svg { pointer-events: none; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
p, h1, h2, h3 { margin: 0; }

/* A small masthead leaves the room for the game. */
.site-header {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 0 max(32px, calc((100vw - 1476px) / 2));
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
}
.brand { display: flex; align-items: center; gap: 4px; font-size: 21px; font-weight: 900; letter-spacing: -.8px; white-space: nowrap; }
.brand > span:nth-child(2) { font-weight: 500; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; margin-right: 7px; color: var(--orange); font-size: 36px; line-height: 1; transform: rotate(-20deg); }
.brand .version { font: 9px 'Consolas', monospace; letter-spacing: 0; margin: -15px 0 0 5px; border: 1px solid var(--ink); background: var(--lime); padding: 2px 4px; border-radius: 3px; }
.site-header nav { display: flex; align-self: stretch; gap: 32px; }
.nav-link { position: relative; background: none; border-radius: 0; padding: 0 2px; color: #777b6f; font-size: 12px; font-weight: 600; }
.nav-link:hover, .nav-link.active { color: var(--ink); }
.nav-link.active::after { content: ''; position: absolute; height: 4px; left: 0; right: 0; bottom: -1px; background: var(--orange); }
.nav-link span { font-size: 10px; margin-left: 6px; color: #999b8f; }
.icon-button { background: var(--paper); border: 1px solid var(--ink); padding: 9px 13px; font-size: 17px; box-shadow: 2px 2px 0 var(--ink); }
.icon-button span { font-size: 11px; margin-left: 8px; }
.icon-button:hover { background: #f1eddb; }
main { max-width: 1480px; margin: 0 auto; padding: 16px 28px 20px; }
.eyebrow { font: 10px 'Consolas', 'Courier New', monospace; letter-spacing: 1.4px; color: #777b6a; }
.status-dot { display: inline-block; width: 7px; height: 7px; border: 1px solid var(--ink); border-radius: 50%; vertical-align: middle; margin-right: 8px; background: var(--lime); }
.workbench-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 21px; }
.workbench-intro h1, .workbench-intro h2 { font-size: 21px; font-weight: 800; letter-spacing: -.7px; }
.workbench-intro p { font-size: 12px; color: #7b7e6e; line-height: 1.6; }
.workbench-intro > div { display: block; }
.workbench-intro > div > .eyebrow { display: block; margin-bottom: 5px; }
.workbench-intro .eyebrow { font-size: 9px; }

/* Character first, then a generous sheet of graph paper to fight on. */
.workbench { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 22px; align-items: start; }
.setup-panel { grid-column: 1; grid-row: 1; min-width: 0; border: 2px solid var(--ink); background: var(--paper); border-radius: 13px; overflow: hidden; box-shadow: var(--shadow); --accent: #b9dd7c; }
.arena-column { grid-column: 2; grid-row: 1; min-width: 0; }
.arena-card { border: 2px solid var(--ink); border-radius: 13px; overflow: hidden; background: #f3efe3; box-shadow: var(--shadow); }
.arena-toolbar { min-height: 57px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--ink); background: var(--paper); gap: 10px; }
.arena-toolbar > div { display: flex; align-items: center; gap: 8px; }
.arena-toolbar .status-dot { margin-right: 0; background: var(--orange); }
.arena-toolbar strong { font-size: 11px; font-weight: 800; letter-spacing: 1.3px; }
.tag { font: 8px 'Consolas', monospace; letter-spacing: .7px; border: 1px solid var(--ink); padding: 4px 6px; border-radius: 3px; margin-left: 5px; background: #f9e8af; color: #5a5137; white-space: nowrap; }
.text-button { padding: 6px; color: #737b67; background: transparent; font-size: 10px; }
.text-button:hover { color: var(--ink); background: #ecebdc; }
.battle-hud { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px 0; background: #f3efe3; font: 9px 'Consolas', monospace; letter-spacing: 1px; color: #8b8d79; }
.battle-hud b { color: #49553e; margin-left: 6px; font-weight: 700; }
.battle-hud > span:nth-child(2) { color: #586348; }
.hud-dot { display: inline-block; width: 5px; height: 5px; border: 1px solid #778165; border-radius: 50%; margin-right: 4px; }
.canvas-shell { position: relative; background: #f3efe3; }
#game { width: 100%; height: min(46vh, 560px); min-height: 360px; overflow: hidden; }
canvas { display: block; max-width: 100%; }
.arena-bottom { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 43px; padding: 0 20px; background: var(--paper); border-top: 1px solid var(--ink); font-size: 10px; color: #747d62; }
.small-cross { font-size: 16px; margin-right: 7px; vertical-align: middle; color: #929e68; }
.live-tag { font: 8px 'Consolas', monospace; letter-spacing: .7px; color: #6d785a; white-space: nowrap; }
.live-tag .status-dot { width: 5px; height: 5px; margin-right: 4px; }
.roster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 12px 0 15px; }
.roster-card { display: flex; align-items: center; gap: 11px; text-align: left; padding: 14px 16px; min-width: 0; border: 1px solid var(--ink); border-radius: 8px; background: var(--paper); box-shadow: 2px 2px 0 #30372f; }
.roster-card:hover { background: #fff9dc; transform: translateY(-2px); }
.roster-ball { width: 34px; height: 34px; border: 1px solid var(--ink); background: var(--fighter-color); display: grid; place-items: center; font-size: 24px; border-radius: 50%; flex-shrink: 0; box-shadow: 1px 2px 0 var(--ink); }
.roster-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.roster-name { font-size: 12px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-weapon { font-size: 9px; color: #7d826f; }
.roster-hp { margin-left: auto; font: 9px 'Consolas', monospace; color: #65734c; white-space: nowrap; }
.roster-card.eliminated { opacity: .4; box-shadow: none; }
.match-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.match-actions .eyebrow { font-size: 9px; color: #5f6a4a; }
.match-actions p:not(.eyebrow) { font-size: 12px; color: #7f826d; margin-top: 6px; }
.primary-button { min-height: 48px; padding: 14px 26px; border: 2px solid var(--ink); background: var(--orange); box-shadow: 3px 3px 0 var(--ink); color: #2f3529; font-size: 11px; letter-spacing: 1.2px; font-weight: 850; white-space: nowrap; }
.primary-button:hover:not(:disabled) { background: #f7916a; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.primary-button:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.secondary-button { min-height: 40px; padding: 10px 15px; border: 1px solid var(--ink); background: var(--paper); box-shadow: 2px 2px 0 var(--ink); font-size: 11px; }
.secondary-button:hover { background: var(--lime); }
.arena-tip { display: flex; align-items: flex-start; gap: 11px; margin-top: 22px; color: #858773; font-size: 10px; line-height: 1.7; }
.arena-tip > span { font-size: 20px; color: var(--orange); margin-top: -5px; }
.arena-tip strong { font-weight: 650; color: #67734e; }
.powerup-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed #b9bda8; }
.powerup-legend > span { padding: 6px 9px; border: 1px solid #c1c5b2; border-radius: 5px; background: var(--paper); font-size: 10px; color: #657053; white-space: nowrap; }
.powerup-legend > span:first-child { padding-left: 0; margin-right: 3px; border: 0; background: transparent; font: 8px 'Consolas', monospace; letter-spacing: .8px; color: #8b9479; }
.powerup-legend > span:nth-child(2) { background: #e9efd5; }
.powerup-legend > span:nth-child(3) { background: #fbebbc; }
.powerup-legend > span:nth-child(4) { background: #f5e2d7; }
.powerup-legend > span:nth-child(5) { background: #e9e3f5; }

/* The fighter card: expressive faces, simple controls, a small stat budget. */
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 13px; }
.panel-heading .eyebrow { font-size: 8px; letter-spacing: 1.3px; color: #96836a; margin-bottom: 6px; }
.panel-heading h2 { font-size: 23px; font-weight: 800; letter-spacing: -.8px; }
.panel-symbol { width: 34px; height: 34px; border: 1px solid var(--ink); border-radius: 7px; background: #f8df98; display: grid; place-items: center; font-size: 21px; transform: rotate(7deg); }
.fighter-tabs { display: flex; margin: 0 22px; gap: 7px; }
.fighter-tab { min-height: 34px; flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #c0c3b0; background: #f5f3e9; color: #939782; font: 10px 'Consolas', monospace; }
.fighter-tab.selected { color: var(--ink); border-color: var(--ink); background: var(--accent); box-shadow: 2px 2px 0 var(--ink); font-weight: 700; }
.fighter-tab.disabled-slot { border-style: dashed; opacity: .6; background: transparent; }
.tab-dot { width: 7px; height: 7px; border: 1px solid #30372f80; border-radius: 50%; background: var(--fighter-color); }
.remove-fighter { margin: 9px 22px -10px; }
fieldset { min-width: 0; border: 0; margin: 0; padding: 14px 20px 12px; }
fieldset:disabled { opacity: .5; }
.character-intro { margin-bottom: 10px; font-size: 11px; color: #73775f; line-height: 1.6; }
.character-intro strong { display: block; font-size: 12px; color: var(--ink); margin-bottom: 3px; }
.fighter-identity { display: flex; align-items: center; gap: 12px; }
.fighter-avatar { display: grid; place-items: center; flex-shrink: 0; width: 51px; height: 51px; background: var(--accent); border: 2px solid var(--ink); border-radius: 50%; font-size: 34px; box-shadow: 2px 3px 0 var(--ink); }
.fighter-avatar span { line-height: 1; }
.name-field { flex: 1; min-width: 0; }
.name-field label, .field-label { font: 9px 'Consolas', monospace; letter-spacing: 1px; color: #8b8d77; }
.name-field input { width: 100%; display: block; padding: 4px 0 5px; border: 0; border-bottom: 1px solid #b5bba3; border-radius: 0; background: none; color: var(--ink); font-size: 18px; font-weight: 700; outline-offset: 2px; }
.fighter-identity > span { align-self: flex-start; padding-top: 4px; font: 10px 'Consolas', monospace; color: #9b9e89; }
.emoji-section { margin: 0 0 13px; }
.emoji-section .field-label, .emoji-section > label { display: block; margin-bottom: 9px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; }
.emoji-choice { min-width: 0; min-height: 37px; padding: 4px 0; background: #f5f3e9; border: 1px solid transparent; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif; font-size: 22px; line-height: 1; }
.emoji-choice:hover { background: #f5e5b3; transform: translateY(-2px); }
.emoji-choice.selected, .emoji-choice[aria-pressed='true'] { border-color: var(--ink); background: #f9e8af; box-shadow: 2px 2px 0 var(--ink); }
.color-row { display: flex; align-items: center; gap: 10px; margin: 11px 0 14px; }
.color-swatches { display: flex; gap: 8px; margin-left: auto; }
.color-swatch { width: 19px; height: 19px; padding: 0; border: 2px solid var(--paper); outline: 1px solid transparent; border-radius: 50%; background: var(--swatch); }
.color-swatch.selected { outline-color: var(--ink); }
.custom-color { position: relative; display: grid; place-items: center; overflow: hidden; width: 21px; height: 21px; border: 1px dashed #9ca685; border-radius: 50%; color: #919b7d; font-size: 14px; cursor: pointer; }
.custom-color input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.section-label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 9px; padding-top: 10px; border-top: 1px dashed #bac0a8; font: 8px 'Consolas', monospace; letter-spacing: .9px; color: #717a5b; }
.section-label > span:last-child { color: #9da38a; font-size: 7px; }
select { display: block; width: 100%; min-height: 39px; margin-top: 7px; padding: 0 10px; background: #fffef9; color: var(--ink); border: 1px solid #a7ad93; font-size: 12px; font-weight: 600; cursor: pointer; appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 15px) calc(50% - 2px), calc(100% - 10px) calc(50% - 2px); background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
select option { background: var(--paper); color: var(--ink); }
.weapon-note { margin: 7px 0 11px; }
.weapon-note > span { font: 7px 'Consolas', monospace; letter-spacing: 1px; color: #cc7350; }
.weapon-note p { margin-top: 4px; font-size: 10px; line-height: 1.6; color: #8b907a; }
.points-box { display: flex; align-items: center; justify-content: space-between; padding: 8px 11px; margin-bottom: 10px; border: 1px solid #a7b17e; border-radius: 6px; background: #eaf0d1; }
.points-box > div { display: flex; align-items: center; gap: 8px; font: 8px 'Consolas', monospace; letter-spacing: .6px; color: #717f4a; }
.points-spark { font: 22px Arial; color: #859e4c; }
.points-box strong { color: #526736; font-size: 22px; font-weight: 700; line-height: 1; }
.points-box small { color: #98a578; font: 9px 'Consolas', monospace; }
.stat-row { margin-bottom: 8px; }
.stat-label { display: flex; justify-content: space-between; color: #6c775b; font-size: 11px; margin-bottom: 7px; }
.stat-label output { color: #617744; font: 10px 'Consolas', monospace; }
.stat-label output small { font-size: 7px; color: #a2ac8b; margin-left: 4px; }
.stat-row input { appearance: none; width: 100%; height: 5px; border: 0; border-radius: 3px; display: block; margin: 10px 0; cursor: pointer; background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--fill, 40%), #e6e9d9 var(--fill, 40%), #e6e9d9 100%); }
.stat-row input::-webkit-slider-thumb { appearance: none; height: 12px; width: 12px; border-radius: 50%; border: 1px solid var(--ink); background: var(--paper); box-shadow: 1px 1px 0 var(--ink); }
.stat-row input::-moz-range-thumb { height: 11px; width: 11px; border-radius: 50%; border: 1px solid var(--ink); background: var(--paper); box-shadow: 1px 1px 0 var(--ink); }
.stat-row input:disabled { cursor: default; }
.tradeoff-note { margin: 3px 0 7px; font-size: 9px; line-height: 1.6; color: #90997a; }
.reset-build { font-size: 9px; padding-left: 0; }
.workshop-footer { padding: 13px 22px; border-top: 1px solid #ccd0bc; background: #f3f4e8; font-size: 9px; color: #919e72; }
.workshop-footer .status-dot { width: 5px; height: 5px; }

/* Small printed notes below the workbench. */
.how-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin: 32px 0 25px; padding: 25px 0; border-top: 1px dashed #b5bda4; border-bottom: 1px dashed #b5bda4; }
.how-strip article { display: flex; align-items: center; gap: 15px; }
.how-strip article > span { display: grid; place-items: center; flex-shrink: 0; width: 33px; height: 33px; border: 1px solid var(--ink); border-radius: 8px; background: #fff9dd; color: #7f855e; font: 11px 'Consolas', monospace; transform: rotate(-5deg); }
.how-strip article:nth-child(2) > span { background: #edf1d5; transform: rotate(4deg); }
.how-strip article:nth-child(3) > span { background: #f9e4d9; }
.how-strip h3 { margin-bottom: 5px; font-size: 12px; font-weight: 650; color: #6c7558; }
.how-strip p { font-size: 10px; color: #9aa086; line-height: 1.5; }
footer { display: flex; justify-content: space-between; gap: 15px; color: #a2aa8a; font: 8px 'Consolas', monospace; letter-spacing: .6px; }
.footer-separator { margin: 0 8px; color: #b0b698; }

/* Rounds, popups, and the winner's little victory card. */
.countdown { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; background: #f4efda55; color: var(--orange); font-size: 105px; font-weight: 900; text-shadow: 3px 3px 0 var(--ink); }
.countdown.paused { font-size: 30px; letter-spacing: 8px; background: #f6f1dee6; text-shadow: 2px 2px 0 var(--ink); }
.result-overlay { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: #eee9dcb8; backdrop-filter: blur(4px); }
.result-card { width: min(360px, 88%); text-align: center; padding: 25px; background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 5px 6px 0 var(--ink); transform: rotate(-1deg); }
.result-card .eyebrow { color: #939e7d; font-size: 8px; }
.winner-emblem { margin: 12px 0 6px; color: #e8b64d; font-size: 55px; line-height: 1.15; }
#winner-title { color: #ad9855; font: 10px 'Consolas', monospace; letter-spacing: 4px; }
#winner-name { margin: 5px 0 10px; font-size: 38px; font-weight: 900; letter-spacing: -1px; overflow-wrap: anywhere; -webkit-text-stroke: .5px var(--ink); }
#winner-detail { margin-bottom: 23px; color: #949d7e; font-size: 11px; }
.result-card .primary-button { width: 100%; }
.result-actions { display: flex; gap: 9px; margin-top: 11px; }
.result-actions button { flex: 1; }
.boot-error { position: absolute; inset: 10%; padding: 20px; background: #ffeadc; color: #985638; border: 1px solid #dc9e72; border-radius: 8px; font-size: 14px; }
.toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); z-index: 100; max-width: 90vw; padding: 13px 22px; border: 1px solid var(--ink); border-radius: 7px; background: var(--lime); color: #516536; font-size: 12px; box-shadow: 3px 3px 0 var(--ink); }
dialog { width: min(670px, calc(100vw - 32px)); max-height: 85vh; padding: 34px; overflow: auto; border: 2px solid var(--ink); border-radius: 13px; color: var(--ink); background: var(--paper); box-shadow: 6px 6px 0 var(--ink); }
dialog::backdrop { background: #454b3d6b; backdrop-filter: blur(5px); }
.dialog-close { position: absolute; right: 14px; top: 14px; padding: 3px 10px; font-size: 24px; }
.dialog-title { margin: 8px 0 20px; font-size: 29px; letter-spacing: -1px; }
.dialog-intro { margin-bottom: 22px; font-size: 13px; line-height: 1.8; color: #929d7f; }
.armory-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.armory-card { padding: 16px; background: #f5f4e9; border: 1px solid #c1cab0; border-radius: 7px; }
.armory-card h3 { font-size: 16px; margin-bottom: 7px; }
.armory-card p { color: #919e7c; font-size: 11px; line-height: 1.7; }
.armory-stats { margin-top: 12px; color: #6e8650; font: 9px 'Consolas', monospace; line-height: 1.8; }
.guide-list { padding-left: 21px; color: #8d9b76; font-size: 13px; line-height: 1.9; }
.guide-list li { padding: 7px 0; }
.in-battle .workbench { grid-template-columns: minmax(0, 1fr); }
.in-battle .setup-panel { display: none; }
.in-battle .arena-column { grid-column: 1; width: 100%; max-width: 1180px; margin: 0 auto; }
.in-battle #game { max-height: 65vh; }
.in-battle .arena-tip, .in-battle .how-strip { display: none; }
.in-battle .roster { grid-template-columns: repeat(var(--fighter-count, 2), minmax(0, 1fr)); }
.in-battle footer { margin-top: 30px; }

@media (max-width: 1180px) {
  main { padding: 24px; }
  .site-header { padding: 0 24px; }
  .workbench { grid-template-columns: 330px minmax(0, 1fr); gap: 22px; }
  .panel-heading, fieldset { padding-left: 20px; padding-right: 20px; }
  .fighter-tabs { margin-left: 20px; margin-right: 20px; }
  .arena-toolbar { padding: 0 15px; }
  .roster-card { padding: 12px; gap: 8px; }
  .roster-weapon { font-size: 8px; }
  .roster-hp { font-size: 8px; }
  .match-actions { gap: 12px; }
  .match-actions p:not(.eyebrow) { font-size: 10px; }
  .primary-button { padding: 14px 18px; }
  .arena-bottom { padding: 0 15px; font-size: 9px; }
  .live-tag { font-size: 7px; }
}
@media (max-width: 990px) {
  #game { height: auto; min-height: 0; aspect-ratio: 960 / 540; }
  .workbench { grid-template-columns: minmax(0, 1fr); gap: 27px; }
  .setup-panel { grid-column: 1; grid-row: 1; }
  .arena-column { grid-column: 1; grid-row: 2; }
  .panel-heading { padding-bottom: 16px; }
  .fighter-tabs { max-width: 360px; }
  fieldset { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 35px; }
  fieldset > * { grid-column: 1; }
  .fighter-identity { grid-row: 2; }
  .emoji-section { grid-row: 1; margin: 0 0 20px; }
  .color-row { grid-row: 3; margin: 17px 0 20px; }
  .section-label { grid-row: 4; }
  .field-label[for='weapon-select'] { grid-row: 5; }
  #weapon-select { grid-row: 6; }
  .weapon-note { grid-row: 7 / 9; }
  .section-label:has(+ .points-box) { grid-column: 2; grid-row: 1; align-self: start; }
  .points-box { grid-column: 2; grid-row: 2; margin-top: -5px; align-self: start; }
  #stat-sliders { grid-column: 2; grid-row: 3 / 7; }
  .tradeoff-note { grid-column: 2; grid-row: 7; }
  .reset-build { grid-column: 2; grid-row: 8; justify-self: start; }
  .how-strip { gap: 20px; }
  .how-strip article { gap: 10px; }
  .how-strip p { font-size: 9px; }
  .in-battle .arena-column { grid-row: 1; }
  .in-battle #game { max-height: none; }
}
@media (max-width: 580px) {
  .site-header { min-height: 65px; padding: 0 17px; gap: 12px; }
  .brand { font-size: 16px; }
  .brand-mark { width: 27px; height: 27px; margin-right: 3px; font-size: 30px; }
  .brand .version { display: none; }
  .site-header nav { gap: 15px; margin-left: auto; }
  .nav-link { font-size: 10px; }
  .nav-link.active, .nav-link span, .icon-button span { display: none; }
  .icon-button { border: 0; box-shadow: none; padding: 7px; }
  main { padding: 23px 17px; }
  .workbench-intro { display: block; margin-bottom: 18px; }
  .workbench-intro > div { display: block; }
  .workbench-intro h1, .workbench-intro h2 { font-size: 19px; }
  .workbench-intro p { font-size: 10px; margin-top: 5px; }
  .workbench-intro > .eyebrow { display: none; }
  .workbench-intro > .tag { display: none; }
  .panel-heading { padding: 21px 20px 17px; }
  .panel-heading h2 { font-size: 22px; }
  .fighter-tabs { max-width: none; }
  .fighter-tab { min-height: 37px; }
  fieldset { display: block; padding: 23px 20px 18px; }
  .emoji-section { margin: 0 0 22px; }
  .emoji-grid { gap: 4px; }
  .emoji-choice { min-height: 39px; font-size: 23px; }
  .color-row { gap: 10px; margin: 20px 0 24px; }
  .color-swatches { gap: 8px; }
  .color-swatch { width: 20px; height: 20px; }
  .custom-color { width: 21px; height: 21px; }
  .points-box { margin-top: 0; }
  .stat-row { margin-bottom: 20px; }
  .stat-row input { height: 5px; margin: 16px 0; }
  .stat-row input::-webkit-slider-thumb { height: 17px; width: 17px; }
  .stat-row input::-moz-range-thumb { height: 15px; width: 15px; }
  .stat-label, .stat-label output { font-size: 12px; }
  .weapon-note p { font-size: 11px; }
  .tradeoff-note { font-size: 10px; }
  .arena-toolbar { min-height: 48px; padding: 0 11px; gap: 7px; }
  .arena-toolbar > div { gap: 6px; }
  .arena-toolbar strong { font-size: 9px; letter-spacing: 1px; }
  .arena-toolbar .tag { margin-left: 2px; font-size: 7px; padding: 3px 4px; }
  .text-button { font-size: 9px; }
  .battle-hud { padding: 14px 14px 0; font-size: 8px; letter-spacing: .4px; }
  .arena-bottom { min-height: 39px; padding: 0 11px; gap: 8px; font-size: 8px; }
  .live-tag { font-size: 6px; letter-spacing: .4px; }
  .small-cross { font-size: 13px; margin-right: 4px; }
  .roster { gap: 8px; margin-top: 14px; }
  .roster-card { padding: 10px; gap: 8px; flex-wrap: wrap; }
  .roster-ball { width: 27px; height: 27px; font-size: 21px; }
  .roster-name { font-size: 11px; }
  .roster-info { flex: 1; }
  .roster-weapon { font-size: 8px; }
  .roster-hp { width: 100%; padding-left: 35px; font-size: 8px; }
  .match-actions { flex-wrap: wrap; gap: 14px; }
  .match-actions > div { flex: 1; }
  .match-actions .eyebrow { font-size: 8px; }
  .match-actions p:not(.eyebrow) { font-size: 10px; }
  .match-actions .primary-button { min-height: 45px; padding: 12px 14px; font-size: 9px; }
  .arena-tip { margin-top: 18px; font-size: 9px; }
  .how-strip { display: flex; flex-direction: column; gap: 20px; margin-top: 27px; padding: 23px 0; }
  .how-strip article { gap: 15px; }
  .how-strip p { font-size: 10px; }
  footer { flex-direction: column; gap: 10px; font-size: 7px; letter-spacing: .4px; }
  .in-battle .roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .countdown { font-size: 66px; }
  .countdown.paused { font-size: 23px; }
  .result-card { max-width: 290px; padding: 15px; }
  .result-card .eyebrow, .winner-emblem { display: none; }
  #winner-name { margin: 4px 0 7px; font-size: 27px; }
  #winner-title { font-size: 8px; }
  #winner-detail { margin-bottom: 12px; font-size: 9px; }
  .result-card .primary-button { min-height: 34px; padding: 8px; font-size: 10px; }
  .result-actions button { min-height: 31px; padding: 7px; font-size: 9px; }
  .armory-grid { grid-template-columns: 1fr; }
  dialog { padding: 29px 23px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* The wave run: a small scoreboard, a useful shop, and room to roll. */
.mode-switch{display:flex;margin:0 22px;border:1px solid var(--ink);border-radius:7px;overflow:hidden;background:#f0eedf}
.mode-switch button{flex:1;padding:10px 6px;border-radius:0;background:transparent;font-size:12px;font-weight:700}
.mode-switch button.selected{background:var(--lime);box-shadow:inset 0 -2px 0 #30372f}
.mode-note{font-size:10px;color:#73775f;padding:10px 22px 15px;line-height:1.5}
.emoji-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
.emoji-choice{min-height:40px}
.run-strip{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 15px;min-height:45px}
.run-strip>span:first-child{display:flex;align-items:center;gap:14px}
.run-strip b{font-size:14px;letter-spacing:.7px}
.run-strip small{font-size:11px;color:#747966}
.coin-pill{display:flex;align-items:center;gap:6px;padding:8px 12px;background:#f7df90;border:1px solid var(--ink);border-radius:7px;font-size:10px;box-shadow:2px 2px 0 var(--ink);white-space:nowrap}
.best-pill{font:10px 'Consolas',monospace;color:#75824d;white-space:nowrap}
.empty-scores{font-size:11px;color:#848874;margin:14px 0 3px;line-height:1.6}
.score-table{border-collapse:collapse;width:100%;margin-top:14px;text-align:left;font-size:12px}
.score-table th{font:9px 'Consolas',monospace;color:#777d64;padding:10px 5px;border-bottom:1px solid #bcc1ac;white-space:nowrap}
.score-table td{padding:12px 5px;border-bottom:1px dashed #d8dacb;overflow-wrap:anywhere}
.score-table th:nth-child(3),.score-table td:nth-child(3),.score-table th:nth-child(4),.score-table td:nth-child(4){text-align:right}
.score-table tbody tr:first-child td:nth-child(3){font-size:17px;font-weight:800;color:#a37925}
.score-table td:first-child{width:28px;color:#a0a68a;font:11px 'Consolas',monospace}
.shop-panel{max-width:1080px;margin:0 auto;padding:32px;border:2px solid var(--ink);border-radius:15px;background:var(--paper);box-shadow:5px 6px 0 var(--ink)}
.shop-heading{display:flex;align-items:center;justify-content:space-between;gap:25px;margin-bottom:25px}
.shop-heading h1{font-size:38px;letter-spacing:-1.6px;margin:7px 0 8px;font-weight:850}
.shop-heading p:last-child{font-size:12px;color:#747c65;line-height:1.7}
.shop-wallet{background:#f8df91;border:2px solid var(--ink);border-radius:10px;box-shadow:3px 3px 0 var(--ink);padding:15px 24px;text-align:center;font-size:28px;transform:rotate(3deg);flex-shrink:0}
.shop-wallet strong{font-size:33px}.shop-wallet span{display:block;font:8px 'Consolas',monospace;letter-spacing:1px;margin-top:5px}
.shop-health{display:flex;gap:15px;align-items:center;background:#f2f3e9;border:1px solid #c5c9b2;padding:15px;border-radius:9px;margin-bottom:23px}
.shop-player{font-size:36px}.shop-health>div{flex:1}.shop-health>div>span{font-size:12px;font-weight:600}
.shop-health-track{height:8px;margin-top:9px;border:1px solid #687751;background:#e0e3d3;border-radius:5px;overflow:hidden}
.shop-health-track>span{display:block;height:100%;background:#a0c673;transition:width .25s}
.shop-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}
.shop-item{display:flex;flex-direction:column;gap:12px;border:1px solid var(--ink);border-radius:9px;padding:18px;background:#fffdf8;box-shadow:2px 2px 0 #b1b4a1}
.shop-icon{display:grid;place-items:center;width:42px;height:42px;border:1px solid var(--ink);border-radius:10px;background:var(--item-color);font-size:29px;transform:rotate(-5deg)}
.shop-item:nth-child(even) .shop-icon{transform:rotate(5deg)}
.shop-item h2{font-size:17px;letter-spacing:-.5px;margin-bottom:7px}.shop-item p{font-size:11px;line-height:1.65;color:#767d67}
.shop-item-bottom{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:auto;padding-top:3px}
.shop-item-bottom>span{font:8px 'Consolas',monospace;color:#929c7f;white-space:nowrap}.shop-item-bottom button{min-height:35px;padding:7px 9px;font-size:10px;background:var(--item-color);box-shadow:1px 2px 0 var(--ink)}
.shop-note{font-size:11px;line-height:1.7;color:#7d856b;padding:19px 0}
.shop-actions{display:flex;justify-content:space-between;align-items:center;gap:15px;border-top:1px dashed #bac1a9;padding-top:19px}
.workshop-footer{color:#697954}.stat-label{color:#535f43}.stat-label output{color:#455c2c}.tradeoff-note{color:#6f7b5c}.weapon-note p{color:#73825e}.weapon-note>span{color:#768b51}
.roster-card:disabled{opacity:1;cursor:default}.roster-card.eliminated:disabled{opacity:.4}.roster-card:disabled:hover{transform:none;background:var(--paper)}
.in-battle .run-strip{max-width:1080px;margin:0 auto 15px}.in-battle .arena-column{max-width:1280px}
.in-battle .setup-panel{display:none}
.remove-fighter{margin-left:20px}
@media(min-width:991px){.setup-panel{max-height:calc(100vh - 88px);overflow-y:auto;scrollbar-width:thin}.setup-panel::-webkit-scrollbar{width:7px}.setup-panel::-webkit-scrollbar-thumb{background:#c6cbb5;border-radius:8px}.arena-modifier{font:9px 'Consolas',monospace;color:#8b654c;letter-spacing:.6px}}
@media(min-width:991px) and (max-height:920px){main{padding-top:10px;padding-bottom:10px}.run-strip{margin-bottom:8px}.powerup-legend{margin-top:9px;padding-top:8px}}
@media(max-width:990px){.shop-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.run-strip{margin-top:2px}.in-battle .run-strip{margin-top:0}}
@media(max-width:580px){
  .site-header{gap:8px;flex-wrap:wrap;min-height:70px;padding-top:10px;padding-bottom:10px}.site-header nav{gap:13px;order:3;width:100%;height:27px;justify-content:space-between;margin:0}.site-header .nav-link.active{display:block}.site-header .nav-link{font-size:11px}.site-header .icon-button{margin-left:auto}.site-header nav .nav-link.active:after{height:2px;bottom:-4px}
  .run-strip{gap:10px}.run-strip>span:first-child{display:block}.run-strip small{display:block;font-size:9px;margin-top:4px}.run-strip b{font-size:12px}.coin-pill{font-size:9px;padding:7px 8px}.best-pill{font-size:8px}
  .emoji-choice{min-height:43px;font-size:25px}.mode-switch{margin:0 20px}.mode-note{padding-left:20px;padding-right:20px}
  .shop-panel{padding:20px 15px}.shop-heading{gap:10px;margin-bottom:18px}.shop-heading h1{font-size:27px;letter-spacing:-1px}.shop-heading .eyebrow{font-size:8px;letter-spacing:.5px}.shop-heading p:last-child{font-size:10px}.shop-wallet{padding:10px 12px;font-size:20px}.shop-wallet strong{font-size:26px}.shop-wallet span{font-size:6px;letter-spacing:.3px}
  .shop-health{gap:9px;padding:11px;flex-wrap:wrap}.shop-player{font-size:28px}.shop-health>div>span{font-size:10px}.shop-health button{width:100%;min-height:35px;margin-top:3px}
  .shop-grid{gap:10px}.shop-item{padding:12px 10px;gap:10px}.shop-item h2{font-size:14px;letter-spacing:-.4px}.shop-item p{font-size:10px;line-height:1.55}.shop-icon{height:33px;width:33px;font-size:23px}.shop-item-bottom{flex-direction:column;align-items:stretch;gap:8px}.shop-item-bottom>span{font-size:7px}.shop-item-bottom button{font-size:9px;width:100%}
  .shop-note{font-size:10px}.shop-actions{flex-direction:column-reverse;align-items:stretch}.shop-actions button{width:100%;font-size:10px}
  .score-table{font-size:11px}.score-table th{font-size:8px}.score-table td{padding:10px 4px}.score-table th:first-child{width:20px}
}
