/* The page's stylesheet. Its colours and fonts are the role tokens in engine/page/tokens.css (loaded first);
   nothing in this file names a colour of its own (theme.test.ts). */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--pf-bg);
  background-image: var(--pf-ground);
  background-attachment: fixed;
  color: var(--pf-fg);
  font: 15px / 1.4 var(--pf-font);
  height: 100vh;
  display: flex;
  flex-direction: column;
}
#top {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 14px;
  background: var(--pf-panel);
  border-bottom: var(--pf-bar-edge);
}
#top h1 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 18px;
  margin: 0;
  letter-spacing: 1px;
}
#phase {
  color: var(--pf-dim);
}
#timer {
  font-weight: bold;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
#spacer {
  flex: 1;
}
#chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  padding: 2px 8px;
  border-radius: calc(var(--pf-radius) + 4px);
  background: var(--pf-raise);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
/* the player's colour, as the dot their avatar wears in the game */
.chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.chip.off {
  opacity: 0.4;
}
#wrap {
  flex: 1;
  display: flex;
  min-height: 0;
}
#main {
  flex: 1;
  position: relative;
  display: flex;
  overflow: auto;
}
#stage {
  width: 100%;
  height: 100%;
  display: none;
}
/* the break's replay (02D96TJ): the round's best moment, this page's own view, no input */
#replay {
  display: none;
  margin: 0 0 14px;
}
#replay.on {
  display: block;
}
#replay .rpStage {
  position: relative;
  aspect-ratio: 1000 / 640;
  max-height: 36vh;
  margin: auto;
  border: 2px solid var(--pf-line);
  border-radius: calc(var(--pf-radius) + 4px);
  overflow: hidden;
  pointer-events: none;
  background: var(--pf-bg);
}
#replay .rpCap {
  text-align: center;
  color: var(--pf-dim);
  font-size: 13px;
  margin-top: 4px;
  letter-spacing: 1px;
}
#panel {
  max-width: 700px;
  padding: 20px;
  margin: auto;
}
/* Klaus (engine/klaus.js): the host's face; big with a bubble only between rounds (the panel is never over a round) */
#klausTop {
  display: inline-flex;
  flex: none;
}
/* Talking to the host (419C01Z, engine/page/klausbar.ts): their face after the chips, a quiet field next to it, their
 speech bubble below. Nothing here covers the game until you tap it. */
#kBar {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
#kBar button {
  font-family: inherit;
  cursor: pointer;
}
#kBar .kFace {
  position: relative;
  border: 0;
  background: transparent;
  padding: 0;
  display: inline-flex;
  min-width: 0;
}
#kBar .kBadge {
  position: absolute;
  top: -5px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--pf-action);
  color: var(--pf-on-action);
  border: 2px solid var(--pf-panel);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
#kBar .kBadge:empty {
  display: none;
}
#kBar .kBadge::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: var(--pf-action);
  z-index: -1;
  animation: kPing 1.4s ease-out infinite;
}
#kBar .kThumbs {
  position: absolute;
  left: 7px;
  top: 32px;
  font-size: 24px;
  opacity: 0;
  pointer-events: none;
}
#kBar .kThumbs.go {
  animation: kThumbs 1.3s ease-out both;
}
#kBar .kFace.swoop {
  animation:
    kSwoop 0.7s cubic-bezier(0.2, 1.3, 0.4, 1) both,
    kWiggle 3.2s ease-in-out 0.8s infinite;
}
#kBar .kPsst {
  height: 32px;
  padding: 0 14px;
  background: var(--pf-host-bg);
  color: var(--pf-host-fg);
  border: 0;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  animation: kPeek 0.35s ease-out 0.5s both;
}
/* his question to the whole room: it runs out, so it asks louder (DR8ARRT) */
#kBar .kPsst.room {
  background: var(--pf-action);
  color: var(--pf-on-action);
  font-variant-numeric: tabular-nums;
}
#kBar .kField {
  width: 230px;
  height: 32px;
  padding: 0 12px;
  background: var(--pf-bg);
  color: var(--pf-dim);
  border: 1px solid var(--pf-line2);
  border-radius: 16px;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: text;
}
#kBar :is(.kBubble, .kSaid) {
  position: absolute;
  left: -14px;
  top: calc(100% + 14px);
  z-index: 60;
  background: var(--pf-host-bg);
  color: var(--pf-host-fg);
  box-shadow:
    0 14px 40px color-mix(in srgb, var(--pf-bg) 70%, transparent),
    0 0 0 1px color-mix(in srgb, var(--pf-host-fg) 20%, transparent);
  transform-origin: 30px 0;
}
#kBar .kSaid {
  display: none;
  width: max-content;
  max-width: 360px;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  white-space: pre-line;
  cursor: pointer;
}
#kBar .kSaid.pop,
#kBar .kBubble {
  animation: kOpen 0.28s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
#kBar .kBubble {
  display: none;
  width: 360px;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
}
#kBar :is(.kBubble, .kSaid)::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 22px;
  width: 18px;
  height: 18px;
  background: inherit;
  transform: rotate(45deg);
  border-radius: 3px;
}
#kBar .kWho {
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--pf-host-fg) 65%, var(--pf-host-bg));
}
#kBar .kX {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 16px;
  padding: 0 2px;
}
#kBar .kText {
  position: relative;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  white-space: pre-line;
}
#kBar .kChips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#kBar .kChips button {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  color: var(--pf-host-fg);
  background: var(--pf-host-bg);
  border: 2px solid color-mix(in srgb, var(--pf-host-fg) 22%, var(--pf-host-bg));
  transition: transform 0.08s;
}
#kBar .kChips button:hover {
  transform: translateY(-2px);
}
#kBar .kChips .kAns {
  background: var(--pf-action);
  color: var(--pf-on-action);
  border-color: var(--pf-action);
}
#kBar .kChips .kDice {
  border-color: var(--pf-host-fg);
}
#kBar .kChips .kHint.on {
  border-color: var(--pf-host-fg);
}
#kBar .kChips .kHint.on.idea {
  background: color-mix(in srgb, var(--pf-gold) 75%, var(--pf-host-bg));
}
#kBar .kChips .kHint.on.rule {
  background: color-mix(in srgb, var(--pf-rule-soft) 75%, var(--pf-host-bg));
}
#kBar .kChips .kHint.on.bug {
  background: color-mix(in srgb, var(--pf-bad) 50%, var(--pf-host-bg));
}
#kBar .kRow {
  display: flex;
  gap: 8px;
  margin: 0;
}
#kBar .kRow input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  background: var(--pf-host-bg);
  color: var(--pf-host-fg);
  border: 1px solid color-mix(in srgb, var(--pf-host-fg) 25%, var(--pf-host-bg));
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
}
#kBar .kRow input::placeholder {
  color: color-mix(in srgb, var(--pf-host-fg) 55%, var(--pf-host-bg));
}
#kBar .kSend {
  width: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--pf-action);
  color: var(--pf-on-action);
  font-size: 18px;
  font-weight: 800;
}
#kBar .kSwitch {
  align-self: flex-start;
  background: transparent;
  border: 0;
  padding: 0;
  color: color-mix(in srgb, var(--pf-host-fg) 65%, var(--pf-host-bg));
  font-size: 13px;
  text-decoration: underline;
}
/* a phone: the face leads the bar (tap it to write), "Psst" takes the title's place, the bubble spans the screen */
body.phone #kBar {
  order: -1;
  position: static;
}
body.phone #kBar .kField {
  display: none !important;
}
body.phone.kWait #phase {
  display: none;
}
body.phone #kBar :is(.kBubble, .kSaid) {
  position: fixed;
  left: 10px;
  right: 10px;
  width: auto;
  max-width: none;
  top: calc(var(--topH, 52px) + 10px);
}
body.phone #kBar :is(.kBubble, .kSaid)::before {
  left: 18px;
}
/* landscape phone mid-round: his short answer is a one-line pill in the top bar next to his face, pointing at him
   (P8YEH8G); the game name hides behind it while it shows, the clock and menu stay */
body.phone #kBar .kSaid.inbar {
  top: 6px;
  left: 66px;
  right: 120px;
  padding: 7px 14px;
  font-size: 15px;
  line-height: 1.25;
  white-space: nowrap;
  border-radius: 999px;
  box-shadow: none;
}
body.phone #kBar .kSaid.inbar::before {
  top: 50%;
  left: -6px;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 2px;
}
body.screen #kBar :is(.kField, .kPsst, .kBadge) {
  display: none !important;
}
@keyframes kPing {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}
@keyframes kOpen {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  70% {
    transform: scale(1.04);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}
@keyframes kSwoop {
  0% {
    transform: translateX(220px) translateY(30px) rotate(25deg) scale(1.6);
  }
  55% {
    transform: translateX(-8px) rotate(-14deg) scale(1.25);
  }
  80% {
    transform: translateX(3px) rotate(6deg) scale(1.05);
  }
  100% {
    transform: none;
  }
}
@keyframes kWiggle {
  0%,
  78%,
  100% {
    transform: rotate(0);
  }
  83% {
    transform: rotate(-12deg) scale(1.12);
  }
  88% {
    transform: rotate(12deg) scale(1.12);
  }
  94% {
    transform: rotate(-6deg);
  }
}
@keyframes kPeek {
  0% {
    transform: translateX(-14px);
    opacity: 0;
  }
  100% {
    transform: none;
    opacity: 1;
  }
}
@keyframes kThumbs {
  0% {
    transform: scale(0) rotate(-30deg);
    opacity: 0;
  }
  35% {
    transform: scale(1.3) rotate(10deg);
    opacity: 1;
  }
  100% {
    transform: translateY(26px) scale(1);
    opacity: 0;
  }
}
#klausHero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
#klausBig {
  flex: none;
}
/* the TV's tallies of a question to the room (793W9W3): flat rows, not buttons; the lead in the action colour */
#tvPoll {
  display: none;
  margin: 4px 0 14px;
  max-width: 760px;
}
#tvPoll.on {
  display: block;
}
/* answer pills, not buttons (nkf on 793W9W3, E63XKTK): a thin border, the count in a round badge, the lead in the
   action colour; they wrap in short rows instead of one long row per answer */
#tvPoll .tvRows {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  font-size: clamp(20px, 1.5vw, 28px);
}
#tvPoll .tvRow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 6px 18px;
  border-radius: 999px;
  border: 2px solid var(--pf-line);
  color: var(--pf-fg2);
  font-weight: 500;
}
#tvPoll .tvRow.lead {
  border-color: var(--pf-action);
  color: var(--pf-fg);
  font-weight: 700;
}
#tvPoll b {
  font-variant-numeric: tabular-nums;
  min-width: 1.6em;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--pf-line);
  color: var(--pf-fg);
  text-align: center;
}
#tvPoll .lead b {
  background: var(--pf-action);
  color: var(--pf-on-action);
}
#tvPoll .tvLeft {
  margin-top: 8px;
  font-size: clamp(16px, 1.1vw, 20px);
  color: var(--pf-dim);
}
body.playing #tvPoll {
  margin: 6px auto;
  padding: 0 16px;
}
body.playing #tvPoll .tvRows {
  font-size: clamp(16px, 1.1vw, 20px);
  gap: 6px 8px;
}
#klausSay {
  position: relative;
  background: var(--pf-host-bg);
  color: var(--pf-host-fg);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  padding: 10px 16px;
  border-radius: 16px;
  max-width: 420px;
  box-shadow: var(--pf-bubble-edge);
}
#klausSay::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  margin-top: -9px;
  border: 9px solid transparent;
  border-right: 12px solid var(--pf-host-bg);
  border-left: 0;
}
#klausSay.pop {
  animation: kPop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes kPop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}
#side {
  width: 320px;
  background: var(--pf-rail);
  border-left: 1px solid var(--pf-line);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}
#side > * {
  flex-shrink: 0;
}
/* desktop: the player can fold the sidebar into a slim rail (1G666JV); the stage takes the width */
#side {
  position: relative;
}
#sideMinBtn {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 2px 8px;
  font-size: 14px;
  z-index: 2;
  opacity: 0.6;
}
#sideMinBtn:hover {
  opacity: 1;
}
#sideRail {
  display: none;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
#sideRail button {
  position: relative;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 18px;
  background: transparent;
  border: 1px solid var(--pf-line);
}
#sideRail button[data-rail="open"] {
  margin-bottom: 6px;
}
#sideRail button.dot::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pf-action);
  box-shadow: 0 0 0 2px var(--pf-rail);
}
body.sideMin:not(.phone) #side {
  width: 48px !important; /* also when a chat would widen it */
  padding: 8px 5px;
}
body.sideMin:not(.phone) #side > *:not(#sideRail) {
  display: none !important;
}
body.sideMin:not(.phone) #sideRail {
  display: flex;
}
body.phone #sideMinBtn {
  display: none;
}
#side #sideList {
  flex-shrink: 1;
  min-height: 0;
  overflow: auto;
}
textarea,
input {
  width: 100%;
  background: var(--pf-bg);
  color: var(--pf-fg);
  border: 1px solid var(--pf-line2);
  border-radius: var(--pf-radius);
  padding: 8px;
  font: inherit;
}
button {
  background: var(--pf-action);
  color: var(--pf-on-action);
  border: 0;
  border-radius: var(--pf-radius);
  padding: 8px 14px;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}
button:disabled {
  background: var(--pf-line2);
  cursor: default;
}
button.ghost {
  background: var(--pf-raise);
}
/* quiet buttons sit on a surface, so their label is text-coloured (the action colour's label may be dark) */
button.ghost,
#fsBtn,
#statsBtn,
#watchBtn,
#drawerBtn,
#voiceBtn,
#musicBtn,
#ctrlBtn,
#sideRail button,
#devPanel .dp-pics button,
.tbtn {
  color: var(--pf-fg);
}
button:disabled {
  color: var(--pf-dim);
}
.big {
  font-size: 22px;
  padding: 14px 28px;
}
.list {
  font-size: 13px;
  color: var(--pf-fg2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.list div b {
  color: var(--pf-fg);
}
/* a rule that is live: plain text, quiet (docs/DESIGN.md 1 and 4: "ok" green is for live/done/points, not for
 a whole list, and the rail stays calm while a round is played) */
.impl {
  color: var(--pf-fg2);
}
body.playing .impl {
  color: var(--pf-dim);
}
.impl .by {
  color: var(--pf-dim);
}
details.more summary {
  color: var(--pf-dim);
  font-size: 12px;
  cursor: pointer;
  margin: 2px 0;
}
.pq-h {
  color: var(--pf-dim);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 8px 0 2px;
}
.pq-tag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--pf-raise);
  color: var(--pf-fg2);
  white-space: nowrap;
}
h1,
h2,
h3 {
  font-family: var(--pf-display);
}
h2 {
  margin: 4px 0;
  font-size: 16px;
}
table {
  border-collapse: collapse;
}
td {
  padding: 4px 12px;
}
/* Klaus shows up (JR4DS4D): his own line in a strip above the stage during a round (never over it), with a wrench
 when he's fixing something; a thumbs-up for its last second */
#kStrip {
  display: none;
  align-items: center;
  gap: 8px;
  background: color-mix(in srgb, var(--pf-you) 18%, var(--pf-bg));
  border-bottom: 2px solid var(--pf-you);
  color: color-mix(in srgb, var(--pf-you) 12%, var(--pf-fg));
  padding: 2px 12px;
  font-weight: bold;
  animation: kStripIn 0.25s ease-out;
}
#kStrip.on {
  display: flex;
}
#kStrip .tool {
  font-size: 20px;
}
#kStrip.fix .tool {
  display: inline-block;
  animation: kWrench 0.35s ease-in-out infinite alternate;
}
@keyframes kWrench {
  from {
    transform: rotate(-35deg);
  }
  to {
    transform: rotate(25deg);
  }
}
@keyframes kStripIn {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
}
#notice {
  background: var(--pf-warn);
  color: var(--pf-on-warn);
  padding: 4px 14px;
  font-weight: bold;
  display: none;
}
/* Rule: nothing the framework shows may cover the game stage. Errors live in the sidebar, the
 connection warning in the top bar, notices in a strip above (the stage shrinks, never gets covered). */
#error {
  background: color-mix(in srgb, var(--pf-bad) 40%, #000);
  color: color-mix(in srgb, var(--pf-bad) 30%, #fff);
  font: 12px monospace;
  padding: 6px;
  white-space: pre-wrap;
  max-height: 40vh;
  overflow: auto;
  display: none;
  border-radius: var(--pf-radius);
}
#devWarn {
  display: none;
  font: 600 13px var(--pf-font);
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid var(--pf-warn);
  color: var(--pf-warn);
  background: var(--pf-bg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 1;
}
body.phone #devWarn {
  flex-shrink: 0;
  overflow: visible;
  padding: 3px 8px;
}
#connWarn {
  display: none;
  font: 600 13px var(--pf-font);
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid;
  background: var(--pf-bg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 1;
}
#hurry {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
  display: none;
  font: 900 160px var(--pf-display);
  color: var(--pf-bad);
  text-shadow: 0 0 40px var(--pf-bad);
  animation: pulse 1s infinite;
  text-align: center;
}
#hurry small {
  display: block;
  font-size: 32px;
  color: var(--pf-fg);
  text-shadow: none;
}
@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(1.25);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.55;
  }
}
body.hurry {
  animation: flash 1s infinite;
}
@keyframes flash {
  0% {
    background: color-mix(in srgb, var(--pf-bad) 28%, var(--pf-bg));
  }
  100% {
    background: var(--pf-bg);
  }
}
#fsBtn {
  background: var(--pf-raise);
  padding: 4px 10px;
}
/* mid-round vote: lives in the sidebar, never over the stage */
#midvote {
  display: none;
  flex-direction: column;
  gap: 8px;
  background: color-mix(in srgb, var(--pf-rule) 12%, var(--pf-bg));
  border: 2px solid var(--pf-rule);
  border-radius: calc(var(--pf-radius) + 4px);
  padding: 10px;
}
#midvote.on {
  display: flex;
}
#midvote .mvq {
  font-size: 18px;
  font-weight: bold;
}
#midvote .mvt {
  font-size: 13px;
  color: var(--pf-rule-soft);
}
#midvote button {
  font-size: 18px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  text-align: left;
  touch-action: manipulation;
}
#midvote button b {
  font-size: 20px;
  min-width: 1.5em;
  text-align: right;
}
#drawerBtn {
  position: relative;
}
#drawerBtn.unread {
  box-shadow: 0 0 0 2px var(--pf-you);
}
#drawerBtn.unread::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pf-you);
  border: 2px solid var(--pf-bg);
}
body.phone #side #tabs {
  order: -1;
} /* the drawer's ✕ row stays on top, above the chat */
/* workshop: builds in progress, told in character (engine/workshop.ts); sidebar only, never over the stage */
#workshop,
.ws {
  display: none;
  flex-direction: column;
  gap: 8px;
  background: var(--pf-panel);
  border: 1px solid color-mix(in srgb, var(--pf-gold) 20%, var(--pf-bg));
  border-radius: calc(var(--pf-radius) + 4px);
  padding: 8px 10px;
  box-shadow: var(--pf-card-edge);
}
.ws h3 {
  margin: 0;
  font-size: 13px;
  color: var(--pf-gold);
  letter-spacing: 0.04em;
}
.ws .wsWatch {
  display: inline-block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--pf-link);
  text-decoration: none;
}
.ws .wb {
  font-size: 13px;
  color: var(--pf-fg2);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ws .wb b {
  color: var(--pf-fg);
}
.ws .bar {
  height: 5px;
  background: var(--pf-raise);
  border-radius: 3px;
  overflow: hidden;
}
.ws .bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--pf-action), var(--pf-gold));
  transition: width 1s;
}
.ws .wb.blocked .bar i {
  background: var(--pf-bad);
  animation: wsblink 1.2s infinite;
}
.ws .wb.done .bar i {
  background: var(--pf-ok);
}
.ws .wb.stalled .bar i {
  opacity: 0.6;
}
/* the rail's workshop (EC4C9X8, docs/DESIGN.md 1 and 3): a calm section like the others, a small label, a thin bar;
 while a round is played nothing in it has colour or moves */
#workshop {
  border-color: var(--pf-line);
}
#workshop h3 {
  color: var(--pf-dim);
  font-size: 12px;
  font-weight: normal;
  letter-spacing: 1px;
  text-transform: uppercase;
}
#workshop .bar {
  height: 3px;
}
body.playing #workshop .wb,
body.playing #workshop .wb b {
  color: var(--pf-dim);
}
body.playing #workshop .bar i {
  background: var(--pf-faint);
  animation: none;
  transition: none;
}
/* lobby join card (1MHTMX6): a QR code and the plain URL, so nobody types an IP */
.join {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--pf-panel);
  border: 2px solid var(--pf-line);
  border-radius: calc(var(--pf-radius) + 4px);
  padding: 10px 14px;
  margin: 10px 0 16px;
  max-width: 480px;
  box-shadow: var(--pf-card-edge);
}
.join img {
  width: 116px;
  height: 116px;
  flex: none;
  border-radius: var(--pf-radius);
  background: #fff;
}
.join .url {
  font:
    600 18px ui-monospace,
    monospace;
  color: var(--pf-link);
  word-break: break-all;
  margin: 4px 0;
}
.join small {
  color: var(--pf-dim);
}
/* empty night (nothing built yet): the workshop is the show, big in the lobby panel */
.ws.big {
  display: flex;
  padding: 14px 18px;
  gap: 14px;
  margin: 6px 0 18px;
}
.ws.big h3 {
  font-size: 15px;
}
.ws.big .wb {
  font-size: 16px;
}
.ws.big .bar {
  height: 9px;
  border-radius: 5px;
}
.ws.big .idle {
  color: var(--pf-dim);
  font-size: 15px;
}
@keyframes wsblink {
  50% {
    opacity: 0.35;
  }
}
.dwBox {
  border: 1px solid var(--pf-warn);
  color: var(--pf-warn);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
}
.rmRules > summary {
  cursor: pointer;
  margin-top: 10px;
  font-size: 13px;
  color: var(--pf-dim);
}
.rmRules .why {
  color: var(--pf-dim);
  font-size: 13px;
}
/* the vote's one count, by its question (CFHA500: one counter, not three) */
.brkBox h2 .cnt {
  color: var(--pf-dim);
  font-style: normal;
  font-weight: normal;
  font-size: 13px;
  margin-left: 6px;
  white-space: nowrap;
}
#readyBtn {
  padding: 4px 12px;
  font-size: 14px;
  flex-shrink: 0;
}
.rmRules > summary span {
  color: var(--pf-dim);
  font-weight: 400;
  font-size: 13px;
}
#modeTag {
  white-space: nowrap;
  font-size: 12px;
  padding: 1px 8px;
  border-radius: calc(var(--pf-radius) + 4px);
  background: var(--pf-raise);
  color: var(--pf-fg2);
  display: none;
}
#modeCtl {
  display: none;
  gap: 6px;
}
#modeCtl button {
  flex: 1;
}
.modes {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.mode {
  flex: 1 1 260px;
  background: var(--pf-panel);
  border: 2px solid var(--pf-line);
  border-radius: calc(var(--pf-radius) + 4px);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mode.on {
  border-color: var(--pf-action);
}
.mode.dev {
  cursor: pointer;
}
.nightSet {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 6px 0 14px;
  padding: 10px 14px;
  background: var(--pf-panel);
  border-radius: calc(var(--pf-radius) + 4px);
}
.nightSet .ns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.nightSet .ns span {
  color: var(--pf-dim);
  min-width: 130px;
  font-size: 14px;
}
.nightSet button {
  padding: 4px 10px;
  font-size: 14px;
}
.mode.dev.on {
  border-color: var(--pf-action);
}
/* the host's setup, one question at a time (EQS09W3, docs/DESIGN.md 2) */
.setupQ h1 {
  font-family: var(--pf-display);
  font-size: clamp(26px, 3vw, 44px);
  margin: 2px 0 6px;
}
.setupQ p {
  color: var(--pf-fg2);
  margin: 0 0 6px;
}
.setupN {
  color: var(--pf-dim);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.setupNav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
}
.mode.soon {
  opacity: 0.45;
  cursor: default;
}
.mode .fit {
  flex: 0;
  font-size: 14px;
}
.mode h2 {
  font-size: 22px;
}
.mode p {
  margin: 0;
  color: var(--pf-fg2);
  flex: 1;
}
.picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
/* stats overlay: opt-in (📊 button / S key), covers the stage only while a player has it open; the game keeps running */
#voiceBtn,
#musicBtn,
#ctrlBtn,
#statsBtn {
  background: var(--pf-raise);
  padding: 4px 10px;
}
/* the version, a faded superscript on the logo (M010C5S): opens what's new */
#verBtn {
  align-self: flex-start;
  margin: -2px 0 0 -2px;
  padding: 0 2px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--pf-faint);
  border: 0;
  background: none;
}
#verBtn:hover {
  color: var(--pf-fg2);
}
#verBtn:empty {
  display: none;
}
#songNow {
  font-size: 12px;
  color: var(--pf-rule-soft);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.phone #songNow {
  display: none;
}
#songPick {
  display: block;
  margin: 8px 0 2px;
  font-size: 13px;
  color: var(--pf-link);
  cursor: pointer;
}
#musicBtn.off {
  opacity: 0.45;
  text-decoration: line-through;
}
.chg {
  padding: 4px 0;
  border-bottom: 1px solid var(--pf-line);
}
.chg.done {
  color: var(--pf-ok);
}
.chg.declined {
  color: var(--pf-dim);
}
.chgR {
  color: var(--pf-fg2);
  font-size: 13px;
  margin: 2px 0 0 22px;
}
#devPanel {
  display: none;
  background: var(--pf-panel);
  border: 1px solid var(--pf-line);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 14px;
}
#devPanel h3 {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--pf-dim);
}
#devPanel .dp-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
#devPanel .dp-row button {
  padding: 2px 10px;
}
#devPanel .dim {
  color: var(--pf-dim);
  font-size: 12px;
}
#devPanel .dp-k {
  display: grid;
  grid-template-columns: 90px 1fr 44px;
  align-items: center;
  gap: 6px;
}
#devPanel .dp-k span {
  overflow: hidden;
  text-overflow: ellipsis;
}
#devPanel .dp-k input {
  width: 100%;
}
#devPanel .dp-art summary {
  cursor: pointer;
  margin-top: 8px;
  color: var(--pf-fg2);
}
#devPanel .dp-now {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0 4px;
  font-size: 12px;
}
#devPanel .dp-now img,
#devPanel .dp-alt img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: var(--pf-bg);
  border-radius: var(--pf-radius);
  image-rendering: pixelated;
}
#devPanel .dp-alts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
#devPanel .dp-alt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--pf-raise);
  font-size: 10px;
  font-weight: normal;
  line-height: 1.1;
  overflow: hidden;
}
#devPanel .dp-alt span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#devPanel .dp-alt.on,
#devPanel .dp-pics .on {
  outline: 2px solid var(--pf-you);
}
#devPanel .dp-pics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 3px;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 6px;
}
#devPanel .dp-pics button {
  padding: 2px;
  background: var(--pf-bg);
}
#devPanel .dp-pics img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: pixelated;
}
#devPanel .dp-alt.asked {
  outline: 2px solid var(--pf-ok);
}
#devPanel > button {
  margin-top: 6px;
  padding: 2px 10px;
}
#watchBtn {
  background: var(--pf-raise);
  padding: 4px 10px;
  white-space: nowrap;
}
#watchBtn.on {
  background: var(--pf-rule);
}
#camHint {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 5;
  background: #000a;
  color: var(--pf-fg2);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: var(--pf-radius);
  pointer-events: none;
  display: none;
}
body.watching #camHint {
  display: block;
}
body.watching #stage {
  overflow: hidden;
}
#stats {
  position: fixed;
  inset: 56px 340px 16px 16px;
  z-index: 6;
  display: none;
  flex-direction: column;
  background: var(--pf-bg);
  border: 1px solid var(--pf-line);
  border-radius: 12px;
  padding: 16px 20px;
  overflow: auto;
}
body.statsOn #stats {
  display: flex;
}
#stats h2 {
  font-size: 20px;
  margin: 0 0 4px;
}
#stats h3 {
  font-size: 14px;
  margin: 18px 0 6px;
  color: var(--pf-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}
#statsHead {
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}
#statsHead span {
  color: var(--pf-dim);
  font-size: 13px;
}
#statsHead button {
  margin-left: auto;
  padding: 4px 12px;
}
#stats table {
  width: 100%;
  font-size: 14px;
}
#stats th {
  text-align: left;
  color: var(--pf-dim);
  font-weight: 600;
  padding: 4px 10px;
}
#stats td {
  padding: 4px 10px;
  border-top: 1px solid var(--pf-row);
}
#stats td.n,
#stats th.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
#stats .bar {
  height: 8px;
  border-radius: 4px;
  background: var(--pf-action);
  min-width: 2px;
}
#stats .live {
  color: var(--pf-ok);
}
#stats .dim {
  color: var(--pf-dim);
}
/* awards gallery (🏆 tab) + the break screen's award highlight */
#statsTabs {
  display: flex;
  gap: 6px;
  margin: 10px 0 4px;
}
#statsTabs button {
  padding: 6px 14px;
}
#statsTabs button:not(.on) {
  background: var(--pf-row);
  color: var(--pf-dim);
}
#stats td.ok {
  color: var(--pf-ok);
}
#stats td.warn {
  color: var(--pf-warn);
}
#stats td.bad {
  color: var(--pf-bad);
}
#stats tr.me td {
  background: var(--pf-row);
}
.awards.mini {
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 8px;
}
.awards.mini .award {
  min-height: 0;
  padding: 8px 10px;
  gap: 2px;
}
.awards.mini .em {
  font-size: 22px;
}
.awards.mini .ti {
  font-size: 13px;
}
.awards.mini .ln {
  font-size: 12px;
}
.badges {
  margin-left: 6px;
  letter-spacing: 2px;
  cursor: default;
}
#stats .teaser {
  color: var(--pf-dim);
  font-size: 13px;
  margin-top: 14px;
}
.awards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.award {
  position: relative;
  background: linear-gradient(160deg, color-mix(in srgb, var(--pf-rule) 18%, var(--pf-panel)), var(--pf-panel));
  border: 2px solid color-mix(in srgb, var(--pf-gold) 33%, transparent);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 130px;
}
.award .em {
  font-size: 34px;
  line-height: 1;
}
.award .ti {
  font-weight: 700;
  font-size: 15px;
  color: var(--pf-gold);
}
.award .bl {
  font-size: 12px;
  color: var(--pf-dim);
}
.award .who {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}
.award .ln {
  font-size: 13px;
  color: var(--pf-fg2);
}
.awChip {
  font-weight: 700;
  font-size: 14px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #0008;
  border: 2px solid var(--c, var(--pf-dim));
  color: var(--c, var(--pf-fg));
}
.award.create {
  background: linear-gradient(160deg, color-mix(in srgb, var(--pf-create) 20%, var(--pf-panel)), var(--pf-panel));
  border-color: color-mix(in srgb, var(--pf-create) 33%, transparent);
}
.award.create .ti {
  color: var(--pf-create);
}
.award.create.fresh {
  border-color: var(--pf-create);
  box-shadow: 0 0 18px color-mix(in srgb, var(--pf-create) 53%, transparent);
}
.awards.awBig {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.awards.awBig .award {
  min-height: 150px;
}
.awards.awBig .em {
  font-size: 40px;
}
#stats .tagline {
  color: var(--pf-create);
  font-size: 14px;
  margin: 2px 0 0;
}
.awHi.create {
  border-color: color-mix(in srgb, var(--pf-create) 53%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--pf-create) 20%, var(--pf-panel)), var(--pf-panel));
}
.awHi.create .k {
  color: var(--pf-create);
}
.awNudge {
  color: var(--pf-create);
  font-weight: 600;
}
.award.fresh {
  border-color: var(--pf-gold);
  box-shadow: 0 0 18px color-mix(in srgb, var(--pf-gold) 53%, transparent);
}
.award.fresh::after {
  content: "NEW";
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 11px;
  font-weight: 800;
  color: var(--pf-on-warn);
  background: var(--pf-gold);
  border-radius: 4px;
  padding: 1px 5px;
}
@keyframes awPop {
  0% {
    transform: scale(0.9);
  }
  60% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}
/* break screen: results first, the award as one compact strip, one call to action, then the votes */
.brkHead {
  display: flex;
  align-items: baseline;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.brkHead h1 {
  font-size: 26px;
  margin: 0;
}
.brkHead h1 small {
  color: var(--pf-dim);
  font-weight: 400;
  font-size: 18px;
}
.brkHead .next {
  color: var(--pf-fg2);
}
.brkHead .next button {
  padding: 4px 12px;
  margin-left: 6px;
}
.roundLine {
  font-size: 20px;
  margin: 4px 0 10px;
}
.upNext {
  font-size: 18px;
  color: var(--pf-fg2);
  margin: 14px 0 6px;
}
/* the round's scores: one quiet line under everything else */
.scores {
  color: var(--pf-dim);
  font-variant-numeric: tabular-nums;
  margin: 6px 0 12px;
}
.scores b {
  color: var(--pf-fg2);
}
.brkBox .voted {
  color: var(--pf-dim);
  font-size: 0.9em;
  align-self: center;
}
.awHi {
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: 560px;
  margin: 0 0 10px;
  padding: 8px 14px;
  border-radius: calc(var(--pf-radius) + 4px);
  border: 1px solid color-mix(in srgb, var(--pf-gold) 53%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--pf-rule) 18%, var(--pf-panel)), var(--pf-panel));
}
.awHi .em {
  font-size: 30px;
  line-height: 1;
  flex: none;
}
.awHi .tx {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.awHi .k {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--pf-gold);
  margin-right: 6px;
}
.awHi .ti {
  font-size: 16px;
  font-weight: 700;
}
.awHi .row2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.awHi .ln {
  color: var(--pf-fg2);
  font-size: 13px;
}
.awHi .awChip {
  font-size: 13px;
  padding: 0 7px;
}
.brkHint {
  margin: 12px 0;
}
/* the break's parts breathe (CFHA500, ac: "vertical spacing instead"): one even gap between the title, the
 award, the vote, the scores and Up next */
#panelBody .brkHead {
  margin-bottom: 20px;
}
#panelBody .awHi,
#panelBody .brkBox,
#panelBody .scores {
  margin-bottom: 20px;
}
#panelBody .upNext {
  margin: 20px 0;
}
.brkBox .rv {
  white-space: nowrap;
  flex: none;
}
.brkHint .awNudge {
  margin: 0 0 2px;
  font-size: 14px;
}
.brkHint .dim {
  color: var(--pf-dim);
  font-size: 13px;
}
.brkBox {
  border: 1px solid var(--pf-line);
  box-shadow: var(--pf-card-edge);
  border-radius: calc(var(--pf-radius) + 4px);
  padding: 10px 14px;
  background: var(--pf-panel);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 640px;
}
.brkBox h2 {
  margin: 0;
}
.brkBox h2 span {
  color: var(--pf-dim);
  font-weight: normal;
  font-size: 13px;
}
.brkBox .btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
/* the vote (EC4C9X8): keeping is the main button, dropping the quiet one; your own vote gets a tick and a ring */
.brkBox .btns button[aria-pressed="true"] {
  outline: 2px solid var(--pf-fg);
  outline-offset: 2px;
}
.brkBox .btns button[aria-pressed="true"]::before {
  content: "✓ ";
}
#join {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--pf-bg) 93%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
#joinHere {
  margin: 4px 0 0;
  color: var(--pf-dim);
  text-align: center;
}
#join div {
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* ---- the TV screen page (/?screen, ST531N9): the game for the whole room, never a player ---------
 No join, no sidebar, no player buttons; the stage takes the whole screen; a big join card in the lobby. */
body.screen #join,
body.screen #side,
body.screen #drawerBtn,
body.screen #watchBtn,
body.screen #devWarn,
body.screen #panelBody button,
body.screen #panelBody textarea,
body.screen #panelBody input {
  display: none !important;
}
body.screen .join {
  max-width: 900px;
  padding: 18px 24px;
  gap: 26px;
}
body.screen .join img {
  width: 260px;
  height: 260px;
}
body.screen .join .url {
  font-size: 22px;
  white-space: nowrap;
}
body.screen .join.brk {
  margin-top: 18px;
  padding: 12px 18px;
  gap: 18px;
}
body.screen .join.brk img {
  width: 160px;
  height: 160px;
}
/* a phone in a room with a TV (couch): while a round runs it's a controller, the game is on the TV. The stage
 stays mounted (input goes through the game's client) but invisible behind a big pad. 📱 in the top bar shows
 the game on the phone too (remembered). */
#ctrlInfo,
#ctrlBtn {
  display: none;
}
body.screens.touch:not(.screen) #ctrlBtn {
  display: inline-block;
}
body.controller.touch.playing.ctl #main {
  display: grid;
  overflow: hidden;
  grid-template: "info info" auto "padL padR" 1fr / 1fr 1fr;
}
body.controller.touch.playing.ctl:not(.pad) #main {
  grid-template: "info" 1fr / 1fr; /* a game's own controller UI, no pad: it gets the whole phone */
}
body.controller.touch.playing.ctl #stage {
  position: absolute;
  inset: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: -1;
}
body.controller.touch.playing.ctl #ctrlInfo {
  grid-area: info;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  gap: 10px;
  padding: 14px 10px;
  font-size: 20px;
  text-align: center;
}
body.controller.touch.playing.ctl .stick {
  width: min(240px, 92%);
}
body.controller.touch.playing.ctl .tbtn {
  width: min(130px, 46%);
  font-size: 26px;
}
#screenTag {
  display: none;
  color: var(--pf-dim);
  font-size: 13px;
  letter-spacing: 2px;
}
body.screen #screenTag {
  display: inline;
}
/* ---- touch + phone (Mobile mode, or any touch/small screen) ------------------------------------
 body.touch: on-screen controls (#padL stick, #padR buttons) beside/below the stage, never over it.
 body.phone: compact top bar, sidebar becomes a drawer (☰ button) that shrinks the stage when open. */
#padL,
#padR {
  display: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  min-height: 0;
}
body.touch.playing.pad #main {
  display: grid;
  overflow: hidden;
  grid-template: "stage stage" 1fr "padL padR" minmax(120px, 28dvh) / 1fr 1fr;
}
@media (orientation: landscape) {
  body.touch.playing.pad #main {
    grid-template: "padL stage padR" 1fr / minmax(110px, 22vw) 1fr minmax(110px, 22vw);
  }
}
body.touch.playing.pad #stage {
  grid-area: stage;
  min-height: 0;
  min-width: 0;
}
body.touch.playing.pad #padL {
  grid-area: padL;
  display: flex;
}
body.touch.playing.pad #padR {
  grid-area: padR;
  display: flex;
  flex-wrap: wrap;
}
.stick {
  width: min(150px, 90%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--pf-row);
  border: 2px solid var(--pf-line2);
  position: relative;
  touch-action: none;
}
.stick i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42%;
  height: 42%;
  margin: -21% 0 0 -21%;
  border-radius: 50%;
  background: var(--pf-line2);
  border: 2px solid var(--pf-line2);
  pointer-events: none;
}
.stick.on {
  border-color: var(--pf-action);
}
.stick.on i {
  background: var(--pf-action);
}
.tbtn {
  width: min(84px, 42%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--pf-raise);
  border: 2px solid var(--pf-line2);
  color: var(--pf-fg);
  font: bold 18px var(--pf-font);
  padding: 0;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.1;
}
.tbtn.on {
  background: var(--pf-action);
  border-color: var(--pf-action);
}
#drawerBtn {
  display: none;
  background: var(--pf-raise);
  padding: 4px 10px;
}
body.phone {
  height: 100dvh;
  overscroll-behavior: none;
}
body.phone #top {
  gap: 8px;
  padding: 4px 8px;
}
body.phone #top h1,
body.phone #chips {
  display: none;
}
body.phone #phase {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 1;
}
body.phone #timer {
  font-size: 18px;
}
body.phone #drawerBtn {
  display: block;
}
/* docs/DESIGN.md 7: a phone's top bar holds the host's face, where you are, the timer and the menu. The mode chip,
 the device warning and the tool buttons live in the menu (#sideTools). */
body.phone #phase .phTail {
  display: none;
}
body.phone #phase {
  flex: 1;
  font-size: 17px;
  color: var(--pf-fg);
}
body.phone #top #spacer {
  display: none;
}
body.phone #drawerBtn {
  position: relative;
  min-width: 44px;
  min-height: 44px;
  font-size: 20px;
}
body.phone #drawerBtn.warn:not(.unread)::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pf-warn);
  border: 2px solid var(--pf-bg);
}
#sideTools {
  display: none;
}
body.phone #sideTools {
  display: flex;
  flex-direction: column;
  margin-top: auto;
  padding-top: 12px;
}
body.phone.screens:not(.screen) #sideTools > #ctrlBtn,
body.phone #sideTools > button:not(#ctrlBtn) {
  display: flex;
}
body.phone #sideTools > button {
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 4px;
  background: none;
  border-top: 1px solid var(--pf-line);
  border-radius: 0;
  color: var(--pf-fg);
  font-size: 17px;
  font-weight: normal;
  text-align: left;
}
body.phone #sideTools > button[data-label]::after {
  content: attr(data-label);
}
body.phone #sideTools > button:empty,
body.phone #sideTools > #songNow:empty {
  display: none;
}
body.phone #sideTools #modeTag,
body.phone #sideTools #devWarn {
  align-self: flex-start;
  margin-bottom: 8px;
  white-space: normal;
}
body.phone #wrap {
  flex-direction: column;
}
/* phones: the sidebar is a sheet that slides up from the bottom over a dimmed stage (JT5T9P6), opened only on
 purpose (☰, or the break screen's button) and closed by ☰, a tap outside, a swipe down or a round start.
 Errors and mid-round votes live in a strip above the stage instead (layoutFlags moves them). */
body.phone #side {
  position: fixed;
  z-index: 25;
  width: auto;
  border: 0;
  max-height: none;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  visibility: hidden;
  transition:
    transform 0.22s ease-out,
    visibility 0s 0.22s;
  box-shadow: 0 0 40px #000a;
}
body.phone.sideOpen #side {
  visibility: visible;
  transform: none;
  transition:
    transform 0.22s ease-out,
    width 0.22s ease-out;
}
#sideScrim {
  display: none;
}
body.phone #sideScrim {
  display: block;
  position: fixed;
  inset: var(--topH, 44px) 0 0 0;
  z-index: 24;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}
body.phone.sideOpen #sideScrim {
  opacity: 0.55;
  pointer-events: auto;
}
body.phone #side {
  left: 0;
  right: 0;
  bottom: 0;
  max-height: calc(100dvh - var(--topH, 44px) - 16px);
  border-left: 0;
  border-top: 1px solid var(--pf-line);
  border-radius: calc(var(--pf-radius) + 10px) calc(var(--pf-radius) + 10px) 0 0;
  padding-top: 26px;
  transform: translateY(100%);
}
/* the grab handle: pull it down to close (the rest of the sheet scrolls, so only the handle drags) */
#sideGrab {
  display: none;
}
body.phone #side #sideGrab {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 26px;
  touch-action: none;
}
body.phone #side #sideGrab::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 50%;
  width: 40px;
  height: 4px;
  margin-left: -20px;
  border-radius: 2px;
  background: var(--pf-line2);
}
body.phone #side #tabs button {
  flex: 1;
  padding: 10px 4px;
}
#sideClose {
  display: none;
}
/* phones: the menu button in the top bar closes the menu too, so the drawer has no ✕ of its own */
body.phone.sideDrag #side {
  transition: none !important;
} /* following the finger */
body.phone #side {
  touch-action: pan-y;
} /* vertical scroll stays native, horizontal moves are our swipe */

body.phone #error {
  margin: 4px 8px 0;
  flex-shrink: 0;
}
body.phone #midvote {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border-radius: 0;
  border-width: 0 0 2px;
  padding: 6px 8px;
  flex-shrink: 0;
}
body.phone #midvote .mvq {
  font-size: 15px;
  flex: 1 1 100%;
}
body.phone #midvote .mvt {
  font-size: 12px;
  flex: 1 1 100%;
  margin-top: -4px;
}
body.phone #midvote button {
  flex: 1 1 0;
  min-width: 0;
  font-size: 15px;
  padding: 8px 10px;
}
body.phone #midvote button b {
  font-size: 16px;
}
#sideOpenBtn {
  display: none;
}
body.phone #sideOpenBtn {
  display: block;
  width: 100%;
  font-size: 15px;
  padding: 7px 10px;
  margin: 0 0 10px;
}
body.phone #panel {
  padding: 12px;
  margin: 0 auto; /* top-aligned: a phone screen has no room for a centred gap above the host */
}
body.phone #sideOpenBtn.last {
  margin: 28px 0 8px;
  padding: 12px 10px;
}
/* the intro on a phone (JT5T9P6): the title, how to play and the new rules fit without a wall of huge cards */
body.phone #panel .iTitle {
  font-size: 38px !important;
}
body.phone #panel .iHow {
  font-size: 16px !important;
  padding: 10px 12px !important;
}
body.phone #panel .iRule {
  font-size: 17px !important;
  padding: 8px 12px !important;
}
details.railRules > summary {
  padding: 8px 0;
  cursor: pointer;
}
details.iOld {
  color: var(--pf-dim);
}
/* the vote on a phone (CFHA500, ac: "can't they be in line with each other"): two buttons side by side at a
 normal height (44 px is a thumb), the count on its own line under them */
body.phone .brkBox .btns {
  gap: 8px;
  margin: 10px 0 4px;
}
body.phone .brkBox .btns button {
  flex: 1 1 0;
  min-height: 44px;
  padding: 6px 8px;
  font-size: 15px;
}
/* desktop (EC4C9X8, docs/DESIGN.md 7): the phone's column with more room, type that grows with the window */
body:not(.phone) #panel {
  max-width: clamp(700px, 62vw, 1100px);
  font-size: clamp(15px, 1.1vw, 19px);
}
body:not(.phone) #panel .brkHead h1 {
  font-size: clamp(26px, 3.6vw, 64px);
  font-family: var(--pf-display);
}
body:not(.phone) #panel .brkHead h1 small {
  font-size: 0.45em;
}
body:not(.phone) #panel .roundLine {
  font-size: clamp(20px, 1.7vw, 28px);
}
body:not(.phone) #klausSay {
  font-size: clamp(19px, 1.35vw, 24px);
  max-width: clamp(420px, 38vw, 680px);
}
body:not(.phone) #panel .brkBox h2 {
  font-size: clamp(17px, 1.3vw, 22px);
}
body:not(.phone) #panel .upNext {
  font-size: clamp(18px, 1.4vw, 24px);
}
body.phone #klausBig .klaus {
  width: 76px !important;
  height: 63px !important;
}
body.phone #klausSay {
  font-size: 15px;
  padding: 7px 12px;
}
body.phone #klausHero {
  gap: 10px;
}
body.phone #stats {
  inset: 48px 8px 8px 8px;
  padding: 12px;
}
body.phone .awards.awBig,
body.phone .awards.mini {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
body.phone .awards .award {
  min-height: 0;
  padding: 10px;
}
body.phone .awards .em {
  font-size: 26px;
}
body.phone #panel .brkHead h1 {
  font-size: 22px;
}
body.phone .awHi {
  padding: 6px 10px;
  gap: 10px;
}
body.phone .awHi .em {
  font-size: 26px;
}
body.phone .brkHint .why,
body.phone .rmRules > summary span,
body.phone .brkBox h2 span {
  display: none;
}
body.phone #hurry {
  font-size: 96px;
}
body.phone #hurry small {
  font-size: 20px;
}
@media (orientation: landscape) {
  body.phone #wrap {
    flex-direction: row;
  }
}
#midvote .mvs {
  display: none;
}
/* a phone held upright (YRE1BYZ): answers in two columns, slim, never broken word by word; an odd last one (the 🎲
   after two answers) gets the whole row; the seconds sit next to the question instead of a hint line */
@media (orientation: portrait) {
  body.phone #midvote.on {
    display: grid;
  }
  body.phone #midvote {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 8px 10px;
  }
  body.phone #midvote .mvq {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    gap: 8px;
  }
  body.phone #midvote .mvs {
    display: inline;
    font-style: normal;
    font-weight: normal;
    font-size: 13px;
    color: var(--pf-rule-soft);
    white-space: nowrap;
  }
  body.phone #midvote .mvt {
    display: none;
  }
  body.phone #midvote button {
    min-height: 40px;
    padding: 6px 12px;
    line-height: 1.2;
  }
  body.phone #midvote button:nth-of-type(odd):last-of-type {
    grid-column: 1 / -1;
  }
}
/* landscape phones: the vote strip is one row (height is what's short) */
@media (orientation: landscape) {
  body.phone #midvote {
    flex-wrap: nowrap;
    padding: 4px 8px;
  }
  body.phone #midvote .mvq {
    flex: 0 1 auto;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body.phone #midvote .mvt {
    display: none;
  }
  body.phone #midvote .mvq {
    display: flex;
    gap: 8px;
    align-items: baseline;
  }
  body.phone #midvote .mvs {
    display: inline;
    font-style: normal;
    font-weight: normal;
    font-size: 12px;
    color: var(--pf-rule-soft);
  }
  body.phone #midvote button {
    padding: 5px 10px;
    font-size: 14px;
    white-space: nowrap;
  }
  body.phone #midvote button span {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
/* principle 1: while a round is played the page goes quiet, so no texture behind the stage */
body.playing {
  background-image: none;
}
