:root {
  --navy: #10203f;
  --navy-2: #16294d;
  --blue: #2f6bff;
  --blue-soft: #eaf0ff;
  --gold: #ffb020;
  --gold-deep: #b9770a;
  --green: #17915b;
  --red: #d23f4a;
  --ink: #1a2233;
  --muted: #667089;
  --line: #e6e9f0;
  --bg: #f5f7fb;
  --card: #ffffff;
  --shadow: 0 6px 24px rgba(16, 32, 63, 0.08);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --blue-soft: #17244a; --ink: #e8ecf5; --muted: #97a1b8; --line: #26304a;
    --bg: #0b1120; --card: #131b2e; --navy: #0a1730; --navy-2: #0f1e3d;
    --shadow: 0 6px 24px rgba(0,0,0,0.35);
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.icon { width: 1em; height: 1em; vertical-align: -0.12em; }

/* ── Header ─────────────────────────────── */
header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: 1080px; margin: 0 auto; padding: 0.6rem 1rem;
  display: flex; align-items: center; gap: 0.8rem;
}
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  display: grid; place-items: center; color: var(--navy); font-weight: 900; font-size: 0.85rem; }
.brand span { color: var(--gold-deep); }
.nav-search { flex: 1; max-width: 380px; position: relative; }
.nav-search input {
  width: 100%; padding: 0.5rem 0.9rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--ink); font-size: 0.9rem; outline: none;
}
.nav-search input:focus { border-color: var(--blue); }
.nav-spacer { flex: 1; }
.nav-links { display: flex; align-items: center; gap: 0.35rem; }
.nav-links a, .nav-links button { padding: 0.45rem 0.7rem; border-radius: 9px; font-size: 0.9rem; font-weight: 600;
  color: var(--muted); background: none; border: none; }
.nav-links a:hover, .nav-links button:hover { color: var(--ink); background: var(--blue-soft); }
.btn { border: none; border-radius: 10px; font-weight: 700; padding: 0.5rem 0.95rem; font-size: 0.9rem; transition: transform .06s, filter .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { filter: brightness(1.07); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { filter: brightness(1.05); }
.btn-ghost { background: var(--blue-soft); color: var(--blue); }
.pill-points { display: inline-flex; align-items: center; gap: 0.35rem; background: var(--blue-soft); color: var(--gold-deep);
  font-weight: 800; padding: 0.35rem 0.7rem; border-radius: 999px; font-size: 0.85rem; }

/* ── Hero ───────────────────────────────── */
.hero { background: radial-gradient(1000px 400px at 20% -20%, rgba(255,176,32,.18), transparent 60%),
  radial-gradient(900px 400px at 100% 0%, rgba(47,107,255,.22), transparent 55%), var(--navy);
  color: #fff; }
.hero-in { max-width: 1080px; margin: 0 auto; padding: 3rem 1rem 2.6rem; text-align: center; }
.hero h1 { font-size: 2.5rem; letter-spacing: -0.03em; line-height: 1.08; }
.hero h1 b { color: var(--gold); }
.hero p { max-width: 620px; margin: 0.8rem auto 0; font-size: 1.08rem; color: #c4d0e8; }
.hero-cta { display: flex; gap: 0.7rem; justify-content: center; margin-top: 1.4rem; flex-wrap: wrap; }
.hero-cta .btn { padding: 0.7rem 1.3rem; font-size: 1rem; }
.hero-stats { display: flex; justify-content: center; gap: 2.4rem; margin-top: 2rem; flex-wrap: wrap; }
.hstat b { display: block; font-size: 1.7rem; font-weight: 800; color: var(--gold); }
.hstat span { font-size: 0.75rem; text-transform: uppercase; letter-spacing: .08em; color: #9fb0d0; }

/* how it works strip */
.how { max-width: 1080px; margin: 1.6rem auto 0; padding: 0 1rem; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 1rem; }
.how-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.how-num { width: 30px; height: 30px; border-radius: 8px; background: var(--blue-soft); color: var(--blue);
  display: grid; place-items: center; font-weight: 800; margin-bottom: 0.5rem; }
.how-card h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.how-card p { font-size: 0.86rem; color: var(--muted); }
.how-card .accent { color: var(--gold-deep); font-weight: 700; }

/* ── Layout ─────────────────────────────── */
.wrap { max-width: 1080px; margin: 1.6rem auto 3rem; padding: 0 1rem; display: grid;
  grid-template-columns: 1fr 300px; gap: 1.3rem; align-items: start; }
@media (max-width: 860px) { .wrap { grid-template-columns: 1fr; } .side { order: -1; } }

.feed-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.feed-head h2 { font-size: 1.2rem; margin-right: auto; }
.tabs { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.tabs button { border: none; background: none; padding: 0.35rem 0.8rem; border-radius: 999px; font-weight: 700; font-size: 0.82rem; color: var(--muted); }
.tabs button.active { background: var(--blue); color: #fff; }
.chips { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 999px;
  padding: 0.3rem 0.75rem; font-size: 0.8rem; font-weight: 600; }
.chip.active { background: var(--ink); color: var(--card); border-color: var(--ink); }

/* ── Deal card ──────────────────────────── */
.deals { display: flex; flex-direction: column; gap: 0.8rem; }
.deal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: grid; grid-template-columns: 62px 92px 1fr; transition: box-shadow .15s, transform .08s; }
.deal:hover { box-shadow: var(--shadow); }
.vote { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--bg); border-right: 1px solid var(--line); padding: 0.4rem 0; }
.vote button { width: 30px; height: 26px; border: none; background: none; border-radius: 7px; color: var(--muted); font-size: 1rem; }
.vote button:hover { background: var(--blue-soft); color: var(--blue); }
.vote .up.on { color: var(--green); }
.vote .down.on { color: var(--red); }
.vote .count { font-weight: 800; font-size: 0.95rem; }
.deal-img { display: grid; place-items: center; background: #fff; border-right: 1px solid var(--line); padding: 6px; }
.deal-img img { max-width: 100%; max-height: 78px; object-fit: contain; }
.deal-img .ph { color: var(--muted); font-size: 1.6rem; }
.deal-body { padding: 0.7rem 0.9rem; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.deal-store { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--blue); }
.deal-store .editor { color: var(--gold-deep); }
.deal-title { font-weight: 700; font-size: 0.98rem; line-height: 1.28; }
.deal-title a:hover { color: var(--blue); }
.deal-price { display: flex; align-items: baseline; gap: 0.5rem; }
.deal-price .now { font-weight: 800; font-size: 1.1rem; color: var(--green); }
.deal-price .was { text-decoration: line-through; color: var(--muted); font-size: 0.85rem; }
.deal-price .off { background: rgba(23,145,91,.12); color: var(--green); font-weight: 800; font-size: 0.72rem; padding: .1rem .4rem; border-radius: 6px; }
.deal-desc { font-size: 0.84rem; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.deal-foot { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.2rem; font-size: 0.76rem; color: var(--muted); flex-wrap: wrap; }
.deal-foot .by b { color: var(--ink); }
.deal-foot .get { margin-left: auto; }
.get-btn { background: var(--gold); color: var(--navy); font-weight: 800; padding: 0.4rem 0.9rem; border-radius: 9px; font-size: 0.82rem; }
.get-btn:hover { filter: brightness(1.05); }

/* ── Side ───────────────────────────────── */
.side { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 68px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.panel h3 { font-size: 0.95rem; margin-bottom: 0.6rem; }
.share-meter { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.share-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--gold)); }
.share-row { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin-top: 0.35rem; }
.lead { display: flex; flex-direction: column; gap: 0.4rem; }
.lead-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.lead-row .rank { width: 20px; font-weight: 800; color: var(--muted); }
.lead-row .who { font-weight: 700; flex: 1; }
.lead-row .pts { font-weight: 800; color: var(--gold-deep); }

/* ── Modal ──────────────────────────────── */
.modal-bg { position: fixed; inset: 0; background: rgba(10,18,35,.55); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 1rem; }
.modal-bg.open { display: flex; }
.modal { background: var(--card); border-radius: 18px; width: 100%; max-width: 440px; padding: 1.5rem; box-shadow: var(--shadow);
  max-height: 92vh; overflow-y: auto; animation: pop .16s ease-out; }
.modal.wide { max-width: 560px; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h2 { font-size: 1.3rem; margin-bottom: 0.3rem; }
.modal .sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }
.field { margin-bottom: 0.8rem; }
.field label { display: block; font-size: 0.8rem; font-weight: 700; margin-bottom: 0.25rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: 10px; font-size: 0.95rem;
  background: var(--bg); color: var(--ink); outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); }
.field .row { display: flex; gap: 0.6rem; }
.modal .btn-full { width: 100%; padding: 0.7rem; font-size: 1rem; margin-top: 0.4rem; }
.modal .switch { text-align: center; font-size: 0.85rem; color: var(--muted); margin-top: 0.8rem; }
.modal .switch a { color: var(--blue); font-weight: 700; }
.modal .close { float: right; border: none; background: none; font-size: 1.3rem; color: var(--muted); line-height: 1; }
.err { background: rgba(210,63,74,.1); color: var(--red); font-size: 0.85rem; padding: 0.5rem 0.7rem; border-radius: 8px; margin-bottom: 0.8rem; display: none; }
.err.show { display: block; }
.ok { background: rgba(23,145,91,.1); color: var(--green); font-size: 0.85rem; padding: 0.5rem 0.7rem; border-radius: 8px; margin-bottom: 0.8rem; display: none; }
.ok.show { display: block; }

/* ── Dashboard ──────────────────────────── */
.dash { max-width: 1080px; margin: 1.6rem auto 3rem; padding: 0 1rem; }
.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.dash-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.dash-card .k { font-size: 0.75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.dash-card .v { font-size: 1.9rem; font-weight: 800; margin-top: 0.2rem; }
.dash-card.gold .v { color: var(--gold-deep); }
.dash-card.blue .v { color: var(--blue); }
table.ledger { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.ledger th, table.ledger td { padding: 0.6rem 0.8rem; text-align: left; font-size: 0.85rem; border-bottom: 1px solid var(--line); }
table.ledger th { background: var(--bg); font-size: 0.72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tag { font-size: 0.7rem; font-weight: 800; padding: .12rem .5rem; border-radius: 999px; }
.tag.pending { background: rgba(255,176,32,.16); color: var(--gold-deep); }
.tag.available { background: rgba(23,145,91,.14); color: var(--green); }

.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--card);
  padding: 0.7rem 1.1rem; border-radius: 999px; font-size: 0.9rem; font-weight: 600; z-index: 200; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

footer { border-top: 1px solid var(--line); background: var(--card); }
.foot-in { max-width: 1080px; margin: 0 auto; padding: 1.6rem 1rem; text-align: center; color: var(--muted); font-size: 0.85rem; }
.foot-in a { color: var(--blue); }
.hidden { display: none !important; }
@media (max-width: 560px) {
  .hero h1 { font-size: 1.9rem; }
  .deal { grid-template-columns: 52px 1fr; }
  .deal-img { display: none; }
  .nav-search { display: none; }
}

/* ── Three-way split bar ────────────────── */
.split-bar { display: flex; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); height: 66px; }
.split { display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; min-width: 0; }
.split b { font-size: 1.15rem; font-weight: 800; }
.split span { font-size: 0.7rem; opacity: 0.92; }
.split.buyer { background: linear-gradient(135deg, #17915b, #0f7a4a); }
.split.poster { background: linear-gradient(135deg, var(--gold), var(--gold-deep)); color: var(--navy); }
.split.site { background: linear-gradient(135deg, #55617d, #3c4763); }

/* ═══════════════════════════════════════════════════════════════════
   Visual polish v3 — typography, depth, motion
   ═══════════════════════════════════════════════════════════════════ */
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: -0.006em; }
h1, .hero h1, .brand { font-family: "Sora", "Inter", system-ui, sans-serif; }

/* Header: crisper glass */
header { background: color-mix(in srgb, var(--card) 82%, transparent); box-shadow: 0 1px 0 var(--line); border-bottom: none; }
.brand-mark { box-shadow: 0 2px 8px rgba(255,176,32,.4); }

/* Buttons: softer, with depth + spring */
.btn { border-radius: 11px; transition: transform .12s cubic-bezier(.2,.8,.2,1), box-shadow .15s, filter .15s; }
.btn-primary { box-shadow: 0 4px 14px rgba(47,107,255,.35); }
.btn-gold { box-shadow: 0 4px 14px rgba(255,176,32,.4); }
.btn-primary:hover, .btn-gold:hover { transform: translateY(-1px); }
.btn-primary:active, .btn-gold:active { transform: translateY(0); }

/* Hero: layered mesh + tighter display type */
.hero { position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(700px 300px at 80% 120%, rgba(23,145,91,.16), transparent 60%);
}
.hero-in { padding: 4rem 1rem 3.2rem; position: relative; }
.hero h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); font-weight: 800; letter-spacing: -0.035em; }
.hero p { font-size: 1.12rem; line-height: 1.6; color: #cdd8ef; }
.hero-cta .btn { padding: 0.8rem 1.5rem; border-radius: 13px; }
.hero-stats { gap: 2.8rem; margin-top: 2.4rem; }
.hstat b { font-size: 2rem; letter-spacing: -0.02em; }

/* Section headings */
.feed-head h2, .dash h1, .dash h2, .panel h3, .how-card h3 { font-family: "Sora","Inter",sans-serif; letter-spacing: -0.02em; }

/* Cards: unified soft depth + hover lift */
.how-card, .panel, .dash-card, .cat-card { box-shadow: 0 1px 2px rgba(16,32,63,.04); transition: transform .14s, box-shadow .18s, border-color .18s; }
.how-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); }
.how-num { background: linear-gradient(135deg, var(--gold), var(--gold-deep)); color: var(--navy); box-shadow: 0 2px 8px rgba(255,176,32,.35); }

/* Deal cards: cleaner, springier, staggered entrance */
.deal { border-radius: 16px; box-shadow: 0 1px 2px rgba(16,32,63,.05); }
.deal:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(16,32,63,.12); border-color: color-mix(in srgb, var(--blue) 25%, var(--line)); }
.deal-title { letter-spacing: -0.01em; }
.deal-price .now { letter-spacing: -0.02em; }
.get-btn { box-shadow: 0 3px 10px rgba(255,176,32,.35); transition: transform .1s; }
.get-btn:hover { transform: translateY(-1px); }
.vote button { transition: transform .08s, background .12s; }
.vote button:active { transform: scale(.85); }
@keyframes riseIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.deals .deal { animation: riseIn .32s cubic-bezier(.2,.8,.2,1) both; }
.deals .deal:nth-child(2){animation-delay:.03s}.deals .deal:nth-child(3){animation-delay:.06s}
.deals .deal:nth-child(4){animation-delay:.09s}.deals .deal:nth-child(5){animation-delay:.12s}
.deals .deal:nth-child(n+6){animation-delay:.15s}

/* Split bar: rounder, subtle sheen */
.split-bar { height: 72px; border: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.04); }
.split b { font-size: 1.25rem; letter-spacing: -0.02em; }
.split { position: relative; }
.split::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.16), transparent 45%); }

/* Chips + tabs: pill polish */
.chip { transition: all .12s; }
.chip:hover { border-color: var(--blue); color: var(--ink); }
.tabs { box-shadow: 0 1px 3px rgba(16,32,63,.06); }

/* Dashboard cards: gradient accents */
.dash-card { border-radius: 16px; }
.dash-card.gold { background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 12%, var(--card)), var(--card)); }
.dash-card.blue { background: linear-gradient(160deg, color-mix(in srgb, var(--blue) 9%, var(--card)), var(--card)); }
.dash-card .v { font-family: "Sora","Inter",sans-serif; letter-spacing: -0.03em; }

/* Modal: smoother */
.modal { border-radius: 20px; box-shadow: 0 24px 70px rgba(10,18,35,.4); }
.modal h2 { font-family: "Sora","Inter",sans-serif; letter-spacing: -0.02em; }
.field input, .field select, .field textarea { transition: border-color .12s, box-shadow .12s; }
.field input:focus, .field select:focus, .field textarea:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }

/* Footer refinement */
footer { background: var(--navy); border-top: none; }
.foot-in { color: #9fb0d0; }
.foot-in a { color: var(--gold); }

/* Toast: pop */
.toast { border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }

/* Hero eyebrow badge */
.eyebrow { display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: .02em;
  color: var(--gold); background: rgba(255,176,32,.12); border: 1px solid rgba(255,176,32,.3);
  padding: 0.35rem 0.9rem; border-radius: 999px; margin-bottom: 1.1rem; }
.get-btn { white-space: nowrap; }
