@font-face { font-family: 'Anybody'; src: url('/fonts/anybody.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Schibsted'; src: url('/fonts/schibsted.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }

:root {
  --bruise: #1E1030;
  --bruise-up: #2A1842;
  --bruise-line: #48305F;
  --bone: #F5EEFB;
  --dust: #BDAACD;
  --aqua: #4EF0C3;
  --amber: #FFB627;
  --pink: #FF3D71;
  --save: #17A586;
  --need: #6C7CF0;
  --want: #E0559A;
  --spare: #C08A12;
  --display: 'Anybody', 'Arial Black', sans-serif;
  --body: 'Schibsted', -apple-system, sans-serif;
  --gutter: clamp(16px, 5vw, 56px);
  --nav-h: calc(62px + env(safe-area-inset-bottom));
}

* { box-sizing: border-box; margin: 0; }
html { background: var(--bruise); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body { background: var(--bruise); color: var(--bone); font: 400 17px/1.5 var(--body); min-height: 100svh; overflow-x: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--aqua); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }

/* Hero tank */
.tank { position: relative; height: calc(100svh - var(--nav-h)); min-height: 520px; }
.tank canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tank-cta { position: absolute; left: var(--gutter); bottom: 22px; }

/* Page */
.page { padding: calc(60px + env(safe-area-inset-top)) var(--gutter) calc(var(--nav-h) + 56px); max-width: 1120px; margin: 0 auto; }
.after-tank { padding-top: 56px; }
.shout { font: 900 clamp(44px, 12vw, 112px)/.95 var(--display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.shout.pink { color: var(--pink); }
.h2 { font: 800 clamp(27px, 5.4vw, 44px)/1.05 var(--display); letter-spacing: -.01em; margin-bottom: 14px; }
.lede { font-size: clamp(19px, 2.6vw, 24px); line-height: 1.32; max-width: 34em; margin-top: 14px; }
.quiet { color: var(--dust); }
.small { font-size: 15px; }
.block { margin-top: 64px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 24px; font: 800 18px/1 var(--display); background: var(--bone); color: var(--bruise); border-radius: 999px; text-decoration: none; transition: transform .12s; }
.btn:active { transform: scale(.96); }
.btn.line { background: none; color: var(--bone); box-shadow: inset 0 0 0 2px var(--bruise-line); }
.btn.danger { background: var(--pink); color: var(--bruise); }
.btn[disabled] { opacity: .5; cursor: default; }
.link { text-decoration: underline; text-underline-offset: 3px; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }

/* Forms */
label.f { display: block; margin-top: 22px; font-weight: 600; }
label.f small { display: block; color: var(--dust); font-weight: 400; font-size: 15px; }
input.t, select.t { display: block; width: 100%; margin-top: 8px; min-height: 54px; padding: 0 16px; background: var(--bruise-up); border: 2px solid var(--bruise-line); border-radius: 14px; font-size: 18px; }
input.t:focus { border-color: var(--aqua); outline: none; }
.money-in { font: 800 clamp(36px, 9vw, 64px)/1 var(--display) !important; min-height: 92px !important; }
.form-narrow { max-width: 520px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 24px; }
.two { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.error { color: var(--pink); font-weight: 700; margin-top: 14px; min-height: 1.5em; }

/* Lock */
.lock { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 48px var(--gutter); max-width: 640px; margin: 0 auto; }
.wordmark { font: 900 clamp(84px, 27vw, 190px)/.85 var(--display); letter-spacing: -.04em; color: var(--pink); }

/* Worst offender, leak rows */
.leak { padding: 28px 0; border-top: 2px solid var(--bruise-line); }
.leak:first-of-type { border-top: 0; }
.leak-amt { font: 900 clamp(38px, 9.5vw, 76px)/1 var(--display); letter-spacing: -.02em; }
.leak-name { font-weight: 700; font-size: 20px; margin-top: 8px; }
.leak-roast { font-size: clamp(19px, 2.5vw, 23px); line-height: 1.32; margin-top: 6px; max-width: 32em; }
.leak-meta { color: var(--dust); font-size: 15px; margin-top: 10px; }

/* Judge deck */
.deck { position: relative; background: var(--bruise-up); border-radius: 28px; padding: 28px 24px; touch-action: pan-y; user-select: none; -webkit-user-select: none; max-width: 620px; will-change: transform; }
.deck-name { font: 900 clamp(38px, 10vw, 68px)/1 var(--display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.deck-q { font-size: 19px; margin-top: 12px; }
.deck-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.deck-btns .worth { background: var(--aqua); color: var(--bruise); }
.deck-btns .waste { background: var(--pink); color: var(--bruise); }
.deck-count { color: var(--dust); font-size: 15px; margin-top: 14px; }

/* Charts */
.chart { position: relative; margin-top: 18px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.tip { position: absolute; top: 0; left: 0; pointer-events: none; background: var(--bone); color: var(--bruise); padding: 6px 10px; border-radius: 8px; font-size: 15px; font-weight: 700; white-space: nowrap; opacity: 0; transition: opacity .1s; z-index: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 15px; color: var(--dust); }
.swatch { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
details.table { margin-top: 12px; font-size: 15px; color: var(--dust); }
details.table summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
details.table table { width: 100%; border-collapse: collapse; }
details.table td { padding: 3px 0; }
details.table td:last-child { text-align: right; }

.split { display: flex; gap: 2px; height: 34px; margin-top: 18px; }
.split i { display: block; min-width: 3px; }
.split i:first-child { border-radius: 8px 0 0 8px; }
.split i:last-child { border-radius: 0 8px 8px 0; }
.split-list { margin-top: 16px; padding: 0; list-style: none; }
.split-list li { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; font-size: 18px; }
.split-list b { white-space: nowrap; }

.cap { margin-top: 18px; }
.cap-top { display: flex; justify-content: space-between; gap: 12px; font-size: 17px; }
.cap-top b { white-space: nowrap; font-weight: 600; }
.cap-track { height: 8px; background: var(--bruise-up); border-radius: 4px; margin-top: 6px; overflow: hidden; }
.cap-fill { height: 100%; border-radius: 4px; background: var(--dust); }
.cap-fill.over { background: var(--pink); }

/* Orders */
.orders { list-style: none; padding: 0; counter-reset: o; }
.orders li { counter-increment: o; position: relative; padding: 20px 0 20px 58px; border-top: 2px solid var(--bruise-line); }
.orders li:first-child { border-top: 0; }
.orders li::before { content: counter(o); position: absolute; left: 0; top: 14px; font: 900 42px/1 var(--display); color: var(--pink); }
.orders b { display: block; font: 800 clamp(22px, 3.6vw, 30px)/1.12 var(--display); }
.orders span { display: block; margin-top: 6px; color: var(--dust); max-width: 36em; }

/* Receipts */
.day-head { font: 800 19px/1 var(--display); margin: 32px 0 6px; }
.tx { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--bruise-up); }
.tx-name { font-weight: 700; overflow-wrap: anywhere; }
.tx-amt { font-weight: 700; white-space: nowrap; }
.tx-sub { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.tx select { background: none; border: 0; color: var(--dust); font-size: 16px; padding: 4px 0; min-height: 36px; max-width: 70%; }
.tx-del { color: var(--dust); font-size: 15px; min-height: 36px; padding: 0 0 0 12px; }

/* Import preview */
.preview { max-height: 380px; overflow: auto; margin-top: 16px; border-top: 1px solid var(--bruise-line); -webkit-overflow-scrolling: touch; }
.pv { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--bruise-up); min-height: 44px; }
.pv input { width: 22px; height: 22px; accent-color: var(--aqua); flex: none; }
.pv-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pv-name small { display: block; color: var(--dust); font-size: 15px; }
.pv b { white-space: nowrap; }

/* Connect */
.steps { padding-left: 1.3em; margin-top: 12px; }
.steps li { padding: 9px 0 9px 6px; max-width: 36em; }
.steps code, .codebox { font: 600 15px/1.4 ui-monospace, Menlo, monospace; }
.steps code { background: var(--bruise-up); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.codebox { display: block; background: var(--bruise-up); border-radius: 14px; padding: 14px 16px; overflow-wrap: anywhere; margin-top: 12px; }
.status { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; }
.status::before { content: ''; width: 11px; height: 11px; border-radius: 50%; background: var(--dust); }
.status.on::before { background: var(--aqua); }

/* Demo strip + nav + toast */
.demo-strip { position: fixed; top: env(safe-area-inset-top); right: 12px; z-index: 30; margin-top: 10px; background: var(--amber); color: var(--bruise); padding: 5px 12px; border-radius: 999px; font-size: 14px; font-weight: 800; text-decoration: none; }
#nav { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: var(--nav-h); padding-bottom: env(safe-area-inset-bottom); background: var(--bruise); border-top: 2px solid var(--bruise-up); display: grid; grid-template-columns: repeat(5, 1fr); }
#nav a { display: flex; align-items: center; justify-content: center; text-decoration: none; font: 700 14px/1 var(--display); color: var(--dust); }
#nav a[aria-current] { color: var(--bone); box-shadow: inset 0 3px 0 var(--pink); }
#toast { position: fixed; z-index: 40; left: 50%; bottom: calc(var(--nav-h) + 14px); transform: translate(-50%, 20px); background: var(--bone); color: var(--bruise); padding: 12px 18px; border-radius: 14px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; width: max-content; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 899px) { .wide > section + section { margin-top: 64px; } }
@media (min-width: 900px) {
  #nav { left: 50%; right: auto; width: 620px; transform: translateX(-50%); bottom: 16px; height: 60px; border: 2px solid var(--bruise-line); border-radius: 999px; padding: 0 12px; overflow: hidden; background: var(--bruise-up); }
  #nav a[aria-current] { box-shadow: none; color: var(--pink); }
  .tank { height: 100svh; }
  .tank-cta { bottom: 96px; }
  .wide { display: grid; grid-template-columns: 1fr 1fr; gap: 0 72px; align-items: start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
