/* 조선 스쿼드 game site. Pixel rules: art is enlarged by whole numbers only (image-rendering: pixelated),
   animation is frame swaps and whole-pixel moves (steps()), never rotation or scaling.
   Fonts are the game's own (Galmuri for Korean, Ark Pixel for English), shared with the live arena's canvas.

   Sizes are in rem and the root size (--root) is the page's scale: 16 px (1x) on most screens, 24 px (1.5x) on a
   1920 px screen, 32 px (2x) and 48 px (3x) on larger ones. Every length here is a multiple of 0.125rem (2 px at 1x), so each scale lands on
   whole pixels: art drawn at 2 px per art pixel becomes 3, 4 and 6; type set at 20 px becomes 30, 40 and 60.
   Type has two faces and no small print: sentences and labels are the reading face at 1.25rem (its 10 px grid doubled),
   headings the bold face at 1.5 / 2.25 / 3rem (its 12 px grid at 2x, 3x, 4x). Nothing is set at 12 px.

   Widths (media queries are in px of the real screen):
     phone        up to 599   one column, the board and the scene run edge to edge up to 420
     small tablet 600-759     one column, centered
     tablet       760-1099    two columns where the art leaves room for words
     desktop      1100 on     the full layout; from 1800 the whole page is scaled up */

@font-face { font-family: "Galmuri11"; src: url("/joseonsquad/live/assets/Galmuri11-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Galmuri9"; src: url("/joseonsquad/live/assets/Galmuri9.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "ArkPixel10"; src: url("/joseonsquad/live/fonts/ark-pixel-10-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  color-scheme: dark;
  /* the game's night: arena.ts SKY, lacquer, gold leaf, jade and juchil */
  --night: #0a0e25;
  --night-1: #0f1632;
  --night-2: #141d3e;
  --night-3: #1a264c;
  --ink: #05060e;
  --lacquer: #16121f;
  --lacquer-hi: #2e2640;
  --gold: #e8b84a;
  --gold-hi: #ffe27a;
  --gold-lo: #8a6420;
  --red: #c43b30;
  --red-lo: #6e1a14;
  --jade: #1e4047;
  --jade-hi: #7fe8d0;
  --paper: #f4ead8;
  --mute: #aeb4d6;
  /* Galmuri11 is drawn on a 12 px grid, Galmuri9 and Ark Pixel 10 on a 10 px grid: sizes are whole multiples of those */
  --font-head: "Galmuri11", ui-monospace, monospace;
  --font-read: "Galmuri9", "ArkPixel10", ui-monospace, monospace;
  /* the root size: the page's scale (see the top of this file) */
  --root: 16px;
  /* one CSS px at 1x: sprite sizes are art pixels x --s x --px */
  --px: 0.0625rem;
  /* --px per art pixel */
  --s: 2;
}
:lang(en) { --font-read: "ArkPixel10", "Galmuri9", ui-monospace, monospace; }

* { box-sizing: border-box; }
html { font-size: var(--root); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
/* a large screen gets the same page, larger: the tall-enough condition keeps a short, wide window at the size below */
@media (min-width: 1800px) and (min-height: 800px) { :root { --root: 24px; } }
@media (min-width: 2560px) and (min-height: 1200px) { :root { --root: 32px; } }
@media (min-width: 3600px) and (min-height: 1800px) { :root { --root: 48px; } }
body {
  margin: 0;
  background: var(--night);
  color: var(--paper);
  font-family: var(--font-read);
  font-size: 1.25rem;
  line-height: 2rem;
  word-break: keep-all;
  /* a word is never broken to make a column narrower (break-word, not anywhere): a column that cannot hold its
     longest word is a layout to fix, not a place to split "Above" */
  overflow-wrap: break-word;
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-rendering: optimizeSpeed;
}
img, video, canvas { display: block; max-width: 100%; }
.px { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--gold-hi); text-underline-offset: 0.25rem; }
a:focus-visible, button:focus-visible, summary:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 0.125rem solid var(--jade-hi); outline-offset: 0.25rem; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, select { font: inherit; color: inherit; cursor: pointer; }
em, i { font-style: normal; }
[hidden] { display: none !important; }

.skip { position: absolute; left: 1rem; top: -6rem; z-index: 50; padding: 0.5rem 0.75rem; background: var(--gold-hi); color: var(--ink); line-height: 1.75rem; }
.skip:focus { top: 1rem; }

.wrap { width: min(100% - 2rem, 80rem); margin: 0 auto; }
@media (min-width: 860px) { .wrap { width: min(100% - 3rem, 80rem); } }
@media (min-width: 1280px) { .wrap { width: min(100% - 4rem, 80rem); } }
/* a note under the thing it explains: the same size as the text, quieter */
.note { line-height: 1.75rem; color: var(--mute); text-wrap: pretty; }
/* a link standing alone still gets a finger's height */
.note a, footer a { display: inline-flex; align-items: center; min-height: 2.5rem; }
/* short facts in a row: the row breaks between facts first, and each keeps its square */
.facts { display: flex; flex-wrap: wrap; gap: 0 1rem; line-height: 1.75rem; color: var(--mute); }
.facts li { display: flex; align-items: baseline; gap: 0.5rem; min-width: 0; }
/* said only where the plaque beside the button is not shown */
.facts li.narrow-only { display: none; }
.facts li::before { content: ""; flex: none; align-self: center; width: 0.5rem; height: 0.5rem; background: var(--gold); box-shadow: 0 0 0 0.125rem var(--ink); }

/* ---------- lacquer panel: black lacquer, gold rim, ink line ---------- */
.panel {
  background: var(--lacquer);
  border: 0.125rem solid var(--gold);
  box-shadow: 0 0 0 0.125rem var(--ink), inset 0 0 0 0.125rem var(--ink);
}
.chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0 0.5rem;
  line-height: 1.75rem; white-space: nowrap;
  color: var(--paper); background: var(--night-2);
  border: 0.125rem solid var(--night-3);
}
.chip-gold { color: var(--ink); background: var(--gold-hi); border-color: var(--gold-lo); white-space: normal; }

/* ---------- buttons: the game's red plaque ---------- */
.btn {
  /* the words may break between their parts (build.py's label), never inside one */
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 0.5rem;
  max-width: 100%; min-height: 3rem; padding: 0.5rem 1rem;
  font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; line-height: 2rem; text-align: center;
  color: #fff6e8; text-decoration: none; text-shadow: 0 0.125rem 0 var(--red-lo);
  background: var(--red);
  border: 0.125rem solid var(--gold-hi);
  box-shadow: 0 0.25rem 0 var(--red-lo), 0 0 0 0.125rem var(--ink), 0 0.25rem 0 0.125rem var(--ink);
}
.btn span { white-space: nowrap; }
.btn:hover { background: #d9483b; }
.btn:active { transform: translateY(0.25rem); box-shadow: 0 0 0 var(--red-lo), 0 0 0 0.125rem var(--ink); }
.btn-jade { background: #1f7a52; text-shadow: 0 0.125rem 0 #0e3d2a; box-shadow: 0 0.25rem 0 #0e3d2a, 0 0 0 0.125rem var(--ink), 0 0.25rem 0 0.125rem var(--ink); }
.btn-jade:hover { background: #279464; }
.btn-jade:active { box-shadow: 0 0 0 #0e3d2a, 0 0 0 0.125rem var(--ink); }
.btn-ink { background: var(--lacquer-hi); border-color: var(--gold); text-shadow: none; box-shadow: 0 0.25rem 0 var(--ink), 0 0 0 0.125rem var(--ink), 0 0.25rem 0 0.125rem var(--ink); }
.btn-ink:hover { background: #3b3152; }
.btn-ink:active { box-shadow: 0 0 0 var(--ink), 0 0 0 0.125rem var(--ink); }
/* the lesser button: the reading face at the reading size, a lower plaque */
.btn-small { min-height: 2.5rem; padding: 0.25rem 0.75rem; font-family: var(--font-read); font-weight: 400; font-size: 1.25rem; line-height: 1.75rem; text-shadow: none; white-space: nowrap; }
.btn[disabled] { background: var(--lacquer-hi); color: var(--mute); border-color: var(--night-3); text-shadow: none; box-shadow: 0 0.25rem 0 var(--ink), 0 0 0 0.125rem var(--ink), 0 0.25rem 0 0.125rem var(--ink); cursor: default; }
/* Google Play is not out yet: a plaque, not a link */
.soon {
  display: inline-flex; align-items: center;
  min-height: 3rem; padding: 0.25rem 1rem;
  line-height: 1.75rem; text-align: center;
  color: var(--mute); background: var(--lacquer);
  border: 0.125rem dashed var(--night-3);
}

/* ---------- top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  /* a hair short of opaque, on purpose. Chromium without GPU compositing culls what an opaque fixed layer covers, and
     gets the live arena's WebGL canvas wrong once more than half of it has scrolled under the bar: the rest of the
     board goes black although frames are still drawn. A layer that is not fully opaque is never an occluder. */
  background: rgb(5 6 14 / 0.99);
  border-bottom: 0.125rem solid var(--gold-lo);
}
.bar .wrap { display: flex; align-items: center; gap: 1rem; min-height: 3.875rem; }
.bar a { flex: none; white-space: nowrap; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.5rem; color: var(--gold-hi); text-decoration: none; font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; line-height: 2rem; }
.brand img { width: 2rem; height: 2rem; }
.bar nav { margin-left: auto; }
.bar nav ul { display: flex; gap: 1rem; }
.bar nav a { display: inline-block; padding: 0.5rem 0.25rem; line-height: 1.75rem; color: var(--paper); text-decoration: none; }
.bar nav a:hover { color: var(--gold-hi); }
.bar .lang { line-height: 1.75rem; color: var(--mute); text-decoration: none; padding: 0.5rem 0.25rem; }
.bar .lang:hover { color: var(--gold-hi); }
.bar .brand + .lang { margin-left: auto; }
/* the section links are shown only where all of them fit on the line with the name, the language and the button:
   English needs more room than Korean (measured at the widths below, with a margin). Below that the page is one
   scroll, as on a phone. */
@media (max-width: 1279px) {
  .bar nav ul { gap: 0.25rem; }
  .bar .wrap { gap: 0.75rem; }
}
@media (max-width: 859px) {
  .bar nav { display: none; }
  .bar .lang { margin-left: auto; }
  .brand { font-family: var(--font-read); font-weight: 400; font-size: 1.25rem; line-height: 1.75rem; }
}
@media (max-width: 1019px) {
  :lang(en) .bar nav { display: none; }
  :lang(en) .bar .lang { margin-left: auto; }
}
/* a phone's bar with the button in it has no room for the name: the mark alone, the name is the logo right below */
@media (max-width: 479px) {
  .bar .wrap { gap: 0.5rem; }
  .bar-full .brand span { display: none; }
}

/* ---------- sections ---------- */
section { position: relative; }
.sec { padding: 5rem 0; }
.sec-title { margin-bottom: 2rem; font-family: var(--font-head); font-weight: 700; font-size: 2.25rem; line-height: 3rem; color: var(--gold-hi); text-shadow: 0 0.125rem 0 var(--gold-lo), 0.125rem 0 0 var(--ink), -0.125rem 0 0 var(--ink), 0 -0.125rem 0 var(--ink), 0 0.25rem 0 var(--ink); text-wrap: balance; }
.sec-head { display: grid; gap: 0.5rem; margin-bottom: 2rem; max-width: 47.5rem; }
.sec-head .sec-title { margin-bottom: 0; }
.sec-head p { color: var(--paper); text-wrap: pretty; }
@media (max-width: 859px) {
  .sec { padding: 3rem 0; }
  .sec-title { font-size: 1.5rem; line-height: 2rem; margin-bottom: 1.5rem; }
  .sec-head { margin-bottom: 1.5rem; }
}
/* the board under a section: the arena's own lacquer hexes, one 48x80 repeat at 2x */
.on-jade { background: #17353c url("art/stage/floor-jade.png") 0 0 / 6rem 10rem; image-rendering: pixelated; }
.on-red { background: #432028 url("art/stage/floor-red.png") 0 0 / 6rem 10rem; image-rendering: pixelated; }

/* ---------- sprites: one strip, frames swapped whole ---------- */
.spr {
  --u: calc(var(--s) * var(--px));
  display: block; flex: none;
  width: calc(var(--w) * var(--u)); height: calc(var(--h) * var(--u));
  background-image: var(--img); background-repeat: no-repeat;
  background-size: calc(var(--w) * var(--n) * var(--u)) calc(var(--h) * var(--u));
  background-position: calc(var(--f, 0) * var(--w) * var(--u) * -1) 0;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
/* the rosters, the bosses and the faces are fetched when their section comes near (site.js adds .art-on); with no
   script the class "js" is never set and they load with the page */
.js [data-art]:not(.art-on) .spr, .js [data-art]:not(.art-on) .face { background-image: none; }

/* ---------- hero: the title screen ---------- */
.hero { padding-top: 4rem; background: var(--night); overflow: hidden; }
.hero-sky { position: absolute; inset: 0; pointer-events: none; }
.stars { position: absolute; inset: 0 0 auto 0; height: calc(100% - 13rem); background-size: 16rem 16rem; image-rendering: pixelated; }
.stars-a { background-image: url("art/stage/stars-a.png"); }
.stars-b { background-image: url("art/stage/stars-b.png"); background-position: 6rem 4rem; animation: twinkle 3200ms steps(1) infinite; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
/* desktop: the words on the left, the key art on the right */
.hero-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3rem; padding: 3rem 0 2rem; min-height: 35rem; }
.hero-copy { display: grid; gap: 1.5rem; justify-items: start; min-width: 0; }
.hero h1 { width: 100%; }
/* the logo is a painted picture, not grid pixel art (the game draws it filtered at half size): it scales smoothly */
.logo { width: 35rem; height: auto; }
.hero-lead { max-width: 37.5rem; text-wrap: pretty; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.keyart { width: 26.25rem; height: 34.875rem; max-width: none; border: 0.125rem solid var(--gold); box-shadow: 0 0 0 0.125rem var(--ink), 0.5rem 0.5rem 0 var(--ink); }
/* the wall, the gate and the night march along the bottom of the title */
.stage { position: relative; height: 13rem; }
.stage-sky { position: absolute; inset: 0 0 auto 0; height: 5.75rem; background: url("art/stage/sky.png") 0 0 / 0.25rem 5.75rem repeat-x; image-rendering: pixelated; }
.stage-moon { position: absolute; top: 0; right: max(1rem, 50% - 26.25rem); width: 6rem; height: 5.75rem; }
.stage-wall { position: absolute; inset: 5.75rem 0 auto 0; height: 2rem; background: url("art/stage/wall.png") 50% 0 / 5.75rem 2rem repeat-x; image-rendering: pixelated; }
.stage-gate { position: absolute; top: 1.75rem; left: calc(50% - 5.875rem); width: 11.75rem; height: 6rem; max-width: none; }
.stage-floor { position: absolute; inset: 7.75rem 0 0 0; background: #17353c url("art/stage/floor-jade.png") 50% 0 / 6rem 10rem; image-rendering: pixelated; border-bottom: 0.125rem solid var(--gold-lo); }
.march { position: absolute; inset: 0; overflow: hidden; }
.march .spr { position: absolute; left: 0; bottom: 1rem; transform: translateX(calc(var(--x, -400) * 1px)); }
@media (max-width: 1099px) {
  /* tablet: the same two columns, closer; the words keep to the left edge and the logo fills their column */
  .hero-inner { gap: 1.5rem; padding: 2rem 0 1.5rem; min-height: 0; }
  .hero-copy { gap: 1rem; }
  .logo { width: min(100%, 35rem); }
  /* Google Play goes into the row of facts here */
  .hero .soon { display: none; }
  .facts li.narrow-only { display: flex; }
}
@media (max-width: 899px) {
  /* the way in keeps to one line: the reading face at its own size */
  .cta .btn { font-family: var(--font-read); font-weight: 400; font-size: 1.25rem; line-height: 1.75rem; }
}
@media (max-width: 759px) {
  /* one column, everything on the center line: the logo, the words, the way in, then the key art at full size */
  .hero-inner { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 1rem; padding: 1.5rem 0; text-align: center; }
  .hero-copy { display: contents; }
  .hero h1 { order: 1; }
  .hero-lead { order: 2; max-width: 34rem; }
  .hero .cta { order: 3; justify-content: center; }
  .hero-line { order: 4; justify-content: center; }
  .keyart { order: 5; margin-top: 0.5rem; }
  .logo { width: min(100%, 26rem); margin: 0 auto; }
}
@media (max-width: 599px) {
  /* a phone: the key art straight under the logo at the game's own size, so the way in stays on the first screen */
  .keyart { order: 1; width: 13.125rem; height: 17.4375rem; margin-top: 0; }
  .logo { width: min(100%, 22.375rem); }
}
/* a wide, short screen (a phone on its side): the key art at the game's own size */
@media (min-width: 600px) and (max-height: 599px) { .keyart { width: 13.125rem; height: 17.4375rem; } }

/* ---------- live arena ---------- */
/* Two layouts, chosen by site.js from the room there is (data-lay on the section):
     below   the board in the middle, the two choosers in one row above it, the score and the buttons under it
     beside  the board on the left, a column on the right with the score, the buttons and the two rows of factions
   Beside is used when the board is no smaller for it. Without the script the layout is "below". */
.arena-grid { --side-min: 20rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem 1.5rem; justify-items: center; }
@media (min-width: 1280px) { .arena-grid { column-gap: 3rem; } }
.matchup { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem 0.75rem; }
.picker { display: none; }
.arena-box { position: relative; overflow: hidden; background: var(--ink); border: 0.125rem solid var(--gold); box-shadow: 0 0 0 0.125rem var(--ink), 0.5rem 0.5rem 0 var(--ink); }
.arena-box canvas, .arena-box .poster { image-rendering: pixelated; image-rendering: crisp-edges; }
/* site.js gives the still the size the board will have (whole device pixels); this is the size with no script */
.arena-box .poster { width: 386px; height: 432px; max-width: none; }
/* the canvas sizes itself in whole device pixels (site.js), within the room the layout leaves it */
.arena-box canvas { position: relative; max-width: none; }
.arena[data-live="on"] .poster { display: none; }
.arena:not([data-live="on"]) canvas { display: none; }
.live-tag { position: absolute; left: 0.5rem; top: 0.5rem; z-index: 2; display: none; }
.live-tag i { display: inline-block; width: 0.5rem; height: 0.5rem; background: var(--red); animation: blink 1200ms steps(1) infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
/* LIVE is shown while frames are being drawn, and only then */
.arena[data-live="on"][data-playing="1"] .live-tag { display: inline-flex; }
.verdict { position: absolute; left: 0; right: 0; top: 40%; z-index: 2; display: none; padding: 0.5rem 0.75rem; text-align: center; font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; line-height: 2rem; color: var(--gold-hi); background: var(--ink); border-top: 0.125rem solid var(--gold); border-bottom: 0.125rem solid var(--gold); }
.arena[data-live="on"][data-over="1"] .verdict { display: block; }
/* shown where the fight does not run by itself (less motion asked for, a weak device, data saver) until it is asked for */
.arena-start { position: absolute; left: 50%; bottom: 1.5rem; z-index: 3; display: none; transform: translateX(-50%); white-space: nowrap; }
.arena-start:active { transform: translate(-50%, 0.25rem); }
.arena[data-ask="1"] .arena-start { display: inline-flex; }
/* under the board: as wide as the board (site.js sets --board-w), never narrower than a readable column */
.arena-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-content: start; min-width: 0; width: min(100%, max(var(--board-w, 0px), 35rem)); }
.score { display: grid; gap: 0.75rem; padding: 0.75rem 1rem; }
/* one side of the fight: where it stands, who it is, how many still stand, and under that what to watch for */
.score-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0 0.75rem; align-items: baseline; line-height: 1.75rem; }
.score .where { color: var(--mute); white-space: nowrap; }
.score .name { font-weight: 400; color: var(--paper); }
.score .left { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; line-height: 2rem; color: var(--gold-hi); }
.score .watch { grid-column: 1 / -1; color: var(--jade-hi); text-wrap: pretty; }
.score .seed { justify-self: start; }
.arena-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 0.75rem; }
.picker { gap: 0.5rem; }
.picker h3 { font-weight: 400; font-size: 1.25rem; line-height: 1.75rem; color: var(--mute); }
.picker ul { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pick {
  min-height: 2.5rem; padding: 0.25rem 0.75rem;
  line-height: 1.75rem; white-space: nowrap;
  color: var(--paper); background: var(--lacquer);
  border: 0.125rem solid var(--night-3); box-shadow: 0 0 0 0.125rem var(--ink);
}
.pick::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; margin-right: 0.5rem; background: var(--fc); box-shadow: 0 0 0 0.125rem var(--ink); }
.pick:hover { border-color: var(--gold-lo); }
.pick[aria-pressed="true"] { background: var(--lacquer-hi); border-color: var(--gold-hi); color: var(--gold-hi); }
.arena-note { max-width: 35rem; }
.arena-state .btn-small { white-space: normal; }
.arena-state { padding: 0.75rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; line-height: 1.75rem; background: var(--lacquer); border: 0.125rem solid var(--gold); box-shadow: 0 0 0 0.125rem var(--ink); }
/* no WebGL, or the bundle did not load: the still stays, the dead controls go, and the way on is the footage */
.arena[data-live="none"] :is(.matchup, .picker, .arena-actions, .score) { display: none; }
.choose { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.choose span { line-height: 1.75rem; color: var(--paper); white-space: nowrap; }
.choose select {
  min-width: 0; min-height: 2.5rem; padding: 0.25rem 2rem 0.25rem 0.75rem;
  font-family: var(--font-read); font-size: 1.25rem; line-height: 1.75rem;
  color: var(--gold-hi); background-color: var(--lacquer);
  /* a pixel arrow: two stacked squares */
  background-image: linear-gradient(var(--gold-hi), var(--gold-hi)), linear-gradient(var(--gold-hi), var(--gold-hi));
  background-size: 0.5rem 0.125rem, 0.25rem 0.125rem; background-position: right 0.625rem top 1.125rem, right 0.75rem top 1.25rem; background-repeat: no-repeat;
  border: 0.125rem solid var(--gold); border-radius: 0; box-shadow: 0 0 0 0.125rem var(--ink);
  appearance: none; -webkit-appearance: none;
}
.matchup .vs { color: var(--mute); }
@media (min-width: 600px) {
  /* under a board with room on both sides the title sits on the board's center line, like everything else there */
  .arena:not([data-lay="beside"]) .sec-title { text-align: center; }
  /* the score on the left, the buttons and the note on the right: the strip is as wide as the board */
  .arena:not([data-lay="beside"]) .arena-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto auto 1fr; column-gap: 1.5rem; }
  .arena:not([data-lay="beside"]) .arena-side > * { grid-column: 2; }
  .arena:not([data-lay="beside"]) .arena-side > .score { grid-column: 1; grid-row: 1 / span 4; align-self: start; }
  .arena[data-live="none"]:not([data-lay="beside"]) .arena-side > * { grid-column: 1 / -1; }
}
/* the column is as wide as the room, up to a width its lines still read well at (a small board on a short, wide
   screen would otherwise leave it a metre of panel) */
.arena[data-lay="beside"] .arena-grid { grid-template-columns: max-content minmax(var(--side-min), 40rem); justify-content: start; justify-items: stretch; align-items: start; }
.arena[data-lay="beside"] .matchup { display: none; }
.arena[data-lay="beside"] .picker { display: grid; }
.arena[data-lay="beside"] .arena-side { width: auto; gap: 1.5rem; }
.arena[data-lay="beside"][data-live="none"] .picker { display: none; }
@media (max-width: 599px) {
  /* a phone: the buttons right under the board, then the score */
  .arena-actions { order: -1; }
  .arena-side { width: 100%; }
}
@media (max-width: 420px) {
  /* the board runs edge to edge on a phone, as it does in the game */
  .arena-box { margin: 0 -1rem; border-left: 0; border-right: 0; box-shadow: none; max-width: 100vw; }
  .arena-box .poster { width: 100vw; height: auto; aspect-ratio: 386 / 432; }
  /* the two choosers share the row evenly, whatever the names' length (Crown Guard, 저승차사) */
  .matchup { flex-wrap: nowrap; width: 100%; }
  .choose { flex: 1 1 0; }
  .choose span { display: none; }
  .choose select { width: 100%; }
}
@media (max-width: 420px) {
  /* two choosers on one 360 px line: the longest name (Crown Guard) fits once the padding gives way */
  .matchup { gap: 0.25rem; }
  .choose select { padding: 0.25rem 1.5rem 0.25rem 0.25rem; background-position: right 0.375rem top 1.125rem, right 0.5rem top 1.25rem; }
}
@media (max-width: 359px) {
  /* a 320 px line cannot hold two names: one chooser to a row, each with its side written out */
  .matchup { flex-direction: column; align-items: stretch; }
  .matchup .vs { display: none; }
  .choose { flex: none; }
  .choose span { display: inline; min-width: 4.5rem; }
  .choose select { flex: 1 1 0; width: auto; }
}

/* ---------- one real scene: two Dokkaebi fuse ---------- */
.scene { background: var(--ink); border-top: 0.125rem solid var(--gold-lo); border-bottom: 0.125rem solid var(--gold-lo); }
.scene .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; justify-items: center; padding: 2.5rem 0; }
/* recorded at one image pixel per art pixel and doubled by whole pixels; shown at 1x or 2x, never in between. The
   picture fills its box by cover: a screen narrower than the scene loses the two edges of the board, not the scale */
.scene-frame { width: min(100%, 24.375rem); background: var(--ink); border: 0.125rem solid var(--gold); box-shadow: 0 0 0 0.125rem var(--ink); }
.scene-clip { width: 100%; height: 18.75rem; object-fit: cover; image-rendering: pixelated; image-rendering: crisp-edges; background: var(--ink); }
.scene-copy { display: grid; gap: 0.75rem; justify-items: center; text-align: center; min-width: 0; }
.scene-caption { line-height: 1.75rem; color: var(--paper); text-wrap: balance; }
@media (max-width: 420px) {
  /* edge to edge, like the board above it */
  .scene-frame { width: 100vw; border-left: 0; border-right: 0; box-shadow: none; }
  .scene-clip { width: min(100%, 24.125rem); margin: 0 auto; }
}
@media (min-width: 720px) and (max-width: 859px) {
  /* a tablet on its end: the scene at the game's size, its line beside it */
  .scene .wrap { grid-template-columns: auto minmax(0, 1fr); gap: 1.5rem; align-items: center; }
  .scene-copy { justify-items: start; text-align: left; }
}
@media (min-width: 860px) {
  .scene .wrap { padding: 3rem 0; }
  .scene-frame { width: 48.5rem; }
  .scene-clip { height: 37.5rem; }
  .scene-caption { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; line-height: 2rem; }
}
@media (min-width: 1180px) {
  .scene .wrap { grid-template-columns: auto minmax(0, 1fr); gap: 2.5rem; align-items: center; }
  .scene-copy { justify-items: start; text-align: left; }
}

/* ---------- one run, scene by scene ---------- */
.run-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3rem; align-items: start; }
.reel { width: 24.625rem; display: grid; gap: 0.75rem; }
.reel-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.reel-tab { min-height: 2.5rem; padding: 0.25rem 0.5rem; line-height: 1.75rem; white-space: nowrap; color: var(--paper); background: var(--lacquer); border: 0.125rem solid var(--night-3); box-shadow: 0 0 0 0.125rem var(--ink); }
.reel-tab:hover { border-color: var(--gold-lo); }
.reel-tab[aria-pressed="true"] { border-color: var(--gold-hi); color: var(--gold-hi); background: var(--lacquer-hi); }
/* what to look at in the scene: room for the longest line is kept so the picture does not jump when the scene changes */
.reel-watch { min-height: 7rem; line-height: 1.75rem; color: var(--paper); text-wrap: pretty; }
:lang(ko) .reel-watch { min-height: 5.25rem; }
.reel-frame { position: relative; background: var(--ink); border: 0.125rem solid var(--gold); box-shadow: 0 0 0 0.125rem var(--ink), 0.5rem 0.5rem 0 var(--ink); }
.reel video { width: 100%; height: auto; aspect-ratio: 780 / 1688; background: var(--ink); }
/* one button plays and pauses: large in the middle while the picture rests, small in the corner while it runs */
.reel-play { position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%, -50%); white-space: nowrap; }
.reel-play:active { transform: translate(-50%, calc(-50% + 0.25rem)); }
.reel[data-playing="1"] .reel-play { left: auto; top: auto; right: 0.5rem; bottom: 0.75rem; transform: none; min-height: 2.5rem; padding: 0.25rem 0.75rem; font-family: var(--font-read); font-weight: 400; font-size: 1.25rem; line-height: 1.75rem; text-shadow: none; background: var(--lacquer-hi); border-color: var(--gold); box-shadow: 0 0.25rem 0 var(--ink), 0 0 0 0.125rem var(--ink), 0 0.25rem 0 0.125rem var(--ink); }
.reel[data-playing="1"] .reel-play:active { transform: translateY(0.25rem); }
.steps { display: grid; counter-reset: step; align-self: center; min-width: 0; border-top: 0.125rem solid var(--night-3); }
.step { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.25rem 1rem; align-items: start; padding: 1rem 0; border-bottom: 0.125rem solid var(--night-3); }
.step > div { display: contents; }
.step::before { counter-increment: step; content: counter(step); grid-row: 1 / span 2; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; line-height: 2rem; color: var(--ink); background: var(--gold-hi); border: 0.125rem solid var(--gold-lo); box-shadow: 0 0 0 0.125rem var(--ink); }
.step h3 { align-self: center; font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; line-height: 2rem; color: var(--gold-hi); }
.step p { grid-column: 2; color: var(--paper); text-wrap: pretty; }
@media (max-width: 1099px) {
  .run-grid { gap: 1.5rem; }
  /* a narrow column: the number beside the heading, the sentence under both at the column's full width */
  .step::before { grid-row: 1; width: 2rem; height: 2rem; font-family: var(--font-read); font-weight: 400; font-size: 1.25rem; line-height: 1.75rem; }
  .step { gap: 0.5rem 0.75rem; }
  .step p { grid-column: 1 / -1; }
}
@media (max-width: 759px) {
  .run-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; justify-items: center; }
  .reel { width: min(100%, 24.625rem); }
  .steps { width: min(100%, 35rem); }
}

/* ---------- factions ---------- */
.fac-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.fac-panel { padding: 1.5rem; display: grid; gap: 1.5rem; border-color: var(--fc); }
.fac-top { display: grid; gap: 0.5rem; }
.fac-top h3 { font-family: var(--font-head); font-weight: 700; font-size: 2.25rem; line-height: 3rem; color: var(--fc); text-shadow: 0 0.125rem 0 var(--ink), 0.125rem 0 0 var(--ink), -0.125rem 0 0 var(--ink), 0 -0.125rem 0 var(--ink); }
.fac-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; }
/* a roster: every card is the same three rows (the body, the name, the lines), shared across the row of cards, so the
   feet stand on one line and the names start on one line whatever their length */
.units { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 1rem; }
.unit { display: grid; grid-row: span 3; grid-template-rows: subgrid; gap: 0.5rem; justify-items: center; text-align: center; min-width: 0; }
.unit .pad, .boss .pad { display: grid; place-items: end center; }
.unit h4 { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; line-height: 2rem; color: var(--paper); }
.unit p { line-height: 1.75rem; color: var(--mute); }
.unit p b { font-weight: 400; color: var(--paper); }
.cost { color: var(--gold-hi); }
details.more { line-height: 1.75rem; color: var(--mute); }
details.more summary { display: inline-block; padding: 0.5rem 0; cursor: pointer; color: var(--jade-hi); list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+ "; }
details.more[open] summary::before { content: "- "; }
details.more dl { display: grid; gap: 0.25rem; margin-top: 0.25rem; }
details.more dt { color: var(--paper); }
.roles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1.5rem; }
.role { padding: 0.75rem; display: grid; gap: 0.25rem; align-content: start; background: var(--lacquer); border: 0.125rem solid var(--night-3); box-shadow: 0 0 0 0.125rem var(--ink); }
.role b { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; line-height: 2rem; color: var(--gold-hi); }
.role span { line-height: 1.75rem; color: var(--paper); text-wrap: pretty; }
@media (max-width: 1099px) { .fac-top h3 { font-size: 1.5rem; line-height: 2rem; } }
@media (min-width: 760px) and (max-width: 1099px) {
  /* five do not fit a tablet's row: three, then two on the center line (six tracks, each card takes two) */
  .units, .roles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .unit, .role { grid-column: span 2; }
  .unit:nth-child(4), .role:nth-child(4) { grid-column: 2 / span 2; }
  .unit:nth-child(-n + 3) { padding-bottom: 1.5rem; }
}

/* ---------- commanders: the muster roll ---------- */
.cmd-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.cmd-list { display: grid; grid-template-columns: repeat(5, 8.25rem); gap: 0.75rem; }
.cmd {
  position: relative; display: block; width: 8.25rem; height: 8.25rem; padding: 0;
  background: var(--lacquer); border: 0.125rem solid var(--night-3); box-shadow: 0 0 0 0.125rem var(--ink);
}
.cmd .face { display: block; width: 8rem; height: 8rem; background: url("art/commanders.png") calc(var(--i) * -8rem) 0 / auto 8rem no-repeat; image-rendering: pixelated; image-rendering: crisp-edges; }
.cmd:hover { border-color: var(--gold-lo); }
.cmd[aria-pressed="true"] { border-color: var(--gold-hi); background: var(--lacquer-hi); }
.cmd .lock { position: absolute; right: 0.125rem; top: 0.125rem; padding: 0 0.25rem; line-height: 1.5rem; color: var(--ink); background: var(--gold-hi); }
.cmd-card { position: sticky; top: 5rem; padding: 1.5rem; display: grid; gap: 0.75rem; min-height: 20rem; align-content: start; }
.cmd-card h3 { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; line-height: 2rem; color: var(--gold-hi); }
.cmd-card .tag { line-height: 1.75rem; color: var(--jade-hi); }
.cmd-card p { color: var(--paper); text-wrap: pretty; }
.cmd-card .how { color: var(--mute); }
@media (max-width: 1099px) {
  /* the roll on top, the card under it at the same width */
  .cmd-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; justify-items: center; }
  .cmd-grid > div { width: min(100%, 44.25rem); }
  .cmd-card { position: static; min-height: 0; }
}
@media (max-width: 759px) {
  /* 64 px faces, five to a row in three even rows */
  .cmd-list { width: 100%; grid-template-columns: repeat(5, 4.25rem); gap: 0.25rem; justify-content: center; }
  .cmd { width: 4.25rem; height: 4.25rem; }
  .cmd .face { width: 4rem; height: 4rem; background-size: auto 4rem; background-position: calc(var(--i) * -4rem) 0; }
  .cmd .lock { display: none; }
  .cmd-card { padding: 1rem; }
}
/* a phone too narrow for five: as many as fit (four at 320 px) */
@media (max-width: 389px) { .cmd-list { grid-template-columns: repeat(auto-fit, 4.25rem); } }

/* ---------- bosses ---------- */
/* nine in three rows of three; each card is four shared rows (the body, the name, the chapter, the line) */
.bosses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1.5rem; }
.boss { display: grid; grid-row: span 4; grid-template-rows: subgrid; gap: 0.5rem; justify-items: center; text-align: center; min-width: 0; padding-bottom: 2.5rem; }
.boss:nth-last-child(-n + 3) { padding-bottom: 0; }
.boss b { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; line-height: 2rem; color: var(--paper); }
.boss p { max-width: 22.5rem; line-height: 1.75rem; color: var(--paper); text-wrap: pretty; }
/* what lies past the bosses: one lacquer board, three entries */
.deeper { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem 2rem; margin-top: 3rem; padding: 1.5rem; background: var(--lacquer); border: 0.125rem solid var(--gold); box-shadow: 0 0 0 0.125rem var(--ink), inset 0 0 0 0.125rem var(--ink); }
.deeper dt { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; line-height: 2rem; color: var(--gold-hi); }
.deeper dd { color: var(--paper); text-wrap: pretty; }
@media (max-width: 859px) { .deeper { grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-top: 1.5rem; padding: 1rem; } }

/* ---------- the way in ---------- */
.last { background: var(--night); border-top: 0.125rem solid var(--gold-lo); overflow: hidden; }
.last .wrap { position: relative; display: grid; gap: 1.5rem; justify-items: center; text-align: center; padding: 5rem 0; }
.last h2, .last h1 { font-family: var(--font-head); font-weight: 700; font-size: 3rem; line-height: 4rem; color: var(--gold-hi); text-shadow: 0 0.25rem 0 var(--gold-lo), 0.125rem 0 0 var(--ink), -0.125rem 0 0 var(--ink), 0 -0.125rem 0 var(--ink), 0 0.375rem 0 var(--ink); text-wrap: balance; }
.last .tiger { --s: 4; }
.last .cta { justify-content: center; }
.buy-line { justify-content: center; color: var(--paper); }
.faq { width: min(100%, 35rem); margin-top: 1.5rem; text-align: left; border-top: 0.125rem solid var(--night-3); }
.faq h3 { padding: 1rem 0 0.25rem; font-weight: 400; font-size: 1.25rem; line-height: 1.75rem; color: var(--jade-hi); }
.faq details { border-bottom: 0.125rem solid var(--night-3); }
.faq summary { padding: 0.75rem 0; cursor: pointer; list-style: none; line-height: 1.75rem; color: var(--paper); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+ "; color: var(--gold-hi); }
.faq details[open] summary::before { content: "- "; }
.faq details p { padding: 0 0 1rem; line-height: 1.75rem; color: var(--mute); text-wrap: pretty; }
.lost .wrap { min-height: calc(100vh - 10rem); align-content: center; padding-top: 6rem; }
.lost .code { line-height: 1.75rem; color: var(--jade-hi); }
@media (max-width: 859px) { .last h2, .last h1 { font-size: 2.25rem; line-height: 3rem; } .last .wrap { padding: 3rem 0; } .lost .wrap { padding-top: 6rem; } }

footer { background: var(--ink); border-top: 0.125rem solid var(--gold-lo); padding: 1.5rem 0 3rem; }
footer .wrap { display: grid; gap: 0.5rem; }
footer ul { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
footer a { line-height: 1.75rem; color: var(--paper); }
footer a.privacy { color: var(--gold-hi); }
footer p { line-height: 1.75rem; color: var(--mute); }

/* ---------- narrow screens: rosters to swipe through, headings in the reading face ---------- */
@media (max-width: 859px) {
  .unit h4, .boss b, .step h3, .deeper dt, .role b, .cmd-card h3 { font-family: var(--font-read); font-weight: 400; font-size: 1.25rem; line-height: 1.75rem; }
  .unit h4, .boss b { color: var(--gold-hi); }
  .march .spr { --s: 1; }
  .last .tiger { --s: 3; }
}
@media (max-width: 759px) {
  /* a roster becomes one row to swipe through, bodies at twice the game's size. Rows cannot be shared across a
     scrolling row, so each card keeps two lines for its name */
  .units, .bosses { display: flex; gap: 0.5rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 0 1rem; }
  .unit, .boss { flex: 0 0 14.5rem; grid-row: auto; grid-template-rows: auto auto 1fr; align-content: start; scroll-snap-align: center; padding-bottom: 0; }
  .boss { grid-template-rows: auto auto auto 1fr; }
  .unit .pad, .boss .pad { min-height: calc(var(--tall) * var(--s) * var(--px)); }
  .unit h4, .boss b { min-height: 3.5rem; display: grid; align-content: end; }
  .roles { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .fac-panel { padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stars-b, .live-tag i { animation: none; }
}
