/* =====================================================================
   LAST BITE — style.css
   One committed visual world: night fishing, one float on dark water.
   Single dark theme, every color painted explicitly.
   ===================================================================== */
:root {
  --night: #070b14;
  --night-2: #0b1222;
  --panel: #0d1527;
  --panel-2: #111c33;
  --rule: #1d2a45;
  --rule-2: #2a3a5c;
  --ink: #eef1f6;
  --ink-2: #b4bfd1;
  --ink-3: #7c8aa3;
  --moon: #f4e9c8;
  --moon-dim: #c9bf9f;
  --bobber: #ff4a2b;
  --bobber-hi: #ff7a5c;
  --bobber-ink: #1a0703;
  --sea: #3d6fb3;
  --ok: #57d6a4;
  --warn: #ffb547;
  --display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
  --body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --gut: 16px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--night); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--night); color: var(--ink);
  font: 15px/1.45 var(--body);
  overflow-x: hidden;
}
a { color: var(--moon); text-decoration: none; }
a:hover { color: #ffffff; text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--moon); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono, code { font-family: var(--mono); font-size: .92em; }

/* ---------------- top bar ---------------- */
.top {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px var(--gut);
  padding: 10px var(--gut); border-bottom: 1px solid var(--rule); background: var(--night);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); min-width: 0; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand img { display: block; border-radius: 9px; }
.brand .word { font: 900 26px/1 var(--display); letter-spacing: .04em; color: var(--moon); }
.brand .tick { font: 500 12px/1 var(--mono); color: var(--bobber-hi); padding: 4px 6px; border: 1px solid #5a2418; border-radius: 4px; background: #1c0c08; }
.ca {
  grid-column: 1 / -1; order: 3;
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 6px 6px 6px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--night-2);
}
.ca-k { font: 600 11px/1 var(--body); letter-spacing: .12em; color: var(--ink-3); }
.ca code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 12.5px; }
.ca-copy { border: 1px solid var(--rule-2); background: var(--panel-2); color: var(--moon); border-radius: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.ca-copy:hover { background: #1a2847; }
.links { grid-column: 1 / -1; order: 4; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.links a { color: var(--ink-2); }
.links a:hover { color: var(--moon); }
.connect {
  justify-self: end; border: 1px solid var(--moon-dim); background: transparent; color: var(--moon);
  border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.connect:hover { background: #1a1a14; }
.connect.on { border-color: var(--rule-2); color: var(--ink-2); font-family: var(--mono); font-size: 12.5px; font-weight: 500; }
.connect.bad { border-color: var(--warn); color: var(--warn); }

/* ---------------- layout ---------------- */
.game { display: grid; gap: 12px; padding: 12px var(--gut) 0; }

/* ---------------- the stage ---------------- */
.stage {
  position: relative; overflow: hidden; isolation: isolate;
  border: 1px solid var(--rule); border-radius: 14px; background: #050913;
  min-height: 360px;
}
.scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; display: block; }
.stage::before { /* scrim so the HUD reads over the water */
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(5, 9, 19, .86) 0%, rgba(5, 9, 19, .55) 48%, rgba(5, 9, 19, 0) 78%);
}
.moonpath line { animation: shimmer 3.4s ease-in-out infinite; }
.moonpath line:nth-child(2n) { animation-delay: -1.2s; }
.moonpath line:nth-child(3n) { animation-delay: -2.1s; }
@keyframes shimmer { 0%, 100% { opacity: .12; } 50% { opacity: .55; } }
.swell path { animation: drift 14s linear infinite; }
.swell path:nth-child(2) { animation-duration: 18s; }
.swell path:nth-child(3) { animation-duration: 22s; }
.swell path:nth-child(4) { animation-duration: 28s; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-160px); } }
.stars circle { animation: twinkle 5s ease-in-out infinite; }
.stars circle:nth-child(3n) { animation-delay: -2s; }
.stars circle:nth-child(4n) { animation-delay: -3.6s; }
@keyframes twinkle { 0%, 100% { opacity: .9; } 50% { opacity: .3; } }

/* the rig */
.rig { position: absolute; top: 0; right: 4%; bottom: 13%; width: 34%; pointer-events: none; }
.rig .line { position: absolute; inset: 0 0 26px 0; width: 100%; height: calc(100% - 26px); overflow: visible; }
.rig .line path { fill: none; stroke: #c9d3e6; stroke-width: 1; opacity: .55; transition: opacity .18s ease; }
.rig .line .taut { opacity: 0; stroke: #ffffff; }
.rig .float { position: absolute; left: 50%; bottom: 0; width: 34px; height: 54px; margin-left: -17px; transform-origin: 50% 62%; animation: bob 3.2s ease-in-out infinite; }
.rig .float svg { display: block; width: 100%; height: 100%; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-5px) rotate(2.5deg); } }
.rig .rings { position: absolute; left: 50%; bottom: 8px; width: 0; height: 0; }
.rig .rings i { position: absolute; left: -40px; top: -9px; width: 80px; height: 18px; border: 1px solid #8fb0e0; border-radius: 50%; opacity: 0; animation: ring 3.6s ease-out infinite; }
.rig .rings i:nth-child(2) { animation-delay: 1.2s; }
.rig .rings i:nth-child(3) { animation-delay: 2.4s; }
@keyframes ring { 0% { transform: scale(.35); opacity: .55; } 100% { transform: scale(1.8); opacity: 0; } }
.rig .splash { position: absolute; left: 50%; bottom: 22px; width: 0; height: 0; }
.rig .splash i { position: absolute; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: #cfe0ff; opacity: 0; }

/* tug: a buy landed */
.rig.tug .float { animation: tug .9s cubic-bezier(.3, .7, .3, 1) 1; }
.rig.tug .line .slack { opacity: 0; }
.rig.tug .line .taut { opacity: .85; }
.rig.tug .rings i { animation: ringBig 1.1s ease-out 1; }
.rig.tug .rings i:nth-child(2) { animation-delay: .15s; }
.rig.tug .rings i:nth-child(3) { animation-delay: .3s; }
@keyframes tug {
  0% { transform: translateY(0) rotate(0); }
  18% { transform: translateY(20px) rotate(-14deg) scaleY(.9); }
  36% { transform: translateY(6px) rotate(8deg); }
  55% { transform: translateY(14px) rotate(-6deg); }
  100% { transform: translateY(0) rotate(0); }
}
@keyframes ringBig { 0% { transform: scale(.3); opacity: .9; border-color: #ffffff; } 100% { transform: scale(2.6); opacity: 0; } }
.rig.splashing .splash i { animation: drop 1s ease-out 1; }
.rig.splashing .splash i:nth-child(1) { --dx: -38px; --dy: -46px; }
.rig.splashing .splash i:nth-child(2) { --dx: -18px; --dy: -64px; }
.rig.splashing .splash i:nth-child(3) { --dx: 4px;   --dy: -72px; }
.rig.splashing .splash i:nth-child(4) { --dx: 22px;  --dy: -60px; }
.rig.splashing .splash i:nth-child(5) { --dx: 40px;  --dy: -40px; }
.rig.splashing .splash i:nth-child(6) { --dx: -2px;  --dy: -36px; }
@keyframes drop { 0% { opacity: 1; transform: translate(0, 0); } 60% { opacity: .9; } 100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) * -.2)); } }
.stage.hot .rig .float { animation-duration: .9s; }

/* the HUD */
.hud { position: relative; padding: 16px 16px 18px; max-width: 640px; }
.hud-top { display: flex; align-items: center; gap: 10px; }
.round { font: 800 15px/1 var(--display); letter-spacing: .16em; color: var(--ink-2); }
.badge { font: 700 11px/1 var(--body); letter-spacing: .14em; padding: 5px 8px; border-radius: 4px; background: var(--warn); color: #1d1300; }
.badge.live { background: #0f2a20; color: var(--ok); border: 1px solid #1f5a43; }
.badge.live::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--ok); vertical-align: 0; animation: pulse 1.6s ease-in-out infinite; }
.badge.time { background: var(--bobber); color: #ffffff; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.status { margin: 10px 0 0; max-width: 34ch; color: var(--ink-2); font-size: 14px; }
.status b { color: var(--moon); font-weight: 600; }

.clock {
  display: flex; align-items: baseline; margin: 4px 0 2px -2px;
  font: 900 clamp(92px, 27vw, 120px)/.9 var(--display); color: var(--moon);
  font-variant-numeric: tabular-nums; letter-spacing: 0;
}
.clock .d { display: inline-block; width: .52em; text-align: center; }
.clock .c { display: inline-block; width: .26em; text-align: center; transform: translateY(-.06em); color: var(--moon-dim); }
.clock.idle { color: #5d6a82; }
.clock.idle .c { color: #4a5569; }
.clock.hot { color: var(--bobber); }
.clock.hot .c { color: var(--bobber-hi); animation: pulse 1s steps(2, jump-none) infinite; }
.clock.done { color: var(--bobber); }
.clock.demo { color: #b9b096; }

.pot { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }
.pot-k { font: 800 15px/1 var(--display); letter-spacing: .16em; color: var(--ink-3); text-transform: uppercase; align-self: center; }
.pot-v b { font: 800 clamp(38px, 11vw, 52px)/1 var(--display); color: #ffffff; font-variant-numeric: tabular-nums; }
.pot-v .unit { font: 700 18px/1 var(--display); color: var(--moon-dim); margin-left: 6px; letter-spacing: .06em; }
.pot-usd { font: 500 14px/1 var(--mono); color: var(--ink-2); }
.queue { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-3); }
.queue button { border: 0; background: none; padding: 0; color: var(--moon); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; }

.rows { margin: 12px 0 0; display: grid; gap: 6px; }
.rows > div { display: grid; grid-template-columns: 9.5em 1fr; gap: 10px; align-items: baseline; }
.rows dt { font-size: 12.5px; color: var(--ink-3); }
.rows dd { margin: 0; font: 500 14px/1.3 var(--mono); color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows dd a { color: var(--ink); }
.rows dd .you { color: var(--bobber-hi); font-weight: 600; }
.rows dd .crown { color: var(--moon); margin-right: 4px; }

/* ---------------- side: button + feed ---------------- */
.side { display: grid; gap: 12px; min-height: 0; }
.card { border: 1px solid var(--rule); border-radius: 14px; background: var(--panel); padding: 14px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-h h2 { margin: 0; white-space: nowrap; font: 800 20px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--moon); }
.wallet { font: 500 12px/1.2 var(--mono); color: var(--ink-3); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.amt { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--night-2); cursor: text; }
.amt:focus-within { border-color: var(--moon-dim); }
.amt-k { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.amt input { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: #ffffff; text-align: right; font: 800 28px/1.1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.amt-u { font: 700 16px/1 var(--display); color: var(--moon-dim); letter-spacing: .06em; }
.amt.low { border-color: #6b4a14; }
.presets { display: flex; gap: 6px; margin-top: 8px; }
.presets button { flex: 1; border: 1px solid var(--rule-2); background: var(--panel-2); color: var(--ink-2); border-radius: 8px; padding: 7px 0; font: 500 12.5px/1 var(--mono); cursor: pointer; }
.presets button:hover { color: var(--moon); border-color: var(--moon-dim); }
.presets button[aria-pressed="true"] { color: var(--moon); border-color: var(--moon); background: #1b1a14; }

.quote { margin: 10px 0 0; display: grid; gap: 3px; }
.quote > div { display: flex; justify-content: space-between; gap: 10px; }
.quote dt { font-size: 12.5px; color: var(--ink-3); }
.quote dd { margin: 0; font: 500 13px/1.4 var(--mono); color: var(--ink); white-space: nowrap; }

.take {
  display: block; width: 100%; margin-top: 12px; padding: 16px 12px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--bobber); color: #ffffff;
  font: 900 30px/1 var(--display); letter-spacing: .08em;
  box-shadow: 0 0 0 1px #ff6a4f inset, 0 10px 30px -12px rgba(255, 74, 43, .7);
  transition: transform .08s ease, background .15s ease;
}
.take:hover:not(:disabled) { background: #ff5d40; }
.take:active:not(:disabled) { transform: translateY(1px) scale(.995); }
.take:disabled { cursor: not-allowed; background: #3a1e19; color: #a38078; box-shadow: 0 0 0 1px #5a2a21 inset; }
.take.busy { background: #a3301c; color: #ffe2da; cursor: progress; }
.crown { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.crown.warn { color: var(--warn); }
.crown.you { color: var(--bobber-hi); }
.fine { margin: 6px 0 0; font-size: 11.5px; line-height: 1.4; color: var(--ink-3); }
.extra { display: flex; gap: 8px; margin-top: 8px; }
.extra:not(:has(button:not([hidden]))) { display: none; }
.ghost { flex: 1; border: 1px solid var(--rule-2); background: var(--panel-2); color: var(--moon); border-radius: 10px; padding: 10px; font-weight: 600; font-size: 14px; cursor: pointer; }
.ghost:hover { border-color: var(--moon-dim); }
.ghost.ok { border-color: #1f5a43; color: var(--ok); background: #0d2019; }
.ghost.hotb { border-color: var(--bobber); color: #ffffff; background: #3a130b; }

.feed { display: flex; flex-direction: column; min-height: 0; }
.live { font: 600 11px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.live.on { color: var(--ok); }
.live.on::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s ease-in-out infinite; }
#feed { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 0; max-height: 340px; scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; }
#feed li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "tag who when" "what what what"; align-items: center; gap: 3px 8px; padding: 7px 0; border-top: 1px solid var(--rule); font-size: 13px; }
#feed li:first-child { border-top: 0; }
#feed li.new { animation: flash 1.6s ease-out 1; }
@keyframes flash { from { background: #1f2a3f; } to { background: transparent; } }
#feed .tag { grid-area: tag; display: inline-block; font: 700 10.5px/1 var(--body); letter-spacing: .1em; padding: 4px 6px; border-radius: 3px; text-align: center; min-width: 5.4em; }
#feed .tag.king { background: var(--moon); color: #1d1a10; }
#feed .tag.nib { background: #1a2338; color: var(--ink-3); }
#feed .tag.win { background: var(--ok); color: #04150e; }
#feed .who { grid-area: who; font-family: var(--mono); font-size: 12.5px; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#feed .who .you { color: var(--bobber-hi); font-weight: 600; }
#feed .what { grid-area: what; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#feed .what b { color: var(--ink); font-weight: 500; font-family: var(--mono); font-size: 12.5px; }
#feed .when { grid-area: when; font-size: 11.5px; color: var(--ink-3); text-align: right; white-space: nowrap; }
#feed .when:hover { color: var(--moon); }
#feed li.won { background: linear-gradient(90deg, #0d2019, transparent 80%); }
#feed .empty { display: block; padding: 18px 0; color: var(--ink-3); font-size: 13px; border: 0; }
#feed .who a { color: inherit; }

/* ---------------- honesty ---------------- */
.honest { margin: 12px var(--gut) 0; padding: 14px; border: 1px solid var(--rule-2); border-radius: 14px; background: var(--night-2); }
.honest h2 { margin: 0 0 8px; font: 800 15px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.honest ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.honest li { font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.honest li b { color: var(--ink); font-weight: 600; }
.honest li > b:first-child { color: var(--moon); }
.honest a { color: var(--moon); text-decoration: underline; text-decoration-color: #5d5642; text-underline-offset: 3px; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 12px var(--gut) 18px; font-size: 12px; color: var(--ink-3); }
.foot .fl { display: flex; gap: 14px; }
.foot a { color: var(--ink-3); }
.foot a:hover { color: var(--moon); }

.toast {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  width: min(440px, calc(100vw - 32px)); padding: 12px 14px; border-radius: 12px;
  background: #121c31; color: var(--ink); border: 1px solid var(--rule-2); box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
  font-size: 14px;
}
.toast.ok { border-color: #1f5a43; }
.toast.err { border-color: #7a2a1c; }
.toast a { color: var(--moon); text-decoration: underline; }

/* ---------------- phone stage ---------------- */
@media (max-width: 639px) {
  .stage { background: #04070f; min-height: 0; }
  .scene { height: 210px; bottom: auto; -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 100%); mask-image: linear-gradient(180deg, #000 72%, transparent 100%); }
  .stage::before { background: linear-gradient(180deg, rgba(5, 9, 19, .35) 0%, rgba(5, 9, 19, .2) 40%, rgba(4, 7, 15, 0) 100%), linear-gradient(90deg, rgba(5, 9, 19, .7) 0%, rgba(5, 9, 19, 0) 70%); }
  .rig { top: 0; bottom: auto; height: 150px; right: 1%; width: 24%; }
  .rig .rings i { left: -30px; width: 60px; height: 14px; top: -7px; }
  .hud { display: flex; flex-direction: column; padding: 14px 16px 16px; }
  .hud-top { order: 0; }
  .clock { order: 1; font-size: clamp(76px, calc((100vw - 64px) * .3), 116px); margin-top: 8px; }
  .pot { order: 2; max-width: 78%; }
  .queue { order: 3; }
  .status { order: 4; margin-top: 10px; font-size: 13.5px; max-width: none; }
  .rows { order: 5; }
  .rows > div { grid-template-columns: 8.6em minmax(0, 1fr); }
  .rows dd { font-size: 13px; }
  .links { font-size: 12.5px; gap: 4px 14px; }
}

/* ---------------- tablet+ ---------------- */
@media (min-width: 640px) {
  .top { grid-template-columns: auto minmax(0, 1fr) auto; }
  .ca { grid-column: auto; order: 0; max-width: 460px; justify-self: center; width: 100%; }
  .links { grid-column: 1 / -1; order: 4; justify-content: center; }
  .stage { min-height: 420px; }
  .hud { padding: 22px 24px; }
  .clock { font-size: clamp(120px, 17vw, 190px); }
  .honest ul { grid-template-columns: 1fr 1fr; gap: 8px 22px; }
}

/* ---------------- desktop: one screen ---------------- */
@media (min-width: 1000px) {
  .top { grid-template-columns: auto minmax(0, 1fr) auto auto; padding: 10px 20px; }
  .ca { max-width: 470px; }
  .links { grid-column: auto; order: 0; flex-wrap: nowrap; gap: 16px; }
  .game { grid-template-columns: minmax(0, 1fr) 380px; padding: 14px 20px 0; gap: 14px; }
  .honest { margin: 14px 20px 0; padding: 12px 16px; }
  .honest ul { grid-template-columns: repeat(3, 1fr); gap: 6px 24px; }
  .honest li { font-size: 12.5px; }
  .foot { padding: 10px 20px 12px; }
  .stage { min-height: 0; }
  .hud { padding: 26px 32px; }
}
@media (min-width: 1000px) and (min-height: 700px) {
  body { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; }
  .foot { padding: 6px 20px 8px; }
  .honest { padding: 10px 16px; }
  #feed li { grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "tag who what when"; gap: 8px; padding: 6px 0; }
  .game { min-height: 0; }
  .side { grid-template-rows: auto minmax(0, 1fr); }
  #feed { max-height: none; flex: 1; }
  .clock { font-size: clamp(120px, min(15vw, 24vh), 210px); }
}
@media (min-width: 1000px) and (max-height: 820px) {
  .card { padding: 12px 14px; }
  .take { padding: 13px 12px; font-size: 27px; }
  .fine { display: none; }
  .hud { padding: 20px 28px; }
  .rows { margin-top: 10px; }
}
@media (min-width: 1400px) {
  .game { grid-template-columns: minmax(0, 1fr) 420px; }
}

/* ---------------- motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rig .rings i { opacity: .25; transform: scale(1); }
  .rig.tug .float svg { filter: drop-shadow(0 0 10px #ff7a5c) brightness(1.3); }
  .rig.tug .line .taut { opacity: .85; }
}
