@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces.woff2') format('woff2');
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces-italic.woff2') format('woff2');
  font-weight: 400 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Figtree';
  src: url('/fonts/figtree.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #07040a;
  --ink: #fff1e2;
  --ink-2: rgba(255, 236, 214, 0.7);
  --ink-3: rgba(255, 236, 214, 0.44);
  --line: rgba(255, 214, 178, 0.12);
  --card: rgba(30, 17, 14, 0.8);
  --card-2: #1b0f0d;
  --ember: #ff7a1a;
  --ember-hot: #ffb547;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --ui: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --my-hue: 24;
  --spring: cubic-bezier(0.3, 1.5, 0.45, 1);
  --ease: cubic-bezier(0.2, 0.85, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100svh;
  overscroll-behavior-y: none;
  background:
    radial-gradient(120% 60% at 50% 0%, #120b18 0%, transparent 60%),
    var(--bg);
}

button { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--ember-hot); outline-offset: 2px; }
[hidden] { display: none !important; }

.app {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}

/* ------------------------------------------------------------------ scene */

.scene {
  position: relative;
  height: clamp(380px, 60svh, 600px);
  overflow: hidden;
  background: #0b0a1d;
}
.scene canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.scene::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 90px;
  background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
  z-index: 1;
}

.topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 6;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: calc(var(--safe-top) + 14px) 16px 0;
}
.title { flex: 1; min-width: 0; transition: opacity 0.5s; }
/* The fire's name only arrives with the first state; keep the space, show nothing until then. */
.app[data-view='loading'] .title { opacity: 0; }
.title h1 {
  min-height: 1.1em;
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 27px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.count {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
}
.pips { display: inline-flex; gap: 4px; }
.pip {
  width: 8px;
  height: 11px;
  border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.5s, box-shadow 0.5s, transform 0.5s var(--spring);
}
.pip.on {
  background: linear-gradient(#ffe08a, #ff6a1a);
  box-shadow: 0 0 9px #ff7a1a;
  transform: scale(1.15);
}

.icon-btn {
  position: relative;
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(16, 9, 10, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  transition: color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.icon-btn svg { width: 20px; height: 20px; }
.bell[data-state='hidden'] { display: none; }
.bell .slash { display: none; }
.bell[data-state='denied'] .slash, .bell[data-state='unsupported'] .slash { display: block; }
.bell[data-state='on'] {
  color: var(--ember-hot);
  border-color: rgba(255, 170, 90, 0.4);
  box-shadow: 0 0 18px rgba(255, 122, 26, 0.3);
}
.bell-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ember);
  display: none;
}
.bell[data-state='off'] .bell-dot,
.bell[data-state='install'] .bell-dot {
  display: block;
  animation: beacon 2s infinite;
}
@keyframes beacon {
  0% { box-shadow: 0 0 0 0 rgba(255, 122, 26, 0.7); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(255, 122, 26, 0); }
}

/* ------------------------------------------------------------------ seats */

.seats {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.seat {
  --c: hsl(var(--hue) 95% 62%);
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 86px;
  display: flex;
  flex-direction: column;
  align-items: center;
  translate: -50% -24px;
  scale: var(--s, 1);
  transition: left 0.8s var(--ease), top 0.8s var(--ease), scale 0.8s var(--ease);
}
.seat .avatar {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  color: rgba(255, 238, 222, 0.72);
  background:
    radial-gradient(circle at var(--lx, 50%) var(--ly, 10%), rgba(255, 150, 70, calc(0.12 + 0.3 * var(--fire, 0))) 0%, transparent 72%),
    #1b1013;
  border: 2px solid hsl(var(--hue) 45% 42% / 0.55);
  transition: color 0.5s, border-color 0.5s, box-shadow 0.6s, filter 0.6s, background 0.6s, scale 0.3s var(--spring);
}
.seat .ring {
  position: absolute;
  inset: -6px;
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  rotate: -90deg;
  opacity: 0;
  transition: opacity 0.5s;
}
.seat .ring circle {
  fill: none;
  stroke: var(--c);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: var(--p, 100) 100;
  transition: stroke-dasharray 1s linear;
}
.seat[data-state='lit'][data-timed] .ring { opacity: 0.85; }
.seat .name {
  max-width: 86px;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-2);
  text-shadow: 0 1px 6px #000, 0 0 2px #000;
  transition: color 0.5s;
}
.seat .tag {
  max-width: 86px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--c);
  text-shadow: 0 1px 6px #000;
  opacity: 0;
  translate: 0 -4px;
  transition: opacity 0.4s, translate 0.4s;
}
.seat .mini-flame {
  position: absolute;
  top: -20px;
  left: 50%;
  width: 16px;
  height: 24px;
  margin-left: -8px;
  transform-origin: 50% 100%;
  scale: 0;
  transition: scale 0.45s var(--spring);
}
.seat .mini-flame::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 82%, #fff 0 16%, var(--c) 46%, transparent 72%);
  animation: flick 0.8s infinite alternate ease-in-out;
}
.seat .zz {
  position: absolute;
  top: -8px;
  right: 16px;
  font-family: var(--display);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-3);
  opacity: 0;
}
.seat[data-state='lit'] .avatar {
  color: #fff8ee;
  border-color: var(--c);
  background:
    radial-gradient(circle at var(--lx, 50%) var(--ly, 10%), hsl(var(--hue) 95% 68% / 0.6) 0%, transparent 78%),
    #2a1611;
  box-shadow: 0 0 0 4px hsl(var(--hue) 95% 60% / 0.16), 0 0 28px hsl(var(--hue) 95% 58% / 0.55);
}
.seat[data-state='lit'] .name { color: var(--ink); }
.seat[data-state='lit'] .tag:not(:empty) { opacity: 1; translate: 0 0; }
.seat[data-state='lit'] .mini-flame { scale: 1; }
.seat[data-state='asleep'] .avatar { filter: saturate(0.35) brightness(0.7); }
.seat[data-state='asleep'] .zz { animation: zz 3.4s infinite ease-out; }
.seat.me .name { color: var(--ink); }
.seat.me .avatar::after {
  content: '';
  position: absolute;
  bottom: -9px;
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--c);
  opacity: 0.8;
}
.seat.entering .avatar { animation: seat-in 0.9s var(--spring) both; }
.seat.entering .name, .seat.entering .tag { animation: fade-in 0.6s 0.25s both; }
.seat.leaving { animation: seat-out 0.5s both; }
.seats.crowded .seat { translate: -50% -19px; width: 64px; }
.seats.crowded .seat .name { font-size: 10.5px; max-width: 60px; }
.seats.crowded .seat .tag { display: none; }
.seats.crowded .seat .avatar { width: 38px; height: 38px; font-size: 16px; }

@keyframes seat-in {
  from { opacity: 0; transform: translateY(18px) scale(0.3); }
}
@keyframes seat-out {
  to { opacity: 0; transform: scale(0.6); }
}
@keyframes fade-in {
  from { opacity: 0; }
}
@keyframes zz {
  0% { opacity: 0; transform: translate(0, 4px) scale(0.8); }
  30% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(10px, -14px) scale(1.15); }
}
@keyframes flick {
  0% { transform: scale(1, 1) skewX(-3deg); }
  50% { transform: scale(0.93, 1.07) skewX(2deg); }
  100% { transform: scale(1.05, 0.94) skewX(-1deg); }
}

/* ------------------------------------------------------------------ banner */

.banner {
  position: absolute;
  inset: 24% 0 auto;
  z-index: 5;
  text-align: center;
  pointer-events: none;
  opacity: 0;
}
.banner strong {
  display: block;
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: 46px;
  line-height: 1.1;
  background: linear-gradient(#fff6cf, #ffb547 55%, #ff6a1a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 20px rgba(255, 140, 40, 0.65));
}
.banner span {
  display: block;
  margin-top: 4px;
  font-weight: 700;
  color: var(--ink);
  text-shadow: 0 1px 10px #000;
}
.banner.show { animation: banner 3.4s var(--ease) both; }
@keyframes banner {
  0% { opacity: 0; transform: translateY(24px) scale(0.6); }
  14% { opacity: 1; transform: none; }
  78% { opacity: 1; transform: translateY(-6px); }
  100% { opacity: 0; transform: translateY(-34px); }
}

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

.panel {
  --c: hsl(var(--my-hue) 95% 60%);
  position: relative;
  z-index: 4;
  margin: -34px 12px 0;
  padding: 16px 16px 16px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(40, 22, 17, 0.94), rgba(20, 11, 11, 0.97));
  border: 1px solid var(--line);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 220, 190, 0.07);
  transition: border-color 0.6s, box-shadow 0.6s;
}
.panel.lit {
  border-color: hsl(var(--my-hue) 90% 60% / 0.38);
  box-shadow: 0 0 46px hsl(var(--my-hue) 90% 55% / 0.2), 0 -12px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 220, 190, 0.07);
}
.status-line {
  margin: 0 0 12px;
  min-height: 27px;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.panel.lit .status-line { color: #fff6ea; }

/* The drums: three alarm-clock wheels sharing one glowing band across the middle row. */
.deck {
  --row: 34px;
  --head: 24px;
  position: relative;
  display: flex;
  gap: 4px;
  margin: 0 -6px;
}
.deck-band {
  position: absolute;
  inset: calc(var(--head) + var(--row) * 2) 0 auto;
  height: var(--row);
  border-radius: 12px;
  border: 1px solid hsl(var(--my-hue) 90% 66% / 0.3);
  background: linear-gradient(90deg, hsl(var(--my-hue) 90% 60% / 0.07), hsl(var(--my-hue) 90% 60% / 0.15) 50%, hsl(var(--my-hue) 90% 60% / 0.07));
  box-shadow: 0 0 22px hsl(var(--my-hue) 90% 55% / 0.12), inset 0 1px 0 rgba(255, 232, 205, 0.07);
  pointer-events: none;
  transition: border-color 0.6s, box-shadow 0.6s;
}
.panel.lit .deck-band { border-color: hsl(var(--my-hue) 95% 66% / 0.5); box-shadow: 0 0 26px hsl(var(--my-hue) 95% 58% / 0.24), inset 0 1px 0 rgba(255, 232, 205, 0.1); }
.deck.sent .deck-band { animation: band-flash 0.7s var(--ease); }
@keyframes band-flash {
  30% { border-color: hsl(var(--my-hue) 100% 72% / 0.9); box-shadow: 0 0 34px hsl(var(--my-hue) 100% 60% / 0.5), inset 0 0 18px hsl(var(--my-hue) 100% 60% / 0.25); }
}
.drum { position: relative; flex: 1.45 1 0; min-width: 0; transition: opacity 0.3s; }
.drum.burns { flex: 0.85 1 0; }
/* A faint seam before the reactions: the first two drums pick, this one sends. */
.drum.say::before {
  content: '';
  position: absolute;
  left: -3px;
  top: calc(var(--head) + 8px);
  bottom: 8px;
  width: 1px;
  background: linear-gradient(transparent, var(--line) 25%, var(--line) 75%, transparent);
}
.drum.cooling { opacity: 0.45; }
.drum-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.drum-head small { font-size: 10.5px; font-weight: 650; letter-spacing: 0.02em; text-transform: none; color: hsl(var(--my-hue) 80% 72% / 0.6); white-space: nowrap; }
.drum-add {
  width: 20px;
  height: 20px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid hsl(var(--my-hue) 90% 65% / 0.4);
  background: hsl(var(--my-hue) 90% 55% / 0.12);
  color: hsl(var(--my-hue) 95% 75%);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.25s var(--spring), background 0.25s;
}
.drum-add:active { transform: scale(0.85); background: hsl(var(--my-hue) 90% 55% / 0.3); }
/* The keeper's + takes the place of the hint on the narrow Say drum. */
.drum-add:not([hidden]) + small { display: none; }
.wheel {
  position: relative;
  height: calc(var(--row) * 5);
  -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
}
.wheel-list {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
.wheel-list::-webkit-scrollbar { display: none; }
/* Room above the first row and below the last, so either can sit in the band. */
.wheel-list::before, .wheel-list::after { content: ''; display: block; height: calc(var(--row) * 2); }
.wheel-item {
  display: block;
  width: 100%;
  height: var(--row);
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 15px;
  font-weight: 650;
  scroll-snap-align: center;
  cursor: pointer;
  will-change: transform, opacity;
  transition: color 0.2s;
}
.wheel-item .wl { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wheel-item.on { color: var(--ink); font-weight: 750; }
.wheel-item.emoji { font-size: 21px; }
.panel.lit .wheel-item.on[aria-checked='true'] { color: hsl(var(--my-hue) 100% 82%); text-shadow: 0 0 14px hsl(var(--my-hue) 100% 60% / 0.6); }
.wheel-item:focus-visible { outline: none; }
.wheel-item:focus-visible .wl { outline: 2px solid var(--ember-hot); outline-offset: 1px; border-radius: 6px; }
.wheel-item.sent .wl { animation: wheel-sent 0.6s var(--spring); }
/* While a drum turns by hand, a taller list floats over it (public/wheel.js `pop`): nine rows,
   centered on the band, wider than a narrow drum. It never takes the finger. */
.wheel-pop {
  position: absolute;
  z-index: 15;
  top: calc(var(--head) - var(--row) * 2);
  left: 50%;
  width: max(100%, 150px);
  height: calc(var(--row) * 9);
  translate: -50% 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid hsl(var(--my-hue) 90% 66% / 0.32);
  background: linear-gradient(180deg, rgba(26, 14, 13, 0.97), rgba(18, 10, 10, 0.97));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 30px hsl(var(--my-hue) 90% 55% / 0.14);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  scale: 0.94;
  transition: opacity 0.18s, scale 0.22s var(--ease), visibility 0s 0.22s;
}
.wheel-pop.open { opacity: 1; visibility: visible; scale: 1; transition: opacity 0.12s, scale 0.2s var(--ease); }
.wp-band {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 50%;
  height: var(--row);
  margin-top: calc(var(--row) / -2);
  border-radius: 12px;
  border: 1px solid hsl(var(--my-hue) 90% 66% / 0.45);
  background: hsl(var(--my-hue) 90% 60% / 0.14);
}
.wp-list { position: absolute; inset: 0; }
.wp-item {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: var(--row);
  margin-top: calc(var(--row) / -2);
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  line-height: var(--row);
  font-size: 15px;
  font-weight: 650;
  color: var(--ink-2);
  will-change: transform, opacity;
}
.wp-item.on { color: var(--ink); font-weight: 750; }
.wp-item.emoji { font-size: 21px; }
.reduced .wheel-pop, .reduced .wheel-pop.open { scale: 1; }
@keyframes wheel-sent {
  35% { transform: scale(1.3); color: #fff; text-shadow: 0 0 16px hsl(var(--my-hue) 100% 62%); }
}

/* Text too long for its box scrolls round like a ticker (public/marquee.js). The ellipsis
   steps aside while it does; a soft edge on the right hints that there's more. The moving text
   gets a layer of its own, so it glides by fractions of a pixel instead of stepping. */
.mq-on {
  text-overflow: clip !important;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 10px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 10px), transparent);
}
.mq { position: relative; display: inline-block; white-space: nowrap; }
.mq-on > .mq { will-change: transform; }
.mq-copy { position: absolute; top: 0; white-space: nowrap; }

.chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 16px 2px 2px;
  margin: -2px 0;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s, transform 0.25s var(--spring);
}
.chip:active { transform: scale(0.94); }
.chip[aria-checked='true'] {
  color: #1d0e06;
  border-color: transparent;
  background: linear-gradient(#ffcd7a, #ff8f2e);
  box-shadow: 0 4px 16px rgba(255, 122, 26, 0.32);
}

/* The match: drag (or tap) the matchstick across the striker strip. */
.match {
  --pos: 0;
  position: relative;
  display: block;
  width: 100%;
  height: 78px;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  container-type: inline-size;
}
.match .strip {
  position: absolute;
  inset: 12px 0;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.07) 0 0.8px, transparent 1.4px) 0 0 / 6px 6px,
    radial-gradient(circle at 70% 70%, rgba(0, 0, 0, 0.35) 0 0.8px, transparent 1.4px) 0 0 / 5px 5px,
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.16) 0 2px, transparent 2px 6px),
    linear-gradient(#5e2b1d, #391711);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.65), inset 0 -1px 0 rgba(255, 200, 160, 0.08), 0 1px 0 rgba(255, 220, 190, 0.05);
}
.match .trail {
  position: absolute;
  left: 18px;
  top: 50%;
  height: 8px;
  width: calc((100cqw - 120px) * var(--pos));
  translate: 0 -50%;
  border-radius: 8px;
  background: linear-gradient(90deg, transparent, hsl(var(--my-hue) 95% 60% / 0.55), #ffe2a8);
  filter: blur(3px);
  opacity: 0;
  transition: opacity 0.6s;
}
.match.lit .trail { opacity: 0.75; animation: trail-glow 2.4s infinite alternate ease-in-out; }
@keyframes trail-glow { to { opacity: 0.45; } }
.match .hint {
  position: absolute;
  right: 20px;
  top: 50%;
  translate: 0 -50%;
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 210, 170, 0.5);
  opacity: calc(1 - var(--pos) * 2.2);
  transition: opacity 0.3s;
}
.match .hint span { margin-right: 6px; }
.match .hint i {
  font-style: normal;
  font-size: 18px;
  animation: chevron 1.6s infinite;
}
.match .hint i:nth-child(3) { animation-delay: 0.15s; }
.match .hint i:nth-child(4) { animation-delay: 0.3s; }
@keyframes chevron {
  0%, 100% { opacity: 0.2; }
  40% { opacity: 1; color: #ffcf9a; }
}
.match .stick {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 104px;
  height: 18px;
  translate: calc((100cqw - 124px) * var(--pos)) -50%;
  transition: translate 0.5s var(--spring);
}
.match.dragging .stick, .match.dragging .trail { transition: none; }
.match .wood {
  position: absolute;
  left: 0;
  top: 4px;
  width: 88px;
  height: 10px;
  border-radius: 3px 5px 5px 3px;
  background: linear-gradient(#f7e2b4, #d0a066 70%, #b5864f);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.55);
}
.match .head {
  position: absolute;
  right: 0;
  top: -2px;
  width: 25px;
  height: 22px;
  border-radius: 56% 62% 62% 56%;
  background: radial-gradient(circle at 34% 30%, #ff9c8c 0 10%, #c9301e 42%, #74130a 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  transition: background 0.8s;
}
.match.lit .head {
  background: radial-gradient(circle at 42% 42%, #ffe6a6 0 10%, #ff8a2a 32%, #3d1b10 76%);
}
.match .flame {
  position: absolute;
  right: -6px;
  bottom: 9px;
  width: 36px;
  height: 58px;
  transform-origin: 50% 100%;
  scale: 0;
  transition: scale 0.4s var(--spring);
  pointer-events: none;
}
.match.lit .flame { scale: 1; }
.match .flame i {
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 86%, #fff 0 12%, #ffe08a 22%, var(--c) 50%, transparent 72%);
  animation: flick 0.9s infinite alternate ease-in-out;
  transform-origin: 50% 100%;
}
.match .flame i + i {
  inset: 22% 24% 0;
  animation-duration: 0.55s;
  background: radial-gradient(ellipse at 50% 86%, #fff 0 28%, #ffd36b 52%, transparent 74%);
}
.match .puff {
  position: absolute;
  right: 0;
  bottom: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 190, 185, 0.5), transparent 70%);
  opacity: 0;
  pointer-events: none;
}
.match.dousing .puff { animation: puff 1s ease-out; }
@keyframes puff {
  0% { opacity: 0.9; transform: translateY(0) scale(0.5); }
  100% { opacity: 0; transform: translateY(-40px) scale(2.2); }
}
.match.igniting .head { animation: ignite 0.7s ease-out; }
@keyframes ignite {
  0% { box-shadow: 0 0 0 0 rgba(255, 245, 210, 0.9); }
  25% { box-shadow: 0 0 34px 14px rgba(255, 200, 120, 0.9); }
  100% { box-shadow: 0 0 10px 2px rgba(255, 122, 26, 0); }
}
.match .spark {
  position: absolute;
  right: 8px;
  top: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffe2a0;
  box-shadow: 0 0 6px #ffb547;
  pointer-events: none;
  animation: spark 0.7s ease-out forwards;
}
@keyframes spark {
  to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3); }
}

.nudge {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 10px 12px 14px;
  border-radius: 16px;
  background: rgba(255, 140, 60, 0.07);
  border: 1px dashed rgba(255, 170, 100, 0.32);
  animation: fade-in 0.6s both;
}
.nudge-text { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-2); }
.nudge-text strong { display: block; font-size: 14px; color: var(--ink); }
.nudge-x {
  flex: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  font-size: 20px;
  cursor: pointer;
}

/* ------------------------------------------------------------------ roster */

.roster { padding: 24px 16px calc(32px + var(--safe-bottom)); }
.roster h2 {
  margin: 0 0 12px 4px;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink-2);
}
.roster ul { list-style: none; margin: 0; padding: 0; }
.friend {
  --c: hsl(var(--hue) 95% 62%);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 11px 14px 11px 11px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  transition: border-color 0.5s, background 0.5s;
}
.friend[data-state='lit'] {
  border-color: hsl(var(--hue) 90% 60% / 0.34);
  background: linear-gradient(90deg, hsl(var(--hue) 90% 50% / 0.15), var(--card) 65%);
}
.friend .dot {
  position: relative;
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  background: hsl(var(--hue) 35% 17%);
  color: hsl(var(--hue) 85% 76%);
  transition: background 0.5s, color 0.5s, box-shadow 0.5s;
}
.friend[data-state='lit'] .dot {
  background: var(--c);
  color: #170a05;
  box-shadow: 0 0 18px hsl(var(--hue) 90% 55% / 0.6);
}
.friend .online {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #a7e37c;
  border: 2px solid #1e1110;
}
.friend .who { flex: 1; min-width: 0; }
.friend b { font-weight: 700; font-size: 15.5px; }
.friend .you {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 2px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-2);
}
.friend small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--ink-3);
}
.friend[data-state='lit'] small { color: var(--ink-2); }
.friend .lit-flame {
  flex: none;
  width: 14px;
  height: 22px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 82%, #fff 0 16%, var(--c) 48%, transparent 74%);
  animation: flick 0.75s infinite alternate ease-in-out;
  transform-origin: 50% 100%;
}
.empty {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  color: var(--ink-3);
  text-align: center;
  font-size: 14px;
}
.empty.small { padding: 14px; font-size: 13.5px; }

/* ------------------------------------------------------------------ views */

/* One page, several views: the scene backs everything except the fire list. */
.app:not([data-view='fire']) .panel,
.app:not([data-view='fire']) .plans,
.app:not([data-view='fire']) .roster,
.app:not([data-view='fire']) .topbar,
.app:not([data-view='home']) .home { display: none; }
.app[data-view='home'] .scene { display: none; }
.app:not([data-view='fire']):not([data-view='home']) .scene { height: 100svh; max-height: none; }

/* ------------------------------------------------------------------ overlays */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end center;
  padding: 16px 12px calc(14px + var(--safe-bottom));
  background: linear-gradient(transparent 35%, rgba(7, 4, 10, 0.72) 70%, rgba(7, 4, 10, 0.92));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.overlay .card {
  width: min(520px, 100%);
  padding: 22px 20px 20px;
  border-radius: 28px;
  background: rgba(27, 15, 13, 0.94);
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  translate: 0 28px;
  transition: translate 0.7s var(--ease);
}
.overlay.open .card { translate: 0 0; }
.overlay h2 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
}
.overlay p { margin: 0 0 4px; color: var(--ink-2); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.ember-badge {
  width: 46px;
  height: 46px;
  margin-bottom: 12px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 122, 26, 0.1);
  border: 1px solid rgba(255, 150, 80, 0.25);
}
.ember-badge i {
  width: 14px;
  height: 20px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 82%, #ffd9a0 0 14%, #ff6a1a 50%, transparent 74%);
  animation: flick 1.2s infinite alternate ease-in-out;
  transform-origin: 50% 100%;
}
.overlay .btn-primary { margin-top: 16px; }

.label {
  display: block;
  margin: 14px 0 8px;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink-2);
}
.field {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.32);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field:focus { border-color: rgba(255, 170, 90, 0.6); box-shadow: 0 0 0 4px rgba(255, 122, 26, 0.15); }
.field::placeholder { color: var(--ink-3); }

.swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}
.swatch {
  --c: hsl(var(--hue) 95% 62%);
  position: relative;
  height: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s, transform 0.25s var(--spring);
}
.swatch:active { transform: scale(0.94); }
.swatch .f {
  width: 18px;
  height: 27px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 82%, #fff 0 14%, var(--c) 48%, transparent 74%);
  opacity: 0.55;
  transform-origin: 50% 100%;
  transition: opacity 0.3s;
}
.swatch small { font-size: 10.5px; font-weight: 650; color: var(--ink-3); }
.swatch[aria-checked='true'] {
  border-color: var(--c);
  background: hsl(var(--hue) 90% 50% / 0.13);
  box-shadow: 0 0 22px hsl(var(--hue) 90% 50% / 0.28);
}
.swatch[aria-checked='true'] .f { opacity: 1; animation: flick 0.7s infinite alternate ease-in-out; }
.swatch[aria-checked='true'] small { color: var(--ink); }
.swatches.compact .swatch { height: 52px; }
.swatches.compact .swatch small { display: none; }

.btn-primary, .btn-secondary, .btn-ghost, .btn-small {
  border: 0;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s var(--spring), opacity 0.2s, box-shadow 0.2s;
}
.btn-primary:active, .btn-secondary:active, .btn-ghost:active, .btn-small:active { transform: scale(0.97); }
.btn-primary {
  width: 100%;
  padding: 15px;
  border-radius: 18px;
  font-size: 17px;
  color: #1d0e06;
  background: linear-gradient(#ffcd7a, #ff7a1a);
  box-shadow: 0 10px 30px rgba(255, 122, 26, 0.34);
}
.btn-primary:disabled { opacity: 0.55; }
.btn-secondary {
  padding: 12px 18px;
  border-radius: 14px;
  color: #1d0e06;
  background: linear-gradient(#ffcd7a, #ff8f2e);
}
.btn-ghost {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}
.btn-small {
  flex: none;
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 14px;
  color: #1d0e06;
  background: linear-gradient(#ffcd7a, #ff8f2e);
}

/* ------------------------------------------------------------------ sheets */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(5, 3, 6, 0.62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 51;
  width: min(560px, 100%);
  max-height: 90svh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 18px calc(24px + var(--safe-bottom));
  border-radius: 28px 28px 0 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: #170d0c;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
  translate: -50% 105%;
  visibility: hidden;
  transition: translate 0.5s var(--ease), visibility 0s 0.5s;
}
.sheet.open { translate: -50% 0; visibility: visible; transition: translate 0.5s var(--ease); }
.grab { width: 42px; height: 5px; margin: 0 auto 10px; border-radius: 3px; background: rgba(255, 255, 255, 0.18); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { margin: 0; font-family: var(--display); font-size: 24px; font-weight: 700; }
.sheet h3 {
  margin: 24px 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.stack { display: grid; gap: 10px; }
.note { margin: 0 0 6px; font-size: 13.5px; color: var(--ink-2); }
.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  cursor: pointer;
}
.toggle input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 48px;
  height: 29px;
  margin: 0;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.13);
  cursor: pointer;
  transition: background 0.25s;
}
.toggle input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #f3e6da;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: translate 0.3s var(--spring);
}
.toggle input:checked { background: linear-gradient(90deg, #ff7a1a, #ffb547); }
.toggle input:checked::after { translate: 19px 0; }
.toggle input:disabled { opacity: 0.4; }
.steps { margin: 10px 0 0; padding-left: 22px; display: grid; gap: 12px; color: var(--ink); font-weight: 600; }
.steps svg { width: 18px; height: 18px; vertical-align: -3px; color: #6cb4ff; }

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

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(16px + var(--safe-bottom));
  z-index: 60;
  width: min(92vw, 420px);
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  --c: var(--ember);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 10px 16px 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(26, 14, 12, 0.94);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  font-size: 14px;
  font-weight: 650;
  animation: toast-in 0.5s var(--spring) both;
}
.toast .dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 10px var(--c);
}
.toast.muted .dot { background: #8a7f7a; box-shadow: none; }
.toast.out { animation: toast-out 0.4s both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.92); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

.reduced *, .reduced *::before, .reduced *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
/* The full-fire banner still has to be seen: fade it, no movement. */
.reduced .banner.show {
  animation: banner-still 3.4s linear both !important;
}
@keyframes banner-still {
  0%, 100% { opacity: 0; }
  8%, 85% { opacity: 1; }
}
/* Reactions too: they hold still and fade. */
.reduced .bubble {
  animation: banner-still 2.6s linear both !important;
}
.reduced .bubble.line { animation-duration: 4.2s !important; }
.reduced .spinner { animation: none !important; }

/* ------------------------------------------------------------------ fire view additions */

.topbar { gap: 7px; padding-left: 12px; padding-right: 12px; }
.topbar .icon-btn { width: 40px; height: 40px; }
.topbar .title h1 { font-size: 23px; }
.topbar .count { font-size: 13px; }
.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #1d0e06;
  background: linear-gradient(#ffcd7a, #ff7a1a);
  box-shadow: 0 0 10px rgba(255, 122, 26, 0.6);
}
.people .you {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 2px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-2);
}
.roster .keeper, .people .keeper {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 2px;
  color: #ffcf9a;
  background: rgba(255, 140, 60, 0.12);
}

/* Reaction bubbles rise from the sender's seat. */
.bubbles { position: absolute; inset: 0; z-index: 7; pointer-events: none; overflow: hidden; }
.bubble {
  position: absolute;
  left: var(--x);
  top: var(--y);
  translate: -50% -78px;
  white-space: nowrap;
  pointer-events: none;
  animation: bubble 2.6s var(--ease) both;
}
.bubble.emoji { font-size: 30px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6)); }
.bubble.line {
  padding: 7px 12px;
  border-radius: 14px 14px 14px 4px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff6ea;
  background: hsl(var(--hue) 55% 22% / 0.92);
  border: 1px solid hsl(var(--hue) 90% 60% / 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 18px hsl(var(--hue) 90% 55% / 0.3);
  animation-duration: 4.2s;
}
@keyframes bubble {
  0% { opacity: 0; transform: translateY(14px) scale(0.5); }
  12% { opacity: 1; transform: translateY(0) scale(1.08); }
  20% { transform: translateY(-4px) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift, 0), -44px); }
}

/* Flares: the touch area on the fire, the swipe hint, the aim label, seat rings and the call. */
.flare-zone {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: var(--w, 130px);
  height: var(--h, 150px);
  translate: -50% -50%;
  z-index: 3;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.flare-zone:active { cursor: grabbing; }
.flare-zone:focus-visible { outline: 2px dashed var(--ember-hot); outline-offset: 4px; }
.app:not([data-view='fire']) .flare-zone,
.app:not([data-view='fire']) .flare-hint { display: none; }

.flare-hint {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 30%);
  z-index: 3;
  translate: -50% -100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s;
}
.flare-hint.show { opacity: 1; }
.flare-hint i {
  width: 12px;
  height: 12px;
  margin-bottom: -3px;
  border-left: 2.5px solid #ffcf9a;
  border-top: 2.5px solid #ffcf9a;
  border-radius: 2px 0 0 0;
  rotate: 45deg;
  opacity: 0;
}
.flare-hint.show i { animation: chevron-up 1.4s infinite ease-out; }
.flare-hint i:nth-child(2) { animation-delay: 0.18s; }
.flare-hint i:nth-child(1) { animation-delay: 0.36s; }
.flare-hint span {
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 170, 100, 0.3);
  background: rgba(26, 14, 12, 0.84);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
@keyframes chevron-up {
  0% { opacity: 0; translate: 0 10px; }
  40% { opacity: 1; }
  100% { opacity: 0; translate: 0 -8px; }
}

.flare-aim {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 8;
  translate: -50% -100%;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(20, 11, 11, 0.88);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  color: var(--ink-2);
  pointer-events: none;
  opacity: 0;
  scale: 0.85;
  transition: opacity 0.2s, scale 0.25s var(--spring), color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.flare-aim.below { translate: -50% 0; }
.flare-aim.show { opacity: 1; scale: 1; }
.flare-aim.show.armed {
  color: #fff8ee;
  border-color: hsl(var(--hue) 90% 60% / 0.7);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 22px hsl(var(--hue) 95% 58% / 0.45);
  scale: 1.06;
}

.seat.aimed .avatar {
  border-color: hsl(var(--fh) 95% 65%);
  box-shadow: 0 0 0 4px hsl(var(--fh) 95% 60% / 0.35), 0 0 26px hsl(var(--fh) 95% 58% / 0.7);
  scale: 1.14;
}
.seat.flared .avatar { animation: flared 1.1s var(--ease); }
@keyframes flared {
  0% { scale: 1.25; box-shadow: 0 0 0 0 hsl(var(--fh) 100% 65% / 0.95), 0 0 34px hsl(var(--fh) 100% 60% / 0.9); }
  100% { scale: 1; box-shadow: 0 0 0 30px hsl(var(--fh) 100% 65% / 0), 0 0 0 hsl(var(--fh) 100% 60% / 0); }
}

.flare-call {
  position: absolute;
  inset: 14% 16px auto;
  z-index: 8;
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  pointer-events: none;
}
.flare-call strong {
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: 48px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  background: linear-gradient(#fffaf0 10%, hsl(var(--hue) 100% 78%) 50%, hsl(var(--hue) 95% 56%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px hsl(var(--hue) 95% 55% / 0.75));
}
.flare-call span { font-weight: 700; color: var(--ink); text-shadow: 0 1px 10px #000, 0 0 2px #000; }
.flare-reply {
  margin-top: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid hsl(var(--hue) 90% 65% / 0.7);
  background: hsl(var(--hue) 60% 20% / 0.92);
  color: #fff8ee;
  font-size: 15px;
  font-weight: 750;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.flare-reply:active { scale: 0.95; }
.flare-reply:disabled { cursor: default; }
.flare-call.show strong { animation: go-in 0.9s var(--spring) both, go-glow 1.6s 0.9s infinite alternate ease-in-out; }
.flare-call.show span { animation: rise-in 0.5s 0.2s var(--ease) both; }
.flare-call.show .flare-reply { animation: rise-in 0.5s 0.35s var(--ease) both, beckon 1.6s 0.9s infinite; }
.flare-call.out { animation: call-out 0.4s both; }
@keyframes go-in {
  0% { opacity: 0; transform: scale(0.3) rotate(-6deg); letter-spacing: 0.3em; }
  60% { opacity: 1; transform: scale(1.12) rotate(1deg); }
  100% { opacity: 1; transform: none; letter-spacing: -0.01em; }
}
@keyframes go-glow { to { filter: drop-shadow(0 0 32px hsl(var(--hue) 95% 60% / 0.95)); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes beckon {
  0% { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 0 hsl(var(--hue) 95% 60% / 0.55); }
  70%, 100% { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 14px hsl(var(--hue) 95% 60% / 0); }
}
@keyframes call-out { to { opacity: 0; transform: translateY(-16px); } }

/* Being called shakes the scene a little. */
.scene.jolt canvas, .scene.jolt .seats { animation: jolt 0.5s ease-out; }
@keyframes jolt {
  15% { translate: -4px 2px; }
  30% { translate: 4px -2px; }
  45% { translate: -3px 1px; }
  60% { translate: 2px -1px; }
  80% { translate: -1px 0; }
}

/* ------------------------------------------------------------------ plans */

.plans { padding: 26px 16px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px 4px; }
.section-head h2, .roster h2 { margin: 0; font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--ink-2); }
.roster h2 { margin: 0 0 12px 4px; }
.btn-chip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 170, 100, 0.35);
  background: rgba(255, 140, 60, 0.08);
  color: #ffcf9a;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s var(--spring);
}
.btn-chip:active { transform: scale(0.95); }
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.plan {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
}
.plan[data-live] {
  border-color: rgba(255, 170, 90, 0.42);
  background: linear-gradient(90deg, rgba(255, 122, 26, 0.16), var(--card) 70%);
}
.plan-when { flex: none; min-width: 74px; max-width: 112px; display: grid; }
.plan-when span { white-space: nowrap; }
.plan-when b { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #ffcf9a; }
.plan[data-live] .plan-when b { color: var(--ember-hot); }
.plan-when span { font-family: var(--display); font-size: 18px; font-weight: 700; }
.plan-what { flex: 1; min-width: 0; display: grid; gap: 2px; }
.plan-what b { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-what small { font-size: 12.5px; color: var(--ink-3); }
.plan-dots { display: flex; gap: 3px; margin-top: 3px; }
.mini-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 10.5px;
  font-weight: 700;
  color: #170a05;
  background: hsl(var(--hue) 90% 62%);
}
/* In, maybe or can't: a row of its own under the plan. */
.plan-answers { flex: 1 0 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s var(--spring), background 0.25s, color 0.25s;
}
.pa:active { transform: scale(0.95); }
.pa i { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); font-style: normal; font-size: 12px; font-weight: 800; }
.pa-in[aria-pressed='true'] { color: #1d0e06; border-color: transparent; background: linear-gradient(#ffcd7a, #ff8f2e); }
.pa-maybe[aria-pressed='true'] { color: #ffe3b5; border-color: rgba(255, 190, 110, 0.6); background: rgba(255, 160, 70, 0.18); }
.pa-out[aria-pressed='true'] { color: #ffb3a3; border-color: rgba(240, 101, 79, 0.55); background: rgba(240, 101, 79, 0.14); }
.pa[aria-pressed='true'] i { background: rgba(0, 0, 0, 0.18); }
.mini-dot.maybe { opacity: 0.55; box-shadow: 0 0 0 1.5px var(--card), 0 0 0 2.5px hsl(var(--hue) 90% 62% / 0.6); }
.plan-more {
  flex: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  font-size: 20px;
  cursor: pointer;
}
/* Other times friends asked for sit under the plan, across the whole card. */
.plan { flex-wrap: wrap; row-gap: 10px; }
.plan-times { flex: 1 0 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding-top: 9px; border-top: 1px dashed var(--line); }
.plan-time { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.pt-when { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.pt-when::before { content: '🕘'; margin-right: 6px; font-size: 13px; }
.plan-time .plan-dots { flex: none; margin: 0; }
.pt-vote, .pt-move {
  flex: none;
  padding: 7px 11px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s var(--spring), background 0.25s;
}
.pt-vote:active, .pt-move:active { transform: scale(0.95); }
.pt-vote[aria-pressed='true'] { color: #1d0e06; border-color: transparent; background: linear-gradient(#ffcd7a, #ff8f2e); }
.pt-move { color: #ffcf9a; border-color: rgba(255, 170, 100, 0.35); background: rgba(255, 140, 60, 0.1); }
.plan-suggest {
  justify-self: start;
  padding: 3px 0;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s;
}
.plan-suggest:hover, .plan-suggest:focus-visible { color: #ffcf9a; }
.plan-suggest b { color: var(--ink-2); font-weight: 700; }
.plan-suggest.hot, .plan-suggest.hot b { color: #ffcf9a; }
.pt-vote.back { color: var(--ink-2); border-style: dashed; }
.plan-for { margin-top: 2px; }
.plan-for b { color: var(--ink); }

/* ------------------------------------------------------------------ join requests */

.requests { margin-bottom: 22px; padding: 14px; border-radius: 20px; border: 1px solid rgba(255, 170, 100, 0.32); background: rgba(255, 140, 60, 0.06); }
.requests-head { margin: 0 0 10px 2px; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #ffcf9a; }
.request { --c: hsl(var(--hue) 95% 62%); display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.request .dot, .person .dot {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 700;
  background: hsl(var(--hue) 35% 17%);
  color: hsl(var(--hue) 85% 76%);
}
.request .who, .person .who { flex: 1; min-width: 0; }
.request b, .person b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request small { font-size: 12.5px; color: var(--ink-3); }
.btn-small.ghost { color: var(--ink); background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); }

/* ------------------------------------------------------------------ home */

.home { min-height: 100svh; padding: calc(var(--safe-top) + 16px) 16px calc(28px + var(--safe-bottom)); }
.home-top { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-size: 21px; font-weight: 700; }
.brand-flame {
  width: 16px;
  height: 23px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 82%, #fff 0 14%, #ffd36b 30%, #ff6a1a 56%, transparent 76%);
  animation: flick 1s infinite alternate ease-in-out;
  transform-origin: 50% 100%;
}
.avatar-btn { border-radius: 50%; font-family: var(--display); font-weight: 700; font-size: 18px; color: hsl(var(--my-hue) 85% 76%); }
.home-hello { margin: 26px 4px 16px; font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1.15; min-height: 1.15em; }
.fire-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fire-list + .fire-list:not(:empty) { margin-top: 10px; }
.fc {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 16px 16px 14px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(40, 22, 17, 0.9), rgba(20, 11, 11, 0.95));
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s var(--spring), border-color 0.4s, box-shadow 0.4s;
}
button.fc:active { transform: scale(0.98); }
.fire-card[data-lit] .fc { border-color: rgba(255, 150, 70, 0.4); box-shadow: 0 0 34px rgba(255, 122, 26, 0.16); }
.fc-flame {
  --level: 0;
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 80%, rgba(255, 122, 26, calc(0.08 + 0.3 * var(--level))), transparent 70%), rgba(0, 0, 0, 0.25);
}
.fc-flame::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 7px;
  width: calc(10px + 14px * var(--level));
  height: calc(14px + 20px * var(--level));
  translate: -50% 0;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 82%, #fff 0 14%, #ffd36b 30%, #ff6a1a 56%, transparent 76%);
  opacity: calc(0.35 + 0.65 * var(--level));
  filter: saturate(calc(0.3 + 0.7 * var(--level)));
  animation: flick 0.9s infinite alternate ease-in-out;
  transform-origin: 50% 100%;
}
.fc-flame::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 22px;
  height: 4px;
  translate: -50% 0;
  border-radius: 2px;
  background: #3f2416;
}
.fc-flame.waiting::before { opacity: 0.25; animation: none; }
.fc-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.fc-main b { font-family: var(--display); font-size: 19px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-main small { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fire-card[data-lit] .fc-main small:first-of-type { color: #ffcf9a; }
.fc-main .fc-plan { color: var(--ink-2); }
.fc .pips { flex: none; }
.fc-badge {
  flex: none;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #1d0e06;
  background: linear-gradient(#ffcd7a, #ff7a1a);
}
.fire-card.pending .fc { cursor: default; border-style: dashed; }
.home-empty { display: grid; justify-items: center; gap: 6px; margin-top: 8px; padding: 28px 22px; }
.home-empty b { font-family: var(--display); font-size: 20px; color: var(--ink); }
.home-empty .ember-badge { margin-bottom: 4px; }
.home > .btn-primary { margin-top: 18px; }

/* ------------------------------------------------------------------ sign-in and invite cards */

.btn-google {
  width: 100%;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: #1f1f1f;
  font-size: 16.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s var(--spring);
}
.btn-google:active { transform: scale(0.97); }
.btn-google svg { width: 20px; height: 20px; }
.or { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.sent-text { margin-top: 6px !important; font-size: 15px !important; color: var(--ink) !important; }
.code-row { display: flex; gap: 10px; margin-top: 10px; }
.field.code { flex: 1; min-width: 0; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }
.btn-link {
  margin-top: 12px;
  padding: 6px 2px;
  border: 0;
  background: none;
  color: #ffcf9a;
  font-size: 14px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.eyebrow { margin: 0 0 2px !important; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #ffcf9a !important; }
#inviteJoin .label { margin-top: 18px; }
#inviteNote { margin-top: 12px; }
#invitePending .note { margin-top: 12px; }
.spinner {
  width: 30px;
  height: 30px;
  margin: 14px 0 4px;
  border-radius: 50%;
  border: 3px solid rgba(255, 170, 100, 0.2);
  border-top-color: var(--ember-hot);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { rotate: 360deg; } }
.big-code {
  margin: 16px 0 4px !important;
  font-family: var(--display);
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  color: var(--ink) !important;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ sheet additions */

.quiet-row { display: flex; gap: 12px; padding: 12px 0 4px; transition: opacity 0.3s; }
.quiet-row.off, #fsNotify.off { opacity: 0.45; }
.quiet-row label { flex: 1; display: grid; gap: 6px; font-size: 13px; font-weight: 650; color: var(--ink-3); }
.field.time { padding: 11px 14px; font-size: 17px; color-scheme: dark; }
.label small { margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); }

/* Plan tag list: grip to drag, × to remove, a box to add. */
.tag-editor { margin-bottom: 4px; }
.tag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tag-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 46px;
  padding: 0 4px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 650;
}
.tag-item.fresh { animation: tag-in 0.4s var(--spring); }
.tag-item.flash { animation: tag-flash 0.7s var(--ease); }
.tag-item.leaving { animation: tag-out 0.22s var(--ease) forwards; }
.tag-list.sorting .tag-item { transition: transform 0.18s var(--ease); }
.tag-item.dragging {
  z-index: 2;
  transition: none !important;
  border-color: hsl(var(--my-hue) 90% 65% / 0.5);
  background: #2b1812;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55), 0 0 18px hsl(var(--my-hue) 90% 55% / 0.25);
}
.tag-item.dropping { z-index: 2; transition: transform 0.19s var(--ease); }
@keyframes tag-in { from { opacity: 0; transform: translateY(-8px) scale(0.94); } }
@keyframes tag-flash { 30% { border-color: hsl(var(--my-hue) 95% 66% / 0.8); box-shadow: 0 0 18px hsl(var(--my-hue) 95% 58% / 0.35); } }
@keyframes tag-out { to { opacity: 0; transform: translateX(28px) scale(0.92); } }
.tag-grip, .tag-x {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
}
.tag-grip { cursor: grab; touch-action: none; }
.tag-grip:active { cursor: grabbing; color: var(--ink); }
.tag-grip svg { width: 18px; height: 18px; fill: currentColor; }
.tag-x { font-size: 22px; line-height: 1; }
.tag-x:hover, .tag-x:focus-visible { color: #ff9a8a; }
.tag-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-add { display: flex; gap: 8px; margin-top: 8px; }
.tag-add .field { flex: 1; min-width: 0; padding: 11px 14px; font-size: 16px; }
.tag-add .btn-small:disabled, .tag-add .field:disabled { opacity: 0.5; }
.stepper { display: flex; align-items: center; gap: 12px; padding: 4px 0; font-weight: 650; }
.stepper span { flex: 1; }
.stepper b { min-width: 26px; text-align: center; font-family: var(--display); font-size: 22px; }
.step {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}
.people { list-style: none; margin: 0; padding: 0; }
.person { --c: hsl(var(--hue) 95% 62%); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.person .who { flex: 1 1 110px; }
.person .btn-small { padding: 7px 10px; font-size: 13px; }
.btn-ghost.danger { color: #ff9a8a; border-color: rgba(255, 120, 100, 0.28); background: rgba(255, 90, 70, 0.06); }
.btn-primary.danger { color: #fff4ef; background: linear-gradient(#e2533a, #b52a17); box-shadow: 0 10px 30px rgba(220, 70, 40, 0.3); }
.owner-note { margin-top: 18px; }
.qr-box { display: grid; place-items: center; margin: 14px 0; }
.qr-box img { width: min(260px, 72vw); height: auto; border-radius: 22px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); }
.link-row { display: flex; gap: 10px; margin-bottom: 12px; }
.field.link { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; padding: 12px 14px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding: 2px; margin: 0 0 10px; -webkit-mask-image: none; mask-image: none; }
.plan-preview { margin-top: 12px; min-height: 1.4em; font-weight: 650; color: #ffcf9a; }
#planForm .label:first-child { margin-top: 6px; }
#planTitle { margin-bottom: 4px; }
.confirm-title { margin: 6px 0 8px; font-family: var(--display); font-size: 24px; font-weight: 700; }
#confirmSheet .btn-primary { margin-top: 14px; }

/* ------------------------------------------------------------------ nudges */

/* A friend's seat is a button: it opens their card. */
.seat:not(.me) { pointer-events: auto; cursor: pointer; }
.seat.picked .avatar {
  border-color: var(--c);
  box-shadow: 0 0 0 4px hsl(var(--hue) 95% 60% / 0.3), 0 0 26px hsl(var(--hue) 95% 58% / 0.55);
  scale: 1.1;
}
.seat.picked .name { color: var(--ink); }
.seat.throwing .avatar { animation: throwing 0.5s var(--spring); }
.seat.poked .avatar { animation: poked 0.85s var(--ease); }
@keyframes throwing {
  30% { scale: 0.86; }
  65% { scale: 1.12; }
}
@keyframes poked {
  0% { box-shadow: 0 0 0 0 hsl(var(--fh) 100% 65% / 0.9), 0 0 30px hsl(var(--fh) 100% 60% / 0.8); }
  14% { rotate: -14deg; scale: 1.16; }
  32% { rotate: 11deg; }
  50% { rotate: -7deg; }
  70% { rotate: 3deg; scale: 1; }
  100% { rotate: 0deg; box-shadow: 0 0 0 24px hsl(var(--fh) 100% 65% / 0), 0 0 0 hsl(var(--fh) 100% 60% / 0); }
}

.roster h2 small {
  margin-left: 8px;
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 650;
  color: hsl(var(--my-hue) 80% 72% / 0.6);
}
.friend[role='button'] { cursor: pointer; transition: border-color 0.5s, background 0.5s, transform 0.2s var(--spring); }
.friend[role='button']:active { transform: scale(0.985); }
.friend[role='button']:focus-visible { outline: 2px solid var(--ember-hot); outline-offset: 2px; }

/* The friend's card, pinned to their seat (or their row). */
.person-card {
  --c: hsl(var(--hue) 95% 62%);
  position: fixed;
  z-index: 45;
  width: min(316px, calc(100vw - 20px));
  padding: 12px;
  border-radius: 22px;
  border: 1px solid hsl(var(--hue) 80% 62% / 0.35);
  background: linear-gradient(180deg, hsl(var(--hue) 35% 13% / 0.97), rgba(20, 11, 11, 0.97) 70%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 34px hsl(var(--hue) 90% 50% / 0.16);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transform-origin: var(--ax, 50%) calc(100% + 10px);
}
.person-card[data-side='below'] { transform-origin: var(--ax, 50%) -10px; }
.person-card.show { animation: pc-in 0.34s var(--spring) both; }
.person-card[data-side='below'].show { animation-name: pc-in-below; }
@keyframes pc-in { from { opacity: 0; transform: translateY(12px) scale(0.82); } }
@keyframes pc-in-below { from { opacity: 0; transform: translateY(-12px) scale(0.82); } }
.pc-arrow {
  position: absolute;
  left: var(--ax, 50%);
  bottom: -7px;
  width: 13px;
  height: 13px;
  translate: -50% 0;
  rotate: 45deg;
  background: rgb(20, 11, 11);
  border-right: 1px solid hsl(var(--hue) 80% 62% / 0.35);
  border-bottom: 1px solid hsl(var(--hue) 80% 62% / 0.35);
}
.person-card[data-side='below'] .pc-arrow { top: -7px; bottom: auto; rotate: 225deg; background: hsl(var(--hue) 35% 13%); }
.person-card[data-side='none'] .pc-arrow { display: none; }
.pc-head { display: flex; align-items: center; gap: 10px; margin: 0 0 10px 2px; }
.pc-dot {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  color: #170a05;
  background: var(--c);
  box-shadow: 0 0 16px hsl(var(--hue) 90% 55% / 0.5);
}
.pc-who { flex: 1; min-width: 0; }
.pc-who b, .pc-who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-who b { font-size: 16px; }
.pc-who small { font-size: 12.5px; color: var(--ink-3); }
.pc-x {
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-3);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.pc-pokes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pc-poke {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 40px;
  padding: 6px 10px 6px 8px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  animation: pc-chip 0.36s calc(var(--i) * 22ms + 60ms) var(--ease) both;
  transition: transform 0.2s var(--spring), background 0.2s, border-color 0.2s;
}
.pc-poke:last-child:nth-child(odd) { grid-column: span 2; }
.pc-poke .pc-icon { flex: none; font-size: 17px; }
.pc-poke:active { transform: scale(0.95); }
.pc-poke.sent { border-color: var(--c); background: hsl(var(--hue) 80% 50% / 0.3); animation: pc-sent 0.3s var(--spring); }
.pc-poke.nope { animation: nope 0.35s; }
@keyframes pc-chip { from { opacity: 0; transform: translateY(6px); } }
@keyframes pc-sent { 40% { transform: scale(1.06); } }
@keyframes nope {
  25% { translate: -4px 0; }
  50% { translate: 4px 0; }
  75% { translate: -2px 0; }
}
.pc-flare {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border-radius: 13px;
  border: 1px solid rgba(255, 170, 100, 0.35);
  background: rgba(255, 140, 60, 0.1);
  color: #ffcf9a;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s var(--spring), background 0.2s;
}
.pc-flare:active { transform: scale(0.97); }

/* The nudge itself: it arcs from seat to seat, lands with a bounce and fades. */
.poke-bubble {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 2;
  translate: -50% calc(-100% - 38px);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 9px;
  border-radius: 16px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 750;
  color: #fff6ea;
  background: hsl(var(--hue) 55% 22%);
  border: 1px solid hsl(var(--hue) 90% 62% / 0.7);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 22px hsl(var(--hue) 95% 55% / 0.45);
  pointer-events: none;
}
.poke-bubble::after {
  content: '';
  position: absolute;
  left: calc(50% + var(--tx, 0px));
  bottom: -6px;
  width: 10px;
  height: 10px;
  translate: -50% 0;
  rotate: 45deg;
  background: hsl(var(--hue) 55% 22%);
  border-right: 1px solid hsl(var(--hue) 90% 62% / 0.7);
  border-bottom: 1px solid hsl(var(--hue) 90% 62% / 0.7);
}
.poke-bubble .pb-icon { font-size: 18px; }
.poke-bubble.for-me { padding: 9px 15px 9px 11px; font-size: 16px; }
.poke-bubble.landed { animation: poke-land 3.2s var(--ease) both; }
.poke-bubble.for-me.landed { animation-duration: 4.2s; }
@keyframes poke-land {
  0% { transform: scale(1.28); }
  8% { transform: scale(0.93); }
  16% { transform: scale(1.04); }
  24%, 82% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-26px); }
}

/* ------------------------------------------------------------------ promises */

/* Under the match: promise a time, or your own countdown. */
.promise { margin-top: 12px; }
.promise-btn {
  width: 100%;
  padding: 11px 14px;
  border-radius: 16px;
  border: 1px dashed hsl(var(--my-hue) 80% 65% / 0.35);
  background: hsl(var(--my-hue) 80% 50% / 0.06);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s var(--spring);
}
.promise-btn b { color: hsl(var(--my-hue) 95% 78%); font-weight: 750; }
.promise-btn:active { transform: scale(0.98); }
.promise-live {
  --p: 1;
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid hsl(var(--my-hue) 85% 62% / 0.38);
  background: linear-gradient(90deg, hsl(var(--my-hue) 80% 50% / 0.14), hsl(var(--my-hue) 80% 50% / 0.04));
  animation: fade-in 0.4s both;
}
.pl-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px 12px 14px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.pl-icon { flex: none; font-size: 22px; animation: tick-tock 2s infinite ease-in-out; transform-origin: 50% 60%; }
.pl-text { min-width: 0; display: grid; }
.pl-text strong { font-family: var(--display); font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--ink-3); }
.pl-x {
  flex: none;
  width: 40px;
  height: 40px;
  margin-right: 6px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-3);
  font-size: 22px;
  cursor: pointer;
}
.pl-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  transform-origin: 0 50%;
  transform: scaleX(var(--p));
  background: linear-gradient(90deg, hsl(var(--my-hue) 95% 55%), hsl(var(--my-hue) 100% 75%));
  box-shadow: 0 0 10px hsl(var(--my-hue) 95% 60% / 0.7);
  transition: transform 1s linear;
}
.promise-live.late { border-color: rgba(255, 120, 100, 0.55); background: linear-gradient(90deg, rgba(255, 90, 70, 0.16), rgba(255, 90, 70, 0.04)); animation: late-glow 1.6s infinite ease-in-out; }
.promise-live.late strong { color: #ffab9c; }
.promise-live.late .pl-icon { animation: ring-ring 0.5s infinite; }
.promise-live.late .pl-bar { display: none; }
@keyframes tick-tock { 0%, 100% { rotate: -8deg; } 50% { rotate: 8deg; } }
@keyframes ring-ring { 0%, 100% { rotate: -14deg; } 50% { rotate: 14deg; } }
@keyframes late-glow { 50% { box-shadow: 0 0 22px rgba(255, 100, 80, 0.3); } }

/* The sheet: one drum, like setting a timer. */
.promise-deck { margin: 14px 0 0; }
.promise-deck .drum-head { color: hsl(var(--my-hue) 80% 72% / 0.75); }
.promise-deck .wheel-item { font-size: 19px; }
.promise-at { margin: 10px 0 0; min-height: 1.4em; text-align: center; font-weight: 650; color: #ffcf9a; }
#promiseSheet .btn-primary { margin-top: 14px; }

/* A friend on their way: the ring burns down to their time, then turns red. */
.seat[data-promise] .tag:not(:empty) { opacity: 1; translate: 0 0; }
.seat[data-promise='soon'] .ring { opacity: 0.6; }
.seat[data-promise='late'] .ring { opacity: 1; animation: late-ring 1.4s infinite ease-in-out; }
.seat[data-promise='late'] .ring circle { stroke: #ff7a66; stroke-dasharray: 100 0; }
.seat[data-promise='late'] .tag { color: #ff9a8a; }
@keyframes late-ring { 50% { opacity: 0.35; } }

@media (hover: hover) and (pointer: fine) {
  .promise-btn:hover { background: hsl(var(--my-hue) 80% 50% / 0.12); }
  .pl-x:hover { color: var(--ink); }
}

/* ------------------------------------------------------------------ be right back */

/* Under a lit match: step away, or your own countdown with "I'm back". */
.away-live {
  border-color: hsl(var(--my-hue) 70% 55% / 0.32);
  background: linear-gradient(90deg, hsl(var(--my-hue) 70% 40% / 0.16), hsl(var(--my-hue) 70% 40% / 0.04));
}
.away-live .pl-icon { animation: ember-glow 3s infinite ease-in-out; }
.away-back {
  flex: none;
  margin-right: 8px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid hsl(var(--my-hue) 90% 65% / 0.6);
  background: hsl(var(--my-hue) 75% 45% / 0.32);
  color: #fff8ee;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 0.2s var(--spring), background 0.2s;
}
.away-back:active { transform: scale(0.95); }
.away-live.late .away-back { animation: beckon-mine 1.6s infinite; }
@keyframes beckon-mine {
  0% { box-shadow: 0 0 0 0 hsl(var(--my-hue) 95% 60% / 0.5); }
  70%, 100% { box-shadow: 0 0 0 10px hsl(var(--my-hue) 95% 60% / 0); }
}
@keyframes ember-glow { 50% { opacity: 0.55; scale: 0.9; } }

/* Your match while you're away: a low glow instead of a flame. */
.panel.away {
  border-color: hsl(var(--my-hue) 70% 50% / 0.26);
  box-shadow: 0 0 30px hsl(var(--my-hue) 80% 45% / 0.12), 0 -12px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 220, 190, 0.07);
}
.panel.away .match.lit .flame { scale: 0.42; filter: saturate(0.75) brightness(0.85); }
.panel.away .match.lit .flame i { animation-duration: 2.2s; }
.panel.away .match.lit .trail { opacity: 0.32; animation: none; }

/* The sheet: how long, and why. */
.away-deck .drum { flex: 1 1 0; }
.away-deck .drum + .drum { flex: 1.3 1 0; }
.promise-at.warn { color: #ffab9c; }
#awaySheet .btn-primary { margin-top: 14px; }

/* A friend who'll be right back: embers on their seat, the ring down to their time, and why. */
.seat[data-state='away'] .avatar {
  color: rgba(255, 238, 222, 0.85);
  border-color: hsl(var(--hue) 70% 48% / 0.85);
  background:
    radial-gradient(circle at 50% 100%, hsl(var(--hue) 90% 50% / 0.45) 0%, transparent 70%),
    #22120f;
  animation: ember-breathe 3.2s infinite ease-in-out;
}
.seat[data-state='away'] .name { color: var(--ink); }
.seat[data-state='away'] .mini-flame { scale: 0.45; opacity: 0.8; }
.seat[data-state='away'] .mini-flame::before { animation-duration: 2.4s; filter: saturate(0.8) brightness(0.85); }
.seat[data-state='away'] .tag:not(:empty) { opacity: 1; translate: 0 0; }
.seat[data-away='soon'] .ring { opacity: 0.7; }
.seat[data-away='late'] .ring { opacity: 1; animation: late-ring 1.4s infinite ease-in-out; }
.seat[data-away='late'] .ring circle { stroke: #ff7a66; stroke-dasharray: 100 0; }
.seat[data-away='late'] .tag { color: #ff9a8a; }
@keyframes ember-breathe {
  0%, 100% { box-shadow: 0 0 0 3px hsl(var(--hue) 90% 50% / 0.08), 0 0 12px hsl(var(--hue) 90% 50% / 0.25); }
  50% { box-shadow: 0 0 0 3px hsl(var(--hue) 90% 55% / 0.16), 0 0 22px hsl(var(--hue) 95% 55% / 0.5); }
}
.seat .abadge {
  position: absolute;
  top: 30px;
  left: calc(50% + 12px);
  font-size: 15px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px #000);
  opacity: 0;
  scale: 0.4;
  transition: opacity 0.3s, scale 0.4s var(--spring);
  pointer-events: none;
}
.seat[data-state='away'] .abadge:not(:empty) { opacity: 1; scale: 1; }
.seats.crowded .seat .abadge { top: 22px; left: calc(50% + 8px); font-size: 13px; }

/* In the header, a pip for each friend right back; in the list, a low flame. */
.pip.ember {
  background: linear-gradient(#ffb36b, #7a2a10);
  box-shadow: 0 0 6px rgba(255, 110, 40, 0.45);
  animation: ember-glow 3s infinite ease-in-out;
}
.friend[data-state='away'] {
  border-color: hsl(var(--hue) 70% 50% / 0.24);
  background: linear-gradient(90deg, hsl(var(--hue) 70% 40% / 0.1), var(--card) 65%);
}
.friend[data-state='away'] .dot { box-shadow: 0 0 0 2px hsl(var(--hue) 80% 50% / 0.35), 0 0 12px hsl(var(--hue) 90% 50% / 0.35); }
.friend[data-state='away'] small { color: var(--ink-2); }
.friend .lit-flame.ember { scale: 0.6; opacity: 0.75; animation-duration: 2.2s; }

/* "Back by the fire?" when you come back to the app while away: over the page wherever it's
   scrolled, below the top bar (over the fire on a computer). */
.back-card {
  position: fixed;
  top: calc(var(--safe-top) + 84px);
  left: 50%;
  z-index: 46;
  width: min(360px, calc(100vw - 32px));
  translate: -50% 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 18px 18px 16px;
  border-radius: 24px;
  border: 1px solid hsl(var(--my-hue) 80% 60% / 0.4);
  background: linear-gradient(180deg, #2c1610, #160b0a);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 40px hsl(var(--my-hue) 90% 50% / 0.18);
  text-align: center;
}
.back-card strong { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.01em; color: #fff6ea; }
.bc-sub { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.bc-embers { display: flex; align-items: flex-end; gap: 5px; height: 14px; }
.bc-embers i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #ffe3a6 0 18%, hsl(var(--my-hue) 95% 55%) 55%, transparent 75%);
  animation: ember-glow 1.8s infinite ease-in-out;
}
.bc-embers i:nth-child(2) { width: 12px; height: 12px; animation-delay: 0.3s; }
.bc-embers i:nth-child(3) { animation-delay: 0.6s; }
.bc-actions { display: flex; gap: 8px; width: 100%; margin-top: 8px; }
.bc-later, .bc-yes {
  flex: 1;
  padding: 11px 8px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 0.2s var(--spring), background 0.2s, color 0.2s;
}
.bc-later { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--ink-2); }
.bc-yes {
  flex: 1.4;
  border: 1px solid hsl(var(--my-hue) 90% 65% / 0.75);
  background: hsl(var(--my-hue) 70% 42% / 0.6);
  color: #fff8ee;
  box-shadow: 0 0 22px hsl(var(--my-hue) 95% 55% / 0.3);
}
.bc-later:active, .bc-yes:active { transform: scale(0.95); }
.back-card.show { animation: rise-in 0.45s var(--ease) both; }
.back-card.out { animation: call-out 0.38s both; }

@media (hover: hover) and (pointer: fine) {
  .away-back:hover, .bc-yes:hover { background: hsl(var(--my-hue) 75% 48% / 0.55); }
  .bc-later:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.2); }
}
@media (min-width: 900px) and (min-height: 540px) {
  :root:has(.app[data-view='fire']) .back-card { top: 18%; left: calc((100vw - 400px) / 2); }
}
@media (min-width: 1200px) and (min-height: 540px) {
  :root:has(.app[data-view='fire']) .back-card { left: calc(240px + (100vw - 660px) / 2); }
}

/* ------------------------------------------------------------------ photos */

/* A photo covers the initial in any avatar circle. */
.has-face { position: relative; }
.face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
}
.seat .avatar .face { inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); }
.seat[data-state='lit'] .avatar.has-face .face { box-shadow: inset 0 0 0 1px rgba(255, 240, 220, 0.25); }
.mini-dot.has-face, .dot.has-face, .pc-dot.has-face, .tp-face.has-face { color: transparent; }
.avatar-btn.has-face { padding: 0; overflow: hidden; }
.avatar-btn.has-face span { visibility: hidden; }

.photo-row { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.photo-face {
  position: relative;
  flex: none;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid hsl(var(--my-hue) 80% 62% / 0.6);
  background: hsl(var(--my-hue) 35% 17%);
  color: hsl(var(--my-hue) 85% 76%);
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
  cursor: pointer;
}
.photo-face.has-face span { visibility: hidden; }
.photo-face i {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #170d0c;
  background: linear-gradient(#ffcd7a, #ff8f2e);
  color: #1d0e06;
  font-style: normal;
  font-size: 17px;
  font-weight: 800;
}
.photo-actions { display: grid; justify-items: start; gap: 2px; }
.photo-pick { display: inline-block; cursor: pointer; }
.photo-actions .btn-link { margin-top: 4px; }
.cropper { position: relative; width: min(300px, 78vw); aspect-ratio: 1; margin: 16px auto 10px; border-radius: 22px; overflow: hidden; background: #0d0808; }
.cropper canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.cropper canvas:active { cursor: grabbing; }
.crop-ring {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(7, 4, 10, 0.62), inset 0 0 0 2px rgba(255, 220, 180, 0.6);
}
.crop-zoom { display: flex; align-items: center; gap: 10px; width: min(300px, 78vw); margin: 0 auto; color: var(--ink-3); font-weight: 700; }
.crop-zoom input { flex: 1; accent-color: var(--ember); }
.crop-note { text-align: center; }

/* Plans: any day, quick times. */
.field.date { margin: -2px 0 12px; padding: 11px 14px; font-size: 17px; color-scheme: dark; }
#planTimes { margin-bottom: 8px; }

/* ------------------------------------------------------------------ the game table */

.app:not([data-view='fire']) .games { display: none; }
.games { padding: 26px 16px 0; }
.game-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gr-main {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.3s, transform 0.2s var(--spring);
}
.gr-main:active { transform: scale(0.985); }
.game-row[data-hot] .gr-main { border-color: rgba(255, 170, 90, 0.45); background: linear-gradient(90deg, rgba(255, 122, 26, 0.14), var(--card) 70%); }
.gr-icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: center / 70% no-repeat, linear-gradient(145deg, #3a2419, #1d120e);
  box-shadow: inset 0 1px 0 rgba(255, 230, 200, 0.08);
}
/* Tiny game icons, drawn with gradients: a pawn, four discs, a grid with an X. */
.gk-chess .gr-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 45 45'%3E%3Cpath fill='%23f3e2c6' d='M22.5 8.2a4.9 4.9 0 0 0-3.3 8.5c-2 1.1-3.2 2.9-3.2 4.8h13c0-1.9-1.2-3.7-3.2-4.8a4.9 4.9 0 0 0-3.3-8.5zM18.2 22.6c0 4.3-2.4 7.4-5 10.7h18.6c-2.6-3.3-5-6.4-5-10.7zM11 38.8h23v-3c0-1.1-.9-2-2-2H13c-1.1 0-2 .9-2 2z'/%3E%3C/svg%3E"), linear-gradient(145deg, #3a2419, #1d120e); }
.gk-four .gr-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='12' cy='28' r='7' fill='%23ff7a3a'/%3E%3Ccircle cx='28' cy='28' r='7' fill='%23ffd36b'/%3E%3Ccircle cx='12' cy='12' r='7' fill='%23ffd36b'/%3E%3Ccircle cx='28' cy='12' r='7' fill='%23ff7a3a' opacity='.35'/%3E%3C/svg%3E"), linear-gradient(145deg, #3a2419, #1d120e); }
.gk-ttt .gr-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke-linecap='round'%3E%3Cpath stroke='%23f3e2c6' stroke-opacity='.45' stroke-width='2' d='M15 6v28M25 6v28M6 15h28M6 25h28'/%3E%3Cpath stroke='%23ff8a4a' stroke-width='3.4' d='M7.5 7.5l5 5m0-5l-5 5'/%3E%3Ccircle cx='30' cy='30' r='3' stroke='%23ffd36b' stroke-width='3'/%3E%3C/svg%3E"), linear-gradient(145deg, #3a2419, #1d120e); }
.gr-text { flex: 1; min-width: 0; display: grid; }
.gr-text b, .gr-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gr-text b { font-size: 15px; }
.gr-text small { font-size: 12.5px; color: var(--ink-3); }
.game-row[data-hot] .gr-text small { color: #ffcf9a; }
.gr-go { flex: none; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); font-size: 13.5px; font-weight: 700; }
.gr-go.hot { color: #1d0e06; border-color: transparent; background: linear-gradient(#ffcd7a, #ff8f2e); }

.game-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 14px 0 4px; }
.game-pick {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 14px 6px 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, transform 0.2s var(--spring);
}
.game-pick:active { transform: scale(0.96); }
.game-pick .gp-art { width: 52px; height: 52px; border-radius: 14px; background: center / 72% no-repeat, linear-gradient(145deg, #3a2419, #1d120e); }
.gp-chess { --art: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 45 45'%3E%3Cpath fill='%23f3e2c6' d='M22.5 8.2a4.9 4.9 0 0 0-3.3 8.5c-2 1.1-3.2 2.9-3.2 4.8h13c0-1.9-1.2-3.7-3.2-4.8a4.9 4.9 0 0 0-3.3-8.5zM18.2 22.6c0 4.3-2.4 7.4-5 10.7h18.6c-2.6-3.3-5-6.4-5-10.7zM11 38.8h23v-3c0-1.1-.9-2-2-2H13c-1.1 0-2 .9-2 2z'/%3E%3C/svg%3E"); }
.gp-chess .gp-art { background-image: var(--art), linear-gradient(145deg, #3a2419, #1d120e); }
.gp-four { --art: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='12' cy='28' r='7' fill='%23ff7a3a'/%3E%3Ccircle cx='28' cy='28' r='7' fill='%23ffd36b'/%3E%3Ccircle cx='12' cy='12' r='7' fill='%23ffd36b'/%3E%3Ccircle cx='28' cy='12' r='7' fill='%23ff7a3a' opacity='.35'/%3E%3C/svg%3E"); }
.gp-four .gp-art { background-image: var(--art), linear-gradient(145deg, #3a2419, #1d120e); }
.gp-ttt { --art: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke-linecap='round'%3E%3Cpath stroke='%23f3e2c6' stroke-opacity='.45' stroke-width='2' d='M15 6v28M25 6v28M6 15h28M6 25h28'/%3E%3Cpath stroke='%23ff8a4a' stroke-width='3.4' d='M7.5 7.5l5 5m0-5l-5 5'/%3E%3Ccircle cx='30' cy='30' r='3' stroke='%23ffd36b' stroke-width='3'/%3E%3C/svg%3E"); }
.gp-ttt .gp-art { background-image: var(--art), linear-gradient(145deg, #3a2419, #1d120e); }
.game-pick[aria-checked='true'] { border-color: rgba(255, 170, 90, 0.6); background: rgba(255, 122, 26, 0.1); box-shadow: 0 0 22px rgba(255, 122, 26, 0.18); }
.who-chip { display: inline-flex; align-items: center; gap: 7px; padding-left: 6px; }
.who-chip .mini-dot { position: relative; }

/* The friend card: sit down at the table with them. */
.pc-games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.pc-games-label { grid-column: 1 / -1; margin: 2px 0 -2px 2px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.pc-game {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 7px 4px 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s var(--spring);
}
.pc-game:active { transform: scale(0.95); }
.pc-game .gr-icon { width: 28px; height: 28px; border-radius: 8px; }

/* A seat at the game table gets the game's badge. */
.seat .gbadge {
  position: absolute;
  top: -6px;
  left: calc(50% + 12px);
  font-size: 15px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px #000);
  opacity: 0;
  scale: 0.4;
  transition: opacity 0.3s, scale 0.4s var(--spring);
}
.seat[data-playing] .gbadge { opacity: 1; scale: 1; animation: badge-bob 2.4s infinite ease-in-out; }
@keyframes badge-bob { 50% { translate: 0 -3px; } }

/* The room: a dark wooden table, lit warm from the side by a fire out of view. */
.table {
  --level: 0.3;
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  overflow: hidden auto;
  background:
    radial-gradient(120% 70% at 50% 120%, rgba(0, 0, 0, 0.6), transparent 60%),
    repeating-linear-gradient(92deg, rgba(0, 0, 0, 0.08) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(88deg, rgba(255, 210, 160, 0.025) 0 1px, transparent 1px 23px),
    linear-gradient(180deg, #2a160e, #1a0d08 60%, #120806);
}
.table.show { animation: table-in 0.45s var(--ease) both; }
@keyframes table-in { from { opacity: 0; transform: scale(1.03); } }
.table-light {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(70% 60% at 0% 40%, rgba(255, 140, 50, calc(0.14 + 0.16 * var(--level))), transparent 70%);
  animation: firelight 3.2s infinite alternate ease-in-out;
}
@keyframes firelight {
  0% { opacity: 0.75; }
  37% { opacity: 1; }
  52% { opacity: 0.82; }
  100% { opacity: 0.95; }
}
html.at-table body { overflow: hidden; }
.table-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--safe-top) + 12px) 14px 6px;
}
.table-back {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 170, 100, 0.3);
  background: rgba(20, 10, 8, 0.6);
  color: #ffcf9a;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.table-back svg { width: 18px; height: 18px; }
.tb-flame {
  width: 12px;
  height: 17px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 82%, #fff 0 14%, #ffd36b 30%, #ff6a1a 56%, transparent 76%);
  scale: calc(0.75 + 0.45 * var(--level));
  animation: flick 0.8s infinite alternate ease-in-out;
  transform-origin: 50% 100%;
}
.table-top h2 { flex: 1; margin: 0; text-align: right; font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--ink-2); }
.table-main {
  position: relative;
  flex: 1;
  width: min(100%, 560px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  padding: 6px 14px calc(18px + var(--safe-bottom));
}
.table-player {
  --c: hsl(var(--hue, 24) 95% 62%);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 12px 8px 8px;
  border-radius: 16px;
  border: 1px solid transparent;
  transition: border-color 0.4s, background 0.4s, box-shadow 0.4s;
}
.table-player.turn { border-color: hsl(var(--hue) 85% 62% / 0.45); background: hsl(var(--hue) 70% 45% / 0.1); box-shadow: 0 0 24px hsl(var(--hue) 90% 55% / 0.15); }
.table-player.won { border-color: hsl(var(--hue) 95% 65% / 0.7); }
.tp-face {
  position: relative;
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--c);
  background: hsl(var(--hue) 35% 17%);
  color: hsl(var(--hue) 85% 76%);
  font-family: var(--display);
  font-weight: 700;
}
.table-player.turn .tp-face { box-shadow: 0 0 0 4px hsl(var(--hue) 95% 60% / 0.2), 0 0 18px hsl(var(--hue) 95% 58% / 0.6); animation: thinking 1.6s infinite ease-in-out; }
@keyframes thinking { 50% { box-shadow: 0 0 0 7px hsl(var(--hue) 95% 60% / 0.08), 0 0 26px hsl(var(--hue) 95% 58% / 0.4); } }
.tp-who { flex: 1; min-width: 0; display: grid; }
.tp-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; }
.tp-who small { font-size: 12px; color: var(--ink-3); }
.tp-taken { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; max-width: 45%; }
.tp-taken .piece { width: 17px; height: 17px; margin-left: -3px; }
.tp-taken small { margin-left: 5px; font-size: 12px; font-weight: 800; color: var(--ink-2); }
/* The effects over a board drawn in the page (public/overlay.js): never in the way of a tap. */
.fx-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }
.board-wrap { position: relative; width: min(100%, calc(100svh - 300px), 520px); min-width: 260px; margin: 0 auto; aspect-ratio: 1; }
.table[data-kind='four'] .board-wrap { aspect-ratio: 7 / 6.4; width: min(100%, calc((100svh - 300px) * 1.09), 540px); }
.board { position: relative; width: 100%; height: 100%; }
.table-status { margin: 4px 0 0; min-height: 1.4em; text-align: center; font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--ink-2); }
.table-status.hot { color: #ffe0b8; }
.table-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 40px; }
.table-actions .btn-small { padding: 10px 18px; }
.tw-watch { padding: 9px 12px; font-size: 13px; font-weight: 700; color: var(--ink-3); }

/* Chess: a wooden board in a frame, pieces that slide. */
.board.chess {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  border-radius: 6px;
  box-shadow: 0 0 0 6px #3b2115, 0 0 0 7px rgba(255, 210, 160, 0.18), 0 26px 50px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.sq {
  position: relative;
  padding: 0;
  border: 0;
  cursor: default;
  font: inherit;
}
.sq.light { background: linear-gradient(135deg, #f0dab4, #e3c69a); }
.sq.dark { background: linear-gradient(135deg, #b9855b, #a3714a); }
.board.chess[data-mine='true'] .sq { cursor: pointer; }
.sq .file, .sq .rank { position: absolute; font-style: normal; font-size: clamp(8px, 1.9vmin, 11px); font-weight: 800; opacity: 0.6; pointer-events: none; }
.sq .file { right: 3px; bottom: 1px; }
.sq .rank { left: 3px; top: 1px; }
.sq.light .file, .sq.light .rank { color: #9d6c45; }
.sq.dark .file, .sq.dark .rank { color: #f0dab4; }
.sq.last::after { content: ''; position: absolute; inset: 0; background: rgba(255, 196, 70, 0.32); }
.sq.sel::after { content: ''; position: absolute; inset: 0; background: rgba(255, 150, 50, 0.45); }
.sq.check::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255, 50, 30, 0.85), rgba(255, 50, 30, 0.2) 55%, transparent 72%); }
.sq.target::after { content: ''; position: absolute; left: 50%; top: 50%; width: 30%; height: 30%; translate: -50% -50%; border-radius: 50%; background: rgba(60, 25, 10, 0.32); }
.sq.capture::after { content: ''; position: absolute; inset: 4%; border-radius: 50%; border: 4px solid rgba(60, 25, 10, 0.34); }
.sq:focus-visible { outline: 3px solid var(--ember-hot); outline-offset: -3px; z-index: 1; }
.pieces { position: absolute; inset: 0; pointer-events: none; }
.pc {
  position: absolute;
  left: calc(var(--c) * 12.5%);
  top: calc(var(--r) * 12.5%);
  width: 12.5%;
  height: 12.5%;
  translate: 0 0;
  transition: translate 0.24s var(--ease);
}
.pc.moving { z-index: 2; }
.pc.dragging { z-index: 3; transition: none; scale: 1.15; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.5)); }
.piece { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)); }
.piece path, .piece circle { stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.piece.pw { fill: #fbf1df; stroke: #3b2416; }
.piece.pb { fill: #2b1d17; stroke: #0b0605; }
.piece .dl { fill: none; }
.piece.pw .dl { stroke: #3b2416; }
.piece.pb .dl { stroke: #c9b097; stroke-opacity: 0.8; }
.piece.pw .eye { fill: #3b2416; stroke: none; }
.piece.pb .eye { fill: #e8d4ba; stroke: none; }
.promo {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(10, 5, 4, 0.66);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade-in 0.2s both;
}
.promo-pick { width: 20%; aspect-ratio: 1; padding: 6%; border-radius: 16px; border: 1px solid rgba(255, 210, 160, 0.35); background: linear-gradient(145deg, #f0dab4, #c69669); cursor: pointer; transition: transform 0.2s var(--spring); }
.promo-pick:hover, .promo-pick:focus-visible { transform: scale(1.08); }

/* Four in a row: discs in each player's flame color drop and bounce. */
.board.four {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1.2%;
  padding: 2.4%;
  border-radius: 18px;
  background: radial-gradient(120% 90% at 30% 10%, #5a3220, #3a1e12 60%, #2a150c);
  box-shadow: inset 0 2px 0 rgba(255, 220, 180, 0.12), inset 0 -6px 14px rgba(0, 0, 0, 0.5), 0 26px 50px rgba(0, 0, 0, 0.6);
}
.col {
  position: relative;
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 3%;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  cursor: pointer;
}
.col:disabled { cursor: default; }
.col:not(:disabled):hover { background: rgba(255, 230, 190, 0.06); }
.col:not(:disabled):hover::before {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  top: -14%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: hsl(var(--hm) 90% 58% / 0.45);
  translate: 0 -40%;
}
.col:focus-visible { outline: 2px solid var(--ember-hot); }
.hole {
  position: relative;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #120806, #1d0f0a 70%);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.75), 0 1px 0 rgba(255, 220, 180, 0.08);
}
.disc {
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.35), inset 0 3px 5px rgba(255, 255, 255, 0.35), 0 2px 4px rgba(0, 0, 0, 0.5);
}
.disc.p0 { background: radial-gradient(circle at 38% 32%, hsl(var(--h0) 100% 78%), hsl(var(--h0) 85% 52%) 55%, hsl(var(--h0) 80% 34%)); }
.disc.p1 { background: radial-gradient(circle at 38% 32%, hsl(var(--h1) 100% 78%), hsl(var(--h1) 85% 52%) 55%, hsl(var(--h1) 80% 34%)); }
.disc.falling { animation: fall calc(0.18s + var(--fall) * 0.06s) cubic-bezier(0.55, 0, 1, 0.45), bounce 0.35s calc(0.18s + var(--fall) * 0.06s) var(--spring); }
@keyframes fall { from { transform: translateY(calc(var(--fall) * -112%)); } }
@keyframes bounce { 30% { transform: translateY(-9%); } }
.disc.win { animation: win-pulse 0.9s infinite alternate ease-in-out; }
@keyframes win-pulse { to { box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(255, 245, 220, 0.85), 0 0 22px rgba(255, 220, 150, 0.9); } }

/* Tic-tac-toe: marks drawn like burnt wood, the winning line struck through. */
.board.ttt {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  border-radius: 18px;
  background: radial-gradient(120% 90% at 30% 10%, #4a2a1b, #321a10 60%, #24120a);
  box-shadow: inset 0 2px 0 rgba(255, 220, 180, 0.1), 0 26px 50px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.cell { position: relative; padding: 14%; border: 0; background: none; cursor: pointer; }
.cell:disabled { cursor: default; }
.cell:nth-child(3n + 1), .cell:nth-child(3n + 2) { box-shadow: inset -2px 0 0 rgba(255, 210, 160, 0.16); }
.cell:nth-child(-n + 6) { border-bottom: 2px solid rgba(255, 210, 160, 0.16); }
.cell:not(:disabled):hover { background: rgba(255, 230, 190, 0.05); }
.cell:focus-visible { outline: 2px solid var(--ember-hot); outline-offset: -4px; }
.mark { width: 100%; height: 100%; fill: none; stroke-width: 9; stroke-linecap: round; }
.mark.p0 { stroke: hsl(var(--h0) 95% 64%); filter: drop-shadow(0 0 8px hsl(var(--h0) 95% 55% / 0.6)); }
.mark.p1 { stroke: hsl(var(--h1) 95% 64%); filter: drop-shadow(0 0 8px hsl(var(--h1) 95% 55% / 0.6)); }
.mark.drawn path, .mark.drawn circle { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-in 0.32s var(--ease) forwards; }
.mark.drawn path + path { animation-delay: 0.16s; }
@keyframes draw-in { to { stroke-dashoffset: 0; } }
.strike { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.strike line { stroke: hsl(var(--h, 40) 100% 80%); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-in 0.5s 0.25s var(--ease) forwards; filter: drop-shadow(0 0 10px hsl(var(--h, 40) 100% 60%)); }

/* The end of a game: a big word, and confetti for the winner. */
.table-result {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  pointer-events: none;
  text-align: center;
  opacity: 0;
}
.table-result.show { animation: result 3s var(--ease) both; }
.table-result strong {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(38px, 9vmin, 64px);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(#fffaf0 10%, hsl(var(--hue) 100% 78%) 50%, hsl(var(--hue) 95% 56%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px hsl(var(--hue) 95% 55% / 0.8)) drop-shadow(0 4px 12px #000);
}
.table-result span { font-weight: 800; color: #fff6ea; text-shadow: 0 1px 10px #000, 0 0 3px #000; }
@keyframes result {
  0% { opacity: 0; transform: scale(0.5) rotate(-4deg); }
  14% { opacity: 1; transform: scale(1.08); }
  24% { transform: none; }
  82% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-20px); }
}
.confetti {
  position: absolute;
  left: var(--x);
  top: 40%;
  z-index: 7;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  background: hsl(var(--h) 95% 62%);
  pointer-events: none;
  animation: confetti 2.2s cubic-bezier(0.2, 0.6, 0.4, 1) both;
}
@keyframes confetti {
  0% { opacity: 0; transform: translate(0, 0) rotate(0); }
  10% { opacity: 1; transform: translate(calc(var(--d) * 0.2), -120px) rotate(calc(var(--r) * 0.2)); }
  100% { opacity: 0; transform: translate(var(--d), 260px) rotate(var(--r)); }
}

@media (hover: hover) and (pointer: fine) {
  .gr-main:hover { border-color: rgba(255, 170, 90, 0.35); }
  .game-pick:hover { border-color: rgba(255, 170, 90, 0.4); }
  .pc-game:hover { border-color: hsl(var(--hue) 80% 62% / 0.5); background: hsl(var(--hue) 70% 50% / 0.12); }
  .table-back:hover { background: rgba(40, 20, 12, 0.8); }
}

@media (min-width: 900px) and (min-height: 540px) {
  .app[data-view='fire'] .games { padding-top: 22px; }
  .table-main { width: min(100%, 640px); }
  .board-wrap { width: min(100%, calc(100svh - 260px), 600px); }
  .table[data-kind='four'] .board-wrap { width: min(100%, calc((100svh - 260px) * 1.09), 640px); }
}

/* ------------------------------------------------------------------ the logbook */

/* By the fire: the tasks that want you first, then news on the ones you asked. */
.app:not([data-view='fire']) .log-sec { display: none; }
.log-sec { padding: 26px 16px 0; }
.log-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.log-row { --hue: 24; display: flex; align-items: center; gap: 8px; }
.lr-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.3s, transform 0.2s var(--spring);
}
.lr-main:active { transform: scale(0.985); }
.log-row:is([data-state='due'], [data-state='late']) .lr-main {
  border-color: hsl(var(--hue) 85% 62% / 0.5);
  background: linear-gradient(90deg, hsl(var(--hue) 80% 50% / 0.16), var(--card) 70%);
}
.lg-glyph {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: 17px;
  background: linear-gradient(145deg, hsl(var(--hue) 40% 22%), #1d120e);
  box-shadow: inset 0 1px 0 rgba(255, 230, 200, 0.08), inset 0 0 0 1px hsl(var(--hue) 70% 55% / 0.25);
}
.log-row[data-state='due'] .lg-glyph, .task[data-state='due'] .task-face { animation: thinking 1.6s infinite ease-in-out; }
.lr-text { flex: 1; min-width: 0; display: grid; }
.lr-text b, .lr-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-text b { font-size: 15px; }
.lr-text small { font-size: 12.5px; color: var(--ink-3); }
.log-row:is([data-state='due'], [data-state='late']) .lr-text small { color: #ffcf9a; }
.lr-done {
  flex: none;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 15px;
  font-size: 22px;
  font-weight: 800;
  color: #10230f;
  background: linear-gradient(#b9f3a2, #59c96b);
  box-shadow: 0 6px 18px rgba(89, 201, 107, 0.28);
  cursor: pointer;
  transition: transform 0.2s var(--spring), opacity 0.2s;
}
.lr-done:active { transform: scale(0.92); }
.lr-done:disabled { opacity: 0.5; }
.log-more {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* On the fire: one of yours wants an answer (under the sync chip when both show). */
.sync-chip:not([hidden]) + .log-chip { top: calc(var(--safe-top) + 126px); }
.sync-chip.log-chip i {
  display: grid;
  place-items: center;
  background: hsl(var(--hue) 70% 45% / 0.25);
  -webkit-mask: none;
  mask: none;
  font-style: normal;
  font-size: 15px;
}
.sync-chip.log-chip { animation: rise-in 0.5s var(--ease) both, chip-glow 1.8s 0.5s infinite ease-in-out; }

/* The room: the same dark wood as the game table, with the tasks stacked like pages. */
.logbook .log-main {
  position: relative;
  width: min(100%, 600px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 18px;
  padding: 8px 14px calc(28px + var(--safe-bottom));
}
.log-group h3 { margin: 0 0 10px 4px; font-family: var(--display); font-size: 18px; font-weight: 600; color: var(--ink-2); }
.task-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.task {
  --hue: 24;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 14px 14px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 214, 178, 0.14);
  background: linear-gradient(180deg, rgba(48, 28, 20, 0.92), rgba(30, 17, 14, 0.92));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 230, 200, 0.06);
  scroll-margin: 90px;
}
.task:is([data-state='due'], [data-state='late']) { border-color: hsl(var(--hue) 85% 62% / 0.55); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 26px hsl(var(--hue) 95% 55% / 0.18); }
.task.focus { outline: 2px solid hsl(var(--hue) 90% 65% / 0.6); outline-offset: 3px; }
.task-head { display: flex; align-items: center; gap: 11px; }
.task-face { flex: none; width: 34px; height: 34px; font-size: 15px; }
.task-what { flex: 1; min-width: 0; display: grid; gap: 1px; }
.task-what b { font-size: 16.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-what small { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-seen { flex: none; font-size: 14px; opacity: 0.75; }
.task-icon {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-2);
  font-size: 16px;
  cursor: pointer;
}
.task-state { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.task-state[data-tone='hot'] { color: #ffd9a8; }
.task-state[data-tone='late'], .task-state[data-tone='refused'] { color: #ff9b8a; }
.task-state[data-tone='done'] { color: #a8e6a0; }
.task-state[data-tone='missed'] { color: var(--ink-3); }
.task-week { display: flex; gap: 6px; }
.tw-day {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-3);
  border: 1px dashed rgba(255, 214, 178, 0.14);
}
.tw-day.today { box-shadow: 0 0 0 2px rgba(255, 214, 178, 0.18); }
.tw-day[data-mark='done'] { color: #10230f; border: 0; background: linear-gradient(#b9f3a2, #59c96b); }
.tw-day[data-mark='part'] { color: #10230f; border: 0; background: linear-gradient(90deg, #8fdc86 50%, rgba(143, 220, 134, 0.3) 50%); }
.tw-day[data-mark='refused'] { color: #2a0b07; border: 0; background: linear-gradient(#ffb3a3, #f0654f); }
.tw-day[data-mark='missed'] { border-style: solid; border-color: rgba(255, 214, 178, 0.3); background: rgba(255, 255, 255, 0.04); }
.tw-day[data-mark='open'] { color: #1d0e06; border: 0; background: hsl(var(--hue) 90% 62%); animation: thinking 1.6s infinite ease-in-out; }
.task-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.task-act {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s var(--spring), opacity 0.2s;
}
.task-act:active { transform: scale(0.96); }
.task-act:disabled { opacity: 0.5; }
.task-act.go { flex-basis: 100%; color: #10230f; border-color: transparent; background: linear-gradient(#b9f3a2, #59c96b); font-size: 16px; }
.task-act.no { color: #ffb3a3; }
.task-more { justify-self: start; padding: 4px 2px; border: 0; background: none; color: var(--ink-3); font-size: 13px; font-weight: 700; cursor: pointer; }
.task-log, .log-trail { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.task-log { padding-top: 8px; border-top: 1px dashed var(--line); }
.te-row { display: grid; grid-template-columns: minmax(0, auto) 1fr; gap: 10px; font-size: 13px; }
.te-when { color: var(--ink-3); white-space: nowrap; }
.te-what { color: var(--ink-2); }
.te-row[data-end='done'] .te-what { color: #a8e6a0; }
.te-row[data-end='refused'] .te-what { color: #ff9b8a; }
.log-none { display: grid; gap: 6px; padding: 22px 18px; border-radius: 20px; border: 1px dashed var(--line); text-align: center; color: var(--ink-2); font-size: 14px; }
.log-none b { font-family: var(--display); font-size: 20px; color: var(--ink); }
.logbook .log-new { justify-self: center; width: auto; min-width: 220px; padding: 13px 28px; }
.log-trail { padding: 12px 14px; border-radius: 18px; background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line); }
.lt-day { margin-top: 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #ffcf9a; }
.lt-day:first-child { margin-top: 0; }
.lt-row { --hue: 24; display: flex; align-items: baseline; gap: 9px; font-size: 14px; }
.lt-time { flex: none; min-width: 64px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lt-mark { flex: none; width: 16px; text-align: center; font-weight: 900; color: hsl(var(--hue) 90% 68%); }
.lt-row[data-end='done'] .lt-mark { color: #8fdc86; }
.lt-row[data-end='refused'] .lt-mark { color: #f0654f; }
.lt-text { min-width: 0; color: var(--ink-2); }

/* The sheets. */
.person-chip[aria-checked='true'] { background: linear-gradient(hsl(var(--hue) 95% 72%), hsl(var(--hue) 90% 55%)); }
.person-chip:disabled { opacity: 0.4; }
.task-days { margin-top: 10px; }
#taskOnce .chips { margin-top: 10px; }
#taskOnce .field + .field, #taskOnce .chips + .field { margin-top: 8px; }
.task-times { display: grid; gap: 8px; margin-top: 10px; }
.tt-row { display: flex; align-items: center; gap: 8px; }
.tt-row .field { flex: 1; }
.tt-add { justify-self: start; }
.task-preview { margin-top: 14px; min-height: 1.3em; }
#taskSheet .btn-primary, #answerSheet .btn-primary { margin-top: 14px; }
.answer-for { font-family: var(--display); font-size: 18px; color: var(--ink); }
.answer-chips { margin-top: 6px; }
.answer-pick { display: grid; justify-items: start; gap: 1px; padding: 9px 15px; border-radius: 16px; }
.answer-pick b { font-size: 15px; }
.answer-pick small { font-size: 12px; color: var(--ink-3); }
#answerNote { margin-top: 4px; }

@media (hover: hover) and (pointer: fine) {
  .lr-main:hover { border-color: rgba(255, 170, 90, 0.35); }
  .task-act:hover { border-color: rgba(255, 170, 90, 0.4); }
  .task-icon:hover { background: rgba(255, 255, 255, 0.1); }
}

@media (min-width: 900px) and (min-height: 540px) {
  .app[data-view='fire'] .log-sec { padding-top: 22px; }
  .task-act.go { flex-basis: auto; }
}

/* ------------------------------------------------------------------ syncs */

/* The room: the fire blurred behind, an ember in a ring of everyone's arcs. */
.sync {
  --hue: 24;
  --level: 0;
  position: fixed;
  inset: 0;
  z-index: 32;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: calc(var(--safe-top) + 56px) 20px calc(24px + var(--safe-bottom));
  overflow: hidden;
  text-align: center;
  background: radial-gradient(70% 55% at 50% 52%, hsl(var(--hue) 55% 12% / 0.8), rgba(7, 4, 10, 0.94) 72%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.sync.show { animation: fade-in 0.35s both; }
.sync-x { position: absolute; top: calc(var(--safe-top) + 14px); right: 14px; }
.sync-by { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: hsl(var(--hue) 90% 72%); }
.sync-topic { margin: 0; max-width: 560px; font-family: var(--display); font-size: clamp(26px, 6.4vw, 42px); font-weight: 700; line-height: 1.1; overflow-wrap: anywhere; }
.sync-stage { position: relative; width: min(84vw, 50svh, 400px); aspect-ratio: 1; margin: 18px 0 8px; }
.sync-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; rotate: -90deg; transition: opacity 0.6s 0.25s; }
.arc { fill: none; stroke-width: 12; stroke-linecap: round; stroke-dashoffset: calc(var(--at) * -1); }
.arc.track { stroke: rgba(255, 230, 200, 0.1); stroke-dasharray: var(--len) 360; }
.arc.fill {
  --f: 0;
  stroke: hsl(var(--h) 95% 60%);
  stroke-dasharray: calc(var(--len) * var(--f)) 360;
  filter: drop-shadow(0 0 6px hsl(var(--h) 95% 55% / 0.9));
  /* An empty arc would still show its round cap as a dot. */
  opacity: calc(var(--f) * 40);
  transition: stroke-dasharray 0.28s var(--ease), opacity 0.15s;
}
.arc.fill.no { --f: 1; stroke: rgba(170, 155, 150, 0.45); filter: none; }
/* Sealed: the arcs give way to one ring of everyone's colors, turning slowly. */
.sync-stage::before {
  content: '';
  position: absolute;
  inset: 5.3%;
  border-radius: 50%;
  background: conic-gradient(var(--hues, transparent, transparent));
  -webkit-mask: radial-gradient(farthest-side, transparent 90.5%, #000 91.5%);
  mask: radial-gradient(farthest-side, transparent 90.5%, #000 91.5%);
  opacity: 0;
  scale: 0.92;
  filter: drop-shadow(0 0 14px rgba(255, 220, 160, 0.6));
  transition: opacity 0.6s, scale 0.9s var(--spring);
}
.sync.sealed .sync-stage::before { opacity: 1; scale: 1; animation: halo-spin 7s linear infinite; }
.sync.sealed .sync-ring { opacity: 0; }
@keyframes halo-spin { to { rotate: 360deg; } }
.sync-faces { position: absolute; inset: 0; pointer-events: none; }
.sync-face {
  --c: hsl(var(--hue) 95% 62%);
  position: absolute;
  width: 42px;
  height: 42px;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid hsl(var(--hue) 40% 40% / 0.7);
  background: hsl(var(--hue) 30% 14%);
  color: hsl(var(--hue) 70% 70%);
  font-family: var(--display);
  font-weight: 700;
  filter: saturate(0.5) brightness(0.75);
  transition: filter 0.4s, border-color 0.4s, box-shadow 0.4s;
}
.sync-face.lit { filter: none; border-color: var(--c); box-shadow: 0 0 0 4px hsl(var(--hue) 95% 60% / 0.22), 0 0 22px hsl(var(--hue) 95% 58% / 0.7); }
.sync-face.has-face { color: transparent; }
.sync-face.no { filter: grayscale(1) brightness(0.6); }
.sync-face.no::after { content: '×'; position: absolute; right: -6px; bottom: -6px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: #3a2421; color: #ffb3a6; font: 800 15px/1 var(--ui); }
.sync-face.pop { animation: face-pop 0.6s var(--spring); }
@keyframes face-pop { 35% { scale: 1.35; } }
/* The ember is a living fireball (plasma.js) drawn under a clear button that holds the label;
   its canvas is larger than the button so flames can lick past the edge. */
.orb-plasma {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 86%;
  aspect-ratio: 1;
  translate: -50% -50%;
  pointer-events: none;
  transition: scale 0.25s var(--spring);
}
.sync.holding .orb-plasma { scale: 0.95; }
.sync.sealed .orb-plasma { animation: orb-burst 1.1s var(--ease); }
@keyframes orb-burst {
  0% { scale: 1; }
  25% { scale: 1.16; }
  100% { scale: 1; }
}
.sync-orb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54%;
  aspect-ratio: 1;
  translate: -50% -50%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: none;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.sync-orb:disabled { cursor: default; }
.orb-label { position: relative; font-family: var(--display); font-size: clamp(22px, 6vw, 32px); font-weight: 700; color: #fff8ee; text-shadow: 0 0 10px rgba(60, 15, 0, 0.9), 0 2px 14px rgba(0, 0, 0, 0.7); pointer-events: none; }
/* Without WebGL: a flickering glow instead. */
.sync.no-gl .orb-plasma { display: none; }
.sync.no-gl .sync-orb {
  background: radial-gradient(circle at 50% 55%, #fff6d8 0, hsl(var(--hue) 100% 62%) 30%, hsl(var(--hue) 90% 38% / 0.8) 58%, transparent 72%);
  filter: blur(1px) brightness(calc(0.7 + 0.5 * var(--level)));
  animation: no-gl-flicker 0.9s infinite alternate ease-in-out;
}
@keyframes no-gl-flicker { to { scale: 1.05 0.97; filter: blur(2px) brightness(calc(0.8 + 0.5 * var(--level))); } }
.sync.fizzled.no-gl .sync-orb { filter: grayscale(0.85) brightness(0.45); animation: none; }
.sync.fizzled .arc.fill { opacity: 0.4; }
.sync-sparks { position: absolute; inset: -10%; width: 120%; height: 120%; pointer-events: none; }
.sync-status { margin: 4px 0 0; min-height: 1.4em; max-width: 520px; font-family: var(--display); font-size: 18px; font-weight: 600; color: var(--ink-2); }
.sync.sealed .sync-status { font-size: 24px; color: #fff3df; }
.sync-actions { display: flex; gap: 8px; min-height: 40px; }

/* At the fire: an open sync you're in, as a chip under the title. */
.sync-chip {
  --hue: 24;
  --p: 0;
  position: absolute;
  left: 50%;
  top: calc(var(--safe-top) + 74px);
  z-index: 7;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 7px 16px 7px 8px;
  border-radius: 999px;
  border: 1px solid hsl(var(--hue) 90% 62% / 0.45);
  background: rgba(20, 11, 11, 0.86);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 22px hsl(var(--hue) 95% 55% / 0.25);
  cursor: pointer;
  animation: rise-in 0.5s var(--ease) both;
}
.sync-chip.hot { animation: rise-in 0.5s var(--ease) both, chip-glow 1.8s 0.5s infinite ease-in-out; }
@keyframes chip-glow { 50% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 34px hsl(var(--hue) 95% 58% / 0.6); } }
.sync-chip i {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: conic-gradient(hsl(var(--hue) 95% 60%) calc(var(--p) * 360deg), rgba(255, 255, 255, 0.14) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent 58%, #000 61%);
  mask: radial-gradient(farthest-side, transparent 58%, #000 61%);
}
.sc-text { min-width: 0; display: grid; text-align: left; }
.sc-text b { font-size: 11.5px; font-weight: 800; letter-spacing: 0.03em; color: hsl(var(--hue) 90% 75%); }
.sc-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 700; }
.app:not([data-view='fire']) .sync-chip { display: none; }

.pc-sync {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border-radius: 13px;
  border: 1px solid hsl(var(--hue) 85% 62% / 0.45);
  background: hsl(var(--hue) 70% 45% / 0.14);
  color: hsl(var(--hue) 95% 82%);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s var(--spring), background 0.2s;
}
.pc-sync:active { transform: scale(0.97); }
.plan-sync {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.2s var(--spring);
}
.plan-sync:active { transform: scale(0.92); }
@media (hover: hover) and (pointer: fine) {
  .pc-sync:hover { background: hsl(var(--hue) 70% 45% / 0.24); }
  .plan-sync:hover { border-color: rgba(255, 170, 90, 0.4); }
}

/* ------------------------------------------------------------------ keyboard */

kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 214, 178, 0.22);
  border-bottom-width: 2px;
  background: rgba(255, 255, 255, 0.06);
  font: 700 12px/1.5 var(--ui);
  color: var(--ink-2);
  text-align: center;
}
.match .hint kbd {
  display: none;
  margin-left: 10px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: rgba(255, 210, 170, 0.6);
}
.keys { margin: 12px 0 0; }

/* A bot's seat says so. */
.bot-tag { margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); font-family: var(--ui); font-size: 10px; font-style: normal; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); vertical-align: 2px; }

/* The game sheet's bots: a switch, then how well they play and how many. */
.game-bots { display: grid; gap: 10px; margin: 6px 0 4px; }
.gb-more { display: grid; gap: 8px; }
.gb-more[hidden] { display: none; }
.gb-more .note { margin: 0; }
.keys-head { margin: 22px 0 0; }
.keys div { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.keys dt { flex: none; width: 96px; display: flex; align-items: center; gap: 4px; color: var(--ink-3); }
.keys dd { margin: 0; font-weight: 600; }

.wheel-list.grabbing { scroll-snap-type: none; cursor: grabbing; }
.wheel-list.grabbing .wheel-item { cursor: grabbing; }

/* ------------------------------------------------------------------ mouse and trackpad */

@media (hover: hover) and (pointer: fine) {
  .match .hint kbd { display: inline-block; }
  .seat:not(.me):hover .avatar { scale: 1.08; border-color: var(--c); }
  .seat:not(.me):hover .name { color: var(--ink); }
  .friend[role='button']:hover { border-color: hsl(var(--hue) 80% 60% / 0.4); }
  .pc-poke:hover { border-color: hsl(var(--hue) 80% 62% / 0.5); background: hsl(var(--hue) 70% 50% / 0.14); }
  .pc-flare:hover { background: rgba(255, 140, 60, 0.18); }
  .pc-x:hover { color: var(--ink); }
  .icon-btn:hover { border-color: rgba(255, 214, 178, 0.3); color: #fff; }
  .chip:hover, .btn-chip:hover { border-color: rgba(255, 170, 100, 0.45); }
  .wheel-item:not(.on):hover { color: var(--ink-2); }
  .fc:hover { border-color: rgba(255, 170, 90, 0.32); }
  .pa:not([aria-pressed='true']):hover { background: rgba(255, 255, 255, 0.1); }
  .btn-ghost:hover { background: rgba(255, 255, 255, 0.09); }
  .btn-primary:hover, .btn-secondary:hover, .btn-small:hover { filter: brightness(1.07); }
  .btn-link:hover { color: #ffe0bd; }
}

/* ------------------------------------------------------------------ wide screens */

/* The rail of fires only shows beside a fire on wide screens. */
.rail { display: none; }

@media (min-width: 900px) and (min-height: 540px) {
  .app { max-width: none; }

  /* A fire: the scene fills the window; the panel, plans and friends scroll beside it. */
  .app[data-view='fire'] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    height: 100svh;
  }
  .app[data-view='fire'] .scene { grid-column: 1; grid-row: 1; height: 100%; }
  .app[data-view='fire'] .scene::after {
    inset: 0 0 0 auto;
    width: 70px;
    height: auto;
    background: linear-gradient(90deg, transparent, rgba(7, 4, 10, 0.55));
  }
  .app[data-view='fire'] .side {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: 16px;
    border-left: 1px solid var(--line);
    background: linear-gradient(180deg, #140b0d, var(--bg) 45%);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 214, 178, 0.16) transparent;
  }
  .app[data-view='fire'] .panel { margin: 0 14px; }
  .app[data-view='fire'] .roster { padding-bottom: 28px; }
  .app[data-view='fire'] .flare-call strong { font-size: 64px; }
  .app[data-view='fire'] .banner strong { font-size: 60px; }
  :root:has(.app[data-view='fire']) .toasts { left: calc((100vw - 400px) / 2); }

  /* Sheets become dialogs in the middle of the window. */
  .sheet {
    top: 50%;
    bottom: auto;
    width: min(520px, calc(100vw - 48px));
    max-height: min(88svh, 860px);
    padding: 16px 24px 26px;
    border-radius: 26px;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    translate: -50% -47%;
    scale: 0.97;
    opacity: 0;
    transition: translate 0.3s var(--ease), scale 0.3s var(--ease), opacity 0.2s, visibility 0s 0.3s;
  }
  .sheet.open { translate: -50% -50%; scale: 1; opacity: 1; transition: translate 0.35s var(--ease), scale 0.35s var(--ease), opacity 0.2s; }
  .grab { display: none; }
  .sheet-head { margin-top: 4px; }

  /* Your fires spread out in a grid. */
  .home { max-width: 1080px; margin: 0 auto; padding: 32px 32px 48px; }
  .home-hello { margin: 44px 4px 22px; font-size: 40px; }
  .fire-list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
  .fire-list + .fire-list:not(:empty) { margin-top: 14px; }
  .home > .btn-primary { width: auto; min-width: 260px; padding: 15px 34px; }
  .home-empty { max-width: 520px; }
}

@media (min-width: 1200px) and (min-height: 540px) {
  .app[data-view='fire'] { grid-template-columns: 240px minmax(0, 1fr) 420px; }
  .app[data-view='fire'] .rail {
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 12px 14px;
    border-right: 1px solid var(--line);
    background: linear-gradient(180deg, #0f090f, #08050a);
  }
  .app[data-view='fire'] .scene { grid-column: 2; }
  .app[data-view='fire'] .side { grid-column: 3; }
  /* The rail already leads home. */
  .app[data-view='fire'] #backHome { display: none; }
  :root:has(.app[data-view='fire']) .toasts { left: calc(240px + (100vw - 660px) / 2); }
}

.rail .brand { padding: 2px 8px 8px; }
.rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.rail-fire {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 7px;
  border-radius: 15px;
  border: 1px solid transparent;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.rail-fire:hover { background: rgba(255, 255, 255, 0.045); }
.rail-fire[aria-current='page'] {
  border-color: rgba(255, 170, 90, 0.28);
  background: linear-gradient(90deg, rgba(255, 122, 26, 0.15), rgba(255, 122, 26, 0.03));
}
.rail-fire .fc-flame { width: 36px; height: 36px; border-radius: 12px; }
.rail-fire .fc-flame::before { bottom: 6px; width: calc(8px + 11px * var(--level)); height: calc(11px + 16px * var(--level)); }
.rail-fire .fc-flame::after { bottom: 5px; width: 18px; height: 3px; }
.rf-main { flex: 1; min-width: 0; display: grid; }
.rf-main b, .rf-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-main b { font-family: var(--display); font-size: 15px; font-weight: 700; }
.rf-main small { font-size: 12px; color: var(--ink-3); }
.rail-fire[data-lit] small { color: #ffcf9a; }
.rf-badge { top: 4px; right: 6px; }
.rail-new {
  margin: 0 2px;
  padding: 10px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 170, 100, 0.35);
  background: none;
  color: #ffcf9a;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.rail-new:hover { background: rgba(255, 140, 60, 0.08); }
.rail-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 2px 0; border-top: 1px solid var(--line); }
.rail-foot .icon-btn { width: 38px; height: 38px; font-size: 16px; font-weight: 700; }
.rail-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; color: var(--ink-2); }

/* Sign-in, invites and onboarding on a wide screen: the fire to the left, the card to the right. */
@media (min-width: 1000px) and (min-height: 540px) {
  .app:not([data-view='fire']):not([data-view='home']) .scene { --fire-x: 0.36; }
  .overlay {
    place-items: center end;
    padding: 24px max(48px, 7vw);
    background: linear-gradient(90deg, transparent 32%, rgba(7, 4, 10, 0.5) 62%, rgba(7, 4, 10, 0.86));
  }
  .overlay .card { width: 440px; translate: 28px 0; }
  .overlay.open .card { translate: 0 0; }
}

.reduced .poke-bubble.landed { animation: banner-still 3.2s linear both !important; }

/* ------------------------------------------------------------------ Discord */

/* "On Discord": a headset on your seat, the toggle under the match, a way in for friends. */
.discord-row { display: flex; gap: 8px; margin-top: 10px; }
.discord-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(140, 150, 255, 0.26);
  background: rgba(88, 101, 242, 0.07);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, color 0.25s, box-shadow 0.25s, transform 0.2s var(--spring);
}
.discord-btn i, .table-discord i, .seat .dbadge {
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9ceff' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M4 15v-3a8 8 0 0 1 16 0v3'/%3E%3Crect x='3' y='13.5' width='4.5' height='7' rx='1.8' fill='%23c9ceff'/%3E%3Crect x='16.5' y='13.5' width='4.5' height='7' rx='1.8' fill='%23c9ceff'/%3E%3C/svg%3E");
}
.discord-btn i { width: 18px; height: 18px; flex: none; }
.discord-btn:active { transform: scale(0.97); }
.discord-btn[aria-pressed='true'] {
  color: #eef0ff;
  border-color: rgba(150, 160, 255, 0.6);
  background: linear-gradient(90deg, rgba(88, 101, 242, 0.42), rgba(88, 101, 242, 0.16));
  box-shadow: 0 0 22px rgba(88, 101, 242, 0.28);
}
.discord-open {
  flex: none;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(140, 150, 255, 0.26);
  background: rgba(255, 255, 255, 0.05);
  color: #c9ceff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.seat .dbadge {
  position: absolute;
  top: -5px;
  right: calc(50% + 12px);
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background-color: #5865f2;
  background-size: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(10, 6, 20, 0.85);
  opacity: 0;
  scale: 0.4;
  transition: opacity 0.3s, scale 0.4s var(--spring);
  pointer-events: none;
}
.seat[data-discord] .dbadge { opacity: 1; scale: 1; }
.pc-discord {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border-radius: 13px;
  border: 1px solid rgba(150, 160, 255, 0.5);
  background: rgba(88, 101, 242, 0.22);
  color: #e6e8ff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s var(--spring);
}
.pc-discord:active { transform: scale(0.97); }
.table-discord {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 9px;
  border-radius: 999px;
  border: 1px solid rgba(150, 160, 255, 0.4);
  background: rgba(88, 101, 242, 0.2);
  color: #e6e8ff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.table-discord i { width: 16px; height: 16px; }
.table-discord[data-count]:not([data-count=''])::after {
  content: attr(data-count);
  position: absolute;
  top: -9px;
  right: -9px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: #5865f2;
  box-shadow: 0 0 0 2px #1a0d08;
}
.table-top h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-top h2.tight { visibility: hidden; }
@media (max-width: 520px) {
  .table-discord { padding: 9px; }
  .table-discord span { display: none; }
  .table-discord i { width: 18px; height: 18px; }
  /* Room for the title beside the way back and the sound switch. */
  .table-top { gap: 8px; }
  .table-top h2 { font-size: 18px; }
  .table-back { gap: 6px; padding: 7px 12px 7px 7px; font-size: 13px; }
  .table-sound { width: 34px; height: 34px; }
}

/* ------------------------------------------------------------------ the new games on the list and in the pickers */

.gk-camps, .gp-camps { --art: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 4l13.9 8v16L20 36 6.1 28V12z' fill='none' stroke='%23f3e2c6' stroke-opacity='.45' stroke-width='2'/%3E%3Cpath d='M11 28L20 12l9 16z' fill='%23ff8a4a'/%3E%3Cpath d='M17.6 28l2.4-6 2.4 6z' fill='%231d120e'/%3E%3C/svg%3E"); }
.gk-camps .gr-icon, .gp-camps .gp-art { background-image: var(--art), linear-gradient(145deg, #3a2419, #1d120e); }
.gk-pong, .gp-pong { --art: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M23.5 23.5l8.5 8.5' stroke='%23f3e2c6' stroke-width='4.5' stroke-linecap='round'/%3E%3Ccircle cx='17' cy='17' r='10.5' fill='%23ff7a3a'/%3E%3Ccircle cx='31' cy='10' r='3.6' fill='%23fff3e0'/%3E%3C/svg%3E"); }
.gk-pong .gr-icon, .gp-pong .gp-art { background-image: var(--art), linear-gradient(145deg, #3a2419, #1d120e); }
.gk-crackers, .gp-crackers { --art: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Crect x='14.5' y='13' width='11' height='22' rx='3' fill='%23d8331f' transform='rotate(-14 20 24)'/%3E%3Crect x='14.5' y='21' width='11' height='3' fill='%23f2d16b' transform='rotate(-14 20 24)'/%3E%3Cpath d='M18.5 12.5q2-5.5 6.5-6' stroke='%23f3e2c6' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3Ccircle cx='25.5' cy='6.5' r='3.2' fill='%23ffd36b'/%3E%3C/svg%3E"); }
.gk-crackers .gr-icon, .gp-crackers .gp-art { background-image: var(--art), linear-gradient(145deg, #3a2419, #1d120e); }
.gk-party, .gp-party { --art: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 6.5l3.6 8.2 8.9.8-6.7 5.9 2 8.7L20 25.6l-7.8 4.5 2-8.7-6.7-5.9 8.9-.8z' fill='%23ffd36b'/%3E%3Crect x='5' y='28' width='4.5' height='4.5' rx='1' fill='%23ff7a3a' transform='rotate(20 7 30)'/%3E%3Crect x='30.5' y='29' width='4.5' height='4.5' rx='1' fill='%23ff6aa8' transform='rotate(-25 32 31)'/%3E%3Ccircle cx='9' cy='9' r='2' fill='%2378c8ff'/%3E%3C/svg%3E"); }
.gk-party .gr-icon, .gp-party .gp-art { background-image: var(--art), linear-gradient(145deg, #3a2419, #1d120e); }
.game-picks { grid-template-columns: repeat(4, 1fr); gap: 7px; }
.gp-head { grid-column: 1 / -1; margin: 6px 2px -2px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.gp-head:first-child { margin-top: 0; }
.game-pick { gap: 5px; padding: 11px 4px 10px; font-size: 12px; line-height: 1.15; text-align: center; }
.game-pick .gp-art { width: 44px; height: 44px; border-radius: 12px; }
.game-pick small { font-size: 10.5px; font-weight: 650; color: var(--ink-3); }
.pc-games { grid-template-columns: repeat(4, 1fr); }
.pc-game { font-size: 10.5px; }

/* ------------------------------------------------------------------ the table: groups, live games, watchers */

.table-player.group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.tp-chip {
  --c: hsl(var(--hue, 24) 95% 62%);
  flex: 1 1 140px;
  max-width: calc(50% - 3px);
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 5px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: rgba(20, 10, 8, 0.35);
  transition: border-color 0.35s, background 0.35s, opacity 0.35s;
}
.tp-chip .tp-face { width: 30px; height: 30px; font-size: 13px; }
.tp-chip .tp-who b { font-size: 13.5px; }
.tp-chip .tp-who small { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-chip.turn { border-color: hsl(var(--hue) 85% 62% / 0.5); background: hsl(var(--hue) 70% 45% / 0.14); }
.tp-chip.turn .tp-face { box-shadow: 0 0 0 3px hsl(var(--hue) 95% 60% / 0.2), 0 0 14px hsl(var(--hue) 95% 58% / 0.6); animation: thinking 1.6s infinite ease-in-out; }
.tp-chip.won { border-color: hsl(var(--hue) 95% 65% / 0.75); background: hsl(var(--hue) 70% 45% / 0.18); }
.tp-chip.out, .tp-chip.away, .tp-chip.pending, .table-player.away { opacity: 0.5; }
.tp-chip.out .tp-who b { text-decoration: line-through; }
.tp-score { flex: none; min-width: 1.4em; font-family: var(--display); font-size: 28px; font-weight: 800; line-height: 1; text-align: right; color: hsl(var(--hue) 95% 76%); }
.table-hud { width: 100%; }

.table[data-kind='pong'] .board-wrap { aspect-ratio: 1 / 1.6; width: min(100%, calc((100svh - 300px) / 1.6), 440px); min-width: 200px; }
.table[data-kind='crackers'] .board-wrap { aspect-ratio: 11 / 13; width: min(100%, calc((100svh - 350px) * 11 / 13), 520px); min-width: 230px; }
.table[data-kind='party'] .board-wrap { aspect-ratio: auto; width: min(100%, 520px); min-height: min(58svh, 500px); }
.table[data-kind='party'] .board { height: auto; min-height: inherit; display: flex; }
.table[data-kind='camps'] .board-wrap { aspect-ratio: 10.3 / 9.7; width: min(100%, calc((100svh - 400px) * 1.06), 600px); min-width: 260px; }
.table[data-kind='camps'] .table-main, .table[data-kind='crackers'] .table-main, .table[data-kind='party'] .table-main { justify-content: flex-start; }

/* Watchers and the cheer rail: it stays in reach at the bottom while the table scrolls. */
.table-crowd { display: grid; justify-items: center; gap: 8px; }
.table-crowd.rail { position: sticky; bottom: calc(8px + var(--safe-bottom)); z-index: 9; }
.table-actions:empty { min-height: 0; }
.tc-watchers { display: flex; align-items: center; gap: 6px; min-height: 22px; font-size: 13px; font-weight: 650; color: var(--ink-3); }
.tc-watchers:empty { display: none; }
.tc-watchers .mini-dot { position: relative; box-shadow: 0 0 0 2px #1a0d08; }
.tc-watchers .mini-dot + .mini-dot { margin-left: -9px; }
.tw-eyes { font-size: 15px; }
.tc-rail {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(20, 10, 8, 0.82);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.tc-cheer {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s var(--spring), background 0.2s;
}
.tc-cheer[data-key='gg'] { width: auto; padding: 0 12px; border-radius: 999px; font-size: 13.5px; font-weight: 800; color: #ffcf9a; }
.tc-cheer:active { transform: scale(0.88); }
.tc-cheer.sent { animation: cheer-sent 0.35s var(--spring); }
@keyframes cheer-sent { 40% { transform: scale(1.3); background: rgba(255, 140, 60, 0.3); } }
.table-cheers { position: absolute; inset: 0; z-index: 8; overflow: hidden; pointer-events: none; }
.cheer {
  position: absolute;
  left: var(--x);
  bottom: 4%;
  display: grid;
  justify-items: center;
  animation: cheer-up 2.5s var(--ease) forwards;
}
.cheer b { font-size: 34px; font-weight: 400; line-height: 1; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5)); }
.cheer.word b { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 28px; color: hsl(var(--hue) 95% 76%); text-shadow: 0 2px 10px #000; }
.cheer small { margin-top: 3px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 800; color: #170a05; background: hsl(var(--hue) 90% 65%); }
@keyframes cheer-up {
  0% { opacity: 0; transform: translate(-50%, 24px) scale(0.6); }
  12% { opacity: 1; transform: translate(-50%, 0) scale(1.12); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--drift)), -230px) scale(0.92); }
}

/* ------------------------------------------------------------------ ping pong and Firecrackers */

.board.pong, .board.crackers { border-radius: 14px; overflow: hidden; touch-action: none; }
.board.pong { background: #0a2a34; box-shadow: 0 0 0 5px #3b2115, 0 0 0 6px rgba(255, 210, 160, 0.18), 0 26px 50px rgba(0, 0, 0, 0.6); }
.board.crackers { background: #1d3522; box-shadow: 0 0 0 5px #2c1a10, 0 0 0 6px rgba(255, 210, 160, 0.16), 0 26px 50px rgba(0, 0, 0, 0.6); }
.pong-canvas, .crackers-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; }
.pong-canvas { cursor: ew-resize; }
.ck-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 4px 0; user-select: none; -webkit-user-select: none; }
.ck-pad {
  position: relative;
  flex: none;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02) 70%);
  touch-action: none;
}
.ck-arrow { position: absolute; left: 50%; top: 50%; width: 0; height: 0; border: 9px solid transparent; opacity: 0.45; transition: opacity 0.15s; }
.ck-arrow.u { border-bottom-color: #ffd9a8; translate: -50% -50px; }
.ck-arrow.d { border-top-color: #ffd9a8; translate: -50% 32px; }
.ck-arrow.l { border-right-color: #ffd9a8; translate: -50px -50%; }
.ck-arrow.r { border-left-color: #ffd9a8; translate: 32px -50%; }
.ck-pad[data-dir='u'] .ck-arrow.u, .ck-pad[data-dir='d'] .ck-arrow.d, .ck-pad[data-dir='l'] .ck-arrow.l, .ck-pad[data-dir='r'] .ck-arrow.r { opacity: 1; }
.ck-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  margin: -23px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ffe2b8, #c98a4e 70%);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
  translate: var(--kx, 0px) var(--ky, 0px);
}
.ck-bomb {
  flex: none;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 2px solid rgba(255, 200, 160, 0.45);
  background: radial-gradient(circle at 40% 35%, #ff7a5a, #b3150e 75%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 80, 40, 0.3);
  font-size: 40px;
  line-height: 1;
  touch-action: none;
  cursor: pointer;
}
.ck-bomb .ic { width: 46px; height: 46px; color: #fff3e0; stroke-width: 2.1; }
.ck-bomb.hit { animation: ck-hit 0.25s var(--spring); }
@keyframes ck-hit { 40% { transform: scale(0.86); } }
.ck-hint { flex: 1; margin: 0; text-align: center; font-size: 12.5px; color: var(--ink-3); }
/* The glove's and the remote's buttons, smaller, beside the cracker's. */
.ck-buttons { display: flex; align-items: center; gap: 8px; }
.ck-bomb.ck-extra { width: 60px; height: 60px; background: radial-gradient(circle at 40% 35%, #7aa8ff, #2b4fa8 75%); border-color: rgba(170, 200, 255, 0.45); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 22px rgba(80, 140, 255, 0.3); }
.ck-bomb.ck-extra .ic { width: 30px; height: 30px; }
.ck-bomb[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) {
  .ck-pad, .ck-bomb { display: none; }
  .ck-controls { justify-content: center; }
}

/* ------------------------------------------------------------------ the games hub */

.hub { display: grid; gap: 12px; margin-top: 26px; }
.hub:empty { display: none; }
.hub-head { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 700; }
.hub-sub { margin: 6px 0 0; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.hub-grid.mini { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.hub-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  min-height: 150px;
  padding: 0 0 12px;
  border: 1px solid rgba(255, 214, 160, 0.12);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  color: var(--ink);
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
.hub-card:active { transform: scale(0.97); }
.hub-card .hc-art {
  display: block;
  width: 100%;
  height: 96px;
  border-radius: 0;
  background-image: var(--art), radial-gradient(90% 120% at 50% 110%, hsl(var(--hc) 85% 45% / 0.75), transparent 65%), linear-gradient(165deg, hsl(var(--hc) 40% 20%), hsl(var(--hc) 30% 8%));
  background-size: 62px, cover, cover;
  background-position: center 42%, center, center;
  background-repeat: no-repeat;
  box-shadow: inset 0 -1px 0 hsl(var(--hc) 80% 60% / 0.25);
}
.hub-card { --hc: 24; }
.hub-card.gp-camps { --hc: 130; }
.hub-card.gp-race { --hc: 38; }
.hub-card.gp-crackers { --hc: 6; }
.hub-card.gp-party { --hc: 290; }
.hub-card.gp-pong { --hc: 195; }
.hub-card.gp-chess { --hc: 28; }
.hub-card.gp-four { --hc: 350; }
.hub-card.gp-ttt { --hc: 50; }
.hub-card .hc-body { display: grid; gap: 2px; padding: 0 12px; }
.hub-card b { font-size: 15px; line-height: 1.2; }
.hub-card small { font-size: 11.5px; font-weight: 650; color: var(--ink-3); }
.hc-line { font-size: 12.5px; line-height: 1.3; color: var(--ink-2); }
.hub-card.hc-mini { min-height: 0; grid-template-rows: auto auto; padding-bottom: 10px; }
.hub-card.hc-mini .hc-art { display: grid; place-items: center; height: 64px; background: linear-gradient(145deg, #2a2440, #151025); }
.hub-card.hc-mini .hc-art .ic { width: 34px; height: 34px; color: #ffd08a; }
.hc-art.k-arena { background: linear-gradient(145deg, #1f4d5c, #0f2730) !important; }
.hc-art.k-ball { background: linear-gradient(145deg, #2b5a2c, #142815) !important; }
.hc-art.k-reflex { background: linear-gradient(145deg, #5a321c, #2a160c) !important; }
.hc-art.k-brain { background: linear-gradient(145deg, #3a2a5c, #1a1230) !important; }
@media (hover: hover) and (pointer: fine) {
  .hub-card:hover { border-color: rgba(255, 170, 90, 0.45); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 22px rgba(255, 122, 26, 0.12); transform: translateY(-2px); }
}
.game-setup { display: grid; gap: 6px; margin-top: 4px; }
.game-setup[hidden] { display: none; }

/* ------------------------------------------------------------------ landing, over the live fire */

.landing {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.landing[hidden] { display: none; }
.lp-hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100svh;
  padding: calc(14px + var(--safe-top)) 20px 28px;
  background: linear-gradient(rgba(7, 4, 10, 0.45), transparent 22%, transparent 48%, rgba(7, 4, 10, 0.88) 76%, var(--bg));
}
.lp-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(1040px, 100%); margin: 0 auto; }
.lp-signin { width: auto; margin: 0; padding: 9px 18px; }
.lp-pitch { width: min(620px, 100%); margin: 0 auto; text-align: center; }
.lp-pitch h1 { margin: 0 0 12px; font-family: var(--display); font-size: clamp(36px, 10vw, 60px); font-weight: 700; line-height: 1.04; }
.lp-pitch > p:not(.lp-note) { margin: 0 0 20px; font-size: clamp(16px, 2.4vw, 19px); line-height: 1.45; color: var(--ink-2); text-wrap: balance; }
.lp-pitch .btn-primary, .lp-again { width: min(320px, 100%); margin: 0 auto; }
.lp-note { margin: 12px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink-3); }
.lp-body { padding: 8px 20px calc(24px + var(--safe-bottom)); background: var(--bg); }
.lp-block { width: min(1040px, 100%); margin: 0 auto; padding: 34px 0; }
.lp-block > h2 { margin: 0 0 8px; font-family: var(--display); font-size: clamp(25px, 5vw, 36px); font-weight: 700; line-height: 1.12; }
.lp-lead { max-width: 640px; margin: 0; line-height: 1.45; color: var(--ink-2); }
.lp-block .hub { margin-top: 18px; }
.lp-steps, .lp-grid { display: grid; gap: 12px; margin: 18px 0 0; padding: 0; list-style: none; }
.lp-steps { counter-reset: step; }
.lp-steps li, .lp-grid li, .lp-plan {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card-2);
}
.lp-steps li { counter-increment: step; }
.lp-steps li::before { content: counter(step); font-family: var(--display); font-size: 26px; font-weight: 700; color: var(--ember-hot); }
.lp-steps b, .lp-grid b { font-size: 16px; }
.lp-steps span, .lp-grid span { font-size: 14.5px; line-height: 1.4; color: var(--ink-2); }
.lp-plans { display: grid; gap: 12px; margin-top: 18px; }
.lp-plan h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 17px; }
.lp-plan.plus { border-color: rgba(255, 181, 71, 0.4); background: radial-gradient(90% 90% at 50% 120%, rgba(255, 122, 26, 0.2), transparent 70%), var(--card-2); }
.lp-tag { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; color: #2a1407; background: var(--ember-hot); }
.lp-price { margin: 6px 0 0; font-family: var(--display); font-size: 32px; font-weight: 700; }
.lp-price small { font-family: var(--ui); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.lp-alt { margin: 0; font-size: 14px; color: var(--ink-2); }
.lp-plan ul { display: grid; gap: 6px; margin: 10px 0 0; padding: 0 0 0 18px; font-size: 14.5px; color: var(--ink-2); }
.lp-again { display: block; margin-top: 18px; }
.lp-foot { display: grid; gap: 8px; width: min(1040px, 100%); margin: 0 auto; padding: 22px 0 8px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-3); }
.lp-foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.lp-foot a { color: var(--ink-2); }
.lp-foot p { margin: 0; }
@media (min-width: 760px) {
  .lp-steps { grid-template-columns: repeat(3, 1fr); }
  .lp-grid { grid-template-columns: repeat(3, 1fr); }
  .lp-plans { grid-template-columns: repeat(2, 1fr); max-width: 760px; }
}

.consent { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; font-size: 14px; line-height: 1.4; color: var(--ink-2); cursor: pointer; }
.consent input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--ember); }
.consent a { color: var(--ember-hot); }
#authBack { display: block; margin: 10px auto 0; }
#authBack[hidden] { display: none; }

/* ------------------------------------------------------------------ support: ad square, Ko-fi */

.support { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 22px; margin-top: 30px; }
.ad-box { display: grid; justify-items: center; gap: 4px; }
.ad-label { margin: 0; font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.ad-label[hidden] { display: none; }
/* Always the unit's size (support.js AD_SIZE), so nothing jumps when an ad comes or goes. */
.ad-square {
  display: grid;
  place-items: center;
  width: 250px;
  height: 250px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 214, 160, 0.1);
}
.ad-square ins.adsbygoogle { border-radius: 0; }
.ad-house {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 20px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: radial-gradient(90% 70% at 50% 108%, rgba(255, 122, 26, 0.32), transparent 70%), linear-gradient(170deg, #2a1a12, #120a0e);
}
.ad-house[hidden] { display: none; }
.ad-house .kofi-cup { width: 46px; height: 46px; color: var(--ember-hot); filter: drop-shadow(0 0 12px rgba(255, 150, 60, 0.45)); }
.ad-house b { font-family: var(--display); font-size: 19px; line-height: 1.15; }
.ah-text { font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
.ah-go { margin-top: 4px; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 800; color: #fff; background: #29abe0; }
.kofi-cup { display: inline-grid; width: 22px; height: 22px; flex: none; }
.kofi-cup svg { width: 100%; height: 100%; }
.kofi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(#3cb8ea, #1f97c9);
  box-shadow: 0 8px 24px rgba(41, 171, 224, 0.28);
  transition: transform 0.2s var(--spring), box-shadow 0.2s;
}
.kofi-btn[hidden] { display: none; }
.kofi-btn:active { transform: scale(0.97); }
.sheet .kofi-btn { width: 100%; margin-top: 6px; }
@media (hover: hover) and (pointer: fine) {
  .kofi-btn:hover { box-shadow: 0 10px 30px rgba(41, 171, 224, 0.42); transform: translateY(-1px); }
  .ad-house:hover .ah-go { background: #3cb8ea; }
}

/* ------------------------------------------------------------------ Party night */

.pt-stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 14px;
  border-radius: 22px;
  background: radial-gradient(120% 80% at 50% 110%, rgba(255, 120, 40, 0.22), transparent 60%), linear-gradient(180deg, #1c1132, #120a16);
  box-shadow: inset 0 1px 0 rgba(255, 220, 180, 0.08), 0 26px 50px rgba(0, 0, 0, 0.55);
  text-align: center;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.pt-round { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.pt-big { margin: 0; font-size: 64px; line-height: 1; filter: drop-shadow(0 6px 18px rgba(255, 140, 60, 0.45)); animation: pt-pop 0.5s var(--spring); }
@keyframes pt-pop { from { transform: scale(0.3) rotate(-12deg); opacity: 0; } }
.pt-title { margin: 0; font-family: var(--display); font-size: 26px; font-weight: 700; }
.pt-how { margin: 0; max-width: 30ch; font-size: 15px; color: var(--ink-2); }
.pt-note { margin: 0; font-size: 13px; color: var(--ink-3); }
.pt-big .ic { color: #ffd08a; stroke-width: 1.6; }
.pt-round .ic { width: 15px; height: 15px; color: var(--ember-hot); vertical-align: -3px; }
.pt-keys { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 2px 0 0; font-size: 12.5px; color: var(--ink-3); }
.pt-keys .ic { width: 18px; height: 18px; }
.pt-kbd { min-width: 20px; padding: 1px 5px; border-radius: 6px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); font: 700 11px var(--ui); color: var(--ink-2); }
.pt-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pt-face {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid hsl(var(--hue) 95% 62%);
  background: hsl(var(--hue) 35% 17%);
  color: hsl(var(--hue) 85% 76%);
  font-family: var(--display);
  font-weight: 700;
  transition: box-shadow 0.25s, opacity 0.25s, filter 0.3s;
}
.pt-face.has-face { color: transparent; }
.pt-face.small { width: 26px; height: 26px; font-size: 12px; border-width: 1.5px; }
.pt-face.good { box-shadow: 0 0 0 3px #6ee08f, 0 0 16px rgba(110, 224, 143, 0.6); }
.pt-face.bad { box-shadow: 0 0 0 3px #ff6a5a; opacity: 0.65; }
.pt-bar { width: min(80%, 320px); height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.pt-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffcd7a, #ff8f2e); transform-origin: left; }
.pt-word { min-height: 1.2em; font-family: var(--display); font-size: 27px; font-weight: 700; color: var(--ink); }
.pt-word.hot { color: #ffcf9a; animation: thinking 1.2s infinite; }
.pt-pad {
  min-width: 70%;
  padding: 16px 24px;
  border: 0;
  border-radius: 20px;
  font-size: 18px;
  font-weight: 800;
  color: #1d0e06;
  background: linear-gradient(#ffcd7a, #ff8f2e);
  box-shadow: 0 10px 28px rgba(255, 120, 30, 0.3);
  touch-action: none;
  cursor: pointer;
}
.pt-pad:disabled { opacity: 0.4; box-shadow: none; }
.pt-pad.hit { animation: pt-hit 0.12s; }
@keyframes pt-hit { 50% { transform: scale(0.95); } }
/* The arena and ball games: one canvas, a stick under your thumb. */
.pt-arena { display: block; width: min(100%, calc(100svh - 330px), 560px); min-width: 240px; aspect-ratio: 1; border-radius: 18px; background: #0b0d10; box-shadow: inset 0 0 0 1px rgba(255, 230, 200, 0.08); touch-action: none; cursor: crosshair; }
.pt-arena.puck { cursor: ew-resize; }
.pt-row.lives { gap: 10px; }
.pt-life { display: flex; align-items: center; gap: 5px; padding: 3px 9px 3px 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); font-size: 11px; letter-spacing: 2px; color: hsl(var(--hue) 95% 72%); transition: opacity 0.3s, filter 0.3s; }
.pt-life b { min-width: 1ch; }
.pt-life.out { opacity: 0.45; filter: grayscale(1); }
/* Stop the needle. */
.pt-dial { width: min(86%, 340px); overflow: visible; }
.pt-dial path { fill: none; stroke-width: 16; stroke-linecap: round; }
.pt-dial .bed { stroke: rgba(255, 255, 255, 0.1); }
.pt-dial .zone { stroke: #6ee08f; filter: drop-shadow(0 0 6px rgba(110, 224, 143, 0.6)); }
.pt-dial .zone, .pt-dial .mid { stroke-linecap: butt; }
.pt-dial .mid { stroke: #f4fff6; stroke-width: 24; }
.pt-dial .hand { stroke: #ffcf9a; stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 5px rgba(255, 170, 90, 0.8)); }
.pt-dial .hub { fill: #ffcf9a; }
.pt-row.tries { min-height: 28px; }
.pt-try { padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); font-size: 12.5px; font-weight: 700; color: var(--ink-2); animation: pt-in 0.3s var(--ease) both; }
.pt-try.good { background: rgba(110, 224, 143, 0.16); color: #a6f0bc; }
/* Lantern catch: three rows of four. */
.pt-lanterns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: min(92%, 380px); }
.pt-lantern { position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 0; border: 1px solid rgba(255, 220, 170, 0.1); border-radius: 18px; background: rgba(0, 0, 0, 0.28); color: rgba(255, 220, 170, 0.22); transition: background 0.12s, color 0.12s, box-shadow 0.12s; touch-action: manipulation; cursor: pointer; }
.pt-lantern .ic { width: 52%; height: 52%; stroke-width: 1.6; }
.pt-lantern.lit { color: #fff1c8; background: radial-gradient(circle, rgba(255, 200, 100, 0.55), rgba(255, 130, 40, 0.18) 60%, rgba(0, 0, 0, 0.2)); box-shadow: 0 0 26px rgba(255, 170, 70, 0.55); }
.pt-lantern.caught { color: #c8ffd6; background: radial-gradient(circle, rgba(110, 224, 143, 0.5), rgba(0, 0, 0, 0.2) 70%); box-shadow: 0 0 22px rgba(110, 224, 143, 0.5); }
.pt-lantern.miss { animation: nope 0.3s; }
.pt-lantern:disabled { cursor: default; }
.pt-lantern .pt-kbd { position: absolute; right: 5px; bottom: 5px; min-width: 0; padding: 0 4px; font-size: 10px; opacity: 0.7; }
/* Quick sums. */
.pt-sum { margin: 0; font-family: var(--display); font-size: clamp(32px, 9vw, 46px); font-weight: 800; color: #ffe2b8; font-variant-numeric: tabular-nums; }
.pt-choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: min(92%, 360px); }
.pt-choice { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px 10px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, 0.06); font-family: var(--display); font-size: 26px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; touch-action: manipulation; cursor: pointer; transition: background 0.12s, transform 0.12s; }
.pt-choice:active { transform: scale(0.96); }
.pt-choice.good { background: rgba(110, 224, 143, 0.3); border-color: transparent; }
.pt-choice.bad { background: rgba(255, 106, 90, 0.3); border-color: transparent; animation: nope 0.3s; }
/* Odd one out. */
.pt-odd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(92%, 360px); }
.pt-oddcell { display: grid; place-items: center; aspect-ratio: 1; padding: 0; border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 14px; background: rgba(255, 255, 255, 0.04); touch-action: manipulation; cursor: pointer; }
.pt-oddcell .ic { width: 58%; height: 58%; stroke-width: 1.8; }
.pt-oddcell.kbd { outline: 2px solid #ffcf9a; outline-offset: 1px; }
.pt-oddcell.bad { background: rgba(255, 106, 90, 0.25); animation: nope 0.3s; }
.pt-odd[data-cells='20'] { grid-template-columns: repeat(5, 1fr); gap: 6px; }
/* The night's heat on each title card, and the round's twist revealed under the rules. */
.pt-heat { display: flex; justify-content: center; gap: 4px; }
.pt-heat .ic { width: 16px; height: 16px; stroke-width: 2; color: rgba(255, 220, 180, 0.2); }
.pt-heat .ic.on { color: #ff9a4a; filter: drop-shadow(0 0 6px rgba(255, 140, 50, 0.7)); }
.pt-twist {
  display: grid;
  justify-items: center;
  gap: 2px;
  max-width: 32ch;
  padding: 8px 14px;
  border-radius: 14px;
  border: 1px solid rgba(190, 140, 255, 0.45);
  background: linear-gradient(135deg, rgba(120, 60, 200, 0.28), rgba(40, 20, 70, 0.4));
  box-shadow: 0 0 22px rgba(160, 100, 255, 0.35);
  animation: pt-twist 0.7s var(--spring) 0.35s both;
}
.pt-twist .ic { width: 18px; height: 18px; color: #e2c8ff; }
.pt-twist b { font-family: var(--display); font-size: 17px; color: #f0e2ff; }
.pt-twist span { font-size: 13px; color: #d9c8f0; }
@keyframes pt-twist { from { opacity: 0; transform: scale(0.6) rotate(-6deg); } 60% { transform: scale(1.08) rotate(1deg); } to { opacity: 1; transform: none; } }
/* Ghost lanterns: lit blue; tapping one costs you a lantern. */
.pt-lantern.ghost { color: #d9f1ff; background: radial-gradient(circle, rgba(120, 190, 255, 0.5), rgba(40, 90, 200, 0.2) 60%, rgba(0, 0, 0, 0.2)); box-shadow: 0 0 24px rgba(110, 170, 255, 0.55); }
.pt-lantern.spooked { background: rgba(90, 140, 255, 0.35); animation: nope 0.3s; }
.pt-row.levels { gap: 12px; }
.pt-level { display: flex; align-items: center; gap: 5px; font-weight: 800; color: var(--ink-2); }
.pt-results { width: min(100%, 360px); margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.pt-results li {
  display: grid;
  grid-template-columns: 28px 1fr auto 2.4em;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 9px;
  padding: 7px 10px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  text-align: left;
  animation: pt-in 0.4s var(--ease) both;
}
.pt-results li:nth-child(2) { animation-delay: 0.08s; }
.pt-results li:nth-child(3) { animation-delay: 0.16s; }
.pt-results li:nth-child(4) { animation-delay: 0.24s; }
@keyframes pt-in { from { opacity: 0; transform: translateY(10px); } }
.pt-results li .pt-face { grid-row: 1 / 3; }
.pt-results li b { font-size: 15px; }
.pt-results li small { grid-column: 2; font-size: 12px; color: var(--ink-3); }
.pt-results li.me { border-color: hsl(var(--hue) 85% 62% / 0.45); }
.pt-plus { grid-column: 3; grid-row: 1 / 3; font-weight: 800; color: #ffcf9a; animation: pt-plus 0.6s var(--spring) both; animation-delay: inherit; }
@keyframes pt-plus { from { opacity: 0; transform: translateY(10px) scale(0.6); } 60% { transform: translateY(-3px) scale(1.25); } }
.pt-total { grid-column: 4; grid-row: 1 / 3; font-family: var(--display); font-size: 22px; font-weight: 800; text-align: right; color: hsl(var(--hue) 95% 76%); }
.pt-results.final li { grid-template-columns: 28px 1fr 2.4em; }
.pt-results.final .pt-total { grid-column: 3; }
.pt-results.final li.crown { border-color: hsl(var(--hue) 95% 65% / 0.75); background: hsl(var(--hue) 70% 45% / 0.18); }
.pt-results.final li.crown b::after { content: ' 👑'; }

/* The Kick-about kick: a big button for the other thumb, its rest shown as it refills. */
.pt-kick {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border: 0;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 800;
  color: #1d0e06;
  background: linear-gradient(#ffe2a8, #ff9a3c);
  box-shadow: 0 8px 22px rgba(255, 130, 40, 0.35);
  overflow: hidden;
  touch-action: none;
  cursor: pointer;
}
.pt-kick .ic { width: 22px; height: 22px; }
.pt-kick::after { content: ''; position: absolute; inset: 0; background: rgba(20, 10, 4, 0.45); transform-origin: left; transform: scaleX(var(--rest, 0)); pointer-events: none; }
.pt-kick:active { transform: scale(0.96); }

/* ------------------------------------------------------------------ Camps & Trails */

.board.camps { display: block; }
.camps-map { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.55)); }
.ct-tile { stroke: rgba(22, 12, 6, 0.6); stroke-width: 0.05; }
.ct-glyph { fill: none; stroke: rgba(255, 248, 232, 0.86); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.ct-glyph.t-F { stroke: #d6f5c0; }
.ct-glyph.t-Q { stroke: #f4eee6; }
.ct-glyph.t-M { stroke: #fbe3ff; }
.ct-glyph.t-L { stroke: #d2efff; }
.ct-glyph.hearth { stroke: #ffe39a; stroke-width: 1.6; filter: drop-shadow(0 0 0.06px rgba(255, 180, 60, 0.9)); }
.ct-glyph.wander { stroke: #fff1c8; stroke-width: 1.8; }
.ic.res.r-w { color: #e6aa70; }
.ic.res.r-s { color: #d4cdc4; }
.ic.res.r-b { color: #cf9bff; }
.ic.res.r-f { color: #86ceff; }
.ct-bundle { display: inline-flex; align-items: center; gap: 1px; white-space: nowrap; vertical-align: -0.2em; }
.ct-bundle .ic + :not(.ic) { margin-left: 3px; }
.ct-have { display: inline-flex; align-items: center; gap: 2px; }
.ct-keys { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 4px 0 0; font-size: 12px; color: var(--ink-3); }
.ct-keys .ic { width: 17px; height: 17px; }
.ct-pick.kbd { stroke: #ffffff; stroke-width: 0.11; fill: rgba(255, 246, 220, 0.5); }
.ct-pick.edge.kbd { stroke: #ffffff; stroke-width: 0.28; stroke-dasharray: none; }
.ct-num circle { fill: #f3e6cc; stroke: rgba(60, 30, 10, 0.4); stroke-width: 0.03; transition: fill 0.3s; }
.ct-num text { font: 800 0.3px var(--ui); text-anchor: middle; fill: #3a2414; }
.ct-num .pip { fill: #3a2414; stroke: none; }
.ct-num.hot text, .ct-num.hot .pip { fill: #c42a12; }
.ct-num.rolled circle:first-child { fill: #ffe7a0; stroke: #ff8a2a; stroke-width: 0.07; }
.camps-map.rolling .ct-num.rolled { animation: ct-roll 0.6s var(--spring); transform-box: fill-box; transform-origin: center; }
@keyframes ct-roll { 30% { transform: scale(1.35); } }
.ct-hearth circle { animation: ct-fire 1.4s infinite alternate ease-in-out; transform-box: fill-box; transform-origin: center; }
/* Trading posts on the rim: a jetty and a sign with the rate. */
.ct-jetty { stroke: rgba(222, 190, 140, 0.55); stroke-width: 0.06; stroke-linecap: round; stroke-dasharray: 0.08 0.06; }
.ct-post circle { fill: #2a1a10; stroke: rgba(255, 214, 160, 0.7); stroke-width: 0.04; }
.ct-post text { font: 800 0.2px var(--ui); text-anchor: middle; fill: #ffe2b8; }
.ct-post.r-any text { font-size: 0.24px; }
.ct-glyph.post { stroke-width: 2.4; }
.ct-glyph.post.r-w { stroke: #e6aa70; }
.ct-glyph.post.r-s { stroke: #d4cdc4; }
.ct-glyph.post.r-b { stroke: #cf9bff; }
.ct-glyph.post.r-f { stroke: #86ceff; }
/* A landmark's badge by its corner. */
.ct-landmark circle { stroke: rgba(255, 245, 225, 0.85); stroke-width: 0.035; }
.ct-glyph.mark { stroke: #fff6e6; stroke-width: 2.2; }
/* A storm over a land: dark, with its cloud. */
.ct-storm { fill: rgba(20, 24, 40, 0.55); pointer-events: none; animation: ct-storm 2.4s infinite alternate ease-in-out; }
.ct-glyph.storm { stroke: #cfe0ff; stroke-width: 2; }
@keyframes ct-storm { to { fill: rgba(20, 24, 40, 0.32); } }
@keyframes ct-fire { to { transform: scale(1.12); opacity: 0.85; } }
.ct-trail-bed { stroke: rgba(10, 5, 2, 0.75); stroke-width: 0.25; stroke-linecap: round; }
.ct-trail { stroke-width: 0.15; stroke-linecap: round; }
.ct-build path:first-child { stroke: rgba(15, 8, 4, 0.9); stroke-width: 0.05; stroke-linejoin: round; }
.ct-build .door { fill: rgba(20, 10, 6, 0.8); stroke: none; }
.ct-build.gone { opacity: 0.4; }
.ct-wanderer { pointer-events: none; }
.ct-pick { cursor: pointer; }
.ct-pick.spot { fill: rgba(255, 240, 200, 0.28); stroke: #fff2d6; stroke-width: 0.05; animation: ct-pulse 1s infinite alternate; }
.ct-pick.edge { stroke: rgba(255, 240, 200, 0.75); stroke-width: 0.2; stroke-linecap: round; stroke-dasharray: 0.14 0.12; animation: ct-dash 0.9s linear infinite; }
.ct-pick.tile { fill: rgba(255, 230, 160, 0.14); stroke: #ffe1a0; stroke-width: 0.07; animation: ct-pulse 1s infinite alternate; }
@keyframes ct-pulse { to { opacity: 0.45; } }
@keyframes ct-dash { to { stroke-dashoffset: -0.52; } }
.ct-hand { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.ct-res { display: flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); font-weight: 800; font-variant-numeric: tabular-nums; }
.ct-res .ic { width: 19px; height: 19px; }
.ct-points { padding: 5px 8px; font-weight: 800; color: #ffcf9a; }
.ct-acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.ct-acts:empty { display: none; }
.ct-act {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 8px 4px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--spring);
}
.ct-act small { font-size: 10.5px; letter-spacing: -0.5px; }
.ct-act small .ic { width: 13px; height: 13px; }
.ct-act > .ic.res { width: 26px; height: 26px; }
.ct-act.big .ic { width: 22px; height: 22px; margin-right: 8px; vertical-align: -5px; }
.ct-pickres { display: inline-flex; align-items: center; gap: 3px; }
.ct-pickres .ic { width: 17px; height: 17px; }
.ct-act:active { transform: scale(0.96); }
.ct-act.on { border-color: rgba(255, 170, 90, 0.75); background: rgba(255, 122, 26, 0.2); }
.ct-act.big { grid-column: 1 / -1; padding: 14px; border: 0; font-size: 18px; color: #1d0e06; background: linear-gradient(#ffcd7a, #ff8f2e); box-shadow: 0 8px 22px rgba(255, 120, 30, 0.3); }
.ct-act.end { background: rgba(255, 255, 255, 0.1); }
.ct-act:disabled { opacity: 0.38; cursor: default; }
.ct-offer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; padding: 8px 12px; border-radius: 14px; border: 1px dashed rgba(255, 190, 120, 0.45); background: rgba(255, 122, 26, 0.08); font-size: 14px; font-weight: 650; }
.ct-trade { display: grid; justify-items: center; gap: 6px; margin-top: 8px; padding: 10px 12px; border-radius: 16px; border: 1px solid var(--line); background: rgba(20, 10, 8, 0.55); }
.ct-trade-head { margin: 4px 0 0; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
/* The turn clock: whose turn, a bar that runs down, red in its last seconds. */
.ct-clock { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; padding: 7px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); font-size: 13.5px; font-weight: 700; color: var(--ink-2); overflow: hidden; }
.ct-clock[hidden] { display: none; }
.ct-clock::before { content: ''; position: absolute; inset: auto 0 0 0; height: 3px; background: linear-gradient(90deg, #ffcd7a, #ff8f2e); transform-origin: left; transform: scaleX(var(--left, 1)); transition: transform 0.25s linear; }
.ct-clock b { font-variant-numeric: tabular-nums; color: var(--ink); }
.ct-clock.mine { color: #ffcf9a; background: rgba(255, 140, 50, 0.1); }
.ct-clock.low::before { background: #ff5a4a; }
.ct-clock.low b { color: #ff8a7a; }
.ct-clock.mine.low { animation: ct-pulse 0.9s infinite; }
/* An offer: its time, the answers to it, counter-offers. */
.ct-offer-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.ct-offer-time { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.ct-offer-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.ct-offer-acts .btn-small.on { border-color: rgba(255, 170, 90, 0.6); }
.ct-offer-no { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.ct-counter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); }
.ct-counter-box { display: grid; gap: 8px; padding: 8px; border-radius: 12px; background: rgba(0, 0, 0, 0.2); }
/* Your secret goal, and everyone's at the end. */
.ct-goal { margin-top: 8px; }
.ct-goal[hidden] { display: none; }
.ct-goal-mine { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; margin: 0; padding: 8px 12px; border-radius: 14px; border: 1px solid rgba(255, 214, 160, 0.22); background: rgba(255, 255, 255, 0.04); font-size: 13.5px; }
.ct-goal-mine .ic { grid-row: 1 / 4; width: 26px; height: 26px; color: var(--ember-hot); }
.ct-goal-mine b { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.ct-goal-mine small { color: var(--ink-3); }
.ct-goal-mine.met { border-color: rgba(140, 220, 150, 0.5); background: rgba(80, 180, 100, 0.1); }
.ct-goal-mine.met .ic { color: #8fe0a0; }
.ct-goal-all { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; margin: 0; font-size: 12.5px; color: var(--ink-2); }
.ct-goal-all .ic { width: 18px; height: 18px; color: var(--ember-hot); }
.ct-goal-all .met { color: #a6e8b2; }
/* The landmarks to build. */
.ct-marks { display: grid; gap: 6px; margin-top: 8px; }
.ct-marks[hidden] { display: none; }
.ct-mark { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; padding: 7px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); }
.ct-mark b { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.ct-mark b .ic { width: 18px; height: 18px; color: var(--ember-hot); }
.ct-mark small { grid-column: 1; font-size: 12px; color: var(--ink-3); }
.ct-mark button { grid-column: 2; grid-row: 1 / 3; display: grid; justify-items: center; gap: 2px; }
.ct-mark button small { grid-column: auto; }
.ct-mark.built { opacity: 0.6; }
.ct-wind { grid-column: 1 / -1; margin: 2px 0 0; font-size: 12.5px; text-align: center; color: #9fd8ff; }
.ct-trade-sub { font-size: 12px; color: var(--ink-3); }
.ct-pickrow { display: flex; gap: 6px; }
.ct-pickres { padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); font-weight: 750; cursor: pointer; }
.ct-pickres.on { border-color: rgba(255, 170, 90, 0.75); background: rgba(255, 122, 26, 0.22); }
.ct-pickres:disabled { opacity: 0.32; cursor: default; }
.ct-offer-grid { display: grid; grid-template-columns: auto auto auto; align-items: center; gap: 4px 14px; }
.ct-offer-grid .ic { width: 21px; height: 21px; justify-self: center; }
.ct-offer-grid small { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--ink-3); text-align: center; }
.ct-step { display: inline-flex; align-items: center; gap: 6px; }
.ct-step button { width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.07); cursor: pointer; }
.ct-step button:disabled { opacity: 0.35; }
.ct-step b { min-width: 1.2em; text-align: center; }
.ct-hands { display: grid; gap: 2px; font-size: 12.5px; color: var(--ink-2); }
.ct-their b { margin-right: 6px; }
.ct-log { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 12.5px; text-align: center; color: var(--ink-3); }
.ct-log li:first-child { color: var(--ink-2); }

@media (hover: hover) and (pointer: fine) {
  .tc-cheer:hover { background: rgba(255, 255, 255, 0.12); transform: scale(1.12); }
  .ct-act:not(:disabled):hover { border-color: rgba(255, 170, 90, 0.45); }
  .discord-btn:hover { border-color: rgba(150, 160, 255, 0.5); }
}

@media (min-width: 900px) and (min-height: 540px) {
  .table[data-kind='pong'] .board-wrap { width: min(100%, calc((100svh - 260px) / 1.6), 460px); }
  .table[data-kind='crackers'] .board-wrap { width: min(100%, calc((100svh - 250px) * 11 / 13), 560px); }
  .table[data-kind='camps'] .board-wrap { width: min(100%, calc((100svh - 330px) * 1.06), 640px); }
}

/* A wide screen gives Camps & Trails two columns: the valley, and your hand beside it. */
@media (min-width: 1100px) and (min-height: 540px) {
  .table[data-kind='camps'] .table-main {
    width: min(100%, 1180px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    grid-template-areas: 'top top' 'board hud' 'board status' 'board actions' 'board crowd' 'board rest';
    grid-template-rows: auto auto auto auto auto 1fr;
    align-content: center;
    column-gap: 32px;
  }
  .table[data-kind='camps'] #tableTop { grid-area: top; }
  .table[data-kind='camps'] .board-wrap { grid-area: board; align-self: center; width: min(100%, calc((100svh - 150px) * 1.06), 760px); }
  .table[data-kind='camps'] .table-hud { grid-area: hud; align-self: end; margin-top: 40px; }
  .table[data-kind='camps'] .table-status { grid-area: status; }
  .table[data-kind='camps'] .table-actions { grid-area: actions; }
  .table[data-kind='camps'] .table-crowd { grid-area: crowd; position: static; }
}

.reduced .cheer { animation-duration: 1.2s; }
.reduced .ct-pick.spot, .reduced .ct-pick.tile, .reduced .ct-pick.edge, .reduced .ct-hearth circle, .reduced .pt-word.hot, .reduced .tp-chip.turn .tp-face, .reduced .pt-twist, .reduced .pt-lantern.spooked { animation: none; }

/* ------------------------------------------------------------------ your own burn time */

.wheel-item.custom .wl { font-style: italic; font-weight: 650; color: hsl(var(--my-hue) 80% 72% / 0.75); }
.burn-deck .drum { flex: 1 1 0; }
.burn-deck .wheel-item { font-size: 22px; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ syncs: going off together */

/* Friends not in the room yet are faded. */
.sync-face.away { opacity: 0.4; }
/* The count beats on the ember. */
.sync.counting .orb-label { font-size: clamp(56px, 16vw, 96px); animation: count-beat 1s infinite; }
@keyframes count-beat {
  0% { scale: 1.3; }
  35% { scale: 1; }
}
.sync.counting .sync-status { color: #ffe0b8; }
/* The moment: the screen flashes in the starter's color and the signal leaps. */
.sync::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #fffaf0, hsl(var(--hue) 100% 70% / 0.85) 34%, transparent 76%);
  opacity: 0;
}
.sync.go::after { animation: go-flash 1.2s ease-out; }
@keyframes go-flash {
  0% { opacity: 0.95; }
  100% { opacity: 0; }
}
.sync.go .sync-topic { animation: go-topic 1.5s var(--spring); }
@keyframes go-topic {
  0% { scale: 0.7; }
  30% { scale: 1.35; text-shadow: 0 0 34px hsl(var(--hue) 100% 70%); }
  100% { scale: 1; }
}
.sync.go .orb-label { font-size: clamp(40px, 12vw, 72px); }

.reduced .sync.go::after, .reduced .sync.go .sync-topic, .reduced .sync.counting .orb-label { animation: none; }

/* ------------------------------------------------------------------ toss-up */

/* By the plans: a button for each kind of draw, the polls, then the latest draws. */
.app:not([data-view='fire']) .tossup { display: none; }
.tossup { padding: 26px 16px 0; }
.toss-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 10px; }
.toss-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s var(--spring), border-color 0.25s, color 0.25s;
}
.toss-btn i { font-style: normal; font-size: 18px; }
.toss-btn:active { transform: scale(0.94); }
.toss-btn:disabled { opacity: 0.55; }
@media (hover: hover) {
  .toss-btn:hover { border-color: rgba(255, 170, 100, 0.4); color: var(--ink); }
}
.poll-list, .toss-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.poll-list:not(:empty) { margin-bottom: 8px; }
.poll-list:not(:empty) ~ .empty, .toss-list:not(:empty) ~ .empty { display: none; }

/* A poll: its question, a bar per option (your picks checked), who it waits for. */
.poll {
  --hue: 24;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 12px 12px 10px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  scroll-margin: 90px;
}
.poll[data-state='open'] { border-color: hsl(var(--hue) 80% 62% / 0.35); }
.poll.focus, .toss-row.focus { outline: 2px solid hsl(var(--hue) 90% 65% / 0.6); outline-offset: 3px; }
.poll-head { display: flex; align-items: center; gap: 10px; }
.poll-face { flex: none; width: 30px; height: 30px; font-size: 13px; }
.poll-what { flex: 1; min-width: 0; display: grid; gap: 1px; }
.poll-what b { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poll-what small { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poll-options { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.po {
  --share: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s var(--spring), border-color 0.25s;
}
.po:active { transform: scale(0.98); }
.po:disabled { cursor: default; color: var(--ink-2); }
.po:disabled:active { transform: none; }
.po-bar {
  position: absolute;
  inset: 0;
  transform-origin: 0 50%;
  transform: scaleX(var(--share));
  background: hsl(var(--hue) 80% 55% / 0.16);
  transition: transform 0.5s var(--ease);
  pointer-events: none;
}
.po > :not(.po-bar) { position: relative; }
.po-check {
  flex: none;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--ink-3);
  font-size: 12px;
  font-weight: 900;
  color: #1d0e06;
}
.poll[data-multi] .po-check { border-radius: 6px; }
.po[aria-pressed='true'] { border-color: rgba(255, 190, 110, 0.6); }
.po[aria-pressed='true'] .po-check { border-color: transparent; background: linear-gradient(#ffcd7a, #ff8f2e); }
.po[aria-pressed='true'] .po-check::before { content: '✓'; }
.po-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po-dots { flex: none; display: flex; align-items: center; padding-left: 4px; }
.po-dots .mini-dot { width: 18px; height: 18px; margin-left: -4px; font-size: 9.5px; box-shadow: 0 0 0 1.5px var(--card-2); }
.po-dots small { margin-left: 3px; font-size: 11px; color: var(--ink-3); }
.po-n { flex: none; min-width: 22px; text-align: right; font-size: 13px; color: var(--ink-2); }
.po.win { border-color: rgba(255, 200, 120, 0.65); color: var(--ink); }
.po.win .po-bar { background: linear-gradient(90deg, rgba(255, 170, 70, 0.32), rgba(255, 122, 26, 0.16)); }
.po.win .po-n::before { content: '🏆 '; }
.poll-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; font-size: 12.5px; color: var(--ink-3); }
.poll[data-state='closed'] .poll-foot > span { color: #ffd9a8; font-weight: 700; }
.poll-more {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.poll-more:disabled { opacity: 0.5; }

/* The latest draws: tap one to see it again, ↻ to draw the same way once more. */
.toss-row { --hue: 24; display: flex; align-items: center; gap: 8px; scroll-margin: 90px; }
.tr-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s var(--spring);
}
.tr-main:active { transform: scale(0.985); }
.tr-main:disabled { cursor: default; color: var(--ink); }
.tr-main:disabled:active { transform: none; }
.tr-text { flex: 1; min-width: 0; display: grid; }
.tr-text b, .tr-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-text b { font-size: 15px; }
.tr-text small { font-size: 12.5px; color: var(--ink-3); }
.tr-again {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-2);
  font-size: 19px;
  cursor: pointer;
  transition: transform 0.2s var(--spring);
}
.tr-again:active { transform: scale(0.9) rotate(-40deg); }
.tr-again:disabled { opacity: 0.5; }
/* Rock paper scissors still in play: its own card, with your hands when it's your move. */
.toss-row.rps-live {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid hsl(var(--hue) 80% 62% / 0.4);
  background: linear-gradient(90deg, hsl(var(--hue) 80% 50% / 0.14), var(--card) 70%);
}
.rps-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rps-hands { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.rps-hand {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 4px 7px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-2);
  cursor: pointer;
  transition: transform 0.2s var(--spring), background 0.25s, color 0.25s;
}
.rps-hand span { font-size: 30px; line-height: 1.15; }
.rps-hand small { font-size: 12px; font-weight: 700; }
.rps-hand:active { transform: scale(0.9); }
.rps-hand:disabled { opacity: 0.5; }
@media (hover: hover) {
  .rps-hand:hover { background: rgba(255, 160, 70, 0.14); color: var(--ink); }
}
.rps-sealed { margin: 0; font-size: 13px; color: var(--ink-2); }
#tossHands .rps-hands { margin-bottom: 14px; }
.poll-preview { margin-top: 10px; }

/* Whoever's straw it was glows on their seat for a moment. */
.seat.picked .avatar { animation: seat-picked 1.1s ease-in-out 3; }
@keyframes seat-picked {
  50% { box-shadow: 0 0 0 4px rgba(255, 214, 130, 0.9), 0 0 30px rgba(255, 170, 60, 0.8); }
}

/* The card over the page: each new draw plays here for everyone with the fire open. */
.toss-show {
  position: fixed;
  inset: 0;
  z-index: 56;
  display: grid;
  place-items: center;
  padding: 20px 16px;
  background: radial-gradient(50% 40% at 50% 48%, rgba(10, 5, 4, 0.5), transparent);
  pointer-events: none;
  animation: ts-in 0.2s both;
}
.toss-show[hidden] { display: none; }
.toss-show.out { animation: ts-out 0.26s both; }
.ts-card {
  --hue: 24;
  width: min(100%, 360px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 14px;
  padding: 18px 18px 20px;
  border-radius: 26px;
  border: 1px solid hsl(var(--hue) 85% 65% / 0.35);
  background: linear-gradient(180deg, #2e1912, #160c0a);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 40px hsl(var(--hue) 90% 55% / 0.18);
  text-align: center;
  pointer-events: auto;
  animation: ts-pop 0.35s var(--spring) both;
}
.ts-card.me { border-color: rgba(255, 210, 120, 0.8); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(255, 170, 60, 0.42); }
.ts-head { display: flex; align-items: center; gap: 10px; max-width: 100%; }
.ts-head .mini-dot { flex: none; width: 30px; height: 30px; font-size: 13px; }
.ts-verb { min-width: 0; display: grid; text-align: left; }
.ts-verb b { font-size: 15px; }
.ts-verb small { font-size: 12.5px; color: var(--ink-3); }
.ts-stage { width: 100%; min-height: 132px; display: grid; place-items: center; perspective: 700px; }
.ts-result {
  margin: 0;
  min-height: 1.3em;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s, transform 0.35s var(--spring);
}
.ts-card.landed .ts-result { opacity: 1; transform: none; }
.ts-card.me .ts-result { color: #ffd27a; }
@keyframes ts-in { from { opacity: 0; } }
@keyframes ts-out { to { opacity: 0; } }
@keyframes ts-pop { from { opacity: 0; transform: translateY(16px) scale(0.92); } }

/* A coin in the air, turning over and over until it lands on the side the fire drew. */
.coin { position: relative; width: 104px; height: 104px; transform-style: preserve-3d; animation: coin-flip 1.5s cubic-bezier(0.25, 0.6, 0.3, 1) both; }
.coin-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: radial-gradient(circle at 34% 28%, #fff3c9, #f2c25b 42%, #c0812a 78%, #8c5514);
  box-shadow: inset 0 0 0 5px rgba(120, 70, 12, 0.45), inset 0 0 0 10px rgba(255, 236, 170, 0.3), 0 8px 24px rgba(0, 0, 0, 0.45);
  font-family: var(--display);
  font-size: 46px;
  font-weight: 800;
  color: #6d3f07;
}
.coin-face.tails { transform: rotateX(180deg); }
@keyframes coin-flip {
  0% { transform: translateY(30px) rotateX(0deg) scale(0.6); }
  50% { transform: translateY(-70px) rotateX(calc(var(--end) * 0.6)) scale(1.08); }
  100% { transform: translateY(0) rotateX(var(--end)) scale(1); }
}

/* Dice tumbling, then showing what was rolled: pips on six-sided ones, numbers on the rest. */
.dice { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 280px; }
.die {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #fff8ee, #e9d6bd);
  box-shadow: inset 0 -4px 0 rgba(120, 80, 40, 0.25), 0 8px 18px rgba(0, 0, 0, 0.4);
  color: #3a1d0c;
}
.die b { font-family: var(--display); font-size: 26px; font-weight: 800; line-height: 1; }
.die small { font-size: 9.5px; font-weight: 800; opacity: 0.55; }
.die.d6 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); align-content: stretch; gap: 2px; padding: 9px; }
.die.d6 i { width: 10px; height: 10px; border-radius: 50%; }
.die.d6 i.on { background: #3a1d0c; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5); }
.die.rolling { animation: die-roll 0.3s infinite linear; }
@keyframes die-roll {
  25% { transform: rotate(14deg) translateY(-8px); }
  50% { transform: rotate(-6deg) translateY(2px); }
  75% { transform: rotate(-16deg) translateY(-6px); }
}

/* Straws and spun lists: a drum like the ones by the match, slowing onto the one drawn. */
.reel {
  position: relative;
  width: min(100%, 260px);
  height: 132px;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.25);
}
.reel::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(rgba(22, 12, 10, 0.95), transparent 34%, transparent 66%, rgba(22, 12, 10, 0.95));
}
.reel-band {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid hsl(var(--hue) 90% 66% / 0.5);
  background: hsl(var(--hue) 90% 60% / 0.14);
}
.reel-strip { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.reel-row {
  height: 44px;
  padding: 0 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 700;
  line-height: 44px;
  color: var(--ink-2);
}
.reel-row.on { color: hsl(var(--hue) 95% 76%); }

/* A spun list: a wheel of the choices in the flames' colors. Its pegs flick the pointer on the
   right as it slows; the drawn slice stays bright and the rest dim. */
.spin-wheel { position: relative; width: 216px; height: 216px; margin: 2px 0; }
.sw-disc { position: absolute; inset: 0; will-change: transform; }
.sw-disc svg { display: block; width: 100%; height: 100%; overflow: visible; }
.sw-rim { fill: #2a160f; stroke: #f2c25b; stroke-width: 4; }
.sw-slice { stroke: rgba(24, 12, 8, 0.6); stroke-width: 1.5; transition: opacity 0.4s; }
.sw-label {
  fill: #fff8ee;
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 750;
  text-anchor: middle;
  dominant-baseline: central;
  paint-order: stroke;
  stroke: rgba(30, 12, 6, 0.6);
  stroke-width: 3px;
  stroke-linejoin: round;
  transition: opacity 0.4s;
}
.sw-peg { fill: #fff2cf; }
.spin-wheel.landed :is(.sw-slice, .sw-label):not(.win) { opacity: 0.4; }
.sw-slice.win { stroke: #fff2cf; stroke-width: 3; }
.sw-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, #ff8a2a 55%, #8a2b08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), inset 0 0 0 2px rgba(255, 236, 170, 0.45);
}
.sw-pointer {
  position: absolute;
  right: -10px;
  top: 50%;
  width: 0;
  height: 0;
  margin-top: -12px;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-right: 26px solid #fff2cf;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55));
  transform-origin: 100% 50%;
}

/* Teams fill up a name at a time; a turn order counts down the list. */
.ts-teams { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 10px; }
.ts-team {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid hsl(var(--team) 70% 60% / 0.4);
  background: hsl(var(--team) 60% 45% / 0.12);
}
.ts-team b { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: hsl(var(--team) 85% 74%); }
.ts-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 700; color: hsl(var(--hue) 90% 80%); animation: ts-name 0.4s var(--spring) both; animation-delay: var(--d); }
.ts-order { margin: 0; padding: 0 0 0 28px; display: grid; gap: 4px; text-align: left; font-size: 17px; font-weight: 700; }
.ts-order li { color: hsl(var(--hue) 90% 80%); animation: ts-name 0.4s var(--spring) both; animation-delay: var(--d); }
.ts-order li::marker { font-family: var(--display); color: var(--ink-3); }
@keyframes ts-name { from { opacity: 0; transform: translateY(8px) scale(0.9); } }

/* Rock paper scissors: two fists shake three times and open. */
.ts-duel { display: flex; align-items: center; justify-content: center; gap: 18px; }
.duel-side { display: grid; justify-items: center; gap: 4px; min-width: 0; }
.duel-side small { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.duel-hand { display: block; font-size: 58px; line-height: 1; }
.duel-side:last-child .duel-hand { transform: scaleX(-1); }
.duel-vs { font-family: var(--display); font-size: 16px; color: var(--ink-3); }
.ts-duel.shaking .duel-hand { animation: duel-shake 0.38s 3 ease-in-out; }
.ts-duel.shaking .duel-side:last-child .duel-hand { animation-name: duel-shake-mirror; }
@keyframes duel-shake { 50% { transform: translateY(-16px) rotate(-10deg); } }
@keyframes duel-shake-mirror {
  0%, 100% { transform: scaleX(-1); }
  50% { transform: scaleX(-1) translateY(-16px) rotate(-10deg); }
}
.duel-side.won .duel-hand { filter: drop-shadow(0 0 14px rgba(255, 190, 90, 0.85)); }
.duel-side.won small { color: #ffd27a; }

.reduced .coin { animation: none; transform: rotateX(var(--end)); }
.reduced .ts-card, .reduced .ts-name, .reduced .ts-order li, .reduced .seat.picked .avatar { animation: none; }

/* ------------------------------------------------------------------ Game icons */

/* The game table's line icons (public/icons.js): they take the text color. */
.ic { flex: none; width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.table-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.table-actions .ic { width: 16px; height: 16px; }
.tw-eyes .ic { width: 18px; height: 18px; color: var(--ink-2); }

/* The keyboard's marker on a board game. */
.board .sq.kbd, .board .cell.kbd { box-shadow: inset 0 0 0 3px rgba(255, 226, 170, 0.95); }
.board .col.kbd { box-shadow: inset 0 0 0 3px rgba(255, 226, 170, 0.85); border-radius: 10px; }

/* A lost game: the board shudders. */
.board-wrap.lost { animation: board-shake 0.5s ease-in-out; }
@keyframes board-shake { 15%, 55% { translate: -7px 0; } 35%, 75% { translate: 6px 0; } }

/* Sound on or off, for every game and the whole app. */
.table-sound {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 170, 100, 0.3);
  background: rgba(20, 10, 8, 0.6);
  color: #ffcf9a;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, transform 0.2s var(--spring);
}
.table-sound .ic { width: 19px; height: 19px; }
.table-sound[aria-pressed='false'] { color: var(--ink-3); border-color: var(--line); }
.table-sound:active { transform: scale(0.9); }

/* ------------------------------------------------------------------ Lantern Rally */

.gk-race, .gp-race { --art: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='17' r='12' fill='%23ffb547' opacity='.2'/%3E%3Cpath d='M16 5.5h8M20 5.5v3.5' stroke='%23f3e2c6' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M14 9.5h12l1.5 4h-15z' fill='%23f3e2c6'/%3E%3Cpath d='M14 13.5h12l-1 11H15z' fill='%23ff7a3a'/%3E%3Cpath d='M20 15.8c1.6 1.8 1.8 3.4 0 5.4-1.8-2-1.6-3.6 0-5.4z' fill='%23ffe9b0'/%3E%3Cpath d='M13 24.5h14v3H13z' fill='%23f3e2c6'/%3E%3Cpath d='M6 33h4v3H6zM14 33h4v3h-4zM22 33h4v3h-4zM30 33h4v3h-4zM10 30h4v3h-4zM18 30h4v3h-4zM26 30h4v3h-4z' fill='%23f3e2c6' opacity='.55'/%3E%3C/svg%3E"); }
.gk-race .gr-icon, .gp-race .gp-art { background-image: var(--art), linear-gradient(145deg, #3a2419, #1d120e); }

.table[data-kind='race'] .table-main { justify-content: flex-start; }
.table[data-kind='race'] .board-wrap { aspect-ratio: 4 / 5; width: min(100%, calc((100svh - 340px) * 0.8), 560px); min-width: 240px; }
.board.race { border-radius: 14px; overflow: hidden; touch-action: none; background: #0b130d; box-shadow: 0 0 0 5px #2c1a10, 0 0 0 6px rgba(255, 210, 160, 0.16), 0 26px 50px rgba(0, 0, 0, 0.6); }
.race-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; }

/* The HUD over the board: place, lap and time; the map; speed and boost. */
.rc-top { position: absolute; left: 8px; top: 8px; right: 124px; display: flex; flex-wrap: wrap; gap: 5px; pointer-events: none; }
.rc-chip {
  display: flex;
  align-items: baseline;
  gap: 3px;
  padding: 4px 9px 4px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 178, 0.16);
  background: rgba(12, 8, 6, 0.66);
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
}
.rc-chip .ic { align-self: center; width: 15px; height: 15px; margin-right: 2px; color: var(--ember-hot); }
.rc-chip b { font-family: var(--display); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rc-chip small { color: var(--ink-3); font-size: 11.5px; }
.rc-chip small:empty { display: none; }
.rc-map { position: absolute; right: 8px; top: 8px; width: 108px; height: 72px; border-radius: 10px; border: 1px solid rgba(255, 214, 178, 0.14); background: rgba(8, 6, 10, 0.6); pointer-events: none; }
.rc-dash {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  justify-items: center;
  width: 112px;
  padding: 6px 8px 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 214, 178, 0.14);
  background: rgba(12, 8, 6, 0.66);
  pointer-events: none;
  transition: box-shadow 0.25s;
}
.rc-dash.boosting { box-shadow: 0 0 22px rgba(255, 140, 40, 0.55); }
.rc-gauge { width: 96px; height: 60px; overflow: visible; }
.rc-gauge path { fill: none; stroke-width: 8; stroke-linecap: round; }
.rc-gauge-bed { stroke: rgba(255, 236, 214, 0.13); }
.rc-gauge-fill { stroke: var(--ember-hot); stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 0.12s linear, stroke 0.2s; }
.rc-dash.boosting .rc-gauge-fill { stroke: #ff6a1a; }
.rc-kmh { margin-top: -30px; font-family: var(--display); font-size: 24px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.rc-unit { font-size: 10px; color: var(--ink-3); }
.rc-meter { position: relative; width: 100%; height: 12px; margin-top: 6px; border-radius: 6px; overflow: hidden; background: rgba(255, 255, 255, 0.08); }
.rc-meter i { position: absolute; inset: 0; background: linear-gradient(90deg, #ff6a1a, #ffd36b); transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.15s; }
.rc-meter .ic { position: absolute; right: 3px; top: 0; width: 12px; height: 12px; color: #fff4e0; stroke-width: 2.4; }
.rc-meter.full { box-shadow: 0 0 12px rgba(255, 180, 60, 0.75); animation: rc-ready 1.2s infinite ease-in-out; }
@keyframes rc-ready { 50% { box-shadow: 0 0 2px rgba(255, 180, 60, 0.3); } }

/* Words across the board: the count, laps, wrong way, the finish. */
.rc-banner {
  position: absolute;
  left: 50%;
  top: 36%;
  translate: -50% -50%;
  max-width: 92%;
  font-family: var(--display);
  font-size: clamp(28px, 8vw, 46px);
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  color: #fff4e4;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45), 0 0 26px rgba(255, 150, 60, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.rc-banner.show { opacity: 1; animation: rc-pop 0.5s var(--spring); }
.rc-banner[data-kind='count'] { font-size: clamp(64px, 20vw, 120px); }
.rc-banner[data-kind='go'] { font-size: clamp(56px, 17vw, 104px); color: #ffd36b; }
.rc-banner[data-kind='final'] { color: #ffb547; }
.rc-banner[data-kind='wrong'] { color: #ff6a5a; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), 0 0 24px rgba(255, 60, 40, 0.7); }
.rc-banner[data-kind='wrong'].show { animation: rc-pulse 0.6s infinite alternate ease-in-out; }
.rc-banner[data-kind='fin'] { color: #ffe08a; }
@keyframes rc-pop { from { opacity: 0; transform: scale(1.6); } }
@keyframes rc-pulse { to { transform: scale(1.08); } }

/* The results, over the board at the end. */
.rc-results {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: min(88%, 380px);
  padding: 12px 14px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 214, 178, 0.2);
  background: rgba(16, 10, 8, 0.9);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  animation: rise-in 0.5s var(--ease) both;
}
.rc-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-family: var(--display); font-size: 20px; font-weight: 800; }
.rc-head .ic { width: 20px; height: 20px; color: var(--ember-hot); }
.rc-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.rc-list li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: hsl(var(--hue) 60% 40% / 0.1);
  animation: rise-in 0.4s var(--ease) both;
}
.rc-list li:nth-child(2) { animation-delay: 0.08s; }
.rc-list li:nth-child(3) { animation-delay: 0.16s; }
.rc-list li:nth-child(4) { animation-delay: 0.24s; }
.rc-list li.me { background: hsl(var(--hue) 70% 45% / 0.24); box-shadow: inset 0 0 0 1px hsl(var(--hue) 90% 65% / 0.5); }
.rc-place { display: grid; place-items: center; font-family: var(--display); font-size: 17px; color: var(--ink-2); }
.rc-place .ic { width: 19px; height: 19px; color: #ffd36b; }
.rc-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: hsl(var(--hue) 95% 80%); }
.rc-bot { margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); font-size: 10.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.rc-t { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }
.rc-best { grid-column: 2 / -1; font-size: 11.5px; color: var(--ink-3); }
.rc-best:empty { display: none; }

/* A wheel to slide a thumb along, and the pedals. */
.rc-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px 0; user-select: none; -webkit-user-select: none; touch-action: none; }
.rc-wheel {
  position: relative;
  flex: 1 1 auto;
  max-width: 220px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-radius: 39px;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02) 50%, rgba(255, 255, 255, 0.07));
  color: #ffd9a8;
  touch-action: none;
}
.rc-wheel > .ic { width: 26px; height: 26px; opacity: 0.55; }
.rc-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ffe2b8, #c98a4e 70%);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
  transition: transform 0.18s var(--spring);
}
.rc-wheel.on .rc-knob { transition: none; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5), 0 0 18px rgba(255, 190, 110, 0.5); }
.rc-feet { flex: none; display: flex; align-items: flex-end; gap: 8px; }
.rc-pedal {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  width: 62px;
  height: 74px;
  border-radius: 16px;
  border: 1px solid rgba(255, 220, 190, 0.3);
  color: #fff3e2;
  font-size: 11px;
  font-weight: 800;
  touch-action: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s var(--spring), filter 0.12s;
}
.rc-pedal .ic { width: 26px; height: 26px; stroke-width: 2.4; }
.rc-gas { height: 92px; background: radial-gradient(circle at 40% 30%, #74d690, #1d6f39 78%); }
.rc-brake { background: radial-gradient(circle at 40% 30%, #ff8d70, #9c2416 78%); }
.rc-boost { background: radial-gradient(circle at 40% 30%, #ffd36b, #cf5d0c 78%); color: #2a1206; }
.rc-pedal.on { transform: scale(0.92); filter: brightness(1.18); }
/* Your item: a round button on the board, glowing in the item's color; it shakes while the box
   rolls. */
.rc-item {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 214, 160, 0.3);
  background: radial-gradient(circle at 40% 32%, rgba(70, 44, 24, 0.92), rgba(18, 11, 8, 0.92) 75%);
  color: #fff3e0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  transition: transform 0.12s var(--spring), box-shadow 0.2s, border-color 0.2s;
}
.rc-item:disabled { cursor: default; }
.rc-item-face { display: grid; place-items: center; width: 34px; height: 34px; }
.rc-item-face .ic { width: 32px; height: 32px; stroke-width: 2.2; }
.rc-item[data-item='spark'] { border-color: #ffd36b; color: #ffe9a8; box-shadow: 0 0 18px rgba(255, 200, 90, 0.55), 0 6px 18px rgba(0, 0, 0, 0.5); }
.rc-item[data-item='smoke'] { border-color: #c9c2d6; color: #ece6f6; box-shadow: 0 0 16px rgba(200, 194, 214, 0.45), 0 6px 18px rgba(0, 0, 0, 0.5); }
.rc-item[data-item='oil'] { border-color: #8fe0c8; color: #c6fff0; box-shadow: 0 0 16px rgba(120, 220, 190, 0.45), 0 6px 18px rgba(0, 0, 0, 0.5); }
.rc-item:not(:disabled):active { transform: scale(0.9); }
.rc-item.rolling .rc-item-face { animation: rc-roll 0.18s linear infinite; }
.rc-item-key { position: absolute; right: -2px; bottom: -2px; min-width: 18px; padding: 1px 4px; border-radius: 6px; border: 1px solid rgba(255, 214, 178, 0.3); background: rgba(12, 8, 6, 0.9); font-size: 10.5px; font-weight: 800; color: var(--ink-2); }
@keyframes rc-roll { 50% { transform: translateY(-3px) scale(1.08); } }
.rc-banner[data-kind='track'] { font-style: italic; font-size: clamp(26px, 7vw, 40px); color: #ffe0b0; }
.rc-ghost { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 12.5px; color: #a8dcff; }
.rc-ghost .ic { flex: none; width: 16px; height: 16px; }
.rc-hint { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; font-size: 12.5px; color: var(--ink-3); text-align: center; }
.rc-hint .ic { width: 20px; height: 20px; }

@media (max-width: 380px) {
  .rc-pedal { width: 54px; }
  .rc-wheel { height: 70px; }
  .rc-dash { width: 96px; }
  .rc-gauge { width: 82px; height: 52px; }
}
@media (min-width: 900px) and (min-height: 540px) {
  .table[data-kind='race'] .table-main { width: min(100%, 1040px); }
  .table[data-kind='race'] .board-wrap { aspect-ratio: 16 / 10; width: min(100%, calc((100svh - 300px) * 1.6), 1000px); }
  .rc-map { width: 150px; height: 96px; }
  .rc-top { right: 168px; }
}
.reduced .rc-banner.show, .reduced .rc-banner[data-kind='wrong'].show, .reduced .rc-meter.full, .reduced .rc-item.rolling .rc-item-face, .reduced .rc-results, .reduced .rc-list li { animation: none; }
