/* Antebank — one blueprint elevation on drafting paper: the bank's stack of antes, ante 1 on the floor, every slot's
   running total drawn as a dimension bar, the next ante's split fanning down to everything beneath it. */
:root {
  --paper: #E8EEF4;
  --sheet: #F6F8FB;
  --ink: #0E2340;
  --ink2: #3C5372;
  --rule: #A9BCD3;
  --hair: rgba(31, 91, 255, .09);
  --blue: #1F5BFF;
  --blue-soft: rgba(31, 91, 255, .12);
  --amber: #C2410C;
  --f-disp: 'Saira Condensed', 'Arial Narrow', sans-serif;
  --f-body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --f-mono: 'Martian Mono', ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); }
body {
  margin: 0; color: var(--ink); font: 400 16px/1.5 var(--f-body);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--hair) 1px, transparent 1px),
    linear-gradient(90deg, var(--hair) 1px, transparent 1px),
    linear-gradient(rgba(31, 91, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 91, 255, .05) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  overflow-x: hidden;
}
a { color: var(--blue); }
button { font: inherit; cursor: pointer; }
code { font-family: var(--f-mono); }

/* ---------- title block: the CA, pinned at the top ---------- */
.ab-title {
  position: sticky; top: 0; z-index: 30;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  padding: 8px 14px; background: var(--sheet);
  border-bottom: 2px solid var(--ink); box-shadow: 0 1px 0 var(--rule), 0 6px 18px rgba(14, 35, 64, .06);
}
.ab-title-tag { display: inline-flex; align-items: center; gap: 6px; font: 700 13px/1 var(--f-disp); letter-spacing: .08em; text-transform: uppercase; }
.ab-title-tag img { border-radius: 4px; }
.ab-title-tag i { font-style: normal; font-weight: 500; color: var(--ink2); }
.ab-title-addr {
  order: 3; flex: 1 1 100%; font-size: 10.5px; line-height: 1.6; letter-spacing: 0; color: var(--ink);
  user-select: all; overflow-wrap: anywhere;
}
.ab-title-addr.is-pending { color: var(--ink2); user-select: none; font-style: italic; }
.ab-title-acts { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; }
.ab-copy {
  border: 1.5px solid var(--ink); background: var(--ink); color: var(--sheet);
  font: 600 11px/1 var(--f-mono); padding: 7px 12px; border-radius: 3px; letter-spacing: .04em;
}
.ab-copy:disabled { background: transparent; color: var(--ink2); border-color: var(--rule); cursor: default; }
.ab-copy.is-done { background: var(--blue); border-color: var(--blue); }
.ab-gm { font: 400 11px/1 var(--f-mono); color: var(--ink2); }

/* ---------- headline ---------- */
.ab-h1 {
  margin: 22px 16px 10px; max-width: 1180px;
  font: 800 44px/0.98 var(--f-disp); letter-spacing: -.005em; text-transform: uppercase;
}
.ab-h1 em { font-style: normal; color: var(--blue); }

/* ---------- the sheet ---------- */
.ab-sheet { display: grid; gap: 18px; padding: 0 16px 28px; max-width: 1180px; }
.ab-drawing { min-width: 0; }
.ab-plate { background: var(--sheet); border: 1.5px solid var(--ink); position: relative; }
.ab-plate::before, .ab-plate::after { content: ''; position: absolute; width: 12px; height: 12px; border: 1.5px solid var(--blue); }
.ab-plate::before { top: -7px; left: -7px; border-right: 0; border-bottom: 0; }
.ab-plate::after { bottom: -7px; right: -7px; border-left: 0; border-top: 0; }
.ab-plate-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; padding: 8px 12px;
  border-bottom: 1px solid var(--rule); font: 400 10px/1.3 var(--f-mono); color: var(--ink2); letter-spacing: .03em;
}
.ab-plate-no { color: var(--ink); font-weight: 600; }
.ab-stackwrap { position: relative; padding: 14px 44px 0 12px; }
.ab-fan { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.ab-fan path { fill: none; stroke: var(--blue); stroke-width: 1.2; stroke-dasharray: 4 4; opacity: .75; }
.ab-fan circle { fill: var(--blue); }
.ab-stack { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; position: relative; }

.ab-slot {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 38px; padding: 6px 10px; border: 1.2px solid var(--ink); background: #fff; position: relative;
}
.ab-slot-n { font: 700 15px/1 var(--f-disp); letter-spacing: .06em; }
.ab-slot-n small { display: block; font: 400 9px/1.3 var(--f-mono); color: var(--ink2); letter-spacing: 0; margin-top: 2px; }
.ab-dim { position: relative; height: 14px; }
.ab-dim::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--rule); }
.ab-dim-bar {
  position: absolute; left: 0; top: 2px; bottom: 2px; min-width: 2px; background: var(--blue-soft);
  border-left: 1.5px solid var(--blue); border-right: 1.5px solid var(--blue); transition: width .7s cubic-bezier(.2, .8, .2, 1);
}
.ab-slot-v { font: 600 12.5px/1 var(--f-mono); text-align: right; white-space: nowrap; }
.ab-slot-v small { display: block; font: 400 9px/1.4 var(--f-mono); color: var(--ink2); }
.ab-slot.is-mine { outline: 2px solid var(--amber); outline-offset: 1px; }
.ab-slot.is-new { animation: ab-drop .7s cubic-bezier(.2, .8, .2, 1); }
.ab-slot.is-paid .ab-slot-v { animation: ab-tick .9s ease-out; }
.ab-slot-plus {
  position: absolute; right: -40px; top: 50%; transform: translateY(-50%);
  font: 600 9px/1 var(--f-mono); color: var(--blue); background: var(--sheet); padding: 2px 3px;
}
@keyframes ab-drop { from { transform: translateY(-26px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ab-tick { 0% { color: var(--blue); transform: scale(1.12); } 100% { color: inherit; transform: none; } }

.ab-slot.is-next {
  border: 1.5px dashed var(--blue); background: rgba(31, 91, 255, .05); color: var(--blue);
}
.ab-slot.is-next .ab-slot-n small { color: var(--blue); }
.ab-slot.is-open { border: 2px solid var(--blue); background: rgba(31, 91, 255, .08); box-shadow: 0 0 0 4px rgba(31, 91, 255, .12); animation: ab-glow 2.4s ease-in-out infinite; }
@keyframes ab-glow { 50% { box-shadow: 0 0 0 7px rgba(31, 91, 255, .05); } }
.ab-slot.is-ghost { border-style: dotted; border-color: var(--rule); background: transparent; color: var(--ink2); }
.ab-gap { font: 400 10px/1 var(--f-mono); color: var(--ink2); text-align: center; padding: 4px 0; letter-spacing: .1em; }

.ab-base {
  display: flex; justify-content: space-between; margin: 8px -44px 0 -12px; padding: 7px 12px;
  border-top: 3px double var(--ink); font: 400 9.5px/1.2 var(--f-mono); color: var(--ink2); letter-spacing: .08em;
}

.ab-say { margin: 14px 2px 12px; font: 400 17px/1.45 var(--f-body); }
.ab-say b { font-family: var(--f-mono); font-weight: 600; font-size: .9em; color: var(--blue); }

.ab-console { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ab-call, .ab-encore { border: 1.2px solid var(--ink); background: var(--sheet); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.ab-call-k { font: 400 9.5px/1 var(--f-mono); color: var(--ink2); letter-spacing: .12em; text-transform: uppercase; }
.ab-call-t, .ab-encore-v { font: 700 30px/1.05 var(--f-disp); }
.ab-call.is-hot .ab-call-t { color: var(--amber); }
.ab-call-n { font-size: 12px; color: var(--ink2); line-height: 1.35; }
.ab-ante {
  grid-column: 1 / -1; border: 0; background: var(--blue); color: #fff; padding: 16px 18px; border-radius: 2px;
  font: 800 22px/1 var(--f-disp); letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--ink);
}
.ab-ante:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.ab-ante:disabled { background: var(--rule); color: var(--ink); box-shadow: 4px 4px 0 rgba(14, 35, 64, .3); cursor: default; }
.ab-fine { grid-column: 1 / -1; margin: 2px 0 0; font-size: 13px; color: var(--ink2); }
.ab-link { border: 0; background: none; padding: 0; color: var(--blue); text-decoration: underline; font-size: 13px; }
.ab-link.is-on { text-decoration: none; font-family: var(--f-mono); font-size: 11.5px; }
.ab-owed { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border: 1.5px solid var(--amber); background: #FFF7F0; }
.ab-owed b { font-family: var(--f-mono); }
.ab-owed button { border: 0; background: var(--amber); color: #fff; padding: 8px 14px; font-weight: 700; }
.ab-close { grid-column: 1 / -1; border: 1.5px dashed var(--ink); background: transparent; padding: 11px; font-weight: 700; }

/* ---------- side: tape, rules ---------- */
.ab-side { display: grid; gap: 18px; align-content: start; min-width: 0; }
.ab-tape { border: 1.2px solid var(--ink); background: var(--sheet); }
.ab-tape-head { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--rule); font-size: 12px; color: var(--ink2); }
.ab-tape-head b { font: 700 15px/1 var(--f-disp); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.ab-tape-roll { list-style: none; margin: 0; padding: 4px 0; max-height: 300px; overflow-y: auto; font: 400 11px/1.5 var(--f-mono); }
.ab-tape-roll li { display: grid; grid-template-columns: 42px 1fr; gap: 8px; padding: 5px 12px; border-bottom: 1px dotted var(--rule); }
.ab-tape-roll li:last-child { border-bottom: 0; }
.ab-tape-roll time { color: var(--ink2); }
.ab-tape-roll .k-ante b { color: var(--blue); }
.ab-tape-roll .k-shut b { color: var(--amber); }
.ab-tape-roll li.is-fresh { animation: ab-print .8s steps(12); }
.ab-tape-roll .ab-tape-empty { display: block; color: var(--ink2); padding: 12px; }
@keyframes ab-print { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

.ab-alt { border: 1.2px solid var(--ink); background: var(--sheet); padding: 12px; font-size: 14px; }
.ab-alt h3 { margin: 0 0 8px; font: 700 18px/1 var(--f-disp); letter-spacing: .08em; text-transform: uppercase; }
.ab-alt ul { list-style: none; margin: 0; padding: 0; font: 400 11.5px/1.6 var(--f-mono); }
.ab-alt li { border-bottom: 1px dotted var(--rule); padding: 4px 0; overflow-wrap: anywhere; }

.ab-rules { border-top: 2px solid var(--ink); padding-top: 10px; }
.ab-rules h2 { margin: 0 0 10px; font: 800 24px/1 var(--f-disp); letter-spacing: .06em; text-transform: uppercase; }
.ab-spec { margin: 0; display: grid; gap: 10px; }
.ab-spec div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; }
.ab-spec dt { font: 600 10px/1.6 var(--f-mono); color: var(--blue); text-transform: uppercase; }
.ab-spec dd { margin: 0; font-size: 14.5px; line-height: 1.45; }
.ab-worked { margin-top: 14px; border: 1.5px dashed var(--blue); padding: 10px 12px; background: rgba(31, 91, 255, .04); }
.ab-worked-k { font: 400 9.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--blue); }
.ab-worked p { margin: 6px 0 0; font-size: 14.5px; }
.ab-worked b { font-family: var(--f-mono); font-size: .88em; }

.ab-foot { border-top: 3px double var(--ink); padding-top: 12px; font-size: 12px; color: var(--ink2); display: grid; gap: 6px; min-width: 0; }
.ab-foot div { display: flex; gap: 8px; flex-wrap: wrap; }
.ab-foot div span { min-width: 92px; font-family: var(--f-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.ab-foot code { font-size: 10.5px; overflow-wrap: anywhere; color: var(--ink); }
.ab-foot-nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 4px; }
.ab-foot-nav a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.ab-foot-nav a.is-here { border-bottom-color: var(--blue); color: var(--blue); }
.ab-foot p { margin: 6px 0 0; }

.ab-pick { position: fixed; inset: 0; z-index: 50; background: rgba(14, 35, 64, .45); display: grid; place-items: center; padding: 20px; }
.ab-pick-in { background: var(--sheet); border: 2px solid var(--ink); padding: 16px; width: min(340px, 100%); display: grid; gap: 8px; }
.ab-pick-in button { display: flex; align-items: center; gap: 8px; border: 1px solid var(--rule); background: #fff; padding: 10px; text-align: left; }
.ab-pick-in img { width: 22px; height: 22px; }
#abPickList { display: grid; gap: 6px; }
.ab-toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--sheet); padding: 10px 16px; font-size: 14px; max-width: calc(100% - 32px); }

/* ---------- ~720–1000: one column, wider measure, bigger object ---------- */
@media (min-width: 600px) {
  .ab-title { padding: 10px 22px; }
  .ab-title-addr { order: 0; flex: 0 1 auto; font-size: 12px; }
  .ab-h1 { margin: 30px 24px 14px; font-size: 64px; }
  .ab-sheet { padding: 0 24px 36px; gap: 24px; }
  .ab-slot { grid-template-columns: 84px minmax(0, 1fr) auto; min-height: 44px; }
  .ab-slot-n { font-size: 18px; }
  .ab-slot-v { font-size: 14px; }
  .ab-say { font-size: 19px; }
  .ab-console { grid-template-columns: 1fr 1fr 1.3fr; align-items: stretch; }
  .ab-ante { grid-column: auto; }
  .ab-call-t, .ab-encore-v { font-size: 36px; }
}

/* ---------- ≥1000: the drawing left, tape + spec in a column beside it ---------- */
@media (min-width: 1000px) {
  .ab-h1 { margin: 36px auto 18px; padding: 0 32px; font-size: 70px; }
  .ab-sheet { margin: 0 auto; padding: 0 32px 48px; grid-template-columns: minmax(0, 1.45fr) minmax(330px, 1fr); gap: 30px; align-items: start; }
  .ab-side { position: sticky; top: 64px; }
  .ab-tape-roll { max-height: 340px; }
  .ab-foot { grid-column: 1 / -1; }
  .ab-stackwrap { padding: 18px 56px 0 16px; }
  .ab-base { margin: 10px -56px 0 -16px; }
  .ab-slot { min-height: 48px; padding: 7px 14px; }
  .ab-slot-plus { right: -52px; }
}
@media (min-width: 1300px) {
  .ab-h1 { font-size: 78px; }
}
