/* Everything is uppercase monospace with hard offset shadows and no curves, which is the whole
   look: a cabinet in a dark room. Two accent colours, one per pond, and nothing else. */

:root {
  --night: #0b1410;
  --bog: #101c15;
  --line: #24382a;
  --ink: #07100b;
  --pale: #e8ffd8;
  --bone: #a8c08e;
  --green: #79e04a;
  --purple: #c86bff;
  --fly: #ffe14d;
  --warn: #ff6a5e;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--night);
  color: var(--pale);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  -webkit-text-size-adjust: 100%;
}

body { min-height: 100vh; min-height: 100dvh; }

/* scanlines and a vignette over the whole page */
.crt {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.14) 0 1px, rgba(0, 0, 0, 0) 1px 4px),
    radial-gradient(130% 110% at 50% 45%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.65) 100%);
}

a { color: var(--green); }

/* ---- logo ---- */

.logo {
  margin: 0 0 0.4em;
  line-height: 0.86;
  font-size: 4rem;
  font-size: clamp(2.6rem, 9vw, 5.6rem);
  letter-spacing: 0.04em;
}
.logo span { display: block; }
.logo .l1 { color: var(--pale); text-shadow: 4px 4px 0 var(--ink), 8px 8px 0 #1c2b1f; }
.logo .l2 { color: var(--green); text-shadow: 4px 4px 0 var(--ink), 8px 8px 0 #2b4a1d; }

/* ---- shared page shell ---- */

/* black-translucent puts the web app under the status bar and the home indicator, so every page
   has to keep clear of them. Only the controller used to. */
.shell {
  display: grid;
  place-items: center;
  /* Plain values first: a browser that does not know env() drops the calc below and would
     otherwise be left with no padding at all, which on a TV means text in the overscan. */
  padding: 6vmin 5vw;
  padding:
    calc(6vmin + env(safe-area-inset-top))
    calc(5vw + env(safe-area-inset-right))
    calc(6vmin + env(safe-area-inset-bottom))
    calc(5vw + env(safe-area-inset-left));
}
.hero { width: min(760px, 100%); display: flex; flex-direction: column; }
.narrow { display: none; }
.hero.narrow { width: min(460px, 100%); text-align: center; }
.tag { color: var(--bone); font-size: 0.95rem; margin: 0 0 2.2em; }

button, .big {
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  background: var(--green);
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  padding: 0.8em 1.2em;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
}
button:active, .big:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }

.host-form { margin: 0 0 2.4em; }
.host-form .big { font-size: clamp(1.1rem, 3.4vw, 1.5rem); }
.host-form .sub { display: block; margin-top: 0.9em; color: var(--bone); font-size: 0.72rem; letter-spacing: 0.14em; }

.joiner label { display: block; color: var(--bone); font-size: 0.72rem; margin-bottom: 0.6em; letter-spacing: 0.2em; }
.joiner .row { display: flex; gap: 0.6rem; align-items: stretch; }
.joiner input {
  font: inherit;
  font-size: 1.6rem;
  letter-spacing: 0.4em;
  width: 6.5em;
  text-align: center;
  text-transform: uppercase;
  color: var(--fly);
  background: #0a140d;
  border: 3px solid var(--line);
  padding: 0.3em 0 0.3em 0.4em;
}
.joiner input:focus { outline: none; border-color: var(--fly); }
.joiner button { background: var(--fly); }
.big-joiner { margin-top: 2em; }
.big-joiner .row { justify-content: center; }

.rules { margin-top: 3.4em; border-top: 2px solid var(--line); padding-top: 1.6em; }
.rules h2 { font-size: 0.78rem; letter-spacing: 0.26em; color: var(--bone); margin: 0 0 1.2em; }
.rules ol { margin: 0 0 1.4em; padding-left: 1.4em; line-height: 1.75; font-size: 0.84rem; }
.rules li { margin-bottom: 0.5em; color: var(--pale); }
.rules b { color: var(--green); }
.fine { color: var(--bone); font-size: 0.72rem; line-height: 1.8; text-transform: none; letter-spacing: 0.04em; }
.fine b { color: var(--pale); }
.fine code { color: var(--fly); }
.warn { color: var(--warn); font-size: 0.8rem; }

/* ---- host screen ---- */

body.host { overflow: hidden; }
.hidden { display: none !important; }

.lobby {
  height: 100vh;
  height: 100dvh;
  padding: 3.4vmin 4vmin;
  padding:
    calc(3.4vmin + env(safe-area-inset-top))
    calc(4vmin + env(safe-area-inset-right))
    calc(3.4vmin + env(safe-area-inset-bottom))
    calc(4vmin + env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 2vmin;
  overflow: hidden;
}
.lobby-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 4vmin; flex: 0 1 auto; min-height: 0; }
.lobby-left { min-width: 0; }
.lobby .logo { font-size: 3.4rem; font-size: clamp(2.2rem, 6.4vw, 4.4rem); margin-bottom: 0.5em; }
.lobby-left .fine { margin: 0.5em 0 0; max-width: 36ch; }

.codeblock { text-align: right; }
.goto { margin: 0 0 0.9em; font-size: clamp(0.8rem, 1.8vw, 1.1rem); color: var(--bone); }
.goto b { color: var(--pale); }
.codelabel { margin: 0; font-size: 0.7rem; letter-spacing: 0.3em; color: var(--bone); }
.code {
  margin: 0.1em 0 0.4em;
  font-size: 6rem;
  font-size: clamp(3rem, 11vw, 7rem);
  line-height: 1;
  color: var(--fly);
  letter-spacing: 0.14em;
  text-shadow: 5px 5px 0 var(--ink);
}
#qr { width: clamp(96px, 12vw, 150px); height: auto; border: 4px solid var(--pale); image-rendering: pixelated; }

.ponds { display: grid; grid-template-columns: 1fr 1fr; gap: 2.4vmin; flex: 1 1 0; min-height: 0; }
.pond { border: 3px solid var(--line); padding: 2vmin; }
.pond h2 { margin: 0 0 1.2vmin; font-size: clamp(0.9rem, 2.4vw, 1.5rem); }
.pond.p0 { border-color: #2d5a1c; }
.pond.p0 h2 { color: var(--green); }
.pond.p1 { border-color: #4b1f73; }
.pond.p1 h2 { color: var(--purple); }
.pond ul { list-style: none; margin: 0; padding: 0; }
.pond li {
  display: flex;
  align-items: center;
  gap: 0.8em;
  padding: 0.38em 0.2em;
  border-bottom: 1px solid #16241a;
  font-size: clamp(0.78rem, 1.8vw, 1.1rem);
}
.pond li.empty { color: #35482f; }
.pond li.gone { opacity: 0.4; }
.pond li .nm { flex: 1; }
.pond li .st { font-size: 0.7em; color: var(--bone); }
.pond li.ready .st { color: var(--green); }
.pond li .crown { font-size: 0.62em; color: var(--ink); background: var(--fly); padding: 0.25em 0.5em; }
.pond li .vip { font-size: 0.62em; color: var(--ink); background: var(--pale); padding: 0.25em 0.5em; }

.why { margin: 0; font-size: clamp(0.85rem, 2.2vw, 1.25rem); color: var(--warn); }
.why.go { color: var(--green); }
.format { margin: .5em 0 0; color: var(--fly); font-size: clamp(.68rem, 1.5vw, .86rem); letter-spacing: .08em; max-width: 46ch; }
.lobby .fine { margin: 0; }

.arena { height: 100vh; height: 100dvh; display: grid; place-items: center; position: relative; }
#stage {
  width: 100vw;
  width: min(100vw, calc(100vh * 16 / 9));
  width: min(100vw, calc(100dvh * 16 / 9));
  height: auto;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: pixelated;
  display: block;
}
.floating-code {
  position: fixed;
  bottom: 0.6rem;
  right: 0.9rem;
  margin: 0;
  font-size: 0.7rem;
  color: #567048;
  z-index: 10;
}

.result {
  position: absolute;
  top: 8%; right: 12%; bottom: 8%; left: 12%;
  inset: 8% 12%;
  background: rgba(7, 16, 11, 0.94);
  border: 4px solid var(--pale);
  padding: 3vmin;
  display: grid;
  place-content: center;
  text-align: center;
  z-index: 8;
}
.result h2 { margin: 0; font-size: clamp(1.6rem, 6vw, 4rem); }
.result h2.t0 { color: var(--green); }
.result h2.t1 { color: var(--purple); }
.result .kind { margin: 0.3em 0 1.6em; color: var(--fly); font-size: clamp(0.8rem, 2.4vw, 1.4rem); letter-spacing: 0.3em; }
.result table { border-collapse: collapse; margin: 0 auto; font-size: clamp(0.65rem, 1.6vw, 1rem); }
.result th { color: var(--bone); font-weight: normal; padding: 0.4em 1em; font-size: 0.8em; letter-spacing: 0.2em; }
.result td { padding: 0.35em 1em; }
.result tr.t0 td:first-child { color: var(--green); }
.result tr.t1 td:first-child { color: var(--purple); }
.result .again { margin: 2em 0 0; color: var(--bone); font-size: 0.75rem; }

/* ---- phone ----

   Landscape is the real layout: thumbs on the outside, status in the middle, nothing to reach
   across. Portrait still works (the lobby lives there, and so does anyone with rotation locked),
   it just stacks. */

/* Pinned to the viewport rather than sized with vh. An installed Android app in landscape has a
   different idea of 100vh than the browser does, which pushed the lobby buttons off the bottom; a
   fixed box with inset 0 is exactly the visible area on both platforms, system bars and all. */
body.pad {
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
body.pad.t1 { --green: var(--purple); }

.gate { padding: 7vmin 7vw; text-align: center; overflow-y: auto; }
.gate .logo { font-size: clamp(2rem, 12vw, 3.2rem); }
.roomline { color: var(--bone); font-size: 0.8rem; margin: 0 0 2em; }
.roomline b { color: var(--fly); font-size: 1.6em; letter-spacing: 0.25em; }
.namef { display: grid; gap: 0.9em; }
.namef label { font-size: 0.7rem; letter-spacing: 0.3em; color: var(--bone); }
.namef input {
  font: inherit;
  font-size: 1.5rem;
  text-align: center;
  text-transform: uppercase;
  color: var(--pale);
  background: #0a140d;
  border: 3px solid var(--line);
  padding: 0.5em;
}
.namef input:focus { outline: none; border-color: var(--green); }
.namef button { font-size: 1.2rem; }
.gate .install { margin-top: 2.4em; }
.gate .fine { margin-top: 1.4em; }

.install { background: var(--fly); color: var(--ink); font-size: 0.9rem; }

.deck { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 2.5vmin 3vw; gap: 2vmin; }
.deck.dead { filter: grayscale(0.8) brightness(0.6); }
.status { display: flex; flex-direction: column; gap: 2vmin; min-height: 0; flex: 1; }
.padhead { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; font-size: 0.7rem; }
.padhead .who { color: var(--green); }
.padhead .tally { color: var(--bone); }
.hint {
  margin: 0;
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: clamp(0.95rem, 5vw, 1.5rem);
  line-height: 1.5;
  color: var(--fly);
  border: 2px solid var(--line);
  padding: 0.6em;
}

.lobbyctl { display: grid; gap: 2.2vmin; align-content: center; }
.lobbyctl button { width: 100%; font-size: clamp(0.9rem, 4.4vw, 1.2rem); background: #1b2b1f; color: var(--pale); }
.lobbyctl button.lit { background: var(--green); color: var(--ink); }
.lobbyctl button.start { background: var(--fly); color: var(--ink); font-size: clamp(1.1rem, 5.4vw, 1.5rem); }

.pad-side { display: none; gap: 3vw; min-width: 0; }
.pad-side button {
  width: 100%;
  height: 100%;
  min-height: 0;
  font-size: 1.6rem;
  background: #1b2b1f;
  color: var(--pale);
  border-color: var(--ink);
  display: grid;
  place-content: center;
  padding: 0;
}
.pad-side .dir { font-size: clamp(1.8rem, 7vw, 3rem); }
.pad-side .flap { background: var(--green); color: var(--ink); font-size: clamp(1.3rem, 5vw, 2.2rem); }
.pad-side .drop { font-size: 0.78rem; line-height: 1.3; }
.pad-side .drop small { font-size: 0.78em; color: var(--bone); }
.pad-side .drop.lit { background: var(--fly); color: var(--ink); }
.pad-side button.down { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); filter: brightness(1.35); }

/* in a match the deck becomes a controller */
.deck.playing { display: grid; gap: 3vw; }
.deck.playing .pad-side { display: grid; }
.deck.playing .lobbyctl { display: none; }

@media (orientation: landscape) {
  .deck.playing {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 1fr);
    grid-template-areas: "left status right";
    align-items: stretch;
  }
  .deck.playing .status { grid-area: status; }
  .deck.playing .pad-left { grid-area: left; grid-template-columns: 1fr 1fr; }
  .deck.playing .pad-right { grid-area: right; grid-template-rows: 0.42fr 1fr; }
  .deck.playing .hint { font-size: clamp(0.8rem, 2.6vw, 1.3rem); }
  .deck.playing .padhead {
    flex-direction: column;
    align-items: center;
    gap: 0.25em;
    font-size: 0.6rem;
    white-space: nowrap;
  }
}

@media (orientation: portrait) {
  .deck.playing {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas: "status status" "left right";
    align-content: end;
  }
  .deck.playing .status { grid-area: status; }
  .deck.playing .pad-left { grid-area: left; grid-template-columns: 1fr 1fr; height: 30vh; }
  .deck.playing .pad-right { grid-area: right; grid-template-rows: 0.4fr 1fr; height: 30vh; }
}

/* turn your phone */
.rotate {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  z-index: 20;
  background: var(--night);
  place-content: center;
  text-align: center;
  padding: 10vw;
  gap: 1.2em;
}
body.pad.playing #rotate.armed { display: grid; }
@media (orientation: landscape) { body.pad.playing #rotate.armed { display: none; } }
.rotate .big-line { margin: 0; font-size: clamp(1.3rem, 7vw, 2rem); color: var(--fly); }
.rotate button { background: #1b2b1f; color: var(--bone); font-size: 0.78rem; justify-self: center; }
.phone-turn { justify-self: center; }
.phone-turn .ph {
  display: block;
  width: 52px;
  height: 86px;
  border: 4px solid var(--pale);
  border-radius: 2px;
  animation: turnit 2.4s ease-in-out infinite;
}
@keyframes turnit {
  0%, 30% { transform: rotate(0deg); }
  60%, 100% { transform: rotate(-90deg); }
}
@media (prefers-reduced-motion: reduce) {
  .phone-turn .ph { animation: none; transform: rotate(-90deg); }
}

/* the install hint on the landing page */
.steps { margin-top: 2.6em; border-top: 2px solid var(--line); padding-top: 1.4em; }
.steps h2 { font-size: 0.8rem; letter-spacing: 0.26em; color: var(--green); margin: 0 0 1em; }
.steps ol { margin: 0; padding-left: 1.4em; line-height: 1.9; font-size: 0.84rem; text-transform: none; letter-spacing: 0.03em; }
.steps b { color: var(--fly); }

/* ---- bufos ----

   Faces from bufo.fun, used for players and for the win conditions. They are drawings, not pixel
   art, so they scale smoothly rather than with the nearest-neighbour the canvas uses. Team one's
   bufos are hue-rotated to the purple pond so a face reads as a side at a glance. */

.av, .face, .trophy {
  display: block;
  flex: none;
  image-rendering: auto;
  object-fit: contain;
}
.av { width: clamp(26px, 3.2vw, 44px); height: clamp(26px, 3.2vw, 44px); }
.av.small { width: 24px; height: 24px; }
.av.tiny { width: 20px; height: 20px; display: inline-block; vertical-align: -4px; margin-right: .4em; }
.av.lg { width: clamp(42px, 6.4vw, 70px); height: clamp(42px, 6.4vw, 70px); }
.av.win { width: 54px; height: 54px; margin-bottom: .8em; }
.av.t1, .face.t1, .trophy.t1 { filter: hue-rotate(175deg) saturate(1.25); }

.strip { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 2.4em; }

.wins { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1.4rem; margin-bottom: 1.6em; }
.wincard { border: 2px solid var(--line); padding: 1.1rem; background: #0d1711; }
.wincard h3 { margin: 0 0 .5em; font-size: .78rem; letter-spacing: .18em; color: var(--green); }
.wincard p { margin: 0; font-size: .76rem; color: var(--bone); line-height: 1.7; text-transform: none; letter-spacing: .03em; }
.credit .av.tiny { float: left; margin: .1em .6em 0 0; }

.trophy { width: clamp(64px, 9vw, 112px); height: clamp(64px, 9vw, 112px); margin: 0 auto .4rem; }

.result td:first-child { width: 1px; padding-right: 0; }

.face { width: 30px; height: 30px; }
.padhead { align-items: center; }
.deck.playing .face { width: 22px; height: 22px; }

/* ---- watching the match on your own phone ----

   The room already sends the big screen a packed frame thirty times a second, so the phone gets the
   same thing at twenty and draws it with the same renderer. That is a few hundred bytes a frame
   instead of a video stream, and because it arrives as state rather than pixels each phone can put
   a marker over its own toad. The controls then sit on top at low opacity so you can see through
   them to the game. */

.mirror {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  background: var(--night);
  z-index: 0;
}
body.pad .deck, body.pad .gate { position: relative; z-index: 1; }

.chip {
  font: inherit;
  font-size: .56rem;
  letter-spacing: .14em;
  padding: .45em .7em;
  background: #1b2b1f;
  color: var(--bone);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.chip.lit { background: var(--fly); color: var(--ink); }

/* with the match showing through, the controls get out of the way */
body.pad.mirrored .deck.playing { background: transparent; }
/* With the match behind them the thumb zones get narrower: at the default width they sit right on
   top of both ponds, which are the two things you most need to see. */
@media (orientation: landscape) {
  body.pad.mirrored .deck.playing { grid-template-columns: 26% minmax(0, 1fr) 26%; }
}
body.pad.mirrored .deck.playing .pad-side button {
  background: rgba(27, 43, 31, .26);
  border-color: rgba(7, 16, 11, .5);
  color: rgba(242, 255, 228, .92);
  box-shadow: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .85);
}
body.pad.mirrored .deck.playing .pad-side .flap { background: rgba(121, 224, 74, .28); color: #06230b; border-color: rgba(121, 224, 74, .5); }
body.pad.mirrored .deck.playing .pad-side .drop.lit { background: rgba(255, 225, 77, .5); color: #1a1403; }
body.pad.mirrored .deck.playing .pad-side button.down { background: rgba(121, 224, 74, .5); filter: none; }
body.pad.mirrored .deck.playing .status { justify-content: flex-start; pointer-events: none; }
body.pad.mirrored .deck.playing .status .chip { pointer-events: auto; }
body.pad.mirrored .deck.playing .hint {
  flex: none;
  border-color: transparent;
  background: rgba(7, 16, 11, .62);
  font-size: .62rem;
  line-height: 1.3;
  padding: .35em .5em;
  color: var(--fly);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: center;
}
body.pad.mirrored .deck.playing .padhead { background: rgba(7, 16, 11, .58); padding: .25em .5em; }
body.pad.mirrored .deck.playing .face { display: none; }

/* The buttons fade out when your thumbs go quiet. They keep their hit areas the whole time, so a
   thumb already on one still works, and the press that lands is also what brings them back. */
body.pad.mirrored .deck.playing .pad-side button,
body.pad.mirrored .deck.playing .status {
  transition: opacity .42s ease;
}
body.pad.mirrored .deck.playing.faded .pad-side button { opacity: 0; }
body.pad.mirrored .deck.playing.faded .status { opacity: .22; }

.tapback {
  position: fixed;
  left: 50%;
  bottom: .6rem;
  bottom: calc(.6rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  margin: 0;
  z-index: 2;
  pointer-events: none;
  font-size: .56rem;
  letter-spacing: .22em;
  color: rgba(168, 192, 142, .55);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .9);
  animation: tapfade .42s ease;
}
@keyframes tapfade { from { opacity: 0; } to { opacity: 1; } }

/* ---- the landing page on a phone ----

   Somebody holding a phone is almost certainly joining a room, not hosting one, so the code box
   comes first and the host button drops to a secondary. Everything tightens: on a 390px screen the
   desktop spacing is three screens of scrolling before the rules. */

@media (max-width: 560px) {
  .wide { display: none; }
  .narrow { display: inline; }

  .hero .logo { order: 0; font-size: clamp(2.2rem, 13vw, 3.4rem); margin-bottom: .3em; }
  .hero .tag { order: 1; margin-bottom: 1.5em; font-size: .8rem; }
  .hero .joiner { order: 2; margin-bottom: 2em; }
  .hero .host-form { order: 3; margin-bottom: 1.8em; }
  .hero .strip { order: 4; margin-bottom: 1em; gap: .45rem; }
  .hero .rules { order: 5; margin-top: .4em; padding-top: 1.4em; }

  .joiner label { font-size: .66rem; letter-spacing: .18em; margin-bottom: .8em; color: var(--pale); }
  .joiner .row { gap: .5rem; }
  .joiner input { flex: 1; width: auto; font-size: 1.7rem; letter-spacing: .3em; }
  .joiner button { font-size: 1rem; padding: .8em 1.1em; }

  .host-form .big { font-size: .92rem; background: #1b2b1f; color: var(--pale); width: 100%; }
  .host-form .sub { margin-top: .7em; }

  .strip .av.lg { width: clamp(34px, 11vw, 46px); height: clamp(34px, 11vw, 46px); }

  .rules h2 { margin-bottom: .9em; }
  .wins { gap: .9rem; }
  .wincard { padding: .9rem; display: grid; grid-template-columns: 44px 1fr; gap: .2rem .9rem; align-items: center; }
  .wincard .av.win { width: 44px; height: 44px; margin: 0; grid-row: span 2; }
  .wincard h3 { margin: 0; align-self: end; }
  .wincard p { align-self: start; }
}

/* Installed on a home screen, so stop telling them to install it. */
body.installed .install-hint { display: none; }

/* ---- lobby buttons and the room's roster, on the phone ----

   A dark button with an imperative label means there is something to do; a lit one with a state
   label and a small way back means it is done. The old ready button said "NOT READY" while unlit,
   which reads as the thing it would do rather than the thing it is. */

.lobbyctl button { display: grid; gap: .15em; line-height: 1.2; }
.lobbyctl .lbl { display: block; }
.lobbyctl .sub {
  display: block;
  font-size: .62em;
  letter-spacing: .1em;
  text-transform: lowercase;
  opacity: .65;
}
.lobbyctl button:not(.lit) .sub { display: none; }

.roster { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: .4rem; }
.rcol { border: 2px solid var(--line); padding: .5rem .55rem; min-width: 0; }
.rcol.t0 { border-color: #2d5a1c; }
.rcol.t1 { border-color: #4b1f73; }
.rhead { margin: 0 0 .45em; font-size: .56rem; letter-spacing: .18em; color: var(--bone); }
.rcol.t0 .rhead { color: var(--green); }
.rcol.t1 .rhead { color: var(--purple); }
.rrow {
  display: flex;
  align-items: center;
  gap: .4em;
  padding: .22em 0;
  font-size: .68rem;
  min-width: 0;
}
.rrow.gone { opacity: .4; }
.rrow.me .rnm { color: var(--fly); }
.rav { width: 20px; height: 20px; flex: none; object-fit: contain; }
.rav.t1 { filter: hue-rotate(175deg) saturate(1.25); }
.rnm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rq { flex: none; font-size: .56rem; background: var(--fly); color: var(--ink); padding: .1em .35em; }
.rst { flex: none; font-size: .54rem; letter-spacing: .1em; color: var(--bone); }
.rrow.ready .rst { color: var(--green); }
.rempty { margin: 0; font-size: .6rem; color: #35482f; }
.roster.hidden { display: none; }

@media (orientation: landscape) and (max-height: 540px) {
  .roster { gap: .5rem; margin-bottom: .3rem; }
  .rcol { padding: .35rem .45rem; }
  .rrow { font-size: .6rem; padding: .12em 0; }
  .rav { width: 16px; height: 16px; }
}

/* In the lobby the roster is the interesting thing, not the one line of guidance. */
.deck:not(.playing) .hint {
  flex: none;
  font-size: clamp(.78rem, 3.8vw, 1.05rem);
  padding: .7em;
}
.deck:not(.playing) .roster { flex: 1; align-content: start; }
.deck:not(.playing) .lobbyctl { flex: none; }

@media (orientation: landscape) and (max-height: 540px) {
  .deck:not(.playing) .status { overflow-y: auto; }
  .deck:not(.playing) .lobbyctl { gap: 1.1vmin; }
  .deck:not(.playing) .lobbyctl button { padding: .5em .8em; font-size: .86rem; }
  .deck:not(.playing) .hint { font-size: .74rem; padding: .4em; min-height: 0; }
}

.resethead { color: var(--fly); font-size: 1rem; letter-spacing: .18em; margin: 0 0 1em; }
.status { font-size: .8rem; letter-spacing: .14em; color: var(--bone); margin: 1.6em 0; }
.status.ok { color: var(--green); }
.build { color: #4d6442; letter-spacing: .1em; }
.build a { color: #6f8f4a; }

/* ---- television ----

   An LG set runs the host screen in webOS's browser, driven by a remote: no pointer worth using, no
   keyboard, and on many sets the outer few percent of the picture is cropped by overscan. So the
   lobby keeps clear of the edges on a big viewport, and anything focusable says so loudly, because
   a d-pad is the only way around the page. */

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 4px solid var(--fly);
  outline-offset: 3px;
}
/* focus-visible is newer than these sets, so plain :focus has to carry it there */
button:focus, a:focus, input:focus { outline: 4px solid var(--fly); outline-offset: 3px; }
button:focus:not(:focus-visible), a:focus:not(:focus-visible), input:focus:not(:focus-visible) { outline: none; }

@media (min-width: 1100px) {
  .lobby { padding: 5vmin 5vmin; }
  .shell { padding: 7vmin 7vw; }
  .floating-code { bottom: 2.4vmin; right: 2.8vmin; font-size: .9rem; color: #7a9a66; }
  /* Read from a sofa, not from a desk. */
  .lobby .fine { font-size: 1rem; line-height: 1.9; max-width: 44ch; }
  .lobby .why { font-size: 1.5rem; }
  .lobby .format { font-size: 1.05rem; max-width: 52ch; }
  .result .again { font-size: 1.05rem; }
}

/* Leaving, and being asked to. The kick is deliberately small and sits past the status, because it
   belongs to the VIP and nobody should hit it reaching for anything else. */

.lobbyctl button.leave {
  background: transparent;
  color: var(--bone);
  border-color: var(--line);
  box-shadow: none;
  font-size: .78rem;
  padding: .55em .8em;
}
.lobbyctl button.leave:active { transform: translate(2px, 2px); }

.rkick {
  flex: none;
  font: inherit;
  font-size: .78rem;
  line-height: 1;
  width: 1.9em;
  height: 1.9em;
  padding: 0;
  margin-left: .2em;
  display: grid;
  place-content: center;
  background: transparent;
  color: var(--warn);
  border: 2px solid rgba(255, 106, 94, .45);
  box-shadow: none;
}
.rkick:active { background: var(--warn); color: var(--ink); transform: none; }

/* A way out. On a television this is the only one, short of finding Back on the remote; on a phone
   it beats closing the tab to join a different room. */
.back {
  display: inline-block;
  margin-bottom: 1.2em;
  color: var(--bone);
  font-size: .7rem;
  letter-spacing: .22em;
  text-decoration: none;
  border: 2px solid var(--line);
  padding: .45em .8em;
}
.back:hover, .back:focus { color: var(--pale); border-color: var(--bone); }
.gate .back { margin-bottom: 1.6em; }
@media (min-width: 1100px) { .back { font-size: .95rem; padding: .5em 1em; } }
