/* Shaftline: warm dark rock with a bright mineral accent. Phone first (360px), calm, one thing at a time. */
:root {
  --bg: #16110e; --bg2: #1d1612; --card: #251c17; --card2: #2e231d; --line: #3d3029; --line2: #54433a;
  --text: #f4ebe2; --dim: #bba899; --mute: #8c7a6c;
  --accent: #3ee6c4; --accent-ink: #062a22; --coin: #ffc95c; --warn: #ffb27a; --bad: #ff7a7a; --ok: #8fe3a6;
  --r: 14px; --font: "Avenir Next", "Segoe UI", ui-rounded, system-ui, -apple-system, Roboto, sans-serif;
  --display: "Bahnschrift", "DIN Alternate", "Avenir Next Condensed", "Arial Narrow", var(--font);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; overflow-x: hidden; background: radial-gradient(120% 60% at 50% -10%, #2b1f18 0%, var(--bg) 60%) fixed; }
body.walled { overflow: hidden; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); letter-spacing: .02em; margin: 0; }
h2 { font-size: 24px; margin: 4px 0 10px; }
h3 { font-size: 17px; margin: 22px 0 8px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
p { margin: 8px 0; }
.dim { color: var(--dim); } .tiny { font-size: 12px; } .small { font-size: 13.5px; } .mono { font-family: ui-monospace, Consolas, monospace; }
.coin { color: var(--coin); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; } .row.between { justify-content: space-between; }
.r { text-align: right; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; }
.page { padding: 12px 16px calc(96px + env(safe-area-inset-bottom)); }
.boot { display: grid; place-items: center; min-height: 100dvh; gap: 18px; text-align: center; padding: 24px; }
.boot-logo { font: 700 30px/1 var(--display); letter-spacing: .18em; color: var(--accent); }
.boot-bar { width: 140px; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.boot-bar i { display: block; width: 40%; height: 100%; background: var(--accent); animation: boot 1.1s ease-in-out infinite; }
@keyframes boot { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---- buttons ---- */
.btn { appearance: none; border: 1px solid var(--line2); background: var(--card2); color: var(--text); font: 600 15px/1 var(--font); padding: 12px 16px; border-radius: 12px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; justify-content: center; text-decoration: none; transition: transform .08s, background .15s, border-color .15s; touch-action: manipulation; }
.btn:hover { border-color: #6e5a4e; } .btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 22px -8px rgba(62,230,196,.6); }
.btn.primary:hover { background: #63eccf; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn.small { padding: 8px 12px; font-size: 13.5px; border-radius: 10px; }
.btn.big { padding: 16px 20px; font-size: 17px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: default; box-shadow: none; }
.btn.danger { border-color: #7a3434; color: #ffb0b0; }

/* ---- top bar and nav ---- */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; background: linear-gradient(var(--bg) 70%, rgba(22,17,14,0)); }
.logo { display: flex; gap: 7px; align-items: center; color: var(--text); text-decoration: none; font: 700 16px/1 var(--display); letter-spacing: .16em; }
.logo svg { color: var(--accent); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--dim); font: 600 13px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; }
.pill b { color: var(--coin); }
.pill.me { color: var(--text); } .pill.me.practice { color: var(--warn); }
@media (max-width: 400px) { .logo span { display: none; } .pill { padding: 7px 10px; } }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center; gap: 4px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(24,18,15,.94); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.nav a { position: relative; flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 12px; color: var(--mute); text-decoration: none; font-size: 11.5px; font-weight: 600; }
.nav a.on { color: var(--accent); background: rgba(62,230,196,.08); }
.nav .dot { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--coin); color: #2a1a00; font: 700 11px/18px var(--font); font-style: normal; }
.outbar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(24,18,15,.94); border-top: 1px solid var(--line); z-index: 10; }
.outbar .btn { max-width: 528px; margin: 0 auto; display: flex; }

/* ---- cards, notes, lists ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 10px 0; }
.note { border-radius: 12px; padding: 10px 12px; margin: 12px 0; background: var(--card); border: 1px solid var(--line); color: var(--dim); font-size: 13.5px; }
.note.ok { border-color: rgba(62,230,196,.3); color: #bfeee2; }
.note.warn { border-color: rgba(255,178,122,.35); color: #ffd2b0; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; font-size: 14px; }
.kv span { color: var(--dim); } .kv b { text-align: right; }
.prose p:first-child { margin-top: 0; } .prose ul { padding-left: 18px; margin: 6px 0; } .prose li { margin: 4px 0; }
.foot { color: var(--mute); margin-top: 26px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; color: var(--mute); font-weight: 600; font-size: 12px; padding: 4px 6px; }
table.t th.r, table.t td.r { text-align: right; }
table.t td { padding: 7px 6px; border-top: 1px solid var(--line); vertical-align: middle; }
table.t td svg { vertical-align: middle; margin-right: 6px; }

/* ---- coach (tutorial) ---- */
.coach { position: relative; display: flex; flex-direction: column; gap: 6px; background: #12322b; border: 1px solid rgba(62,230,196,.45); color: #dffcf4; border-radius: 14px; padding: 12px 14px; margin: 10px 0; box-shadow: 0 10px 30px -14px rgba(62,230,196,.5); animation: rise .35s ease-out; }
.coach p { margin: 0; font-size: 14px; }
.coach .step { font: 700 11px/1 var(--font); letter-spacing: .1em; color: var(--accent); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ---- landing ---- */
body.out #app { max-width: none; }
.landing { position: relative; min-height: 100dvh; display: grid; place-items: center; overflow: hidden; }
.hero-rock { position: absolute; inset: 0; width: 100%; height: 100%; }
.landing::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 50% at 50% 48%, rgba(22,17,14,.72), rgba(22,17,14,.3) 75%, rgba(22,17,14,.55)); pointer-events: none; }
.hero { position: relative; z-index: 1; max-width: 460px; width: 100%; padding: 32px 22px calc(28px + env(safe-area-inset-bottom)); text-align: center; }
.brand { display: flex; gap: 10px; align-items: center; justify-content: center; color: var(--accent); }
.brand h1 { font-size: 40px; letter-spacing: .2em; color: var(--text); text-shadow: 0 2px 0 #000, 0 0 30px rgba(62,230,196,.25); }
.tag { font-size: 18px; color: #f0d9c4; margin: 6px 0 20px; }
.steps { text-align: left; list-style: none; counter-reset: s; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.steps li { counter-increment: s; position: relative; padding: 10px 12px 10px 46px; background: rgba(37,28,23,.82); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; color: var(--dim); }
.steps li b { color: var(--text); }
.steps li::before { content: counter(s); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 13px/24px var(--font); text-align: center; }
.potline { color: var(--dim); } .potline b { color: var(--coin); }
.cta { display: grid; gap: 10px; margin: 14px 0 8px; }
.soon { padding: 12px; border-radius: 12px; border: 1px dashed rgba(255,201,92,.5); color: #ffe2a8; background: rgba(255,201,92,.06); font-size: 14px; }
.links { display: flex; gap: 18px; justify-content: center; margin-top: 12px; font-size: 14px; }

/* ---- home: the framed field, one big Dive button, two numbers, the payout clock ---- */
.field-hero { position: relative; border-radius: 22px; overflow: hidden; border: 1px solid var(--line2); margin: 2px 0 12px; height: 220px; background: #120d0a; }
.field-hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.field-hero .cap { position: absolute; left: 14px; right: 14px; bottom: 12px; color: #f6e8da; text-shadow: 0 1px 3px #000; }
.field-hero .cap b { font: 700 22px/1.1 var(--display); display: block; }
.field-hero .cap span { font-size: 13.5px; color: rgba(246,232,218,.85); }
.btn.dive-btn { width: 100%; padding: 22px 20px; font: 700 24px/1 var(--display); letter-spacing: .06em; border-radius: 18px; }
.mini { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.mini .card { margin: 0; padding: 12px; }
.mini .card .v { font: 700 20px/1.1 var(--display); color: var(--coin); font-variant-numeric: tabular-nums; }
.mini .card .k { font-size: 12.5px; color: var(--dim); }
.payout { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; }
.payout > span { color: #bfeee2; font-size: 14px; } .payout > b { font: 700 22px/1 var(--display); color: var(--accent); font-variant-numeric: tabular-nums; }
.payout small { grid-column: 1 / -1; color: var(--dim); font-size: 12.5px; }
.note .hi { color: var(--text); }

.rails { position: relative; height: 92px; margin: 14px -16px -10px; pointer-events: none; }
.rails canvas { position: absolute; inset: 0; }
.drow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.drow:first-child { border-top: 0; }

/* ---- market ---- */
.sellall { display: flex; align-items: center; gap: 12px; }
.list { padding: 4px 12px; }
.mrow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.mrow:first-child { border-top: 0; }
.price { display: flex; flex-direction: column; align-items: flex-end; min-width: 58px; }
.up { color: var(--ok); } .down { color: var(--warn); }

/* ---- rewards ---- */
.potcard { text-align: center; padding: 18px 16px; border-radius: 18px; margin: 8px 0 12px; background: radial-gradient(120% 90% at 50% 0%, #3a2a17, #221913 70%); border: 1px solid #5a4329; }
.potcard > b { display: block; font: 700 38px/1.1 var(--display); color: var(--coin); margin: 4px 0; }
.potcard > b small { font-size: 16px; color: #e9c27a; }
.potcard p { color: var(--dim); margin: 8px 0 0; }
.you h3 { margin-top: 0; }
.board { list-style: none; padding: 4px 12px; }
.board li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.board li:first-child { border-top: 0; }
.board li.me { color: var(--accent); }
.board .rk { width: 22px; color: var(--mute); font-variant-numeric: tabular-nums; }
.board .sh { width: 44px; text-align: right; }

/* ---- modal ---- */
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(8,5,4,.6); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { width: 100%; max-width: 480px; background: var(--bg2); border: 1px solid var(--line); border-radius: 20px 20px 0 0; padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 12px; animation: rise .2s ease-out; }
@media (min-width: 640px) { .modal { align-items: center; } .sheet { border-radius: 20px; } }
.wallets { display: grid; gap: 8px; }
.wopt { display: block; padding: 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card2); color: var(--text); font: 600 15px var(--font); text-align: left; text-decoration: none; cursor: pointer; }
@keyframes fade { from { opacity: 0; } }

/* ---- toasts ---- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 60; display: grid; gap: 6px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: #2b211b; border: 1px solid var(--line2); color: var(--text); padding: 11px 14px; border-radius: 12px; font-size: 14px; box-shadow: 0 10px 30px -10px #000; animation: rise .2s; }
.toast.good { border-color: rgba(62,230,196,.5); } .toast.bad { border-color: rgba(255,122,122,.5); }
.toast b { color: var(--coin); }

/* ---- the dive ---- */
.dive:focus { outline: none; }
.dive { position: fixed; inset: 0; z-index: 50; background: #120d0a; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; animation: wallin .22s ease-out; }
.dive.out { animation: wallout .18s ease-in forwards; }
@keyframes wallin { from { opacity: 0; transform: scale(1.04); } }
@keyframes wallout { to { opacity: 0; transform: scale(.98); } }
.dive canvas { position: absolute; inset: 0; display: block; cursor: crosshair; }
/* the HUD lives on the frame: depth painted on the beam, the clock as a hanging wooden sign, the bag on a hook */
.dive-depth { position: absolute; top: 5px; color: #fbe9cf; text-shadow: 0 1px 0 rgba(0,0,0,.9), 0 0 6px rgba(0,0,0,.6); line-height: 1.1; pointer-events: none; }
.dive-depth .d { font: 700 18px/1 var(--display); font-variant-numeric: tabular-nums; }
.dive-depth .l { font: 600 10px/1 var(--font); color: rgba(251,233,207,.75); letter-spacing: .06em; text-transform: uppercase; display: block; margin-top: 2px; }
.timer { position: absolute; left: 50%; top: 56px; transform: translateX(-50%) rotate(-1.5deg); display: flex; align-items: center; gap: 7px; border-radius: 8px; padding: 8px 14px; background: linear-gradient(#b07a45, #7a4d28 70%, #5c3819); border: 2px solid #2e1c0d; color: #fff3df; font: 700 24px/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: .03em; text-shadow: 0 2px 0 rgba(40,20,5,.8); box-shadow: inset 0 1px 0 rgba(255,220,170,.35), 0 8px 16px -6px #000; pointer-events: none; }
.timer svg { color: #ffe2a8; }
.timer.low { color: #ffe0c8; border-color: #6b1f12; background: linear-gradient(#b5603a, #7d3a1e 70%, #5a2612); }
.timer::before, .timer::after, .bag.hang::before { content: ""; position: absolute; top: -16px; width: 2px; height: 16px; background: #c9b08a; box-shadow: 0 0 0 .5px rgba(0,0,0,.6); }
.timer::before { left: 16px; } .timer::after { right: 16px; }
.bag { position: relative; width: 46px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; background: rgba(20,14,11,.7); border: 1px solid rgba(255,236,214,.18); }
.bag b { position: absolute; right: -4px; bottom: -6px; min-width: 20px; padding: 0 5px; height: 18px; border-radius: 9px; background: var(--coin); color: #2a1a00; font: 700 11px/18px var(--font); text-align: center; }
.bag.hang { position: absolute; top: 56px; background: rgba(28,18,12,.85); border-color: rgba(201,176,138,.5); pointer-events: none; }
.bag.hang::before { left: 50%; top: -14px; height: 14px; }
.bag.bump { animation: bump .35s ease-out; }
@keyframes bump { 40% { transform: scale(1.25) rotate(-6deg); } }
.dbtn { position: absolute; top: 6px; width: 32px; height: 30px; border-radius: 8px; border: 1px solid rgba(201,176,138,.4); background: rgba(28,18,12,.7); color: #fbe9cf; display: grid; place-items: center; cursor: pointer; padding: 0; }
.resurface { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(26px + env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px; background: rgba(28,18,12,.9); border: 1px solid rgba(201,176,138,.45); color: #f6e8da; font: 600 14.5px/1 var(--font); white-space: nowrap; box-shadow: 0 8px 24px -10px #000; cursor: pointer; }
.resurface svg { color: var(--accent); }
.resurface[hidden] { display: none; }
.dive-hint { position: absolute; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom)); text-align: center; color: rgba(246,232,218,.85); font-size: 13.5px; text-shadow: 0 1px 3px #000; padding: 0 24px; pointer-events: none; }
.dive-hint.fade { opacity: 0; transition: opacity 1.2s; }
.dive-coach { position: absolute; left: 34px; right: 34px; bottom: calc(76px + env(safe-area-inset-bottom)); max-width: 420px; margin: 0 auto; z-index: 2; }
.dive-over[hidden] { display: none; }
.dive .shade { position: absolute; inset: 0; background: rgba(8,5,3,.62); animation: fade .2s; }
.dive .sheet { position: absolute; width: auto; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); max-width: 460px; margin: 0 auto; background: rgba(29,22,18,.98); border: 1px solid var(--line2); border-radius: 20px; padding: 18px 16px 16px; display: grid; gap: 10px; box-shadow: 0 20px 50px -20px #000; }
.dive .sheet .big { font: 700 21px/1.2 var(--display); }
.dive .sheet p { margin: 0; color: var(--dim); font-size: 14.5px; }
.dive .sheet .row .btn { flex: 1; }
.dive .sheet .row .btn.again { flex: 2; }
.kicker { font: 700 11.5px/1 var(--font); letter-spacing: .12em; color: var(--accent); text-transform: uppercase; }
.haul { display: grid; gap: 2px; margin: 2px 0; max-height: 40vh; overflow: auto; }
.haul .it { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 6px 2px; border-top: 1px solid var(--line); font-size: 14.5px; }
.haul .it:first-child { border-top: 0; }
.haul .it b { font-variant-numeric: tabular-nums; }
.haul .it .x { color: var(--dim); font-size: 12.5px; margin-left: 4px; }
.pts { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 12px; border-radius: 14px; background: #1b2a24; border: 1px solid rgba(62,230,196,.35); }
.pts span { color: #bfeee2; font-size: 14px; } .pts b { font: 700 26px/1 var(--display); color: var(--coin); font-variant-numeric: tabular-nums; }
.share { font-size: 13.5px; color: var(--dim); }
.share b { color: var(--text); }
/* while diving, messages sit above the resurface button */
body.walled .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }

@media (min-width: 900px) {
  .page { padding-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---- ops page ---- */
#ops h1 { font-size: 26px; } #ops .sec { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; }
.stack > * + * { margin-top: 10px; } .row.wrap { flex-wrap: wrap; }
input[type=text] { width: 100%; min-height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); padding: 0 12px; font: inherit; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; filter: brightness(.7); }
.tiercard { display: grid; gap: 6px; color: var(--dim); }
.tiercard small { font-size: 12.5px; }
.steps6 { display: inline-flex; gap: 3px; }
.steps6 i { width: 10px; height: 10px; border-radius: 3px; background: rgba(255,255,255,.08); border: 1px solid var(--line2); }
.steps6 i.on { background: var(--coin); border-color: transparent; }
.tbar { height: 6px; border-radius: 3px; background: rgba(0,0,0,.45); overflow: hidden; }
.tbar i { display: block; height: 100%; background: linear-gradient(90deg, #a87b55, var(--coin)); border-radius: 3px; }
