/* CLEAVE. Carved stone and a crimson edge. One token sheet, one accent (crimson) and one reward colour (gold), sharp
   corners, engraved double hairlines. The live arena is the picture: the title is a centred column with the fight on its
   left and the ladder of forms on its right; in the arena the HUD reads like a fighting game. */
:root {
  --bg: #0b0908; --s1: #14100e; --s2: #1b1613; --s3: #251e1a; --s4: #332a24;
  --ink: #f4ede4; --ink2: #bcaea2; --ink3: #85786e;
  --line: rgba(244, 237, 228, .1); --line2: rgba(244, 237, 228, .2); --deep: rgba(0, 0, 0, .55);
  --acc: #e5383b; --acc-hi: #ff5650; --acc-ink: #fff5ee; --gold: #f6c765; --gold-ink: #2a1c05; --warn: #ffb347;
  --panel: rgba(16, 12, 11, .92);
  --r1: 3px; --r2: 4px; --r3: 6px;
  --f-d: 'Cormorant', 'Cormorant Garamond', Georgia, serif; --f-t: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; --f-m: 'Chivo Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --pad: 36px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--f-t); overflow: hidden; -webkit-font-smoothing: antialiased; overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
::selection { background: var(--acc); color: var(--acc-ink); }
:where(a) { color: inherit; text-decoration: none; }
:where(button, input) { font: inherit; color: inherit; }
:where(input) { -webkit-user-select: text; user-select: text; }
:where(button) { background: none; border: 0; padding: 0; cursor: pointer; }
:where(ol, ul) { list-style: none; margin: 0; padding: 0; }
:where(h1, h2, p) { margin: 0; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; cursor: crosshair; }

.lab { font: 600 10.5px/1 var(--f-m); letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); white-space: nowrap; }
.lab i { font-style: normal; letter-spacing: .02em; text-transform: none; color: var(--ink3); opacity: .85; margin-left: 6px; font-family: var(--f-t); font-weight: 400; }
.num, .mono { font-family: var(--f-m); font-variant-numeric: tabular-nums; }
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 3px; background: rgba(244, 237, 228, .08); border: 1px solid var(--line2); border-bottom-width: 2px; font: 600 10.5px/1 var(--f-m); color: var(--ink2); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--acc); animation: pulse 1.8s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(229, 56, 59, .6); } 100% { box-shadow: 0 0 0 9px rgba(229, 56, 59, 0); } }
/* a panel: flat stone, an engraved line 3 px inside the edge, a crimson top edge */
.card { background: var(--panel); border: 1px solid var(--line2); border-top: 2px solid var(--acc); border-radius: var(--r2); box-shadow: inset 0 0 0 3px rgba(11, 9, 8, .9), inset 0 0 0 4px var(--line), 0 30px 60px -30px #000; }
.is-hidden { visibility: hidden; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 14px; height: 54px; padding: 0 24px; border-radius: var(--r1); font: 700 19px/1 var(--f-d); letter-spacing: .16em; text-transform: uppercase; transition: transform .14s var(--ease), background .14s, border-color .14s; }
.btn-primary { background: var(--acc); color: var(--acc-ink); box-shadow: inset 0 -3px 0 rgba(60, 4, 6, .45), inset 0 1px 0 rgba(255, 200, 190, .25); }
.btn-primary:hover { background: var(--acc-hi); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(1px); box-shadow: inset 0 -1px 0 rgba(60, 4, 6, .45); }
.btn-primary kbd { background: rgba(40, 6, 6, .22); border-color: rgba(40, 6, 6, .34); color: var(--acc-ink); }
.btn-ghost { border: 1px solid var(--line2); color: var(--ink2); }
.btn-ghost:hover { border-color: var(--ink2); color: var(--ink); }
.btn-small { height: 36px; padding: 0 16px; font-size: 14px; }
.field { display: grid; gap: 7px; text-align: left; }
.field input:not([type=range]) { width: 100%; height: 44px; padding: 0 13px; border-radius: var(--r1); background: rgba(8, 6, 5, .8); border: 1px solid var(--line2); color: var(--ink); font-size: 15px; outline: 0; transition: border-color .14s, background .14s; }
.field input.mono { font-size: 12.5px; }
.field input::placeholder { color: var(--ink3); }
.field input:not([type=range]):focus { border-color: var(--acc); background: var(--s2); }
.field input.is-bad { border-color: var(--warn); }
.field input[type=range] { width: 100%; accent-color: var(--acc); }
.hint { font-size: 12.5px; line-height: 1.4; color: var(--ink3); min-height: 18px; }
.hint.is-bad { color: var(--warn); }
.acct { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; min-height: 20px; font-size: 13px; color: var(--ink3); }
.acct b { color: var(--ink); font-weight: 600; }
.link { color: var(--ink); font-size: 13px; text-decoration: underline; text-decoration-color: var(--acc); text-underline-offset: 3px; }
.link:hover { color: var(--acc-hi); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink2); }
.check input { width: 16px; height: 16px; accent-color: var(--acc); }

/* top bar: a solid band with an engraved foot */
.nav { position: fixed; z-index: 30; top: 0; left: 0; right: 0; height: 60px; display: flex; align-items: center; gap: 30px; padding: 0 var(--pad); background: rgba(11, 9, 8, .94); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(0, 0, 0, .7), 0 4px 0 -3px rgba(244, 237, 228, .05); }
.brand { display: flex; flex: none; align-items: center; gap: 12px; font: 700 26px/1 var(--f-d); letter-spacing: .24em; text-transform: uppercase; }
.mark { width: 30px; height: 30px; border-radius: 4px; }
.nav-links { display: flex; flex: none; gap: 24px; font-size: 14px; color: var(--ink2); white-space: nowrap; }
.nav-links a, .nav-links .link { color: var(--ink2); font-size: 14px; text-decoration: none; transition: color .14s; }
.nav-links a:hover, .nav-links .link:hover { color: var(--ink); }
.nav-side { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.live { display: inline-flex; align-items: center; gap: 9px; height: 32px; padding: 0 13px; border-radius: var(--r1); background: rgba(244, 237, 228, .04); border: 1px solid var(--line); font-size: 13px; color: var(--ink2); white-space: nowrap; }
.live b { color: var(--ink); font-family: var(--f-m); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.chip { display: inline-flex; align-items: center; gap: 9px; height: 32px; padding: 0 13px; border-radius: var(--r1); background: rgba(244, 237, 228, .04); border: 1px solid var(--line); font: 600 12px/1 var(--f-m); color: var(--ink); }
.chip:hover { border-color: var(--acc); }
.xl { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--r1); background: rgba(244, 237, 228, .04); border: 1px solid var(--line); color: var(--ink); }
.xl:hover { border-color: var(--acc); }
body.is-playing .nav { display: none; }

/* ------------------------------------------------------------- the title: the fight on the left, a centred column, the ladder on the right */
.title { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.title::before { content: ''; position: absolute; z-index: 0; inset: 0; background: radial-gradient(ellipse 30% 62% at 50% 54%, rgba(11, 9, 8, .9) 0, rgba(11, 9, 8, .74) 55%, rgba(11, 9, 8, 0) 100%), linear-gradient(270deg, rgba(11, 9, 8, .9) 0, rgba(11, 9, 8, .55) 22%, rgba(11, 9, 8, 0) 34%); }
.title > * { position: absolute; z-index: 1; pointer-events: auto; }
.hero { left: 50%; top: calc(50% + 4px); transform: translate(-50%, -50%); width: min(580px, calc(100vw - 2 * var(--pad))); display: grid; justify-items: center; text-align: center; animation: rise .7s var(--ease) both; }
@keyframes rise { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
.crest { position: relative; width: 116px; height: 116px; margin-bottom: 14px; border-radius: 50%; background: radial-gradient(circle at 50% 42%, #2b211c 0, #14100e 70%); border: 1px solid var(--line2); box-shadow: 0 0 0 5px rgba(11, 9, 8, .92), 0 0 0 6px rgba(229, 56, 59, .55), 0 18px 40px -10px #000; }
.crest canvas { position: absolute; inset: 0; width: 116px; height: 116px; }
.eyebrow { display: flex; align-items: center; justify-content: center; gap: 10px; font: 600 11.5px/1 var(--f-m); letter-spacing: .2em; text-transform: uppercase; color: var(--acc-hi); margin-bottom: 14px; }
.eyebrow.is-down { color: var(--ink2); }
.h1 { font: 700 46px/.88 var(--f-d); font-size: clamp(46px, min(5.6vw, 9vh), 96px); letter-spacing: .03em; text-transform: uppercase; text-shadow: 0 3px 0 rgba(0, 0, 0, .6); }
.h1-sub { margin-top: 12px; font: italic 600 20px/1.1 var(--f-d); font-size: clamp(20px, 2vw, 28px); color: var(--acc-hi); letter-spacing: .02em; }
.lead { margin: 16px 0 22px; max-width: 48ch; font-size: 15.5px; line-height: 1.55; color: var(--ink2); }
.play { display: grid; gap: 12px; padding: 18px; width: 100%; text-align: left; }
.play-fields { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.3fr); gap: 12px; }
.play .btn { width: 100%; }
.play .acct { justify-content: center; }
/* the ladder: the twelve forms, what each pays now and who is at it right now */
.rail { right: var(--pad); top: 84px; bottom: 76px; width: 340px; display: flex; flex-direction: column; animation: rise .7s .12s var(--ease) both; }
.rail-head { display: flex; justify-content: space-between; align-items: center; flex: none; height: 38px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.rungs { flex: 1; min-height: 0; display: flex; flex-direction: column-reverse; padding: 4px 0; }
.rungs li { flex: 1 1 0; min-height: 0; max-height: 72px; display: grid; grid-template-columns: 44px minmax(0, 1fr) 80px; align-items: center; gap: 10px; padding: 0 16px 0 13px; border-left: 3px solid transparent; }
.rungs li + li { border-bottom: 1px solid rgba(244, 237, 228, .05); }
.rungs li.is-held { border-left-color: var(--acc); background: linear-gradient(90deg, rgba(229, 56, 59, .1), rgba(229, 56, 59, 0) 70%); }
.rungs li.is-top .rn { color: var(--gold); }
.rungs canvas { width: 44px; height: 44px; }
.rungs .rt { display: grid; gap: 3px; min-width: 0; }
.rungs .rn { font: 700 16px/1 var(--f-d); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.rungs .rw { font-size: 11.5px; line-height: 1.2; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rungs .rw b { color: var(--ink2); font-weight: 500; }
.rungs .rp { font: 500 12.5px/1 var(--f-m); font-variant-numeric: tabular-nums; text-align: right; color: var(--gold); white-space: nowrap; }
.rungs .rp.is-low { color: var(--ink3); }
.rail-foot { flex: none; padding: 10px 16px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink3); text-align: center; }
/* the numbers, in one engraved line along the bottom */
.ticker { left: 0; right: 0; bottom: 0; height: 52px; display: flex; justify-content: center; align-items: center; gap: 0; background: rgba(11, 9, 8, .94); border-top: 1px solid var(--line); box-shadow: 0 -1px 0 rgba(0, 0, 0, .7); }
.tk { display: flex; align-items: baseline; gap: 9px; padding: 0 22px; white-space: nowrap; min-width: 0; }
.tk + .tk { border-left: 1px solid var(--line); box-shadow: -1px 0 0 rgba(0, 0, 0, .6); }
.tk b { font: 600 16px/1 var(--f-m); font-variant-numeric: tabular-nums; color: var(--ink); }
.tk b:not(.num) { font: 600 14px/1 var(--f-t); }
.tk:first-child b, .tk:nth-child(2) b { color: var(--gold); }
.tk i { font-style: normal; font-size: 12px; color: var(--ink3); overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------- in the arena: a fighting-game HUD, fixed slots, nothing moves */
.hud { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.hud > * { pointer-events: auto; position: absolute; }
/* you: your form's portrait in a ring that fills toward the next form, its name, what you are worth */
.badge { left: 16px; top: 16px; width: 392px; height: 100px; display: grid; grid-template-columns: 100px minmax(0, 1fr); align-items: center; gap: 4px; padding: 0 14px 0 8px; background: var(--panel); border: 1px solid var(--line2); border-left: 3px solid var(--acc); border-radius: var(--r2); box-shadow: inset 0 0 0 3px rgba(11, 9, 8, .9), inset 0 0 0 4px var(--line), 0 30px 60px -30px #000; pointer-events: none; }
.face { position: relative; width: 84px; height: 84px; justify-self: center; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #2b211c 0, #120e0c 72%); }
.face canvas { position: absolute; inset: 4px; width: 76px; height: 76px; border-radius: 50%; }
.face-ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--acc) calc(var(--k, 0) * 1turn), rgba(244, 237, 228, .12) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); }
.badge.is-top .face-ring { background: var(--gold); }
.badge-text { display: grid; grid-template-rows: 24px 30px 20px; align-content: center; gap: 2px; min-width: 0; }
.badge-top { display: grid; grid-template-columns: minmax(0, 1fr) 8ch; align-items: baseline; gap: 10px; min-width: 0; }
.badge-top .lab { text-align: right; }
.badge-top b { font: 700 25px/1 var(--f-d); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-worth { display: flex; align-items: baseline; gap: 10px; }
.badge-worth b { font: 600 25px/1 var(--f-m); color: var(--gold); white-space: nowrap; }
.badge-worth i { font-style: normal; font-size: 11px; color: var(--ink3); white-space: nowrap; }
.badge-next { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink3); white-space: nowrap; min-width: 0; }
.badge-next #g-pts { font-family: var(--f-m); font-variant-numeric: tabular-nums; color: var(--ink2); }
.badge-next #g-next { font: 700 13px/1 var(--f-d); letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; }
.badge-next .to { color: var(--ink3); }
.badge-next canvas { width: 22px; height: 22px; flex: none; }
.badge.is-top .badge-next { visibility: hidden; }
/* the pot over the leaderboard */
.lb { top: 16px; right: 16px; width: 320px; pointer-events: none; }
.lb-pot { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 5px; align-items: baseline; padding: 12px 16px 10px; border-bottom: 1px solid var(--line); }
.lb-pot b { grid-row: span 2; justify-self: end; font: 600 22px/1 var(--f-m); color: var(--gold); }
.lb-pot i { font-style: normal; font-size: 11.5px; color: var(--ink3); }
.rows { padding: 6px 0; }
.rows li { display: grid; grid-template-columns: 20px 12px minmax(0, 1fr) 84px 64px; align-items: center; gap: 8px; height: 26px; padding: 0 14px; font-size: 13px; }
.rows li.is-me { background: rgba(229, 56, 59, .14); box-shadow: inset 3px 0 0 var(--acc); }
.rows li.is-gap { border-top: 1px dashed var(--line); }
.rows .rk { font: 500 11px/1 var(--f-m); color: var(--ink3); text-align: right; }
.rows .sw { width: 12px; height: 12px; border-radius: 2px; }
.rows .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 500; }
.rows .fm { font: 700 12px/1 var(--f-d); letter-spacing: .08em; text-transform: uppercase; text-align: right; color: var(--ink2); white-space: nowrap; overflow: hidden; }
.rows .cy { font: 500 12px/1 var(--f-m); font-variant-numeric: tabular-nums; text-align: right; color: var(--gold); }
/* the kill feed, top centre */
.feed { left: 50%; top: 16px; transform: translateX(-50%); width: min(520px, calc(100vw - 2 * 420px)); height: 112px; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.feed li { max-width: 100%; height: 24px; padding: 0 12px; border-radius: var(--r1); background: rgba(16, 12, 11, .82); border: 1px solid var(--line); font-size: 12.5px; line-height: 22px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: drop .3s var(--ease) both; }
.feed li b { color: var(--ink); font-weight: 600; }
.feed li em { font-style: normal; color: var(--gold); font-family: var(--f-m); font-size: 12px; }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
/* your blade landed */
.ko { left: 50%; top: 150px; transform: translateX(-50%); display: flex; gap: 14px; height: 52px; padding: 0 26px; align-items: center; background: linear-gradient(90deg, rgba(229, 56, 59, 0), rgba(160, 16, 22, .92) 18%, rgba(160, 16, 22, .92) 82%, rgba(229, 56, 59, 0)); pointer-events: none; visibility: hidden; white-space: nowrap; }
.ko .ko-k { font: 700 13px/1 var(--f-m); letter-spacing: .3em; text-transform: uppercase; color: rgba(255, 245, 238, .78); }
.ko b { font: 700 30px/1 var(--f-d); letter-spacing: .08em; text-transform: uppercase; color: #fff; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.ko em { font-style: normal; font-size: 20px; color: var(--gold); }
.ko.is-on { visibility: visible; animation: ko 1.6s var(--ease) both; }
@keyframes ko { 0% { opacity: 0; transform: translateX(-50%) scaleX(.3); } 10% { opacity: 1; transform: translateX(-50%) scaleX(1.04); } 16% { transform: translateX(-50%) scaleX(1); } 78% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-6px); } }
/* a new form: its name in large type for a second */
.formup { left: 50%; top: 34%; transform: translateX(-50%); width: min(620px, calc(100vw - 2 * 410px)); display: grid; justify-items: center; gap: 8px; pointer-events: none; visibility: hidden; }
.formup span { font: 600 12px/1 var(--f-m); letter-spacing: .34em; text-transform: uppercase; color: var(--acc-hi); }
.formup b { font: 700 38px/1 var(--f-d); font-size: clamp(38px, 4.6vw, 76px); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); text-shadow: 0 4px 0 rgba(0, 0, 0, .55), 0 0 40px rgba(229, 56, 59, .35); white-space: nowrap; }
.formup.is-on { visibility: visible; animation: formup 1.3s var(--ease) both; }
@keyframes formup { 0% { opacity: 0; transform: translateX(-50%) scale(1.3); } 14% { opacity: 1; transform: translateX(-50%) scale(1); } 76% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-10px); } }
/* kneeling: the seconds left, big, above the dock */
.count { left: 50%; bottom: 104px; transform: translateX(-50%); display: grid; justify-items: center; gap: 4px; pointer-events: none; visibility: hidden; }
.count b { font: 600 64px/1 var(--f-m); color: var(--gold); text-shadow: 0 3px 0 rgba(0, 0, 0, .6); }
.count span { font: 600 11px/1 var(--f-m); letter-spacing: .24em; text-transform: uppercase; color: var(--warn); }
.count.is-on { visibility: visible; }
.mini { right: 16px; bottom: 16px; width: 180px; height: 180px; padding: 6px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line2); box-shadow: 0 0 0 4px rgba(11, 9, 8, .85), 0 0 0 5px var(--line); pointer-events: none; }
.mini canvas { display: block; width: 166px; height: 166px; border-radius: 50%; }
/* the dock: the dash meter and the cash-out hold, one panel */
.dock { left: 50%; bottom: 20px; transform: translateX(-50%); width: min(640px, calc(100vw - 2 * 216px)); height: 66px; display: grid; grid-template-columns: 132px minmax(0, 1fr); background: var(--panel); border: 1px solid var(--line2); border-top: 2px solid var(--acc); border-radius: var(--r2); box-shadow: inset 0 0 0 3px rgba(11, 9, 8, .9), inset 0 0 0 4px var(--line), 0 30px 60px -30px #000; pointer-events: none; }
.dock.is-on { border-color: rgba(246, 199, 101, .7); border-top-color: var(--gold); box-shadow: inset 0 0 0 3px rgba(11, 9, 8, .9), inset 0 0 0 4px rgba(246, 199, 101, .2), 0 0 0 4px rgba(246, 199, 101, .12), 0 30px 60px -30px #000; }
.dash { display: grid; grid-template-columns: 1fr auto; grid-template-rows: 22px 6px; align-content: center; row-gap: 10px; padding: 0 16px; border-right: 1px solid var(--line); }
.dash-bar { grid-column: 1 / -1; height: 6px; border-radius: 1px; background: var(--s4); overflow: hidden; }
.dash-bar i { display: block; height: 100%; width: 100%; background: var(--ink3); }
.dash.is-ready .dash-bar i { background: var(--ink); }
.dash.is-ready .lab { color: var(--ink); }
.cash { display: grid; grid-template-rows: 22px 6px; align-content: center; row-gap: 10px; padding: 0 18px; min-width: 0; }
.cash-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13.5px; color: var(--ink2); white-space: nowrap; min-width: 0; }
.cash-row span { overflow: hidden; text-overflow: ellipsis; }
.cash-row b { color: var(--gold); font-weight: 600; font-size: 15px; }
.cash-bar { height: 6px; border-radius: 1px; background: var(--s4); overflow: hidden; }
.cash-bar i { display: block; height: 100%; width: 0; background: var(--gold); }
.cash.is-on .cash-row { color: var(--ink); }
.cash.is-wait .cash-row { color: var(--warn); }
.hud-menu { left: 16px; bottom: 20px; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; border-radius: var(--r1); background: var(--panel); border: 1px solid var(--line); font-size: 12px; color: var(--ink2); }
.hud-menu:hover { color: var(--ink); border-color: var(--line2); }
/* cut down: the edges of the screen flash red */
.hitfx { position: fixed; inset: 0; z-index: 15; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(160, 16, 22, 0) 45%, rgba(160, 16, 22, .55) 100%); }
.hitfx.is-on { animation: hit .7s ease-out both; }
@keyframes hit { 0% { opacity: 1; } 100% { opacity: 0; } }
/* a phone: a stick on the left; swing, dash and hold-to-cash on the right */
.stick, .tbtn { display: none; }
.stick { left: 22px; bottom: 168px; width: 124px; height: 124px; border-radius: 50%; background: rgba(16, 12, 11, .5); border: 1px solid var(--line2); pointer-events: none; }
.stick i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(244, 237, 228, .22); border: 1px solid rgba(244, 237, 228, .4); }
.tbtn { align-items: center; justify-content: center; border-radius: 50%; font: 700 13px/1 var(--f-d); letter-spacing: .12em; text-transform: uppercase; touch-action: none; }
.tbtn-swing { right: 20px; bottom: 170px; width: 96px; height: 96px; background: var(--acc); color: var(--acc-ink); font-size: 15px; box-shadow: inset 0 -3px 0 rgba(60, 4, 6, .45); }
.tbtn-dash { right: 128px; bottom: 164px; width: 66px; height: 66px; background: var(--panel); border: 1px solid var(--line2); color: var(--ink); }
.tbtn-dash.is-cool { color: var(--ink3); border-color: var(--line); }
.tbtn-cash { right: 16px; bottom: 282px; width: auto; height: 42px; padding: 0 16px; border-radius: var(--r1); background: var(--gold); color: var(--gold-ink); }

.toast { position: fixed; z-index: 60; bottom: 104px; left: 50%; transform: translateX(-50%); max-width: min(560px, calc(100vw - 32px)); padding: 11px 16px; border-radius: var(--r2); background: var(--panel); border: 1px solid var(--line2); font-size: 14px; color: var(--ink); text-align: center; pointer-events: none; transition: opacity .2s, transform .2s var(--ease); }
.toast.is-hidden { opacity: 0; transform: translate(-50%, 6px); }
.toast.is-bad { border-color: rgba(255, 179, 71, .7); }
.toast.is-good { border-color: rgba(246, 199, 101, .7); }
.toast em { font-style: normal; color: var(--gold); font-family: var(--f-m); }
body:not(.is-playing) .toast { bottom: 72px; }

/* ------------------------------------------------------------- sheets: centred over the dimmed arena */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(7, 5, 4, .7); animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { width: min(480px, calc(100vw - 32px)); padding: 28px; display: grid; gap: 16px; animation: rise .35s var(--ease) both; }
.sheet-wide { width: min(620px, calc(100vw - 32px)); }
.sheet .eyebrow { margin: 0; justify-content: flex-start; }
.sheet-out, .sheet-paid { padding-top: 22px; justify-items: stretch; text-align: center; }
.sheet-out .eyebrow, .sheet-paid .eyebrow { justify-content: center; }
.sheet-paid { border-top-color: var(--gold); }
.sheet-face { justify-self: center; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #2b211c 0, #120e0c 72%); box-shadow: 0 0 0 4px rgba(11, 9, 8, .9), 0 0 0 5px var(--line2); }
.sheet-out .sheet-face { box-shadow: 0 0 0 4px rgba(11, 9, 8, .9), 0 0 0 5px rgba(229, 56, 59, .7); filter: grayscale(.55) brightness(.8); }
.sheet-paid .sheet-face { box-shadow: 0 0 0 4px rgba(11, 9, 8, .9), 0 0 0 5px rgba(246, 199, 101, .8); }
.sheet-face canvas { width: 100px; height: 100px; }
.h2 { font: 700 36px/1.02 var(--f-d); letter-spacing: .06em; text-transform: uppercase; }
.h2.num { font: 600 40px/1 var(--f-m); letter-spacing: 0; color: var(--gold); text-transform: none; }
.sub { font-size: 14.5px; line-height: 1.5; color: var(--ink2); min-height: 22px; }
.sub b { color: var(--ink); font-weight: 600; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r1); overflow: hidden; text-align: left; }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid4 .cell { display: grid; gap: 9px; padding: 13px 12px; background: var(--s1); min-width: 0; }
.grid4 .cell b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid4 .cell b:not(.num) { font: 700 17px/1.1 var(--f-d); letter-spacing: .08em; text-transform: uppercase; }
.row-btns { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; margin-top: 4px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.step { height: 34px; display: grid; place-items: center; border-radius: var(--r1); background: var(--s2); border: 1px solid var(--line); font: 600 11px/1 var(--f-m); letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.step.is-on { color: var(--gold-ink); background: var(--gold); border-color: var(--gold); }
.step.is-bad { color: var(--gold-ink); background: var(--warn); border-color: var(--warn); }
.txlink { font-size: 13px; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; height: 20px; }
.how { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r1); overflow: hidden; counter-reset: how; }
.how li { display: grid; grid-template-columns: 30px 128px minmax(0, 1fr); align-items: baseline; gap: 6px; padding: 14px 16px; background: var(--s1); counter-increment: how; font-size: 14px; line-height: 1.5; color: var(--ink2); }
.how li::before { content: 'I'; font: 700 15px/1 var(--f-d); color: var(--acc-hi); }
.how li:nth-child(2)::before { content: 'II'; } .how li:nth-child(3)::before { content: 'III'; } .how li:nth-child(4)::before { content: 'IV'; }
.how li b { font: 700 17px/1.1 var(--f-d); text-transform: uppercase; letter-spacing: .1em; color: var(--ink); }
.how kbd { margin: 0 2px; }

/* ------------------------------------------------------------- docs and ledger pages */
body.is-page { overflow: auto; -webkit-user-select: text; user-select: text; }
.page { position: relative; z-index: 5; width: min(920px, calc(100vw - 2 * var(--pad))); margin: 0 auto; padding: 112px 0 80px; display: grid; gap: 56px; }
.page-head { text-align: center; display: grid; justify-items: center; }
.page-head .h1 { font-size: clamp(40px, 5vw, 72px); }
.page-head .lead { margin-bottom: 0; }
.sec { display: grid; gap: 18px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(0, 0, 0, .6); }
.sec-head h2 { font: 700 28px/1 var(--f-d); text-transform: uppercase; letter-spacing: .1em; margin: 0; }
.sec p { color: var(--ink2); max-width: 70ch; }
.sec p b { color: var(--ink); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line2); border-top: 2px solid var(--acc); border-radius: var(--r2); overflow: hidden; }
.tiles .cell { display: grid; gap: 10px; padding: 18px 16px; background: var(--s1); min-width: 0; }
.tiles .cell b { font: 600 19px/1 var(--f-m); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--gold); }
.tiles .cell i { font-style: normal; font-size: 12px; color: var(--ink3); }
.rules { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.rules li { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; padding: 15px 18px; background: var(--s1); font-size: 14.5px; color: var(--ink2); }
.rules li b { color: var(--ink); font: 700 17px/1.2 var(--f-d); letter-spacing: .06em; text-transform: uppercase; }
.ladder { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.ladder .cell { display: grid; justify-items: center; gap: 6px; padding: 12px 8px 14px; background: var(--s1); min-width: 0; }
.ladder canvas { width: 96px; height: 96px; }
.ladder b { font: 700 14px/1 var(--f-d); letter-spacing: .1em; text-transform: uppercase; }
.ladder i { font-style: normal; font: 500 11px/1 var(--f-m); color: var(--ink3); }
.ladder em { font-style: normal; font: 600 12px/1 var(--f-m); color: var(--gold); }
.table { border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.table .tr { display: grid; grid-template-columns: 96px 170px minmax(0, 1fr) 130px 110px; align-items: center; gap: 12px; height: 40px; padding: 0 18px; font-size: 13.5px; background: var(--s1); border-top: 1px solid var(--line); }
.table .tr:first-child { border-top: 0; background: var(--s2); height: 36px; }
.table .tr4 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
.table .tr span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink2); }
.table .tr .amt { text-align: right; color: var(--ink); }
.table .tr .amt.is-in { color: var(--gold); }
.table .tr a { color: var(--gold); font-family: var(--f-m); font-size: 12px; text-align: right; }
.table .empty { padding: 26px 18px; background: var(--s1); color: var(--ink3); font-size: 14px; }
.foot { display: flex; justify-content: space-between; gap: 16px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink3); }

/* ------------------------------------------------------------- smaller screens */
@media (max-width: 1500px) { .rail { width: 300px; } .rungs li { grid-template-columns: 38px minmax(0, 1fr) 72px; gap: 8px; } .rungs canvas { width: 38px; height: 38px; } .feed { width: min(440px, calc(100vw - 2 * 400px)); } }
@media (max-width: 1500px) { .tk { padding: 0 14px; } .tk i { display: none; } }
@media (max-width: 1280px) { .lb { width: 280px; } .lb .rows li { grid-template-columns: 18px 12px minmax(0, 1fr) 70px 58px; gap: 6px; } .feed { display: none; } .ko { top: 128px; } }
@media (max-width: 1260px) { .rail { display: none; } .title::before { background: radial-gradient(ellipse 46% 64% at 50% 54%, rgba(11, 9, 8, .9) 0, rgba(11, 9, 8, .7) 55%, rgba(11, 9, 8, .15) 100%); } }
@media (max-width: 1100px) { .lb { display: none; } .formup { width: min(620px, calc(100vw - 2 * 420px + 336px)); } }
@media (max-width: 980px) { .tk:nth-child(n + 4) { display: none; } }
@media (max-width: 820px) {
  :root { --pad: 16px; }
  .nav { height: 54px; gap: 14px; } .nav-links { display: none; } .brand { font-size: 21px; letter-spacing: .18em; } .chip { display: none; }
  .title { overflow-y: auto; pointer-events: auto; }
  .title::before { background: rgba(11, 9, 8, .8); }
  .hero { top: 0; transform: translateX(-50%); position: relative; margin: 72px 0 72px; }
  .crest { width: 84px; height: 84px; margin-bottom: 10px; } .crest canvas { width: 84px; height: 84px; }
  .lead { font-size: 14.5px; margin: 12px 0 16px; }
  .play-fields { grid-template-columns: 1fr; }
  .ticker { position: fixed; height: 48px; } .tk { padding: 0 12px; } .tk:nth-child(n + 3) { display: none; }
  .badge { left: 8px; top: 8px; width: min(300px, calc(100vw - 120px)); height: 76px; grid-template-columns: 70px minmax(0, 1fr); padding: 0 10px 0 4px; }
  .face { width: 62px; height: 62px; } .face canvas { width: 54px; height: 54px; }
  .badge-text { grid-template-rows: 20px 24px; } .badge-top b { font-size: 19px; } .badge-worth b { font-size: 19px; } .badge-worth i { display: none; } .badge-next { display: none; }
  .mini { width: 96px; height: 96px; padding: 4px; right: 8px; top: 8px; bottom: auto; } .mini canvas { width: 86px; height: 86px; }
  .dock { bottom: 12px; width: calc(100vw - 16px); grid-template-columns: minmax(0, 1fr); height: 60px; } .dash { display: none; }
  .count { bottom: 96px; } .count b { font-size: 48px; }
  .ko { top: 152px; height: 44px; max-width: calc(100vw - 16px); padding: 0 20px; } .ko .ko-k { display: none; } .ko b { font-size: 22px; max-width: 50vw; }
  .formup { width: calc(100vw - 16px); top: 30%; }
  .formup b { font-size: 40px; }
  .hud-menu { left: auto; right: 8px; top: 112px; bottom: auto; }
  .toast { bottom: 84px; }
  .grid4, .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ladder { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rules li, .how li { grid-template-columns: 1fr; }
  .modal { overflow-y: auto; } .sheet { padding: 20px; gap: 12px; } .how li { padding: 10px 12px; gap: 3px; font-size: 13px; line-height: 1.45; } .h2 { font-size: 30px; }
  .how li::before { display: none; }
  .table .tr { grid-template-columns: 70px minmax(0, 1fr) 96px; } .table .tr span:nth-child(2), .table .tr :nth-child(5) { display: none; }
}
@media (max-height: 820px) and (min-width: 821px) { .crest { width: 84px; height: 84px; margin-bottom: 8px; } .crest canvas { width: 84px; height: 84px; } .lead { margin: 10px 0 14px; font-size: 14.5px; } .play { gap: 9px; padding: 14px; } .eyebrow { margin-bottom: 10px; } .field input:not([type=range]) { height: 40px; } .rail-foot { display: none; } }
@media (max-height: 760px) and (min-width: 821px) { .crest { display: none; } }
@media (max-height: 660px) and (min-width: 821px) { .lead { display: none; } }
@media (pointer: coarse) { .stick { display: block; } .tbtn { display: inline-flex; } .hud-menu kbd { display: none; } #game { cursor: default; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
