:root {
  --cream: #EDE3CF;
  --ink: #14110F;
  --rust: #C1441E;
  --copper: #2C6B62;
  --amber: #E0A32B;
  --steel: #8A9199;
  --violet: #4A2B4E;
  --paper-deep: #DED2B8;
  --rule: 3px solid var(--ink);
  --display: "Alfa Slab One", Georgia, serif;
  --text: "Barlow Condensed", "Arial Narrow", sans-serif;
  --mono: "Share Tech Mono", "Courier New", monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--text);
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  position: relative;
  background-image: radial-gradient(circle at 1px 1px, rgba(20,17,15,.055) 1px, transparent 1.4px);
  background-size: 5px 5px;
}

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: .22;
  mix-blend-mode: multiply;
  background-image: radial-gradient(circle at 1px 1px, rgba(20,17,15,.4) 1px, transparent 1.6px);
  background-size: 3px 3px;
}

.newsprint {
  position: fixed;
  inset: -2%;
  width: 104%;
  height: 104%;
  object-fit: cover;
  z-index: 41;
  pointer-events: none;
  opacity: .20;
  mix-blend-mode: multiply;
}

.fold {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 53.5%;
  width: 2px;
  z-index: 42;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(20,17,15,0) 0%, rgba(20,17,15,.13) 45%, rgba(255,255,255,.22) 55%, rgba(20,17,15,0) 100%);
  box-shadow: 8px 0 20px rgba(20,17,15,.05), -8px 0 20px rgba(20,17,15,.04);
}

.page {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 1180px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 8px 12px 4px;
  display: flex;
  flex-direction: column;
}

.masthead {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: padding .25s ease;
}

.title-wrap { width: min(100%, 760px); display: flex; justify-content: center; }

.title-img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(3px 3px 0 rgba(44,107,98,.30)) drop-shadow(-1px -1px 0 rgba(193,68,30,.25));
  transition: width .25s ease, height .25s ease;
}

.dateline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100%, 720px);
  margin-top: -2px;
  font-family: var(--mono);
  font-size: clamp(9px, 1.5vw, 12px);
  letter-spacing: .18em;
  color: var(--ink);
  opacity: .86;
}

.dateline i { display: block; height: 3px; flex: 1; background: var(--ink); }

.sound-toggle {
  position: absolute;
  right: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 2px solid var(--ink);
  background: var(--cream);
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(8px, 1.3vw, 10px);
  letter-spacing: .08em;
  cursor: pointer;
  transform: rotate(1.5deg);
}

.sound-toggle[aria-pressed="false"] { opacity: .55; }
.sound-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rust); }
.sound-toggle[aria-pressed="false"] .sound-dot { background: var(--steel); }

.app { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.screen { width: 100%; }
.hidden, [hidden] { display: none !important; }

.select {
  padding-top: clamp(6px, 1.4vh, 18px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(10px, 1.9vh, 20px);
  flex: 1;
  min-height: 0;
}

.select-head { text-align: center; }

.kicker {
  margin: 0 0 3px;
  font-family: var(--mono);
  font-size: clamp(8px, 1.3vw, 11px);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--rust);
}

.select-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(22px, 5.2vw, 52px);
  line-height: .96;
  letter-spacing: .01em;
  color: var(--ink);
  text-shadow: 2px 2px 0 rgba(44,107,98,.22);
  transform: rotate(-.5deg);
}

.select-sub {
  margin: 5px 0 0;
  font-size: clamp(11px, 1.9vw, 16px);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #2c2824;
}

.select-sub b { color: var(--rust); font-weight: 700; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 1.2vw, 14px);
  align-items: end;
  max-width: 850px;
  width: 100%;
  margin: 0 auto;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--text);
  text-align: center;
  cursor: default;
  transform-origin: 50% 90%;
  transition: transform .14s ease, filter .14s ease;
}

button.card { cursor: pointer; }
.card-riveter { transform: rotate(-1.4deg); }
.card-bronzefist { transform: rotate(1.4deg); }
.card-deuce { transform: rotate(.2deg) translateY(-4px); }

.card-paper {
  display: block;
  width: 100%;
  background: var(--cream);
  border: 2px solid rgba(20,17,15,.25);
  padding: 3px;
  box-shadow: 3px 4px 0 rgba(20,17,15,.12);
}

.card-paper img { display: block; width: 100%; height: auto; }

.card-name {
  margin-top: 3px;
  font-family: var(--display);
  font-size: clamp(13px, 2.4vw, 25px);
  line-height: 1;
  letter-spacing: .01em;
}

.card-meta {
  font-family: var(--mono);
  font-size: clamp(7px, 1.15vw, 10px);
  letter-spacing: .06em;
  color: #4a443c;
}

.card-cta {
  margin-top: 2px;
  padding: 1px 6px;
  border: 2px solid var(--rust);
  color: var(--rust);
  font-family: var(--mono);
  font-size: clamp(7px, 1.15vw, 10px);
  letter-spacing: .10em;
  transform: rotate(-1.5deg);
  background: rgba(237,227,207,.7);
}

button.card:hover .card-paper,
button.card:focus-visible .card-paper {
  box-shadow: 5px 6px 0 rgba(193,68,30,.25);
  border-color: var(--rust);
}

button.card:hover, button.card:focus-visible { transform: translateY(-3px) rotate(-1deg); }
button.card:active { transform: translateY(1px) scale(.985); }
button.card:hover .card-cta { background: var(--rust); color: var(--cream); }

.card.is-you .card-paper { border-color: var(--copper); box-shadow: 3px 4px 0 rgba(44,107,98,.28); }

.you-badge {
  position: absolute;
  top: -8px;
  z-index: 2;
  padding: 2px 7px;
  background: var(--copper);
  color: var(--cream);
  font-family: var(--mono);
  font-size: clamp(7px, 1.1vw, 10px);
  letter-spacing: .12em;
  transform: rotate(-2deg);
  box-shadow: 1px 2px 0 rgba(20,17,15,.25);
}

.board {
  width: min(100%, 540px);
  margin: 0 auto;
  border: var(--rule);
  background: rgba(237,227,207,.55);
  padding: 5px 9px 6px;
  box-shadow: 3px 3px 0 rgba(20,17,15,.13);
}

.board-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 2px;
  font-family: var(--display);
  font-size: clamp(10px, 1.8vw, 15px);
  letter-spacing: .04em;
}

.board-head span:last-child { font-family: var(--mono); font-size: clamp(8px, 1.3vw, 11px); color: var(--rust); }

.board-list {
  list-style: none;
  margin: 3px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-family: var(--mono);
  font-size: clamp(9px, 1.4vw, 12px);
}

.board-list li { display: flex; gap: 8px; align-items: baseline; white-space: nowrap; }
.board-list .rank { width: 1.6em; color: var(--rust); }
.board-list .who { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.board-list .who a { color: var(--ink); text-decoration: none; border-bottom: 1px solid rgba(193,68,30,.45); }
.board-list .time { color: var(--ink); }
.board-list .board-empty { color: #6d6355; letter-spacing: .05em; }
.board-list li.mine .who { color: var(--rust); }

.howto {
  margin: 0 auto;
  max-width: 620px;
  text-align: center;
  font-family: var(--mono);
  font-size: clamp(8px, 1.35vw, 11px);
  letter-spacing: .06em;
  color: #4f483f;
  line-height: 1.45;
}

kbd {
  border: 1px solid var(--ink);
  padding: 0 4px;
  background: var(--paper-deep);
  font-family: var(--mono);
  font-size: .95em;
}

.fight {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 2px;
}

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 5px 6px 0 rgba(20,17,15,.16), inset 0 0 0 2px rgba(237,227,207,.7);
  container-type: size;
  touch-action: none;
  isolation: isolate;
}

.game-mount { position: absolute; inset: 0; }
.game-mount canvas { display: block; width: 100% !important; height: 100% !important; }

.hud {
  position: absolute;
  inset: 0 0 auto 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.4% 1.6% 0;
  pointer-events: none;
  z-index: 3;
}

.hud-side { display: flex; flex-direction: column; gap: .35cqh; width: clamp(112px, 29cqw, 310px); }
.hud-left { align-items: flex-start; }
.hud-right { align-items: flex-end; }

.health-wrap { position: relative; width: 100%; }
.health-wrap.left { width: 100%; }
.health-wrap.right { width: 92%; }
.hud-img { display: block; width: 100%; height: auto; }

.health-track {
  position: absolute;
  top: 22%;
  bottom: 19%;
  left: 12.5%;
  right: 2.5%;
  background: var(--ink);
  background-image: radial-gradient(circle at 1px 1px, rgba(237,227,207,.20) 1px, transparent 1.3px);
  background-size: 4px 4px;
  overflow: hidden;
  border: 1px solid rgba(237,227,207,.25);
}

.health-wrap.right .health-track { left: 3%; right: 14%; }

.health-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--rust);
  background-image:
    repeating-linear-gradient(90deg, rgba(20,17,15,.82) 0 2px, transparent 2px 11px),
    radial-gradient(circle at 1px 1px, rgba(237,227,207,.32) 1px, transparent 1.4px);
  background-size: auto, 4px 4px;
  box-shadow: inset 0 0 0 1px rgba(20,17,15,.35);
  transition: width .13s linear;
}

.health-wrap.right .health-fill { left: auto; right: 0; }
.health-fill.low { background-color: var(--rust); animation: lowpulse .6s steps(2) infinite; }

@keyframes lowpulse {
  0%, 100% { background-color: var(--rust); }
  50% { background-color: #8e2f14; }
}

.meter-wrap { position: relative; width: 88%; }
.hud-right .meter-wrap { align-self: flex-end; }
.meter-track {
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 4%;
  right: 22%;
  background: var(--ink);
  overflow: hidden;
}
.meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--amber);
  background-image: repeating-linear-gradient(90deg, rgba(20,17,15,.75) 0 2px, transparent 2px 10px);
}
.hud-right .meter-fill { left: auto; right: 0; }
.meter-fill.full { animation: meterfull .55s steps(2) infinite; }
@keyframes meterfull {
  0%, 100% { background-color: var(--amber); }
  50% { background-color: var(--cream); }
}

.hud-name {
  font-family: var(--display);
  background: rgba(237,227,207,.72);
  padding: 1px 4px;
  border-bottom: 2px solid rgba(20,17,15,.55);
  font-size: clamp(7px, 1.55cqw, 15px);
  line-height: 1;
  letter-spacing: .02em;
  color: var(--ink);
  text-shadow: 1px 1px 0 rgba(237,227,207,.8);
  white-space: nowrap;
  margin-top: -1px;
}
.hud-name span { font-family: var(--mono); font-size: .72em; color: #3b352e; }
.hud-name.right { text-align: right; }

.timer-wrap {
  position: relative;
  width: clamp(72px, 19cqw, 200px);
  flex: 0 0 auto;
  margin-top: -.4cqh;
}

.timer-img { display: block; width: 100%; height: auto; filter: drop-shadow(2px 2px 0 rgba(20,17,15,.18)); }

.timer-face {
  position: absolute;
  left: 27%;
  right: 27%;
  top: 15%;
  bottom: 15%;
  background: var(--ink);
  clip-path: polygon(12% 0, 88% 0, 100% 18%, 100% 82%, 88% 100%, 12% 100%, 0 82%, 0 18%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.timer-face::after {
  content: "";
  position: absolute;
  inset: 4%;
  border: 1px solid rgba(193,68,30,.7);
  clip-path: polygon(12% 0, 88% 0, 100% 18%, 100% 82%, 88% 100%, 12% 100%, 0 82%, 0 18%);
}

.timer-num {
  font-family: var(--mono);
  font-size: clamp(18px, 5.7cqw, 60px);
  line-height: 1;
  color: var(--cream);
  letter-spacing: -.05em;
  text-shadow: 2px 2px 0 rgba(193,68,30,.35);
}

.timer-num.warn { color: var(--rust); }

.pips {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: -21%;
  display: flex;
  justify-content: space-between;
  padding: 2px 5px;
  background: rgba(237,227,207,.92);
  border: 1px solid rgba(20,17,15,.7);
  pointer-events: none;
}
.pip-set { display: flex; gap: 2px; }
.pip-set img { width: clamp(8px, 1.8cqw, 15px); height: auto; opacity: .55; filter: grayscale(1) contrast(.7); }
.pip-set img.on { opacity: 1; filter: none; }

.combo {
  position: absolute;
  left: 2.5%;
  bottom: 6%;
  width: clamp(120px, 33cqw, 360px);
  z-index: 4;
  pointer-events: none;
  animation: comboIn .14s ease-out;
  transform: rotate(-2.5deg);
}
.combo img { display: block; width: 100%; height: auto; }
.combo-num {
  position: absolute;
  left: 9%;
  top: 53%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: clamp(15px, 5.2cqw, 54px);
  line-height: 1;
  color: var(--ink);
}
@keyframes comboIn {
  from { transform: rotate(-2.5deg) scale(.7); opacity: 0; }
  to { transform: rotate(-2.5deg) scale(1); opacity: 1; }
}

.stamp-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 6;
}

.stamp {
  width: min(72%, 460px);
  height: auto;
  filter: drop-shadow(4px 5px 0 rgba(20,17,15,.28));
  animation: stampIn .26s cubic-bezier(.16,1.4,.4,1) both;
  mix-blend-mode: multiply;
}

.stamp.text-stamp {
  width: auto;
  max-width: 78%;
  padding: .10em .30em .14em;
  background: var(--cream);
  border: 3px solid var(--ink);
  outline: 2px solid var(--rust);
  outline-offset: 4px;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(25px, 8cqw, 78px);
  line-height: .95;
  letter-spacing: .01em;
  transform: rotate(-4deg);
  text-shadow: 1px 2px 0 rgba(193,68,30,.35);
  animation: stampIn .26s cubic-bezier(.16,1.4,.4,1) both;
  mix-blend-mode: multiply;
}

@keyframes stampIn {
  0% { transform: rotate(-7deg) scale(1.55); opacity: 0; filter: blur(2px); }
  60% { opacity: 1; }
  100% { transform: rotate(-4deg) scale(1); opacity: 1; filter: blur(0); }
}

.stamp-layer .stamp:nth-child(2) { position: absolute; }

.stage-plate {
  position: absolute;
  left: 2.4%;
  bottom: 1.6%;
  z-index: 4;
  padding: 2px 6px;
  background: var(--cream);
  border: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: clamp(7px, 1.45cqw, 12px);
  letter-spacing: .08em;
  color: var(--ink);
  transform: rotate(-.6deg);
  pointer-events: none;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: clamp(6px, 2vw, 28px);
  padding: 0 2px;
  flex: 0 0 auto;
}

.ctrl-group { display: flex; gap: clamp(4px, 1.4vw, 12px); align-items: flex-end; }

.ctrl {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: clamp(42px, 10.5vw, 80px);
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: clamp(7px, 1.45vw, 11px);
  letter-spacing: .06em;
  color: var(--ink);
  cursor: pointer;
  touch-action: none;
  transition: transform .06s ease;
}

.ctrl img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(2px 3px 0 rgba(20,17,15,.18));
  transition: filter .06s ease, transform .06s ease;
}

.ctrl span { margin-top: -1px; }

.ctrl.is-down { transform: translateY(2px); }
.ctrl.is-down img { filter: drop-shadow(0 1px 0 rgba(20,17,15,.25)) brightness(.92); transform: scale(.965); }
.ctrl.guard.is-down img { filter: drop-shadow(0 1px 0 rgba(20,17,15,.25)) sepia(.3) hue-rotate(120deg) saturate(1.5); }

.fight-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 26px;
  flex: 0 0 auto;
}

.mini {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px 1px 2px;
  border: 2px solid var(--ink);
  background: var(--cream);
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(7px, 1.3vw, 10px);
  letter-spacing: .06em;
  cursor: pointer;
  transform: rotate(-1deg);
}
.mini img { width: clamp(18px, 4.4vw, 30px); height: auto; display: block; }
.mini:active { transform: translateY(1px); }

.fight-legend {
  margin: 0;
  flex: 1;
  text-align: center;
  font-family: var(--mono);
  font-size: clamp(7px, 1.25vw, 10px);
  letter-spacing: .05em;
  color: #5a5146;
}

.panel-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(20,17,15,.42);
}

.panel {
  width: min(100%, 460px);
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 7px 8px 0 rgba(20,17,15,.35);
  padding: clamp(12px, 3.4vw, 24px);
  transform: rotate(-.7deg);
  position: relative;
  text-align: center;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(193,68,30,.55);
  pointer-events: none;
}

.panel-kicker {
  margin: 0 0 3px;
  font-family: var(--mono);
  font-size: clamp(9px, 1.6vw, 12px);
  letter-spacing: .18em;
  color: var(--rust);
  text-transform: uppercase;
}

.panel-title {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(24px, 6.4vw, 44px);
  line-height: .95;
  letter-spacing: .01em;
}

.panel-body {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 10px;
}

.panel-portrait {
  width: clamp(72px, 20vw, 118px);
  height: auto;
  display: block;
  border: 2px solid var(--ink);
}

.panel-copy { text-align: left; }
.panel-copy p { margin: 0; font-size: clamp(12px, 2.1vw, 16px); line-height: 1.2; letter-spacing: .02em; }
.panel-record { margin-top: 4px !important; font-family: var(--mono); font-size: clamp(9px, 1.6vw, 12px) !important; color: var(--rust); }

.panel-btn {
  display: inline-block;
  padding: 7px 16px;
  border: 3px solid var(--ink);
  background: var(--rust);
  color: var(--cream);
  font-family: var(--display);
  font-size: clamp(14px, 3.4vw, 22px);
  letter-spacing: .03em;
  cursor: pointer;
  transform: rotate(-1.5deg);
  box-shadow: 3px 4px 0 rgba(20,17,15,.25);
}
.panel-btn:active { transform: translateY(2px) rotate(-1.5deg); box-shadow: 1px 2px 0 rgba(20,17,15,.25); }
.panel-btn img { display: block; width: clamp(150px, 44vw, 250px); height: auto; filter: drop-shadow(2px 3px 0 rgba(20,17,15,.25)); }
.panel-btn.img-only { padding: 0; border: 0; background: transparent; box-shadow: none; }

.colophon {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-top: 2px solid var(--ink);
  margin-top: 4px;
  padding-top: 2px;
  font-family: var(--mono);
  font-size: clamp(7px, 1.1vw, 9px);
  letter-spacing: .10em;
  color: #4f483f;
}

.page.playing .masthead { gap: 0; }
.page.playing .title-wrap { width: auto; }
.page.playing .title-img { width: auto; height: clamp(46px, 8.4vh, 74px); }
.page.playing .dateline { display: none; }
.page.playing .sound-toggle { bottom: 50%; transform: translateY(50%) rotate(1.5deg); }
.page.playing .colophon { display: none; }
.page.playing .select { display: none; }

.jolt { animation: jolt .13s steps(2) both; }
@keyframes jolt {
  0% { transform: translate(0,0) rotate(0); }
  25% { transform: translate(-3px,2px) rotate(-.25deg); }
  50% { transform: translate(3px,-1px) rotate(.2deg); }
  75% { transform: translate(-1px,1px) rotate(0); }
  100% { transform: none; }
}

.violet-edge {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: var(--violet);
  opacity: 0;
}
.violet-edge.on { animation: violetflash .18s steps(2) both; }
@keyframes violetflash {
  0% { opacity: .42; }
  60% { opacity: .18; }
  100% { opacity: 0; }
}

.stage-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  font-family: var(--display);
  font-size: clamp(15px, 3.4vw, 26px);
  color: var(--rust);
  z-index: 9;
  background: var(--cream);
}

@media (max-width: 600px) {
  .page { padding: 5px 8px 3px; }
  .cards { gap: 5px; }
  .card-paper { padding: 2px; }
  .board { padding: 4px 7px; }
  .howto { font-size: 8px; }
  .fight-legend { display: none; }
  .controls { gap: 3px; }
  .ctrl-group { gap: 4px; }
  .ctrl { width: clamp(38px, 11.2vw, 52px); }
}

@media (max-width: 380px) {
  .card-name { font-size: 12px; }
  .card-meta { font-size: 6.5px; }
  .card-cta { font-size: 6.5px; }
}

@media (orientation: landscape) and (max-height: 620px) {
  .page { padding: 4px 10px; max-width: none; }
  .masthead { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; }
  .title-wrap { width: auto; }
  .title-img { width: auto; height: clamp(38px, 12vh, 64px); }
  .dateline { display: flex; flex: 1; margin: 0 14px; font-size: clamp(7px, 1.1vh, 10px); }
  .sound-toggle { position: static; transform: rotate(1.5deg); }
  .page.playing .title-wrap { width: auto; }
  .page.playing .title-img { height: clamp(34px, 9vh, 48px); }
  .page.playing .masthead { flex-direction: row; min-height: 0; }
  .page.playing .sound-toggle { position: static; transform: rotate(1.5deg); }
  .select {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 2.4vw, 26px);
    padding-top: 2px;
  }
  .select-head { flex: 0 0 31%; text-align: left; }
  .kicker { font-size: clamp(7px, 1.15vh, 10px); letter-spacing: .13em; }
  .select-title { font-size: clamp(18px, 3.9vh, 34px); }
  .select-sub { font-size: clamp(9px, 1.55vh, 13px); letter-spacing: .06em; }
  .cards { flex: 1; max-width: none; gap: 8px; }
  .card-name { font-size: clamp(11px, 2.4vh, 20px); }
  .card-meta, .card-cta { font-size: clamp(6px, 1.2vh, 9px); }
  .board { display: none; }
  .howto { display: none; }
  .select-controls { display: none !important; }
  .colophon { margin-top: 2px; font-size: clamp(6px, 1.1vh, 8px); }
  .fight { padding-top: 0; gap: 3px; position: relative; }
  .stage { border-width: 2px; }
  .controls {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 34px;
    padding: 0;
    z-index: 8;
    pointer-events: none;
  }
  .ctrl-group { pointer-events: auto; }
  .ctrl { width: clamp(42px, 8.6vh, 62px); }
  .ctrl span { background: rgba(237,227,207,.88); border: 1px solid rgba(20,17,15,.5); padding: 0 3px; }
  .fight-foot { position: absolute; right: 8px; bottom: 4px; z-index: 8; min-height: 0; }
  .fight-legend { display: none; }
  .hud-side { width: clamp(100px, 25vw, 220px); }
  .timer-wrap { width: clamp(66px, 15vw, 150px); }
  .stage-plate { bottom: 29%; }
  .combo { bottom: 23%; }
}

@media (min-width: 900px) and (min-height: 621px) {
  .title-wrap { width: min(100%, 620px); }
  .select {
    display: grid;
    grid-template-columns: minmax(230px, 320px) minmax(0, 1fr);
    grid-template-areas: "head cards" "board cards" "howto cards";
    align-items: center;
    column-gap: clamp(18px, 3vw, 40px);
    row-gap: 10px;
    justify-content: stretch;
  }
  .select-head { grid-area: head; text-align: left; align-self: end; }
  .select-title { font-size: clamp(22px, 3.2vw, 42px); }
  .select-sub { font-size: clamp(11px, 1.5vw, 15px); }
  .cards { grid-area: cards; max-width: none; align-self: center; }
  .board { grid-area: board; align-self: start; width: 100%; margin: 0; }
  .howto { grid-area: howto; text-align: left; margin: 0; }
  .select-controls { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .stamp, .stamp.text-stamp, .combo, .jolt, .health-fill.low, .meter-fill.full { animation: none !important; }
  .health-fill { transition: none; }
}

.panel-back {
  display: block;
  margin: 8px auto 0;
  padding: 2px 6px;
  border: 0;
  border-bottom: 2px solid rgba(20,17,15,.55);
  background: transparent;
  color: #4f483f;
  font-family: var(--mono);
  font-size: clamp(8px, 1.5vw, 11px);
  letter-spacing: .10em;
  cursor: pointer;
}
.panel-back:hover { color: var(--rust); border-color: var(--rust); }

.howto b { color: var(--rust); font-weight: 700; }

.select-controls {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(6px, 1.6vw, 14px);
  margin: 0 auto;
  padding-top: 6px;
  border-top: 2px solid rgba(20,17,15,.5);
  width: min(100%, 420px);
}
.select-controls .sc { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.select-controls .sc img {
  width: clamp(30px, 8vw, 46px);
  height: auto;
  display: block;
  filter: drop-shadow(1px 2px 0 rgba(20,17,15,.16));
}
.select-controls .sc b {
  font-family: var(--mono);
  font-weight: 400;
  font-size: clamp(6px, 1.3vw, 9px);
  letter-spacing: .07em;
  color: #4f483f;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.stage-loading {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  background-image: radial-gradient(circle at 1px 1px, rgba(20,17,15,.16) 1px, transparent 1.5px);
  background-size: 5px 5px;
}
.stage-loading span {
  font-family: var(--display);
  font-size: clamp(18px, 4.6vw, 34px);
  color: var(--rust);
  transform: rotate(-2deg);
  border: 3px solid var(--ink);
  outline: 2px solid var(--rust);
  outline-offset: 4px;
  padding: 6px 12px;
  background: var(--cream);
}

@supports (padding: max(0px)) {
  .page {
    padding-top: max(7px, env(safe-area-inset-top));
    padding-right: max(10px, env(safe-area-inset-right));
    padding-bottom: max(4px, env(safe-area-inset-bottom));
    padding-left: max(10px, env(safe-area-inset-left));
  }
}

@media (max-width: 360px) {
  .hud { padding: 1.2% 1% 0; }
  .hud-side { width: clamp(92px, 29cqw, 310px); }
  .timer-wrap { width: clamp(62px, 19cqw, 200px); }
  .select-title { font-size: 20px; }
  .card-name { font-size: 11px; }
  .card-meta, .card-cta { font-size: 6px; }
  .select-controls .sc img { width: 28px; }
}
