/* BAGHUNT base system: tokens, type, buttons, chips, fields, cards, skeletons, toasts, modal, motion switch.
   Black + neon green #38FF55. One accent, used for rewards, the active state and the main button. No backdrop-filter, no heavy filters. */
:root {
  --bg: #050806; --bg2: #0a110c; --bg3: #101a13; --line: #173321; --line2: #24472f;
  --g: #38ff55; --g2: #1fc23c; --g3: #0f6b22; --gdim: rgba(56, 255, 85, .14); --gglow: rgba(56, 255, 85, .38);
  --gold: #ffc93a; --gold2: #b8860b; --ink: #e9ffe9; --mut: #86a38d; --mut2: #5d7a64; --bad: #ff5b4d; --warn: #ffb020;
  --r: 18px; --r2: 12px; --r3: 999px; --wrap: 1200px; --z: 1;
  --hf: 'Archivo', 'Geist', system-ui, sans-serif; --bf: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif; --mf: 'Geist Mono', ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sh: 0 0 0 1px var(--line), 0 24px 48px -24px rgba(0, 0, 0, .9);
}
*, *::before, *::after { box-sizing: border-box }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; background: var(--bg) }
html.lenis, html.lenis body { height: auto } .lenis.lenis-smooth { scroll-behavior: auto !important } .lenis.lenis-stopped { overflow: hidden }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--bf); -webkit-font-smoothing: antialiased; overflow-x: hidden }
img, svg, canvas { display: block; max-width: 100% } a { color: inherit; text-decoration: none } button { font: inherit; color: inherit; cursor: pointer }
h1, h2, h3, h4 { font-family: var(--hf); margin: 0; line-height: 1.02; letter-spacing: -.03em; font-weight: 800 }
p { margin: 0 } ::selection { background: var(--g); color: #000 }
:focus-visible { outline: 3px solid var(--g); outline-offset: 3px; border-radius: 8px }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto }
.mono { font-family: var(--mf) } .mut { color: var(--mut) } .hide { display: none !important } .sm { font-size: 13.5px }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap }
.grn { color: var(--g) } .gld { color: var(--gold) }

/* ---------- buttons: label always centred inside the frame ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 14px; border: 1.5px solid var(--line2); background: var(--bg3); color: var(--ink); font-weight: 650; font-size: 15px; letter-spacing: -.01em; line-height: 1; overflow: hidden; transition: transform .25s var(--ease), background .2s, box-shadow .25s var(--ease), border-color .2s, color .2s; white-space: nowrap }
.btn:hover { border-color: var(--g); background: #12231a } .btn:active { transform: scale(.97) }
.btn.pri { background: var(--g); border-color: var(--g); color: #021105; font-weight: 750 } .btn.pri:hover { background: #6bff80; box-shadow: 0 0 0 4px var(--gdim), 0 12px 32px -10px var(--gglow) }
.btn.ghost { background: transparent } .btn.gold { background: var(--gold); border-color: var(--gold); color: #1a1200 }
.btn.lg { min-height: 58px; padding: 0 30px; font-size: 17px; border-radius: 16px } .btn.sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 11px } .btn.block { width: 100% }
.btn[disabled], .btn.dis { opacity: .55; cursor: not-allowed; pointer-events: none; box-shadow: none }
.btn.pri[disabled], .btn.pri.dis { background: #12301a; border-color: var(--line2); color: var(--mut) }
.btn .rip { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .35); transform: scale(0); animation: rip .7s ease-out forwards; pointer-events: none } @keyframes rip { to { transform: scale(2.6); opacity: 0 } }
.btn .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite } @keyframes spin { to { transform: rotate(360deg) } }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--r3); background: var(--bg3); border: 1px solid var(--line2); font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; line-height: 1 }
.chip.g { background: var(--gdim); border-color: var(--g3); color: var(--g) } .chip.gold { background: rgba(255, 201, 58, .12); border-color: #6b5214; color: var(--gold) }
.chip.warn { background: rgba(255, 176, 32, .1); border-color: #5e4510; color: var(--warn) } .chip.bad { background: rgba(255, 91, 77, .1); border-color: #6b241d; color: var(--bad) }
button.chip { cursor: pointer; transition: background .2s, border-color .2s } button.chip:hover { border-color: var(--g) }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--g); box-shadow: 0 0 0 0 var(--gglow); animation: pulse 1.8s infinite } @keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(56, 255, 85, 0) } 100% { box-shadow: 0 0 0 0 rgba(56, 255, 85, 0) } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 700 12px/1 var(--mf); letter-spacing: .12em; text-transform: uppercase; color: var(--g); padding: 8px 12px; border: 1px solid var(--g3); border-radius: var(--r3); background: var(--gdim) }

/* ---------- cards with the HUD corner brackets ---------- */
.card { position: relative; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 20px }
.hud { position: relative }
.hud::before, .hud::after { content: ''; position: absolute; width: 14px; height: 14px; border: 2px solid var(--g); pointer-events: none; opacity: .9 }
.hud::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: var(--r) } .hud::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: var(--r) }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px } .kv:last-child { border: 0 } .kv span { color: var(--mut) } .kv b { font-weight: 650; text-align: right }

/* ---------- inputs ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px } .field > label { font-weight: 650; font-size: 14px } .field small { color: var(--mut); font-size: 13px }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line2); border-radius: var(--r2); padding: 12px 14px; min-height: 46px; transition: border-color .2s, box-shadow .2s }
textarea { min-height: 96px; resize: vertical } select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--g) 50%), linear-gradient(135deg, var(--g) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 38px }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--g); box-shadow: 0 0 0 4px var(--gdim) } input::placeholder, textarea::placeholder { color: var(--mut2) }
input[type=checkbox] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--g) }

/* ---------- skeleton, empty, toast ---------- */
.sk { position: relative; overflow: hidden; background: var(--bg3); border-radius: var(--r2) } .sk::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(56, 255, 85, .09) 50%, transparent 80%); transform: translateX(-100%); animation: shim 1.3s infinite } @keyframes shim { to { transform: translateX(100%) } }
.empty { text-align: center; padding: 38px 20px; border: 1.5px dashed var(--line2); border-radius: var(--r); color: var(--mut) } .empty img { margin: 0 auto 12px; opacity: .9 } .empty b { display: block; color: var(--ink); font-family: var(--hf); font-size: 20px; letter-spacing: -.02em; margin-bottom: 6px } .empty .btn { margin-top: 14px }
#toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); top: calc(64px + env(safe-area-inset-top)); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none }
.toast { background: #0e1d13; margin: 0; border: 1px solid var(--g3); color: var(--ink); padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: 14.5px; box-shadow: 0 16px 40px -12px #000; transform: translateY(14px) scale(.96); opacity: 0; transition: transform .35s var(--ease), opacity .3s; text-align: center } .toast.in { transform: none; opacity: 1 } .toast.err { border-color: #6b241d; background: #200d0b; color: #ffb4ac } .toast.ok::before { content: '\2713\00a0'; color: var(--g) }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 150; background: rgba(2, 5, 3, .86); display: flex; align-items: flex-end; justify-content: center; padding: 0; animation: fadein .2s } @keyframes fadein { from { opacity: 0 } }
.modal-in { position: relative; width: min(520px, 100%); max-height: 92vh; overflow: auto; background: var(--bg2); border: 1px solid var(--line2); border-radius: 22px 22px 0 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); animation: rise .3s var(--ease) }
@keyframes rise { from { transform: translateY(40px); opacity: 0 } }
.modal-in h3 { font-size: 26px; margin-bottom: 8px } .modal-in > p { margin-bottom: 14px } .modal-in .btn { margin-top: 8px }
@media (min-width: 700px) { .modal { align-items: center; padding: 24px } .modal-in { border-radius: 22px } }
.wopt { display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; min-height: 54px; padding: 0 16px; margin: 8px 0 0; border-radius: 14px; border: 1.5px solid var(--line2); background: var(--bg3); font-weight: 650; font-size: 16px; text-align: left } .wopt:hover { border-color: var(--g) } .wopt .av { width: 32px; height: 32px; border-radius: 10px; background: var(--g); color: #021105; display: inline-flex; align-items: center; justify-content: center; font-weight: 800 }
.callout { border: 1px solid var(--line2); background: var(--bg3); border-radius: var(--r2); padding: 12px 14px; font-size: 14.5px; margin: 10px 0 } .callout.warn { border-color: #5e4510; background: rgba(255, 176, 32, .07) }

/* ---------- the manual motion switch (animations are ALWAYS on unless the user turns them off here) ---------- */
.motion { white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 14px; border-radius: var(--r3); border: 1px solid var(--line2); background: var(--bg3); font-size: 13.5px; font-weight: 650; color: var(--mut) } .motion i { width: 30px; height: 17px; border-radius: 9px; background: var(--line2); position: relative; transition: background .2s } .motion i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--ink); transition: transform .25s var(--ease) } .motion[aria-pressed='true'] i { background: var(--g3) } .motion[aria-pressed='true'] i::after { transform: translateX(13px); background: var(--g) }
html.calm *, html.calm *::before, html.calm *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important }
/* a closer, bigger feel: 17px text on desktop, and a zoom on large screens so a 1866 px monitor does not look tiny */
@media (min-width: 900px) { body { font-size: 17px } }
@media (min-width: 1600px) { :root { --z: 1.15 } }
@media (min-width: 2200px) { :root { --z: 1.4 } }
@media (max-width: 560px) { body { font-size: 15.5px } .btn.lg { min-height: 54px; padding: 0 24px; font-size: 16px } }

/* confetti (cheap DOM bits) */
.cf { position: fixed; z-index: 300; pointer-events: none; border-radius: 2px; animation: cf 1.3s cubic-bezier(.2, .7, .3, 1) forwards } @keyframes cf { to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0 } }
