/* ============================================================
   The Vault — player-facing styles.
   Original work. Dark, high-contrast, tabular numbers, and an
   ember accent that is reserved for money and primary actions
   so the eye lands on the figure that matters.
   ============================================================ */

:root {
  /* Yellow and black, taken from the artwork: the yellow is the rails and
     lettering (#ffd000), the black the panels. Neutral greys, not the cool
     blue-greys this used to use, so nothing sits off the art's colours. */
  --bg:        #0a0a0a;
  --surface:   #141414;
  --surface-2: #1c1c1c;
  --line:      #2e2e2e;
  --line-warm: rgba(255, 208, 0, .35);

  --text:      #f4f4f4;
  --muted:     #a8a8a8;
  --dim:       #6f6f6f;

  /* The one accent, for money, primary actions and anything that is good
     news. --ember-lit is its hover. --teal used to be a second, green accent
     for wins; it is the same yellow now, kept as a name so nothing breaks. */
  --ember:     #ffd000;
  --ember-lit: #ffe14d;
  --ember-dim: rgba(255, 208, 0, .14);
  --teal:      #ffd000;
  --teal-dim:  rgba(255, 208, 0, .13);

  /* The two corners of a duel: yellow on the left, black edged in yellow on
     the right -- the two halves of every rail in the artwork. */
  --side-a:     #ffd000;
  --side-a-dim: rgba(255, 208, 0, .2);
  --side-b:     #ffd000;
  --side-b-dim: #000;
  --crimson:   #d9614c;
  --crimson-dim: rgba(217,97,76,.13);
  --discord:   #000;

  /* The lettering in the artwork: heavy, condensed, italic. */
  --display: 'Barlow Condensed', 'Arial Narrow', var(--sans);
  --mono: ui-monospace, 'Cascadia Code', 'SF Mono', Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* The page fills the screen rather than sitting in a column. Most of
     this site is rows, cards and tables, which all read better wide. Prose
     does not, so the few places that carry a paragraph cap themselves in
     characters -- see --prose below. */
  --wrap: 108rem;
  --prose: 68ch;
  --pad: clamp(1rem, 3vw, 2.25rem);
  --r: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(.98rem, .35vw + .92rem, 1.04rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* The artwork sits behind everything, fixed, so it does not scroll away on
   a long admin table and does not repeat. It is a separate layer rather than
   a background on the body because a fixed body background jumps around on
   iOS while scrolling; a fixed element does not.

   The image itself is set in the page head, where the versioned URL is known.
   Without one, this is simply the flat background colour, which is a fine
   page -- so a missing or slow image costs nothing but the picture. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background-color: var(--bg);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}

a { color: var(--ember); text-underline-offset: 3px; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

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

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* -- header ------------------------------------------------- */

/* No band at all: the page artwork runs up behind the header. The buttons
   are the only thing that needs to stay legible over it, so they keep their
   own surface -- see .nav-right .btn below. */
.nav { background: none; border: 0; }
/* Three tracks with equal outer ones, so the middle is centred on the page
   rather than on whatever is left over. Centring it inside a single flexible
   column would push it off-centre, because the icon and the row of buttons
   are nowhere near the same width. */
.nav-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center; column-gap: 1rem; row-gap: .5rem; padding-block: .5rem;
}
/* The mark and the Banker light share the left track, so the wordmark stays
   centred on the *page* -- putting the light in its own column would push the
   middle one off centre, which is the whole reason the grid is built this
   way. */
.nav-left     { justify-self: start; display: flex; align-items: center; gap: .9rem; min-width: 0; }
.brand-icon   { justify-self: start; }
/* The banner is a strip right across the top, the icon, the Banker light and
   the buttons on the row under it. */
.brand-banner { grid-row: 1; grid-column: 1 / -1; justify-self: stretch; }
.nav-left     { grid-row: 2; }
.nav-right    { grid-row: 2; justify-self: end; }

/* -- the X on a pop-up ------------------------------------------- */

/* The one thing that is clickable. Small, as asked, but not so small it has
   to be aimed at -- it sits on the character's own artwork, so it carries its
   own dark disc to stay findable against the glow. */
.popup-x {
  pointer-events: auto;
  position: absolute; top: .1rem; right: .1rem;
  width: 1.6rem; height: 1.6rem; padding: 0;
  display: grid; place-items: center;
  font-size: 1.05rem; line-height: 1;
  color: var(--muted); cursor: pointer;
  background: rgba(10, 10, 10, .82);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
  backdrop-filter: blur(6px);
}
.popup-x:hover { color: var(--text); border-color: var(--ember); }


/* -- is the Banker there ------------------------------------------ */

/* Sits opposite the buttons and answers the question the rest of the site
   depends on. A whisper to somebody offline is not queued -- the game says
   "player not found" and it is gone -- and the bank runs at weekends, so this
   is the difference between "send it now" and "nothing you type will land". */
.banker-status {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--mono); font-size: .78rem; letter-spacing: .04em;
  text-transform: uppercase; white-space: nowrap;
  padding: .32rem .7rem; border-radius: 999px;
  background: rgba(16, 16, 16, .72);
  border: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(8px);
}
.banker-dot { width: .5rem; height: .5rem; border-radius: 50%; flex: none; }

/* Off is deliberately quiet: it is the ordinary state most of the week, and
   a warning colour for "not Saturday yet" would cry wolf. */
.banker-off      { color: var(--dim); }
.banker-off .banker-dot { background: var(--dim); }

/* On is worth looking up for, so it is the one that moves. */
.banker-on {
  color: var(--ember);
  border-color: rgba(255, 208, 0, .35);
  animation: banker-breathe 2.4s ease-in-out infinite;
}
.banker-on .banker-dot {
  background: var(--ember);
  box-shadow: 0 0 6px rgba(255, 208, 0, .8);
}
@keyframes banker-breathe {
  0%, 100% { opacity: .78; text-shadow: none; }
  50%      { opacity: 1; text-shadow: 0 0 10px rgba(255, 208, 0, .55); }
}
/* Stillness still has to read as on, so the lit colour and the glow stay and
   only the movement goes. */
@media (prefers-reduced-motion: reduce) {
  .banker-on { animation: none; opacity: 1; }
}

@media (max-width: 44rem) {
  /* The dot alone carries it once the row is tight. */
  .banker-status { padding: .3rem; gap: 0; }
  .banker-status [data-banker-text] { display: none; }
}
.brand-icon, .brand-banner {
  display: flex; align-items: center;
  text-decoration: none; color: var(--text); min-width: 0;
}
/* Both are artwork with transparent edges, so they are sized by height and
   left to find their own width -- fixing both would letterbox them, and the
   mark and the wordmark have quite different proportions. */
.brand-mark, .brand-name { display: block; width: auto; flex: none; }
/* The mark stays the size it was. The wordmark is the centrepiece now, so it
   takes as much height as the viewport will spare -- it carries a lot of
   surround (spikes, chains, dice) and the lettering is only about half its
   height, so size is what makes it readable.
   Doubled from clamp(3.4rem, 7vw, 6.5rem): width is auto and the artwork is
   2.5:1, so twice the height is twice the width, and the centred grid column
   keeps it in the same place. */
.brand-mark { height: 3.6rem; }
.brand-name { width: 100%; height: auto; }
.brand-icon:hover .brand-mark,
.brand-banner:hover .brand-name { filter: brightness(1.12); }

/* Without the header band these sit straight on the artwork, so they carry a
   little of their own. */
.nav-right .btn {
  background: rgba(16, 16, 16, .72);
  border-color: rgba(255, 255, 255, .10);
  backdrop-filter: blur(8px);
}
.nav-right .btn:hover:not(:disabled) { background: rgba(28, 28, 28, .9); }
/* The artwork is drawn for a dark page and carries its own glow, so it needs
   no background; a box behind it would show as a rectangle around the spikes
   and the drips. */
@media (max-width: 52rem) {
  /* The buttons wrap rather than pushing the page wider than the screen. The
     banner strip scales down with the page, so it stays on a phone too. */
  .nav-right { justify-self: stretch; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
}
@media (max-width: 34rem) {
  .brand-mark { height: 2.4rem; }
}
.nav-right { display: flex; align-items: center; gap: .8rem; font-size: .9rem; }

/* -- type --------------------------------------------------- */

h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1.08; margin: 0 0 .5rem; letter-spacing: -.015em; }
h2 { font-size: 1.16rem; margin: 0 0 .7rem; letter-spacing: -.005em; }
h3 { font-size: .96rem; margin: 0 0 .3rem; }
/* A line of text 1,700 pixels wide is hard to read: the eye loses the
   return sweep. Only the prose is capped -- tables and card grids use the
   whole width, which is the point of widening it. */
.lede { color: var(--muted); margin-top: 0; font-size: 1.05rem; max-width: var(--prose); }
/* For a line that states a rule rather than describing the page. It is one
   sentence and reads as one, so it is allowed the width to stay on one line
   and shrinks rather than wrapping when the window cannot give it that. */
.lede-bright {
  color: #fff; max-width: none; text-align: center;
  font-size: clamp(.82rem, 1.45vw, 1.05rem);
  text-wrap: balance;
}
h1, h2 { max-width: 26ch; }
main > .wrap > p:not(.lede):not(.fine) { max-width: var(--prose); }
.fine { color: var(--dim); font-size: .84rem; }
.eyebrow {
  font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ember); margin-bottom: .5rem; font-weight: 600;
}

main { padding-block: clamp(1.5rem, 5vw, 2.8rem) 4rem; }

/* -- cards -------------------------------------------------- */

/* Cards sit on artwork now, so they are a shade translucent -- enough for
   the colour behind to tint them, not enough to make the text work for it --
   and lifted off it with a shadow so the edge reads as an edge rather than as
   part of the picture. */
.card {
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--r); padding: clamp(1rem, 3vw, 1.5rem);
  margin-bottom: 1rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.grid .card { margin-bottom: 0; }

/* -- balance ------------------------------------------------ */

.balance-card { border-color: var(--line-warm); background: linear-gradient(180deg, var(--ember-dim), transparent 60%), var(--surface); }
.balance { display: flex; gap: 2.5rem; flex-wrap: wrap; align-items: flex-end; }
.balance-main .figure { font-size: clamp(2.1rem, 7vw, 3rem); color: var(--ember); line-height: 1.05; }
.balance-held .figure { font-size: 1.5rem; color: var(--muted); line-height: 1.05; }
.figure { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; }
.balance-label { color: var(--dim); font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; }

/* -- forms -------------------------------------------------- */

label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: .3rem; }

input[type="text"], input[type="number"] {
  width: 100%; padding: .6rem .7rem; border-radius: 7px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text); font: inherit;
}
input[type="number"], input.code-in { font-family: var(--mono); font-variant-numeric: tabular-nums; }
input:focus { border-color: var(--ember); outline: none; }
input::placeholder { color: var(--dim); }

.row { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.row > .grow { flex: 1 1 9rem; }

.btn {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 550; padding: .58rem 1.1rem; border-radius: 7px;
  cursor: pointer; text-decoration: none; white-space: nowrap; display: inline-block;
}
.btn:hover:not(:disabled) { border-color: var(--dim); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--ember); border-color: var(--ember); color: #000; }
.btn-primary:hover:not(:disabled) { background: var(--ember-lit); border-color: var(--ember-lit); color: #000; }
.btn-quiet { background: none; color: var(--muted); font-weight: 400; font-size: .88rem; padding: .42rem .8rem; }
.btn-discord { background: var(--discord); border-color: var(--ember); color: var(--ember); font-size: 1.02rem; padding: .7rem 1.4rem; }
.btn-discord:hover:not(:disabled) { background: var(--ember); border-color: var(--ember); color: #000; }

/* -- link code ---------------------------------------------- */

.code-display {
  font-family: var(--mono); font-size: clamp(1.4rem, 6vw, 1.9rem);
  letter-spacing: .2em; color: var(--teal); background: var(--surface-2);
  border: 1px dashed var(--teal); border-radius: 8px;
  padding: .7rem .8rem; text-align: center; margin: .8rem 0; word-break: break-all;
}
.steps { margin: .4rem 0 0; padding-left: 1.15rem; color: var(--muted); }
.steps li { margin-bottom: .25rem; }
.steps b, .steps code { color: var(--text); }
.steps code { font-family: var(--mono); background: var(--surface-2); padding: .08rem .3rem; border-radius: 4px; }

/* -- how it works ------------------------------------------- */

.howto { counter-reset: step; display: grid; gap: .8rem; margin: 0; padding: 0; list-style: none; }
.howto li {
  counter-increment: step; position: relative; padding-left: 2.4rem;
  color: var(--muted);
}
.howto li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: .1rem;
  font-family: var(--mono); font-size: .8rem; color: var(--ember);
  border: 1px solid var(--line-warm); border-radius: 5px;
  width: 1.75rem; text-align: center; padding: .05rem 0;
}
.howto strong { color: var(--text); display: block; font-weight: 600; }

/* -- notes and pills ---------------------------------------- */

.note { border-radius: 7px; padding: .55rem .8rem; font-size: .9rem; margin-top: .75rem; border: 1px solid; }
.note-ok   { background: var(--teal-dim);    border-color: rgba(255, 208, 0, .42);  color: #ffe14d; }
.note-bad  { background: var(--crimson-dim); border-color: rgba(217,97,76,.45);   color: #eb907c; }
.note-wait { background: var(--ember-dim);   border-color: var(--line-warm);      color: #ffe14d; }
[hidden] { display: none !important; }

.pill {
  display: inline-block; font-size: .7rem; text-transform: uppercase;
  letter-spacing: .07em; padding: .14rem .48rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap; font-weight: 600;
}
.pill-settled  { color: #ffe14d; border-color: rgba(255, 208, 0, .42); }
.pill-review   { color: #eb907c; border-color: rgba(217,97,76,.45); }
.pill-aborted  { color: var(--dim); }
/* A review somebody dealt with. Green rather than the red of an open one:
   it is finished, and leaving it the colour of a problem is how a cleared
   queue goes on looking like an unattended one. */
.pill-resolved { color: #ffe14d; border-color: rgba(255, 208, 0, .42); }
.pill-intent, .pill-reserved, .pill-acting { color: #ffe14d; border-color: var(--line-warm); }

/* -- table --------------------------------------------------- */

.table-scroll { overflow-x: auto; margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad); }

/* A table that grows without limit. It keeps its own height and scrolls, with
   the header pinned, because a hundred rows of history push everything below
   them off the page and a column heading that scrolls away leaves the reader
   counting columns to work out which figure is which. */
.table-tall { max-height: min(60vh, 28rem); overflow-y: auto; }
.table-tall thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2);
  box-shadow: inset 0 -1px 0 var(--line);
}
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .55rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--dim); font-weight: 500; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; }
td.r { text-align: right; }
tr:last-child td { border-bottom: 0; }
.empty { color: var(--dim); font-style: italic; }

/* -- footer -------------------------------------------------- */

/* White rather than the dimmed grey used elsewhere. It sits over artwork now,
   where a low-contrast grey was hard to read, and the line it carries -- that
   this is in-game currency with no real-money value -- is the one thing on
   the page that should never be easy to miss. */
footer { border-top: 1px solid var(--line); padding-block: 1.3rem; color: #fff; font-size: .84rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
/* Beats `.fine`, which would otherwise dim the right-hand half back to grey. */
footer .fine { color: inherit; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* -- owner panel --------------------------------------------- */

.admin-head { margin-bottom: .8rem; }

.admin-nav { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.admin-nav a {
  padding: .4rem .85rem; border-radius: 7px; text-decoration: none;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-size: .9rem;
}
.admin-nav a:hover { color: var(--text); border-color: var(--dim); }
.admin-nav a.on { color: var(--ember); border-color: var(--line-warm); background: var(--ember-dim); }
.badge {
  display: inline-block; background: var(--crimson); color: #fff;
  border-radius: 999px; padding: 0 .38rem; font-size: .72rem; font-weight: 700;
}

/* The reconciliation banner. Deliberately the largest thing on the page:
   whether the books match the Bank's wallet is the one question the previous
   system could not answer. */
.recon {
  border-radius: var(--r); padding: clamp(1rem, 3vw, 1.5rem);
  margin-bottom: 1.1rem; border: 1px solid;
}
.recon-label { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; opacity: .85; }
.recon-figure {
  font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600;
  font-size: clamp(1.8rem, 6vw, 2.6rem); line-height: 1.1;
}
.recon p { margin: .3rem 0 0; }
.recon-ok      { background: var(--teal-dim);    border-color: rgba(255, 208, 0, .42); color: #ffe14d; }
.recon-bad     { background: var(--crimson-dim); border-color: rgba(217,97,76,.5);   color: #eb907c; }
.recon-unknown { background: var(--surface);     border-color: var(--line);          color: var(--muted); }
.recon .fine { color: inherit; opacity: .85; }

.stats { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .9rem 1rem; }
.stat-label { color: var(--dim); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; }
.stat-figure { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 600; }
.stat-warn { border-color: rgba(217,97,76,.45); }
.stat-warn .stat-figure { color: #eb907c; }

.drift-ok  { color: var(--dim); }
.drift-bad { color: #eb907c; font-weight: 600; }

.readings { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); margin: .8rem 0; }
.readings .figure { font-size: 1.3rem; }

.admin-actions { border-top: 1px solid var(--line); margin-top: .9rem; padding-top: .7rem; }
.admin-actions > summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.admin-actions > summary:hover { color: var(--text); }
.admin-actions .stack > * + * { margin-top: .6rem; }
.admin-actions form + p, .admin-actions p + form { margin-top: .7rem; }

select {
  width: 100%; padding: .6rem .7rem; border-radius: 7px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text); font: inherit;
}
select:focus { border-color: var(--ember); outline: none; }

.pill-role { color: var(--ember); border-color: var(--line-warm); }
.review-card { border-color: rgba(217,97,76,.35); }

/* -- duels ---------------------------------------------------- */

.vs { color: var(--dim); font-weight: 400; font-size: .85em; }

.sides { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); margin: .8rem 0 .4rem; }
.side { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: .7rem .8rem; }
.side-won { border-color: rgba(255, 208, 0, .45); background: var(--teal-dim); }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }

/* Share of the pot at a glance. Width is the side's fraction, so the two bars
   read as one split rather than two unrelated figures. */
.side-bar { height: 5px; border-radius: 3px; background: var(--line); margin: .45rem 0; overflow: hidden; }
.side-bar span { display: block; height: 100%; background: var(--ember); transition: width .3s ease; }
.side-won .side-bar span { background: var(--teal); }

.side-figures { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.side-figures .num { font-size: 1.1rem; font-weight: 600; }

/* No panel behind a duel. The frame is already a container with its own
   edge, and a grey box around it only fenced the artwork off from the page
   image it was meant to sit in. Padding stays so the figures underneath do
   not run to the page edge. Recent results keep their card -- they have no
   frame of their own to stand in for one. */
.duel-card {
  background: none; border: 0; box-shadow: none;
  backdrop-filter: none; padding-inline: 0;
}
.queued { align-items: center; margin-bottom: .5rem; }

/* -- notice pop-ups -------------------------------------------- */

.notice-stack {
  position: fixed; left: 1rem; bottom: 1rem; z-index: 50;
  display: grid; gap: .6rem; max-width: min(22rem, calc(100vw - 2rem));
}
/* The queue ticket lives in the same corner. It is gone by the time a trade
   notice appears -- the transaction it was counting has just ended -- but if
   both are ever up, the notice sits above it rather than on top of it. */
.notice-stack:not(:empty) ~ .queue-ticket { bottom: auto; }
.notice-pop-trade { border-color: rgba(217, 97, 76, .5); }
.notice-pop {
  background: var(--surface); border: 1px solid var(--line-warm);
  border-radius: var(--r); padding: .9rem 1rem;
  box-shadow: 0 8px 28px rgba(0,0,0,.45);
  animation: notice-in .25s ease;
}
.notice-pop-win { border-color: rgba(255, 208, 0, .5); background: linear-gradient(180deg, var(--teal-dim), var(--surface) 70%); }
.notice-title { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.notice-figure {
  font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600;
  font-size: 1.9rem; line-height: 1.15; color: var(--ember);
}
.notice-pop-win .notice-figure { color: #ffe14d; }
.notice-body { margin: .2rem 0 .6rem; font-size: .88rem; color: var(--muted); }

/* A bet's result: the banner across the middle of the screen. The art is a
   full-width strip, so the box is too, and the X sits on its corner the way
   it does on the footer pop-ups. */
.result-pop {
  position: fixed; left: 50%; top: 50%; z-index: 70;
  width: min(64rem, calc(100vw - 1rem));
  transform: translate(-50%, -50%);
  animation: result-in .3s cubic-bezier(.2, .9, .3, 1.2);
  filter: drop-shadow(0 12px 32px rgba(0,0,0,.6));
}
.result-pop img { width: 100%; height: auto; display: block; }
.result-line {
  margin: .4rem auto 0; width: fit-content; max-width: 100%;
  padding: .3rem .8rem; border-radius: var(--r);
  background: rgba(10, 10, 10, .85);
  font-size: .9rem; text-align: center; color: var(--text);
}
.result-pop .popup-x { top: .3rem; right: .3rem; }
@keyframes result-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.92); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .result-pop { animation: none; } }

/* Two buttons where most notices have one: a failed trade has something to
   be done about it, so the way to report it sits beside the dismissal. */
.notice-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.notice-actions .btn { flex: 1 1 auto; text-align: center; }

/* Somebody else's result. Deliberately quieter than a notice addressed to
   the reader -- ember rather than the teal a payout gets, and no figure -- so
   a glance tells you whether this one is yours before you have read a word.
   It also takes itself away, so it is never in the way of the page. */
.notice-shout {
  border-color: var(--line-warm);
  background: linear-gradient(180deg, var(--ember-dim), var(--surface) 70%);
}
.notice-shout .notice-title { color: var(--ember); }
.notice-shout .notice-body { color: var(--text); font-size: .95rem; }

@keyframes notice-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .notice-pop { animation: none; } .side-bar span { transition: none; } }

.pill-open      { color: #ffe14d; border-color: rgba(255, 208, 0, .42); }
.pill-scheduled { color: #ffe14d; border-color: var(--line-warm); }
.pill-closed    { color: var(--muted); }
.pill-cancelled { color: var(--dim); }

.stat-note { color: var(--dim); font-size: .78rem; margin-top: .15rem; }

/* -- countdown ------------------------------------------------ */

.countdown-card {
  background: linear-gradient(180deg, var(--ember-dim), transparent 70%), var(--surface);
  border: 1px solid var(--line-warm); border-radius: var(--r);
  padding: clamp(1rem, 3vw, 1.5rem); margin-bottom: 1.2rem; text-align: center;
}
.countdown-label {
  font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ember); font-weight: 600;
}
.countdown-clock {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: clamp(2rem, 8vw, 3.4rem); font-weight: 600; line-height: 1.1;
  color: var(--text); margin: .2rem 0 .3rem;
}
.countdown-now .countdown-clock { color: var(--teal); }

/* -- versus --------------------------------------------------- */

/* The frame is a black screen with the VS at the top. The two duellists
   stand level with each other, left and right of the middle, and everything
   is placed as a percentage of the frame so the panel scales as one picture.
   Measured off the artwork: the screen runs x 4.5-95.5%, y 28.5-86%, with
   the VS dipping into it at the centre down to 37%. */
.duel-panel {
  position: relative; aspect-ratio: 1672 / 941;
  margin: .6rem 0 .9rem;
}
/* The screen is painted black, not cut out, so the frame goes underneath. */
.panel-frame { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.panel-frame img { width: 100%; height: 100%; display: block; }

.duel-panel .fighter {
  /* A share of the panel's width, so the badge holds its place in the
     artwork at any size. The artwork leaves about 22% on each side -- the
     left box runs from the inner rail at 10% to the VS at 34%, the right one
     from 68% to 90% -- and this sits comfortably inside that. */
  position: absolute; z-index: 2; width: 17.85%;
  transform: translate(-50%, -50%);
  text-align: center; min-width: 0;
}
.fighter-a { left: 26%; top: 56%; }
.fighter-b { left: 74%; top: 56%; }

/* -- two a side --------------------------------------------------- */
/* A pair stands side by side, level, in the space one badge would take. */
.duel-panel .fighter-paired { width: 11.5%; }
.fighter-a1 { left: 19%; top: 56%; }
.fighter-a2 { left: 33%; top: 56%; }
.fighter-b1 { left: 67%; top: 56%; }
.fighter-b2 { left: 81%; top: 56%; }

/* The stamp is sized against its portrait, so it follows a halved badge
   down already. This only stops it overlapping its neighbour, which at
   132% of a badge sitting this close to another one it otherwise does. */
.fighter-paired .fighter-result { width: 108%; }

/* Both names on the one line, "one & two", a size down so the pair fits
   the rail a single name had to itself. Same place, same colours, same
   clipping -- the rail is not the thing that should change for a 2v2. */
.panel-name-pair span { font-size: clamp(.7rem, 1.3vw, 1.05rem); }

/* The tags in the frame's top corners. No pill background: the rail behind
   them is already a shape, and a second one inside it reads as a mistake. */
.panel-tag {
  position: absolute; z-index: 4; top: 21%;
  transform: translate(-50%, -50%);
  font-size: clamp(.58rem, 1.05vw, .82rem);
  letter-spacing: .1em; text-transform: uppercase; font-weight: 650;
  white-space: nowrap; pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .85);
}
/* In the two rails beside the VS. */
.panel-tag-left  { left: 25%; color: var(--ember); }
.panel-tag-right { left: 75%; color: var(--ember); }

/* The tag keeps the rail's yellow whatever the state says. It flashes once
   when the state changes and then settles -- something that pulses forever
   stops being a signal and becomes part of the furniture, and by then it is
   the countdown beside it that wants the eye. */
.panel-tag-changed { animation: tag-changed 1.1s ease-out 1; }
@keyframes tag-changed {
  0%   { transform: translate(-50%, -50%) scale(1); text-shadow: 0 1px 4px rgba(0,0,0,.85); }
  18%  { transform: translate(-50%, -50%) scale(1.12);
         text-shadow: 0 0 16px currentColor, 0 0 6px #fff, 0 1px 4px rgba(0,0,0,.85); }
  100% { transform: translate(-50%, -50%) scale(1); text-shadow: 0 1px 4px rgba(0,0,0,.85); }
}

/* The duellists' names, in the empty rail at each bottom corner. Centred on
   the rail and clipped rather than wrapped, so a long name stays on one line
   and a short one still sits in the middle of its box. */
.panel-name {
  position: absolute; z-index: 4; top: 79%; width: 30%;
  transform: translate(-50%, -50%);
  text-align: center; pointer-events: none;
}
.panel-name span {
  display: block; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 700; font-size: clamp(.72rem, 1.5vw, 1.15rem);
  text-shadow: 0 1px 5px rgba(0, 0, 0, .9);
}
/* Under each duellist, in the screen: yellow on the left, black edged in
   yellow on the right, the two ways the artwork letters its names. */
.panel-name-a { left: 26%; }
.panel-name-a span { color: var(--ember); }
.panel-name-b { left: 74%; }
.panel-name-b span {
  color: #000; -webkit-text-stroke: 1.2px var(--ember);
  paint-order: stroke fill; text-shadow: none;
}
/* The winner goes white, which is the one thing brighter than either. */
.panel-name-won span { color: #fff; -webkit-text-stroke: 0; text-shadow: 0 0 12px rgba(255,255,255,.55), 0 1px 5px rgba(0,0,0,.9); }

.fighter { text-align: center; min-width: 0; }

/* The portrait carries the width, not the face inside it. It used to be a
   shrink-to-fit inline-block with a percentage-width child, which is a
   circular definition -- the child sizes from the parent and the parent from
   the child -- so the percentage never resolved and the result stamp, sized
   against the portrait, came out several times too big. */
.duel-panel .fighter-portrait {
  /* A quarter of the panel's width. Sized against the panel rather than the
     viewport so the badge holds its place in the artwork at any width, and
     capped so it stops growing before it reaches the frame on a wide screen. */
  /* No pixel ceiling: the badge is a fixed share of the artwork, and a cap
     would make it shrink relative to the frame on a wide screen -- which is
     exactly the drift the percentage is here to prevent. The panel itself
     stops growing at the page width, so this has an upper bound already. */
  display: block; width: 100%; margin: 0 auto .4rem;
}
.fighter-face {
  width: 100%; aspect-ratio: 1; height: auto;
  border-radius: 50%; object-fit: cover; display: block;
  border: 2px solid var(--line); background: var(--surface-2);
}
.fighter-won .fighter-face { border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-dim); }


/* -- the result stamp ------------------------------------------ */
/* Sits over the avatar rather than beside it, so the eye lands on the face
   and the verdict together. The wrapper is only there to be the thing the
   stamp is positioned against; the avatar keeps its own margin. */
.fighter-portrait { position: relative; display: inline-block; }
.fighter-result {
  /* Dead centre of the badge. The quarter-rem lift was for the name that used
     to sit underneath; that name is down in the frame's rail now. */
  position: absolute; left: 50%; top: 50%;
  /* Both stamps are cut to the same width, so one rule sizes the pair and
     they match over avatars that are themselves the same size. Sized against
     the portrait, so it follows the face wherever the panel puts it.

     132% is what the frame allows. The badge is 17.85% of the panel and sits
     at 22% and 79%; at 150% the stamp spanned 8.6% to 35.4%, which is inside
     the left rail at one end and into the VS at the other. At 132% it runs
     10.2% to 33.8% and clears both. */
  width: 132%;
  pointer-events: none;   /* it covers the face; nothing under it is clickable */
  z-index: 2;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, .55));
  animation: result-stamp .42s cubic-bezier(.2, .9, .3, 1) both;
}
.fighter-result img { display: block; width: 100%; height: auto; }

/* Fades in and settles the last few percent of its size -- enough to read as
   arriving, short enough not to delay seeing who won. */
@keyframes result-stamp {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.82); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .fighter-result {
    animation: none; opacity: 1; transform: translate(-50%, -50%);
  }
  .panel-tag-changed { animation: none; }
  .bet-clock-label {
    animation: none; opacity: 1; text-shadow: 0 0 10px currentColor;
  }
}


/* -- queue ticket ---------------------------------------------- */

.queue-ticket {
  position: fixed; left: 1rem; bottom: 1rem; z-index: 40;
  background: var(--surface); border: 1px solid var(--line-warm);
  border-radius: var(--r); padding: .8rem 1.1rem; min-width: 10rem;
  box-shadow: 0 8px 28px rgba(0,0,0,.45);
}
.queue-label {
  font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.queue-number {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 2.1rem; font-weight: 600; line-height: 1.1; color: var(--ember);
}
.queue-note { margin: .1rem 0 0; font-size: .82rem; color: var(--muted); }
.queue-ticket-now { border-color: rgba(255, 208, 0, .5); background: linear-gradient(180deg, var(--teal-dim), var(--surface) 70%); }
.queue-ticket-now .queue-number { color: #ffe14d; font-size: 1.7rem; }

/* A position only ever falls, so a brief flash is enough to notice it. */
.queue-ticket-moved { animation: queue-drop .9s ease; }
@keyframes queue-drop {
  0%   { transform: translateY(-6px); border-color: var(--ember); }
  100% { transform: none; }
}
.figure-changed { animation: figure-flash 1.2s ease; }
@keyframes figure-flash { 0% { color: var(--teal); } 100% { color: inherit; } }

@media (prefers-reduced-motion: reduce) {
  .queue-ticket-moved, .figure-changed { animation: none; }
}

/* -- ban notice ------------------------------------------------ */

/* Covers the page rather than sitting beside it. A banned player can still
   read the site underneath -- they have to be able to, or they would never
   see why -- but nothing they can do from here moves any currency. */
.ban-shade {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: var(--pad);
  background: rgba(6, 6, 6, .78); backdrop-filter: blur(3px);
}
.ban-panel {
  background: var(--surface); border: 1px solid rgba(217, 97, 76, .5);
  border-radius: var(--r); padding: clamp(1.1rem, 4vw, 1.8rem);
  max-width: 30rem; box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
}
.ban-label {
  margin: 0; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: #eb907c; font-weight: 600;
}
.ban-clock {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: clamp(1.7rem, 6vw, 2.4rem); line-height: 1.1;
  margin: .1rem 0 .2rem; color: var(--text);
}
.ban-reason {
  background: var(--surface-2); border-left: 3px solid rgba(217, 97, 76, .6);
  border-radius: 4px; padding: .6rem .8rem; margin: .7rem 0;
}

/* -- modal ----------------------------------------------------- */

.modal-shade {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center; padding: var(--pad);
  background: rgba(6, 6, 6, .72);
}
.modal {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1.1rem 1.2rem;
  width: min(44rem, 100%); max-height: min(80vh, 44rem); overflow: auto;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
}
.modal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.modal-head h2 { margin: 0; }
.modal-body { margin-top: .6rem; }

.stat-button {
  font: inherit; text-align: left; cursor: pointer; width: 100%;
  color: inherit;
}
.stat-button:hover { border-color: var(--dim); }
.stat-button:hover .stat-note { color: var(--muted); }

/* -- users ----------------------------------------------------- */

.user-face {
  border-radius: 50%; object-fit: cover; flex: none;
  border: 1px solid var(--line); background: var(--surface-2);
}
.user-cell { display: flex; align-items: center; gap: .5rem; }

/* One row per player. A list this shape is read by running an eye down one
   column, so the columns have to line up between rows -- hence a grid with
   fixed tracks rather than each row flexing to its own content. */
.urows {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  /* Deliberately not `overflow: hidden`. That was here to round the corners
     of the first and last rows, and it also cut off every menu a row opens --
     a dropdown near the bottom of the list simply ended at the container's
     edge. The rows round their own corners instead. */
}
.urow:first-child { border-top-left-radius: var(--r); border-top-right-radius: var(--r); }
.urow:last-child  { border-bottom-left-radius: var(--r); border-bottom-right-radius: var(--r); }
.urow {
  display: grid;
  /* face | who | balance | actions. Placed explicitly rather than by source
     order, because staff get no balance element and the buttons still have to
     finish at the right edge -- an empty track collapses, a shifted one does
     not. */
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center; gap: .9rem;
  padding: .7rem .9rem;
  border-top: 1px solid var(--line);
}
.urow > .urow-face    { grid-column: 1; }
.urow > .urow-who     { grid-column: 2; }
.urow > .urow-balance { grid-column: 3; }
.urow > .urow-actions { grid-column: 4; justify-self: end; }
.urow:first-child { border-top: 0; }
.urow:hover { background: var(--surface-2); }
.urow-banned { background: var(--crimson-dim); }

.urow-face {
  border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line); background: var(--surface-2);
}
.urow-who { min-width: 0; }
.urow-name {
  display: flex; align-items: center; gap: .45rem;
  font-weight: 650; font-size: 1.02rem; min-width: 0;
}
/* The name truncates; the pills beside it do not, so a long character name
   cannot push the role or ban badge off the end of the row. */
.urow-name > .pill { flex: none; }
.urow-ign { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.urow-sub {
  color: var(--dim); font-size: .8rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.urow-balance { text-align: right; white-space: nowrap; }
.urow-balance .figure { font-size: 1.15rem; }

.urow-actions { display: flex; align-items: center; gap: .4rem; }
.urow-actions form { margin: 0; }

/* The ban sits under its own row rather than in a column, because the reason
   is a sentence and a sentence does not belong in a fixed-width cell. */
.urow-ban {
  grid-column: 1 / -1; font-size: .85rem; color: #eb907c;
  border-top: 1px dashed rgba(217, 97, 76, .35);
  margin-top: .2rem; padding-top: .5rem;
}

/* -- a button that drops its own form ------------------------- */

.drop { position: relative; }
.drop > summary {
  list-style: none; cursor: pointer; display: inline-block; white-space: nowrap;
}
.drop > summary::-webkit-details-marker { display: none; }
.drop[open] > summary { border-color: var(--ember); color: #fff; }
.drop-panel {
  position: absolute; right: 0; top: calc(100% + .35rem); z-index: 30;
  width: max(22rem, 100%); max-width: calc(100vw - 2rem);
  background: var(--surface-2); border: 1px solid var(--line-warm);
  border-radius: var(--r); padding: .8rem .9rem;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .55);
  text-align: left; white-space: normal;
  /* Taller than the window is possible -- the credits menu carries three
     fields and two paragraphs -- so it scrolls inside itself rather than
     running off the bottom with its buttons out of reach. */
  max-height: min(70vh, 30rem); overflow-y: auto; overscroll-behavior: contain;
}
.drop-panel > * + * { margin-top: .6rem; }
.drop-panel .stack > * + * { margin-top: .6rem; }
.drop-panel .fine { margin: .4rem 0 0; }

.btn-danger { color: #eb907c; border-color: rgba(217, 97, 76, .45); }
.btn-danger:hover:not(:disabled) { border-color: #eb907c; color: #fff; background: var(--crimson-dim); }

/* Narrow screens: the row stops being a row. The balance and the buttons drop
   under the name rather than squeezing it to nothing. */
@media (max-width: 40rem) {
  .urow { grid-template-columns: auto minmax(0, 1fr); }
  .urow-balance { grid-column: 2; text-align: left; }
  .urow-actions { grid-column: 1 / -1; flex-wrap: wrap; }
  .drop-panel { right: auto; left: 0; }
}

/* -- leaderboard ----------------------------------------------- */

.board { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .35rem; }
.board-row {
  display: grid; grid-template-columns: 1.6rem 40px 1fr auto;
  align-items: center; gap: .7rem;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: .45rem .7rem;
}
.board-top { border-color: var(--line-warm); background: linear-gradient(90deg, var(--ember-dim), var(--surface-2) 55%); }
.board-rank {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  color: var(--dim); text-align: right; font-size: .95rem;
}
.board-top .board-rank { color: var(--ember); font-weight: 700; }
.board-face { border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.board-who { min-width: 0; display: grid; }
.board-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-record { font-variant-numeric: tabular-nums; white-space: nowrap; }
.board-wins { font-size: 1.1rem; font-weight: 650; color: var(--teal); }

/* -- tickets ---------------------------------------------------- */

.ticket { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .8rem; }
.ticket:first-of-type { border-top: 0; }
.ticket-head { display: flex; align-items: center; gap: .6rem; }
.ticket-head .grow { min-width: 0; }
.ticket-body {
  background: var(--surface-2); border-radius: 7px;
  padding: .55rem .8rem; margin: .5rem 0;
}
.ticket-reply {
  border-left: 3px solid var(--teal); background: var(--teal-dim);
  border-radius: 4px; padding: .5rem .8rem; margin: .4rem 0 0;
  color: #ffe14d;
}
.ticket-closed { opacity: .72; }

/* -- the account badge ----------------------------------------- */

/* Face, name and balance in one chip, with signing out behind it. It is an
   action taken once in a while and it was sitting beside the links people use
   constantly, one mis-click from throwing away a session. */
.account > summary.account-badge {
  display: flex; align-items: center; gap: .5rem;
  padding: .28rem .7rem .28rem .32rem; border-radius: 999px;
  background: rgba(16, 16, 16, .78);
  border: 1px solid rgba(255, 255, 255, .10);
  backdrop-filter: blur(8px);
  cursor: pointer; list-style: none; white-space: nowrap;
}
.account > summary::-webkit-details-marker { display: none; }
.account > summary:hover { border-color: var(--dim); }
.account[open] > summary { border-color: var(--ember); }

.account-face {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none;
  border: 1px solid var(--line); background: var(--surface-2);
}
.account-name { font-weight: 600; font-size: .9rem; }

/* Green because it is the one figure on the page that is the person's own
   money, and it changes under them while they read. */
.account-cash {
  display: flex; align-items: center; gap: .3rem;
  color: var(--teal); font-weight: 650;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: .9rem;
  padding-left: .5rem; border-left: 1px solid var(--line);
}
.cash-bag { width: 18px; height: 18px; object-fit: contain; display: block; }

.account-menu { width: max-content; min-width: 11rem; }

/* -- the balance figure ---------------------------------------- */

/* The bag stands where the currency letter used to, so it is sized against
   the figure rather than given a size of its own. */
.balance-figure { display: flex; align-items: center; gap: .55rem; }
.balance-bag {
  width: clamp(2.1rem, 6vw, 3rem); height: auto; flex: none;
  object-fit: contain; display: block;
}
.balance-main .balance-figure .figure {
  font-size: clamp(2.1rem, 7vw, 3rem); color: var(--ember); line-height: 1.05;
}

/* -- a page whose heading is artwork --------------------------- */

/* Sized by height, like the header wordmark: it is a heading, and a heading
   that takes a third of the screen before a word of content is a banner by
   accident. Width follows, and is capped so a narrow screen cannot overflow. */
.page-crest {
  display: block; margin: .2rem auto .8rem;
  height: clamp(4.5rem, 13vw, 9rem); width: auto; max-width: 100%;
}

/* -- owner maintenance ----------------------------------------- */

.maint h3 { margin: 0 0 .3rem; font-size: 1rem; }
.maint p { margin: 0 0 .7rem; }
.maint form { margin: 0; }
.maint .row { gap: .5rem; }

.record-reset {
  border-top: 1px solid var(--line); margin-top: .7rem; padding-top: .7rem;
}
.record-reset form { margin: 0; }

/* -- the four kings -------------------------------------------- */

/* Sits at the foot of the page now, after the results, so it needs a
   clear gap above it to read as its own section rather than a tail on
   whatever ended last. */
.kings-heading { text-align: center; margin: 2.6rem 0 .6rem; max-width: none; }
.kings {
  display: grid; gap: clamp(.5rem, 2vw, 1rem);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1.4rem;
}

/* The frame is drawn around a hole, so the portrait sits behind it and shows
   through. The window is a fixed fraction of the artwork -- which is why the
   frames are trimmed to their own edges when they are built, so that fraction
   means the same thing on all four. */
.king-window { position: relative; aspect-ratio: 1414 / 2000; }
.king-frame {
  position: relative; z-index: 2;
  width: 100%; height: 100%; display: block; object-fit: contain;
}
/* A round badge centred in the frame's window, rather than a portrait
   stretched to fill it. The frames are ornate and the window is not quite
   square, so filling it cropped faces oddly and made every king a different
   shape; a circle of fixed size sits the same way in all four. */
.king-face {
  position: absolute; z-index: 1;
  /* Dead centre of the frame, not two thirds up it. The window is close
     enough to centred that sitting the badge high left a gap below it and
     none above. */
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 46%; aspect-ratio: 1; height: auto;
  border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .22);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .55);
  background: var(--surface-2);
}
.king-vacant .king-window { filter: grayscale(.7) brightness(.62); }

.king-name {
  margin-top: .3rem; text-align: center;
  font-weight: 700; color: var(--ember);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.king-open { color: var(--dim); font-weight: 500; font-style: italic; }
.king-title {
  text-align: center; color: var(--muted);
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
}

@media (max-width: 44rem) {
  /* Two across rather than four squeezed into a phone, where a quarter of the
     width leaves a face too small to recognise. */
  .kings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* -- betting countdown ----------------------------------------- */

/* Above the faces, centred, in the same green used for a player's own money.
   The figure comes from the server's stored deadline, so it is the same
   moment for everyone watching. */
.bet-clock { text-align: center; margin: .2rem 0 .4rem; }
/* Green like the figure it labels, and pulsing on the same rhythm as the
   OPEN tag on the frame -- the two say the same thing and should beat
   together rather than at odds. The glow is `currentColor`, so when the last
   thirty seconds turn the clock red the label follows without a second rule
   to keep in step. */
.bet-clock-label {
  display: block; font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--teal); font-weight: 650;
  animation: clock-live 2.4s ease-in-out infinite;
}
@keyframes clock-live {
  0%, 100% { opacity: .68; text-shadow: none; }
  50%      { opacity: 1;   text-shadow: 0 0 10px currentColor; }
}
.bet-clock-time {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 700; color: var(--teal);
  line-height: 1.1;
}
/* The last thirty seconds, so a late bet is a decision rather than a surprise. */
.bet-clock-urgent .bet-clock-time,
.bet-clock-urgent .bet-clock-label { color: #eb907c; }
.bet-clock-over .bet-clock-time { color: var(--dim); }
.bet-clock-over .bet-clock-label {
  animation: none; opacity: 1; color: var(--dim); text-shadow: none;
}

/* -- a finished duel, holding its place ------------------------ */

/* It stays at the top of the board for half a minute with its result up,
   then steps aside. The fade is on the way out only: arriving should be
   sudden, because that is the moment worth catching. */
.duel-held { animation: held-settle .5s ease-out both; }
@keyframes held-settle {
  from { opacity: .35; }
  to   { opacity: 1; }
}
.duel-leaving {
  animation: held-leave .6s ease-in both;
  pointer-events: none;
}
@keyframes held-leave {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-8px); }
}
@media (prefers-reduced-motion: reduce) {
  .duel-held, .duel-leaving { animation: none; }
  .duel-leaving { opacity: 0; }
}

/* -- king challenges ------------------------------------------- */

.btn-gold { background: var(--ember); border-color: var(--ember); color: #000; }
.btn-gold:hover:not(:disabled) {
  background: var(--ember-lit); border-color: var(--ember-lit); color: #000;
}
.pill-gold { color: var(--ember); border-color: var(--line-warm); }
/* Gold, not white: the headline duel of an event should not have to be picked
   out of a queue of ordinary requests. */
.king-challenge td, .king-challenge strong { color: var(--ember); }
.king-challenge { background: var(--ember-dim); }

.challenge-card { border-color: var(--line-warm); }
.crown h3 { margin: 0 0 .1rem; font-size: 1rem; color: var(--ember); }

/* -- betting figures, under the frame -------------------------- */

/* Left, centre, right -- the same order as the panel above, so a name is in
   the same place in both. White rather than the dimmed grey used for notes:
   these are the numbers someone is deciding on. */
.betting {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: clamp(.6rem, 2vw, 1.4rem);
  margin-bottom: .6rem; color: #fff;
}
.betting-a { justify-self: start; }
.betting-b { justify-self: end; }
/* `width: 100%` on a grid item whose track is already `1fr` overflowed the
   track once the max-width bound, which is what pushed the right-hand block
   off the card. The track sizes it; it only needs a ceiling. */
.betting-side { min-width: 0; max-width: 20rem; }
.betting-b .side-head, .betting-b .side-figures { flex-direction: row-reverse; }
.betting .side { background: none; border: 0; padding: 0; }
.betting .side-figures .num, .betting .side strong { color: #fff; }

.betting-pot { text-align: center; white-space: nowrap; }
.pot-label {
  display: block; font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
/* The bag anchors the left and the figure grows away from it, so a pot that
   climbs during betting extends rightwards instead of pushing the icon
   about. */
.pot-value { display: inline-flex; align-items: center; gap: .45rem; }
.pot-bag {
  width: clamp(1.5rem, 3vw, 2.1rem); height: auto; flex: none;
  object-fit: contain; display: block;
}
.pot-figure {
  font-size: clamp(1.2rem, 3vw, 1.7rem); font-weight: 700; color: #fff;
}

@media (max-width: 40rem) {
  /* The three columns stop fitting; the pot goes under the two names. */
  .betting { grid-template-columns: 1fr 1fr; }
  .betting-pot { grid-column: 1 / -1; grid-row: 1; margin-bottom: .3rem; }
  .betting-b .side-head, .betting-b .side-figures { flex-direction: row; }
  .betting-b { justify-self: stretch; }
}

/* -- the queue of upcoming matches ----------------------------- */

/* Two across, filling left to right and then down, so the next match is top
   left and the order reads the way a list does. */
.duel-queue {
  list-style: none; margin: .4rem 0 0; padding: 0;
  display: grid; gap: .6rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.queue-match {
  position: relative;
  display: grid; align-items: center; gap: .6rem;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .5rem .9rem;
  backdrop-filter: blur(8px);
}

.qm-side { display: flex; align-items: center; gap: .5rem; min-width: 0; }
/* The second name runs back towards the middle, so the two faces sit either
   side of the VS rather than both leaning left. */
.queue-match .qm-side:last-of-type { flex-direction: row-reverse; }
.qm-face {
  width: clamp(26px, 3.4vw, 38px); aspect-ratio: 1; flex: none;
  border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line); background: var(--surface-2);
}
.qm-name {
  font-weight: 650; font-size: clamp(.8rem, 1.2vw, .98rem);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* The position number sits over the VS, which is what makes the pill read as
   a queue rather than as a fixture list. */
.qm-mid { text-align: center; line-height: 1.1; flex: none; }
.qm-no {
  display: block;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: clamp(.95rem, 1.6vw, 1.15rem); font-weight: 700;
  color: var(--text);
}
.qm-vs { display: block; width: 3.4rem; height: auto; margin: .1rem auto 0; }
.qm-format {
  display: block; margin-top: .1rem;
  font-size: .58rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--dim); white-space: nowrap;
}

/* A match with a king in it. Gold and pulsing on the same rhythm as the
   betting clock -- these are the headline duel of an event, and a queue that
   buries one among the ordinary ones is a queue where it gets missed. */
.queue-king {
  border-color: var(--line-warm);
  background: linear-gradient(180deg, var(--ember-dim), transparent 70%), var(--surface-2);
}
.queue-king .qm-name,
.queue-king .qm-no { color: var(--ember); }
.queue-king .qm-format { color: rgba(255, 208, 0, .7); }
.queue-king .qm-face { border-color: var(--line-warm); }
/* The staff toggle, tucked under the pill's own controls. Deliberately quiet:
   it is for two people and everyone else has to look past it. */
.qm-staff {
  grid-column: 1 / -1;
  display: flex; gap: .3rem; justify-content: center;
  margin-top: .1rem;
}
.qm-staff select {
  font-size: .7rem; padding: .12rem .3rem;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px;
}
.qm-staff .btn {
  font-size: .68rem; padding: .12rem .5rem;
  color: var(--dim); border-color: var(--line);
}
.qm-staff .btn:hover { color: var(--ember); border-color: var(--line-warm); }

.qm-crown {
  position: absolute; top: -.55rem; left: 50%; transform: translateX(-50%);
  font-size: .56rem; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 700; color: var(--ember);
  background: var(--surface-2); border: 1px solid var(--line-warm);
  border-radius: 999px; padding: .1rem .5rem;
  animation: clock-live 2.4s ease-in-out infinite;
}
.queue-king .qm-name { animation: clock-live 2.4s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .qm-crown, .queue-king .qm-name { animation: none; opacity: 1; }
}

@media (max-width: 46rem) {
  /* One across on a phone: two of these squeeze both names to nothing. */
  .duel-queue { grid-template-columns: minmax(0, 1fr); }
}

/* -- reordering the queue -------------------------------------- */

.head-right {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  flex: none;
}

/* Stacked, on the right of the card under the state pill: up is earlier and
   down is later, which is the same direction the queue reads on the board. */
.queue-move { display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.queue-move form { margin: 0; line-height: 0; }

.qm-arrow {
  background: none; border: 0; padding: .1rem .2rem; cursor: pointer;
  color: var(--ember); line-height: 0;
}
.qm-arrow svg { width: clamp(20px, 2.4vw, 28px); height: auto; display: block; }
.qm-arrow svg path {
  fill: currentColor;
  stroke: rgba(0, 0, 0, .55); stroke-width: 1.5; stroke-linejoin: round;
}
.qm-arrow:hover:not(:disabled) { color: var(--ember-lit); }
.qm-arrow:hover:not(:disabled) svg { filter: drop-shadow(0 0 6px var(--ember-dim)); }
/* At the end of the queue there is nowhere to go, so the arrow says so
   rather than posting a move that would be refused. */
.qm-arrow:disabled { color: var(--line); cursor: not-allowed; }

.queue-pos {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: .78rem; font-weight: 700; color: var(--muted);
}

/* -- the stage: a duel and its commentator --------------------- */

/* Side by side, with the two frames exactly as tall as each other.
   Stretching one to match the other does not work when both have an aspect
   ratio -- the width then depends on the height and the height on the width.
   Instead the columns are given the ratio that makes the heights come out
   equal: the duel frame is 1672:941 and the commentator 400:600, so for
   equal heights the second column is 0.3752 of the first. The maths is done
   once, here, rather than guessed at with a percentage. */
.stage {
  display: grid; align-items: start;
  grid-template-columns: 1fr 0.3979fr;
  gap: clamp(.5rem, 1.5vw, 1rem);
}
.stage-duel { min-width: 0; }
/* The card's own top padding would start the frame a couple of dozen pixels
   below the commentator beside it, so the two would be the same height and
   still not line up. */
.stage-duel .duel-card { margin-bottom: 0; padding-top: 0; }
.stage-duel .duel-panel { margin: 0; }

.commentator { min-width: 0; }
.commentator-window { position: relative; aspect-ratio: 1414 / 2000; }
.commentator-frame {
  position: relative; z-index: 2;
  width: 100%; height: 100%; display: block; object-fit: contain;
}
/* Two windows cut in the frame, measured off the artwork: x 10.7-89.3%, the
   top one y 6.2-46.3% and the bottom one y 50.4-88.5%, each with a black
   strip under it for the name. The seat sits behind the frame, filling its
   window, with the badge centred in it. */
.seat {
  position: absolute; z-index: 1; left: 10.7%; width: 78.6%;
  display: grid; place-items: center; background: #000;
}
.seat-0 { top: 6.2%;  height: 40.1%; }
.seat-1 { top: 50.4%; height: 38.1%; }
.seat-face {
  width: 62%; aspect-ratio: 1; height: auto;
  border-radius: 50%; object-fit: cover;
  border: 3px solid var(--ember);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .55);
  background: var(--surface-2);
}
/* An empty seat, lettered the way the frame letters its own title: black,
   edged in yellow. */
.seat-empty {
  font-family: var(--display); font-weight: 800; font-style: italic;
  text-transform: uppercase; text-align: center; line-height: 1;
  font-size: clamp(1rem, 2.3vw, 1.9rem);
  color: #000; -webkit-text-stroke: 1.5px var(--ember); paint-order: stroke fill;
}
.seat-name {
  position: absolute; z-index: 3; left: 10.7%; width: 78.6%;
  text-align: center; transform: translateY(-50%);
  font-family: var(--display); font-weight: 700; font-style: italic;
  text-transform: uppercase; letter-spacing: .03em;
  font-size: clamp(.68rem, 1.1vw, .95rem); color: var(--ember);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.seat-name-0 { top: 48.3%; }
.seat-name-1 { top: 90.5%; }

.stage-empty .duel-panel { filter: grayscale(.75) brightness(.6); }
.stage-empty .panel-tag { color: var(--dim); }

@media (max-width: 52rem) {
  /* The commentator goes under the duel on a narrow screen: side by side,
     the frame would be too small to make out either face. */
  .stage { grid-template-columns: minmax(0, 1fr); }
  .commentator { justify-self: center; width: min(46%, 14rem); }
}

/* -- placing a bet, wherever the duel is shown ----------------- */

/* One line: who to back, the bag, the stake. The same control on a queue pill
   and under the stage frame, so placing a bet is the same gesture whichever
   duel caught someone's eye. */
.betline { display: flex; justify-content: flex-end; margin-top: .4rem; }
.betline-form { display: flex; align-items: center; gap: .35rem; margin: 0; }
.betline-form select {
  width: auto; min-width: 6rem; max-width: 9rem;
  padding: .3rem .45rem; font-size: .82rem;
}
.betline-form input[name="amount"] {
  width: 6.5rem; padding: .3rem .5rem; font-size: .82rem;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}
.betline-form .btn { padding: .34rem .8rem; font-size: .82rem; }
.betline-bag {
  width: 1.5rem; height: auto; flex: none;
  object-fit: contain; display: block;
}

/* Once placed, the form is gone and this is what is left. */
.betline-locked {
  display: flex; align-items: center; gap: .4rem;
  padding: .22rem .6rem; border-radius: 999px;
  background: var(--ember-dim); border: 1px solid var(--line-warm);
}
.betline-who {
  font-weight: 650; font-size: .82rem; color: var(--ember);
  max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.betline-amount { font-weight: 700; font-size: .88rem; color: #fff; }

.betline-error {
  margin: .3rem 0 0; font-size: .78rem; color: #eb907c; text-align: right;
}

/* On the stage it is centred under the frame rather than tucked to one side:
   there is only one duel there and it is the point of the page. */
.stage-duel .betline { justify-content: center; margin-top: .6rem; }

/* The pill puts it on its own row across the bottom, right-aligned. */
.queue-match .betline { grid-column: 1 / -1; }

@media (max-width: 30rem) {
  .betline-form { flex-wrap: wrap; justify-content: flex-end; }
}

/* -- turning a request away ------------------------------------ */

/* One row, one click. The reason box is optional and narrow: most rejections
   are housekeeping, and a form that demands a sentence for each one is a form
   staff stop filling in. */
.reject-form {
  display: flex; align-items: center; gap: .4rem;
  justify-content: flex-end; margin: 0;
}
.reject-form input {
  width: 11rem; padding: .28rem .5rem; font-size: .8rem;
}
.reject-form .btn { padding: .3rem .75rem; font-size: .8rem; }

@media (max-width: 46rem) {
  .reject-form { flex-wrap: wrap; }
  .reject-form input { width: 100%; }
}

/* -- auctions ------------------------------------------------------ */

/* One card under the hammer at a time, shown whole and centred. The window in
   the frame is a hole rather than paint, so the card goes *behind* the
   artwork and the chain closes over its edges -- the same way the
   commentator's face sits behind its frame. */
.auction-stage { margin: 0 0 1.2rem; }

/* Sized to come out about as tall as the commentator panel on the duel page,
   which is roughly 41% of the content width. This frame is 452:800, so the
   same height wants about 24rem of width at the widest the page ever gets. */
.auction-frame {
  position: relative; margin-inline: auto;
  width: clamp(16rem, 37vw, 27rem); max-width: 100%;
}
.auction-frame-art {
  position: relative; z-index: 1;
  width: 100%; height: auto; display: block;
}

/* The card is set inside the opening with a margin all round, rather than
   run under the chain. Measured off the artwork, the opening is x 14-86.7%
   and y 29.4-90.8%, narrowing to 15.9-85.4% where the chain twists inward;
   the card is centred on that and cut small enough to clear the narrow
   points. The margin shows the page behind, which is near black, so it reads
   as a dark mount around the card.

   The two shapes are not the same proportion -- the opening is 0.64 wide to
   tall, the card 0.686 -- so width runs out first and the top and bottom
   margins come out a little deeper than the sides. That looks right: a card
   sitting in a mount, not a photo trimmed to fit. */
/* The new frame's screen is painted black at x 6.5-93.4%, y 10.9-84.7%, so
   the card sits on top of it, centred, with a little black showing round it. */
.auction-frame-window {
  position: absolute; z-index: 2;
  left: 50%; top: 47.8%; transform: translate(-50%, -50%);
  width: 80%;
}
.auction-frame-window img {
  width: 100%; height: auto; display: block;
}

/* A foil sweep, used on the card under the hammer and on the duels that are
   worth looking at. One implementation, because two copies of an animation
   drift apart and then nobody knows which is right.

   The light moves *inside* the element rather than being a band that slides
   across it, so nothing ever overflows and the element needs no `overflow:
   hidden` to be tidy. That matters: the queue pill hangs its "King duel"
   badge above its own top edge, and clipping to the pill would cut it off.

   It runs on its own rather than on hover. Half the people looking at this
   are on a phone and have nothing to hover with. */
/* The host must position itself. This rule deliberately does not set
   `position: relative`, because that clobbers a host that is positioned some
   other way: the auction card is `position: absolute`, both selectors are one
   class deep, and whichever is written later in this file wins. It was this
   one, and the card dropped out of the frame and into the page flow. */
.shimmer::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  /* Narrow and fairly bright. A wide, faint band washes over the artwork and
     reads as nothing at all -- it should look like light catching one strip
     of foil, not like the thing underneath has gone pale. */
  background: linear-gradient(105deg,
    transparent 40%,
    rgba(255, 255, 255, .45) 50%,
    transparent 60%);
  background-size: 300% 100%;
  background-position: 200% 0;
  animation: shimmer-sweep 5.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shimmer-sweep {
  /* Nearly three quarters of the cycle is the pause. The sweep is the tail
     end of it, so it reads as an occasional glint rather than a loop. */
  0%, 72% { background-position: 200% 0; }
  100%    { background-position: -100% 0; }
}

/* A duel that is worth stopping for: a challenge, or one king calling out
   another. The border breathes gold so it is picked out from the ordinary
   pills around it before a word has been read. */
@keyframes crown-flash {
  0%, 100% {
    border-color: var(--line-warm);
    box-shadow: 0 0 0 rgba(255, 208, 0, 0);
  }
  50% {
    border-color: var(--ember);
    box-shadow: 0 0 16px rgba(255, 208, 0, .3);
  }
}
.crowned {
  border: 1px solid var(--line-warm);
  animation: crown-flash 2.2s ease-in-out infinite;
}

/* The call-to-arms pill: the sentence in the middle, the button on the right,
   laid out to sit exactly where the Get matched pill above it does so the two
   read as one column of controls rather than two designs. */
.crown-call {
  position: relative;            /* the shimmer above is drawn against this */
  align-items: center;
  gap: 1rem;
  padding: .85rem 1rem;
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--ember-dim), transparent 70%),
              var(--surface-2);
}
.crown-call-word {
  flex: 1 1 12rem; min-width: 0; text-align: center;
  font-weight: 700; letter-spacing: .04em;
  font-size: clamp(.95rem, 2.4vw, 1.15rem);
  color: var(--ember);
  text-transform: uppercase;
}
.crown-call-sub {
  display: inline-block;
  text-transform: none; letter-spacing: 0; font-weight: 600;
  color: rgba(255, 208, 0, .78);
  font-size: .85em;
}
.crown-call .btn { flex: none; }

@media (max-width: 34rem) {
  /* Stacked on a phone: the sentence and the button side by side leave both
     too narrow to read. */
  .crown-call { flex-direction: column; align-items: stretch; gap: .6rem; }
  .crown-call .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .shimmer::after { animation: none; }
  .crowned { animation: none; border-color: var(--ember); }
}

.auction-noart {
  display: grid; place-items: center; text-align: center;
  aspect-ratio: 421 / 614; padding: .8rem;
  border: 1px dashed var(--line); border-radius: 6px; color: var(--dim);
  font-size: .85rem;
}
.auction-name {
  margin: .7rem auto 0; max-width: none; text-align: center;
  font-size: clamp(1.05rem, 2.6vw, 1.5rem);
}

/* The duel page's clock, kept to the width of the panels under it so the
   column of the page stays straight. */
.auction-countdown { max-width: 34rem; margin-inline: auto; }
/* The last two minutes are the whole game, so they look like it. */
.auction-closing .countdown-clock {
  color: var(--ember);
  animation: auction-tick 1s steps(2) infinite;
}
@keyframes auction-tick { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
  .auction-closing .countdown-clock { animation: none; }
}

.auction-bidding { max-width: 34rem; margin-inline: auto; }
.auction-top {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: .9rem;
}
.auction-figure { display: flex; align-items: center; gap: .45rem; }
.auction-figure .figure {
  font-size: clamp(1.4rem, 4vw, 1.9rem); line-height: 1; color: var(--ember);
}
.auction-leader {
  font-size: 1.1rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* -- what went before ---------------------------------------------- */

/* A row per sale, read left to right: the card, its name, who took it, what
   it cost. Small on purpose -- this is the run of prices, not the auction. */
.sold { display: grid; gap: .45rem; margin-bottom: .6rem; }
.sold-row {
  display: grid; align-items: center; gap: .1rem .8rem;
  grid-template-columns: 2.2rem minmax(0, 1fr) minmax(0, 9rem) auto;
  padding: .4rem .9rem;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px;
}
.sold-art { width: 2.2rem; height: auto; display: block; border-radius: 3px; }
.sold-noart {
  aspect-ratio: 421 / 614; background: var(--surface);
  border: 1px solid var(--line);
}
.sold-card {
  font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sold-who {
  color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sold-price {
  text-align: right; color: var(--ember);
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}

@media (max-width: 40rem) {
  /* Four columns do not fit on a phone, so the winner drops under the card
     name rather than being squeezed to two letters and an ellipsis. */
  .sold-row {
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    border-radius: 14px;
  }
  .sold-art, .sold-noart { grid-row: 1 / span 2; width: 2rem; }
  .sold-card { grid-column: 2; grid-row: 1; }
  .sold-who { grid-column: 2; grid-row: 2; font-size: .8rem; }
  .sold-price { grid-column: 3; grid-row: 1 / span 2; }
}

/* -- other cards up at the same time ------------------------------- */

/* Staff are meant to run one at a time, but if a second is open it is listed
   rather than dropped: somebody may already have credits held on it. */
.auction-also { display: grid; gap: .45rem; margin-bottom: 1rem; }

/* The run someone is on. Ember, because it is the thing on the board that is
   live rather than historical -- wins and losses are a record, a streak is
   something happening now. */
.board-streak {
  display: inline-block; margin-left: .5rem;
  font-size: .68rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; white-space: nowrap;
  color: var(--ember); background: var(--ember-dim);
  border: 1px solid var(--line-warm); border-radius: 999px;
  padding: .08rem .45rem;
}

/* Names only. The codes are deliberately not here -- see admin_links.html. */
.waiting-list {
  list-style: none; margin: .4rem 0 .6rem; padding: 0;
  display: flex; flex-wrap: wrap; gap: .35rem;
}
.waiting-list li {
  font-size: .82rem; padding: .15rem .6rem;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; color: var(--text);
}

/* -- backing a side ------------------------------------------------ */

/* Two halves of a pill rather than a dropdown. Who you are backing is the
   thing worth being certain about before you part with credits, and a closed
   select reads as a line of text much like the one next to it. */
.side-pick {
  display: flex; min-width: 0; flex: 1 1 10rem;
  border: 1px solid var(--line); border-radius: 999px;
  /* A fieldset brings its own border, padding and margin. */
  padding: 0; margin: 0; overflow: hidden;
}
.side-pick label { flex: 1 1 0; min-width: 0; cursor: pointer; }

/* Kept in the layout rather than display:none, so it is still focusable and
   still announced. The visible half is the label beside it. */
.side-pick input {
  position: absolute; opacity: 0; width: 1px; height: 1px;
  pointer-events: none;
}
.side-pick span {
  display: block; padding: .3rem .7rem;
  font-size: .82rem; text-align: center; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  color: var(--muted); background: var(--surface-2);
  transition: background .15s ease, color .15s ease;
}
.side-pick label:hover span { color: var(--text); }

/* Both the pseudo-class and a class the script sets. The pseudo-class alone
   is correct and works without JavaScript; the class is there because this
   highlight is the one thing on the pill that must not be subtly wrong, and
   a second, simpler selector costs nothing to carry. */
.side-pick-a input:checked + span,
.side-pick-a.is-picked span {
  background: var(--side-a); color: #000; font-weight: 700;
}
.side-pick-b input:checked + span,
.side-pick-b.is-picked span {
  background: #000; color: var(--side-b); font-weight: 700;
  box-shadow: inset 0 0 0 2px var(--side-b);
}
/* The keyboard has to show where it is, since the input itself is invisible. */
.side-pick input:focus-visible + span {
  outline: 2px solid var(--ember); outline-offset: -2px;
}
@media (prefers-reduced-motion: reduce) {
  .side-pick span { transition: none; }
}

/* -- the staff side ------------------------------------------------ */

.card-hits { display: grid; gap: .4rem; margin-top: .6rem; }
.card-hit {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  padding: .4rem .6rem; text-align: left; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; color: var(--text);
}
.card-hit:hover { border-color: var(--ember); }
.card-hit img { width: 2rem; height: auto; border-radius: 3px; flex: none; }
.card-hit-name { font-weight: 600; }
.card-hit-type { color: var(--dim); font-size: .8rem; }

/* -- the staff pairing row ---------------------------------------- */
/* The 2v2 tick, sitting to the left of the format so the row reads as one
   sentence: this kind of duel, this format, make it. The box is drawn
   large because it is the one control here that changes what gets built,
   and a default checkbox beside a full-height select reads as an
   afterthought. */
.pair-row { align-items: flex-end; }
.team-check {
  display: flex; align-items: center; gap: .6rem;
  cursor: pointer; user-select: none; white-space: nowrap;
}
.team-check-box { display: grid; justify-items: center; gap: .15rem; }
.team-check-tag {
  font-size: .62rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
.team-check input {
  width: 1.9rem; height: 1.9rem; margin: 0;
  accent-color: var(--gold); cursor: pointer;
}
.team-check:hover .team-check-tag { color: var(--text); }

/* -- a duellist's own page ---------------------------------------- */
/* The board says who is winning and never said anything about you. This
   is the page people screenshot, so the face is large and the record is
   the first thing on it. */
.player-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.player-face {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--line-warm); background: var(--surface-2);
  flex: none;
}
.player-id { min-width: 0; flex: 1 1 12rem; }
.player-rank { text-align: right; margin-left: auto; }
.player-rank-num {
  font-size: clamp(1.6rem, 5vw, 2.4rem); font-weight: 700; line-height: 1;
  color: var(--ember);
}
/* The streak takes the ember too, because it is the one number here that
   is about right now rather than about the whole record. */
.player-streak { color: var(--ember); }
.up { color: var(--teal); }
.down { color: var(--muted); }

/* The board rows link through, so a name on the leaderboard is a way in
   rather than a dead end. */
.board-row a.board-link { color: inherit; text-decoration: none; }
.board-row a.board-link:hover strong { text-decoration: underline; }

/* -- form, under the duel panel ----------------------------------- */
/* What these two have done to each other, and any run either is on.
   Quiet by default: it is context for a decision, not an announcement,
   and it sits between the artwork and the figures people are reading. */
.form-line {
  margin: .5rem 0 0; text-align: center;
  font-size: .82rem; color: var(--muted);
}
.form-line strong { color: var(--text); }
.form-tied { color: var(--muted); }
/* The streak takes the ember, as it does everywhere else -- it is the
   one figure here about right now rather than about the whole record. */
.form-streak { color: var(--ember); font-weight: 600; }

/* -- the artwork's lettering ------------------------------------------ */
/* Headings, buttons and labels take the heavy condensed italic the artwork
   is lettered in. Body text stays in the plain face: paragraphs and figures
   in a display face are harder to read, and the art never sets either. */
h1, h2, h3, .btn, .eyebrow, th, .countdown-label, .notice-title,
.panel-tag, .panel-name span, .king-name, .qm-name {
  font-family: var(--display);
}
h1, h2 {
  font-weight: 800; font-style: italic; text-transform: uppercase;
  letter-spacing: .01em; color: var(--ember);
  text-shadow: 0 2px 0 #000;
}
h1 { font-size: clamp(2.2rem, 5.6vw, 3rem); }
h2 { font-size: 1.45rem; max-width: none; }
h3 { font-weight: 700; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .02em; }
.btn {
  font-weight: 700; font-style: italic; text-transform: uppercase;
  letter-spacing: .04em;
}
.btn-quiet { font-size: 1rem; }
th { font-size: .86rem; font-weight: 600; letter-spacing: .06em; }
.panel-tag { font-weight: 800; font-style: italic; letter-spacing: .06em; font-size: clamp(.7rem, 1.3vw, 1rem); }
.panel-name span { font-weight: 800; font-style: italic; text-transform: uppercase; font-size: clamp(.85rem, 1.8vw, 1.4rem); }
.king-name { font-weight: 700; font-style: italic; text-transform: uppercase; letter-spacing: .03em; }
