:root {
  color-scheme: light;
  --bg: #f3ebdd;
  --bg-soft: #e8dcc9;
  --surface: rgba(255, 250, 241, .9);
  --surface-solid: #fffaf2;
  --surface-elevated: #fffdf8;
  --text: #2b211b;
  --muted: #66584c;
  --soft: #82705f;
  --line: rgba(82, 61, 44, .14);
  --line-strong: rgba(82, 61, 44, .24);
  --accent: #2f6f9d;
  --accent-2: #4e8cb9;
  --brown: #76553f;
  --brown-2: #9c7456;
  --gold: #936b2f;
  --success: #447b5b;
  --danger: #a94e47;
  --shadow: 0 22px 70px rgba(79, 55, 36, .14);
  --shadow-soft: 0 10px 30px rgba(79, 55, 36, .09);
  --radius: 24px;
  --ease: cubic-bezier(.2,.8,.2,1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); color: var(--text); }
a { color: inherit; }
button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.ambient { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.ambient span { position: absolute; width: 55vw; height: 28vw; border-radius: 50%; filter: blur(62px); opacity: .16; transform: rotate(-10deg); }
.ambient span:nth-child(1) { top: -10vw; left: -7vw; background: #bd8b62; }
.ambient span:nth-child(2) { top: 18vh; right: -18vw; background: #5f95c2; }
.ambient span:nth-child(3) { bottom: -12vw; left: 18vw; background: #d7b47b; }

.bid-app { position: relative; z-index: 1; width: min(1120px, calc(100% - 28px)); margin: 0 auto; padding: 22px 0 56px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 8px 2px 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 900; letter-spacing: -.03em; }
.brand img { width: 54px; height: 54px; object-fit: contain; }
.brand-copy { display: flex; align-items: baseline; gap: 7px; font-size: 1.2rem; }
.brand-copy small { font-size: .68rem; letter-spacing: .12em; color: var(--accent); text-transform: uppercase; }
.top-links { display: flex; align-items: center; gap: 8px; }
.top-links a { text-decoration: none; color: var(--muted); font-weight: 700; font-size: .9rem; padding: 9px 12px; border-radius: 999px; }
.top-links a:hover { background: rgba(255,255,255,.42); color: var(--text); }

.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr); gap: 24px; align-items: stretch; }
.hero-copy, .bid-card { border: 1px solid var(--line); border-radius: 30px; background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.hero-copy { padding: clamp(28px, 5vw, 56px); min-height: 520px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.hero-copy::after { content: ""; position: absolute; width: 260px; height: 260px; right: -100px; bottom: -110px; border: 34px solid rgba(47,111,157,.09); border-radius: 50%; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; width: max-content; max-width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.43); color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(68,123,91,.1); }
.hero h1 { margin: 22px 0 14px; max-width: 720px; font-size: clamp(3rem, 7.2vw, 6.4rem); line-height: .88; letter-spacing: -.075em; font-weight: 950; }
.hero h1 span { color: var(--accent); }
.hero-lede { margin: 0; max-width: 630px; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.18rem); line-height: 1.65; }
.hero-line { margin-top: 22px; font-weight: 900; letter-spacing: -.02em; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.hero-proof span { border: 1px solid var(--line); border-radius: 999px; background: var(--surface-solid); padding: 9px 12px; font-size: .84rem; color: var(--muted); font-weight: 750; }

.bid-card { padding: 26px; display: flex; flex-direction: column; }
.bid-card-header { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.bid-card h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.8rem); letter-spacing: -.05em; line-height: 1; }
.bid-card h2 strong { color: var(--accent); }
.live-pill { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; background: rgba(68,123,91,.1); color: var(--success); font-size: .74rem; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; }
.label { display: grid; gap: 7px; margin-top: 14px; color: var(--muted); font-size: .78rem; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; }
.input, .textarea { width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.55); color: var(--text); outline: none; border-radius: 16px; transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease); }
.input { height: 52px; padding: 0 15px; }
.textarea { min-height: 78px; resize: vertical; padding: 13px 15px; line-height: 1.4; }
.input:focus, .textarea:focus { border-color: rgba(47,111,157,.55); box-shadow: 0 0 0 4px rgba(47,111,157,.09); background: #fffdf8; }
.amount-control { display: grid; grid-template-columns: 48px 1fr 48px; gap: 8px; align-items: stretch; }
.amount-control button { border: 1px solid var(--line); background: var(--surface-solid); border-radius: 15px; cursor: pointer; font-size: 1.3rem; font-weight: 850; color: var(--text); }
.amount-wrap { position: relative; }
.amount-wrap::before { content: "$"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 1.1rem; font-weight: 900; color: var(--soft); }
.amount-wrap .input { padding-left: 31px; font-size: 1.16rem; font-weight: 900; }
.helper { margin: 8px 0 0; color: var(--soft); font-size: .82rem; line-height: 1.45; }
.primary-btn, .takeover-btn, .rank-claim { border: 0; cursor: pointer; font-weight: 900; transition: transform .16s var(--ease), box-shadow .16s var(--ease), opacity .16s var(--ease); }
.primary-btn:active, .takeover-btn:active, .rank-claim:active { transform: translateY(1px) scale(.995); }
.primary-btn:disabled, .takeover-btn:disabled { opacity: .55; cursor: wait; }
.primary-btn { margin-top: 20px; min-height: 54px; border-radius: 17px; color: white; background: linear-gradient(125deg, var(--brown) 0%, var(--brown-2) 44%, var(--accent) 100%); box-shadow: 0 13px 30px rgba(47,111,157,.2); }
.primary-btn:hover:not(:disabled) { box-shadow: 0 16px 38px rgba(47,111,157,.26); transform: translateY(-1px); }
.divider { display: flex; align-items: center; gap: 10px; margin: 17px 0 13px; color: var(--soft); font-size: .73rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.takeover-btn { min-height: 48px; border-radius: 15px; border: 1px solid rgba(147,107,47,.25); color: #6f4c17; background: rgba(215,180,123,.14); }
.takeover-btn:hover:not(:disabled) { background: rgba(215,180,123,.22); }

.notice { margin: 18px 0 0; border-radius: 16px; padding: 12px 14px; font-size: .88rem; line-height: 1.45; border: 1px solid var(--line); background: rgba(255,255,255,.5); color: var(--muted); }
.notice.success { border-color: rgba(68,123,91,.26); color: var(--success); background: rgba(68,123,91,.08); }
.notice.error { border-color: rgba(169,78,71,.28); color: var(--danger); background: rgba(169,78,71,.07); }

.stats { margin: 22px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat { border: 1px solid var(--line); border-radius: 18px; background: rgba(255,250,241,.72); padding: 16px; box-shadow: var(--shadow-soft); }
.stat span { display: block; color: var(--soft); font-size: .72rem; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.stat strong { display: block; margin-top: 4px; font-size: 1.25rem; letter-spacing: -.03em; }

.board-shell { border: 1px solid var(--line); border-radius: 28px; overflow: hidden; background: rgba(255,250,241,.8); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 22px 18px; border-bottom: 1px solid var(--line); }
.board-head h2 { margin: 0; font-size: 1.5rem; letter-spacing: -.04em; }
.refresh-row { display: flex; align-items: center; gap: 10px; color: var(--soft); font-size: .8rem; }
.refresh-btn { border: 1px solid var(--line); border-radius: 999px; background: var(--surface-solid); padding: 8px 11px; cursor: pointer; font-weight: 800; color: var(--muted); }
.takeover-banner { margin: 16px; padding: 22px; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 16px; align-items: center; border-radius: 20px; border: 1px solid rgba(147,107,47,.28); background: linear-gradient(120deg, rgba(215,180,123,.2), rgba(255,250,241,.9)); }
.takeover-crown { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: rgba(147,107,47,.12); font-size: 1.55rem; }
.takeover-banner h3 { margin: 0 0 4px; font-size: 1.14rem; }
.takeover-banner p { margin: 0; color: var(--muted); font-size: .87rem; line-height: 1.4; }
.takeover-banner a { text-decoration: none; padding: 10px 13px; border-radius: 12px; background: #6f4c17; color: #fff8e9; font-weight: 900; font-size: .84rem; }

.board-list { display: grid; }
.rank-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) 46px 92px 104px 126px; gap: 14px; align-items: center; padding: 17px 20px; border-top: 1px solid var(--line); transition: background .16s var(--ease); }
.rank-row:first-child { border-top: 0; }
.rank-row:hover { background: rgba(255,255,255,.38); }
.rank-num { display: flex; flex-direction: column; align-items: start; gap: 2px; }
.rank-num strong { font-size: 1.12rem; }
.rank-num span { color: var(--soft); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; }
.listing { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 12px; align-items: center; min-width: 0; }
.favicon { width: 44px; height: 44px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface-solid); display: grid; place-items: center; overflow: hidden; font-weight: 950; color: var(--accent); }
.favicon img { width: 24px; height: 24px; object-fit: contain; }
.listing-copy { min-width: 0; }
.listing-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.listing-title a { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 900; text-decoration: none; letter-spacing: -.02em; }
.listing-title a:hover { color: var(--accent); }
.listing-title small { flex: 0 0 auto; color: var(--soft); font-size: .72rem; }
.listing-desc { margin: 4px 0 0; max-width: 650px; color: var(--muted); font-size: .83rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.media-cell { display:flex; justify-content:center; align-items:center; min-width:40px; min-height:40px; }
.media-thumb { width:38px; height:38px; padding:0; border:1px solid var(--line); border-radius:11px; overflow:hidden; background:var(--surface-solid); cursor:zoom-in; box-shadow:var(--shadow-soft); }
.media-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.empty-media { opacity:0; pointer-events:none; }
.media-modal { position:fixed; inset:0; z-index:1000; display:grid; place-items:center; padding:20px; background:rgba(32,24,19,.72); backdrop-filter:blur(10px); }
.media-modal-card { width:min(560px,94vw); border-radius:24px; padding:12px; position:relative; background:var(--surface-solid); border:1px solid var(--line); box-shadow:0 28px 90px rgba(0,0,0,.28); }
.media-modal-card > img { width:100%; aspect-ratio:1; object-fit:contain; display:block; border-radius:17px; background:white; }
.media-modal-close { position:absolute; top:20px; right:20px; width:38px; height:38px; border:0; border-radius:999px; background:rgba(28,22,18,.82); color:white; font-size:1.5rem; cursor:pointer; }
.media-modal-meta { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:13px 5px 4px; }
.media-modal-meta span { color:var(--soft); font-size:.8rem; }
.creative-input { display:block; width:100%; border:1px dashed var(--line-strong); border-radius:14px; padding:12px; background:rgba(255,255,255,.42); text-transform:none; letter-spacing:0; }
.creative-help { color:var(--soft); font-size:.78rem; text-transform:none; letter-spacing:0; }
.creative-selected { display:grid; grid-template-columns:48px minmax(0,1fr) auto; gap:10px; align-items:center; border:1px solid var(--line); border-radius:14px; padding:9px; background:rgba(255,255,255,.45); text-transform:none; letter-spacing:0; }
.creative-selected img { width:48px; height:48px; border-radius:10px; object-fit:cover; }
.creative-selected span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text); font-weight:800; }
.creative-selected small { display:block; color:var(--soft); font-weight:650; font-size:.72rem; }
.creative-selected button { border:1px solid var(--line); background:var(--surface-solid); border-radius:10px; padding:8px 10px; cursor:pointer; color:var(--muted); font-weight:800; }
.metric { text-align: right; }
.metric strong { display: block; font-size: 1.02rem; }
.metric span { display: block; margin-top: 2px; color: var(--soft); font-size: .72rem; }
.rank-claim { min-height: 40px; border-radius: 12px; background: rgba(47,111,157,.1); color: var(--accent); border: 1px solid rgba(47,111,157,.16); font-size: .78rem; }
.rank-claim:hover { background: rgba(47,111,157,.16); }
.empty { padding: 60px 24px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 1.25rem; margin-bottom: 6px; }
.skeleton { animation: pulse 1.1s ease-in-out infinite alternate; opacity: .45; }
@keyframes pulse { to { opacity: .8; } }

.pagination { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 18px; border-top: 1px solid var(--line); }
.page-btn { min-width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-solid); color: var(--muted); cursor: pointer; font-weight: 850; }
.page-btn.active { background: var(--text); color: var(--surface-solid); border-color: var(--text); }

.footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 26px 8px 0; color: var(--soft); font-size: .8rem; }
.footer a { font-weight: 800; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { min-height: auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .rank-row { grid-template-columns: 54px minmax(0,1fr) 46px 90px 118px; }
  .rank-row .metric.clicks { display: none; }
}

@media (max-width: 620px) {
  .bid-app { width: min(100% - 16px, 1120px); padding-top: 10px; }
  .topbar { padding-bottom: 14px; }
  .brand img { width: 48px; height: 48px; }
  .brand-copy { font-size: 1rem; }
  .top-links a:not(:last-child) { display: none; }
  .hero-copy, .bid-card, .board-shell { border-radius: 22px; }
  .hero-copy { padding: 28px 22px; }
  .hero h1 { font-size: clamp(3.2rem, 17vw, 5rem); }
  .bid-card { padding: 20px 16px; }
  .stats { gap: 7px; }
  .stat { padding: 13px; border-radius: 15px; }
  .stat strong { font-size: 1.05rem; }
  .board-head { padding: 18px 14px 14px; }
  .refresh-row span { display: none; }
  .takeover-banner { grid-template-columns: 44px minmax(0,1fr); padding: 16px; }
  .takeover-crown { width: 44px; height: 44px; border-radius: 14px; }
  .takeover-banner a { grid-column: 1 / -1; text-align: center; }
  .rank-row { grid-template-columns: 44px minmax(0,1fr); gap: 10px; padding: 15px 13px; }
  .rank-row .media-cell { grid-column: 1; grid-row: 2 / span 2; align-self: start; }
  .rank-row .metric.bid { grid-column: 2; text-align: left; display: flex; align-items: center; gap: 8px; }
  .rank-row .metric.bid span { margin: 0; }
  .rank-row .rank-claim { grid-column: 2; width: 100%; }
  .favicon { width: 40px; height: 40px; border-radius: 12px; }
  .listing { grid-template-columns: 40px minmax(0,1fr); gap: 9px; }
  .listing-title { align-items: center; }
  .listing-title small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
