/* Topdeck — a dark card room read like a dealer's page: the live paragraph first, then the felt ranked by this
   round's raise with the bottom seat stamped in stencil. Ground #0B1014, felt #11201A, one red accent. */
:root {
  --ground: #0B1014; --felt: #11201A; --felt-hi: #172A22; --rail: #24372E; --ink: #EDEFEA; --dim: #93A29A; --faint: #5E6F67;
  --red: #FF4141; --red-soft: rgba(255, 65, 65, .14);
  --stencil: 'Stick No Bills', 'Impact', sans-serif; --text: 'Sora', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
  --strip: 54px;
}
* { box-sizing: border-box; }
html { background: var(--ground); }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 15px/1.55 var(--text); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
code { font-family: var(--mono); }
button { font: inherit; cursor: pointer; }
.ink-red { color: var(--red); }

/* ---------- the CA dock (fixed, bottom, above the thumb) ---------- */
.cutbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; min-height: var(--strip); display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom)); background: rgba(11, 16, 20, .95); border-top: 1px solid var(--rail); backdrop-filter: blur(8px); }
.cutbar-ca { flex: 0 1 640px; min-width: 0; display: flex; align-items: center; gap: 8px; background: var(--felt); border: 1px dashed var(--red);
  border-radius: 14px; padding: 5px 5px 5px 12px; }
.cutbar-tag { font: 700 16px/1 var(--stencil); color: var(--red); letter-spacing: .1em; flex: none; }
.cutbar-hex { flex: 1; min-width: 0; font-size: 11px; line-height: 1.25; word-break: break-all; user-select: all; color: var(--ink); }
.cutbar-hex.is-wait { color: var(--dim); font-family: var(--text); font-size: 11.5px; user-select: text; word-break: normal; }
.cutbar-copy { flex: none; border: 0; border-radius: 10px; background: var(--red); color: #160606; font: 700 17px/1 var(--stencil); letter-spacing: .08em;
  text-transform: uppercase; padding: 10px 14px; }
.cutbar-copy:disabled { background: var(--rail); color: var(--faint); cursor: default; }
.cutbar-copy.is-done { background: var(--ink); }
.cutbar-gm { flex: none; font-size: 11px; color: var(--dim); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 520px) { .cutbar { gap: 7px; padding-left: 8px; padding-right: 8px; } .cutbar-ca { padding-left: 9px; } .cutbar-gm { font-size: 10px; } }

/* ---------- masthead (not fixed: the dock carries the CA, the name sits with the page) ---------- */
.masthead { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; margin-bottom: 10px; }
.masthead img { border-radius: 6px; display: block; }
.masthead span { font: 800 20px/1 var(--stencil); letter-spacing: .08em; text-transform: uppercase; }
.masthead em { font-style: normal; font-size: 11px; color: var(--faint); letter-spacing: .04em; }

/* ---------- page grid ---------- */
.baize { padding: 14px 14px calc(var(--strip) + 48px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; max-width: 1180px; margin: 0 auto; }
.dealer { padding: 2px 2px 0; }
.dealer-kick { margin: 0 0 6px; font: 700 15px/1.2 var(--stencil); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.dealer-rule { margin: 0 0 8px; font: 800 28px/1 var(--stencil); letter-spacing: .02em; text-transform: uppercase; }
.dealer-prose { margin: 0; font-size: 14.5px; line-height: 1.55; color: #CFD6D1; max-width: 62ch; }
.dealer-prose b { color: var(--ink); font-weight: 600; }
.dealer-prose code { font-size: .86em; background: var(--felt-hi); padding: 1px 5px; border-radius: 4px; }

/* ---------- the felt ---------- */
.pit { background: radial-gradient(120% 90% at 50% 0%, var(--felt-hi), var(--felt) 70%); border: 1px solid var(--rail); border-radius: 22px; padding: 12px 12px 10px;
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, .18); }
.pit-rim { display: flex; justify-content: space-between; align-items: stretch; gap: 10px; margin-bottom: 8px; }
.pit-pot, .pit-clock { display: flex; flex-direction: column; background: rgba(0, 0, 0, .25); border-radius: 12px; padding: 7px 11px; }
.pit-pot span, .pit-clock span { font: 700 13px/1 var(--stencil); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.pit-pot b, .pit-clock b { font: 800 28px/1.05 var(--stencil); letter-spacing: .03em; }
.pit-pot i { font-style: normal; font-size: 10.5px; color: var(--faint); }
.pit-clock { text-align: right; align-items: flex-end; }
.pit-clock b.is-low { color: var(--red); }
.pit-legend { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; padding: 0 8px 4px 40px; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.pit-legend span:nth-child(2) { width: 72px; text-align: right; } .pit-legend span:nth-child(3) { width: 62px; text-align: right; }
.seatline { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; position: relative; }
.seatrow { display: grid; grid-template-columns: 30px minmax(0, 1fr) 72px 62px; grid-template-rows: auto 4px; column-gap: 8px; align-items: center;
  min-height: 38px; padding: 5px 8px; border-radius: 10px; background: rgba(0, 0, 0, .22); border: 1px solid transparent; position: relative; }
.seatrow-no { grid-row: 1 / 3; font: 800 18px/1 var(--stencil); color: var(--dim); text-align: center; }
.seatrow-who { font-family: var(--mono); font-size: 12px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; overflow-wrap: anywhere; }
.seatrow-who em { font-style: normal; font-family: var(--text); font-size: 10.5px; color: var(--faint); }
.seatrow-bar { grid-column: 2 / 5; grid-row: 2; height: 3px; background: rgba(255, 255, 255, .05); border-radius: 2px; overflow: hidden; }
.seatrow-bar i { display: block; height: 100%; background: var(--ink); opacity: .55; transition: width .5s ease; }
.seatrow-r { font: 700 21px/1 var(--stencil); text-align: right; letter-spacing: .02em; }
.seatrow-s { font-size: 11.5px; color: var(--dim); text-align: right; font-variant-numeric: tabular-nums; }
.seatrow.is-me { border-color: rgba(237, 239, 234, .35); }
.seatrow.is-next { background: var(--red-soft); border: 1px dashed var(--red); }
.seatrow.is-next .seatrow-no, .seatrow.is-next .seatrow-r { color: var(--red); }
.seatrow.is-next .seatrow-bar i { background: var(--red); opacity: 1; }
.foldstamp { font: 800 13px/1 var(--stencil); letter-spacing: .14em; text-transform: uppercase; color: var(--ground); background: var(--red);
  padding: 3px 6px 2px; border-radius: 3px; transform: rotate(-3deg); animation: stamp 1.6s ease-in-out infinite; flex: none; }
@keyframes stamp { 0%, 100% { opacity: 1; } 50% { opacity: .62; } }
.splitin { font: 700 13px/1 var(--stencil); letter-spacing: .06em; color: var(--red); flex: none; }
.splitin::before { content: '◂ '; opacity: .7; }
.toptag { font: 700 12px/1 var(--stencil); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); border: 1px solid var(--dim); padding: 2px 5px 1px; border-radius: 3px; flex: none; }
.seatrow.is-open { background: transparent; border: 1px dashed var(--rail); }
.seatrow.is-open .seatrow-who { font-family: var(--text); color: var(--faint); font-size: 11.5px; white-space: normal; grid-column: 2 / 5; }
.seatrow.is-open .seatrow-r, .seatrow.is-open .seatrow-s { display: none; }
.seatrow.is-first { border-color: var(--red); background: rgba(255, 65, 65, .06); }
.seatrow.is-first .seatrow-who { color: var(--ink); }
.seatrow.is-first .seatrow-no { color: var(--red); }
.seatrow.is-out { opacity: .42; }
.seatrow.is-out .seatrow-who { text-decoration: line-through; text-decoration-color: var(--red); }
.seatline.has-split::before { content: ''; position: absolute; left: 22px; top: 8px; bottom: 8px; width: 2px;
  background: repeating-linear-gradient(to top, var(--red) 0 6px, transparent 6px 11px); opacity: .45; animation: drip 1.2s linear infinite; background-size: 2px 11px; }
@keyframes drip { from { background-position: 0 0; } to { background-position: 0 -11px; } }
.pit-under { margin: 8px 2px 0; font-size: 12px; color: var(--dim); }

/* ---------- the raiser ---------- */
.sidecar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; min-width: 0; }
.raiser { background: var(--felt); border: 1px solid var(--rail); border-radius: 18px; padding: 14px; display: grid; gap: 10px; }
.raiser-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.raiser-k { font: 800 20px/1 var(--stencil); letter-spacing: .08em; text-transform: uppercase; }
.raiser-bal { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.raiser-field { display: grid; gap: 4px; }
.raiser-lbl { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.raiser-row { display: flex; align-items: center; background: var(--ground); border: 1px solid var(--rail); border-radius: 12px; padding: 0 12px; }
.raiser-row input { flex: 1; min-width: 0; width: 100%; background: transparent; border: 0; outline: 0; color: var(--ink); font: 800 30px/1 var(--stencil); padding: 10px 0; letter-spacing: .03em; }
.raiser-unit { font: 700 15px/1 var(--stencil); color: var(--dim); letter-spacing: .1em; }
.raiser-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.raiser-chips button { border: 1px solid var(--rail); background: transparent; color: var(--ink); border-radius: 999px; padding: 6px 11px; font-size: 12px; }
.raiser-chips button[data-beat] { border-color: var(--red); color: var(--red); }
.raiser-quote { margin: 0; font-size: 12.5px; color: #CFD6D1; }
.raiser-go { border: 0; border-radius: 12px; background: var(--red); color: #1A0505; font: 800 22px/1 var(--stencil); letter-spacing: .1em; text-transform: uppercase; padding: 14px; }
.raiser-go:disabled { background: var(--rail); color: var(--faint); cursor: default; }
.raiser-note { margin: 0; font-size: 11.5px; color: var(--faint); }
.raiser-owed[hidden] { display: none; }
.raiser-owed { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; background: var(--red-soft); border-radius: 10px; padding: 8px 10px; }
.raiser-owed button { border: 0; background: var(--ink); color: var(--ground); border-radius: 8px; padding: 6px 10px; font-size: 12px; }

/* ---------- rules ---------- */
.casebook { border-top: 1px solid var(--rail); padding-top: 12px; }
.casebook-h { margin: 0 0 8px; font: 800 22px/1 var(--stencil); letter-spacing: .06em; text-transform: uppercase; }
.casebook-steps { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; color: #CFD6D1; }
.casebook-steps b { color: var(--ink); }
.casebook-ex { background: rgba(255, 255, 255, .03); border-left: 3px solid var(--red); border-radius: 0 12px 12px 0; padding: 10px 12px; font-size: 13px; }
.casebook-ex p { margin: 4px 0; color: #CFD6D1; }
.casebook-ex b { color: var(--ink); font-variant-numeric: tabular-nums; }
.casebook-exh { font: 700 14px/1.1 var(--stencil); letter-spacing: .12em; text-transform: uppercase; color: var(--red); margin-bottom: 4px; }

/* ---------- the tape ---------- */
.spool { border-top: 1px solid var(--rail); padding-top: 12px; min-width: 0; }
.spool-hd { display: flex; justify-content: space-between; font: 700 15px/1 var(--stencil); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.spool-list { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 11.5px; display: grid; gap: 2px; max-height: 340px; overflow: auto; }
.spool-list li { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px; padding: 5px 4px; border-bottom: 1px dotted var(--rail); }
.spool-list li span { min-width: 0; overflow-wrap: anywhere; }
.spool-list time { color: var(--faint); }
.spool-list li.is-fold span { color: var(--red); }
.spool-list li.is-shown span { color: var(--ink); font-weight: 600; }
.spool-list li.is-quiet { display: block; font-family: var(--text); color: var(--faint); border: 0; }
.spool-list li.is-print { animation: printin .7s ease-out; }
@keyframes printin { from { opacity: 0; transform: translateY(-6px); background: var(--red-soft); } to { opacity: 1; transform: none; } }

/* ---------- small print ---------- */
.smallprint { border-top: 1px solid var(--rail); padding-top: 14px; font-size: 11.5px; color: var(--faint); display: grid; gap: 4px; min-width: 0; }
.smallprint code { overflow-wrap: anywhere; color: var(--dim); }
.smallprint-n { font: 700 15px/1.2 var(--stencil); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.smallprint nav { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; }

/* ---------- drawer + pop ---------- */
.drawer { position: fixed; inset: 0; z-index: 50; padding-bottom: var(--strip); background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; }
.drawer[hidden] { display: none; }
.drawer-card { width: min(560px, 100%); max-height: 78vh; overflow: auto; background: var(--felt); border: 1px solid var(--rail); border-radius: 18px 18px 0 0; padding: 14px 16px 22px; }
.drawer-hd { display: flex; justify-content: space-between; align-items: center; font: 800 20px/1 var(--stencil); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
.drawer-hd button { border: 1px solid var(--rail); background: transparent; color: var(--dim); border-radius: 8px; padding: 5px 10px; font-size: 12px; }
.handlog { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; color: #CFD6D1; }
.walletlist { display: grid; gap: 8px; }
.walletlist button { display: flex; align-items: center; gap: 10px; background: var(--ground); color: var(--ink); border: 1px solid var(--rail); border-radius: 10px; padding: 10px; }
.walletlist img { width: 24px; height: 24px; }
.pop { position: fixed; left: 50%; bottom: calc(var(--strip) + 22px); transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--ground); padding: 9px 14px; border-radius: 10px; font-size: 13px; }

/* ---------- tablet: wider measure, bigger type, still one column ---------- */
@media (min-width: 700px) {
  .baize { max-width: 760px; padding-left: 24px; padding-right: 24px; gap: 18px; }
  .dealer-rule { font-size: 44px; }
  .dealer-prose { font-size: 17px; }
  .seatrow { grid-template-columns: 38px minmax(0, 1fr) 96px 84px; min-height: 46px; }
  .pit-legend { padding-left: 50px; } .pit-legend span:nth-child(2) { width: 96px; } .pit-legend span:nth-child(3) { width: 84px; }
  .seatrow-r { font-size: 26px; } .seatrow-who { font-size: 13px; }
  .pit-pot b, .pit-clock b { font-size: 36px; }
  .cutbar-hex { font-size: 13px; }
}

/* ---------- desktop: the table and its page on the left, the raiser + rules + tape as a rail on the right ---------- */
@media (min-width: 1000px) {
  .baize { max-width: 1180px; grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr); grid-template-areas: "dealer side" "pit side" "foot foot"; grid-template-rows: auto minmax(0, 1fr) auto; column-gap: 28px; padding-top: 26px; }
  .dealer { grid-area: dealer; } .pit { grid-area: pit; align-self: start; } .sidecar { grid-area: side; position: sticky; top: 16px; align-self: start; }
  .smallprint { grid-area: foot; }
  .dealer-rule { font-size: 52px; }
  .dealer-prose { font-size: 17.5px; }
  .pit { padding: 18px 18px 14px; border-radius: 28px; }
  .seatrow { min-height: 52px; grid-template-columns: 44px minmax(0, 1fr) 112px 96px; }
  .seatrow-r { font-size: 30px; } .seatrow-no { font-size: 22px; }
  .pit-legend { padding-left: 56px; } .pit-legend span:nth-child(2) { width: 112px; } .pit-legend span:nth-child(3) { width: 96px; }
  .pit-pot b, .pit-clock b { font-size: 44px; }
  .cutbar-hex { font-size: 14px; }
}
