:root {
  --kraft: #b78952;
  --kraft-dark: #8f6435;
  --cream: #e9dab8;
  --cream-hi: #f3e8cd;
  --ink: #1d1913;
  --ink-70: rgba(29, 25, 19, 0.7);
  --ink-45: rgba(29, 25, 19, 0.45);
  --ink-22: rgba(29, 25, 19, 0.22);
  --teal: #1e8b8c;
  --red: #bf3f2b;
  --cobalt: #2b5c9e;
  --ochre: #d79a2c;
  --black: #1b1a16;
  --steel: #8d9396;
  --hair: rgba(29, 25, 19, 0.38);
  --hair-cream: rgba(233, 218, 184, 0.45);
  --hard-shadow: 2px 3px 0 rgba(45, 32, 18, 0.25);
  --hard-shadow-lg: 4px 6px 0 rgba(45, 32, 18, 0.28);
  --fs-micro: clamp(8px, 0.62vw, 9.5px);
  --fs-label: clamp(9px, 0.7vw, 10.5px);
  --fs-body: clamp(10px, 0.78vw, 11.5px);
  --fs-name: clamp(11px, 0.88vw, 13.5px);
  --fs-title: clamp(21px, 2.05vw, 30px);
  --pad: clamp(9px, 1.5vw, 20px);
  --gap: clamp(7px, 1vw, 13px);
  --class-disc: clamp(58px, 6vw, 92px);
  --slammer-disc: clamp(52px, 5.2vw, 76px);
  --shop-disc: clamp(54px, 5vw, 74px);
  --pot-disc: clamp(54px, 5.4vw, 80px);
  --hand-disc: clamp(50px, 4.8vw, 64px);
  --paper-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  --label-bg: var(--cream);
  --sound: 1;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body {
  background: #a97c4a;
  color: var(--ink);
  font-family: Archivo, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.35;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
img { display: block; max-width: 100%; }
p, h1, h2, h3, h4, ul { margin: 0; }
ul { padding: 0; list-style: none; }
.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;
}
.mono {
  font-family: "Space Mono", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* ---------- stock ---------- */
.mat-bg {
  position: fixed; inset: 0; z-index: -3;
  background: url("assets/img/workbench_mat.webp") center center / cover no-repeat;
  background-color: var(--kraft);
}
.mat-bg::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(183, 137, 82, 0.06);
}
.grain {
  position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: 0.2;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}
.margin-rule {
  position: fixed; inset: 8px; z-index: 9; pointer-events: none;
  border: 1px solid rgba(233, 218, 184, 0.34);
}

/* ---------- sheet ---------- */
.sheet {
  position: relative;
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: var(--pad) var(--pad) calc(var(--pad) + 4px);
  display: grid;
  grid-template-columns: 27% minmax(0, 1fr) 29%;
  grid-template-areas:
    "title classes classes"
    "deck slammers slammers"
    "deck play tray"
    "plates plates plates";
  gap: var(--gap);
  align-items: start;
  min-height: 100vh;
}
.cross { position: absolute; width: 12px; height: 12px; pointer-events: none; opacity: 0.5; }
.cross::before, .cross::after { content: ""; position: absolute; background: var(--ink); }
.cross::before { left: 5px; top: 0; width: 1px; height: 12px; }
.cross::after { top: 5px; left: 0; height: 1px; width: 12px; }
.cross.tl { top: 3px; left: 3px; }
.cross.tr { top: 3px; right: 3px; }
.cross.bl { bottom: 3px; left: 3px; }
.cross.br { bottom: 3px; right: 3px; }

/* ---------- screen 1: slammer selection ---------- */
.screen-prompt {
  display: none;
  margin: 8px 0 0;
  padding: 6px 10px;
  background: var(--cream);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--hair);
  box-shadow: var(--hard-shadow);
  font-family: "Space Mono", monospace;
  font-size: clamp(8px, 0.7vw, 10px);
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
  color: var(--ink);
}
.sheet.screen-slammer {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.screen-slammer .classes-block,
.screen-slammer .play-block,
.screen-slammer .deck-block,
.screen-slammer .tray-block,
.screen-slammer .plate-bar { display: none !important; }
.screen-slammer .slammer-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.screen-slammer .slammer-rail {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 1.5vw, 24px);
  align-content: center;
  align-items: stretch;
  overflow: visible;
  padding: 0;
}
.screen-slammer .slammer-card { width: 100%; min-width: 0; }
.screen-slammer .slammer-face {
  width: clamp(76px, 15vh, 150px);
  height: clamp(76px, 15vh, 150px);
}
.screen-slammer .slammer-label {
  min-height: 0;
  padding: 6px 9px 8px;
  margin-top: 8px;
}
.screen-slammer .slammer-top b { font-size: clamp(14px, 1.5vw, 22px); }
.screen-slammer .slammer-tag { font-size: clamp(7px, 0.6vw, 9px); padding: 1px 3px; }
.screen-slammer .spec { font-size: clamp(9px, 0.8vw, 12px); line-height: 1.3; }
.screen-slammer .spec i { font-size: clamp(6.5px, 0.55vw, 8px); }
.screen-slammer .slammer-label .plate-no { font-size: clamp(6px, 0.5vw, 8px); }
.screen-slammer .screen-prompt { display: block; }
@media (max-width: 700px) {
  .screen-slammer .slammer-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }
  .screen-slammer .slammer-face {
    width: clamp(64px, 12.6vh, 104px);
    height: clamp(64px, 12.6vh, 104px);
  }
  .screen-slammer .slammer-label { padding: 4px 6px 6px; margin-top: 5px; }
  .screen-slammer .slammer-top b { font-size: clamp(9px, 1.5vh, 13px); }
  .screen-slammer .slammer-tag { font-size: 6px; }
  .screen-slammer .spec { font-size: clamp(6.5px, 1.05vh, 9px); line-height: 1.2; }
  .screen-slammer .spec i { font-size: 5px; }
  .screen-slammer .slammer-label .plate-no { font-size: 5px; }
  .screen-slammer .screen-prompt { font-size: 7px; padding: 4px 6px; margin-top: 5px; }
  .sheet.screen-slammer { height: 100dvh; min-height: 100dvh; overflow: hidden; }
}

/* ---------- shared print parts ---------- */
.block { min-width: 0; }
.block-head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 3px 6px 4px;
  background: var(--label-bg);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--hair);
  box-shadow: var(--hard-shadow);
  margin-bottom: 7px;
  position: relative;
}
.block-head::after {
  content: ""; position: absolute; right: 3px; top: 0; bottom: 0; width: 14px;
  opacity: 0.35; pointer-events: none;
  background-image: radial-gradient(circle, var(--ink) 0.8px, transparent 1px);
  background-size: 3px 3px;
  -webkit-mask-image: linear-gradient(to left, #000, transparent);
  mask-image: linear-gradient(to left, #000, transparent);
}
.block-head h2 {
  font-family: Archivo, sans-serif;
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}
.block-note {
  font-family: "Space Mono", monospace;
  font-size: var(--fs-micro);
  letter-spacing: 0.03em;
  color: var(--ink-70);
  text-transform: uppercase;
  margin-left: auto;
  text-align: right;
}
.swipe-hint {
  display: none;
  font-family: "Space Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--red);
  margin-left: auto;
}
.block-caption {
  margin-top: 6px;
  padding: 4px 6px;
  background: var(--label-bg);
  border-top: 1px solid var(--hair);
  font-size: var(--fs-micro);
  line-height: 1.4;
  color: var(--ink-70);
  box-shadow: var(--hard-shadow);
}
.block-caption b { color: var(--ink); letter-spacing: 0.04em; }
.paper-tab {
  appearance: none;
  background: var(--cream);
  border: 1px solid var(--ink);
  box-shadow: 2px 2px 0 rgba(45, 32, 18, 0.28);
  padding: 5px 9px;
  font-family: "Space Mono", monospace;
  font-size: var(--fs-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.paper-tab:hover, .paper-tab:focus-visible {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 rgba(45, 32, 18, 0.3);
  outline: none;
}
.paper-tab:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(45, 32, 18, 0.25); }
.paper-tab.small { padding: 3px 7px; font-size: 8px; }

/* ---------- title ---------- */
.title-block { grid-area: title; min-width: 0; }
.title-plate {
  position: relative;
  aspect-ratio: 1024 / 464;
  background: url("assets/img/title_plate.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(3px 5px 0 rgba(45, 32, 18, 0.25));
}
.title-panel {
  position: absolute;
  left: 8.6%; right: 8.6%; top: 21.5%; bottom: 21.5%;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center;
  gap: 3px;
}
.title {
  font-family: Graduate, Archivo, sans-serif;
  font-weight: 400;
  font-size: var(--fs-title);
  line-height: 0.92;
  letter-spacing: -0.028em;
  color: var(--teal);
  text-shadow: 2px 2px 0 var(--red);
  white-space: nowrap;
  text-transform: uppercase;
}
.title-tag {
  display: block;
  font-family: "Space Mono", monospace;
  font-size: clamp(7px, 0.68vw, 9px);
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--ink);
  text-shadow: none;
  margin-top: 4px;
  text-transform: uppercase;
}
.title-micro {
  font-family: "Space Mono", monospace;
  font-size: clamp(6.5px, 0.58vw, 8px);
  letter-spacing: 0.12em;
  color: var(--ink-70);
  text-transform: uppercase;
}
.title-notes {
  margin-top: 7px;
  background: var(--label-bg);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--hair);
  box-shadow: var(--hard-shadow);
  padding: 6px 8px 7px;
}
.kicker {
  font-family: Archivo, sans-serif;
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
}
.brief {
  font-size: var(--fs-body);
  line-height: 1.38;
  margin-top: 3px;
  max-width: 40ch;
}
.title-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  margin-top: 7px;
}
.paper-tab.record {
  cursor: default;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding: 3px 2px;
  color: var(--ink-70);
}
.paper-tab.record b { color: var(--ink); }

/* ---------- rails ---------- */
.rail {
  display: flex;
  gap: clamp(4px, 0.7vw, 10px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding: 2px 2px 5px;
  scroll-snap-type: x proximity;
}
.rail::-webkit-scrollbar { display: none; }
.classes-block { grid-area: classes; }
.slammer-block { grid-area: slammers; }
.classes-rail .class-card { flex: 1 1 0; min-width: 0; }
.slammer-rail .slammer-card { flex: 1 1 0; min-width: 0; }

.class-card {
  scroll-snap-align: start;
  min-width: 0;
  display: flex; flex-direction: column;
  align-items: center;
}
.face-holder {
  position: relative;
  width: var(--class-disc);
  height: var(--class-disc);
  flex: none;
  filter: drop-shadow(2px 3px 0 rgba(45, 32, 18, 0.2));
  transition: transform 0.18s ease, filter 0.18s ease;
}
.face-holder::after {
  content: ""; position: absolute; left: 12%; right: 12%; bottom: -5px; height: 7px;
  border-radius: 50%;
  background: rgba(45, 32, 18, 0.19);
  filter: blur(1.5px);
  z-index: -1;
}
.pog-face {
  position: relative;
  display: block;
  width: 100%; height: 100%;
  border-radius: 50%;
}
.face-img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 50%;
}
.weight-badge {
  position: absolute;
  left: 50%; bottom: -5%;
  transform: translateX(-50%);
  min-width: calc(var(--class-disc) * 0.3);
  height: calc(var(--class-disc) * 0.3);
  padding: 0 3px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: calc(var(--class-disc) * 0.21);
  line-height: 1;
  color: var(--ink);
  background: var(--cream-hi);
  border: 1px solid var(--ink);
  border-radius: 50%;
  box-shadow: 1px 1px 0 rgba(45, 32, 18, 0.3);
  z-index: 3;
  transition: color 0.12s ease, background 0.12s ease;
}
.rarity-mark {
  position: absolute;
  top: -1%; right: -2%;
  width: 26%;
  height: 26%;
  z-index: 3;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0.5px 0.5px 0 rgba(29, 25, 19, 0.25));
}
.rarity-mark img { width: 100%; height: 100%; object-fit: contain; }
.rarity-mark.dots { gap: 0; }
.rarity-mark.dots img { width: 30%; }
.rarity-mark.dots.one img { width: 55%; }
.rarity-mark.burst { width: 38%; height: 38%; top: -7%; right: -7%; }
.rarity-mark.burst img { width: 100%; }

.label-strip {
  width: 100%;
  margin-top: 7px;
  background: var(--label-bg);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--hair);
  box-shadow: var(--hard-shadow);
  padding: 3px 4px 4px;
  display: flex; flex-direction: column;
  gap: 1px;
  text-align: left;
  min-height: 52px;
}
.label-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 3px;
}
.class-name {
  font-family: Archivo, sans-serif;
  font-weight: 700;
  font-size: var(--fs-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.label-row .mono { color: var(--ink-70); font-size: var(--fs-micro); white-space: nowrap; }
.pips { display: flex; gap: 1px; height: 6px; align-items: center; }
.pips img { width: 6px; height: 6px; object-fit: contain; }
.rarity-line {
  font-family: "Space Mono", monospace;
  font-size: 7.5px;
  letter-spacing: 0.04em;
  color: var(--ink-70);
  text-transform: uppercase;
}
.ability {
  font-size: var(--fs-micro);
  line-height: 1.26;
  color: var(--ink);
  margin-top: 1px;
}
.ability em { font-style: normal; color: var(--red); font-weight: 700; }
.class-card .ability { font-size: clamp(8px, 0.66vw, 9.5px); }
.class-card .class-name { color: var(--ink-c); }
.class-card .label-strip { border-top-color: var(--ink-c); }

/* paper tooth, halftone edge, misregistered rule */
.label-strip, .slammer-label, .block-head, .block-caption, .inspect-strip,
.title-notes, .paper-tab, .deck-tag, .deck-note, .scale-tab, .pot-empty,
.arena-label, .pot-label, .hand-card .hand-label, .tray-side-label,
.sheet-dialog, .dialog-head, .end-col {
  background-image: var(--paper-noise);
  background-size: 140px 140px;
  background-blend-mode: multiply;
}
.label-strip, .slammer-label, .hand-card .hand-label { position: relative; overflow: hidden; }
.label-strip::after, .slammer-label::after, .hand-card .hand-label::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  pointer-events: none; opacity: 0.17;
  background-image: radial-gradient(circle, currentColor 0.7px, transparent 1.1px);
  background-size: 3px 3px;
  -webkit-mask-image: linear-gradient(to top, #000, transparent);
  mask-image: linear-gradient(to top, #000, transparent);
}
.label-strip::before, .slammer-label::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 1px; height: 1px;
  background: var(--red); opacity: 0.28; pointer-events: none;
}
.label-row {
  border-bottom: 1px solid rgba(29, 25, 19, 0.28);
  padding-bottom: 1px; margin-bottom: 1px;
}
.slammer-top {
  border-bottom: 1px solid rgba(29, 25, 19, 0.28);
  padding-bottom: 1px; margin-bottom: 1px;
}
.plate-no {
  display: block;
  font-family: "Space Mono", monospace;
  font-size: 5.5px;
  letter-spacing: 0.12em;
  line-height: 1;
  color: var(--ink-45);
  text-transform: uppercase;
  white-space: nowrap;
}
.slammer-label .plate-no {
  position: absolute; right: 4px; bottom: 2px; margin: 0;
}
.block-plate {
  font-family: "Space Mono", monospace;
  font-size: 6.5px;
  letter-spacing: 0.06em;
  color: var(--ink-45);
  text-transform: uppercase;
  white-space: nowrap;
}
.sheet-id {
  font-family: "Space Mono", monospace;
  font-size: 6.5px;
  letter-spacing: 0.12em;
  color: var(--ink-45);
  text-transform: uppercase;
  margin-bottom: 2px;
}

/* ---------- slammers ---------- */
.slammer-card {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
  display: flex; flex-direction: column;
  scroll-snap-align: start;
  min-width: 0;
  position: relative;
}
.slammer-face {
  position: relative;
  width: var(--slammer-disc);
  height: var(--slammer-disc);
  align-self: center;
  filter: drop-shadow(2px 3px 0 rgba(45, 32, 18, 0.22));
  transition: transform 0.18s ease, filter 0.18s ease;
}
.slammer-face img {
  width: 100%; height: 100%; object-fit: contain;
  border-radius: 50%;
}
.slammer-face::after {
  content: ""; position: absolute; left: 16%; right: 16%; bottom: -4px; height: 6px;
  border-radius: 50%; background: rgba(45, 32, 18, 0.2); filter: blur(1.5px); z-index: -1;
}
.slammer-label {
  width: 100%;
  margin-top: 6px;
  background: var(--label-bg);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--hair);
  box-shadow: var(--hard-shadow);
  padding: 3px 5px 4px;
  display: flex; flex-direction: column; gap: 1px;
  min-height: 49px;
}
.slammer-top { display: flex; align-items: baseline; gap: 4px; }
.slammer-top b {
  font-family: Graduate, Archivo, sans-serif;
  font-weight: 400;
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.slammer-tag {
  margin-left: auto;
  font-family: "Space Mono", monospace;
  font-size: 7px;
  letter-spacing: 0.06em;
  color: var(--cream-hi);
  background: var(--red);
  padding: 1px 3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.slammer-tag.rival { background: var(--ink); }
.slammer-tag.armed { background: var(--red); animation: tagPulse 0.9s steps(2, end) infinite; }
@keyframes tagPulse { 50% { transform: translateY(-1px); } }
.spec {
  display: block;
  font-size: clamp(7.5px, 0.6vw, 9px);
  line-height: 1.25;
  color: var(--ink);
}
.spec i {
  font-family: "Space Mono", monospace;
  font-style: normal;
  font-size: 6.5px;
  letter-spacing: 0.03em;
  color: var(--ink-70);
  margin-right: 3px;
  text-transform: uppercase;
}
.spec .red { color: var(--red); font-weight: 700; }
.slammer-cd {
  display: flex; gap: 2px; align-items: center;
  margin-top: 1px;
  font-family: "Space Mono", monospace;
  font-size: 6.5px;
  color: var(--ink-70);
}
.slammer-cd b {
  width: 5px; height: 5px; border-radius: 50%;
  border: 1px solid var(--ink-45);
  background: transparent;
}
.slammer-cd b.full { background: var(--ink); border-color: var(--ink); }
.slammer-card.is-yours .slammer-face {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 50%;
  transform: translateY(-3px);
  filter: drop-shadow(3px 6px 0 rgba(45, 32, 18, 0.26));
}
.slammer-card.is-rival .slammer-face {
  outline: 2px dashed var(--ink-70);
  outline-offset: 3px;
  border-radius: 50%;
}
.slammer-card.is-armed .slammer-face {
  outline: 3px double var(--red);
  outline-offset: 3px;
  animation: armShiver 1.4s ease-in-out infinite;
}
@keyframes armShiver { 0%,100% { transform: translateY(-3px) rotate(0); } 30% { transform: translateY(-4px) rotate(-1.5deg); } 65% { transform: translateY(-3px) rotate(1.5deg); } }
.slammer-card.can-arm .slammer-label { border-top-color: var(--red); }
.slammer-card.is-dim { opacity: 0.72; }
.slammer-card:hover .slammer-face, .slammer-card:focus-visible .slammer-face {
  transform: translateY(-4px);
  filter: drop-shadow(3px 7px 0 rgba(45, 32, 18, 0.27));
}
.slammer-card:focus-visible { outline: none; }
.slammer-card:focus-visible .slammer-label { outline: 2px solid var(--red); outline-offset: 1px; }

/* ---------- deck ---------- */
.deck-block { grid-area: deck; min-width: 0; }
.deck-art {
  position: relative;
  display: block;
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  filter: drop-shadow(4px 6px 0 rgba(45, 32, 18, 0.22));
  transition: transform 0.16s ease, filter 0.16s ease;
}
.deck-art img { width: 100%; height: auto; }
.deck-art:hover, .deck-art:focus-visible { transform: translateY(-3px); filter: drop-shadow(5px 9px 0 rgba(45, 32, 18, 0.24)); outline: none; }
.deck-art:focus-visible img { outline: 2px solid var(--red); outline-offset: 2px; }
.deck-tag {
  position: absolute;
  right: 5%; top: 40%;
  min-width: 72px;
  padding: 5px 7px 4px;
  background: var(--cream-hi);
  border: 1px solid var(--ink);
  box-shadow: 2px 2px 0 rgba(45, 32, 18, 0.28);
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  transform: rotate(-2deg);
}
.deck-tag b {
  font-family: "Space Mono", monospace;
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.deck-tag span {
  font-family: "Space Mono", monospace;
  font-size: 7px;
  letter-spacing: 0.12em;
  color: var(--ink-70);
}
.deck-stamp {
  position: absolute;
  left: 7%; bottom: 13%;
  font-family: Graduate, Archivo, sans-serif;
  font-size: clamp(12px, 1.4vw, 18px);
  letter-spacing: 0.12em;
  color: var(--red);
  opacity: 0;
  transform: rotate(-9deg) scale(1.6);
  text-transform: uppercase;
  pointer-events: none;
}
.deck-stamp.show { animation: stampFlash 1.1s ease-out both; }
@keyframes stampFlash {
  0% { opacity: 0; transform: rotate(-9deg) scale(1.7); }
  12% { opacity: 0.9; transform: rotate(-9deg) scale(0.94); }
  24% { transform: rotate(-9deg) scale(1.02) translate(1px, 0); }
  36% { transform: rotate(-9deg) scale(1); }
  75% { opacity: 0.8; }
  100% { opacity: 0; transform: rotate(-9deg) scale(1); }
}
.deck-note {
  margin-top: 7px;
  padding: 5px 6px;
  background: rgba(233, 218, 184, 0.55);
  border-top: 1px solid var(--hair);
  font-size: var(--fs-micro);
  line-height: 1.4;
  color: var(--ink);
}
.deck-note b { letter-spacing: 0.08em; }

/* ---------- play field ---------- */
.play-block { grid-area: play; min-width: 0; display: flex; flex-direction: column; }
.play-head {
  display: flex; align-items: center; gap: 7px;
  padding: 3px 6px;
  background: var(--label-bg);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--hair);
  box-shadow: var(--hard-shadow);
  margin-bottom: 7px;
  min-height: 30px;
}
.play-title {
  font-family: Archivo, sans-serif;
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 700;
}
.play-title.rival { color: var(--red); }
.play-title.over { color: var(--ink-70); }
.tally-strip {
  flex: 1;
  min-width: 0;
  display: flex; align-items: center;
  border-left: 1px solid var(--hair);
  padding-left: 7px;
  overflow: hidden;
}
.tally-strip .mono {
  font-size: var(--fs-micro);
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tally-strip .flag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 3px;
  background: var(--red);
  color: var(--cream-hi);
  font-family: "Space Mono", monospace;
  font-size: 7px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mat {
  position: relative;
  border: 1px solid rgba(29, 25, 19, 0.42);
  box-shadow: inset 0 0 0 1px rgba(233, 218, 184, 0.16);
  padding: 22px clamp(6px, 1vw, 14px) 12px;
  min-height: 142px;
  display: flex; flex-direction: column; align-items: stretch; justify-content: center;
  gap: 7px;
  background: rgba(183, 137, 82, 0.06);
  overflow: hidden;
}
.mat::before, .mat::after {
  content: ""; position: absolute; width: 10px; height: 10px; pointer-events: none; opacity: 0.45;
}
.mat::before { left: -1px; top: -1px; border-left: 1px solid var(--ink); border-top: 1px solid var(--ink); }
.mat::after { right: -1px; bottom: -1px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.mat.shake { animation: matHit 0.3s ease-out; }
@keyframes matHit {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-2px, 1px); }
  40% { transform: translate(2px, -1px); }
  60% { transform: translate(-1px, 0); }
  80% { transform: translate(1px, 0); }
}
.mat-label {
  position: absolute;
  left: 6px; top: 4px;
  font-family: "Space Mono", monospace;
  font-size: 7px;
  letter-spacing: 0.12em;
  color: var(--ink-70);
  text-transform: uppercase;
  background: var(--cream);
  padding: 1px 4px;
  border: 1px solid var(--hair);
  box-shadow: 1px 1px 0 rgba(45, 32, 18, 0.2);
}
.pot {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: center;
  gap: clamp(6px, 1.1vw, 12px);
  width: 100%;
  perspective: 700px;
}
.pot.draft { gap: clamp(5px, 0.9vw, 10px); }
.pot-empty {
  font-family: "Space Mono", monospace;
  font-size: 7.5px;
  letter-spacing: 0.05em;
  color: var(--ink);
  text-align: center;
  padding: 6px 9px;
  max-width: 182px;
  background: var(--cream);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--hair);
  box-shadow: var(--hard-shadow);
  max-width: 100%;
}
.mat-stamp {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotate(-7deg);
  font-family: Graduate, Archivo, sans-serif;
  font-size: clamp(22px, 3.4vw, 46px);
  letter-spacing: 0.06em;
  color: var(--red);
  opacity: 0;
  pointer-events: none;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 2px 2px 0 rgba(233, 218, 184, 0.45);
  z-index: 8;
}
.mat-stamp.show { animation: matStamp 1.2s ease-out both; }
@keyframes matStamp {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-7deg) scale(1.6); }
  10% { opacity: 0.95; transform: translate(-50%, -50%) rotate(-7deg) scale(0.95); }
  18% { transform: translate(-50%, -50%) rotate(-7deg) scale(1.02); }
  28% { transform: translate(-50%, -50%) rotate(-7deg) scale(1); }
  72% { opacity: 0.88; }
  100% { opacity: 0; }
}
.slammer-fly {
  position: absolute;
  left: 50%; top: 50%;
  width: clamp(120px, 19vw, 230px);
  height: clamp(120px, 19vw, 230px);
  margin-left: calc(clamp(120px, 19vw, 230px) / -2);
  margin-top: calc(clamp(120px, 19vw, 230px) / -2);
  pointer-events: none;
  opacity: 0;
  z-index: 6;
  filter: drop-shadow(5px 10px 2px rgba(45, 32, 18, 0.25));
}
.slammer-fly img { width: 100%; height: 100%; object-fit: contain; }
.slammer-fly.drop { animation: slamDrop 0.52s cubic-bezier(0.2, 0.85, 0.25, 1) both; }
@keyframes slamDrop {
  0% { opacity: 0; transform: translateY(-120%) scale(1.35) rotate(-8deg); }
  10% { opacity: 0.95; }
  62% { opacity: 1; transform: translateY(-6%) scale(0.92) rotate(1deg); }
  76% { transform: translateY(0) scale(0.84) rotate(0); }
  100% { opacity: 0; transform: translateY(0) scale(0.84) rotate(0); }
}
.stamp-layer { position: absolute; inset: 0; pointer-events: none; z-index: 7; overflow: visible; }
.ability-stamp {
  position: absolute;
  transform: translate(-50%, -50%);
  width: clamp(54px, 6.8vw, 82px);
  height: clamp(54px, 6.8vw, 82px);
  opacity: 0;
}
.ability-stamp .blot {
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(1px 2px 0 rgba(45, 32, 18, 0.25));
}
.ability-stamp .tag {
  position: absolute;
  left: 50%; top: 100%;
  transform: translateX(-50%) rotate(-1deg);
  background: var(--cream-hi);
  border: 1px solid var(--ink);
  box-shadow: 1px 1px 0 rgba(45, 32, 18, 0.3);
  padding: 1px 4px;
  font-family: "Space Mono", monospace;
  font-size: clamp(6.5px, 0.62vw, 9px);
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--ink);
}
.ability-stamp.fire { animation: stampFire 0.95s ease-out both; }
@keyframes stampFire {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.9) rotate(-8deg); }
  10% { opacity: 1; transform: translate(-50%, -50%) scale(0.94) rotate(-8deg); }
  16% { transform: translate(calc(-50% + 2px), -50%) scale(1.03) rotate(-8deg); }
  24% { transform: translate(-50%, -50%) scale(1) rotate(-8deg); }
  74% { opacity: 0.92; }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(1) rotate(-8deg); }
}
.ability-stamp .dots {
  position: absolute; inset: 12%;
  border-radius: 50%;
  background-image: radial-gradient(circle, var(--ink) 1px, transparent 1.4px);
  background-size: 6px 6px;
  opacity: 0;
  -webkit-mask-image: radial-gradient(circle, transparent 38%, #000 55%, transparent 76%);
  mask-image: radial-gradient(circle, transparent 38%, #000 55%, transparent 76%);
}
.ability-stamp.fire .dots { animation: dotBurst 0.9s ease-out both; }
@keyframes dotBurst {
  0% { opacity: 0.75; transform: scale(0.5); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* pog disc component */
.pot-disc {
  appearance: none; border: 0; background: transparent; padding: 0;
  position: relative;
  width: var(--pot-disc);
  height: var(--pot-disc);
  flex: none;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.3, 1), filter 0.24s ease;
  filter: drop-shadow(2px 4px 0 rgba(45, 32, 18, 0.2));
}
.pot-disc .disc-inner {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.42s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.pot-disc .disc-front, .pot-disc .disc-back {
  position: absolute; inset: 0;
  border-radius: 50%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  overflow: hidden;
}
.pot-disc .disc-front { background: transparent; }
.pot-disc .disc-front img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.pot-disc .disc-back {
  transform: rotateY(180deg);
  background: var(--cream);
  border: 2px solid rgba(29, 25, 19, 0.55);
  box-shadow: inset 0 0 0 5px var(--cream-hi), inset 0 0 0 6px rgba(29, 25, 19, 0.25);
  display: flex; align-items: center; justify-content: center;
}
.pot-disc .disc-back::before {
  content: "POG"; font-family: Graduate, Archivo, sans-serif;
  font-size: calc(var(--pot-disc) * 0.15);
  letter-spacing: 0.12em;
  color: rgba(29, 25, 19, 0.45);
}
.pot-disc .weight-badge {
  min-width: calc(var(--pot-disc) * 0.3);
  height: calc(var(--pot-disc) * 0.3);
  font-size: calc(var(--pot-disc) * 0.2);
  bottom: -6%;
}
.pot-disc .rarity-mark { width: 25%; height: 25%; }
.pot-disc .rarity-mark.burst { width: 36%; height: 36%; }
.pot-disc:hover, .pot-disc:focus-visible {
  transform: translateY(-6px) rotate(-1deg);
  filter: drop-shadow(3px 8px 0 rgba(45, 32, 18, 0.24));
  outline: none;
}
.pot-disc.selected { z-index: 4; }
.pot-disc.selected .disc-front::after {
  content: ""; position: absolute; inset: 3%;
  border: 2px solid var(--red);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--cream-hi);
  pointer-events: none;
}
.pot-disc.selected .weight-badge { color: var(--red); }
.pot-disc.flipping .disc-inner { transform: rotateY(180deg) translateY(-18px); }
.pot-disc.unflip-wobble { animation: wobble 0.46s ease-out; }
@keyframes wobble {
  0%, 100% { transform: rotate(0) translateY(0); }
  25% { transform: rotate(-2.4deg) translateY(-2px); }
  55% { transform: rotate(2.2deg) translateY(0); }
  80% { transform: rotate(-1deg) translateY(0); }
}
.pot-disc.heavy.unflip-wobble { animation: wobbleHeavy 0.5s ease-out; }
@keyframes wobbleHeavy {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(-0.8deg) translateY(-1px); }
  65% { transform: rotate(0.7deg); }
}
.pot-disc.to-tray {
  transform: translate(var(--dx), var(--dy)) scale(0.34) rotate(300deg);
  opacity: 0.15;
  transition: transform 0.62s cubic-bezier(0.35, 0, 0.75, 0.45), opacity 0.62s;
  z-index: 5;
}
.pot-disc.leaving { pointer-events: none; }

/* shop card */
.pog-card {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
  display: flex; flex-direction: column;
  align-items: center;
  min-width: 0;
  position: relative;
  scroll-snap-align: start;
}
.pog-card .face-holder { width: var(--shop-disc); height: var(--shop-disc); }
.pog-card .weight-badge {
  min-width: calc(var(--shop-disc) * 0.3);
  height: calc(var(--shop-disc) * 0.3);
  font-size: calc(var(--shop-disc) * 0.2);
}
.pog-card .rarity-mark { width: 25%; height: 25%; }
.pog-card .rarity-mark.burst { width: 38%; height: 38%; }
.pog-card .label-strip {
  width: 100%;
  min-height: 62px;
  padding: 3px 4px;
  margin-top: 6px;
}
.pog-card .ability { font-size: clamp(8px, 0.62vw, 9px); line-height: 1.22; }
.pog-card .class-name { font-size: clamp(8px, 0.62vw, 9px); letter-spacing: 0.03em; }
.pog-card:hover .face-holder, .pog-card:focus-visible .face-holder {
  transform: translateY(-6px);
  filter: drop-shadow(3px 8px 0 rgba(45, 32, 18, 0.24));
}
.pog-card:hover .weight-badge, .pog-card:focus-visible .weight-badge { color: var(--red); }
.pog-card:focus-visible { outline: none; }
.pog-card:focus-visible .label-strip { outline: 2px solid var(--red); outline-offset: 1px; }
.pog-card.picked { animation: pick 0.35s ease-out; }
@keyframes pick {
  0% { transform: scale(1); }
  40% { transform: scale(0.92) rotate(-2deg); }
  100% { transform: scale(1); }
}
.pog-card.disabled { pointer-events: none; opacity: 0.55; }
.shop-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(4px, 0.7vw, 8px);
  width: 100%;
}
.shop-grid.disabled { opacity: 0.5; }
.draft-summary {
  width: 100%;
  display: flex; flex-direction: column; gap: 6px;
  align-items: center; justify-content: center;
  padding: 10px;
}
.draft-summary .stamp {
  font-family: Graduate, Archivo, sans-serif;
  font-size: clamp(20px, 2.6vw, 34px);
  letter-spacing: 0.08em;
  color: var(--red);
  transform: rotate(-4deg);
  text-transform: uppercase;
}

/* inspect strip */
.inspect-strip {
  margin-top: 7px;
  background: var(--label-bg);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--hair);
  box-shadow: var(--hard-shadow);
  padding: 4px 7px 5px;
  min-height: 44px;
  display: flex; flex-direction: column; gap: 1px;
}
.inspect-meta { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.inspect-name {
  font-family: Graduate, Archivo, sans-serif;
  font-size: clamp(11px, 1.05vw, 15px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.inspect-meta .mono { font-size: var(--fs-micro); color: var(--ink-70); }
.inspect-ability { font-size: var(--fs-micro); line-height: 1.3; }
.inspect-strip .flip-line {
  font-family: "Space Mono", monospace;
  font-size: 7.5px;
  letter-spacing: 0.04em;
  color: var(--red);
  text-transform: uppercase;
}
.play-foot {
  margin-top: 7px;
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  min-height: 24px;
}
.start-tab {
  appearance: none;
  border: 2px solid var(--ink);
  background: var(--red);
  color: var(--cream-hi);
  font-family: Graduate, Archivo, sans-serif;
  font-size: clamp(13px, 1.35vw, 18px);
  letter-spacing: 0.06em;
  padding: 6px 14px;
  box-shadow: 3px 4px 0 rgba(45, 32, 18, 0.3);
  cursor: pointer;
  text-transform: uppercase;
}
.start-tab span {
  display: inline-block;
  margin-left: 6px;
  font-family: "Space Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.06em;
  opacity: 0.8;
  vertical-align: middle;
}
.start-tab:hover, .start-tab:focus-visible { transform: translate(-1px, -1px); box-shadow: 4px 5px 0 rgba(45, 32, 18, 0.3); outline: none; }
.start-tab.ghost { background: var(--cream); color: var(--ink); }
.play-hint {
  font-family: "Space Mono", monospace;
  font-size: 7.5px;
  letter-spacing: 0.02em;
  color: var(--ink-70);
  text-transform: uppercase;
  flex: 1 1 120px;
}

/* ---------- tray ---------- */
.tray-block { grid-area: tray; min-width: 0; }
.tray-art {
  position: relative;
  display: block;
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  filter: drop-shadow(4px 6px 0 rgba(45, 32, 18, 0.2));
  transition: transform 0.16s ease;
}
.tray-art > img { width: 100%; height: auto; }
.tray-art:hover, .tray-art:focus-visible { transform: translateY(-2px); outline: none; }
.tray-art:focus-visible > img { outline: 2px solid var(--red); outline-offset: 2px; }
.tray-floor {
  position: absolute;
  left: 7.5%; right: 7.5%; top: 9%; height: 65%;
  display: flex; flex-wrap: wrap-reverse;
  align-content: flex-end; justify-content: center;
  gap: 1px;
  pointer-events: none;
  overflow: hidden;
  padding: 2px;
}
.scale-tab {
  position: absolute;
  display: flex; flex-direction: column; align-items: center;
  min-width: 26px;
  padding: 1px 3px;
  background: var(--cream-hi);
  border: 1px solid var(--ink);
  box-shadow: 1px 1px 0 rgba(45, 32, 18, 0.3);
  font-family: "Space Mono", monospace;
  line-height: 0.95;
  transform: translateX(-50%);
  transition: left 0.5s cubic-bezier(0.2, 0.8, 0.3, 1);
  z-index: 3;
  pointer-events: none;
}
.scale-tab b { font-size: clamp(9px, 1.05vw, 14px); font-weight: 700; }
.scale-tab small { font-size: 5.5px; letter-spacing: 0.08em; color: var(--ink-70); }
.scale-tab.you { bottom: 12.5%; border-top: 3px solid var(--teal); color: var(--ink); }
.scale-tab.rival { bottom: 4.5%; border-top: 3px solid var(--red); }
.scale-mult {
  position: absolute;
  left: 3%; bottom: 9%;
  font-family: "Space Mono", monospace;
  font-size: 7px;
  color: var(--ink-70);
  background: rgba(233, 218, 184, 0.7);
  padding: 0 2px;
  pointer-events: none;
}

/* ---------- plates ---------- */
.plate-bar {
  grid-area: plates;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 1vw, 12px);
  align-items: stretch;
  position: sticky;
  bottom: 0;
  z-index: 30;
  padding: 8px;
  margin: 0 calc(-1 * var(--pad));
  background: rgba(184, 140, 88, 0.97);
  border-top: 1px solid rgba(29, 25, 19, 0.45);
  box-shadow: 0 -4px 0 rgba(45, 32, 18, 0.15);
}
.plate {
  appearance: none;
  position: relative;
  border: 0;
  padding: 0;
  aspect-ratio: 2.2 / 1;
  max-height: 124px;
  min-height: 52px;
  cursor: pointer;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  filter: drop-shadow(3px 5px 0 rgba(45, 32, 18, 0.24));
  transition: transform 0.12s ease, filter 0.12s ease;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--ink);
  overflow: hidden;
}
.plate-slam { background-image: url("assets/img/action_plates_01_slam_plate.webp"); }
.plate-draw { background-image: url("assets/img/action_plates_02_draw_plate.webp"); }
.plate-pass { background-image: url("assets/img/action_plates_03_pass_plate.webp"); }
.plate-discard { background-image: url("assets/img/action_plates_04_discard_plate.webp"); }
.plate-word {
  font-family: Graduate, Archivo, sans-serif;
  font-weight: 400;
  font-size: clamp(16px, 1.9vw, 27px);
  letter-spacing: 0.03em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0.5px 0.5px 0 rgba(233, 218, 184, 0.5);
}
.plate-discard .plate-word { text-transform: lowercase; font-size: clamp(15px, 1.8vw, 25px); }
.plate-sub {
  font-family: "Space Mono", monospace;
  font-size: clamp(5.5px, 0.55vw, 7.5px);
  letter-spacing: 0.12em;
  margin-top: 1px;
  color: var(--ink-70);
}
.plate-key {
  position: absolute;
  right: 8%; bottom: 4%;
  font-family: "Space Mono", monospace;
  font-size: clamp(5.5px, 0.52vw, 7px);
  letter-spacing: 0.06em;
  color: var(--ink-45);
}
.plate:hover, .plate:focus-visible {
  transform: translate(-1px, -2px);
  filter: drop-shadow(4px 7px 0 rgba(45, 32, 18, 0.26));
  outline: none;
}
.plate:active { transform: translate(1px, 2px); filter: drop-shadow(1px 2px 0 rgba(45, 32, 18, 0.22)); }
.plate:disabled { opacity: 0.42; cursor: default; filter: drop-shadow(2px 3px 0 rgba(45, 32, 18, 0.16)); }
.plate:disabled:hover, .plate:disabled:active { transform: none; filter: drop-shadow(2px 3px 0 rgba(45, 32, 18, 0.16)); }
.plate.turn-ready .plate-word { color: var(--ink); }
.plate.armed::after {
  content: "ARMED"; position: absolute; left: 7%; top: 6%;
  font-family: "Space Mono", monospace; font-size: 6px; letter-spacing: 0.06em;
  background: var(--red); color: var(--cream-hi); padding: 1px 3px;
}
.plate.pulse { animation: platePulse 2.2s ease-in-out infinite; }
@keyframes platePulse { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

/* ---------- dialogs ---------- */
.sheet-dialog {
  width: min(920px, calc(100vw - 24px));
  max-height: min(86vh, 780px);
  border: 2px solid var(--ink);
  background: var(--cream);
  color: var(--ink);
  padding: 0;
  box-shadow: 8px 10px 0 rgba(29, 25, 19, 0.4);
  overflow: hidden;
  font-family: Archivo, sans-serif;
}
.sheet-dialog::backdrop {
  background: rgba(29, 25, 19, 0.52);
  background-image: radial-gradient(circle, rgba(233, 218, 184, 0.09) 0.8px, transparent 1px);
  background-size: 5px 5px;
}
.dialog-head {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: var(--cream-hi);
  border-bottom: 2px solid var(--ink);
  position: sticky; top: 0; z-index: 3;
}
.dialog-head h2 {
  font-family: Graduate, Archivo, sans-serif;
  font-weight: 400;
  font-size: clamp(17px, 2vw, 24px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dialog-head .mono { font-size: 9px; color: var(--ink-70); }
.dialog-close {
  appearance: none; margin-left: auto;
  border: 1px solid var(--ink); background: var(--cream);
  font-family: "Space Mono", monospace; font-size: 10px;
  padding: 4px 8px; cursor: pointer;
  box-shadow: 2px 2px 0 rgba(45, 32, 18, 0.25);
}
.dialog-close:hover, .dialog-close:focus-visible { background: var(--red); color: var(--cream-hi); outline: none; }
.dialog-body { padding: 12px; overflow: auto; max-height: calc(86vh - 56px); }
.dialog-note {
  font-size: 10px; color: var(--ink-70);
  border-top: 1px solid var(--hair);
  padding-top: 6px; margin-top: 10px;
}
.discard-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pile-head {
  display: flex; align-items: baseline; gap: 8px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 4px; margin-bottom: 6px;
}
.pile-head h3 {
  font-family: Archivo, sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.pile-head .mono { margin-left: auto; font-size: 11px; }
.pile-head .swatch { width: 9px; height: 9px; border: 1px solid var(--ink); }
.pile-empty {
  font-family: "Space Mono", monospace; font-size: 9px;
  letter-spacing: 0.06em; color: var(--ink-70); padding: 10px 0;
}
.pile-row {
  display: flex; align-items: flex-start; gap: 7px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(29, 25, 19, 0.18);
}
.pile-face {
  width: clamp(30px, 4vw, 40px); height: clamp(30px, 4vw, 40px);
  flex: none; border-radius: 50%;
  filter: drop-shadow(1px 1.5px 0 rgba(45, 32, 18, 0.22));
}
.pile-face img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.pile-info { min-width: 0; display: flex; flex-direction: column; gap: 0; }
.pile-name {
  font-family: Archivo, sans-serif; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
}
.pile-name .mono { font-size: 8px; color: var(--ink-70); font-weight: 400; letter-spacing: 0.02em; }
.pile-ability { font-size: 9.5px; line-height: 1.32; color: var(--ink); }
.pile-rarity { font-family: "Space Mono", monospace; font-size: 7.5px; color: var(--ink-70); text-transform: uppercase; letter-spacing: 0.04em; }

.end-dialog { width: min(700px, calc(100vw - 24px)); }
.end-body { text-align: center; max-height: none; }
.end-kicker {
  font-family: "Space Mono", monospace; font-size: 9px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-70);
}
.end-result {
  font-family: Graduate, Archivo, sans-serif;
  font-size: clamp(34px, 7vw, 64px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--red);
  text-shadow: 2px 2px 0 var(--teal);
  margin: 6px 0 2px;
}
.end-result.win { color: var(--teal); text-shadow: 2px 2px 0 var(--red); }
.end-result.tie { color: var(--ink); text-shadow: 2px 2px 0 var(--ochre); }
.end-line { font-family: "Space Mono", monospace; font-size: 11px; letter-spacing: 0.03em; }
.end-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0 6px; text-align: left; }
.end-col { border-top: 2px solid var(--ink); padding-top: 6px; }
.end-col h3 { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; }
.end-col .count { font-family: "Space Mono", monospace; font-size: 28px; font-weight: 700; line-height: 1; margin: 2px 0 5px; }
.end-col ul { font-family: "Space Mono", monospace; font-size: 8.5px; color: var(--ink-70); display: flex; flex-wrap: wrap; gap: 2px 9px; }
.end-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.end-actions .start-tab { font-size: clamp(13px, 1.5vw, 18px); }
.end-record { font-family: "Space Mono", monospace; font-size: 8px; color: var(--ink-70); margin-top: 10px; text-transform: uppercase; letter-spacing: 0.05em; }

/* rules */
.rules-body { font-size: 12px; line-height: 1.5; }
.rules-body h3 {
  font-family: Archivo, sans-serif; font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; margin: 14px 0 5px;
  border-top: 1px solid var(--ink); padding-top: 6px;
}
.rules-body ol { margin: 0; padding-left: 18px; }
.rules-body li { margin-bottom: 6px; }
.rules-body .kv { display: grid; grid-template-columns: 74px 1fr; gap: 2px 8px; font-size: 10.5px; }
.rules-body .kv b { font-family: "Space Mono", monospace; font-size: 9px; letter-spacing: 0.04em; text-transform: uppercase; }
.rules-body .kv span { color: var(--ink); }
.rules-body .keys {
  font-family: "Space Mono", monospace; font-size: 9px; letter-spacing: 0.04em;
  background: var(--cream-hi); border: 1px solid var(--ink); padding: 5px 7px; margin-top: 8px;
}
.rules-body .tiny { font-size: 9px; color: var(--ink-70); }

/* dealt / tray details */
.pot-disc.dealt { animation: dealIn 0.4s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
@keyframes dealIn {
  0% { opacity: 0; transform: translateY(-18px) scale(0.8) rotate(-4deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}
.disc-front { overflow: visible; }
.disc-back { overflow: hidden; }
.tray-floor { display: flex; gap: 3%; align-items: stretch; }
.tray-side {
  width: 50%; height: 100%; min-width: 0;
  display: flex; flex-direction: column;
  justify-content: flex-end; align-items: center;
  position: relative;
}
.tray-side + .tray-side { border-left: 1px solid rgba(29, 25, 19, 0.2); }
.tray-side-label {
  font-family: "Space Mono", monospace;
  font-size: clamp(4.5px, 0.5vw, 6.5px);
  letter-spacing: 0.08em;
  color: var(--ink-45);
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 2px;
}
.tray-minis {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-end;
  justify-content: center;
  gap: 1px;
  overflow: hidden;
}
.tray-mini {
  position: relative;
  width: clamp(13px, 2.1vw, 22px);
  height: clamp(13px, 2.1vw, 22px);
  border-radius: 50%;
  flex: none;
  transform: rotate(var(--rot, 0deg));
  filter: drop-shadow(0.5px 1px 0 rgba(45, 32, 18, 0.3));
}
.tray-mini img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.tray-mini.fresh { animation: miniLand 0.4s ease-out both; }
@keyframes miniLand {
  0% { transform: scale(0.4) rotate(-20deg); opacity: 0; }
  70% { transform: scale(1.08) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(var(--rot, 0deg)); }
}
.deck-art:disabled { cursor: default; }
.deck-art:disabled:hover { transform: none; filter: drop-shadow(4px 6px 0 rgba(45, 32, 18, 0.22)); }
.paper-tab:disabled { opacity: 0.45; cursor: default; }
.paper-tab:disabled:hover { transform: none; box-shadow: 2px 2px 0 rgba(45, 32, 18, 0.28); }
.slammer-cd { display: flex; align-items: center; gap: 3px; }
.slammer-cd span { font-size: 6.5px; letter-spacing: 0.04em; }
.slammer-cd b { width: 5px; height: 5px; border-radius: 50%; border: 1px solid var(--ink-45); background: transparent; }
.slammer-cd b.full { background: var(--ink); border-color: var(--ink); }

/* ---------- arena: hands around the pot ---------- */
.rival-hand-row {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: 9px; min-height: 27px;
  border-bottom: 1px solid rgba(29, 25, 19, 0.13);
  padding-bottom: 4px;
}
.rival-hand { display: flex; gap: 3px; align-items: center; }
.rival-hand-disc {
  width: clamp(23px, 2.5vw, 29px); height: clamp(23px, 2.5vw, 29px);
  border-radius: 50%;
  background: var(--cream);
  border: 1px solid rgba(29, 25, 19, 0.55);
  box-shadow: inset 0 0 0 3px var(--cream-hi), inset 0 0 0 4px rgba(29, 25, 19, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-family: Graduate, Archivo, sans-serif;
  font-size: clamp(4.5px, 0.5vw, 6px);
  letter-spacing: 0.06em;
  color: rgba(29, 25, 19, 0.42);
  transform: rotate(-5deg);
}
.rival-hand-disc:nth-child(2n) { transform: rotate(4deg); }
.arena-label {
  font-family: "Space Mono", monospace;
  font-size: clamp(6.5px, 0.6vw, 8px);
  letter-spacing: 0.09em;
  color: var(--ink);
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--cream);
  border: 1px solid var(--hair);
  box-shadow: 1px 1px 0 rgba(45, 32, 18, 0.2);
  padding: 1px 4px;
}
.pot-wrap {
  width: 100%; display: flex; flex-direction: column;
  align-items: center; gap: 3px; min-width: 0;
  position: relative;
}
.pot { position: relative; z-index: 1; }
.pot-label { position: relative; z-index: 2; }
.pot-ring {
  position: absolute; left: 50%; top: calc(50% + 4px);
  width: clamp(196px, 26vw, 276px); height: clamp(196px, 26vw, 276px);
  transform: translate(-50%, -50%);
  border: 1px solid rgba(29, 25, 19, 0.38);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.pot-ring::before {
  content: ""; position: absolute; inset: 9px;
  border: 1px dashed rgba(29, 25, 19, 0.28);
  border-radius: 50%;
}
.pot-ring::after {
  content: ""; position: absolute; inset: -1px;
  border-radius: 50%;
  background-image: radial-gradient(circle, rgba(29, 25, 19, 0.28) 0.8px, transparent 1.2px);
  background-size: 5px 5px;
  -webkit-mask-image: radial-gradient(circle, transparent 58%, #000 66%, transparent 78%);
  mask-image: radial-gradient(circle, transparent 58%, #000 66%, transparent 78%);
}
.pot-wrap.drafting .pot-ring { display: none; }
.pot-label {
  font-family: "Space Mono", monospace;
  font-size: clamp(7px, 0.66vw, 9px);
  letter-spacing: 0.11em;
  color: var(--ink);
  text-transform: uppercase;
  background: var(--cream);
  border: 1px solid var(--hair);
  box-shadow: 1px 1px 0 rgba(45, 32, 18, 0.2);
  padding: 1px 6px;
}
.hand-row {
  width: 100%;
  border-top: 1px solid rgba(29, 25, 19, 0.16);
  padding-top: 5px;
  display: flex; flex-direction: column; gap: 7px;
}
.hand-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hand-head .mono {
  font-size: 7px; color: var(--ink); text-transform: uppercase; white-space: nowrap;
  background: var(--cream); border: 1px solid var(--hair); padding: 1px 4px;
  box-shadow: 1px 1px 0 rgba(45, 32, 18, 0.2);
}
.hand {
  display: flex; gap: clamp(4px, 0.8vw, 9px);
  justify-content: center; align-items: flex-end; flex-wrap: wrap;
  min-height: 64px;
  padding-top: 9px;
}
.hand-card {
  appearance: none; border: 0; background: transparent; padding: 0;
  cursor: pointer; display: flex; flex-direction: column; align-items: center;
  position: relative; width: clamp(58px, 7vw, 82px);
  flex: 0 0 auto;
}
.hand-card .face-holder { width: var(--hand-disc); height: var(--hand-disc); }
.hand-card .weight-badge {
  min-width: calc(var(--hand-disc) * 0.3);
  height: calc(var(--hand-disc) * 0.3);
  font-size: calc(var(--hand-disc) * 0.2);
}
.hand-card .rarity-mark { width: 25%; height: 25%; }
.hand-card .rarity-mark.burst { width: 38%; height: 38%; }
.hand-card .hand-label {
  width: 100%; margin-top: 5px;
  background: var(--label-bg);
  border-top: 1px solid var(--hair);
  box-shadow: 1px 2px 0 rgba(45, 32, 18, 0.16);
  padding: 2px 3px 3px;
  text-align: left;
  display: flex; flex-direction: column; gap: 0;
}
.hand-card .hand-label b {
  font-family: Archivo, sans-serif; font-size: 8px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hand-card .hand-label .mono { font-size: 6.5px; color: var(--ink-70); white-space: nowrap; }
.hand-card .pot-tag {
  display: none; position: absolute; top: -4px; right: -3px;
  background: var(--red); color: var(--cream-hi);
  font-family: "Space Mono", monospace; font-size: 6.5px; letter-spacing: 0.08em;
  padding: 1px 3px; border: 1px solid var(--cream-hi);
  transform: rotate(4deg); z-index: 4;
}
.hand-card.selected .pot-tag { display: block; }
.hand-card.selected .face-holder {
  outline: 2px solid var(--red); outline-offset: 3px;
  transform: translateY(-5px);
  filter: drop-shadow(3px 7px 0 rgba(45, 32, 18, 0.26));
}
.hand-card.selected .weight-badge { color: var(--red); }
.hand-card.selected .hand-label { border-top-color: var(--red); }
.hand-card:hover .face-holder, .hand-card:focus-visible .face-holder { transform: translateY(-4px); }
.hand-card:focus-visible { outline: none; }
.hand-card:focus-visible .hand-label { outline: 2px solid var(--red); outline-offset: 1px; }
.hand-card.readonly { opacity: 0.9; }
.hand-card.readonly .face-holder { filter: drop-shadow(2px 4px 0 rgba(45, 32, 18, 0.16)); }
.hand-card.fresh { animation: handIn 0.4s ease-out both; }
@keyframes handIn {
  0% { opacity: 0; transform: translateY(-9px) scale(0.9); }
  100% { opacity: 1; transform: none; }
}
.hand-empty {
  font-family: "Space Mono", monospace; font-size: 8px; letter-spacing: 0.04em;
  color: var(--ink-45); text-transform: uppercase; padding: 16px 6px;
}
.hand-empty.tiny { padding: 3px; font-size: 6.5px; }

/* ---------- charge slip ---------- */
.charge-slip {
  position: fixed; left: 50%; bottom: 150px;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 20px));
  z-index: 46;
  background: var(--cream-hi);
  border: 1px solid var(--ink);
  box-shadow: 4px 5px 0 rgba(45, 32, 18, 0.34);
  padding: 5px 8px 6px;
  font-family: "Space Mono", monospace;
  color: var(--ink);
}
.charge-slip[hidden] { display: none; }
.cg-top, .cg-bottom {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: clamp(6.5px, 0.62vw, 8.5px);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.cg-top { margin-bottom: 3px; }
.cg-bottom { margin-top: 3px; color: var(--ink-70); }
.cg-read { font-weight: 700; }
.cg-track {
  position: relative; height: 13px;
  background: #dccaa6;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--hair);
}
.cg-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: var(--teal); opacity: 0.32;
}
.cg-ticks {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(to right, transparent 0 9.5%, rgba(29, 25, 19, 0.28) 9.5% calc(9.5% + 1px));
  opacity: 0.6;
}
.cg-sweet {
  position: absolute; left: 43%; width: 14%; top: 0; bottom: 0;
  background: var(--red); opacity: 0.76;
}
.cg-sweet::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(233, 218, 184, 0.55) 0.7px, transparent 1px);
  background-size: 4px 4px;
}
.cg-needle {
  position: absolute; top: -5px; bottom: -5px; left: 0; width: 2px;
  background: var(--ink); transform: translateX(-1px);
  box-shadow: 0 0 0 1px rgba(233, 218, 184, 0.5);
}
.cg-needle::before {
  content: ""; position: absolute; left: -4px; top: -2px;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid var(--ink);
}

/* ---------- selection flight ---------- */
.flight-layer { position: fixed; inset: 0; pointer-events: none; z-index: 44; overflow: hidden; }
.fly-pog {
  position: fixed; border-radius: 50%;
  transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.3, 1), opacity 0.38s;
  filter: drop-shadow(2px 5px 0 rgba(45, 32, 18, 0.26));
  will-change: transform;
}
.fly-pog img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.plate-slam { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.plate.charging { transform: translate(1px, 2px); filter: drop-shadow(1px 2px 0 rgba(45, 32, 18, 0.2)); }
.plate.charging .plate-word { color: var(--red); }
/* live region */
.sr-live {
  position: fixed; left: 10px; bottom: 10px; z-index: 50;
  width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}

/* ---------- responsive ---------- */
@media (max-width: 1099px) {
  .sheet {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "title title"
      "classes classes"
      "slammers slammers"
      "play play"
      "deck tray"
      "plates plates";
    max-width: 760px;
  }
  .title-block { display: grid; grid-template-columns: 1.1fr 1fr; gap: 10px; align-items: start; }
  .title-notes { margin-top: 0; }
  .classes-rail, .slammer-rail { display: grid; overflow: visible; padding: 0; gap: 7px; }
  .classes-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .slammer-rail { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .classes-rail .class-card, .slammer-rail .slammer-card { min-width: 0; width: 100%; flex: none; }
  .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .slammer-fly { width: 170px; height: 170px; margin-left: -85px; margin-top: -85px; }
}
@media (max-width: 700px), (min-width: 701px) and (max-width: 1099px) and (max-height: 620px) {
  html, body { height: 100%; overflow: hidden; }
  :root {
    --fs-micro: 7px;
    --fs-label: 8px;
    --fs-body: 9px;
    --fs-name: 10px;
    --fs-title: 11px;
    --class-disc: clamp(24px, 4.8vh, 38px);
    --slammer-disc: clamp(25px, 5vh, 40px);
    --shop-disc: clamp(38px, 6.6vh, 54px);
    --pot-disc: clamp(40px, 7vh, 56px);
    --hand-disc: clamp(36px, 6.2vh, 50px);
    --pad: 7px;
    --gap: 4px;
  }
  .sheet {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    grid-template-areas:
      "title title"
      "classes classes"
      "slammers slammers"
      "play play"
      "deck tray"
      "plates plates";
    grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    padding: 6px 7px 0;
    gap: 4px;
    align-items: stretch;
  }
  .margin-rule { inset: 4px; }
  .title-block { display: grid; grid-template-columns: minmax(0, 38%) 1fr; gap: 6px; align-items: stretch; }
  .title-plate { max-width: 100%; margin: 0; align-self: start; }
  .title-panel { gap: 0; }
  .title { font-size: clamp(9px, 1.7vh, 12px); }
  .title-tag { font-size: clamp(4.5px, 0.8vh, 6px); margin-top: 1px; }
  .title-micro { display: none; }
  .title-notes { margin-top: 0; padding: 3px 5px 4px; display: flex; flex-direction: column; justify-content: center; }
  .kicker { font-size: 6px; }
  .sheet-id, .title-notes .brief { display: none; }
  .title-tools { margin-top: 3px; gap: 3px; }
  .title-tools .paper-tab { padding: 2px 4px; font-size: 6px; }
  .block-head { padding: 1px 4px 2px; margin-bottom: 3px; gap: 4px; }
  .block-head h2 { font-size: 8px; letter-spacing: 0.1em; }
  .block-plate { font-size: 5px; }
  .classes-rail { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; overflow: visible; padding: 0; }
  .slammer-rail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; overflow: visible; padding: 0; }
  .classes-rail .class-card, .slammer-rail .slammer-card { min-width: 0; width: 100%; flex: none; }
  .class-card .face-holder { width: var(--class-disc); height: var(--class-disc); }
  .class-card .label-strip { min-height: 15px; padding: 1px 2px; margin-top: 3px; }
  .class-card .plate-no, .class-card .ability { display: none; }
  .class-card .class-name { font-size: 5.5px; letter-spacing: 0; }
  .class-card .label-row .mono { font-size: 5px; }
  .class-card .pips { height: 3px; }
  .class-card .pips img { width: 3px; height: 3px; }
  .class-card .label-row { border-bottom: 0; padding: 0; margin: 0; }
  .slammer-label { min-height: clamp(26px, 5.4vh, 40px); padding: 1px 2px; margin-top: 3px; }
  .slammer-top { gap: 1px; }
  .slammer-top b { font-size: clamp(6px, 1.05vh, 8px); letter-spacing: 0; }
  .slammer-tag { font-size: 4.5px; padding: 0 1px; }
  .spec { font-size: clamp(4px, 0.8vh, 5.5px); line-height: 1.05; }
  .spec i { font-size: 3.6px; margin-right: 1px; }
  .slammer-label .plate-no { display: none; }
  .slammer-cd { display: none; }
  .swipe-hint, .block-note { display: none; }
  .play-block { min-height: 0; }
  .play-head { padding: 2px 4px; min-height: 16px; margin-bottom: 3px; gap: 4px; }
  .play-title { font-size: 7px; letter-spacing: 0.1em; }
  .tally-strip { padding-left: 4px; }
  .tally-strip .mono { font-size: 5.5px; }
  .paper-tab.small { padding: 1px 3px; font-size: 5.5px; }
  .mat { flex: 1; min-height: 0; padding: 14px 4px 4px; }
  .mat-label { font-size: 5px; padding: 0 2px; }
  .pot { gap: 4px; }
  .pot-wrap { gap: 1px; }
  .pot-ring { width: clamp(118px, 19vh, 190px); height: clamp(118px, 19vh, 190px); }
  .pot-empty { font-size: 5.5px; padding: 3px 5px; max-width: 62%; }
  .shop-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; }
  .pog-card .face-holder { width: var(--shop-disc); height: var(--shop-disc); }
  .pog-card .label-strip { min-height: clamp(22px, 4.6vh, 34px); padding: 1px 2px; margin-top: 2px; }
  .pog-card .class-name { font-size: 5px; letter-spacing: 0; }
  .pog-card .label-row .mono { font-size: 4.5px; }
  .pog-card .pips, .pog-card .plate-no { display: none; }
  .pog-card .rarity-line { font-size: 4px; }
  .pog-card .ability { font-size: clamp(4px, 0.8vh, 5.5px); line-height: 1.05; }
  .pog-card .weight-badge { min-width: calc(var(--shop-disc) * 0.32); height: calc(var(--shop-disc) * 0.32); font-size: calc(var(--shop-disc) * 0.22); }
  .inspect-strip { padding: 2px 4px; min-height: 22px; margin-top: 3px; gap: 0; }
  .inspect-name { font-size: 7px; }
  .inspect-meta { gap: 4px; }
  .inspect-meta .mono { font-size: 4.5px; }
  .inspect-ability { font-size: 5.5px; line-height: 1.15; }
  .inspect-strip .flip-line { display: none; }
  .play-foot { margin-top: 3px; min-height: 16px; gap: 4px; }
  .start-tab { font-size: 10px; padding: 3px 6px; border-width: 1px; box-shadow: 2px 2px 0 rgba(45, 32, 18, 0.28); }
  .start-tab span { font-size: 5px; }
  .play-hint { font-size: 4.5px; flex: 1 1 80px; }
  .rival-hand-row { min-height: 14px; padding-bottom: 1px; gap: 4px; }
  .arena-label { font-size: 5px; padding: 0 2px; }
  .pot-label { font-size: 5.5px; padding: 0 3px; }
  .rival-hand-disc { width: 15px; height: 15px; font-size: 3px; }
  .hand-row { gap: 3px; padding-top: 3px; }
  .hand-head .mono { font-size: 4.5px; padding: 0 2px; }
  .hand { min-height: 40px; padding-top: 3px; gap: 3px; }
  .hand-card { width: clamp(40px, 6.6vh, 54px); }
  .hand-card .face-holder { width: var(--hand-disc); height: var(--hand-disc); }
  .hand-card .hand-label { min-height: 14px; padding: 1px 2px; margin-top: 2px; }
  .hand-card .hand-label b { font-size: 4.5px; }
  .hand-card .hand-label .mono { font-size: 4px; }
  .hand-card .pot-tag { font-size: 4.5px; top: -3px; right: -2px; }
  .hand-empty { font-size: 5px; padding: 4px; }
  .deck-block, .tray-block { min-width: 0; }
  .deck-block .block-head, .tray-block .block-head { margin-bottom: 2px; }
  .deck-art, .tray-art { max-height: 44px; overflow: hidden; }
  .deck-art img, .tray-art > img { height: 44px; width: 100%; object-fit: cover; }
  .deck-tag { min-width: 30px; padding: 1px 3px; top: 24%; }
  .deck-tag b { font-size: 11px; }
  .deck-tag span { font-size: 4px; }
  .deck-stamp { font-size: 10px; }
  .deck-note, .block-caption { display: none; }
  .tray-floor { left: 6%; right: 6%; top: 6%; height: 62%; }
  .tray-mini { width: 8px; height: 8px; }
  .tray-side-label { font-size: 3px; margin-bottom: 0; }
  .scale-tab { min-width: 14px; padding: 0 1px; }
  .scale-tab b { font-size: 6px; }
  .scale-tab small { font-size: 3.5px; }
  .scale-tab.you { bottom: 13%; }
  .scale-tab.rival { bottom: 5%; }
  .scale-mult { font-size: 4px; }
  .plate-bar { padding: 4px 5px calc(4px + env(safe-area-inset-bottom, 0px)); margin: 0 calc(-1 * var(--pad)); gap: 3px; }
  .plate { min-height: 46px; }
  .plate-word { font-size: 12px; }
  .plate-discard .plate-word { font-size: 11px; }
  .plate-sub { font-size: 4.5px; }
  .plate-key { font-size: 4px; right: 5%; bottom: 3%; }
  .discard-cols { grid-template-columns: 1fr; gap: 12px; }
  .end-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .dialog-body { padding: 8px; }
  .rules-body { font-size: 11px; }
  .rules-body .kv { grid-template-columns: 62px 1fr; }
  .charge-slip { bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  .sheet-dialog.info-sheet {
    position: fixed;
    top: 74px;
    left: 7px;
    right: 7px;
    bottom: auto;
    width: auto;
    max-width: none;
    max-height: 196px;
    margin: 0;
    border: 2px solid var(--ink);
    box-shadow: 4px 5px 0 rgba(29, 25, 19, 0.35);
    z-index: 60;
  }
  .sheet-dialog.info-sheet .dialog-head { padding: 5px 8px; gap: 6px; }
  .sheet-dialog.info-sheet .dialog-head h2 { font-size: 14px; }
  .sheet-dialog.info-sheet .dialog-head .mono { font-size: 6.5px; }
  .sheet-dialog.info-sheet .dialog-close { font-size: 7px; padding: 2px 5px; }
  .sheet-dialog.info-sheet .dialog-body {
    max-height: calc(196px - 38px);
    padding: 6px 8px 16px;
    overflow: auto;
  }
  .sheet-dialog.info-sheet .rules-body { font-size: 9px; line-height: 1.4; }
  .sheet-dialog.info-sheet .rules-body h3 { font-size: 8px; margin: 8px 0 3px; padding-top: 4px; }
  .sheet-dialog.info-sheet .rules-body ol { padding-left: 13px; }
  .sheet-dialog.info-sheet .rules-body li { margin-bottom: 4px; }
  .sheet-dialog.info-sheet .rules-body .kv { grid-template-columns: 52px 1fr; gap: 1px 5px; font-size: 8px; }
  .sheet-dialog.info-sheet .rules-body .kv b { font-size: 7px; }
  .sheet-dialog.info-sheet .rules-body .keys { font-size: 7px; padding: 4px 5px; margin-top: 5px; }
  .sheet-dialog.info-sheet .rules-body .tiny { font-size: 7px; }
}

/* ---------- phone held sideways: one full screen, three columns ---------- */
@media (min-width: 701px) and (max-width: 1099px) and (max-height: 620px) {
  .sheet {
    max-width: none;
    width: 100%;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.6fr) minmax(0, 0.8fr);
    grid-template-areas:
      "title play deck"
      "slammers play tray"
      "classes play tray"
      "plates plates plates";
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }
  .title-block { grid-template-columns: minmax(0, 44%) 1fr; }
  .classes-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
  .deck-block, .tray-block { align-self: start; }
  .tray-block { grid-row: 2 / 4; }
  .deck-art, .tray-art { max-height: 64px; }
  .deck-art img, .tray-art > img { height: 64px; }
  .plate { min-height: 40px; aspect-ratio: auto; height: 44px; }
  .screen-slammer .slammer-rail { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .screen-slammer .slammer-face { width: clamp(64px, 20vh, 110px); height: clamp(64px, 20vh, 110px); }
  .screen-slammer .slammer-label { padding: 4px 6px 6px; margin-top: 5px; }
  .screen-slammer .slammer-top b { font-size: 12px; }
  .screen-slammer .spec { font-size: 8.5px; line-height: 1.25; }
  .screen-slammer .spec i { font-size: 6px; }
  .screen-slammer .screen-prompt { font-size: 7.5px; padding: 4px 6px; margin-top: 5px; }
  .screen-slammer .title-block { grid-template-columns: 180px 1fr; flex: none; }
  .title-plate { max-height: 82px; }
  .title { font-size: 13px; }
  .title-tag { font-size: 6px; }
  .charge-slip { bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 701px) and (max-height: 620px) {
  .sheet-dialog.info-sheet {
    position: fixed;
    top: 8px; right: 8px; bottom: auto; left: auto;
    width: min(40vw, 380px);
    height: calc(100dvh - 16px);
    max-width: none; max-height: calc(100dvh - 16px);
    margin: 0;
    display: flex; flex-direction: column;
    border: 2px solid var(--ink);
    box-shadow: 4px 5px 0 rgba(29, 25, 19, 0.35);
    z-index: 60;
  }
  .sheet-dialog.info-sheet .dialog-head { padding: 5px 8px; gap: 6px; flex: none; }
  .sheet-dialog.info-sheet .dialog-head h2 { font-size: 14px; }
  .sheet-dialog.info-sheet .dialog-head .mono { font-size: 6.5px; }
  .sheet-dialog.info-sheet .dialog-close { font-size: 7px; padding: 2px 5px; }
  .sheet-dialog.info-sheet .dialog-body { flex: 1; min-height: 0; max-height: none; padding: 8px 10px 22px; overflow: auto; }
  .sheet-dialog.info-sheet .rules-body { font-size: 9.5px; line-height: 1.4; }
  .sheet-dialog.info-sheet .rules-body h3 { font-size: 8px; margin: 8px 0 3px; padding-top: 4px; }
  .sheet-dialog.info-sheet .rules-body ol { padding-left: 13px; }
  .sheet-dialog.info-sheet .rules-body li { margin-bottom: 4px; }
  .sheet-dialog.info-sheet .rules-body .kv { grid-template-columns: 56px 1fr; gap: 1px 5px; font-size: 8px; }
  .sheet-dialog.info-sheet .rules-body .kv b { font-size: 7px; }
  .sheet-dialog.info-sheet .rules-body .keys { font-size: 7px; padding: 4px 5px; margin-top: 5px; }
  .sheet-dialog.info-sheet .rules-body .tiny { font-size: 7px; }
}
@media (min-width: 1100px) and (max-height: 700px) {
  .slammer-face { width: 50px; height: 50px; }
  .slammer-label { min-height: 42px; }
  .spec { font-size: 8px; }
  .play-block .mat { min-height: 126px; }
  .plate { min-height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
dialog:not([open]) { display: none !important; }

/* ---------- the pot is a pile, driven by physics ---------- */
.pot.match {
  display: block;
  position: relative;
  width: 100%;
  height: calc(var(--pot-disc) * 2.3);
  min-height: calc(var(--pot-disc) * 1.8);
  perspective: 600px;
}
.pot.match .pot-disc {
  position: absolute;
  left: 50%; top: 50%;
  margin-left: calc(var(--pot-disc) / -2);
  margin-top: calc(var(--pot-disc) / -2);
  transition: none;
  will-change: transform;
}
.pot.match .pot-disc:hover, .pot.match .pot-disc:focus-visible { transform: none; }
.pot.match .pot-disc .disc-inner { transition: none; }
.pot.match .pot-empty {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  white-space: normal;
}
.pot-disc.flying { pointer-events: none; }
.pot-disc.to-tray-js { transition: transform 0.6s cubic-bezier(0.35, 0, 0.75, 0.45), opacity 0.6s; }
@media (max-width: 700px), (min-width: 701px) and (max-width: 1099px) and (max-height: 620px) {
  .pot-wrap { flex: 1; min-height: 0; justify-content: center; }
  .pot.match { height: auto; flex: 1; min-height: calc(var(--pot-disc) * 1.7); }
}

/* ---------- perfect slam ---------- */
.sheet.shake-metal { animation: shakeMetal 0.32s steps(6, end); }
.sheet.shake-resin { animation: shakeResin 0.6s ease-out; }
.sheet.shake-stone { animation: shakeStone 0.9s ease-out; }
.sheet.shake-wood { animation: shakeWood 0.55s ease-out; }
@keyframes shakeMetal {
  0%,100% { transform: translate(0,0); } 17% { transform: translate(-5px,2px); } 34% { transform: translate(5px,-2px); }
  50% { transform: translate(-3px,1px); } 67% { transform: translate(3px,0); } 84% { transform: translate(-1px,0); }
}
@keyframes shakeResin {
  0%,100% { transform: translate(0,0) rotate(0); } 15% { transform: translate(-3px,1px) rotate(-0.4deg); }
  30% { transform: translate(3px,-1px) rotate(0.4deg); } 45% { transform: translate(-2px,0) rotate(-0.2deg); } 60% { transform: translate(1px,0); }
}
@keyframes shakeStone {
  0%,100% { transform: translate(0,0); } 8% { transform: translate(0,7px); } 16% { transform: translate(-6px,-3px); }
  26% { transform: translate(6px,3px); } 38% { transform: translate(-5px,2px); } 50% { transform: translate(4px,-2px); }
  64% { transform: translate(-3px,1px); } 78% { transform: translate(2px,0); } 90% { transform: translate(-1px,0); }
}
@keyframes shakeWood {
  0%,100% { transform: translate(0,0); } 12% { transform: translate(0,-5px); } 26% { transform: translate(0,4px); }
  40% { transform: translate(-3px,-2px); } 55% { transform: translate(3px,1px); } 72% { transform: translate(-1px,0); }
}
.perfect-fx {
  position: absolute; width: 0; height: 0; pointer-events: none; z-index: 9;
}
.perfect-fx span {
  position: absolute; left: 0; top: 0; border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.2); opacity: 0;
}
.perfect-fx .pf-a { width: 220px; height: 220px; animation: pfRing 0.9s ease-out forwards; }
.perfect-fx .pf-b { width: 300px; height: 300px; animation: pfRing 1.1s 0.12s ease-out forwards; }
.perfect-fx .pf-c { width: 140px; height: 140px; animation: pfRing 0.8s 0.24s ease-out forwards; }
@keyframes pfRing {
  0% { opacity: 0.95; transform: translate(-50%, -50%) scale(0.2); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}
.perfect-metal span { border: 3px solid #8d9396; box-shadow: inset 0 0 0 1px #f3e8cd; }
.perfect-metal .pf-a { border-top-color: #f3e8cd; border-width: 4px; }
.perfect-resin span { border: 6px solid rgba(215, 154, 44, 0.75); }
.perfect-resin .pf-b { border-color: rgba(191, 63, 43, 0.5); border-width: 3px; }
.perfect-stone span {
  border: 0;
  background-image: radial-gradient(circle, rgba(29, 25, 19, 0.6) 1.2px, transparent 1.6px);
  background-size: 7px 7px;
  -webkit-mask-image: radial-gradient(circle, transparent 40%, #000 55%, transparent 72%);
  mask-image: radial-gradient(circle, transparent 40%, #000 55%, transparent 72%);
}
.perfect-wood span { border: 2px solid #8f6435; }
.perfect-wood .pf-a { border-width: 3px; }
.perfect-wood .pf-c { border: 2px dashed #8f6435; }
@media (prefers-reduced-motion: reduce) {
  .sheet.shake-metal, .sheet.shake-resin, .sheet.shake-stone, .sheet.shake-wood { animation: none; }
}

/* ---------- unique pogs and the reward ---------- */
.vault-note {
  margin: 5px 0 0; padding: 3px 8px;
  font-family: "Space Mono", monospace; font-size: 8px; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink);
  background: var(--cream-hi); border: 1px solid var(--ochre);
  box-shadow: 1px 1px 0 rgba(45, 32, 18, 0.25);
  text-align: center;
}
.vault-note b { color: var(--red); }
.reward-box {
  margin: 10px 0 4px; padding: 8px;
  border-top: 2px solid var(--ink); border-bottom: 1px solid var(--hair);
  background: rgba(215, 154, 44, 0.12);
}
.reward-head {
  font-family: Graduate, Archivo, sans-serif; font-size: clamp(13px, 2.2vw, 18px);
  letter-spacing: 0.05em; color: var(--red); text-transform: uppercase;
}
.reward-sub { font-size: 10px; color: var(--ink-70); margin: 2px 0 8px; }
.reward-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.reward-card {
  appearance: none; border: 0; background: transparent; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; position: relative; min-width: 0;
}
.reward-face {
  position: relative; width: clamp(62px, 15vw, 104px); height: clamp(62px, 15vw, 104px);
  filter: drop-shadow(3px 5px 0 rgba(45, 32, 18, 0.25)); transition: transform 0.15s ease;
}
.reward-face img { width: 100%; height: 100%; border-radius: 50%; }
.reward-face::before {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--ochre); box-shadow: 0 0 0 1px var(--ink);
}
.reward-face .weight-badge { bottom: -6%; min-width: 26%; height: 26%; font-size: clamp(10px, 2.2vw, 15px); }
.reward-label {
  width: 100%; margin-top: 8px; padding: 4px 5px 5px;
  background: var(--cream-hi); border-top: 2px solid var(--ochre); border-bottom: 1px solid var(--hair);
  box-shadow: var(--hard-shadow); text-align: left; display: flex; flex-direction: column; gap: 1px;
}
.reward-label b { font-family: Graduate, Archivo, sans-serif; font-weight: 400; font-size: clamp(9px, 1.6vw, 13px); letter-spacing: 0.04em; }
.reward-label .mono { font-size: 7px; color: var(--ink-70); }
.reward-rule { font-size: clamp(8px, 1.4vw, 10px); line-height: 1.25; }
.reward-card:hover .reward-face, .reward-card:focus-visible .reward-face { transform: translateY(-5px); }
.reward-card:focus-visible { outline: none; }
.reward-card:focus-visible .reward-label { outline: 2px solid var(--red); outline-offset: 1px; }
.reward-card.off { opacity: 0.4; }
.reward-card:disabled { cursor: default; }
.reward-stamp {
  position: absolute; top: 18%; left: 50%; transform: translateX(-50%) rotate(-12deg);
  font-family: Graduate, Archivo, sans-serif; font-size: 20px; color: var(--red);
  border: 2px solid var(--red); padding: 0 6px; background: rgba(243, 232, 205, 0.8);
  animation: stampFlash 0.6s ease-out both; opacity: 1;
}
.hand-card.unique .face-holder::before {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid var(--ochre); box-shadow: 0 0 0 1px var(--ink); z-index: 2; pointer-events: none;
}
.hand-card.unique .hand-label { border-top-color: var(--ochre); }
@media (max-width: 700px) {
  .end-dialog .dialog-body { max-height: calc(100dvh - 70px); }
  .reward-box { padding: 6px; margin: 6px 0 2px; }
  .reward-sub { font-size: 8px; margin-bottom: 6px; }
  .reward-row { gap: 4px; }
  .reward-rule { font-size: 7px; }
  .reward-label { padding: 3px; margin-top: 6px; }
  .reward-label .mono { font-size: 5.5px; }
  .end-result { font-size: 30px; margin: 2px 0; }
  .end-grid { margin: 8px 0 4px; }
  .end-col .count { font-size: 20px; }
  .end-actions { margin-top: 8px; }
  .vault-note { font-size: 6px; padding: 2px 4px; }
}

/* ---------- the draft is its own screen; the title fits its banner ---------- */
.screen-draft .slammer-block { display: none !important; }
.title-panel { container-type: inline-size; }
.title { font-size: min(var(--fs-title), 8.4cqw); white-space: nowrap; }
.title-tag { font-size: min(9px, 3.4cqw); }
@media (min-width: 701px) and (max-width: 1099px) and (max-height: 620px) {
  .sheet { grid-template-areas:
      "title play deck"
      "slammers play tray"
      "classes play tray"
      "plates plates plates"; }
  .title-block { grid-template-columns: 1fr; }
  .title-plate { max-height: none; width: 100%; max-width: 230px; }
  .title-notes { padding: 3px 5px; }
  .screen-slammer .title-block { grid-template-columns: 200px 1fr; }
  .screen-slammer .title-plate { max-width: 200px; }
}
@media (min-width: 701px) and (max-height: 620px) {
  .sheet-dialog.info-sheet {
    height: calc(100dvh - 82px);
    max-height: calc(100dvh - 82px);
  }
  .sheet-dialog.info-sheet .dialog-body { padding-bottom: 28px; }
}
.title { font-size: min(30px, 8.4cqw); }
.title-tag { font-size: min(9px, 3.2cqw); }
@media (min-width: 701px) and (max-width: 1099px) and (max-height: 620px) {
  .title-plate { max-width: 180px; }
}
.sheet-dialog.info-sheet .dialog-body::after {
  content: "END OF RULES";
  display: block;
  margin-top: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--hair);
  font-family: "Space Mono", monospace;
  font-size: 6.5px;
  letter-spacing: 0.12em;
  color: var(--ink-45);
  text-align: center;
}
.scroll-cue {
  position: sticky;
  bottom: -28px;
  margin: 6px -10px -28px;
  padding: 10px 0 5px;
  text-align: center;
  font-family: "Space Mono", monospace;
  font-size: 7px;
  letter-spacing: 0.12em;
  color: var(--ink);
  background: linear-gradient(to bottom, rgba(233, 218, 184, 0), var(--cream) 45%);
  pointer-events: none;
  transition: opacity 0.2s;
}
.scroll-cue.gone { opacity: 0; }
.scroll-cue { bottom: -16px; margin: 6px -8px -16px; padding: 12px 0 4px; }
@media (min-width: 701px) and (max-height: 620px) {
  .scroll-cue { bottom: -28px; margin: 6px -10px -28px; }
}
