/* ---------------------------------------------------------------------------
   couch.css — the Couch: the hub as a console's home screen on a TV.

   A near-black stage and white type. The only colour on screen is the game's
   own, arriving as --g-light, --g-glow, --g-deep: the backdrop's tint, the
   focus glow, the progress bars. Everything is sized in viewport units so it
   scales like a TV interface: the same layout on a laptop as on a wall.
--------------------------------------------------------------------------- */

@property --tint-glow {
  syntax: '<color>';
  inherits: true;
  initial-value: #3a3d4a;
}

@property --tint-deep {
  syntax: '<color>';
  inherits: true;
  initial-value: #0b0c12;
}

:root {
  --stage: #05060a;
  --ink: #f4f5f8;
  --ink-2: rgb(244 245 248 / 0.74);
  --ink-3: rgb(244 245 248 / 0.56);
  --glass: rgb(255 255 255 / 0.09);
  --glass-hi: rgb(255 255 255 / 0.17);
  --line: rgb(255 255 255 / 0.13);
  --face: 'Archivo', 'Archivo Narrow', 'Roboto Condensed', 'Arial Narrow', system-ui, -apple-system, 'Segoe UI',
    sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0.06, 0.68, 0.19);
  --focus-ms: 160ms;
  --fade-ms: 600ms;

  /* The layout, in screen units. The hero ends and the rows begin at
     --hero-end; the rows below hold about 2.3 rails. */
  --gutter: max(20px, 4.4vw);
  --bar-h: clamp(56px, 8.6vh, 108px);
  --hero-end: 56dvh;
  --rails-h: calc(100dvh - var(--hero-end));
  --rail-h: calc(var(--rails-h) / 2.3);
  --rail-font: clamp(13px, 1.95vh, 25px);
  --rail-head: calc(var(--rail-font) * 2.3);
  --tile-h: calc((var(--rail-h) - var(--rail-head)) / 1.14);
  --tile-w: calc(var(--tile-h) * 16 / 9);
  --tile-gap: calc(var(--tile-w) * 0.055);
  /* Room around a row for a focused tile to grow and glow into. */
  --track-pad: calc(var(--tile-h) * 0.2);
  --radius: max(6px, calc(var(--tile-h) * 0.065));

  --type-s: clamp(11px, 1.5vh, 17px);
  --type-m: clamp(13px, 1.8vh, 21px);
  --type-l: clamp(15px, 2.4vh, 30px);

  /* The names player.css reads, in the couch's own values. */
  --light: var(--ink);
  --dust: var(--ink-2);
  --dust-dim: var(--ink-3);
  --hair: var(--line);
  --attract: #fff;
  --attract-ink: var(--stage);
  --room-deep: var(--stage);
  --step--1: var(--type-s);
  --step-2: var(--type-l);

  /* Neutral stand-ins until a game lends its own. */
  --g-light: #c9ccd8;
  --g-glow: #6c7086;
  --g-deep: #0d0e14;

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--stage);
  color: var(--ink);
  font-family: var(--face);
  font-size: var(--type-m);
  font-variation-settings: 'wdth' 100, 'wght' 420;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p,
ul,
dl,
dd,
figure {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

kbd {
  font: inherit;
}

:focus {
  outline: none;
}

/* Every control here draws its own focus; this catches anything that does not. */
:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* On a phone a ring round the button just tapped says nothing. A picked tile
   keeps its ring: on touch, that is how the first tap shows its choice. */
[data-input='touch'] .btn:focus,
[data-input='touch'] .page__back:focus {
  outline: none;
  transform: none;
  box-shadow: none;
}

::selection {
  background: #fff;
  color: var(--stage);
}

/* --- the stage: the focused game, behind everything ------------------------ */

.couch {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--bar-h) 1fr;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--stage);
  transition:
    --tint-glow var(--fade-ms) ease,
    --tint-deep var(--fade-ms) ease;
}

/* The still sits to the right at its own 4:3, fading in from the left, so
   the hero's side of the screen is the game's colour rather than its art. */
.stage__shot {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  bottom: 0;
  width: min(100%, max(64vw, 100dvh * 4 / 3));
  opacity: 0;
  transition: opacity var(--fade-ms) ease;
}

.stage__shot.is-on {
  opacity: 1;
}

.stage__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 72% 38%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 34%);
  mask-image: linear-gradient(90deg, transparent, #000 34%);
  animation: drift 26s ease-in-out infinite alternate;
}

.stage.is-paused img {
  animation-play-state: paused;
}

/* Ken Burns: a slow lean in, as if the camera were breathing. */
@keyframes drift {
  from {
    transform: scale(1.03);
  }
  to {
    transform: scale(1.13) translate(-1.6%, 1.2%);
  }
}

.stage__veil {
  position: absolute;
  inset: 0;
  background:
    /* the bar reads */
    linear-gradient(180deg, rgb(5 6 10 / 0.92) 0%, rgb(5 6 10 / 0.62) 9%, transparent 22%),
    /* the words on the left read */
    linear-gradient(90deg, var(--stage) 0%, rgb(5 6 10 / 0.9) 24%, rgb(5 6 10 / 0.55) 42%, rgb(5 6 10 / 0.12) 64%, transparent 82%),
    /* the rows at the foot read */
    linear-gradient(0deg, var(--stage) 0%, rgb(5 6 10 / 0.97) 38%, rgb(5 6 10 / 0.6) 50%, rgb(5 6 10 / 0.1) 64%, transparent 74%),
    /* the game's own light: its glow from the top corner, its deep round the edges */
    radial-gradient(70% 60% at 100% 0%, color-mix(in srgb, var(--tint-glow) 34%, transparent), transparent 72%),
    radial-gradient(60% 50% at 0% 56%, color-mix(in srgb, var(--tint-glow) 16%, transparent), transparent 80%),
    radial-gradient(140% 120% at 66% 30%, transparent 40%, color-mix(in srgb, var(--tint-deep) 92%, transparent) 100%),
    /* a light still (a menu, a page of text) should not glare over the screen */
    linear-gradient(rgb(5 6 10 / 0.16), rgb(5 6 10 / 0.16));
}

/* --- the bar ------------------------------------------------------------------ */

.bar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 var(--gutter);
  font-size: var(--type-m);
}

.bar__mark {
  display: flex;
  align-items: center;
  gap: 0.75em;
  font-size: inherit;
  white-space: nowrap;
}

.bar__hub {
  font-weight: 800;
  font-variation-settings: 'wdth' 104, 'wght' 820;
  letter-spacing: -0.01em;
}

.bar__room {
  padding-inline-start: 0.75em;
  border-inline-start: 1px solid rgb(255 255 255 / 0.3);
  color: var(--ink-2);
  font-variation-settings: 'wdth' 100, 'wght' 440;
}

.bar__side {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 20px);
}

.bar__views,
.page__views,
.find__views {
  --views-bg: rgb(255 255 255 / 0.06);
  --views-line: rgb(255 255 255 / 0.1);
  --views-ink: #fff;
  --views-ink-dim: var(--ink-2);
  --views-on-bg: #fff;
  --views-on-ink: var(--stage);
  --views-radius: 999px;
  font-size: var(--type-s);
  font-variation-settings: 'wdth' 100, 'wght' 560;
}

.views__button:focus,
.settings-button:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.bar__round {
  display: grid;
  place-items: center;
  width: clamp(38px, 5.4vh, 64px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--glass);
  color: var(--ink);
  transition:
    transform var(--focus-ms) var(--ease),
    background-color 0.15s;
}

.bar__round svg {
  width: 46%;
  height: 46%;
}

.bar__round:hover {
  background: var(--glass-hi);
}

.bar__round:focus {
  outline: none;
  background: #fff;
  color: var(--stage);
  transform: scale(1.08);
}

.bar__pad {
  display: none;
  align-items: center;
  gap: 0.45em;
  color: var(--ink-2);
  font-size: var(--type-s);
  font-variation-settings: 'wdth' 100, 'wght' 560;
}

.bar__pad.is-on {
  display: inline-flex;
}

.bar__pad svg {
  width: 1.7em;
  height: 1.7em;
}

.bar__clock {
  min-width: 3.2em;
  text-align: end;
  white-space: nowrap;   /* "6:47 pm" and other twelve-hour clocks stay on one line */
  flex: none;
  font-size: var(--type-l);
  font-weight: 500;
  font-variation-settings: 'wdth' 96, 'wght' 480;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

/* --- the home screen: the hero over the rows ----------------------------- */

.home {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: calc(var(--hero-end) - var(--bar-h)) var(--rails-h);
  min-height: 0;
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: clamp(10px, 2vh, 26px);
  width: min(100%, max(46vw, 36rem));
  max-width: 76rem;
  padding: 0 var(--gutter) clamp(6px, 1.2vh, 16px);
  min-width: 0;
  min-height: 0;
  /* The art behind is busy; a soft shade keeps every line legible on it. */
  text-shadow: 0 1px 14px rgb(5 6 10 / 0.55);
}

.hero__body {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.1vh, 14px);
  min-height: 0;
}

.hero__body.is-new {
  animation: hero-in 0.42s var(--ease) both;
}

@keyframes hero-in {
  from {
    opacity: 0.25;
    transform: translateY(0.6vh);
  }
}

.hero__spot {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: var(--type-s);
  font-weight: 700;
  font-variation-settings: 'wdth' 100, 'wght' 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}

.hero__spark {
  width: 0.62em;
  height: 0.62em;
  border-radius: 50%;
  background: var(--g-light);
  box-shadow: 0 0 1em 0.2em var(--g-glow);
}

.hero__eyebrow {
  font-size: var(--type-s);
  font-weight: 600;
  font-variation-settings: 'wdth' 100, 'wght' 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero__name {
  font-size: clamp(2.2rem, min(5.6vw, 10vh), 9.5rem);
  line-height: 0.88;
  font-weight: 800;
  font-variation-settings: 'wdth' 68, 'wght' 860;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  text-wrap: balance;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  padding-block: 0.04em;
}

.hero__name[data-fit='mid'] {
  font-size: clamp(2rem, min(4.6vw, 8.4vh), 8rem);
}

.hero__name[data-fit='long'] {
  font-size: clamp(1.8rem, min(3.7vw, 6.8vh), 6.5rem);
}

.hero__tagline {
  font-size: var(--type-l);
  line-height: 1.2;
  font-weight: 500;
  font-variation-settings: 'wdth' 92, 'wght' 540;
  color: var(--ink);
}

.hero__blurb {
  max-width: 54ch;
  font-size: var(--type-m);
  line-height: 1.5;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  font-size: var(--type-s);
  max-height: 2.3em;
  overflow: hidden;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  height: 2.2em;
  padding: 0 0.9em;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid rgb(255 255 255 / 0.08);
  color: var(--ink);
  white-space: nowrap;
  font-variation-settings: 'wdth' 100, 'wght' 520;
}

.chip--keys {
  padding-inline: 0.45em 0.6em;
  gap: 0.35em;
}

.chip--keys .cap {
  font-size: 0.86em;
}

.hero__actions {
  display: flex;
  gap: clamp(8px, 1vw, 18px);
  margin-top: clamp(2px, 0.6vh, 10px);
}

/* --- buttons ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  height: clamp(42px, 6vh, 70px);
  padding-block: 0 0; padding-inline: 1em 1.15em;
  border-radius: 999px;
  background: var(--glass-hi);
  color: #fff;
  font-size: var(--type-m);
  font-weight: 600;
  font-variation-settings: 'wdth' 98, 'wght' 650;
  white-space: nowrap;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition:
    transform var(--focus-ms) var(--ease),
    box-shadow var(--focus-ms) var(--ease),
    background-color 0.15s;
}

.btn svg {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

.btn:hover {
  background: rgb(255 255 255 / 0.26);
}

.btn[hidden] {
  display: none;
}

.btn--play {
  background: #fff;
  color: var(--stage);
}

/* With friends: glass like the others, ringed, the second way to play. */
.btn--friends {
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 0.42);
}

.btn--play:hover {
  background: #e9eaef;
}

.btn:focus {
  transform: scale(1.06);
  outline: 3px solid #fff;
  outline-offset: 4px;
  box-shadow: 0 0 2.4em -0.2em var(--g-glow);
}

.btn--fave[aria-pressed='true'] svg {
  color: var(--g-light);
}

/* --- keycaps and the prompts that follow your input ---------------------- */

.cap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9em;
  height: 1.8em;
  padding: 0 0.5em;
  border-radius: 0.36em;
  border: 1px solid rgb(255 255 255 / 0.3);
  border-bottom-width: 2px;
  background: rgb(255 255 255 / 0.07);
  color: var(--ink);
  font-size: 0.8em;
  line-height: 1;
  font-weight: 600;
  font-variation-settings: 'wdth' 96, 'wght' 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.cap--pointer {
  border-radius: 999px;
  border-bottom-width: 1px;
  border-style: dashed;
  padding: 0 0.7em;
}

.cap-join {
  color: var(--ink-3);
  font-size: 0.86em;
  padding-inline: 0.1em;
}

.prompt {
  display: inline-flex;
  align-items: center;
  margin-inline-start: 0.15em;
  opacity: 0.85;
}

.prompt__key {
  display: inline-flex;
  align-items: center;
  height: 1.55em;
  padding: 0 0.42em;
  border-radius: 0.32em;
  border: 1px solid currentColor;
  font-size: 0.62em;
  line-height: 1;
  font-variation-settings: 'wdth' 100, 'wght' 700;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.prompt__pad {
  display: none;
  place-items: center;
  width: 1.45em;
  height: 1.45em;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-size: 0.66em;
  font-variation-settings: 'wdth' 100, 'wght' 800;
}

[data-prompts='pad'] .prompt__key {
  display: none;
}

[data-prompts='pad'] .prompt__pad {
  display: inline-grid;
}

[data-prompts='none'] .prompt {
  display: none;
}

/* --- the rows --------------------------------------------------------------- */

.rails {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding-top: 2.6vh;
  /* Room for the last row to reach the band like every other. */
  padding-bottom: calc(var(--rails-h) - var(--rail-h));
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 2.6vh, #000 82%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 2.6vh, #000 82%, transparent 100%);
}

.rails::-webkit-scrollbar,
.rail__track::-webkit-scrollbar {
  display: none;
}

.rail {
  display: flex;
  flex-direction: column;
  height: var(--rail-h);
}

.rail__head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 0.55em;
  height: var(--rail-head);
  padding: 0 var(--gutter);
  font-size: var(--rail-font);
  font-weight: normal;
  line-height: 1.6;
  white-space: nowrap;
  pointer-events: none;
}

.rail__title {
  font-weight: 600;
  font-variation-settings: 'wdth' 96, 'wght' 640;
  color: var(--ink-2);
  transition: color 0.2s;
}

.rail__pos {
  font-size: 0.8em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.2s;
}

.rail__pos::before {
  content: '·';
  margin-inline-end: 0.55em;
}

.rail:focus-within .rail__title {
  color: var(--ink);
}

.rail:focus-within .rail__pos:not(:empty) {
  opacity: 1;
}

/* A row scrolls sideways; its padding is the room a focused tile grows and
   glows into, borrowed from the title above and the gap below. */
.rail__track {
  display: flex;
  gap: var(--tile-gap);
  flex: none;
  margin: calc(-1 * var(--track-pad)) 0;
  padding: var(--track-pad) var(--gutter);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

/* Some engines leave a scroller's end padding out: this keeps the gutter. */
.rail__track::after {
  content: '';
  flex: none;
  width: 1px;
  margin-inline-start: calc(var(--gutter) - var(--tile-gap) - 1px);
}

/* --- tiles ---------------------------------------------------------------- */

.tile {
  position: relative;
  flex: none;
  width: var(--tile-w);
  height: var(--tile-h);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--g-deep);
  transition:
    transform var(--focus-ms) var(--ease),
    box-shadow var(--focus-ms) var(--ease),
    filter 0.24s ease;
}

.tile__art,
.tile__still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile__still {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.tile__still.is-on {
  opacity: 1;
}

.tile__name {
  position: absolute;
  inset: auto 0 0;
  padding: 2.4em 0.75em 0.6em;
  background: linear-gradient(0deg, rgb(5 6 10 / 0.94), rgb(5 6 10 / 0.55) 50%, transparent);
  font-size: clamp(11px, calc(var(--tile-h) * 0.11), 20px);
  line-height: 1.2;
  font-weight: 600;
  font-variation-settings: 'wdth' 92, 'wght' 650;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.tile__fave {
  position: absolute;
  top: 0.5em;
  inset-inline-end: 0.5em;
  width: clamp(12px, calc(var(--tile-h) * 0.12), 22px);
  height: auto;
  aspect-ratio: 1;
  color: #fff;
  filter: drop-shadow(0 1px 3px rgb(0 0 0 / 0.8));
}

.tile__flag {
  position: absolute;
  top: 0.5em;
  inset-inline-start: 0.5em;
  padding: 0.15em 0.5em;
  border-radius: 999px;
  background: #fff;
  color: var(--stage);
  font-size: clamp(10px, calc(var(--tile-h) * 0.085), 14px);
  font-variation-settings: 'wdth' 96, 'wght' 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tile:focus {
  outline: none;
  z-index: 2;
  transform: scale(1.1);
  box-shadow:
    0 0 0 3px #fff,
    0 0.6em 2.6em -0.2em var(--g-glow);
}

/* Focus on a row dims the rest, a little. */
.rails:focus-within .tile:not(:focus),
.page__rail:focus-within .tile:not(:focus) {
  filter: brightness(0.66) saturate(0.85);
}

.tile:hover {
  filter: none;
}

/* A tile's own stills, once focus has rested on it: one bar per still. */
.tile__bars {
  position: absolute;
  top: 0.55em;
  inset-inline-start: 0.65em;
  inset-inline-end: 0.65em;
  display: flex;
  gap: 4px;
}

.tile__bar {
  position: relative;
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgb(255 255 255 / 0.3);
  overflow: hidden;
}

.tile__bar.is-done::after,
.tile__bar.is-running::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--g-light);
  transform-origin: left;
}
.tile__bar.is-running:dir(rtl)::after {
  transform-origin: right;
}


.tile__bar.is-running::after {
  animation: fill 1.6s linear both;
}

@keyframes fill {
  from {
    transform: scaleX(0);
  }
}

/* --- left alone: the screen plays by itself ---------------------------- */

.is-attract .rails,
.is-attract .hero__actions {
  opacity: 0;
}

.is-attract .bar {
  opacity: 0.35;
}

.hero__idle {
  position: absolute;
  inset-inline-start: var(--gutter);
  bottom: clamp(18px, 2.6vh, 34px);
  display: none;
  color: var(--ink-2);
  font-size: var(--type-m);
  font-variation-settings: 'wdth' 100, 'wght' 560;
  letter-spacing: 0.02em;
}

.is-attract .hero__idle {
  display: block;
  animation: breathe 2.4s ease-in-out infinite alternate;
}

@keyframes breathe {
  from {
    opacity: 0.45;
  }
}

/* Which words to show: those for the input in hand. */
.for-pad,
.for-touch,
[data-prompts='pad'] .for-keys,
[data-prompts='none'] .for-keys {
  display: none;
}

[data-prompts='pad'] .for-pad,
[data-prompts='none'] .for-touch {
  display: inline;
}

.rails,
.hero__actions,
.bar {
  transition: opacity 1s ease;
}

.hero.is-shuffling .hero__name {
  filter: blur(1.5px);
  opacity: 0.85;
}

/* --- toasts ----------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%; /* centred: stays physical */
  bottom: max(4vh, 20px);
  z-index: 70;
  transform: translate(-50%, 1.2em);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    transform 0.25s var(--ease);
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast__card {
  display: flex;
  align-items: center;
  gap: 0.6em;
  max-width: calc(100vw - 2 * var(--gutter));
  padding: 0.8em 1.35em;
  border-radius: 999px;
  background: rgb(16 17 24 / 0.94);
  border: 1px solid var(--line);
  box-shadow: 0 1em 3em rgb(0 0 0 / 0.55);
  font-size: var(--type-m);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.toast__card b {
  font-weight: 700;
  font-variation-settings: 'wdth' 96, 'wght' 700;
}

.toast__exit {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

.toast__ring {
  width: 1.4em;
  height: 1.4em;
  margin-inline-end: 0.3em;
  rotate: -90deg;
}

.toast__ring circle {
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-dasharray: 1;
  stroke-linecap: round;
}

.pad-glyph {
  display: inline-grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}

.pad-glyph svg {
  width: 72%;
  height: 72%;
}

/* While a game plays, the couch behind it stops drawing once the player has
   grown to cover it, and is back the moment the player starts to shrink. */
.is-playing .couch,
.is-playing .find,
.is-playing .page {
  visibility: hidden;
  transition: visibility 0s linear 0.4s;
}

/* --- a phone, or any screen taller than it is wide ------------------------- */

@media (max-width: 46rem), (max-aspect-ratio: 1/1) {
  :root {
    --gutter: clamp(16px, 5vw, 32px);
    --bar-h: 58px;
    --hero-end: 58dvh;
    --rail-h: calc(var(--rails-h) / 2.15);
    --rail-font: clamp(14px, 2vh, 20px);
    --type-s: clamp(11px, 1.45vh, 15px);
    --type-m: clamp(13px, 1.75vh, 17px);
    --type-l: clamp(15px, 2.2vh, 22px);
  }

  .bar {
    gap: 0.75rem;
  }

  .bar__room,
  .bar__clock,
  .views__label,
  .bar__pad,
  .bar .friends-cta {
    display: none;   /* the hero's With friends and the Play with friends row stand in for the bar's */
  }

  .bar__side {
    min-width: 0;
    gap: 0.5rem;
  }

  .stage__shot {
    inset-inline-start: 0;
    bottom: auto;
    width: 100%;
    height: calc(var(--hero-end) + 6dvh);
  }

  .stage__shot img {
    -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
    mask-image: linear-gradient(180deg, #000 55%, transparent);
  }

  .stage__veil {
    background:
      linear-gradient(180deg, rgb(5 6 10 / 0.8) 0%, transparent 14%),
      linear-gradient(0deg, var(--stage) 0%, var(--stage) 40%, rgb(5 6 10 / 0.9) 50%, rgb(5 6 10 / 0.66) 64%, rgb(5 6 10 / 0.28) 80%, transparent 92%),
      radial-gradient(90% 50% at 100% 0%, color-mix(in srgb, var(--tint-glow) 30%, transparent), transparent 80%);
  }

  .hero {
    width: 100%;
  }

  .hero__name {
    font-size: clamp(2rem, 10vw, 3.4rem);
  }

  .hero__name[data-fit='mid'] {
    font-size: clamp(1.8rem, 8.4vw, 3rem);
  }

  .hero__name[data-fit='long'] {
    font-size: clamp(1.6rem, 7vw, 2.6rem);
  }

  .hero__blurb {
    -webkit-line-clamp: 2;
  }

  .hero__actions {
    gap: 8px;
  }

  .btn {
    padding-inline: 0.9em;
  }

  /* Phones swipe a row; it settles on a tile. */
  .rail__track {
    scroll-snap-type: x proximity;
    scroll-padding-inline: var(--gutter);
  }

  .tile {
    scroll-snap-align: start;
  }
}

/* A phone held sideways, or a short window: the words make room. */
@media (max-height: 34rem) {
  .hero__blurb,
  .hero__chips {
    display: none;
  }
}

@media (max-width: 30rem) {
  .btn--info .btn__label,
  .btn--fave .btn__label,
  .btn--info .prompt,
  .btn--fave .prompt {
    display: none;
  }

  .btn--info,
  .btn--fave {
    width: clamp(42px, 6vh, 70px);
    padding: 0;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .stage__shot img {
    animation: none;
  }

  .tile:focus,
  .btn:focus,
  .bar__round:focus {
    transform: none;
  }
}

/* --- a ranked row: a streaming service's Top 10 (couch/rails.js) ------------- */

.rail--ranked .tile {
  --rank-w: calc(var(--tile-h) * 0.62);
  width: calc(var(--tile-w) + var(--rank-w));
  overflow: visible;
  background: transparent;
}

.rail--ranked .tile__art,
.rail--ranked .tile__still {
  inset-inline-start: var(--rank-w);
  width: auto;
  border-radius: var(--radius);
}

.rail--ranked .tile__name {
  inset-inline-start: var(--rank-w);
}

.tile__rank {
  position: absolute;
  inset-block-end: -0.08em;
  inset-inline-start: 0;
  z-index: 0;
  color: var(--stage, #07070b);
  font-size: calc(var(--tile-h) * 1.08);
  font-weight: 900;
  font-variation-settings: 'wdth' 80, 'wght' 900;
  letter-spacing: -0.09em;
  line-height: 1;
  -webkit-text-stroke: max(2px, 0.03em) rgb(255 255 255 / 0.78);
  paint-order: stroke fill;
  pointer-events: none;
}
