/* yippee-tracker.com — dark gray, shadcn-ish, one screen, no scroll */

:root {
  --bg:        #1c1c1f;
  --elevated:  #232327;
  --card:      #26262b;
  --border:    #34343a;
  --border-hi: #45454d;
  --fg:        #f2f2f3;
  --muted:     #a1a1aa;
  --dim:       #71717a;
  --radius:    0.625rem;
  --pad:       clamp(.6rem, 2vw, 1.25rem);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* faint grid so the gray does not read as flat paint */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(to right, #ffffff06 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(to bottom, #ffffff06 1px, transparent 1px) 0 0 / 56px 56px,
    radial-gradient(120% 90% at 50% 0%, #ffffff09, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* -- the gate -------------------------------------------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: var(--pad);
  background: var(--bg);
  transition: opacity .5s ease;
}
.gate.gone { opacity: 0; pointer-events: none; }

.gate-card {
  display: grid;
  justify-items: center;
  gap: .9rem;
  width: min(30rem, 100%);
  text-align: center;
}
/* `display` beats the hidden attribute, so say it again louder */
.gate-card[hidden] { display: none; }

.gate-title {
  font-size: clamp(1.9rem, 7vw, 3rem);
  font-weight: 600;
  letter-spacing: -.035em;
  animation: rise .5s cubic-bezier(.2,.7,.3,1) both;
}
.gate-title::after {
  content: "_";
  color: var(--dim);
  animation: blink 1.1s steps(1) infinite;
}

.gate-hint {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  animation: rise .5s cubic-bezier(.2,.7,.3,1) .1s both;
}

/* three doors, one card */
.modes {
  display: inline-flex;
  gap: .15rem;
  padding: .2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  animation: rise .5s cubic-bezier(.2,.7,.3,1) .16s both;
}
.mode {
  font: inherit;
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .03em;
  color: var(--dim);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: .3rem .75rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: color .15s ease, background .15s ease;
}
.mode:hover { color: var(--fg); }
.mode.on { color: #18181b; background: var(--fg); }
.mode:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

.join {
  display: grid;
  gap: .4rem;
  width: min(21rem, 100%);
  margin-top: .2rem;
  animation: rise .5s cubic-bezier(.2,.7,.3,1) .22s both;
}
.join.bad { animation: shake .38s cubic-bezier(.36,.07,.19,.97); }

.field {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--fg);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .55rem 1rem;
  transition: border-color .18s ease, background .18s ease;
}
.field::placeholder { color: var(--dim); }
.field:focus { outline: none; border-color: var(--border-hi); background: var(--elevated); }
.field[hidden] { display: none; }
.field.mono { font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }
.join.bad .field { border-color: var(--muted); }

.join-go {
  flex: 0 0 auto;
  user-select: none;
  -webkit-user-select: none;
  font: inherit;
  font-size: .85rem;
  color: #18181b;
  background: var(--fg);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .6rem 1.2rem;
  cursor: pointer;
  transition: transform .18s ease, opacity .18s ease;
}
.join-go:hover { transform: translateY(-1px); }
.join-go:disabled { color: var(--dim); background: transparent; border-color: var(--border); cursor: default; transform: none; }
.join-go:focus-visible, .field:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

.join-say {
  min-height: 1.2em;
  max-width: min(26rem, 100%);
  font-family: var(--mono);
  font-size: .68rem;
  line-height: 1.5;
  color: var(--muted);
}

.link {
  font: inherit;
  font-family: var(--mono);
  font-size: .66rem;
  color: var(--dim);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--border-hi);
  text-underline-offset: 3px;
  transition: color .15s ease;
}
.link:hover { color: var(--fg); }
.link:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.join-back[hidden] { display: none; }

/* -- the vault ------------------------------------------- */
/* the token is shown here once, and then never again by anyone */

.vault[hidden] { display: none; }
.vault { gap: .75rem; }

.vault-token {
  display: block;
  width: 100%;
  padding: .8rem .6rem;
  font-family: var(--mono);
  font-size: clamp(.72rem, 2.6vw, .95rem);
  line-height: 1.6;
  letter-spacing: .12em;
  color: var(--fg);
  overflow-wrap: anywhere;
  background:
    repeating-linear-gradient(114deg, #ffffff08 0 2px, transparent 2px 9px),
    var(--card);
  border: 1px dashed var(--border-hi);
  border-radius: .5rem;
  user-select: all;
  -webkit-user-select: all;
}
.vault-token:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

.vault-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem .9rem;
  font-family: var(--mono);
  font-size: .66rem;
  color: var(--dim);
}
.vault-ok { display: flex; align-items: center; gap: .4rem; cursor: pointer; user-select: none; }
.vault-ok input { accent-color: var(--fg); width: .85rem; height: .85rem; cursor: pointer; }
.vault-ok:hover { color: var(--muted); }

.vault-note {
  max-width: 26rem;
  font-family: var(--mono);
  font-size: .62rem;
  line-height: 1.7;
  color: var(--dim);
}
.vault .join-go { width: min(21rem, 100%); }

.gate-stat {
  font-family: var(--mono);
  font-size: .68rem;
  line-height: 1.7;
  color: var(--dim);
  animation: rise .5s cubic-bezier(.2,.7,.3,1) .3s both;
}
.gate-stat b { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.gate-king { display: block; }

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

.page {
  position: relative;
  z-index: 1;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: .5rem;
  padding:
    calc(var(--pad) + env(safe-area-inset-top))
    calc(var(--pad) + env(safe-area-inset-right))
    calc(var(--pad) + env(safe-area-inset-bottom))
    calc(var(--pad) + env(safe-area-inset-left));
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  font-family: var(--mono);
  font-size: .72rem;
}
.foot { color: var(--dim); }
.dim { color: var(--dim); }
.credit { flex: 0 0 auto; white-space: nowrap; }
.credit s { text-decoration-color: var(--border-hi); }

#timer { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* the yipee bureau: a number nobody asked for, kept forever */
.yipee {
  flex: 0 1 auto;
  display: flex;
  white-space: nowrap;
  align-items: baseline;
  gap: .3rem;
  min-width: 0;
}
.yipee b {
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  transition: color .2s ease;
}
.yipee.hot b { color: var(--fg); }
.yipee.bump b { animation: pop .34s cubic-bezier(.2, .8, .3, 1); }
.yipee-note { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.brand { display: flex; align-items: baseline; letter-spacing: .01em; color: var(--muted); cursor: default; }
.brand span { transition: transform .25s cubic-bezier(.2,.7,.3,1), color .25s ease; }
.brand:hover span { color: var(--fg); transform: translateY(-3px); }

.bar-right { display: flex; align-items: center; gap: .5rem; }

.badge {
  padding: .2rem .5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff08;
  color: var(--muted);
  white-space: nowrap;
}
.badge b { font-weight: 500; color: var(--fg); font-variant-numeric: tabular-nums; }

.shop-open { display: inline-flex; align-items: center; gap: .35rem; }
.shop-open b {
  font-weight: 500;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.shop-open:hover { color: var(--fg); border-color: var(--border-hi); background: #ffffff0d; }

.here-badge { display: inline-flex; align-items: center; gap: .3rem; }
.here-badge .dot {
  width: .38rem;
  height: .38rem;
  border-radius: 50%;
  background: #4ade80;
  animation: breathe 3s ease-in-out infinite;
}

.ghost {
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  font: inherit;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .2rem .55rem;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.ghost:hover { color: var(--fg); border-color: var(--border-hi); background: #ffffff08; }
.ghost:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

/* -- stage ----------------------------------------------- */

.stage {
  display: grid;
  grid-template-columns: minmax(0, 17rem) minmax(0, 1fr) minmax(0, 17rem);
  align-items: stretch;
  gap: clamp(.6rem, 2vw, 1.5rem);
  min-height: 0;
}

.panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: .5rem;
  min-height: 0;
  min-width: 0;
  padding: .7rem;
  background: color-mix(in srgb, var(--elevated) 70%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
}

.pip { display: inline-flex; align-items: center; gap: .32rem; }
.pip::before {
  content: "";
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: #4ade80;
  animation: breathe 3s ease-in-out infinite;
}
.pip.off::before { background: var(--dim); animation: none; }

/* -- the ticker ------------------------------------------ */
/* bottom left, five seconds a line, everything the house says out loud */

.ticker {
  position: fixed;
  left: var(--pad);
  bottom: 3.4rem;        /* clear of the chat bar and the composer */
  z-index: 62;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: .25rem;
  width: min(17rem, calc(100vw - var(--pad) * 2));
  max-width: 17rem;
  pointer-events: none;
}

.tick {
  padding: .32rem .5rem;
  font-family: var(--mono);
  font-size: .62rem;
  line-height: 1.4;
  color: var(--muted);
  background: color-mix(in srgb, var(--elevated) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-left: 2px solid var(--border-hi);
  border-radius: .4rem;
  overflow-wrap: anywhere;
  animation: slidein .28s cubic-bezier(.2,.8,.3,1) both;
}
.tick.out { opacity: 0; transform: translateX(-10px); transition: opacity .28s ease, transform .28s ease; }
.tick.bad { color: #f87171; border-left-color: #f87171; }
.tick.good { color: #facc15; border-left-color: #facc15; }

@keyframes slidein {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: none; }
}

/* -- the machine in the corner --------------------------- */

.slot { display: grid; gap: .35rem; margin-bottom: .4rem; }

.pull {
  font: inherit;
  font-family: var(--mono);
  font-size: .72rem;
  color: #1c1c1f;
  background: #facc15;
  border: 1px solid transparent;
  border-radius: .5rem;
  padding: .5rem;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}
.pull b { font-weight: 600; font-variant-numeric: tabular-nums; }
.pull:hover:not(:disabled) { transform: translateY(-1px); }
.pull:disabled { color: var(--dim); background: transparent; border-color: var(--border); cursor: default; }
.pull.going { transform: translateY(2px); opacity: .8; }

.slot-said { font-size: .66rem; line-height: 1.45; color: var(--muted); min-height: 1.4em; }
.slot-said.good { color: #facc15; }
.slot-said.bad { color: var(--dim); }

.slot-odds {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: .15rem .5rem;
  list-style: none;
}
.odd {
  display: flex;
  gap: .35rem;
  font-family: var(--mono);
  font-size: .58rem;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
}
.odd b { color: var(--muted); font-variant-numeric: tabular-nums; }
.odd span { overflow: hidden; text-overflow: ellipsis; }
.odd.good b { color: #facc15; }
.odd.good span { color: var(--muted); }

/* -- the board ------------------------------------------- */

.board {
  list-style: none;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
  mask-image: linear-gradient(to bottom, #000 calc(100% - 1.1rem), transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.1rem), transparent);
}
.board::-webkit-scrollbar { width: 5px; }
.board::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 999px; }
.board::-webkit-scrollbar-track { background: transparent; }

.row {
  position: relative;
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .5rem;
  padding: .3rem .45rem;
  border-radius: .4rem;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted);
  isolation: isolate;
}
/* how much of the leader's pile this one is, drawn behind the row */
.row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: var(--w, 0%);
  background: #ffffff09;
  border-radius: .4rem;
  transition: width .6s cubic-bezier(.2,.8,.3,1);
}
.row .rank { color: var(--dim); font-variant-numeric: tabular-nums; }
/* the dot always takes its room, so nobody's name jumps when they connect */
.row .who::before {
  content: "";
  display: inline-block;
  width: .34rem;
  height: .34rem;
  margin-right: .35rem;
  vertical-align: middle;
  border-radius: 50%;
  background: transparent;
  transition: background .35s ease, box-shadow .35s ease;
}
.row.on .who::before { background: #4ade80; box-shadow: 0 0 0 2px #4ade8021; }
/* something of theirs is running whether they are here or not */
.row.starred .who::after {
  content: var(--stars, "");
  margin-left: .3rem;
  font-size: .8em;
  color: #facc15b3;
}
.row.auto .n::after {
  content: "↻";
  margin-left: .3rem;
  color: var(--dim);
  font-size: .9em;
}
.row .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .n { color: var(--fg); font-variant-numeric: tabular-nums; }

.row.me { color: var(--fg); }
.row.me::before { background: #ffffff16; }
.row.me .rank { color: var(--muted); }
.row.crown .rank { color: var(--fg); }
.row.gain .n { animation: pop .4s cubic-bezier(.2,.8,.3,1); }

/* -- the arena ------------------------------------------- */

.arena {
  display: grid;
  /* tally · race · surge · the drawing · the line under it. the two banners are
     hidden most of the time and an auto row collapses to nothing when they are */
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  justify-items: center;
  gap: .4rem;
  min-height: 0;
  min-width: 0;
}

.tally { display: grid; justify-items: center; gap: .12rem; }
.tally-n {
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  transition: transform .12s cubic-bezier(.2,.8,.3,1);
}
.tally-n.hit { transform: scale(1.07); }
.tally-tag { font-family: var(--mono); font-size: .68rem; color: var(--dim); }
.tally-tag b { font-weight: 500; color: var(--muted); }
.tally-rank {
  margin-top: .18rem;
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim);
  padding: .12rem .5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color .3s ease, border-color .3s ease;
}
.tally-rank.top { color: var(--fg); border-color: var(--border-hi); }

.face-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  place-self: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

#face {
  font-family: var(--mono);
  font-size: 20px;
  line-height: 1.05;
  white-space: pre;
  width: max-content;
  color: var(--fg);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform .09s cubic-bezier(.2,.8,.3,1);
}
#face:focus-visible { outline: 2px solid var(--border-hi); outline-offset: 10px; border-radius: .4rem; }
#face.squish { transform: scale(.965); }

/* every cell gets the same box (--cell is measured in JS from the widest glyph
   in the art) so the drawing sits on a real grid; only inked cells animate */
#face b,
#face i {
  display: inline-block;
  width: var(--cell, 1ch);
  font-style: normal;
  font-weight: 400;
  text-align: center;
}
#face b { opacity: 0; }
#face.go b {
  animation:
    dot-in .5s var(--d) both,
    dot-wave 3.6s calc(var(--d) + 620ms) infinite;
}

@keyframes dot-in {
  from { opacity: 0; filter: blur(4px); }
  to   { opacity: 1; filter: blur(0); }
}
@keyframes dot-wave {
  0%, 100% { opacity: .62; }
  50%      { opacity: 1; }
}

.poke[hidden] { display: none; }
.poke {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--dim);
  text-align: center;
  transition: color .2s ease;
}
.poke.hot { color: var(--muted); }

/* the +1s that fly off the top of the yippee */
.pops { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.pops span {
  position: absolute;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--fg);
  white-space: nowrap;
  will-change: transform, opacity;
  animation: fly .9s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes fly {
  from { opacity: 0; transform: translate(-50%, 0) scale(.8); }
  22%  { opacity: 1; transform: translate(-50%, -14px) scale(1); }
  to   { opacity: 0; transform: translate(-50%, -90px) scale(1); }
}

/* -- the front line -------------------------------------- */

.front {
  display: flex;
  height: .55rem;
  overflow: hidden;
  border-radius: 999px;
  background: #ffffff08;
}
.front span {
  width: var(--w, 0%);
  background: var(--c, #ffffff30);
  transition: width .7s cubic-bezier(.2,.8,.3,1);
}
.front span + span { box-shadow: -1px 0 0 var(--elevated); }

.front-key {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .18rem .6rem;
  font-family: var(--mono);
  font-size: .6rem;
  color: var(--dim);
}
.front-key li { display: flex; align-items: center; gap: .3rem; min-width: 0; max-width: 100%; }
.front-key i {
  flex: 0 0 auto;
  width: .45rem;
  height: .45rem;
  border-radius: 2px;
  background: var(--c, #ffffff30);
}
.front-key span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.front-key li.me { color: var(--fg); }

.feed {
  list-style: none;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: .18rem;
  font-family: var(--mono);
  font-size: .66rem;
  color: var(--dim);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.feed li {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  min-width: 0;
  white-space: nowrap;
  animation: pop .3s cubic-bezier(.2,.8,.3,1) both;
}
.feed li b { min-width: 0; font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.feed li em { flex: 0 0 auto; font-style: normal; font-variant-numeric: tabular-nums; }
.feed li.me b { color: var(--fg); }

/* the panels get their own row so the middle column can breathe */
.war { grid-template-rows: auto auto auto minmax(0, 1fr); }

/* -- entrance choreography ------------------------------- */

.page > *, .r1, .r2, .r3 { opacity: 0; }
.page.in > * { animation: rise .55s cubic-bezier(.2,.7,.3,1) both; }
.page.in .r1 { animation: rise .55s cubic-bezier(.2,.7,.3,1) .12s both; }
.page.in .r2 { animation: rise .55s cubic-bezier(.2,.7,.3,1) .24s both; }
.page.in .r3 { animation: rise .55s cubic-bezier(.2,.7,.3,1) .36s both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes bob   { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-3px); opacity: .9; } }

/* -- the shop -------------------------------------------- */

.tally-gear {
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .04em;
  color: var(--dim);
}
.tally-gear[hidden] { display: none; }
.tally-gear.hot { color: #facc15; }

/* the mark list, once you can see what they are sitting on */
.mark-pile {
  font-family: var(--mono);
  font-size: .66rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.shop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  justify-content: flex-end;
}
.shop[hidden] { display: none; }

.shop-back {
  position: absolute;
  inset: 0;
  background: #0000008c;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fade .25s ease both;
}

.shop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: min(24rem, 100%);
  height: 100%;
  padding: var(--pad);
  padding-right: calc(var(--pad) + env(safe-area-inset-right));
  overflow: hidden;
  background: var(--elevated);
  border-left: 1px solid var(--border-hi);
  box-shadow: -24px 0 60px -20px #000000a6;
  animation: drawer .34s cubic-bezier(.2, .8, .3, 1) both;
}
.shop.bad .shop-card { animation: shake .38s cubic-bezier(.36,.07,.19,.97); }

.shop-head { display: flex; align-items: center; gap: .5rem; }
.shop-head h2 {
  margin-right: auto;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.02em;
}

.shop-close {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: .5rem;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.shop-close:hover { color: var(--fg); border-color: var(--border-hi); }
.shop-close:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.shop-close svg { width: .8rem; height: .8rem; }
.shop-close svg path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

.shop-wallet {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--dim);
}
.shop-wallet b { color: var(--fg); font-variant-numeric: tabular-nums; }
.shop-gear { color: var(--muted); }

/* one scroller for the whole drawer, so the floors read as one list */
.shop-scroll {
  flex: 1 1 auto;
  min-height: 0;
  margin: .2rem 0;
  padding-right: .2rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
}
.shop-scroll::-webkit-scrollbar { width: 5px; }
.shop-scroll::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 999px; }

.shop-list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  list-style: none;
}

.shelf {
  margin: .55rem 0 -.05rem;
  font-family: var(--mono);
  font-size: .58rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
}
.shelf:first-child { margin-top: 0; }

.shop-head-2 {
  margin: 1rem 0 .35rem;
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
}

/* one to a line: a name with room to be a name, and a line about it with room
   to be a line. two columns of this was a wall of syllables */
.badges {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  list-style: none;
}
/* one to a line, and it wraps: the pills in the header are .badge and they do
   not wrap, which is right for a pill and wrong for a sentence. this is a deed */
.deed {
  display: grid;
  grid-template-columns: minmax(6rem, 8.5rem) minmax(0, 1fr);
  align-items: baseline;
  gap: .1rem .6rem;
  padding: .4rem .55rem;
  overflow: hidden;
  white-space: normal;
  border: 1px solid var(--border);
  border-radius: .45rem;
  background: #ffffff05;
  opacity: .5;
  transition: opacity .2s ease, border-color .2s ease, background .2s ease;
}
.deed b {
  min-width: 0;
  font-size: .72rem;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}
.deed span {
  min-width: 0;
  font-size: .64rem;
  line-height: 1.45;
  color: var(--dim);
  white-space: normal;
  overflow-wrap: anywhere;
}
.deed.got { opacity: 1; border-color: var(--border-hi); background: #ffffff0d; }
.deed.got b { color: var(--fg); }
.deed.got span { color: var(--muted); }

/* a narrow drawer stacks the two halves instead of squeezing them */
@media (max-width: 620px) {
  .deed { grid-template-columns: minmax(0, 1fr); }
}

.burn-go {
  width: 100%;
  font: inherit;
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--dim);
  background: transparent;
  border: 1px dashed var(--border-hi);
  border-radius: .5rem;
  padding: .5rem;
  margin-top: .3rem;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.burn-go:not(:disabled) { color: #facc15; border-color: #facc1573; }
.burn-go:not(:disabled):hover { background: #facc150f; }
.burn-go.armed { color: #1c1c1f; background: #facc15; border-style: solid; border-color: #facc15; }
.burn-go:disabled { cursor: default; }

/* burning everything is a moment, not a light show. washing the drawer's
   background was the entire screen on anything narrow, where the drawer is the
   screen — so the edge takes it, and the number does the rest */
.shop.burnt .shop-card { animation: singe 1s ease both; }
@keyframes singe {
  0% {
    border-color: #facc15;
    box-shadow: inset 0 0 40px -14px #facc15aa, -24px 0 60px -20px #facc1566;
  }
  70% { border-color: #facc1573; }
  100% {
    border-color: var(--border-hi);
    box-shadow: -24px 0 60px -20px #000000a6;
  }
}

/* the tally, for the second and a bit after everything it counted went away */
.tally-n.starred { animation: goldpulse 1.2s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes goldpulse {
  0% { color: #facc15; transform: scale(1.1); text-shadow: 0 0 26px #facc1566; }
  100% { color: inherit; transform: none; text-shadow: none; }
}

/* the day you came back for */
.daily-go { color: #facc15; border-color: #facc1559; }
.daily-go:hover { background: #facc1514; border-color: #facc15; }
.daily-go[hidden] { display: none; }
.daily-go b { color: inherit; font-weight: 500; }

.buy {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .65rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .6rem;
  transition: border-color .18s ease, opacity .18s ease;
}
.buy.afford { border-color: var(--border-hi); }
.buy.maxed { opacity: .5; }
.buy.got { animation: pop .4s cubic-bezier(.2,.8,.3,1); border-color: var(--fg); }
.buy.wait { opacity: .7; }

.buy-what { display: grid; gap: .12rem; min-width: 0; margin-right: auto; }
.buy-name { font-size: .82rem; font-weight: 500; }
.buy.own .buy-name { color: var(--fg); }
.buy-blurb { font-size: .68rem; line-height: 1.4; color: var(--dim); }
.buy-has {
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .03em;
  color: var(--muted);
}

.buy-go {
  flex: 0 0 auto;
  font: inherit;
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .35rem .7rem;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: transform .18s ease, color .18s ease, background .18s ease, border-color .18s ease;
}
.buy.afford .buy-go { color: #18181b; background: var(--fg); border-color: transparent; }
.buy.afford .buy-go:hover { transform: translateY(-1px); }
.buy-go:disabled { cursor: default; transform: none; }
.buy-go:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

.shop-note { font-size: .64rem; line-height: 1.5; color: var(--dim); }

@keyframes drawer {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* -- the board ------------------------------------------- */
/* three things worth doing next, and how far along each one is */

.jobs {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-bottom: .5rem;
  list-style: none;
}

.job {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: .1rem .5rem;
  padding: .42rem .55rem;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .45rem;
}
.job.none { color: var(--dim); border-style: dashed; }

.job b {
  min-width: 0;
  font-size: .72rem;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}
.job-how {
  font-family: var(--mono);
  font-size: .6rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.job-pays {
  font-family: var(--mono);
  font-size: .64rem;
  color: #facc15;
  white-space: nowrap;
}

.job-swap {
  position: absolute;
  right: .3rem;
  bottom: .2rem;
  font: inherit;
  font-size: .6rem;
  line-height: 1;
  color: var(--dim);
  background: transparent;
  border: 0;
  padding: .15rem .25rem;
  cursor: pointer;
}
.job-swap:hover { color: var(--fg); }

/* how far along, drawn behind the row */
.job-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: var(--at, 0%);
  background: #facc1573;
  transition: width .4s cubic-bezier(.2,.8,.3,1);
}

/* -- the surge ------------------------------------------- */
/* the only thing here that is worth more because other people are in */

.surge {
  display: flex;
  align-self: center;
  width: fit-content;
  max-width: 100%;
  height: fit-content;
  align-items: center;
  gap: .35rem;
  margin: 0;
  padding: .18rem .5rem;
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #facc15;
  background: #facc1514;
  border: 1px solid #facc1559;
  border-radius: 999px;
}
.surge[hidden] { display: none; }
.surge.in { animation: pop .35s cubic-bezier(.2,.8,.3,1) both; }
.surge b { font-size: .68rem; font-weight: 600; }
.surge i {
  font-style: normal;
  font-variant-numeric: tabular-nums;
  color: #facc15a6;
}

/* -- caught autoclicking --------------------------------- */
/* it sits in the middle, it is a card and not a curtain, it has no button and
   it does not take clicks — they go through it to the page underneath, which is
   the point: hammering the mouse cannot dismiss it */

.caught {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  padding: var(--pad);
  pointer-events: none;
}
.caught[hidden] { display: none; }

.caught-card {
  position: relative;
  width: min(15rem, calc(100vw - 3.5rem));
  max-width: 15rem;
  max-height: 60vh;
  display: grid;
  gap: .3rem;
  padding: .8rem .9rem 1rem;
  overflow: hidden;
  text-align: center;
  background: color-mix(in srgb, var(--elevated) 96%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid #f87171;
  border-radius: .8rem;
  box-shadow: 0 0 0 4px #f8717114, 0 24px 60px -18px #000000cc;
}
.caught.in .caught-card { animation: caughtin .32s cubic-bezier(.2,.8,.3,1) both; }

.caught-head {
  font-family: var(--mono);
  font-size: .56rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #f87171;
}
.caught-say {
  font-size: .82rem;
  line-height: 1.4;
  color: var(--fg);
  overflow-wrap: anywhere;
}
.caught-left {
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

/* three seconds, drawn, so nobody wonders whether it is stuck */
.caught-fuse {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: #f87171;
  transform-origin: left;
}
.caught.in .caught-fuse { animation: fuse var(--life, 10s) linear both; }

@keyframes caughtin {
  from { opacity: 0; transform: translateY(8px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

/* and the blob itself, while the button is off. the drawing is #face, not
   .face — it has only ever had the one of it */
#face.dead { opacity: .4; filter: grayscale(1); cursor: not-allowed; }
#face.dead b { animation: none; }

/* -- the race -------------------------------------------- */
/* the competitive one: two numbers and a clock, across the top of the arena */

.race {
  display: flex;
  align-self: center;
  width: fit-content;
  max-width: 100%;
  height: fit-content;
  align-items: center;
  gap: .35rem;
  margin: 0;
  padding: .18rem .5rem;
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .04em;
  white-space: nowrap;
  color: var(--dim);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  animation: pop .3s cubic-bezier(.2,.8,.3,1) both;
}
.race[hidden] { display: none; }
.race b {
  color: var(--fg);
  font-size: .68rem;
  font-variant-numeric: tabular-nums;
  max-width: 6rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.race span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race i {
  font-style: normal;
  font-variant-numeric: tabular-nums;
  padding: 0 .35rem;
  border-radius: 999px;
  background: #ffffff0f;
}
.race.won { border-color: #4ade8080; }
.race.won b:first-child { color: #4ade80; }
.race.lost { border-color: #f8717180; }
.race.lost b:last-of-type { color: #f87171; }

/* the two answers on an invitation */
.race-ask { cursor: default; }
.race-row { display: flex; gap: .3rem; margin-top: .25rem; }
.race-yes, .race-no {
  font: inherit;
  font-family: var(--mono);
  font-size: .62rem;
  padding: .2rem .5rem;
  border-radius: 999px;
  cursor: pointer;
}
.race-yes { color: #18181b; background: var(--fg); border: 1px solid transparent; }
.race-no { color: var(--dim); background: transparent; border: 1px solid var(--border); }
.race-no:hover { color: var(--fg); border-color: var(--border-hi); }

/* the stake, above the list of people */
.heist-stake {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  padding: .35rem 0 .1rem;
  font-size: .62rem;
  color: var(--dim);
}
.heist-input.short { flex: 0 0 6rem; padding: .3rem .5rem; }
.mark-go.ghosty { color: var(--fg); background: transparent; border: 1px solid var(--border-hi); }
.mark-go.ghosty:hover { background: #ffffff0f; }

/* the leaderboard's own toggle: all of it, or the last minute of it */
.when {
  font: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--dim);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.when:hover { color: var(--muted); }
.when.hot { color: #facc15; }

/* -- the closed sign ------------------------------------- */
/* it lands mid-click on everybody who does not run the place */

.closed {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: var(--pad);
  background: #0b0b0ceb;
  backdrop-filter: blur(6px) saturate(.6);
  -webkit-backdrop-filter: blur(6px) saturate(.6);
  animation: fade .3s ease both;
}
.closed[hidden] { display: none; }

.closed-card {
  display: grid;
  gap: .5rem;
  max-width: 26rem;
  text-align: center;
}
.closed-title {
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -.03em;
}
.closed-title::after {
  content: "_";
  color: var(--dim);
  animation: blink 1.1s steps(1) infinite;
}
.closed-why {
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1.6;
  color: var(--muted);
}
.closed-note { font-size: .68rem; line-height: 1.6; color: var(--dim); }

/* -- the back office ------------------------------------- */

.admin-open { color: #f87171; border-color: #f8717159; }
.admin-open:hover { background: #f871711a; border-color: #f87171; }
.admin-open[hidden] { display: none; }

.admin {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: var(--pad);
}
.admin[hidden] { display: none; }

.admin-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: min(34rem, 100%);
  max-height: 100%;
  padding: clamp(.8rem, 2.5vw, 1.1rem);
  overflow-y: auto;
  font-family: var(--mono);
  background: var(--elevated);
  border: 1px solid #f8717159;
  border-radius: .8rem;
  box-shadow: 0 30px 80px -20px #000000cc;
  animation: pop .24s cubic-bezier(.2,.8,.3,1) both;
}
.admin-card h2 { font-size: .9rem; font-weight: 500; margin-right: auto; }

.admin-row { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }

.admin-in {
  flex: 1 1 8rem;
  min-width: 0;
  font: inherit;
  font-size: .74rem;
  color: var(--fg);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .45rem;
  padding: .38rem .55rem;
}
.admin-in.short { flex: 0 0 5rem; }
.admin-in:focus { outline: none; border-color: var(--border-hi); }

.admin-go {
  flex: 0 0 auto;
  font: inherit;
  font-size: .72rem;
  color: #18181b;
  background: var(--fg);
  border: 1px solid transparent;
  border-radius: .45rem;
  padding: .38rem .7rem;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.admin-go:hover { transform: translateY(-1px); }
.admin-go.small { font-size: .64rem; padding: .22rem .5rem; }
.admin-go.danger { color: #fff; background: #b91c1c; }

.admin-said { font-size: .68rem; color: #facc15; min-height: 1em; }

.admin-people {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  max-height: 14rem;
  overflow-y: auto;
  scrollbar-width: thin;
}
.who-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .5rem;
  font-size: .72rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .4rem;
}
.who-row b { margin-right: auto; font-weight: 500; }
.who-row span { color: var(--dim); font-variant-numeric: tabular-nums; }
.who-row.on { border-color: var(--fg); }

.admin-one { display: grid; gap: .4rem; }
.admin-one[hidden] { display: none; }

/* the label at the head of a row of controls */
.admin-tag {
  flex: 0 0 3.6rem;
  font-size: .58rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
}

/* the whole row, as the table has it */
.admin-detail {
  font-family: var(--mono);
  font-size: .64rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-x: auto;
  padding: .5rem .6rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: .45rem;
}
.admin-detail::-webkit-scrollbar { height: 4px; }

.admin-card select.admin-in {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 1.4rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* -- the gold one ---------------------------------------- */
/* it lands in the same place on everybody's screen and there is one of it */

/* the tray holds one coin and nothing else, so it is the size of nothing: the
   coin positions itself against the viewport. a transparent layer over the
   whole page is still a layer over the whole page */
/* the same: the coin lands somewhere on the page, and the page is what it is
   measured against */
.gold {
  position: absolute;
  inset: 0;
  z-index: 65;
  pointer-events: none;
}
/* no containment here on purpose: containment makes an element the containing
   block for its fixed children, and the coin would then be laid out against a
   box of nothing instead of against the glass */

.gold-one {
  position: fixed;
  /* the server picks a spot in percent; this keeps the whole coin on the glass
     however narrow the glass is */
  left: clamp(3rem, var(--x, 50%), calc(100% - 3rem));
  top: clamp(3rem, var(--y, 50%), calc(100% - 3rem));
  transform: translate(-50%, -50%);
  pointer-events: auto;
  display: grid;
  justify-items: center;
  gap: .1rem;
  padding: .5rem .7rem;
  font: inherit;
  font-family: var(--mono);
  color: #1c1c1f;
  background: #facc15;
  border: 1px solid #fde047;
  border-radius: .7rem;
  box-shadow: 0 0 0 6px #facc1520, 0 14px 40px -12px #facc1580;
  cursor: pointer;
  animation:
    landed .3s cubic-bezier(.2,.8,.3,1) both,
    wobble 1.6s ease-in-out .3s infinite;
}
.gold-one.frenzy { background: #f8fafc; border-color: var(--fg); box-shadow: 0 0 0 6px #ffffff1f, 0 14px 40px -12px #ffffff66; }
.gold-one:hover { filter: brightness(1.08); }
.gold-one.hit { animation: landed .2s reverse both; }
.gold-one.lost { background: var(--card); color: var(--dim); border-color: var(--border); box-shadow: none; animation: none; }
.gold-one.out { opacity: 0; transform: translate(-50%, -50%) scale(.8); transition: opacity .28s ease, transform .28s ease; }

.gold-face { font-size: 1.4rem; line-height: 1; }
.gold-what {
  font-size: .58rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* the fuse under it, so nobody thinks it is staying */
.gold-one::after {
  content: "";
  position: absolute;
  left: .5rem;
  right: .5rem;
  bottom: .28rem;
  height: 2px;
  border-radius: 999px;
  background: #1c1c1f40;
  transform-origin: left;
  animation: fuse var(--life, 13s) linear both;
}
.gold-one.frenzy::after { background: #1c1c1f26; }
.gold-one.lost::after { display: none; }

@keyframes landed {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(-12deg); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes wobble {
  0%, 100% { transform: translate(-50%, -50%) rotate(-2deg); }
  50%      { transform: translate(-50%, -52%) rotate(2deg); }
}
@keyframes fuse { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* -- the terminal ---------------------------------------- */
/* two people, one clock. the only place on the site that is allowed to shout */

.hack-open:hover { color: var(--fg); border-color: var(--border-hi); background: #ffffff0d; }
.hack-open[hidden] { display: none; }

.heist {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: var(--pad);
}
.heist[hidden] { display: none; }

.heist-back {
  position: absolute;
  inset: 0;
  background: #000000b8;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade .2s ease both;
}

.heist-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  width: min(44rem, 100%);
  max-height: 100%;
  padding: clamp(.8rem, 2.5vw, 1.2rem);
  overflow-y: auto;
  font-family: var(--mono);
  background: var(--elevated);
  border: 1px solid var(--border-hi);
  border-radius: .8rem;
  box-shadow: 0 30px 80px -20px #000000cc;
  animation: pop .26s cubic-bezier(.2,.8,.3,1) both;
}
/* being the one broken into looks different from being the one breaking in */
.heist.defending .heist-card { border-color: #facc1573; box-shadow: 0 0 0 1px #facc1526, 0 30px 80px -20px #000000cc; }
.heist.won .heist-card { border-color: #4ade8080; }
.heist.lost .heist-card { border-color: #f8717180; }
.heist.bad .heist-card { animation: shake .38s cubic-bezier(.36,.07,.19,.97); }

.heist-head { display: flex; align-items: center; gap: .6rem; }
.heist-head b { font-size: .84rem; font-weight: 500; margin-right: auto; }
.heist-side { font-size: .66rem; color: var(--dim); }

.heist-note { font-size: .66rem; line-height: 1.5; color: var(--dim); }

/* the list of people who are in tonight */
.heist-marks { list-style: none; display: flex; flex-direction: column; gap: .3rem; }
.mark {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .4rem .6rem;
  font-size: .74rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .5rem;
}
.mark b { margin-right: auto; font-weight: 500; }
.mark.none { color: var(--dim); border-style: dashed; }

.mark-go {
  font: inherit;
  font-size: .66rem;
  color: #18181b;
  background: var(--fg);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .22rem .6rem;
  cursor: pointer;
  transition: transform .18s ease;
}
.mark-go:hover:not(:disabled) { transform: translateY(-1px); }
.mark-go:disabled { color: var(--dim); background: transparent; border-color: var(--border); cursor: default; }

/* the round */
.heist-line { display: flex; align-items: baseline; gap: .5rem; font-size: .7rem; color: var(--muted); }
.heist-round { color: var(--dim); font-variant-numeric: tabular-nums; }

.heist-bar {
  height: 3px;
  border-radius: 999px;
  background: #ffffff0f;
  overflow: hidden;
}
.heist-bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--fg);
  border-radius: 999px;
}
.heist-bar i.low { background: #f87171; }

/* what has to be typed. selecting it is not typing it */
.heist-text {
  font-family: var(--mono);
  font-size: clamp(.72rem, 1.6vw, .86rem);
  line-height: 1.7;
  letter-spacing: .01em;
  word-break: break-all;
  white-space: pre-wrap;
  padding: .6rem .7rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: .5rem;
  user-select: none;
  -webkit-user-select: none;
}
.heist-text i { font-style: normal; }
.heist-text i.gap { white-space: pre; }
.heist-text i.on { color: var(--fg); }
.heist-text i.off { color: #f87171; background: #f8717126; border-radius: .12rem; }
.heist-text i.at { box-shadow: inset 2px 0 0 var(--fg); }

.heist-input {
  font: inherit;
  font-family: var(--mono);
  font-size: clamp(.72rem, 1.6vw, .86rem);
  color: var(--fg);
  background: var(--card);
  border: 1px solid var(--border-hi);
  border-radius: .5rem;
  padding: .5rem .7rem;
}
.heist-input:focus { outline: none; border-color: var(--fg); }
.heist-input.bad { border-color: #f87171; }
.heist-input:disabled { color: var(--dim); }

.heist-end { display: grid; gap: .3rem; padding: .4rem 0; }
.heist-end b { font-size: 1.1rem; font-weight: 600; letter-spacing: -.02em; }
.heist.won .heist-end b { color: #4ade80; }
.heist.lost .heist-end b { color: #f87171; }

/* the room says what happened, and shouts a little if it was about you */
.rnote.news { color: var(--muted); }
.rnote.news.mine { color: #facc15; }

/* -- the chat window ------------------------------------- */

.chat {
  --grip: 2.5rem;
  position: fixed;
  z-index: 40;
  right: calc(var(--pad) + env(safe-area-inset-right));
  bottom: calc(var(--pad) + env(safe-area-inset-bottom) + 1.8rem);
  width: min(21rem, calc(100vw - var(--pad) * 2));
  height: min(29rem, 62dvh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: color-mix(in srgb, var(--elevated) 92%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--border-hi);
  border-radius: .85rem;
  box-shadow:
    0 1px 0 #ffffff0d inset,
    0 18px 50px -12px #00000080,
    0 4px 12px -4px #00000059;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(var(--tx, 0px), calc(var(--ty, 0px) + 18px), 0) scale(.97);
  transition:
    opacity .45s ease,
    transform .55s cubic-bezier(.2, .9, .3, 1),
    height .38s cubic-bezier(.2, .8, .3, 1),
    border-color .2s ease;
  will-change: transform;
}
.chat.in {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) scale(1);
}
.chat.folded { height: var(--grip); }

/* while a finger is on it nothing should ease — it has to track the pointer */
.chat.dragging {
  transition: none;
  border-color: var(--fg);
  box-shadow: 0 1px 0 #ffffff14 inset, 0 26px 60px -10px #000000a6;
}

.chat-grip {
  flex: 0 0 auto;
  height: var(--grip);
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 0 .35rem 0 .7rem;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(#ffffff0a, transparent);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.chat.dragging .chat-grip { cursor: grabbing; }

.chat-who { display: flex; align-items: center; gap: .45rem; margin-right: auto; }
.chat-who .dot {
  width: .42rem;
  height: .42rem;
  border-radius: 50%;
  background: #4ade80;
  animation: breathe 3s ease-in-out infinite;
}

.chat-hint {
  font-size: .6rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  transition: opacity .4s ease;
}
.chat-hint.gone { opacity: 0; }

.chat-fold {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  color: var(--dim);
  background: transparent;
  border: 0;
  border-radius: .45rem;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.chat-fold:hover { color: var(--fg); background: #ffffff0f; }
.chat-fold:focus-visible { outline: 2px solid var(--fg); outline-offset: -2px; }
.chat-fold svg { width: .8rem; height: .8rem; transition: transform .3s cubic-bezier(.2,.8,.3,1); }
.chat.folded .chat-fold svg { transform: rotate(180deg); }

.chat-fold svg path,
.chat-send svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  transition: opacity .22s ease;
}
.chat.folded .chat-body { opacity: 0; pointer-events: none; }

.chat-log {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  padding: .7rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
  /* the top of the scroll fades out instead of getting chopped by the grip */
  mask-image: linear-gradient(to bottom, transparent, #000 .9rem);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 .9rem);
}
.chat-log::-webkit-scrollbar { width: 5px; }
.chat-log::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 999px; }
.chat-log::-webkit-scrollbar-track { background: transparent; }

.cmsg {
  max-width: 86%;
  padding: .45rem .68rem;
  font-size: .81rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--fg);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .75rem;
  border-bottom-left-radius: .28rem;
  animation: pop .32s cubic-bezier(.2, .8, .3, 1) both;
}
.cmsg.me {
  align-self: flex-end;
  color: #18181b;
  background: var(--fg);
  border-color: transparent;
  border-bottom-left-radius: .75rem;
  border-bottom-right-radius: .28rem;
}

/* a caret rides the end of the answer while it is still arriving */
.cmsg.live::after {
  content: "\258C";
  margin-left: .1em;
  color: var(--dim);
  animation: blink 1.1s steps(1) infinite;
}

.cmsg.off {
  max-width: 100%;
  align-self: stretch;
  font-family: var(--mono);
  font-size: .67rem;
  line-height: 1.65;
  color: var(--dim);
  background: transparent;
  border-style: dashed;
  border-radius: .5rem;
}
.cmsg.off code { color: var(--muted); }

.cmsg.dots { display: inline-flex; gap: .22rem; padding: .6rem .68rem; }
.cmsg.dots i { width: .3rem; height: .3rem; border-radius: 50%; background: var(--muted); animation: bob 1.1s ease-in-out infinite; }
.cmsg.dots i:nth-child(2) { animation-delay: .15s; }
.cmsg.dots i:nth-child(3) { animation-delay: .3s; }

/* -- two rooms, one window ------------------------------- */

.ctabs {
  flex: 0 0 auto;
  display: flex;
  gap: .25rem;
  padding: .4rem .45rem .15rem;
}

.ctab {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font: inherit;
  font-family: var(--mono);
  font-size: .66rem;
  color: var(--dim);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .2rem .55rem;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.ctab:hover { color: var(--muted); }
.ctab.on {
  color: var(--fg);
  background: #ffffff0d;
  border-color: var(--border);
}
.ctab:focus-visible { outline: 2px solid var(--fg); outline-offset: 1px; }

.ctab-n { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.ctab.on .ctab-n { color: var(--fg); }

/* something was said while you were looking the other way */
.ctab-new {
  display: grid;
  place-items: center;
  min-width: .95rem;
  height: .95rem;
  padding: 0 .2rem;
  font-size: .55rem;
  font-style: normal;
  color: #18181b;
  background: var(--fg);
  border-radius: 999px;
  animation: pop .3s cubic-bezier(.2,.8,.3,1) both;
}
.ctab-new[hidden] { display: none; }

.pane {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.pane[hidden] { display: none; }

/* who is holding a tab open, in the order the server counted them */
.here {
  flex: 0 0 auto;
  display: flex;
  gap: .3rem;
  padding: .35rem .5rem .1rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  font-family: var(--mono);
  font-size: .6rem;
  color: var(--dim);
  white-space: nowrap;
}
.here::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding: .12rem .42rem;
  color: var(--muted);
  background: #ffffff08;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.chip .dot {
  width: .3rem;
  height: .3rem;
  border-radius: 50%;
  background: #4ade80;
}
.chip.me { color: var(--fg); border-color: var(--border-hi); }
.chip.dim { color: var(--dim); background: transparent; border-style: dashed; }

/* the room's lines are tighter than plumsy's — there are more of them */
.rmsg {
  max-width: 90%;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  padding: .34rem .6rem;
  font-size: .78rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  color: var(--fg);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .7rem;
  border-bottom-left-radius: .26rem;
  animation: pop .28s cubic-bezier(.2,.8,.3,1) both;
}
.rmsg.me {
  align-self: flex-end;
  color: #18181b;
  background: var(--fg);
  border-color: transparent;
  border-bottom-left-radius: .7rem;
  border-bottom-right-radius: .26rem;
}

.rmsg-who {
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--dim);
}
.rmsg.me .rmsg-who { color: #18181bb3; text-align: right; }

/* the same person, still talking: one header is enough */
.rmsg.same { border-top-left-radius: .26rem; }
.rmsg.same.me { border-top-left-radius: .7rem; border-top-right-radius: .26rem; }
.rmsg.same .rmsg-who { display: none; }

/* an @name, in somebody else's line and in your own */
.at {
  padding: 0 .12em;
  border-radius: .25rem;
  color: var(--fg);
  background: #ffffff1a;
  font-weight: 500;
}
.rmsg.me .at { color: #18181b; background: #18181b1f; }
/* the one that is you */
.at.you { color: #1c1c1f; background: #facc15d9; }

/* the whole line, when it was addressed at you */
.rmsg.ping {
  border-color: #facc1559;
  box-shadow: 0 0 0 1px #facc1526, inset 0 0 0 100vmax #facc150a;
}

.rnote {
  align-self: center;
  max-width: 100%;
  padding: .1rem .3rem;
  font-family: var(--mono);
  font-size: .58rem;
  letter-spacing: .03em;
  text-align: center;
  color: var(--dim);
  animation: pop .28s cubic-bezier(.2,.8,.3,1) both;
}

/* -- the @ menu ------------------------------------------ */

/* the form is what the menu hangs above */
.at-wrap { position: relative; flex: 0 0 auto; }

.at-menu {
  position: absolute;
  left: .5rem;
  right: .5rem;
  bottom: calc(100% - .35rem);
  z-index: 2;
  display: flex;
  flex-direction: column;
  max-height: 9rem;
  margin-bottom: -.3rem;
  padding: .25rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background: var(--elevated);
  border: 1px solid var(--border-hi);
  border-radius: .55rem;
  box-shadow: 0 12px 30px -10px #000000a6;
  animation: pop .18s cubic-bezier(.2,.8,.3,1) both;
}
.at-menu[hidden] { display: none; }

.at-row {
  font: inherit;
  font-family: var(--mono);
  font-size: .7rem;
  text-align: left;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: .35rem;
  padding: .28rem .45rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.at-row:hover { color: var(--fg); background: #ffffff0d; }
.at-row.on { color: #18181b; background: var(--fg); }

/* -- somebody said your name ----------------------------- */

/* inside the page now, not hung off the browser window. a fixed corner is not
   always where the site is — in a preview pane, a split window or an emulated
   viewport it lands somewhere else, which is how a note about a gold yippee
   ended up in the top left corner of somebody's screen */
.pings {
  position: absolute;
  z-index: 60;
  top: 2.6rem;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  width: min(16rem, calc(100vw - var(--pad) * 2));
  max-width: 16rem;
  pointer-events: none;
}

.ping-card {
  pointer-events: auto;
  display: grid;
  gap: .15rem;
  /* its own ceiling, not its parent's: 15rem wide and only as tall as it needs */
  width: 100%;
  max-width: 15rem;
  max-height: 7rem;
  overflow: hidden;
  align-self: flex-end;
  padding: .5rem .65rem;
  font: inherit;
  text-align: left;
  color: var(--fg);
  background: color-mix(in srgb, var(--elevated) 94%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid #facc1559;
  border-left: 2px solid #facc15;
  border-radius: .6rem;
  box-shadow: 0 14px 34px -12px #000000a6;
  cursor: pointer;
  animation: slide-in .32s cubic-bezier(.2,.8,.3,1) both;
  transition: transform .18s ease, border-color .18s ease;
}
.ping-card:hover { transform: translateX(-2px); border-color: #facc15; }
.ping-card:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.ping-card.out { animation: slide-out .26s ease both; }

.ping-card.gold { border-color: #facc15; border-left-color: #facc15; }
.ping-card.badge { border-color: var(--border-hi); border-left-color: var(--fg); }
.ping-card.badge b { color: var(--fg); }
.ping-card.dim { border-color: var(--border); border-left-color: var(--dim); }
.ping-card.dim b { color: var(--dim); }

.ping-card b {
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: #facc15;
}
.ping-card span {
  font-size: .76rem;
  line-height: 1.4;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateX(18px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes slide-out {
  to { opacity: 0; transform: translateX(18px) scale(.97); }
}

/* -- the anti-yipee captcha ------------------------------ */
/* a real captcha proves you are human. this one proves nothing. */

.captcha {
  align-self: stretch;
  max-width: 100%;
  display: grid;
  gap: .45rem;
  padding: .55rem;
  font-family: var(--mono);
  background: var(--card);
  border: 1px dashed var(--border-hi);
  border-radius: .6rem;
  animation: pop .32s cubic-bezier(.2, .8, .3, 1) both;
}
.captcha.bad { animation: shake .38s cubic-bezier(.36, .07, .19, .97); }
.captcha.done { border-style: solid; border-color: var(--border); opacity: .8; }

.captcha-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .58rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--dim);
}
.captcha-head span { margin-right: auto; }

.captcha-again {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: .3rem;
  padding: .1rem .3rem;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.captcha-again:hover { color: var(--fg); border-color: var(--border-hi); }
.captcha-again:focus-visible { outline: 2px solid var(--fg); outline-offset: 1px; }

/* the word itself: still perfectly readable, just visibly annoyed about it */
.captcha-word {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: .5rem .35rem;
  font-size: clamp(.85rem, 4vw, 1.05rem);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  background:
    repeating-linear-gradient(114deg, #ffffff0a 0 2px, transparent 2px 8px),
    var(--elevated);
  border: 1px solid var(--border);
  border-radius: .4rem;
}
.captcha-word i {
  display: inline-block;
  font-style: normal;
  transform: rotate(var(--r, 0deg)) translateY(var(--y, 0)) scale(var(--s, 1));
}
/* the obligatory line through it that never stopped a single robot */
.captcha-word::after {
  content: "";
  position: absolute;
  left: -6%;
  right: -6%;
  top: 54%;
  height: 1px;
  background: var(--border-hi);
  transform: rotate(-3.5deg);
}

.captcha-form { display: flex; align-items: center; gap: .35rem; }
.captcha-form .chat-input { font-family: var(--mono); font-size: .76rem; padding: .35rem .7rem; }
.captcha-go {
  flex: 0 0 auto;
  font: inherit;
  font-size: .68rem;
  color: #18181b;
  background: var(--fg);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .35rem .6rem;
  cursor: pointer;
  transition: transform .18s ease, opacity .18s ease;
}
.captcha-go:hover { transform: translateY(-1px); }
.captcha-go:disabled { color: var(--dim); background: transparent; border-color: var(--border); cursor: default; transform: none; }
.captcha-go:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

.captcha-note { font-size: .62rem; line-height: 1.5; color: var(--dim); }
.captcha.bad .captcha-note { color: var(--muted); }

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

/* -- chat input ------------------------------------------ */

.chat-form {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem;
  border-top: 1px solid var(--border);
}
.chat-form[hidden] { display: none; }

.chat-input {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-size: .81rem;
  color: var(--fg);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .42rem .8rem;
  transition: border-color .18s ease, background .18s ease;
}
.chat-input::placeholder { color: var(--dim); }
.chat-input:focus { outline: none; border-color: var(--border-hi); background: var(--elevated); }
.chat-input:disabled { color: var(--dim); }

.chat-send {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}
.chat-send svg { width: .95rem; height: .95rem; }
.chat-send:not(:disabled) { color: #18181b; background: var(--fg); border-color: transparent; }
.chat-send:not(:disabled):hover { transform: translateY(-1px); }
.chat-send:disabled { cursor: default; }
.chat-send:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

@keyframes pop {
  from { opacity: 0; transform: translateY(6px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes breathe {
  0%, 100% { opacity: .45; box-shadow: 0 0 0 2px #4ade8014; }
  50%      { opacity: 1;   box-shadow: 0 0 0 4px #4ade8024; }
}

/* -- every screen ---------------------------------------- */

/* small laptops and tablets: the side columns give up their width first */
@media (max-width: 1180px) {
  .stage { grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) minmax(0, 13rem); }
  .yipee-note { display: none; }
}

/* the yippee takes the top, the two panels split the bottom */
@media (max-width: 900px) {
  .page { padding-bottom: calc(var(--pad) + env(safe-area-inset-bottom) + 3.2rem); }
  .stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 12rem);
    gap: .5rem;
  }
  /* auto-placement would put the arena under the first panel; pin the rows */
  .arena { grid-row: 1; grid-column: 1 / -1; }
  .panel { grid-row: 2; padding: .55rem; }
  .bar { font-size: .64rem; }
  .brand { font-size: clamp(.56rem, 2.8vw, .68rem); }
  .credit { display: none; }
  .foot { justify-content: space-between; }
  #timer { flex: 1 1 auto; }
  .yipee { flex: 0 0 auto; }
  .row { font-size: .68rem; grid-template-columns: 1.3rem minmax(0, 1fr) auto; gap: .35rem; }

  /* a sheet, not a window — dragging something full width is pointless */
  .chat {
    --grip: 2.6rem;
    left: calc(var(--pad) / 1.5 + env(safe-area-inset-left));
    right: calc(var(--pad) / 1.5 + env(safe-area-inset-right));
    bottom: calc(var(--pad) / 1.5 + env(safe-area-inset-bottom));
    width: auto;
    height: min(24rem, 62dvh);
    transform: translate3d(0, 18px, 0) scale(.98);
  }
  .chat.in { transform: none; }
  .chat-grip { cursor: default; }
  .chat-hint { display: none; }
  .cmsg { max-width: 92%; font-size: .84rem; }
}

/* narrow phones: the legend under the front line is the first thing to go */
@media (max-width: 560px) {
  .front-key { display: none; }
  .feed { font-size: .6rem; }
  .panel-head { font-size: .56rem; letter-spacing: .06em; }
  .tally-tag { font-size: .62rem; }
  .yipee { font-size: .6rem; }
}

/* phones on their side: wide but very short, so three columns again */
@media (max-height: 560px) and (orientation: landscape) {
  .page { gap: .3rem; padding-bottom: calc(var(--pad) + env(safe-area-inset-bottom)); }
  .stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: .5rem;
  }
  .arena { grid-column: auto; gap: .2rem; }
  .tally-n { font-size: clamp(1.4rem, 5vw, 2rem); }
  .tally-rank { display: none; }
  .feed { display: none; }
  .chat { height: min(18rem, 82dvh); }
  .chat.folded { height: var(--grip); }
}

/* the last stop: 320px wide */
@media (max-width: 400px) {
  .brand { letter-spacing: -.02em; }
  .gate-title { font-size: clamp(1.5rem, 8vw, 2.2rem); }
  .modes { font-size: .9em; }
  .join-go { padding: .55rem 1rem; }
}

/* very wide screens: keep the columns from drifting apart */
@media (min-width: 1600px) {
  .bar,
  .stage {
    width: 100%;
    max-width: 96rem;
    margin-inline: auto;
  }
  .stage { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr) minmax(0, 20rem); }
}

/* a narrow window is not a reason for a note to be the whole screen */
@media (max-width: 720px) {
  .pings {
    top: 2.2rem;
    width: min(11rem, calc(100% - var(--pad)));
  }
  .ping-card { padding: .38rem .5rem; }
  .ping-card b { font-size: .52rem; }
  .ping-card span { font-size: .62rem; -webkit-line-clamp: 3; }
}

/* touch screens get targets you can actually hit */
@media (pointer: coarse) {
  .chat-fold { width: 2.1rem; height: 2.1rem; }
  .chat-send { width: 2.2rem; height: 2.2rem; }
  .chat-input { padding: .55rem .85rem; font-size: 16px; } /* 16px or ios zooms the page */
  .ctab { padding: .28rem .6rem; font-size: .7rem; }
  .shop-card { width: 100%; border-left: 0; }
  .heist-card { max-height: calc(100dvh - var(--pad) * 2); }
  .heist-input { font-size: 16px; }   /* 16px or ios zooms mid-round */
  .here-badge { display: none; }  /* the room tab already carries the count */
  .field { font-size: 16px; }
  .ghost { padding: .3rem .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .page > *, .r1, .r2, .r3 { opacity: 1; }
  .pops { display: none; }
}

/* ---------------------------------------------------------------- */
/* the machine, when the handle is pulled                            */
/* ---------------------------------------------------------------- */

/* it stands in the middle of the screen, because that is the one moment on
   this site that is worth stopping for. the cabinet itself is a card the size
   of every other card here — the screen goes dim behind it, it does not go
   gold, and nothing about it is full bleed */

.slot-stage {
  position: fixed;
  inset: 0;
  z-index: 78;
  display: grid;
  place-items: center;
  padding: var(--pad);
}
.slot-stage[hidden] { display: none; }

.slot-back {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .26s ease;
}

.slot-box {
  --cell: 2.9rem;
  position: relative;
  width: min(19rem, calc(100vw - 2.5rem));
  padding: .95rem .9rem .8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: .8rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  opacity: 0;
  transform: translateY(14px) scale(.94);
  transition: opacity .26s ease, transform .34s cubic-bezier(.2, 1.1, .35, 1),
              border-color .3s ease, box-shadow .3s ease;
}

.slot-stage.in .slot-back { opacity: 1; }
.slot-stage.in .slot-box { opacity: 1; transform: none; }
.slot-stage.out .slot-back { opacity: 0; }
.slot-stage.out .slot-box { opacity: 0; transform: translateY(8px) scale(.97); }

.slot-name {
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---- the reels ---- */

.slot-reels {
  display: flex;
  gap: .4rem;
  padding: .35rem;
  border-radius: .55rem;
  background: var(--sunken, rgba(0, 0, 0, .28));
  border: 1px solid var(--border);
}

.reel {
  position: relative;
  width: 3rem;
  height: var(--cell);
  overflow: hidden;
  border-radius: .35rem;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, .45) 0%, rgba(0, 0, 0, 0) 34%,
    rgba(0, 0, 0, 0) 66%, rgba(0, 0, 0, .45) 100%), var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}

.strip {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.cell {
  display: grid;
  place-items: center;
  flex: 0 0 var(--cell);
  height: var(--cell);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text);
}

/* a reel in motion is a blur with a direction, not a list of symbols */
.strip.spinning {
  animation: reelspin .32s linear infinite;
  filter: blur(1.1px);
}
@keyframes reelspin {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}

.reel.stopped { animation: reelbump .26s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes reelbump {
  0%   { transform: translateY(2px); }
  60%  { transform: translateY(-1px); }
  100% { transform: none; }
}

/* ---- what it said ---- */

.slot-take {
  font-family: var(--mono);
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--muted);
  min-height: 1.2em;
  opacity: 0;
  transform: translateY(4px);
  animation: slotsay .34s ease forwards;
}
.slot-take.good { color: #facc15; }
.slot-take.bad { color: var(--dim); }

.slot-line {
  font-family: var(--mono);
  font-size: .64rem;
  line-height: 1.5;
  text-align: center;
  color: var(--muted);
  min-height: 2.1em;
  overflow-wrap: anywhere;
}
.slot-line.good { color: #facc15; }
.slot-line.bad { color: var(--dim); }

@keyframes slotsay {
  to { opacity: 1; transform: none; }
}

.slot-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  width: 100%;
}
.slot-row .pull { flex: 1; }

.slot-shut {
  padding: .42rem .6rem;
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: .4rem;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}
.slot-shut:hover { color: var(--muted); border-color: var(--border-hi); }

/* ---- the cabinet reacting ---- */

.slot-box.going { border-color: var(--border-hi); }
.slot-box.won { border-color: rgba(250, 204, 21, .55); box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 0 0 1px rgba(250, 204, 21, .25); }
.slot-box.lost { border-color: var(--border); }
.slot-box.big { animation: slotwin .5s cubic-bezier(.25, 1.4, .4, 1); }

@keyframes slotwin {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.035); }
  100% { transform: scale(1); }
}

/* ---- what falls out of it ---- */

.slot-burst {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: .8rem;
  pointer-events: none;
}

.coin {
  position: absolute;
  top: -1.2rem;
  left: var(--x);
  font-size: .85rem;
  color: #facc15;
  animation: coinfall 1.5s cubic-bezier(.4, .1, .7, 1) forwards;
}
@keyframes coinfall {
  0%   { opacity: 0; transform: translate(0, 0) rotate(0); }
  12%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift), 15rem) rotate(var(--turn)); }
}

@media (prefers-reduced-motion: reduce) {
  .slot-box, .slot-back { transition: opacity .2s ease; transform: none !important; }
  .slot-box.big { animation: none; }
  .strip.spinning { filter: none; }
  .coin { display: none; }
}

/* the back office, in sections. it was one long column of rows and it had got
   to the point where finding a control meant reading all of them */
.admin-set {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding-top: .6rem;
  border-top: 1px solid var(--border);
}
.admin-set:first-of-type { padding-top: 0; border-top: 0; }

.admin-h {
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--dim);
}
.admin-h.on-bench { color: var(--text); font-size: .7rem; letter-spacing: .04em; text-transform: none; }

.admin-hint {
  font-family: var(--mono);
  font-size: .58rem;
  line-height: 1.5;
  color: var(--dim);
}

/* the drawing, in the middle of what is left of the arena.

   the two banners and the line underneath are hidden most of the time, and a
   hidden grid item is not placed at all — so auto-placement was dropping the
   tally into row one and the drawing into row two, leaving the flexible row
   and every gap belonging to the empty rows stacked up underneath it. each
   child gets its own row, and the gaps live on the children that are up. */
.arena { row-gap: 0; }
.arena > .tally { grid-row: 1; margin-bottom: .45rem; }
.arena > .race { grid-row: 2; }
.arena > .surge { grid-row: 3; }
.arena > .face-wrap { grid-row: 4; }
.arena > .poke { grid-row: 5; }
.arena > .race:not([hidden]),
.arena > .surge:not([hidden]) { margin-bottom: .45rem; }
.arena > .poke:not([hidden]) { margin-top: .45rem; }

/* the bench re-reads itself on a clock, and says so quietly */
.admin-h.on-bench { display: flex; align-items: center; gap: .35rem; }
.admin-pip {
  width: .32rem;
  height: .32rem;
  border-radius: 50%;
  background: #4ade80;
  animation: pip 2s ease-in-out infinite;
}
.admin-livetag {
  font-family: var(--mono);
  font-size: .54rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
}
@keyframes pip {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* ---------------------------------------------------------------- */
/* caught, and asked what for                                        */
/* ---------------------------------------------------------------- */

/* the one dialog on this site with no way out of it. it is a card the size of
   every other card here — the screen dims behind it, and that is all */
.forfeit {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: grid;
  place-items: center;
  padding: var(--pad);
}
.forfeit[hidden] { display: none; }

.forfeit-back {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .24s ease;
}

.forfeit-box {
  position: relative;
  width: min(19rem, calc(100vw - 2.5rem));
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  padding: .95rem .85rem .8rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  background: var(--elevated);
  border: 1px solid #f87171;
  border-radius: .8rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
  opacity: 0;
  transform: translateY(12px) scale(.95);
  transition: opacity .24s ease, transform .3s cubic-bezier(.2, 1.1, .35, 1);
}

.forfeit.in .forfeit-back { opacity: 1; }
.forfeit.in .forfeit-box { opacity: 1; transform: none; }
.forfeit.out .forfeit-back { opacity: 0; }
.forfeit.out .forfeit-box { opacity: 0; transform: translateY(6px) scale(.98); }

.forfeit-title {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .04em;
  color: #f87171;
  text-align: center;
}

.forfeit-why {
  font-family: var(--mono);
  font-size: .58rem;
  line-height: 1.5;
  color: var(--dim);
  text-align: center;
  overflow-wrap: anywhere;
}

.forfeit-list {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  list-style: none;
}

.forfeit-go {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  padding: .5rem .6rem;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .5rem;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, opacity .2s ease;
}
.forfeit-go:hover:not([disabled]) { border-color: var(--border-hi); background: var(--elevated); }
.forfeit-go:focus-visible { outline: 2px solid #f87171; outline-offset: 1px; }
.forfeit-go[disabled] { cursor: default; opacity: .35; }
.forfeit-go.taken { opacity: 1; border-color: #f87171; }

.forfeit-what {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--text);
}
.forfeit-cost {
  font-family: var(--mono);
  font-size: .58rem;
  line-height: 1.4;
  color: var(--dim);
  overflow-wrap: anywhere;
}

.forfeit-clock {
  font-family: var(--mono);
  font-size: .56rem;
  color: var(--dim);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .forfeit-box { transition: opacity .2s ease; transform: none !important; }
}
