/* THE TONTINE TABLE — room styles. Every rule scoped under #screen-tontine. */

#screen-tontine .tt-room {
  max-width: 32rem;
  margin: 0 auto;
  padding: 0.4rem 0.4rem 2rem;
  position: relative;
}

/* ---------- head / the Registrar's voice ---------- */
#screen-tontine .tt-head .label { font-size: 0.8rem; letter-spacing: 0.34em; }
#screen-tontine .tt-registrar {
  min-height: 2.3rem;
  margin: 0.25rem auto 0;
  max-width: 26rem;
  font-size: 0.86rem;
  color: var(--bone);
  transition: opacity 0.3s ease;
}

/* ---------- HUD: purse, the book's figure, the quarter ---------- */
#screen-tontine .tt-hud {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.35rem 0 0.5rem;
  border-bottom: 1px dashed rgba(216, 180, 90, 0.18);
  margin-bottom: 0.45rem;
}
#screen-tontine .tt-hudbox,
#screen-tontine .tt-bookplate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  min-width: 6.4rem;
  padding: 0.25rem 0.6rem;
}
#screen-tontine .tt-hudword { font-size: 0.6rem; letter-spacing: 0.22em; font-style: normal; }
#screen-tontine .tt-purse { font-size: 1.25rem; }
#screen-tontine .tt-quarter {
  font-family: Georgia, serif;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  color: var(--bone);
}
#screen-tontine .tt-late .tt-quarter { color: #d4837d; }
#screen-tontine .tt-flag { font-size: 0.62rem; color: var(--gold-dim); }
#screen-tontine .tt-bookplate {
  border: 1px solid rgba(138, 115, 53, 0.5);
  border-radius: 3px;
  background:
    radial-gradient(circle at 50% -40%, rgba(216, 180, 90, 0.12), transparent 60%),
    rgba(10, 8, 4, 0.6);
  transition: box-shadow 0.3s ease;
}
#screen-tontine .tt-bookfig { font-size: 1.15rem; color: var(--bone); }
#screen-tontine .tt-buyoutword { font-size: 0.62rem; }
#screen-tontine .tt-buyoutword b { color: var(--gold); font-style: normal; }
#screen-tontine .tt-bookplate.swell { animation: tt-bookswell 0.9s ease-out; }
@keyframes tt-bookswell {
  0% { box-shadow: 0 0 0 rgba(216, 180, 90, 0); transform: scale(1); }
  30% { box-shadow: 0 0 26px rgba(216, 180, 90, 0.55); transform: scale(1.06); }
  100% { box-shadow: 0 0 0 rgba(216, 180, 90, 0); transform: scale(1); }
}

/* ---------- the first-night coach line ---------- */
#screen-tontine .tt-coach {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  max-width: 28rem;
  margin: 0 auto 0.4rem;
  padding: 0.15rem 0.3rem 0.15rem 0.7rem;
  border: 1px dashed rgba(207, 201, 184, 0.35);
  border-radius: 3px;
  background: rgba(20, 24, 18, 0.55);
}
#screen-tontine .tt-coach-line {
  font-size: 0.74rem;
  font-style: italic;
  color: #b6b09c;
  line-height: 1.35;
  padding: 0.25rem 0;
}
#screen-tontine .tt-coach-x {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: none;
  color: #8c8775;
  font-size: 1rem;
  cursor: pointer;
}

/* ---------- the hall: long table, eleven chairs, and yours ---------- */
#screen-tontine .tt-hall {
  position: relative;
  padding: 0.5rem 0.4rem 0.6rem;
  border: 1px solid #2c2012;
  border-radius: 5px;
  background:
    radial-gradient(ellipse 95% 50% at 50% -5%, rgba(255, 190, 90, 0.08), transparent 70%),
    linear-gradient(180deg, #14100a, #0d0a06 65%, #090704);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.7), 0 10px 30px rgba(0, 0, 0, 0.55);
  transition: filter 0.5s ease;
}
#screen-tontine .tt-room.tt-dim .tt-hall { filter: brightness(0.45) saturate(0.7); }
#screen-tontine .tt-room.tt-dim .tt-seat.snuffing { filter: brightness(2.1); }

#screen-tontine .tt-cruel {
  font-size: 0.6rem;
  letter-spacing: 0.26em;
  color: #6f6856;
  text-align: center;
  margin-bottom: 0.35rem;
}

/* the Registrar at the far end, the book chained to his wrist */
#screen-tontine .tt-regend {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
#screen-tontine .tt-regfig { position: relative; width: 30px; height: 38px; }
#screen-tontine .tt-reghead {
  position: absolute;
  top: 0; left: 50%;
  width: 12px; height: 12px;
  margin-left: -6px;
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(180deg, #3a332a, #241f18);
}
#screen-tontine .tt-regbody {
  position: absolute;
  bottom: 0; left: 50%;
  width: 28px; height: 24px;
  margin-left: -14px;
  border-radius: 45% 45% 8% 8% / 90% 90% 8% 8%;
  background: linear-gradient(180deg, #2a241c, #17130d);
  box-shadow: inset 0 2px 4px rgba(255, 220, 160, 0.07);
}
#screen-tontine .tt-bookfig2 { position: relative; width: 34px; height: 24px; }
#screen-tontine .tt-bookicon {
  position: absolute;
  inset: 4px 0 0 6px;
  border-radius: 2px 4px 4px 2px;
  background: linear-gradient(100deg, #4a2c1a, #2e1a0e 70%);
  box-shadow: inset 0 0 0 1px rgba(216, 180, 90, 0.25), inset 3px 0 0 rgba(216, 180, 90, 0.3), 0 2px 5px rgba(0, 0, 0, 0.6);
}
#screen-tontine .tt-bookchain {
  position: absolute;
  left: -8px; top: 9px;
  width: 14px; height: 7px;
  background:
    radial-gradient(circle at 3px 3.5px, transparent 1.5px, rgba(150, 140, 110, 0.7) 1.5px 2.5px, transparent 2.5px),
    radial-gradient(circle at 10px 3.5px, transparent 1.5px, rgba(150, 140, 110, 0.7) 1.5px 2.5px, transparent 2.5px);
}

/* the seats: two flanks up the table, you at the near end */
#screen-tontine .tt-seats {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: auto;
  gap: 0.3rem 4.2rem;
  padding: 0.2rem 0.4rem;
}
#screen-tontine .tt-seats::before { /* the long table itself */
  content: '';
  position: absolute;
  left: 50%;
  top: -34px;
  bottom: 4px;
  width: 4rem;
  margin-left: -2rem;
  border-radius: 14px 14px 8px 8px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.4), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.4)),
    radial-gradient(ellipse 80% 30% at 50% 0%, rgba(255, 210, 130, 0.1), transparent 70%),
    linear-gradient(180deg, #1a3023, #122b1c 55%, #0c1f14);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.55), 0 4px 14px rgba(0, 0, 0, 0.5);
}
#screen-tontine .tt-seat {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-areas: 'chair candle' 'name name' 'chip chip';
  grid-template-columns: auto auto;
  justify-content: center;
  align-items: end;
  gap: 0 0.3rem;
  padding: 0.1rem 0;
  transition: opacity 0.5s ease, filter 0.5s ease;
}
#screen-tontine .tt-seat[data-side='left'] { grid-column: 1; }
#screen-tontine .tt-seat[data-side='right'] { grid-column: 2; }
/* perspective: the far rows sit smaller, nearer the Registrar */
#screen-tontine .tt-seat[data-row='1'] { transform: scale(0.8); opacity: 0.92; }
#screen-tontine .tt-seat[data-row='2'] { transform: scale(0.84); opacity: 0.94; }
#screen-tontine .tt-seat[data-row='3'] { transform: scale(0.88); opacity: 0.96; }
#screen-tontine .tt-seat[data-row='4'] { transform: scale(0.92); }
#screen-tontine .tt-seat[data-row='5'] { transform: scale(0.96); }
#screen-tontine .tt-seat.tt-you {
  grid-column: 1 / -1;
  order: 99;                /* your end of the table — nearest you */
  margin-top: 0.2rem;
  padding-top: 0.25rem;
  border-top: 1px dashed rgba(216, 180, 90, 0.15);
}

/* a high-backed chair */
#screen-tontine .tt-chair {
  grid-area: chair;
  position: relative;
  display: block;
  width: 26px;
  height: 40px;
  border-radius: 9px 9px 2px 2px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.5), transparent 25%, transparent 75%, rgba(0, 0, 0, 0.5)),
    linear-gradient(180deg, #3d2a16, #2a1c0e 70%, #20150a);
  box-shadow:
    inset 0 0 0 2px rgba(15, 9, 4, 0.9),
    inset 0 3px 5px rgba(255, 215, 150, 0.08),
    0 3px 7px rgba(0, 0, 0, 0.55);
}
#screen-tontine .tt-chair::after { /* the seat panel */
  content: '';
  position: absolute;
  left: 4px; right: 4px; top: 7px;
  height: 18px;
  border-radius: 5px;
  background: linear-gradient(180deg, #1c2e1f, #14241a);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.7);
}
#screen-tontine .tt-drape { /* the cloth over a dead man's chair */
  position: absolute;
  inset: -2px -3px auto -3px;
  height: 0;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, #11100e, #1b1815 60%, rgba(27, 24, 21, 0));
  opacity: 0;
  transition: height 0.8s ease 0.3s, opacity 0.8s ease 0.3s;
  z-index: 2;
}
#screen-tontine .tt-seat.dead .tt-drape { height: 46px; opacity: 0.96; }
#screen-tontine .tt-seat.dead .tt-chair { filter: brightness(0.6); }
#screen-tontine .tt-seat.dead .tt-name { color: #5d574a; text-decoration: line-through; }
#screen-tontine .tt-seat.gone { opacity: 0.38; filter: saturate(0.4); }
#screen-tontine .tt-seat.gone .tt-chair::after { background: #0d1410; }

/* the candle: height is the only ledger the flames keep */
#screen-tontine .tt-candle {
  grid-area: candle;
  position: relative;
  display: block;
  width: 10px;
  height: 52px;
}
#screen-tontine .tt-candle::after { /* the stick */
  content: '';
  position: absolute;
  left: 1px; right: 1px; bottom: 0;
  height: 16px;
  border-radius: 2px 2px 1px 1px;
  background: linear-gradient(100deg, #e9dfc0, #c9bb92 60%, #a99a72);
  box-shadow: inset -1px 0 2px rgba(0, 0, 0, 0.3);
}
#screen-tontine .tt-wick {
  position: absolute;
  left: 50%; bottom: 15px;
  width: 2px; height: 3px;
  margin-left: -1px;
  background: #221a10;
}
#screen-tontine .tt-flame {
  position: absolute;
  left: 50%;
  bottom: 17px;
  width: 9px;
  height: calc(var(--fh, 0.1) * 30px + 5px);
  margin-left: -4.5px;
  border-radius: 50% 50% 50% 50% / 68% 68% 32% 32%;
  background: radial-gradient(circle at 50% 82%, #fff6d2 0 18%, #f6c14a 52%, rgba(224, 112, 30, 0.3) 86%, transparent);
  box-shadow:
    0 0 calc(6px + var(--fh, 0.1) * 16px) calc(2px + var(--fh, 0.1) * 5px) rgba(255, 190, 90, calc(0.12 + var(--fh, 0.1) * 0.3));
  transform-origin: 50% 95%;
  animation: tt-flicker 2.1s ease-in-out infinite;
  transition: height 0.7s ease, box-shadow 0.7s ease, opacity 0.4s ease;
}
@keyframes tt-flicker {
  0%, 100% { transform: scale(1) skewX(0deg); opacity: 0.95; }
  26% { transform: scale(0.93, 1.07) skewX(-3deg); opacity: 0.88; }
  47% { transform: scale(1.05, 0.95) skewX(2deg); }
  71% { transform: scale(0.96, 1.08) skewX(-2deg); opacity: 1; }
}
#screen-tontine .tt-seat.warmest .tt-flame {
  animation-duration: 0.9s;
  box-shadow:
    0 0 calc(10px + var(--fh, 0.1) * 20px) calc(3px + var(--fh, 0.1) * 7px) rgba(255, 160, 60, calc(0.2 + var(--fh, 0.1) * 0.35));
}
#screen-tontine .tt-seat.warmest .tt-name { color: #e8c574; }
#screen-tontine .tt-seat.dead .tt-flame,
#screen-tontine .tt-seat.gone .tt-flame { opacity: 0; height: 2px; box-shadow: none; }
#screen-tontine .tt-seat.snuffing .tt-flame { transition: height 0.25s ease, opacity 0.3s ease; }
#screen-tontine .tt-smoke { /* the wisp above a snuffed wick */
  position: absolute;
  left: 50%;
  bottom: 20px;
  width: 3px;
  height: 16px;
  margin-left: -1.5px;
  border-radius: 50%;
  background: linear-gradient(180deg, transparent, rgba(180, 175, 160, 0.35) 40%, rgba(160, 155, 140, 0.18));
  opacity: 0;
  filter: blur(1px);
}
#screen-tontine .tt-seat.dead .tt-smoke { animation: tt-smoke 2.6s ease-out 0.25s; }
@keyframes tt-smoke {
  0% { opacity: 0; transform: translateY(0) scaleY(0.4); }
  18% { opacity: 0.85; }
  100% { opacity: 0; transform: translateY(-26px) scaleY(1.6) translateX(3px); }
}

#screen-tontine .tt-name {
  grid-area: name;
  font-size: 0.56rem;
  letter-spacing: 0.12em;
  color: #a9a28d;
  text-align: center;
  margin-top: 0.15rem;
  white-space: nowrap;
}
#screen-tontine .tt-you .tt-name { color: var(--gold); letter-spacing: 0.3em; }
#screen-tontine .tt-chip {
  grid-area: chip;
  min-height: 0.95rem;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}
#screen-tontine .tt-chip.on { opacity: 1; }
#screen-tontine .tt-chip.press { color: #d8a04a; font-style: normal; }
#screen-tontine .tt-chip.sit { color: #9a937e; font-style: normal; }
#screen-tontine .tt-chip.cool { color: #7d9bb0; font-style: normal; }
#screen-tontine .tt-chipexit { color: #b6b09c; }
#screen-tontine .tt-chipdead { color: var(--red); font-style: normal; letter-spacing: 0.22em; }

/* ---------- the postures ---------- */
#screen-tontine .tt-postures {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
  margin-top: 0.7rem;
}
#screen-tontine .tt-p {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-height: 52px;
  padding: 0.45rem 0.3rem;
  border: 1px solid var(--gold-dim);
  border-radius: 3px;
  background:
    radial-gradient(circle at 50% -40%, rgba(216, 180, 90, 0.12), transparent 60%),
    var(--felt-deep);
  color: var(--bone);
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s, opacity 0.2s;
}
#screen-tontine .tt-p:hover:not(:disabled) { border-color: var(--gold); box-shadow: 0 0 12px rgba(216, 180, 90, 0.25); }
#screen-tontine .tt-p:disabled { opacity: 0.45; cursor: default; }
#screen-tontine .tt-pname { font-size: 0.82rem; letter-spacing: 0.18em; color: var(--gold); }
#screen-tontine .tt-psub { font-size: 0.58rem; line-height: 1.25; }
#screen-tontine .tt-psub b { color: var(--gold); font-style: normal; }
#screen-tontine .tt-pwithdraw { border-color: #5d4a2a; }
#screen-tontine .tt-pwithdraw .tt-pname { color: var(--bone); }
#screen-tontine .tt-late .tt-p[data-p='cool'] .tt-psub { color: #d4837d; }

/* ---------- footer ---------- */
#screen-tontine .tt-footer {
  display: flex;
  justify-content: center;
  gap: 1.4rem;
  margin-top: 0.8rem;
}
#screen-tontine .tt-footer .dim-btn { margin-top: 0; font-size: 0.74rem; padding: 0.45rem 0.9rem; min-height: 44px; }

/* ---------- the end: THE REGISTER (trust artifact) ---------- */
#screen-tontine .tt-end {
  position: fixed;
  inset: 0;
  z-index: 38;
  background: rgba(4, 5, 4, 0.96);
}
#screen-tontine .tt-end-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 1.4rem 0.7rem 2.4rem;
  text-align: center;
}
#screen-tontine .tt-end-title {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0.26em;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(216, 180, 90, 0.35);
}
#screen-tontine .tt-end-title.tt-down { color: var(--red); text-shadow: 0 0 18px rgba(168, 54, 46, 0.4); }
#screen-tontine .tt-end-detail { margin: 0.45rem 0 0.2rem; color: var(--bone); letter-spacing: 0.04em; }
#screen-tontine .tt-register {
  max-width: 30rem;
  margin: 1.2rem auto 0;
  padding: 0.8rem 0.6rem 0.9rem;
  border: 1px solid rgba(138, 115, 53, 0.4);
  border-radius: 4px;
  background: rgba(10, 8, 4, 0.7);
}
#screen-tontine .tt-reglabel { font-size: 0.66rem; letter-spacing: 0.24em; }
#screen-tontine .tt-regsub { max-width: 24rem; margin: 0.35rem auto 0.7rem; font-size: 0.66rem; line-height: 1.4; }
#screen-tontine .tt-regcols {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}
#screen-tontine .tt-regcol {
  width: 7.4rem;
  padding: 0.4rem 0.3rem 0.45rem;
  border: 1px solid rgba(80, 56, 26, 0.5);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(34, 24, 12, 0.4), rgba(18, 13, 7, 0.55));
}
#screen-tontine .tt-regq { display: block; font-size: 0.56rem; letter-spacing: 0.18em; line-height: 1.5; margin-bottom: 0.35rem; }
#screen-tontine .tt-stamps { display: flex; flex-direction: column; gap: 2px; }
#screen-tontine .tt-stamp {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 1px 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.25);
}
#screen-tontine .tt-stamp.yours { outline: 1px solid rgba(216, 180, 90, 0.55); }
#screen-tontine .tt-stamp.taken { background: rgba(168, 54, 46, 0.22); }
#screen-tontine .tt-stamp.taken .tt-stampname { color: #d4837d; text-decoration: line-through; }
#screen-tontine .tt-stampflame {
  width: calc(var(--fh, 0.1) * 3.2rem + 0.25rem);
  height: 5px;
  border-radius: 2px;
  background: linear-gradient(90deg, #f6c14a, rgba(224, 112, 30, 0.6));
  box-shadow: 0 0 5px rgba(255, 190, 90, 0.4);
  flex: none;
}
#screen-tontine .tt-stampname { font-size: 0.56rem; letter-spacing: 0.1em; color: #a9a28d; }
#screen-tontine .tt-lotstrip {
  position: relative;
  display: flex;
  height: 9px;
  margin-top: 0.35rem;
  border-radius: 2px;
  overflow: hidden;
  background: #0b0905;
  outline: 1px solid rgba(80, 56, 26, 0.5);
}
#screen-tontine .tt-lotseg { height: 100%; background: rgba(216, 180, 90, 0.28); box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.65); }
#screen-tontine .tt-lotseg.yours { background: rgba(216, 180, 90, 0.6); }
#screen-tontine .tt-lotseg.taken { background: rgba(168, 54, 46, 0.85); }
#screen-tontine .tt-needle {
  position: absolute;
  top: -1px; bottom: -1px;
  width: 2px;
  margin-left: -1px;
  background: #efe8d2;
  box-shadow: 0 0 5px rgba(255, 245, 210, 0.9);
  z-index: 2;
}
#screen-tontine .tt-regexit { display: block; margin-top: 0.3rem; font-size: 0.56rem; }
#screen-tontine .tt-end-house {
  font-style: italic;
  color: #9a937e;
  max-width: 24rem;
  margin: 1rem auto;
}
#screen-tontine .tt-end-actions { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
#screen-tontine .tt-end-leave { min-height: 48px; letter-spacing: 0.18em; }
#screen-tontine .tt-again { margin-top: 0.2rem; min-height: 44px; }

/* ---------- explainer (placards reuse the global .rule-card family) ---------- */
#screen-tontine .tt-explainer {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(4, 6, 4, 0.94);
  overflow-y: auto;
  padding: 1.4rem 0.8rem 2.4rem;
  text-align: center;
}
#screen-tontine .tt-explainer-house {
  font-style: italic;
  color: var(--bone);
  max-width: 26rem;
  margin: 1.1rem auto 1rem;
}
#screen-tontine .tt-dismiss { min-height: 48px; letter-spacing: 0.2em; }
#screen-tontine .tt-demo {
  position: relative;
  height: 3.6rem;
  margin: 0 auto;
  max-width: 10rem;
  overflow: hidden;
}
/* I. the table: five chair backs; the light walks the row */
#screen-tontine .tt-demo-table {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0.45rem;
}
#screen-tontine .tt-demo-chair {
  width: 1.1rem;
  height: 2.4rem;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #3d2a16, #20150a);
  box-shadow: inset 0 0 0 2px rgba(15, 9, 4, 0.9);
  animation: tt-demo-rowlight 4s ease-in-out infinite;
}
#screen-tontine .tt-demo-chair:nth-child(2) { animation-delay: 0.5s; }
#screen-tontine .tt-demo-chair:nth-child(3) { animation-delay: 1s; }
#screen-tontine .tt-demo-chair:nth-child(4) { animation-delay: 1.5s; }
#screen-tontine .tt-demo-chair:nth-child(5) { animation-delay: 2s; }
@keyframes tt-demo-rowlight {
  0%, 100% { filter: brightness(1); }
  12% { filter: brightness(1.7); box-shadow: inset 0 0 0 2px rgba(15, 9, 4, 0.9), 0 0 10px rgba(255, 200, 110, 0.4); }
  24% { filter: brightness(1); }
}
/* II. the postures: four buttons pulse in turn */
#screen-tontine .tt-demo-postures {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.3rem;
}
#screen-tontine .tt-demo-pb {
  padding: 0.45rem 0.25rem;
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: 3px;
  background: var(--felt-deep);
  animation: tt-demo-press 4.4s ease-in-out infinite;
}
#screen-tontine .tt-demo-pb:nth-child(2) { animation-delay: 1.1s; }
#screen-tontine .tt-demo-pb:nth-child(3) { animation-delay: 2.2s; }
#screen-tontine .tt-demo-pb:nth-child(4) { animation-delay: 3.3s; }
#screen-tontine .tt-demo-pb.wd { color: var(--bone); border-color: #5d4a2a; }
@keyframes tt-demo-press {
  0%, 100% { transform: none; box-shadow: none; }
  6% { transform: scale(1.12); box-shadow: 0 0 12px rgba(216, 180, 90, 0.5); }
  14% { transform: none; box-shadow: none; }
}
/* III. the flame: three candles; the tall one draws the dark, and is snuffed */
#screen-tontine .tt-demo-flames {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1.3rem;
  padding-bottom: 0.2rem;
}
#screen-tontine .tt-demo-candle {
  position: relative;
  width: 0.55rem;
  height: 1.3rem;
  border-radius: 2px;
  background: linear-gradient(100deg, #e9dfc0, #a99a72);
}
#screen-tontine .tt-demo-candle::after { /* its flame */
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 0.5rem;
  height: calc(var(--fh, 0.5) * 1.6rem + 0.3rem);
  margin-left: -0.25rem;
  border-radius: 50% 50% 50% 50% / 68% 68% 32% 32%;
  background: radial-gradient(circle at 50% 82%, #fff6d2 0 18%, #f6c14a 52%, transparent 88%);
  box-shadow: 0 0 10px 3px rgba(255, 190, 90, 0.3);
  transform-origin: 50% 95%;
  animation: tt-flicker 1.6s ease-in-out infinite;
}
#screen-tontine .tt-demo-candle.hot::after { animation: tt-demo-snuff 4.2s ease-in-out infinite; }
@keyframes tt-demo-snuff {
  0%, 58% { opacity: 1; transform: scale(1); }
  64%, 78% { opacity: 0; transform: scale(0.5, 0.1); }
  86%, 100% { opacity: 1; transform: scale(1); }
}
/* IV. the book: a coin folds in, the book swells */
#screen-tontine .tt-demo-book {
  display: flex;
  justify-content: center;
  align-items: center;
}
#screen-tontine .tt-demo-bookicon {
  width: 2.6rem;
  height: 1.8rem;
  border-radius: 3px 6px 6px 3px;
  background: linear-gradient(100deg, #4a2c1a, #2e1a0e 70%);
  box-shadow: inset 0 0 0 1px rgba(216, 180, 90, 0.3), inset 5px 0 0 rgba(216, 180, 90, 0.35);
  animation: tt-demo-swallow 3.6s ease-in-out infinite;
}
@keyframes tt-demo-swallow {
  0%, 52%, 100% { transform: scale(1); box-shadow: inset 0 0 0 1px rgba(216, 180, 90, 0.3), inset 5px 0 0 rgba(216, 180, 90, 0.35); }
  62%, 72% { transform: scale(1.14); box-shadow: inset 0 0 0 1px rgba(216, 180, 90, 0.6), inset 5px 0 0 rgba(216, 180, 90, 0.5), 0 0 18px rgba(216, 180, 90, 0.45); }
}
#screen-tontine .tt-demo-coinfly {
  position: absolute;
  left: 18%;
  top: 45%;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f3d98a, #b8923a 70%);
  box-shadow: 0 0 8px rgba(255, 217, 122, 0.5);
  animation: tt-demo-coin 3.6s ease-in infinite;
}
@keyframes tt-demo-coin {
  0%, 28% { opacity: 0; transform: translateX(0); }
  36% { opacity: 1; }
  60% { opacity: 1; transform: translateX(2.6rem) scale(0.7); }
  64%, 100% { opacity: 0; transform: translateX(2.9rem) scale(0.4); }
}

/* ---------- mobile: ≤600px — the table becomes a stacked roster ---------- */
@media (max-width: 600px) {
  #screen-tontine .tt-room { padding: 0.2rem 0.2rem 1.4rem; }
  #screen-tontine .tt-hud { gap: 0.35rem; }
  #screen-tontine .tt-hudbox, #screen-tontine .tt-bookplate { min-width: 5.4rem; padding: 0.2rem 0.35rem; }
  #screen-tontine .tt-regend { margin-bottom: 0.45rem; }
  /* the roster: one chair per row, flame read left to right */
  #screen-tontine .tt-seats { grid-template-columns: 1fr; gap: 0.15rem; }
  #screen-tontine .tt-seats::before { display: none; }
  #screen-tontine .tt-seat,
  #screen-tontine .tt-seat[data-side='left'],
  #screen-tontine .tt-seat[data-side='right'] {
    grid-column: 1;
    grid-template-areas: 'chair candle name chip';
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    justify-content: stretch;
    gap: 0 0.55rem;
    transform: none;
    opacity: 1;
    padding: 0.1rem 0.3rem;
    border-bottom: 1px solid rgba(80, 56, 26, 0.25);
    min-height: 44px;
  }
  #screen-tontine .tt-seat[data-row='1'], #screen-tontine .tt-seat[data-row='2'],
  #screen-tontine .tt-seat[data-row='3'], #screen-tontine .tt-seat[data-row='4'],
  #screen-tontine .tt-seat[data-row='5'] { transform: none; opacity: 1; }
  #screen-tontine .tt-seat.gone { opacity: 0.38; }
  #screen-tontine .tt-chair { width: 20px; height: 30px; }
  #screen-tontine .tt-seat.dead .tt-drape { height: 34px; }
  #screen-tontine .tt-candle { height: 46px; width: 12px; }
  #screen-tontine .tt-name { text-align: left; margin-top: 0; font-size: 0.62rem; }
  #screen-tontine .tt-chip { text-align: right; font-size: 0.6rem; }
  #screen-tontine .tt-seat.tt-you { order: -1; border-top: 0; margin-top: 0; padding-top: 0.1rem; }
  #screen-tontine .tt-seat.tt-you .tt-chair { box-shadow: inset 0 0 0 2px rgba(15, 9, 4, 0.9), 0 0 8px rgba(216, 180, 90, 0.25); }
  /* postures: 2 × 2, thumb-fair */
  #screen-tontine .tt-postures { grid-template-columns: 1fr 1fr; gap: 0.4rem; }
  #screen-tontine .tt-p { min-height: 56px; }
  #screen-tontine .tt-registrar { font-size: 0.8rem; min-height: 2.1rem; }
  #screen-tontine .tt-regcol { width: 100%; max-width: 17rem; }
  #screen-tontine .tt-coach-line { font-size: 0.7rem; }
}
