/* front_door: Thornheart's challenge (board.py) on the share page, the thank-you page and /board. Loaded after
   site.css and thanks.css. The pixel fonts only at 16, 24, 32 and 48 px; every line height on the 8 px grid. */

/* The result in the share page's hero: the question a shade lighter, the facts under it. */
.hero h1 .q { color: var(--cream); }
.hero .result { margin: 0 0 24px; max-width: 640px; font: var(--t-lead); color: var(--teal); text-wrap: balance; }
a.button.ghost.watchbtn { --b: transparent; }

/* The challenge band: the time to beat beside the top five. */
.band.challenge { background: var(--night-1); box-shadow: inset 0 4px var(--night-3); }
.duo { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: start; }
@media (max-width: 900px) { .duo { grid-template-columns: minmax(0, 1fr); gap: 48px; } }
.target { padding: 32px 40px 40px; background: rgba(1, 9, 27, .7);
  box-shadow: 0 -4px var(--gold), 0 4px var(--gold-lo), -4px 0 var(--gold), 4px 0 var(--gold), 0 24px 48px rgba(0, 0, 0, .35); }
.target h2 { margin: 0 0 16px; }
.target .big { margin: 0 0 8px; font: 48px/64px var(--px-title); color: var(--gold-hi); }
.target p { margin: 0 0 16px; max-width: 40ch; }
.target .friends { color: var(--teal); }
.target .button { margin: 8px 0 0; }
@media (max-width: 700px) { .target { padding: 24px 24px 32px; } .target .button { display: block; text-align: center; } }

/* The board: one row per player, each row a framed strip (a grid, so the frame is the row's own). */
table.board { display: block; width: 100%; margin: 0; font: 16px/24px var(--px); }
table.board thead, table.board tbody { display: block; }
table.board tr { display: grid; grid-template-columns: 56px minmax(0, 1fr) 144px 112px 136px 48px 112px; column-gap: 8px; align-items: center; }
table.board.mini tr { grid-template-columns: 48px minmax(0, 1fr) auto 48px; }
table.board th { padding: 0 16px 8px; text-align: left; font: 16px/24px var(--px); color: var(--muted); font-weight: normal; }
table.board tbody tr { margin: 0 0 16px; background: rgba(1, 9, 27, .72);
  box-shadow: 0 -4px var(--night-3), 0 4px var(--night-3), -4px 0 var(--night-3), 4px 0 var(--night-3); }
table.board td { padding: 12px 16px; color: var(--text); min-width: 0; }
table.board .rk { font: 24px/32px var(--px-title); color: var(--muted); text-align: center; padding-left: 8px; padding-right: 8px; }
table.board tr:nth-child(-n+3) .rk { color: var(--gold); }
table.board .nm { display: block; text-align: left; font: 24px/32px var(--px-title); color: var(--cream); }
table.board .tm { font: 24px/32px var(--px-title); color: var(--gold-hi); white-space: nowrap; }
table.board .opt { white-space: nowrap; color: var(--muted); }
table.board .sub { display: none; font: var(--t-small); color: var(--muted); }      /* "2 tries, 43 min ago": small print (it was 13.3 px of the pixel font, off its grid) */
table.board .sub .watch { margin: 8px 0 4px 4px; }
table.board .wxc { text-align: center; padding-left: 8px; padding-right: 8px; }
table.board .wt { white-space: nowrap; }
table.board tbody tr.me { background: rgba(84, 62, 14, .55); box-shadow: 0 -4px var(--gold), 0 4px var(--gold-lo), -4px 0 var(--gold), 4px 0 var(--gold); }
table.board tr.me .rk, table.board tr.me .nm { color: var(--gold-hi); }
table.board tbody tr.them { box-shadow: 0 -4px var(--teal), 0 4px var(--teal), -4px 0 var(--teal), 4px 0 var(--teal); }
table.board.mini td { padding: 8px 16px; }
table.board.mini .rk, table.board.mini .wxc { padding-left: 8px; padding-right: 8px; }
a.watch { --lipw: 4px; --bandw: 4px; display: inline-block; padding: 4px 16px; font: 16px/24px var(--px); color: var(--cta-ink); background: var(--cta);
  text-decoration: none; box-shadow: 0 -4px var(--cta-edge), -4px 0 var(--cta-edge), 4px 0 var(--cta-edge), 0 var(--lipw) var(--cta-lo), 0 calc(var(--lipw) + 4px) var(--cta-edge), inset 0 var(--bandw) var(--cta-hi); }
a.watch:hover { background: var(--cta-hover); }
@media (max-width: 700px) {
  table.board tr, table.board.mini tr { grid-template-columns: 40px minmax(0, 1fr) auto 40px; }
  table.board .opt, table.board .wt { display: none; }
  table.board .sub { display: block; }
  table.board td, table.board.mini td { padding: 8px 8px; }
  table.board .nm, table.board .tm, table.board .rk { font-size: 16px; line-height: 24px; }
  /* a phone's narrow name column: the names in the narrower pixel face, so "Mystery Speedrunner" takes two lines and
     never runs into its time (the title face set one long word wider than the column) */
  table.board .nm { font-family: var(--px); overflow-wrap: anywhere; }
  /* Watch on a line of its own, tall enough for a thumb (it used to trail the "2 tries, 43 min ago" line and wrap with
     its last word) */
  table.board .sub .watch { display: table; margin: 8px 0 4px; padding: 8px 16px; }
}
.minib .eyebrow { margin: 0 0 8px; }
.few { margin: 16px 0 0; color: var(--teal); }
.more { margin: 4px 0 0; font: 16px/24px var(--px); }      /* a link to more of the board: display */
.more a { display: inline-block; padding: 12px 0; }      /* 40 px tall for a thumb, the line where it was */

/* The weather each run got: small pixel marks. */
.wx { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; vertical-align: middle; }
.wx svg { width: 100%; height: 100%; fill: currentColor; }
.wx-sun { color: var(--gold); }
.wx-rain { color: var(--sky); }
.wx-moon { color: var(--cream); }
.wx-cloud { color: var(--muted); }
.wx-star { color: var(--teal); }
.wx-moon svg, .wx-star svg { width: 18px; height: 21px; }
.wx-cloud svg { height: 15px; }

/* Filters (board.seg): one row per question, the Dream's mode from Gentle up to Hard, then when, nearest first. A
   filter is a switch, not a button: its choices share one frame, flat, with no lip under them, and the one in force
   is the cream one. Gold with a lip is kept for the things that do something (Be next, Wishlist, Play). Each choice
   is 48 px tall so a thumb finds it, and on a phone a row fills the width and never wraps. */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 48px; margin: 0 0 32px; }
.filter { display: flex; align-items: center; gap: 16px; min-width: 0; }
.flabel { font: 16px/24px var(--px); letter-spacing: 2px; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.seg { display: flex; min-width: 0; background: var(--night-0);
  box-shadow: 0 -4px var(--frame), 0 4px var(--frame), -4px 0 var(--frame), 4px 0 var(--frame); }
.seg a { flex: 1 1 auto; box-sizing: border-box; min-height: 48px; padding: 12px 24px; font: 16px/24px var(--px); color: var(--text);
  text-align: center; text-decoration: none; white-space: nowrap; box-shadow: inset 4px 0 var(--frame); }
.seg a:first-child { box-shadow: none; }
.seg a:hover { color: var(--cream); background: var(--night-3); }
.seg a.on, .seg a[aria-current], .seg a[aria-selected=true] { color: #1a1430; background: var(--cream); }
.seg a:focus-visible { position: relative; z-index: 1; outline: 4px solid var(--sky); outline-offset: 4px; }
#boardlist[aria-busy=true] table.board { opacity: .6; }
@media (max-width: 700px) {
  .filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .filter { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .seg a { padding: 12px 4px; }
}
.pager { display: flex; gap: 24px; justify-content: center; margin: 32px 0 0; }
.band.boardband { background: var(--night-1); box-shadow: inset 0 4px var(--night-3); }
.boardband h2 { text-align: center; }
.boardband .quiet.center { margin: 0 auto 24px; }

/* The /board hero: the curtain call, a little shorter. */
.hero.boardhero .hero-in { padding-bottom: 56px; }
.hero.boardhero .quiet { margin: 0; text-align: center; }
.hero.boardhero .cta { justify-content: center; }

/* The thank-you page's result card: the rank said plainly, the friend who brought them, the replay opt-in. */
.runcard.result .rank { margin: 0 0 24px; font: var(--t-lead); color: var(--teal); text-wrap: balance; }
.runcard.result .inall { margin: 16px 0 0; font: 16px/24px var(--px); color: var(--cream); text-wrap: balance; }      /* player-record: every turn so far */
.runcard.result .rank + .inall { margin-top: -8px; }
.runcard .wxtile b { display: flex; align-items: center; height: 40px; }
.runcard .wxtile .wx { width: 32px; height: 32px; }
.runcard .vs { margin: 24px 0 0; padding: 16px 24px; background: rgba(1, 9, 27, .7);
  box-shadow: 0 -4px var(--teal), 0 4px var(--teal), -4px 0 var(--teal), 4px 0 var(--teal); }
.runcard .vs p { margin: 0; color: var(--cream); }
.runcard .vs .eyebrow { margin: 0 0 8px; }
form.replay { margin: 24px 0 0; }
form.replay .quiet { margin: 8px 0 0; }
button.toggle { --b: var(--night-0); --lip: var(--night-0); display: inline-flex; align-items: center; gap: 16px; margin: 0;
  padding: 8px 24px; font: 16px/24px var(--px); color: var(--cream); background: var(--night-0);
  box-shadow: 0 -4px var(--frame-hi), 0 4px var(--frame-hi), -4px 0 var(--frame-hi), 4px 0 var(--frame-hi); }
button.toggle .box { width: 16px; height: 16px; flex: 0 0 auto; background: var(--night-0); box-shadow: 0 0 0 4px var(--cream); }
button.toggle.on .box { background: var(--teal); }
button.toggle:hover { color: var(--gold-hi); }
@media (max-width: 700px) { .target .big { font-size: 32px; line-height: 48px; } button.toggle { text-align: left; } }

/* The welcome page: the top five inside its card. */
.welcomeboard { margin: 40px 0 0; padding: 32px 0 0; box-shadow: 0 -4px var(--night-3); }
.welcomeboard h2 { margin: 0 0 16px; font: 24px/40px var(--px-title); text-align: center; color: var(--cream); font-weight: normal; }
.welcomeboard .few { text-align: center; }
.welcomeboard p.center { margin: 16px 0 0; }

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

/* The result card in the thank-you page's curtain: wide enough for its four tiles on one row. */
.hero.curtain .runcard.result { width: min(960px, 100%); max-width: none; }
@media (min-width: 701px) { .runcard.result .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
table.board.mini thead th { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); padding: 0; }
table.board.mini thead tr { display: block; height: 0; }
.target p { text-wrap: pretty; }
.target .friends { text-wrap: balance; }
/* names.py: the stage name beside a typed first name on the player's own link, and "You" on their own board row */
.hero .aka { margin: -8px 0 24px; font: 16px/24px var(--px); color: var(--muted); }
.hero .aka b { color: var(--cream); font-weight: normal; }
.arena.golive .aka { margin: 0 0 16px; font: 16px/24px var(--px); color: var(--muted); }
.arena.golive .aka b { color: var(--cream); font-weight: normal; }
table.board .you { display: inline-block; margin-top: 4px; padding: 0 8px; font: 16px/24px var(--px); font-weight: normal;
  color: var(--night-0); background: var(--gold); }
#name b.stage { color: var(--gold-hi); font-weight: normal; }

/* ps-build (runkit.py): a player's build. The pips are the game's own HUD pictures (web/runkit.css, runkit_build.py),
   drawn at whole multiples only: 28 x 30 (1x) or 56 x 60 (2x), never smoothed. Hover or tap one for its name. */
.kp { display: inline-block; flex: none; position: relative; width: 28px; height: 30px; vertical-align: middle;
  background: no-repeat 0 0 / 100% 100%; image-rendering: pixelated; }
.kp.x2 { width: 56px; height: 60px; }
.kpl { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; vertical-align: middle; }
.kpgap { width: 4px; }
.bld { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; vertical-align: middle; }
/* the board row: the build on its own line under the name, on every width (a column of its own squeezed the names to
   three lines); the other cells stand beside both lines. A run from before the build has none, and no line. */
table.board th.bldc { display: none; }
table.board tbody td.bldc { grid-column: 2; grid-row: 2; padding-top: 0; margin-top: -4px; }
table.board tbody td.bldc:empty { display: none; }
table.board tbody tr:has(td.bldc:not(:empty)) > td:not(.plr):not(.bldc) { grid-row: 1 / span 2; }
.hrts { display: inline-flex; gap: 2px; }
.hrt { width: 14px; height: 12px; fill: #f05a5a; }          /* the card's hearts: the lives left when it happened */
.hrt.off { fill: #3c435f; }
/* Pure: the HUD's own chip (the Kindle chip's cream, plum and black outline), in the pixel face at 16 px */
.pure { display: inline-block; position: relative; padding: 0 8px; font: 16px/24px var(--px); color: #2e1e28;
  background: #d8cfb2; box-shadow: 0 -2px #0d0a0d, 0 2px #0d0a0d, -2px 0 #0d0a0d, 2px 0 #0d0a0d, 0 4px #0d0a0d; }
.kp[data-tip]:hover::after, .kp[data-tip]:focus::after, .pure[data-tip]:hover::after, .pure[data-tip]:focus::after {
  content: attr(data-tip); position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 5; white-space: nowrap;
  padding: 4px 8px; font: 16px/24px var(--px); color: var(--cream); background: #0d0a0d; pointer-events: none;
  box-shadow: 0 0 0 2px var(--frame-hi); }
.kp:focus, .pure:focus { outline: none; }
.kp:focus-visible, .pure:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
/* the thank-you page and a share page: each pip with its name beside it */
.kpnamed { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 0; padding: 0; list-style: none; }
.kpnamed li { display: flex; align-items: center; gap: 12px; margin: 0; }
.kpn { font: 16px/24px var(--px); color: var(--cream); }
.kpnone { margin: 0; font: 16px/24px var(--px); color: var(--cream); }
.kplives { display: grid; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.kplives li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0; }
.kplives .lf { min-width: 64px; font: 16px/24px var(--px); color: var(--muted); }
.kpq { font: var(--t-small); color: var(--muted); }
.kpnames { margin: 12px 0 0; font: var(--t-body); color: var(--cream); text-wrap: pretty; }
.buildbox .hrt { width: 21px; height: 18px; }                  /* 3 px a heart pixel beside the heading */
.buildbox .hrts { gap: 3px; }
.runcard .buildbox, .target .buildbox { margin: 24px 0 0; padding: 16px 24px 24px; background: rgba(1, 9, 27, .7);
  box-shadow: 0 -4px var(--night-3), 0 4px var(--night-3), -4px 0 var(--night-3), 4px 0 var(--night-3); }
.buildbox .eyebrow { margin: 0 0 16px; }
.buildbox .bldhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 16px; }
.buildbox .bldhead .eyebrow { margin: 0; }
@media (max-width: 700px) { .runcard .buildbox, .target .buildbox { padding: 16px 16px 16px; } .kpnamed { flex-direction: column; gap: 8px; } }

/* /board on a phone (Nov 28): the board first. The hero's wishlist and trailer buttons wait at the bottom (the last band has
   the wishlist; the trailer button comes there too). */
.phoneonly { display: none; }
@media (max-width: 700px) { .hero.boardhero .cta { display: none; } .phoneonly { display: flex; justify-content: center; margin-top: 24px; } }
