:root {
  color-scheme: dark;
  --bg: #11241f;
  --fol: #19392f;
  --paper: #f0ead9;
  --muted: #acc0b3;
  --gold: #d5ac66;
  --ink: #1b3027;
  --rule: #435a49;
  --serif: Georgia, 'Batang', '바탕', serif;
  font:
    16px/1.5 'Malgun Gothic',
    'Apple SD Gothic Neo',
    system-ui,
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 85% 10%, #284a38aa, transparent 49%), var(--bg);
  color: #f3eee0;
  min-height: 100vh;
}
button,
input,
select {
  font: inherit;
}
button,
select,
input {
  border: 1px solid #607361;
  background: #203b30;
  color: inherit;
  border-radius: 5px;
}
button {
  cursor: pointer;
}
button:hover {
  border-color: var(--gold);
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid #f2ce80;
  outline-offset: 3px;
}
.mast {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
  padding: 0 max(5vw, 24px);
  background: #11271feb;
}
.brand,
.mast nav,
.player,
.launch,
.hand-heading,
.section-label {
  display: flex;
  align-items: center;
}
.brand {
  font: bold 25px var(--serif);
  gap: 14px;
}
.brand i {
  width: 1px;
  height: 18px;
  background: var(--rule);
}
.brand small {
  font: 14px sans-serif;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.sigil {
  color: var(--gold);
  font: 34px Georgia;
}
.mast nav {
  gap: 6px;
}
.mast nav button,
.text-btn {
  background: none;
  border: 0;
  padding: 7px 10px;
  font-size: 14px;
  color: #d3dbc9;
}
.mast nav button:hover,
.text-btn:hover {
  color: #ffe2a3;
  text-decoration: underline;
}
.hall {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-rows: auto auto;
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 5% 48px;
  position: relative;
}
.hall-intro {
  grid-column: 1;
  grid-row: 1;
  padding: 10px 0 36px;
}
.overline {
  margin: 0 0 15px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.15em;
  display: flex;
  gap: 12px;
  align-items: center;
}
.overline i {
  width: 20px;
  height: 1px;
  background: var(--gold);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
.hall h1,
.mull h1,
.interlude h1 {
  font: clamp(44px, 6vw, 86px) / 1.1 var(--serif);
  letter-spacing: -0.06em;
  margin: 20px 0 24px;
}
.intro {
  color: #c2d0c3;
  font-size: 18px;
  line-height: 1.75;
}
.hall-art {
  grid-column: 2;
  grid-row: 1/3;
  align-self: start;
  position: relative;
  height: 440px;
  pointer-events: none;
}
.halo {
  position: absolute;
  width: 78%;
  aspect-ratio: 1;
  border: 1px solid #c6ab6a33;
  top: 8%;
  left: 8%;
  border-radius: 50%;
  outline: 1px solid #c6ab6a22;
  outline-offset: 12px;
}
.fan {
  position: absolute;
  width: 54%;
  max-width: 230px;
  box-shadow: 7px 15px 26px #07100c72;
  border-radius: 8px;
}
.fan.front {
  left: 9%;
  top: 24%;
  transform: rotate(-13deg);
}
.fan.back {
  left: 38%;
  top: 13%;
  transform: rotate(14deg);
}
.paper {
  height: 100%;
  border: 1px solid #c8b289;
  border-radius: 6px;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  padding: 6px;
  box-shadow: inset 0 0 0 2px #d3c8ac;
}
.paper canvas,
.permanent canvas,
.deck-tile canvas {
  display: block;
  width: 100%;
  height: auto;
}
.card-cap {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 2px 5px;
  font-size: 12px;
  color: #5c5845;
}
.card-cap b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: #814c35;
  color: #fff0cc;
  border-radius: 50%;
  font: bold 16px Georgia;
}
.blue .card-cap b {
  background: #375655;
}
.card-copy {
  padding: 8px 4px 6px;
}
.card-copy strong {
  font: 700 16px/1.35 var(--serif);
  display: block;
}
.card-copy p {
  font-size: 14px;
  line-height: 1.6;
  margin: 7px 0;
}
.fan .paper {
  padding: 11px;
  border-radius: 8px;
}
.fan canvas {
  width: 100%;
  height: 150px;
  object-fit: cover;
  margin: 4px 0;
}
.fan .card-copy {
  padding: 12px 7px 18px;
}
.fan strong {
  font-size: 21px;
}
.prepare {
  grid-row: 2;
  grid-column: 1/3;
  border-top: 1px solid var(--rule);
  margin-top: 64px;
  padding-top: 22px;
  z-index: 1;
}
.section-label {
  justify-content: space-between;
  margin-bottom: 10px;
}
.section-label h2,
.hand-heading h2 {
  font: 22px var(--serif);
  margin: 0;
}
.decks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.deck-tile {
  display: flex;
  align-items: center;
  text-align: left;
  padding: 10px;
  gap: 16px;
  min-height: 100px;
  background: #1a3129;
  border-color: #46614f;
}
.deck-tile.selected {
  background: #304334;
  border: 1px solid var(--gold);
}
.deck-tile canvas {
  width: 26%;
  max-width: 120px;
  aspect-ratio: 1.45;
  object-fit: cover;
  border: 1px solid #d0af7055;
}
.deck-tile small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.deck-tile strong {
  display: block;
  font: 22px var(--serif);
  margin: 4px 0;
}
.deck-tile em {
  font-style: normal;
  color: #c0caba;
  font-size: 13px;
}
.deck-tile i {
  margin: 0 6px 0 auto;
  display: grid;
  place-items: center;
  font-style: normal;
  width: 22px;
  height: 22px;
  border: 1px solid #7a8c74;
  border-radius: 50%;
  color: var(--gold);
  flex-shrink: 0;
}
.selected i {
  border-color: var(--gold);
}
.launch {
  margin-top: 23px;
  gap: 12px;
  flex-wrap: wrap;
}
.launch label {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  margin-right: auto;
}
select,
input[type='search'] {
  padding: 10px 14px;
}
.primary,
.secondary {
  padding: 11px 24px;
  border-radius: 4px;
  font-weight: 700;
}
.primary {
  background: #e6c682;
  color: #202d23;
  border-color: #f0d597;
}
.primary:hover {
  background: #f4d89d;
  color: #12261c;
}
.secondary {
  background: #234235;
  border-color: #738574;
}
.loading,
.interlude,
.mull {
  max-width: 1200px;
  margin: auto;
  padding: 60px 5%;
}
.mull h1,
.interlude h1 {
  font-size: 46px;
}
.mull > p:not(.overline),
.interlude p {
  color: var(--muted);
}
.mull-cards {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0;
}
.mull-card,
.hand-card {
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
}
.mull-card {
  width: 180px;
}
.mull-card[aria-pressed='true'] {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.mull-card[aria-pressed='true'] .paper {
  background: #dccca9;
}
.arena {
  max-width: 1500px;
  margin: auto;
  padding: 22px 4vw 32px;
}
.arena-title .overline {
  margin: 0 0 4px;
}
.arena-title h1 {
  font: clamp(21px, 3vw, 34px) / 1.3 var(--serif);
  margin: 0 0 18px;
}
.arena-title i {
  font-style: italic;
  font-size: 0.59em;
  color: var(--gold);
  margin: 0 7px;
}
.battle-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 25%);
  gap: 18px;
}
.mat {
  border: 1px solid #677a61;
  border-radius: 8px;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #315542, #254437 65%, #213d31);
  display: flex;
  flex-direction: column;
}
.player {
  gap: 12px;
  padding: 9px 15px;
  background: #152f26da;
}
.player.current {
  box-shadow: inset 3px 0 var(--gold);
}
.avatar {
  width: 38px;
  height: 38px;
  border: 1px solid #ad955e;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 23px var(--serif);
  color: #e8ce91;
  background: #324837;
}
.player-name b,
.stat b {
  display: block;
}
.player-name small,
.stat small {
  font-size: 12px;
  color: var(--muted);
}
.player-name b {
  font: 17px var(--serif);
}
.stat {
  padding-left: 12px;
  border-left: 1px solid var(--rule);
}
.stat b {
  font: 700 17px Georgia;
  color: #efd7b0;
}
.stat i {
  font: 13px Georgia;
  color: #9fb19c;
}
.counts {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}
.counts button {
  font-size: 12px;
  padding: 0;
}
.field {
  min-height: 108px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px;
  flex-wrap: wrap;
  flex: 1;
}
.empty-board {
  font: 15px var(--serif);
  letter-spacing: 0.06em;
  color: #a5b6a49e;
  margin: auto;
}
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  font-size: 12px;
  color: #ccc298;
}
.divider:before,
.divider:after {
  content: '';
  height: 1px;
  background: #8b9e7880;
  flex: 1;
}
.permanent {
  background: #e7e0c9;
  color: #26372a;
  border: 1px solid #b4a987;
  width: clamp(75px, 7.7vw, 110px);
  padding: 3px;
  text-align: left;
}
.permanent canvas {
  height: 33px;
  object-fit: cover;
}
.permanent b,
.permanent span,
.permanent small {
  display: block;
  line-height: 1.35;
  padding: 1px 3px;
}
.permanent b {
  font-size: 12px;
}
.permanent span {
  font-size: 12px;
}
.permanent small {
  font-size: 10px;
  color: #53604d;
}
.permanent.ready,
.hand-card.ready .paper {
  outline: 2px solid #d9b970;
  outline-offset: 1px;
}
.rail {
  background: #172e26;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 16px;
  align-self: stretch;
  min-width: 0;
}
.rail h2 {
  font: 20px/1.4 var(--serif);
  margin: 0 0 12px;
}
.rail .overline {
  margin-bottom: 7px;
}
.rail .primary {
  width: 100%;
  padding: 8px;
}
.rail h3 {
  font-size: 15px;
  margin-bottom: 4px;
}
.rail h3 b {
  color: var(--gold);
  margin-left: 8px;
}
.stack,
.log {
  border-top: 1px solid var(--rule);
  padding-top: 9px;
  margin-top: 12px;
}
.stack ol,
.history {
  padding-left: 18px;
}
.stack ol {
  max-height: 100px;
  overflow: auto;
  margin: 0;
}
.stack li small,
.stack li b,
.stack li em {
  display: block;
  font-size: 12px;
}
.stack li em {
  color: var(--gold);
}
.stack p,
.log p {
  font-size: 13px;
  color: #bfcebf;
  margin: 4px 0;
}
.log .text-btn {
  padding: 4px 0;
}
.hand-heading {
  gap: 12px;
  margin: 18px 0 10px;
}
.hand-heading span {
  font-size: 13px;
  color: var(--muted);
}
.hand {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 4px 3px 12px;
}
.hand-card {
  width: clamp(108px, 11vw, 160px);
  flex-shrink: 0;
}
.hand-card .card-copy strong {
  font-size: 14px;
}
.hand-card .card-cap {
  font-size: 10px;
}
.hand-card canvas {
  max-height: 55px;
  object-fit: cover;
}
.hand-card .paper:hover {
  background: #ffefc7;
}
.choices,
.action-options {
  display: grid;
  gap: 5px;
  max-height: 32vh;
  overflow: auto;
}
.choice {
  padding: 8px 11px;
  font-size: 14px;
  text-align: left;
  color: #e1e8d9;
}
.choices:not(:empty) {
  margin: 8px 0;
}
dialog {
  width: min(760px, 94vw);
  max-height: 84vh;
  padding: 20px;
  color: #e9eddf;
  background: #1c342b;
  border: 1px solid #788b71;
  border-radius: 8px;
  box-shadow: 0 28px 100px #0009;
}
dialog::backdrop {
  background: #06110dbe;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 16px;
  padding-bottom: 10px;
}
.dialog-head h2 {
  font: 23px var(--serif);
  margin: 0;
}
.dialog-head button {
  padding: 4px 12px;
}
.inspect {
  display: grid;
  grid-template-columns: minmax(175px, 34%) 1fr;
  gap: 22px;
}
.inspect .paper {
  height: auto;
  align-self: start;
}
.inspect .action-options {
  max-height: 47vh;
}
.muted,
.filters label,
.rulebook p,
.history {
  color: var(--muted);
}
.catalogue {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.catalogue article {
  padding: 12px;
  background: #243e32;
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.catalogue small,
.catalogue strong {
  display: block;
}
.catalogue small {
  color: var(--gold);
  font-size: 12px;
}
.catalogue p {
  font-size: 14px;
  margin: 7px 0 0;
}
.filters {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.filters input[type='search'] {
  flex: 1;
  min-width: 120px;
}
.deck-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.deck-lists h3 {
  color: var(--gold);
  font: 19px var(--serif);
}
.deck-lists p {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  padding-bottom: 4px;
  margin: 6px 0;
}
.rulebook h3 {
  margin: 16px 0 4px;
}
.rulebook p {
  margin: 0;
}
.history li {
  margin: 5px 0;
}
#notice:not(:empty) {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #efe2bd;
  color: var(--ink);
  padding: 10px 20px;
  border-radius: 4px;
  z-index: 5;
}
@media (max-width: 800px) {
  .mast {
    padding: 0 15px;
    height: 62px;
  }
  .brand {
    font-size: 21px;
    gap: 7px;
  }
  .brand small,
  .brand i {
    display: none;
  }
  .mast nav button {
    font-size: 13px;
    padding: 6px;
  }
  .hall {
    padding: 32px 5%;
  }
  .hall-art {
    height: 240px;
  }
  .fan .card-copy {
    padding: 4px;
  }
  .fan canvas {
    height: 80px;
  }
  .fan strong {
    font-size: 15px;
  }
  .fan .card-cap span {
    font-size: 9px;
  }
  .prepare {
    margin-top: 15px;
  }
  .decks {
    gap: 9px;
  }
  .deck-tile {
    gap: 9px;
  }
  .deck-tile strong {
    font-size: 17px;
  }
  .deck-tile em {
    font-size: 12px;
  }
  .battle-grid {
    grid-template-columns: 1fr;
  }
  .rail {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
  }
  .rail h2 {
    grid-column: 1;
    margin: 0;
  }
  .rail > .overline {
    grid-column: 1/3;
  }
  .rail .choices {
    grid-column: 1/3;
  }
  .rail .primary {
    grid-column: 2;
    grid-row: 2;
  }
  .stack,
  .log {
    margin-top: 5px;
  }
  .mull-card {
    width: 145px;
  }
  .arena {
    padding: 14px;
  }
  .player {
    gap: 9px;
  }
  .hand-card {
    width: 112px;
  }
}
@media (max-width: 520px) {
  .hall {
    grid-template-columns: 1.2fr 0.8fr;
  }
  .hall-intro {
    padding: 4px 0 8px;
  }
  .hall-intro .overline {
    font-size: 10px;
  }
  .hall h1 {
    font-size: 41px;
  }
  .intro {
    font-size: 14px;
  }
  .hall-art {
    height: 200px;
  }
  .fan {
    width: 65%;
  }
  .fan.front {
    left: 0;
  }
  .fan.back {
    left: 33%;
  }
  .fan .card-cap b {
    width: 15px;
    height: 15px;
    font-size: 11px;
  }
  .fan .card-cap span {
    display: none;
  }
  .fan .paper {
    padding: 4px;
  }
  .fan canvas {
    height: 48px;
  }
  .fan strong {
    font-size: 11px;
  }
  .decks {
    grid-template-columns: 1fr;
  }
  .deck-tile {
    min-height: 62px;
    padding: 6px;
  }
  .deck-tile canvas {
    width: 67px;
    height: 48px;
  }
  .deck-tile small {
    display: none;
  }
  .deck-tile strong {
    margin: 0;
  }
  .launch label {
    width: 100%;
  }
  .launch .primary {
    flex: 1;
  }
  .player {
    flex-wrap: wrap;
    padding: 7px;
  }
  .counts {
    width: 100%;
    margin-left: 0;
  }
  .hand-heading h2 {
    font-size: 19px;
  }
  .inspect {
    grid-template-columns: 1fr;
  }
  .inspect .paper {
    max-width: 208px;
  }
  .deck-lists,
  .catalogue {
    grid-template-columns: 1fr;
  }
  .mull {
    padding: 24px 14px;
  }
  .mull-card {
    width: calc(50% - 7px);
  }
  .rail {
    padding: 12px;
  }
  .hall-art .halo {
    top: 30px;
  }
  .brand .sigil {
    font-size: 26px;
  }
}

/* Give the artwork its own row height, including the rotated card corners. */
.hall-art {
  grid-row: 1;
  height: 360px;
}
.fan.front {
  top: 13%;
}
.fan.back {
  top: 2%;
}
.prepare {
  margin-top: 36px;
}
@media (max-width: 800px) {
  .hall-art {
    height: 228px;
  }
  .prepare {
    margin-top: 16px;
  }
}
@media (max-width: 520px) {
  .hall {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.75fr);
    column-gap: 10px;
  }
  .hall h1 {
    font-size: clamp(32px, 9.5vw, 41px);
  }
  .hall-art {
    height: 172px;
  }
  .fan.front {
    top: 34%;
    left: 4%;
  }
  .fan.back {
    top: 20%;
    left: 30%;
  }
  .prepare {
    margin-top: 22px;
  }
}

.decks label { display: grid; gap: 6px; min-width: 0; }
.decks select { width: 100%; }
.catalogue .paper { height: auto; }
.workshop { max-width: 1360px; margin: 0 auto; padding: clamp(14px,3vw,42px); }
.workshop header { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.workshop h1 { font:700 clamp(30px,4vw,50px)/1.2 var(--serif); margin:12px 0 20px; }
.workshop h2 { font:700 23px/1.3 var(--serif); margin:16px 0 12px; }
.recipe-shelf { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:10px; }
.recipe-tile { display:grid; gap:9px; text-align:left; padding:16px; background:#253e32; }
.recipe-tile small,.recipe-panel small { color:#dbcba8; }
.builder-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(250px,31%); gap:22px; align-items:start; }
.builder-filters { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
.builder-filters input { flex:1 1 160px; min-width:0; }
#collection-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(165px,1fr)); gap:9px; max-height:72vh; overflow:auto; padding:3px; }
.collection-card { display:flex; flex-direction:column; padding:4px; text-align:left; background:#324638; }
.collection-card .paper { width:100%; height:auto; flex:1; }
.collection-card > span { align-self:end; padding:5px 7px; font-size:12px; }
.collection-card[aria-disabled=true] > span { color:#c4c4b5; }
.recipe-panel { padding:16px; background:#22392e; border:1px solid var(--rule); border-radius:8px; }
.recipe-panel label { display:grid; gap:4px; margin-bottom:10px; }
.recipe-panel input,.recipe-panel select { min-width:0; width:100%; padding:8px; }
#recipe-lines { max-height:40vh; overflow:auto; }
#recipe-lines button { width:100%; display:flex; align-items:center; gap:8px; text-align:left; padding:6px 8px; }
#recipe-lines b { margin-left:auto; white-space:nowrap; }
@media(max-width:720px) {
  .builder-layout { display:flex; flex-direction:column; }
  .collection,.recipe-panel { width:100%; }
  #collection-list { max-height:49vh; grid-template-columns:repeat(2,minmax(0,1fr)); }
  #recipe-lines { max-height:30vh; }
}
/* Illustrated table and card faces */
.hall { max-width:none; min-height:calc(100svh - 72px); display:flex; flex-direction:column; justify-content:flex-end; align-items:flex-start; padding:clamp(20px,5vw,74px); background:linear-gradient(0deg,#0a171af2 0%,#101c1a80 33%,transparent 70%),url('/art/table.webp') center 38%/cover; }
.hall-intro {padding:0}.hall h1 {color:#fff0c5;text-shadow:0 3px 18px #15100d;margin:12px 0;font-size:clamp(42px,7vw,96px)}
.prepare {margin:0; width:min(100%,720px);background:#12231de8;padding:clamp(12px,2vw,24px);border:1px solid #97774f88;border-radius:14px}
.section-label {justify-content:flex-start;flex-wrap:wrap;gap:6px}
.card-art {display:block; width:100%; object-fit:cover; aspect-ratio:1; pointer-events:none; user-select:none}
.paper {position:relative;isolation:isolate;padding:0!important;overflow:hidden;color:#fff0cd;background:#1c221d!important;border:2px solid #aa8651;border-radius:10px;box-shadow:0 3px 9px #05090788}
.paper .card-art {width:100%;height:auto;max-height:none}
.paper .card-cap {position:absolute;top:5px;left:5px;z-index:2;padding:0;background:none;border:0}
.paper .card-cap span {display:none}.paper .card-cap b {background:#193f62;border:2px solid #bbd0c8;color:white;border-radius:50%;min-width:27px;height:27px;display:grid;place-items:center;line-height:1;font:bold 18px Georgia}
.paper .card-copy {padding:19px 6px 6px;background:linear-gradient(0deg,#081510 3%,#101711cf 60%,transparent);position:absolute;inset:auto 0 0;text-align:center}
.paper .card-copy strong {font:700 clamp(12px,1.3vw,17px)/1.22 var(--serif);color:#fff5d5;text-shadow:0 1px 3px #000}
.inspect .paper,.card-detail .paper {height:auto;max-width:320px;margin:auto}
.inspect .paper .card-copy,.card-detail .paper .card-copy {position:static;background:#222c26;padding:12px}
.inspect .card-copy p,.card-detail .card-copy p {color:#f4e7c8;text-align:left}
.catalogue {grid-template-columns:repeat(auto-fill,minmax(110px,1fr))}
.catalog-tile,.collection-card,.mull-card,.hand-card {padding:0;border:0;background:transparent}
.collection-slot {position:relative;min-width:0}.collection-slot .collection-card {width:100%;display:block}
.info-pin {position:absolute;right:5px;top:5px;border-radius:50%;background:#14261dd9;color:#ffedbd;padding:2px 7px}
.collection-card > span {display:block;text-align:center;font-size:11px;padding:2px}
#collection-list {grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:9px}
#recipe-lines img {width:40px;height:33px;border-radius:4px}
.recipe-tile img {width:64px;height:56px;grid-row:span 2;border-radius:6px}.recipe-tile:has(img){grid-template-columns:64px 1fr;align-items:center}
.arena {max-width:1340px;padding:8px clamp(6px,2vw,28px) 14px;}
.arena-title h1 {font-size:16px;margin:2px 0 6px;color:#e8d5b0}
.battle-grid {grid-template-columns:minmax(0,1fr) minmax(145px,19%);gap:8px}
.mat {background:linear-gradient(#102327bd,#283e36d9,#142a27c9),url('/art/table.webp') center/cover;border:2px solid #967648;border-radius:17px;box-shadow:inset 0 0 42px #080f0d}
.player {flex-wrap:nowrap;gap:6px;padding:4px 8px;background:#111e1cdb}.avatar {width:48px;height:48px;overflow:hidden;border:2px solid #b79464;flex-shrink:0}
.player-name b {font-size:13px}.counts {width:auto;font-size:11px}
.field {min-height:clamp(75px,14vh,138px);padding:6px;gap:5px;justify-content:center}
.permanent {border:2px solid #9e8052;border-radius:12px;overflow:hidden;padding:0;background:#18211e;color:#ffecc8;text-align:center;width:clamp(60px,7vw,98px);position:relative}
.permanent .card-art {height:clamp(45px,7.5vh,82px)}.permanent b,.permanent span {font-size:11px}.permanent small {color:#c6c5b5;font-size:9px}
.rail {padding:8px}.rail h2 {font-size:15px}.log {display:flex;justify-content:space-between;gap:6px}.stack ol {max-height:140px}.stack li {list-style:none}.stack li .card-art {float:left;width:32px;height:36px;margin-right:3px}
.hand-heading {margin:5px 0}.hand-heading h2 {font-size:14px}.hand {gap:6px;flex-wrap:wrap;overflow:visible;justify-content:center}
.hand-card {width:clamp(65px,8vw,112px)}.hand-card .paper {height:auto}.hand-card.ready,.permanent.ready {cursor:grab}
.mull-card {width:clamp(94px,17vw,185px)}.mull-card[aria-pressed=true] {filter:saturate(.45)}.mull-card[aria-pressed=true]::after{content:'↻';font-size:24px;color:#ffe6a2}
#swap-zone {padding:12px;margin:8px auto;border:1px dashed #b49963;width:fit-content;border-radius:8px}
.hand-card,.permanent,.mull-card,#recipe-lines button {touch-action:none;user-select:none}
.collection-card {touch-action:pan-y}.collection-card > span {touch-action:none;cursor:grab}
.drop-ready {outline:2px dashed #ffd775!important;outline-offset:-3px;box-shadow:inset 0 0 16px #e6b74955}
.drop-over {outline:3px solid #fff0a1!important;background-color:#91824d99!important}
.dragging,.dragging * {cursor:grabbing!important;user-select:none}
.lifting {opacity:.46}.drag-ghost {position:fixed;z-index:10000;pointer-events:none;width:64px;transform:translate(-45%,-68%) rotate(-6deg);border:2px solid #ffdf93;border-radius:9px;overflow:hidden;box-shadow:0 8px 18px #0009}
.choices .choice img {width:32px;height:32px;display:inline-block;vertical-align:middle;margin-right:6px}
@media(max-width:720px){
  .hall{padding:14px;justify-content:flex-end;background-position:49% center}.hall .decks{grid-template-columns:1fr 1fr}.hall h1{font-size:44px}
  .battle-grid {display:flex;flex-direction:column;gap:4px}.rail{display:flex;flex-wrap:wrap;gap:5px;align-items:center;justify-content:space-between}.rail>.overline,.arena-title{display:none}.rail h2{font-size:12px;margin:0}.rail .primary{width:auto}.rail .log{margin:0;padding:0;border:0}.rail .choices:not(:empty){width:100%;display:flex;overflow-x:auto}
  .player-name b{max-width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.counts{font-size:10px}.player{gap:4px}.avatar{height:32px;width:32px}.stat{padding-left:4px}.stat small{font-size:10px}
  .field {min-height:68px}.permanent{width:54px}.permanent .card-art{height:42px}.permanent small{display:none}
  .hand {justify-content:flex-start}.hand-card {width:calc((100% - 30px)/6);min-width:49px}.hand-card .card-cap b {font-size:12px;min-width:17px;height:17px}.hand-card .card-copy strong{font-size:10px}
  #collection-list,.catalogue{grid-template-columns:repeat(3,minmax(0,1fr))}.builder-layout{gap:8px}
}
.sample-cards {display:grid;grid-template-columns:repeat(auto-fit,minmax(100px,1fr));gap:8px;}
.sample-cards>div {position:relative;}
.sample-cards>div>b {position:absolute;right:4px;top:4px;background:#14271a;color:#ffefc3;padding:3px 6px;border-radius:20px;}
.choice-target {outline:3px solid #f7cb67!important;cursor:pointer;}
.sample-cards .paper {height:auto}
.face-stats {display:block;color:#ffeabd;font:700 11px/1.2 system-ui;margin-top:3px}
.stat,.counts,.permanent span {white-space:nowrap}
.permanent b {overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.rail .choices:not(:empty) .choice {text-align:left;padding:7px 9px}
@media (max-width:720px){
 .player {display:grid;grid-template-columns:34px minmax(64px,1fr) auto auto;align-items:center;gap:2px 8px;padding:5px 9px}
 .player .avatar {grid-row:span 2}.player .player-name{grid-row:span 2}
 .player .player-name small,.player .player-name b{display:block;white-space:nowrap;max-width:100px;overflow:hidden;text-overflow:ellipsis}
 .player .stat {display:flex;gap:4px;align-items:center;border:0;justify-content:end}
 .player .counts{grid-column:3/5;text-align:right}.player .stat b{font-size:17px}.player .stat i{font-size:11px}
 .permanent {width:clamp(55px,16vw,78px)}.permanent .card-art{height:clamp(49px,14vw,70px)}
 .field {min-height:84px}.hand-card{width:calc((100% - 24px)/5)}
 .hand-card .face-stats {font-size:9px}.hand .card-copy{padding:15px 2px 3px}
 .hand .card-cap{top:2px;left:2px}.rail .log button {min-height:34px;padding:4px}
}

.motion-layer{position:fixed;inset:0;pointer-events:none;z-index:220;overflow:hidden}
.motion{position:absolute;transform:translate(-50%,-50%);pointer-events:none}
.flying-card{width:clamp(52px,7vw,88px);aspect-ratio:4/5;overflow:hidden;border:2px solid #f9da89;border-radius:9px;background:#452e27;color:#ffdf94;box-shadow:0 6px 24px #070e13aa;display:grid;place-items:center;font-size:30px}
.flying-card .card-art{height:100%}.draw-flight{background:repeating-linear-gradient(45deg,#2d534d 0 3px,#294038 3px 7px)}
.attack-trail{height:5px;transform-origin:0 50%;background:linear-gradient(90deg,transparent,#ffdd77,#fff2ce);box-shadow:0 0 12px #ffac57}
.hit-number,.heal-number{z-index:2;font:900 clamp(29px,4.5vw,56px)/1 Georgia;color:#fff0da;text-shadow:-2px -2px #691e18,2px 2px #671a12,0 3px 10px #000}
.heal-number{color:#ceffdc;text-shadow:2px 2px #164d35,0 2px 6px #000}
.impact-ring{width:76px;height:76px;border-radius:50%;border:4px solid #ffd9a4;box-shadow:0 0 24px #e96c32,inset 0 0 17px #ec6b39}
.impact-ring.healing{border-color:#c0ffd8;box-shadow:0 0 22px #44cd89}
.finish{position:relative;isolation:isolate;overflow:hidden;min-height:calc(100svh - 70px);display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;background:linear-gradient(#0d1b1bd9,#171911f0),url('/art/table.webp') center/cover}
.finish-rays{position:absolute;z-index:-1;width:min(125vw,940px);aspect-ratio:1;border-radius:50%;background:repeating-conic-gradient(from 3deg,transparent 0deg 9deg,#f5cb703d 11deg 14deg,transparent 18deg 24deg);mask-image:radial-gradient(closest-side,#0007,transparent);animation:rays 19s linear infinite}
.finish-seal{width:clamp(140px,22vw,220px);position:relative;animation:seal-arrives .72s cubic-bezier(.2,1.3,.4,1) both}
.finish-seal img{border-radius:50%;border:5px double #eacd81;box-shadow:0 0 45px #c6973877}
.finish-seal b{position:absolute;bottom:-20px;left:50%;transform:translateX(-50%);font:50px/1 Georgia;color:#ffe295;text-shadow:0 2px 8px #201508}
.finish h1{font:700 clamp(54px,11vw,110px)/1 var(--serif);color:#ffe5aa;letter-spacing:.1em;margin:30px 0 6px;animation:banner-arrives .55s .15s both}
.finish p{color:#ddd3ae}.finish button{margin:4px}.lost .finish-rays{background:repeating-conic-gradient(transparent 0deg 10deg,#9a84952b 15deg 22deg)}
.lost .finish-seal{filter:saturate(.25)}.lost h1,.draw h1{color:#ddd5cc}
@keyframes seal-arrives{from{opacity:0;transform:scale(.52) translateY(20px)}to{opacity:1;transform:none}}
@keyframes banner-arrives{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@keyframes rays{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.finish *{animation:none!important}}

#card-preview{position:fixed;inset:auto;margin:0;box-sizing:border-box;width:min(286px,calc(100vw - 12px));max-height:calc(100dvh - 10px);overflow:auto;padding:12px;pointer-events:none;border:1px solid #ab935f;border-radius:10px;color:#fff0d3;background:#101c19fa;box-shadow:0 8px 34px #000a;z-index:9999}
#card-preview header{display:flex;gap:10px;align-items:center;margin:0 0 9px}#card-preview header img{width:64px;height:68px;border-radius:5px}#card-preview strong{display:block;font-size:17px}#card-preview p{font-size:14px;line-height:1.55;margin:7px 0 0}#card-preview small,#card-preview footer{font-size:12px;color:#ddcba6}
.chapter-badge{display:inline-flex!important;align-self:start;border:1px solid currentColor;border-radius:12px;padding:2px 6px!important;font:600 11px/1.35 system-ui;text-align:left}
.chapter-badge.main{color:#a9eacd;background:#183e32}.chapter-badge.common{color:#ecdcb2;background:#48402c}.chapter-badge.sub{color:#ddd0ff;background:#392c50}.chapter-badge.outside{color:#c2bfbc;background:#323331}
.collection-card{display:flex!important;align-items:stretch;gap:3px;height:100%}.collection-card .paper{flex:none}.collection-card .chapter-badge{margin:1px 4px}.collection-card .face-stats{display:none}
.readout{display:flex!important;align-items:center;align-self:stretch!important;justify-content:flex-start;gap:6px;padding:2px 5px!important;flex-wrap:wrap;color:#f1e6ce}.readout b{font:700 12px/1.3 system-ui}
.readout .mana-chip,.stat-key span:first-child{color:#abd6ff}.readout .attack-chip,.stat-key span:nth-child(2){color:#ffdc8c}.readout .life-chip,.stat-key span:last-child{color:#ffbdb3}
.stat-key,.chapter-totals{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 8px;font-size:12px}.add-count{margin-top:auto}.recipe-card-copy{display:grid;justify-items:start;gap:2px}.recipe-card-copy strong{text-align:left}.recipe-card-copy .readout{padding:0!important}.recipe-panel #recipe-lines .readout b{margin:0}
.cost-curve{display:flex;align-items:flex-end;gap:3px;margin:6px 0 10px}.cost-curve>div{flex:1;display:grid;justify-items:center;align-content:end;gap:1px}.cost-curve i{display:block;width:80%;background:#76a9be;border-radius:2px 2px 0 0}.cost-curve b,.cost-curve small{font-size:10px;color:#d6d8c9}.cost-curve small{border-top:1px solid #5d706c;width:100%;text-align:center}
@media(max-width:720px){.chapter-badge{font-size:10px}.readout{gap:4px}.readout b{font-size:11px}.log{flex-wrap:wrap}.log button{font-size:11px}}
.recent-plays{display:flex;gap:4px;margin:8px 0;align-items:center}.recent-play{position:relative;padding:0;width:44px;border:1px solid #987c4d;border-radius:5px;overflow:hidden;background:#162820;color:#fbefcf}.recent-play img{width:100%;height:31px}.recent-play small{display:block;line-height:1.3;font-size:9px;white-space:nowrap}.player:has(.combat-forecast){position:relative}.combat-forecast,.permanent .combat-forecast{position:absolute;left:50%;top:40%;transform:translateX(-50%);z-index:4;padding:3px 5px;color:#fff3cf;background:#322514f5;border:1px solid #ffe39b;border-radius:5px;font:bold 12px/1.2 system-ui;white-space:nowrap;pointer-events:none}.permanent.lifting:has(.combat-forecast){opacity:.95}
/* Keep the nameplate below the illustration, including long Korean names. */
.hand .paper{display:flex;flex-direction:column;height:100%;background:#19241f!important}
.hand .card-copy{position:static;display:flex;flex:1;flex-direction:column;justify-content:center;background:#19241f;padding:4px 3px}
.hand .card-copy strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;word-break:keep-all;overflow-wrap:anywhere}
.hand .card-art{aspect-ratio:1.35;object-fit:cover}
@media(min-width:721px){
 .field{min-height:clamp(112px,17vh,170px)}
 .permanent{width:clamp(84px,8vw,114px)}
 .permanent .card-art{height:clamp(68px,9.5vh,95px)}
 .hand-card{width:clamp(98px,9.8vw,138px)}
 .arena{padding-top:10px}.hand-heading{margin-top:9px}
 .recent-play{width:clamp(35px,3.6vw,50px)}
}
.choices .choice:has(.choice-copy){display:flex;align-items:center;gap:8px;padding:5px;text-align:left}
.choices .choice .card-art{width:58px;height:62px;flex:none;border-radius:4px;margin:0}
.choice-copy{display:grid;align-content:center;gap:4px}.choice-copy .readout{padding:0!important}
.choices:has(.choice-copy){max-height:min(50vh,400px)}#sample-search{margin-bottom:12px;width:100%}
@media(max-width:720px){.choices .choice:has(.choice-copy){min-width:135px}.choices .choice .card-art{width:42px;height:49px}}
