:root {
  color-scheme: light dark;
  --ink: #101b18;
  --muted: #5f6966;
  --paper: #fffefa;
  --green: #007749;
  --accent: #007749;
  --gold: #ffb81c;
  --red: #e03c31;
  --blue: #001489;
  --line: #d8ddd9;
  --surface: #fff;
  --hover: #f7f8f5;
  --leader: #eef7f1;
  --error: #a72820;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; }
button, input, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.shell { width: min(920px, calc(100% - 32px)); margin-inline: auto; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.flag-stripe { display: grid; grid-template-columns: 1.2fr .55fr 1.3fr .55fr 1.2fr; height: 7px; }
.flag-stripe span:nth-child(1) { background: var(--red); }
.flag-stripe span:nth-child(2) { background: var(--gold); }
.flag-stripe span:nth-child(3) { background: var(--green); }
.flag-stripe span:nth-child(4) { background: #fff; border-bottom: 1px solid #ddd; }
.flag-stripe span:nth-child(5) { background: var(--blue); }

.site-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.wordmark { font-weight: 850; letter-spacing: -.04em; text-decoration: none; font-size: 1.15rem; }
.site-header nav, footer nav { display: flex; gap: 18px; }
.site-header nav a, footer a { color: var(--muted); text-underline-offset: 4px; }

.hero { padding-block: clamp(64px, 10vw, 112px) 72px; text-align: center; }
.eyebrow { margin: 0 0 14px; color: var(--accent); font-size: .75rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(3.1rem, 10vw, 6.8rem); line-height: .88; letter-spacing: -.075em; }
.lede { max-width: 610px; margin: 26px auto 34px; color: var(--muted); font-size: clamp(1.05rem, 2.6vw, 1.35rem); line-height: 1.55; }
.lede strong { color: var(--ink); }

.bid-form { max-width: 920px; margin: auto; padding: 10px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 18px 55px rgba(16,27,24,.09); text-align: left; }
.bid-form.is-targeted { animation: bid-target .7s ease-out; }
.bid-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(118px, .62fr) 84px 230px; gap: 10px; }
.bid-grid label { min-width: 0; padding: 4px 10px; }
.bid-grid label > span:first-child { display: block; margin-bottom: 4px; color: var(--muted); font-size: .7rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.bid-grid input { width: 100%; min-height: 32px; border: 0; color: var(--ink); font-weight: 650; background: transparent; }
.bid-grid input:focus-visible { outline: 0; border-radius: 0; box-shadow: inset 0 -2px var(--accent); }
.bid-grid label:first-child { border-right: 1px solid var(--line); }
.money-input { display: flex; align-items: center; gap: 4px; }
.money-input b { font-size: .95rem; }
.rank-result { display: grid; place-content: center; justify-items: center; min-height: 58px; border: 1px solid var(--line); border-radius: 11px; background: var(--hover); color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.rank-result small { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: .58rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.rank-result strong { color: var(--ink); font-size: 1.3rem; line-height: 1.05; }
.rank-result.is-top { border-color: rgba(0,119,73,.42); background: var(--leader); box-shadow: inset 0 2px var(--gold); }
.rank-result.is-top strong { color: var(--accent); }
.bid-grid button { width: 230px; border: 0; border-radius: 11px; background: var(--green); color: white; font-weight: 800; cursor: pointer; padding: 0 18px; min-height: 58px; white-space: nowrap; }
.bid-form button:hover, .bid-form button:focus-visible { background: #00643e; }
.bid-form button:disabled { cursor: not-allowed; opacity: .52; }
.quote-line { min-height: 25px; padding: 12px 10px 4px; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.quote-line:empty { min-height: 0; padding: 0; }
.quote-line strong { color: var(--ink); }
.form-error { color: var(--error); font-weight: 650; }

.board { padding-block: 46px 80px; }
.board-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding-bottom: 22px; }
.board-heading h2 { margin: 0; font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.055em; }
.board-status { display: grid; justify-items: end; gap: 9px; }
.board-caption { margin: 0; color: var(--muted); }
.live-indicator { display: flex; align-items: center; gap: 7px; min-height: 32px; margin: 0; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .76rem; white-space: nowrap; }
.live-indicator strong { color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(0,119,73,.12); animation: live-pulse 2.2s ease-in-out infinite; }
.rankings { display: grid; list-style: none; margin: 0; padding: 0; }
.rankings li { display: grid; grid-template-columns: minmax(0, 1fr) 166px; align-items: stretch; border-top: 1px solid var(--line); }
.rankings li:last-child { border-bottom: 1px solid var(--line); }
.rankings .venture-link { display: grid; grid-template-columns: 52px minmax(0,1fr) auto; align-items: center; gap: 16px; min-width: 0; padding: 22px 18px 22px 8px; text-decoration: none; }
.rankings li:hover { background: var(--hover); }
.rank { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight: 700; }
.venture-copy { min-width: 0; }
.venture-copy strong, .venture-copy small { display: block; }
.venture-copy strong { font-size: 1.08rem; }
.venture-copy small { margin-top: 4px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listing-metrics { display: grid; justify-items: end; gap: 3px; margin-left: 12px; }
.listing-metrics small { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .68rem; white-space: nowrap; }
.amount { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight: 800; }
.row-actions { align-self: center; display: grid; grid-template-columns: 2fr 1fr; gap: 6px; margin-right: 8px; }
.row-cta { display: inline-grid; grid-auto-flow: column; place-items: center; place-content: center; gap: 7px; height: 44px; min-width: 0; padding: 0 12px; border-radius: 11px; background: transparent; color: var(--accent); border: 1px solid currentColor; font-weight: 800; text-decoration: none; white-space: nowrap; cursor: pointer; }
.row-cta svg, .share-close svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.share-cta { padding-inline: 10px; }
.row-cta:hover, .row-cta:focus-visible { background: var(--green); color: white; }
.rankings .leader { position: relative; margin-bottom: 18px; overflow: hidden; border: 1px solid rgba(0,119,73,.36); border-radius: 18px; background: linear-gradient(120deg, var(--leader), var(--surface)); box-shadow: 0 14px 34px rgba(16,27,24,.09), inset 4px 0 var(--accent); }
.rankings .leader::after { position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, var(--gold), var(--green), var(--blue)); content: ''; }
.rankings .leader + li { border-top: 1px solid var(--line); }
.leader .rank { color: var(--accent); transform: translateX(10px); }
.top-spot-label { display: inline-block; margin-bottom: 5px; color: #7a5700; font-size: .63rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.live-cursors { position: fixed; inset: 0; z-index: 50; overflow: hidden; pointer-events: none; }
.remote-cursor { position: absolute; top: 0; left: 0; width: 14px; height: 18px; opacity: .9; background: var(--cursor-colour); clip-path: polygon(0 0, 100% 65%, 57% 70%, 40% 100%); filter: drop-shadow(0 1px 1px rgba(0,0,0,.28)); transition: transform .1s linear, opacity .25s ease; will-change: transform; }
.snapshot-note { max-width: 690px; margin: 20px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.snapshot-note { margin: 0 0 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }

body.share-open { overflow: hidden; }
body.checkout-open { overflow: hidden; }
body.listing-setup-open { overflow: hidden; }
.share-dialog { width: min(560px, calc(100% - 32px)); max-width: none; max-height: min(760px, calc(100dvh - 32px)); margin: auto; padding: 0; border: 0; border-radius: 24px; background: transparent; color: var(--ink); overflow: visible; }
.share-dialog::backdrop { background: rgba(3,10,7,.62); backdrop-filter: blur(5px); }
.share-dialog[open] { animation: dialog-in .22s ease-out; }
.share-sheet { max-height: min(760px, calc(100dvh - 32px)); overflow: auto; padding: 26px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 28px 90px rgba(0,0,0,.28); }
.share-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.share-heading .eyebrow { margin-bottom: 6px; }
.share-heading h2 { margin: 0; font-size: 1.75rem; letter-spacing: -.045em; }
.share-close { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--muted); cursor: pointer; }
.share-close:hover { color: var(--ink); background: var(--hover); }
.share-help { margin: 12px 0 20px; color: var(--muted); font-size: .88rem; }
.share-message-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.share-dialog textarea { display: block; width: 100%; min-height: 126px; resize: vertical; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); color: var(--ink); line-height: 1.5; }
.share-platforms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.share-platforms button { min-height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); font-weight: 740; cursor: pointer; transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease; }
.share-platforms button:hover, .share-platforms button:focus-visible { border-color: var(--accent); background: var(--hover); }
.share-platforms button:active { transform: translateY(1px); }
.share-platforms button.is-complete { border-color: var(--accent); background: var(--leader); color: var(--accent); }
.share-platforms button.is-complete::before { content: '✓ '; }
.share-toast { position: fixed; z-index: 100; right: 20px; bottom: 20px; max-width: min(390px, calc(100% - 40px)); margin: 0; padding: 12px 15px; border-radius: 11px; background: var(--ink); color: var(--paper); font-size: .82rem; font-weight: 700; box-shadow: 0 12px 38px rgba(0,0,0,.24); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.share-toast.is-visible { opacity: 1; transform: translateY(0); }
.share-toast.is-error { background: var(--error); color: white; }

.checkout-dialog { width: min(500px, calc(100% - 32px)); max-width: none; margin: auto; padding: 0; border: 0; border-radius: 24px; background: transparent; color: var(--ink); overflow: visible; }
.checkout-dialog::backdrop { background: rgba(3,10,7,.62); backdrop-filter: blur(5px); }
.checkout-dialog[open] { animation: dialog-in .22s ease-out; }
.checkout-sheet { padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 28px 90px rgba(0,0,0,.28); }
.checkout-sheet .eyebrow { margin-bottom: 7px; }
.checkout-sheet h2 { margin: 0; font-size: clamp(2rem, 8vw, 3rem); letter-spacing: -.055em; }
.checkout-summary { margin: 18px 0 0; color: var(--muted); font-size: 1.05rem; }
.checkout-summary strong { color: var(--ink); }
.checkout-terms { margin: 22px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.6; }
.checkout-terms a { color: var(--accent); text-underline-offset: 3px; }
.checkout-merchant { margin: 13px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--hover); color: var(--muted); font-size: .78rem; line-height: 1.45; }
.checkout-actions { display: grid; grid-template-columns: 1fr 1.8fr; gap: 9px; margin-top: 24px; }
.checkout-actions button { min-height: 50px; border-radius: 12px; font-weight: 800; cursor: pointer; }
.checkout-actions .secondary-action { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.checkout-actions .primary-action { border: 1px solid var(--green); background: var(--green); color: white; }
.checkout-actions .secondary-action:hover { border-color: var(--accent); background: var(--hover); }
.checkout-actions .primary-action:hover { background: #00643e; }

.listing-setup-dialog { width: min(520px, calc(100% - 32px)); max-width: none; margin: auto; padding: 0; border: 0; border-radius: 24px; background: transparent; color: var(--ink); overflow: visible; }
.listing-setup-dialog::backdrop { background: rgba(3,10,7,.68); backdrop-filter: blur(6px); }
.listing-setup-dialog[open] { animation: dialog-in .22s ease-out; }
.listing-setup-sheet { display: grid; gap: 18px; padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 28px 90px rgba(0,0,0,.3); }
.listing-setup-sheet .eyebrow { margin: 0; }
.listing-setup-sheet h2 { margin: -7px 0 0; font-size: clamp(2.2rem, 8vw, 3.4rem); letter-spacing: -.06em; }
.listing-setup-help { margin: -8px 0 2px; color: var(--muted); line-height: 1.5; }
.listing-setup-sheet label { display: grid; gap: 7px; }
.listing-setup-sheet label > span { color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.listing-setup-sheet input, .listing-setup-sheet textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font-weight: 650; }
.listing-setup-sheet input { min-height: 50px; padding: 0 13px; }
.listing-setup-sheet textarea { min-height: 92px; padding: 12px 13px; resize: vertical; line-height: 1.45; }
.listing-setup-sheet input:focus-visible, .listing-setup-sheet textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.listing-setup-sheet label small { justify-self: end; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .68rem; }
.listing-setup-actions { display: grid; grid-template-columns: 1fr 1.7fr; gap: 9px; margin-top: 2px; }
.listing-setup-actions button { min-height: 50px; border-radius: 12px; font-weight: 800; cursor: pointer; }
.listing-setup-actions .secondary-action { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.listing-setup-actions .primary-action { border: 1px solid var(--green); background: var(--green); color: white; }
.listing-setup-actions .primary-action:disabled { cursor: wait; opacity: .65; }

.legal { max-width: 760px; padding-block: 70px 90px; }
.legal h1 { font-size: clamp(3rem, 8vw, 5.5rem); }
.legal-intro { margin: 24px 0 48px; color: var(--muted); font-size: clamp(1.1rem, 2.5vw, 1.35rem); line-height: 1.6; }
.legal h2 { margin: 42px 0 12px; font-size: 1.35rem; letter-spacing: -.025em; }
.legal p, .legal li { color: var(--muted); line-height: 1.7; }
.legal li + li { margin-top: 9px; }
.legal a { color: var(--accent); text-underline-offset: 3px; }
.legal code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .88em; }
.legal-updated { margin-top: 52px; font-size: .82rem; }

.payment-page { display: grid; place-items: center; min-height: 66vh; padding-block: 60px 90px; }
.status-card { width: min(560px, 100%); padding: clamp(28px, 7vw, 52px); border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 20px 70px rgba(16,27,24,.08); text-align: center; }
.status-card h1 { font-size: clamp(2.2rem, 8vw, 4.2rem); line-height: .95; }
.status-card p { color: var(--muted); line-height: 1.6; }
.status-card a { text-underline-offset: 4px; }
.status-mark { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 24px; border-radius: 50%; background: var(--green); color: white !important; font-size: 1.7rem; }
.status-spinner { display: block; width: 44px; height: 44px; margin: 0 auto 26px; border: 4px solid #dfe8e2; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.primary-link { display: inline-grid; place-items: center; min-height: 48px; margin: 16px 6px 0; padding: 0 20px; border: 0; border-radius: 11px; background: var(--green); color: white !important; font-weight: 800; text-decoration: none; cursor: pointer; }
.text-link { display: block; margin-top: 20px; color: var(--muted); }
.hidden { display: none !important; }
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes bid-target {
  0%, 100% { box-shadow: 0 18px 55px rgba(16,27,24,.09), 0 0 0 0 rgba(255,184,28,0); }
  42% { box-shadow: 0 18px 55px rgba(16,27,24,.09), 0 0 0 6px rgba(255,184,28,.5); }
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(0,119,73,.1); }
  50% { box-shadow: 0 0 0 7px rgba(0,119,73,.02); }
}
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }

footer { display: flex; justify-content: space-between; gap: 24px; padding-block: 30px 44px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
footer p { margin: 0; }

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f0f5f2;
    --muted: #aab3ae;
    --paper: #050806;
    --line: #27302c;
    --surface: #080d0a;
    --hover: #0c1510;
    --leader: #07170e;
    --error: #ff847b;
    --accent: #55c98e;
  }
  .flag-stripe span:nth-child(4) { border-bottom-color: #666; }
  .bid-form, .status-card { box-shadow: 0 18px 55px rgba(0,0,0,.35); }
  .rankings .leader { border-color: rgba(85,201,142,.42); box-shadow: 0 14px 34px rgba(0,0,0,.28), inset 4px 0 var(--accent); }
  .top-spot-label { color: var(--gold); }
}

@media (max-width: 700px) {
  .site-header { min-height: 62px; }
  .site-header nav { gap: 14px; font-size: .85rem; }
  .hero { padding-block: 56px 56px; }
  h1 { font-size: clamp(3.2rem, 17vw, 5.2rem); }
  .lede { margin-top: 22px; }
  .bid-form { padding: 8px; }
  .bid-grid { grid-template-columns: minmax(0, 1fr) 88px; gap: 0; }
  .bid-grid label { padding: 11px 12px; }
  .bid-grid label:first-child { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); }
  .rank-result { min-height: 58px; margin: 6px 0; }
  .bid-grid button { grid-column: 1 / -1; width: 100%; min-height: 52px; margin-top: 6px; }
  .board { padding-top: 28px; }
  .board-heading { align-items: start; flex-direction: column; }
  .board-status { width: 100%; justify-items: start; }
  .board-caption { display: none; }
  .live-indicator { max-width: 100%; white-space: normal; }
  .rankings li { grid-template-columns: 1fr; padding-bottom: 12px; }
  .rankings .venture-link { grid-template-columns: 38px minmax(0,1fr) auto; gap: 9px; padding: 18px 8px; }
  .venture-copy small { max-width: 44vw; }
  .row-actions { width: auto; margin: 0 8px; }
  .row-cta { height: 46px; }
  .rankings .leader { margin-bottom: 16px; }
  .share-dialog { inset-block-start: auto; width: 100%; max-height: calc(100dvh - 20px); margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .share-dialog[open] { animation: sheet-in .24s ease-out; }
  .share-sheet { max-height: calc(100dvh - 20px); padding: 22px 18px calc(20px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; }
  .share-platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-toast { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); }
  .checkout-dialog { inset-block-start: auto; width: 100%; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .checkout-dialog[open] { animation: sheet-in .24s ease-out; }
  .checkout-sheet { padding: 24px 18px calc(20px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; }
  .listing-setup-dialog { inset-block-start: auto; width: 100%; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .listing-setup-dialog[open] { animation: sheet-in .24s ease-out; }
  .listing-setup-sheet { padding: 24px 18px calc(20px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; }
  footer { flex-direction: column; }
}

@keyframes sheet-in { from { opacity: 0; transform: translateY(28px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .status-spinner, .bid-form.is-targeted, .live-dot, .share-dialog[open], .checkout-dialog[open], .listing-setup-dialog[open] { animation: none; }
  .remote-cursor, .share-platforms button, .share-toast { transition: none; }
}
