/* Lastclub — the club door. A steel ground, one magenta clock, stencil numerals. The ten-minute dial is the page;
   the CA hangs as a vertical rail on the right edge at every width. */
:root {
  --steel: #121314; --plate: #1b1c1f; --rivet: #2a2c30; --seam: #34363b;
  --bone: #e4e2dc; --ash: #9b9a95; --dim: #6c6b67;
  --mag: #e040fb; --mag-lo: rgba(224, 64, 251, .16); --mag-glow: rgba(224, 64, 251, .45);
  --stamp: 'Black Ops One', 'Impact', sans-serif;
  --text: 'Instrument Sans', system-ui, sans-serif;
  --mono: 'Red Hat Mono', ui-monospace, monospace;
  --rail: 46px;
}
* { box-sizing: border-box; }
html { background: var(--steel); }
body {
  margin: 0; min-height: 100vh; color: var(--bone); background: var(--steel);
  font: 400 15px/1.5 var(--text); -webkit-font-smoothing: antialiased;
  display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 36px;
  grid-template-areas: "plate" "dial" "door" "entry" "verdict" "log" "howto" "tail";
  padding: 0 calc(var(--rail) + 14px) 28px 16px;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.012) 0 2px, transparent 2px 7px);
}
a { color: var(--bone); }
code { font-family: var(--mono); }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }

/* ---------- plate (name + connect, no nav strip) ---------- */
.plate { grid-area: plate; display: flex; align-items: center; gap: 10px; height: 46px; border-bottom: 1px dashed var(--seam); }
.plate-mark { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font: 400 16px/1 var(--stamp); letter-spacing: .06em; text-transform: uppercase; }
.plate-mark img { border-radius: 6px; }
.plate-night { flex: 1; font: 500 11px/1 var(--mono); color: var(--ash); text-transform: uppercase; letter-spacing: .08em; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate-key { border: 1px solid var(--seam); background: var(--plate); color: var(--bone); border-radius: 3px; padding: 6px 10px; font: 600 12px/1 var(--mono); }
.plate-key.is-on { border-color: var(--mag); color: var(--mag); }

/* ---------- the dial: readout overlaid on the gauge ---------- */
.readout, .gauge { grid-area: dial; }
.readout {
  position: relative; z-index: 2; align-self: stretch; justify-self: stretch;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 30px; pointer-events: none; margin-top: 26px;
}
.readout-t { font: 400 clamp(54px, 16vw, 112px)/.9 var(--stamp); letter-spacing: .02em; color: var(--bone); text-shadow: 0 0 28px rgba(0,0,0,.8); font-variant-numeric: tabular-nums; }
.readout-k { font: 500 11px/1.3 var(--mono); color: var(--ash); text-transform: uppercase; letter-spacing: .1em; max-width: min(62%, 300px); text-align: center; }
.gauge.is-hot ~ .readout .readout-t, .is-hot .readout-t { color: var(--mag); }
.gauge {
  position: relative; margin: 26px auto 0; width: min(100%, 300px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #17181a 0 54%, #0d0e0f 55% 100%);
  box-shadow: inset 0 0 0 1px var(--seam), 0 20px 60px rgba(0,0,0,.5); font-size: 11px;
}
.gauge-sweep, .gauge-ticks { position: absolute; inset: 0; border-radius: 50%; }
.gauge-sweep {
  inset: 7%;
  background: conic-gradient(var(--mag) 0 calc(var(--f) * 360deg), var(--rivet) calc(var(--f) * 360deg) 360deg);
  -webkit-mask: radial-gradient(circle closest-side, transparent 0 76%, #000 77% 100%);
  mask: radial-gradient(circle closest-side, transparent 0 76%, #000 77% 100%);
  filter: drop-shadow(0 0 10px var(--mag-glow)); transition: background .9s linear;
}
/* stencil bridges: the ring is cut into 40 segments, like a sprayed numeral */
.gauge-sweep::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: repeating-conic-gradient(transparent 0 8deg, #0d0e0f 8deg 9deg); }
.gauge.is-rest .gauge-sweep { filter: none; background: conic-gradient(rgba(224,64,251,.5) 0 360deg); }
.gauge.is-out .gauge-sweep { background: var(--rivet); filter: none; }
.gauge-ticks {
  inset: 2.5%;
  background: repeating-conic-gradient(var(--dim) 0 .6deg, transparent .6deg 6deg);
  -webkit-mask: radial-gradient(circle closest-side, transparent 0 90%, #000 91% 100%); mask: radial-gradient(circle closest-side, transparent 0 90%, #000 91% 100%);
}
.gauge-needle {
  position: absolute; left: calc(50% - 2px); top: 9%; width: 4px; height: 41%; transform-origin: 50% 100%;
  transform: rotate(calc(var(--f) * 360deg)); background: linear-gradient(var(--mag), transparent); border-radius: 2px; transition: transform .9s linear;
}
.gauge.is-rest .gauge-needle { opacity: .35; }
.gauge-hub { position: absolute; left: calc(50% - 7px); top: calc(50% - 7px); width: 14px; height: 14px; border-radius: 50%; background: var(--rivet); box-shadow: 0 0 0 3px var(--steel); opacity: .0; }
.gauge-lbl { position: absolute; font: 600 10px/1 var(--mono); color: var(--dim); letter-spacing: .06em; }
.gauge-lbl-top { top: 3.5%; left: 50%; transform: translate(-50%, -130%); color: var(--ash); }
.gauge-lbl-b { bottom: 3.5%; left: 50%; transform: translate(-50%, 130%); }

/* ---------- the doorway: last in + pot ---------- */
.doorway { grid-area: door; display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 26px; }
.doorway-slot, .doorway-pot { background: var(--plate); border: 1px solid var(--seam); border-radius: 4px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.doorway-slot { border-left: 4px solid var(--mag); }
.doorway-slot.is-empty { border-left-style: dashed; border-left-color: var(--dim); }
.doorway-slot.is-fresh { animation: knock .9s ease-out; }
@keyframes knock { 0% { background: var(--mag-lo); } 100% { background: var(--plate); } }
.doorway-k { font: 600 10px/1.2 var(--mono); color: var(--ash); text-transform: uppercase; letter-spacing: .12em; }
.doorway-who { font: 500 13px/1.35 var(--mono); word-break: break-all; color: var(--bone); }
.doorway-slot.is-empty .doorway-who { font: 400 17px/1.1 var(--stamp); color: var(--dim); word-break: normal; }
.doorway-sub { font-size: 12px; color: var(--ash); }
.doorway-amt { font: 400 34px/1 var(--stamp); }
.doorway-amt b { font-weight: 400; color: var(--mag); }
.doorway-amt i { font: 600 12px/1 var(--mono); font-style: normal; color: var(--ash); }

/* ---------- the live sentence ---------- */
.verdict { grid-area: verdict; margin: 16px 0 0; font-size: 17px; line-height: 1.45; border-top: 1px dashed var(--seam); padding-top: 14px; }
.verdict b { color: var(--mag); font-weight: 700; }
.verdict code { font-size: .86em; background: var(--plate); padding: 1px 4px; border-radius: 2px; }
.verdict .t { font-family: var(--mono); font-weight: 600; color: var(--bone); background: var(--mag-lo); padding: 0 4px; border-radius: 2px; }

/* ---------- the entry ---------- */
.entry { grid-area: entry; display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.entry-go {
  width: 100%; min-height: 58px; border: 0; border-radius: 4px; background: var(--mag); color: #16051a;
  font: 400 22px/1 var(--stamp); letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 10px 30px var(--mag-lo);
}
.entry-go:disabled { background: var(--rivet); color: var(--ash); box-shadow: none; }
.entry-go.is-first:not(:disabled) { animation: beckon 1.8s ease-in-out infinite; }
@keyframes beckon { 50% { box-shadow: 0 0 0 6px var(--mag-lo), 0 10px 40px var(--mag-glow); } }
.entry-note { font-size: 13px; color: var(--ash); }
.entry-note b { color: var(--bone); }

/* ---------- the tape ---------- */
.log { grid-area: log; margin-top: 28px; min-width: 0; }
.log-h { display: flex; justify-content: space-between; font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--ash); padding-bottom: 8px; border-bottom: 2px solid var(--seam); }
.log-h2 { margin-top: 22px; }
.log-roll { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.log-roll li { display: grid; grid-template-columns: 44px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rivet); font-size: 13px; }
.log-roll li time { font: 500 12px/1.5 var(--mono); color: var(--dim); }
.log-roll li code { font-size: 12px; }
.log-roll li b { color: var(--mag); }
.log-roll li.is-new { animation: print .6s ease-out; }
@keyframes print { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.log-roll .log-empty { display: block; color: var(--ash); padding: 14px 0; }
.log-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tool-btn { flex: 1 1 140px; border: 1px solid var(--seam); background: transparent; color: var(--bone); border-radius: 3px; padding: 9px 10px; font: 600 12px/1.2 var(--mono); }
.tool-btn:disabled { color: var(--dim); border-style: dashed; }
.tool-btn.is-hot { border-color: var(--mag); color: var(--mag); }
.log-past { list-style: none; margin: 0; padding: 0; }
.log-past li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rivet); font-size: 13px; color: var(--ash); }
.log-past li b { font: 400 15px/1.2 var(--stamp); color: var(--bone); }

/* ---------- rules ---------- */
.howto { grid-area: howto; margin-top: 34px; }
.howto-h { font: 400 26px/1.1 var(--stamp); margin: 0 0 14px; letter-spacing: .02em; }
.howto-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.howto-steps li { counter-increment: s; position: relative; padding-left: 40px; color: var(--ash); }
.howto-steps li b { color: var(--bone); }
.howto-steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; font: 400 26px/1 var(--stamp); color: var(--mag); }
.howto-ex { margin-top: 16px; border: 1px dashed var(--mag); border-radius: 4px; padding: 12px 14px; background: rgba(224,64,251,.05); }
.howto-exk { font: 600 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--mag); }
.howto-ex p { margin: 6px 0 0; }
.howto-ex b { color: var(--bone); font-family: var(--mono); }
.howto-more { font-size: 13px; color: var(--ash); }

/* ---------- tail ---------- */
.tail { grid-area: tail; margin-top: 36px; padding-top: 14px; border-top: 1px dashed var(--seam); font-size: 12px; color: var(--ash); }
.tail-links { display: flex; flex-wrap: wrap; gap: 14px; }
.tail-refs { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 12px 0; }
.tail-refs dt { font: 600 10px/1.6 var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.tail-refs dd { margin: 0; font-family: var(--mono); word-break: break-all; }
.tail-note { margin: 0; color: var(--dim); }

/* ---------- the CA rail (fixed, vertical, right edge) ---------- */
.carail {
  position: fixed; right: 6px; top: 50%; transform: translateY(-50%); z-index: 20;
  width: var(--rail); max-height: calc(100vh - 260px); padding: 10px 0;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: #0b0b0c; border: 1px solid var(--seam); border-radius: 23px;
  box-shadow: 0 0 0 1px rgba(224,64,251,.18), 0 10px 30px rgba(0,0,0,.6);
}
.carail-k { font: 400 13px/1 var(--stamp); color: var(--mag); }
.carail-addr {
  writing-mode: vertical-rl; font: 500 11.5px/1.15 var(--mono); color: var(--bone); user-select: all; -webkit-user-select: all;
  letter-spacing: .01em; overflow: hidden; white-space: nowrap;
}
.carail-addr.is-pending { color: var(--ash); font-weight: 400; }
.carail-copy {
  writing-mode: vertical-rl; border: 0; border-radius: 14px; background: var(--mag); color: #16051a; padding: 10px 6px;
  font: 700 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em;
}
.carail-copy:disabled { background: var(--rivet); color: var(--dim); }
.carail-copy.is-done { background: var(--bone); }
.carail-gm { writing-mode: vertical-rl; font: 500 10px/1 var(--mono); color: var(--ash); text-decoration: none; }
.carail-gm[hidden] { display: none; }

/* ---------- slip + toasts ---------- */
.slip[hidden] { display: none; }
.slip { position: fixed; inset: 0; z-index: 40; background: rgba(5,5,6,.72); display: flex; align-items: flex-end; justify-content: center; }
.slip-card { width: min(100%, 680px); max-height: 82vh; overflow-y: auto; background: var(--plate); border: 1px solid var(--seam); border-radius: 10px 10px 0 0; padding: 16px 18px 28px; }
.slip-top { display: flex; justify-content: space-between; align-items: center; font: 400 18px/1 var(--stamp); margin-bottom: 12px; }
.slip-x { border: 1px solid var(--seam); background: transparent; color: var(--bone); border-radius: 3px; padding: 5px 9px; font: 600 11px/1 var(--mono); }
.slip-body table { width: 100%; border-collapse: collapse; font-size: 13px; }
.slip-body th, .slip-body td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--rivet); }
.slip-body th { font: 600 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--ash); }
.slip-body .howto-steps li { color: var(--ash); }
.picker { display: grid; gap: 8px; }
.picker button { display: flex; align-items: center; gap: 10px; border: 1px solid var(--seam); background: var(--steel); color: var(--bone); border-radius: 4px; padding: 10px; }
.picker img { width: 24px; height: 24px; }
.toasts { position: fixed; left: 16px; bottom: 16px; z-index: 50; display: grid; gap: 6px; }
.toast { background: var(--bone); color: var(--steel); font: 600 13px/1.3 var(--text); padding: 9px 12px; border-radius: 3px; max-width: 300px; }

/* ---------- 720–1000: one column, wider measure, bigger dial ---------- */
@media (min-width: 720px) {
  body { padding-left: 32px; padding-right: calc(var(--rail) + 32px); max-width: 760px; margin: 0 auto; }
  .gauge { width: min(100%, 440px); }
  .doorway { grid-template-columns: 1.4fr 1fr; }
  .verdict { font-size: 19px; }
  .readout-k { font-size: 12px; }
}

/* ---------- ≥1000: the dial and door in a primary column, the tape beside it ---------- */
@media (min-width: 1000px) {
  body {
    max-width: 1220px; padding: 0 calc(var(--rail) + 40px) 36px 40px; column-gap: 56px;
    grid-template-columns: minmax(0, 560px) minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto 1fr auto;
    grid-template-areas: "plate plate" "dial log" "door log" "entry log" "verdict log" "howto log" "tail tail";
  }
  .gauge { width: 500px; margin-top: 34px; }
  .readout { margin-top: 34px; }
  .readout-t { font-size: 132px; }
  .log { margin-top: 36px; position: sticky; top: 16px; align-self: start; }
  .log-roll { max-height: 560px; }
  .howto { align-self: start; }
  .carail { right: 14px; }
}
