@charset "UTF-8";

:root {
  color-scheme: dark;
  --ink: #171512;
  --well: #131211;
  --line: #40352a;
  --line-soft: #332a22;
  --paper: #f6ebd7;
  --muted: #c1ad95;
  --gold: #e7b771;
  --serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", SimSun, serif;
  --sans: "Source Sans 3", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --numbers: "Inter", "Segoe UI", var(--sans);
  --max: 1320px;
  --gutter: clamp(16px, 4.35vw, 66px);
}

*, *::before, *::after { box-sizing: border-box; }

html { min-width: 300px; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 28% 0%, #35251c68, transparent 57%),
    linear-gradient(180deg, #1e1915, var(--ink) 36rem);
  color: var(--paper);
  font: 400 15px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--gold); }
button, a, input, select { -webkit-tap-highlight-color: #e7b77126; }
:focus-visible { outline: 2px solid #ffcc82; outline-offset: 4px; }
::selection { background: #ad513c; color: #fff0d8; }

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.26; text-wrap: balance; }
h1, h2, .brand-name { font-family: var(--serif); }
strong, b { color: var(--paper); }
small { color: var(--muted); }

.shell { width: min(calc(100% - 2 * var(--gutter)), var(--max)); margin-inline: auto; }

.skip-link {
  position: fixed;
  z-index: 20;
  top: 8px;
  left: 8px;
  padding: 8px 14px;
  transform: translateY(-150%);
  background: var(--paper);
  color: var(--ink);
}
.skip-link:focus { transform: none; }

.masthead {
  position: sticky;
  z-index: 8;
  top: 0;
  background: #1a1612f4;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.masthead-inner {
  min-height: 70px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 35px;
  border: 1px solid #dd896b;
  border-radius: 3px 5px 4px 3px;
  box-shadow: 0 0 0 2px #561e17, inset 0 0 0 2px #9e392b;
  background: #a33b2c;
  color: #ffe7c9;
  font: 900 22px/1 var(--serif);
  transform: rotate(-3deg);
}
.brand-name { font-size: 25px; font-weight: 900; letter-spacing: .12em; }
.site-nav { display: flex; gap: clamp(5px, 1.5vw, 32px); align-self: stretch; }
.site-nav button {
  position: relative;
  min-height: 44px;
  padding: 0 9px;
  border: 0;
  background: transparent;
  white-space: nowrap;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}
.site-nav button:hover, .site-nav button[aria-current="page"], .site-nav button.is-active { color: var(--paper); }
.site-nav button:is([aria-current="page"], .is-active)::after {
  position: absolute;
  right: 8px;
  bottom: 0;
  left: 8px;
  height: 3px;
  background: var(--gold);
  content: "";
}
.wallet { display: flex; gap: 8px; justify-self: end; white-space: nowrap; }
.wallet-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px;
  border: 1px solid #473729;
  border-radius: 4px;
  background: #292018;
  color: var(--muted);
  font-size: 12px;
}
.wallet-item b { color: var(--gold); font: 700 14px/1 var(--numbers); font-variant-numeric: tabular-nums; }
.main { flex: 1 0 auto; min-width: 0; padding-block: clamp(18px, 3vw, 44px) 42px; }
.loading { padding: 30px 0; color: var(--muted); }
.footer {
  display: flex;
  justify-content: space-between;
  gap: 10px 20px;
  padding-block: 16px 22px;
  border-top: 1px solid var(--line-soft);
  color: #aa9680;
  font-size: 12px;
}

.hero {
  position: relative;
  z-index: 0;
  display: grid;
  align-items: center;
  min-height: clamp(435px, 45vw, 590px);
  overflow: hidden;
  border: 1px solid #725045;
  border-radius: 8px;
  isolation: isolate;
  background:
    linear-gradient(90deg, #1f1412 1%, #221613f2 28%, #241a15a0 49%, #36201a13 76%),
    linear-gradient(0deg, #1b130fa0, transparent 30%),
    url("./assets/court.webp") center 32% / cover,
    radial-gradient(ellipse at 76% 39%, #a7663c, #694230 21%, #1f1815 58%);
  box-shadow: 0 20px 46px #0c090747;
}
.hero::before, .hero::after {
  position: absolute;
  z-index: -1;
  inset: 10px;
  background:
    linear-gradient(#d5a574ad, #d5a574ad) top left / 28px 1px,
    linear-gradient(#d5a574ad, #d5a574ad) top left / 1px 28px,
    linear-gradient(#d5a574ad, #d5a574ad) top right / 28px 1px,
    linear-gradient(#d5a574ad, #d5a574ad) top right / 1px 28px,
    linear-gradient(#d5a574ad, #d5a574ad) bottom left / 28px 1px,
    linear-gradient(#d5a574ad, #d5a574ad) bottom left / 1px 28px,
    linear-gradient(#d5a574ad, #d5a574ad) bottom right / 28px 1px,
    linear-gradient(#d5a574ad, #d5a574ad) bottom right / 1px 28px;
  background-repeat: no-repeat;
  content: "";
  pointer-events: none;
}
.hero::after { inset: 14px; opacity: .3; }
.hero-content {
  position: relative;
  width: min(58%, 690px);
  padding: clamp(30px, 5vw, 76px);
  padding-right: 0;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .18em;
}
.eyebrow::before {
  width: 7px;
  height: 7px;
  border: 1px solid currentColor;
  transform: rotate(45deg);
  content: "";
}
.hero h1 {
  margin-block: 14px 18px;
  color: #ffebc5;
  letter-spacing: .075em;
  font-size: clamp(62px, 9.2vw, 132px);
  font-weight: 900;
  text-shadow: 0 5px 22px #321b0f99;
}
.hero-description { max-width: 31em; color: #e3c7a9; font-size: clamp(14px, 1.5vw, 17px); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.hero-actions { margin-top: 30px; }

.btn {
  min-height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 17px;
  border: 1px solid #73583e;
  border-radius: 4px;
  background: #2c231b;
  color: var(--paper);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .17s, border-color .17s, color .17s, transform .17s;
}
.btn:hover:not(:disabled) { border-color: #bd9466; background: #3b2d20; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .48; }
.btn-primary {
  border-color: #d67d55;
  background: linear-gradient(110deg, #a73d2d, #7d2b22);
  color: #fff3e0;
  box-shadow: inset 0 0 0 2px #611e183d, 0 3px 9px #15080449;
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(110deg, #bd4932, #9b3226); border-color: #f1ac7d; }
.hero .btn { min-width: 119px; min-height: 49px; }

.page-heading, .section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 22px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}
.page-heading h1 { margin: 5px 0 6px; font-size: clamp(31px, 5vw, 48px); letter-spacing: .06em; }
.section-heading { margin-bottom: 14px; padding-bottom: 10px; }
.section-heading h2 { margin-top: 4px; font-size: clamp(20px, 3.2vw, 31px); }
.page-description { max-width: 72ch; color: var(--muted); }
.panel {
  min-width: 0;
  padding: clamp(14px, 2.2vw, 26px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(150deg, #272019, #1c1814);
}
.panel h2 { font-size: 20px; }
.muted { color: var(--muted); }
input::placeholder { color: #a78e73; }
.empty-state {
  padding: 34px 16px;
  border: 1px dashed #654e39;
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
}
.empty-state :is(h2, h3, strong) { display: block; margin-bottom: 5px; }
.empty-state button { margin-top: 12px; }

.odds-panel { align-self: start; }
.odds-panel p, .odds-panel small { font-size: 13px; color: var(--muted); }
.odds-panel table { width: 100%; margin: 12px 0; border-collapse: collapse; text-align: left; white-space: nowrap; }
.odds-panel th, .odds-panel td { padding: 7px 5px; border-bottom: 1px solid var(--line); font-size: 12px; }
.odds-panel th { color: var(--muted); font-weight: 650; }
.odds-panel :is(th, td):not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
  align-items: stretch;
  gap: 12px;
}

.rarity-common { --rarity: #a7a7a0; --rarity-bg: #302e29; }
.rarity-rare { --rarity: #8dbab7; --rarity-bg: #233133; }
.rarity-epic { --rarity: #c4a3e5; --rarity-bg: #332a40; }
.rarity-legendary { --rarity: #f3c47b; --rarity-bg: #493520; }
.rarity-mythic { --rarity: #ffa38e; --rarity-bg: #502920; }

.collect-card {
  position: relative;
  container-type: inline-size;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--rarity, #816956);
  border-radius: 6px;
  background: #281e16;
  color: var(--paper);
  text-align: left;
  vertical-align: top;
}
.collect-card:hover { filter: brightness(1.12); transform: translateY(-2px); box-shadow: 0 4px 11px #170a05a8; }
.collect-card.is-locked { opacity: .7; filter: saturate(.45); }
.collect-card.is-locked:focus-within, .collect-card.is-locked:hover { opacity: 1; }
.card-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 70px;
  aspect-ratio: 1.65;
  color: #fce0aa;
  text-shadow: 0 2px 7px #1e0f06c2;
  font: 900 clamp(28px, 32cqw, 61px)/1 var(--serif);
  isolation: isolate;
  overflow: hidden;
}
.card-art::after {
  position: absolute;
  inset: 6px;
  z-index: -1;
  border: 1px solid #eccda34d;
  content: "";
}
.card-meta { color: #c7ac8f; font-size: 11px; }

.deck-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(225px, 100%), 1fr)); gap: 12px; }

.battle-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(215px, .31fr); gap: 12px; align-items: start; }
.board, .battle-sidebar { min-width: 0; display: grid; gap: 12px; }
.scoreboard {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 7px 12px;
  padding: 9px;
  border: 1px solid #684f38;
  border-radius: 6px;
  background: linear-gradient(95deg, #3c211c, #1c1915 40% 63%, #222f30);
}
.score-side {
  min-width: 0;
  flex: 1;
  display: grid;
  justify-items: start;
  align-items: center;
  gap: 2px 8px;
  padding: 2px 5px;
  color: #e2c5a7;
}
.score-side:last-child { justify-items: end; justify-content: end; text-align: right; }
.score-side strong { color: var(--paper); font: 800 24px/1 var(--numbers); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.field, .base {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #1e1915;
}
.field {
  background:
    linear-gradient(150deg, #42292162, #1b1816e6),
    radial-gradient(ellipse at top center, #4d3927, #181514 82%);
}
.field-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
  margin-bottom: 7px;
}
.field-head h3 { color: #f6d8ae; font-size: 17px; }
.field-head p { color: var(--muted); font-size: 11px; }
.field-units, .base-units {
  min-height: 44px;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 5px;
  padding: 5px 0;
}
.battle-unit {
  position: relative;
  display: inline-grid;
  align-items: center;
  grid-template-columns: auto auto;
  gap: 3px 7px;
  min-height: 37px;
  max-width: 100%;
  padding: 5px 7px;
  border: 1px solid #a3755a;
  border-radius: 4px;
  background: #422a21;
  color: #ffe7cc;
  text-align: left;
  font-size: 12px;
}
.battle-unit.is-enemy { border-color: #608d8c; background: #243b3b; color: #dfe9de; }
.battle-unit.is-exhausted { opacity: .66; }
.battle-unit.is-selected { outline: 2px solid #ffcd80; outline-offset: 2px; }
.hand { min-width: 0; padding-top: 5px; }
.hand-grid {
  min-height: 115px;
  display: grid;
  grid-auto-columns: clamp(104px, 13vw, 160px);
  grid-auto-flow: column;
  gap: 6px;
  padding: 3px 4px 9px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
.battle-actions {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #1d1814;
}
.battle-actions p { color: var(--muted); font-size: 12px; }
.battle-sidebar .panel { padding: 13px; }
.battle-sidebar .panel h2 { font-size: 17px; }
.log {
  max-height: 310px;
  margin: 5px 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-color: #70523c #201913;
}
.log > li { padding: 5px 2px; border-bottom: 1px solid var(--line-soft); color: #dbbaa0; font-size: 12px; overflow-wrap: anywhere; }
.log > li:last-child { border-bottom: 0; }
.result-banner {
  padding: 17px;
  border: 1px solid #987149;
  border-radius: 5px;
  background: linear-gradient(105deg, #5f3826, #251c15);
  color: #ffe0af;
}
.result-banner h2 { font-size: 25px; }
.result-banner p { margin-top: 6px; }

dialog {
  max-width: min(660px, calc(100vw - 24px));
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  padding: clamp(16px, 4vw, 30px);
  border: 1px solid #936848;
  border-radius: 8px;
  background: #211912;
  color: var(--paper);
  box-shadow: 0 22px 70px #050403d9;
}
dialog::backdrop { background: #100d0bc7; backdrop-filter: blur(5px); }
.related-cards { margin-top: 18px; }
.related-cards p { margin-bottom: 7px; }
.toast {
  position: fixed;
  z-index: 9;
  right: var(--gutter);
  bottom: 20px;
  max-width: min(385px, calc(100% - 2 * var(--gutter)));
  padding: 10px 15px;
  border: 1px solid #b48554;
  border-radius: 4px;
  background: #3d2a1d;
  color: #fff0d4;
  box-shadow: 0 6px 22px #0d0907ba;
  font-size: 14px;
}
.toast:empty { display: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.hero-caption {
  position: absolute;
  right: 28px;
  bottom: 26px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff0cf;
  font: 800 13px/1.3 var(--serif);
  letter-spacing: .14em;
  text-shadow: 0 1px 8px #130e0a;
}
.hero-caption span:last-child { color: var(--gold); }
.home-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: clamp(22px, 3vw, 38px);
  border-bottom: 1px solid #4c3a2a;
}
.metric {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px 12px;
  padding: 18px 8px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
.metric + .metric { border-left: 1px solid #4c3a2a; }
.metric strong { color: #f2cd9b; font: 800 clamp(20px, 3vw, 26px)/1 var(--numbers); }
.metric small { font-size: 13px; font-weight: 550; }
.chapter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.chapter-tile {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: start;
  align-items: center;
  gap: 4px 14px;
  min-height: 116px;
  padding: 15px;
  border: 1px solid #614a37;
  border-radius: 5px;
  background: linear-gradient(125deg, #34241b, #211a14);
  text-align: left;
}
.chapter-tile--2 { background: linear-gradient(125deg, #3f251e, #211a14); }
.chapter-tile--3 { background: linear-gradient(125deg, #293032, #211a14); }
.chapter-tile:hover { border-color: #be956c; }
.chapter-tile strong { font: 800 21px/1.25 var(--serif); }
.chapter-tile > span:not(.chapter-seal) { color: var(--muted); font-size: 12px; }
.chapter-tile small { grid-column: 2; color: var(--gold); font: 650 12px/1.3 var(--numbers); }
.chapter-seal, .deck-emblem {
  grid-row: 1 / span 3;
  display: grid;
  place-items: center;
  width: clamp(35px, 5vw, 56px);
  aspect-ratio: 1;
  border: 3px double #977350;
  border-radius: 4px 4px 6px 3px;
  background: #68422d;
  color: #f4d5a7;
  font: 800 clamp(18px, 3vw, 29px)/1 var(--serif);
  transform: rotate(-3deg);
}
.chapter-tile--2 .chapter-seal { background: #743527; }
.chapter-tile--3 .chapter-seal { background: #3a4a48; }
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid #735638;
  border-radius: 4px;
  background: #34261b;
  color: #efd1a4;
  font-size: 12px;
  white-space: nowrap;
}

.rarity-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 1px; background: var(--rarity); transform: rotate(45deg); }
.odds-panel th[scope="row"] { color: var(--paper); }
.odds-panel td:last-child { color: var(--gold); }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 15px;
  padding: 13px;
}
.segmented { display: inline-flex; padding: 2px; border: 1px solid #5c4534; border-radius: 5px; background: #191410; }
.segmented-item {
  min-height: 38px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.segmented-item:is(.is-active, :hover) { border-color: #7e5b40; background: #45301f; color: #ffe4bd; }
.filter-select, .filter-search { min-width: 0; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.filter-search { flex: 1 0 178px; }
.filter-select select, .filter-search input {
  width: 100%;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid #604b38;
  border-radius: 4px;
  background: #1b1713;
  color: var(--paper);
}
.match-count { margin-block: 10px 9px; font-size: 12px; }
.filter-bar + div > .empty-state { margin-top: 14px; }
.collect-card {
  --chapter-light: #b58a57;
  --chapter-dark: #4c3428;
  transition: transform .17s, filter .17s, opacity .17s;
}
.collect-card.chapter-2 { --chapter-light: #b46d52; --chapter-dark: #46251f; }
.collect-card.chapter-3 { --chapter-light: #7e9692; --chapter-dark: #2f3937; }
.collect-card .card-art {
  width: 100%;
  aspect-ratio: 1.7;
  background:
    radial-gradient(ellipse at center top, var(--chapter-light), transparent 90%),
    repeating-linear-gradient(154deg, #f0ba870f 0 1px, transparent 1px 6px),
    var(--chapter-dark);
}
.card-art-seal {
  display: grid;
  place-items: center;
  width: 44%;
  aspect-ratio: 1;
  border: 3px double #ffe1b080;
  border-radius: 4px 8px 5px 7px;
  background: #1a100d30;
  transform: rotate(-5deg);
}
.card-cost, .card-tag {
  position: absolute;
  top: 8px;
  min-height: 21px;
  border: 1px solid #d6ad84;
  border-radius: 3px;
  background: #281d15da;
  color: #ffe0af;
  font: 700 12px/1.5 var(--numbers);
  text-shadow: none;
}
.card-cost { left: 8px; min-width: 23px; text-align: center; }
.card-tag { right: 8px; padding: 0 4px; color: #f8ddaa; font-size: 10px; }
.card-copy {
  flex: 1;
  width: 100%;
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 8px 9px 10px;
  border-top: 1px solid #46362c;
  background: linear-gradient(180deg, var(--rarity-bg, #25201a), #211914 65%);
}
.card-copy strong { color: #f6e3c7; font: 850 clamp(17px, 12cqw, 23px)/1.24 var(--serif); overflow-wrap: anywhere; }
.card-copy .card-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 3px 6px; margin-top: 0; }
.card-rarity, .card-owned { color: var(--rarity, #d0ba98); }
.card-subline, .card-owned { font-size: 11px; overflow-wrap: anywhere; }
.card-subline { color: #dcc3a4; }
.load-more { display: grid; place-items: center; margin-top: 19px; }
.dialog-inner { min-width: min(410px, calc(100vw - 90px)); }
.dialog-inner form { float: right; margin-left: 10px; }
.dialog-inner h2 { margin: 7px 0 4px; font-size: 31px; }
.dialog-inner h3 { margin: 0 0 5px; font-size: 17px; }
.dialog-close {
  width: 36px;
  height: 36px;
  border: 1px solid #8e6749;
  border-radius: 4px;
  background: #38271a;
  color: #ffebcd;
  font: 750 23px/1 var(--sans);
}
.card-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 10px 8px; border-block: 1px solid #5a402e; }
.card-stats dt, .card-stats dd { margin: 0; text-align: center; }
.card-stats dt { color: var(--muted); font-size: 12px; }
.card-stats dd { color: var(--gold); font-size: 17px; font-weight: 800; }

.deck-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: start;
  align-items: start;
  justify-items: start;
  gap: 4px 11px;
  padding: 14px;
  text-align: left;
}
.deck-choice:hover, .deck-choice.is-selected { border-color: #d6a16a; background: linear-gradient(140deg, #4c301f, #211a14); }
.deck-choice .deck-emblem { background: #723d2b; }
.deck-choice .eyebrow { font-size: 10px; }
.deck-choice strong { font: 800 22px/1.2 var(--serif); }
.deck-choice span:last-child { color: var(--muted); font-size: 12px; }
.deck-editor, .start-battle { margin-top: 13px; }
.workbench-native-link { display: flex; justify-content: end; padding-block: 10px; }
.godot-match { margin-block-start: 18px; }
.godot-match-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-block-end: 8px; }
.godot-match-toolbar [role="status"] { color: var(--muted); font-size: 13px; }
.godot-match iframe { display: block; border: 0; width: 100%; aspect-ratio: 1120 / 790; background: #171512; border-radius: 12px; touch-action: none; }
[data-godot-surface="ready"] .arena-stage { display: none; }
.arena-surface-picker { display: flex; flex-wrap: wrap; align-items: center; justify-content: end; gap: 5px 9px; margin-block: 5px; }
.arena-lineup { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 8px; margin-inline-end: auto; padding: 4px 8px; color: #b9d9e2; }
.arena-lineup strong { color: #eaf8fc; overflow-wrap: anywhere; }
.arena-lineup :is(span, small) { font-size: .76rem; }
.deck-editor p + p { margin-top: 9px; }
.deck-controls, .start-battle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 11px;
}
.deck-controls { margin-top: 12px; }
.swap-list { display: grid; gap: 4px; padding-left: 18px; }
.swap-list .btn-quiet { min-height: 32px; padding: 3px 8px; margin-left: 6px; font-size: 12px; }
.btn-quiet { border-color: #513d2e; background: #231a14; color: #d8c0a3; }
.battle-guide { margin-top: 12px; }
.battle-sidebar .battle-guide { margin-top: 0; }
.battle-guide summary { color: #f4d6aa; font-weight: 750; cursor: pointer; }
.battle-guide ol { display: grid; gap: 5px; margin: 8px 0 0; padding-left: 19px; color: var(--muted); font-size: 12px; }
.score-player { font-size: 13px; }
.score-player .muted { margin-left: 4px; font-size: 11px; }
.score-side strong small { font: 650 13px/1 var(--numbers); }
.score-resources { color: #c9b49c; font-size: 11px; }
.score-versus { align-self: center; color: var(--gold); font: 750 24px/1 var(--serif); }
.field.is-fighting { border-color: #f3bd72; box-shadow: inset 0 0 20px #f1a85a29, 0 0 12px #f1a85a25; }
.field-effect { min-height: 38px; font-size: 12px; }
.field-units { display: grid; gap: 0; }
.unit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 41px; padding: 4px 0; }
.unit-row + .unit-row { border-top: 1px dashed #5d4535; }
.unit-empty { color: #ae9a84; font-size: 11px; }
.battle-unit small { display: block; grid-column: 1 / -1; font-size: 10px; }
.battle-unit strong { color: #f3d3ac; font-size: 12px; }
.battle-unit:hover { filter: brightness(1.22); }
.base h3 { color: #dcc0a5; font-size: 14px; }
.enemy-base { background: #1c2020; }
.ally-base { background: #251c18; }
.battle-action-top, .battle-action-row {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.battle-action-top { justify-content: space-between; }
.battle-action-row .btn { min-height: 37px; padding: 4px 8px; font-size: 12px; }
.selected-card-note { display: grid; gap: 3px; padding: 6px 8px; border-left: 2px solid #c48b59; background: #281d16; color: #e3c6a2; font-size: 12px; }
.battle-actions > label { justify-self: start; display: flex; align-items: center; gap: 5px; font-size: 12px; cursor: pointer; }
.battle-actions input[type="checkbox"] { accent-color: var(--gold); }
.battle-actions .battle-message { color: #f4bf8d; }
.hand .section-heading { margin-bottom: 4px; padding-bottom: 6px; }
.hand .section-heading .muted { font-size: 12px; }
.hand-card {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 7px 7px 10px;
  border: 1px solid var(--rarity, #927252);
  border-radius: 4px;
  background: linear-gradient(115deg, var(--rarity-bg, #34241b), #211814 75%);
  color: #f8e5cb;
  text-align: left;
}
.hand-card strong { font: 800 17px/1.22 var(--serif); overflow-wrap: anywhere; }
.hand-card small { color: #d8c4ad; font-size: 11px; overflow-wrap: anywhere; }
.hand-card.is-selected { outline: 2px solid #ffd797; outline-offset: 1px; background: linear-gradient(115deg, #4b3325, #2a1f18 75%); }
.hand-card:hover:not(:disabled) { filter: brightness(1.17); }
.hand-card:disabled { opacity: .58; }
.hand-cost { color: var(--gold); font-size: 11px; }
.hand-stats { color: #d9bc9d; font-size: 11px; }
.result-banner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 13px; margin-bottom: 12px; }

.main[data-page="battle"]:has(.scoreboard) { padding-top: 13px; }
.main[data-page="battle"]:has(.scoreboard) .page-heading {
  position: relative;
  align-items: center;
  gap: 4px 10px;
  margin-bottom: 10px;
  padding-bottom: 9px;
}
.main[data-page="battle"]:has(.scoreboard) .page-heading > div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0 13px;
}
.main[data-page="battle"]:has(.scoreboard) .page-heading h1 {
  margin: 0;
  font-size: clamp(20px, 3vw, 30px);
}
.main[data-page="battle"]:has(.scoreboard) .page-description {
  grid-column: 2;
  font-size: 12px;
}
.board, .battle-sidebar { gap: 9px; }
.score-side { grid-template-columns: auto auto; justify-content: start; }
.score-resources { grid-column: 1 / -1; }
.base { display: flex; align-items: center; gap: 7px 12px; padding: 6px 9px; }
.base h3 { flex: none; }
.base-units { flex: 1; min-height: 29px; padding: 0; align-items: center; }
.field-effect { min-height: 22px; }
.field-units { padding-bottom: 0; }
.unit-row { min-height: 33px; }

@media (max-width: 920px) {
  .masthead-inner { gap: 13px; }
  .battle-layout { grid-template-columns: minmax(0, 1fr); }
  .battle-sidebar { grid-template-columns: repeat(auto-fit, minmax(min(225px, 100%), 1fr)); }
  .log { max-height: 190px; }
}

@media (max-width: 710px) {
  .masthead-inner { grid-template-columns: 1fr 1fr; min-height: auto; gap: 0 8px; }
  .brand, .wallet { align-self: center; margin-block: 11px 5px; }
  .site-nav { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; }
  .site-nav button { flex: 1; min-height: 41px; padding-inline: 2px; font-size: 13px; }
  .site-nav button:is([aria-current="page"], .is-active)::after { inset-inline: 0; }
  .brand-mark { width: 28px; height: 29px; font-size: 18px; }
  .brand-name { font-size: 21px; }
  .hero { min-height: 444px; background-position: 0 0, 0 0, 61% 53%, center; }
  .hero-content { width: 80%; padding-left: 27px; }
  .hero h1 { font-size: clamp(60px, 12.5vw, 88px); }
  .hero-caption { right: 20px; bottom: 18px; font-size: 11px; }
  .chapter-grid { grid-template-columns: 1fr; gap: 7px; }
  .chapter-tile { min-height: 0; padding: 10px; }
  .metric { flex-direction: column; align-items: center; gap: 6px; padding-block: 13px; }
  .collection-grid { grid-template-columns: repeat(auto-fill, minmax(min(130px, 100%), 1fr)); gap: 8px; }
  .main[data-page="battle"]:has(.scoreboard) .page-heading > div { gap: 0 8px; }
  .main[data-page="battle"]:has(.scoreboard) .page-heading .eyebrow { font-size: 10px; }
  .main[data-page="battle"]:has(.scoreboard) .page-heading > .status-pill { display: none; }
  .score-side { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 420px) {
  .hero {
    background-image:
      linear-gradient(90deg, #1f1412f7, #221613bd 54%, #241a1540),
      linear-gradient(0deg, #1b130f88, transparent 37%),
      url("./assets/court.webp"),
      radial-gradient(ellipse at 76% 39%, #a7663c, #694230 21%, #1f1815 58%);
  }
  .hero-content { width: 88%; }
  .hero-actions { gap: 8px; }
  .hero .btn { min-width: 0; }
  .hero-caption { display: none; }
  .metric small { font-size: 11px; }
  .field, .base { padding: 6px; }
  .field-head h3 { font-size: 15px; }
  .footer { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
