:root {
  --bg: #0f172a;
  --bg-soft: #111827;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #0f172a;
  --text-light: #e5e7eb;
  --muted: #475569;
  --line: #dbe4ee;
  --accent: #f59e0b;
  --accent-dark: #b45309;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
code {
  background: #e2e8f0;
  padding: 0.1rem 0.35rem;
  border-radius: 0.4rem;
  font-size: 0.95em;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(15, 23, 42, 0.88);
  color: var(--text-light);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.95rem 0;
  gap: 1rem;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav a { opacity: 0.88; }
.nav a:hover { opacity: 1; }

.hero {
  background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.26), transparent 25%),
              linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: var(--text-light);
  padding: 5rem 0 4rem;
}

.hero-grid,
.submit-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: 2rem;
  align-items: start;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}

h1, h2, h3 {
  line-height: 1.1;
  margin: 0 0 1rem;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  max-width: 12ch;
}

h2 {
  font-size: clamp(1.9rem, 3vw, 2.7rem);
}

.lead {
  max-width: 62ch;
  font-size: 1.1rem;
  color: #d1d5db;
}

.cta-row,
.sheet-actions,
.price-row {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  align-items: center;
}

.quick-points {
  margin: 1.25rem 0 0;
  padding-left: 1.2rem;
  color: #cbd5e1;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.15rem;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  color: #111827;
}

.button-primary:hover {
  background: #fbbf24;
}

.button-disabled,
.button-disabled:hover {
  background: #cbd5e1;
  color: #475569;
  transform: none;
  cursor: not-allowed;
}

.button-secondary {
  background: rgba(255,255,255,0.09);
  color: inherit;
  border: 1px solid rgba(255,255,255,0.14);
}

.hero-card,
.product-card,
.submit-card,
.sheet-frame-wrap {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 1.5rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
}

.stat-label {
  display: block;
  color: #cbd5e1;
  font-size: 0.92rem;
}

.section {
  padding: 4.5rem 0;
}

.section-alt {
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
}

.section-heading {
  max-width: 70ch;
  margin-bottom: 1.5rem;
}

.leaderboard-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.leaderboard-stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.leaderboard-number {
  display: block;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 800;
  line-height: 1;
}

.leaderboard-label {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.sheet-actions {
  margin-bottom: 1rem;
}

.sheet-status,
.sheet-fallback {
  border-radius: var(--radius);
}

.sheet-status {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
}

.sheet-status[data-tone="success"] {
  border-color: rgba(22, 163, 74, 0.22);
  background: #f0fdf4;
  color: #166534;
}

.sheet-status[data-tone="warn"] {
  border-color: rgba(217, 119, 6, 0.22);
  background: #fffbeb;
  color: #92400e;
}

.submissions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.submission-card {
  display: grid;
  grid-template-rows: 180px 1fr;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.submission-photo {
  background: linear-gradient(135deg, #111827 0%, #334155 100%);
}

.submission-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.submission-photo-fallback {
  display: grid;
  place-items: center;
  color: #fff;
  text-align: center;
  padding: 1rem;
}

.submission-photo-fallback span {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1;
}

.submission-photo-fallback small {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.submission-body {
  display: grid;
  gap: 0.85rem;
  padding: 1.2rem;
}

.submission-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.submission-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.73rem;
  color: var(--accent-dark);
  font-weight: 800;
}

.submission-badge {
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.76rem;
  font-weight: 700;
}

.submission-card h3,
.submission-meta,
.submission-story {
  margin: 0;
}

.submission-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.submission-story {
  color: #1f2937;
}

.submission-mileage {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--line);
}

.submission-mileage-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-dark);
}

.submission-mileage-label {
  font-size: 0.86rem;
  color: var(--muted);
}

.sheet-fallback {
  margin-top: 1rem;
}

.sheet-fallback-copy {
  margin: 0 0 0.8rem;
  color: var(--muted);
}

.sheet-fallback-actions,
.submit-actions,
.footer-links {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  align-items: center;
}

.sheet-fallback-panel {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.sheet-fallback-panel summary {
  cursor: pointer;
  font-weight: 700;
}

.sheet-fallback-panel[open] .sheet-frame-wrap {
  margin-top: 1rem;
}

.sheet-frame-wrap {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
}

#sheet-embed {
  display: block;
  width: 100%;
  min-height: 680px;
  border: 0;
  background: #fff;
}

.product-card {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
}

.product-art {
  min-height: 340px;
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
  display: grid;
  place-items: center;
  padding: 2rem;
}

.sticker {
  display: grid;
  gap: 0.2rem;
  place-items: center;
  background: #fbbf24;
  color: #111827;
  width: min(280px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 14px solid #fff;
  box-shadow: 0 14px 40px rgba(0,0,0,0.28);
  font-weight: 800;
  transform: rotate(-10deg);
}

.sticker span {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  line-height: 1;
}

.product-copy,
.submit-card {
  padding: 2rem;
}

.product-copy ul {
  padding-left: 1.2rem;
}

.price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-dark);
}

.submit-card {
  background: var(--panel);
  border: 1px solid var(--line);
}

.submit-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-links a {
  color: #cbd5e1;
}

.footer-credit {
  margin: 0;
}

.footer-copy {
  margin: 0;
  color: #cbd5e1;
}

.footer-credit a {
  color: #f8fafc;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.product-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.policy-main {
  min-height: calc(100vh - 120px);
}

.policy-wrap {
  max-width: 840px;
}

.policy-title {
  max-width: none;
}

.policy-lead {
  color: var(--muted);
}

.policy-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.policy-card h2 {
  margin-top: 1.75rem;
  font-size: 1.35rem;
}

.policy-card h2:first-child {
  margin-top: 0;
}

.site-footer {
  background: #0f172a;
  color: var(--text-light);
  padding: 2rem 0;
}

.footer-wrap {
  display: grid;
  gap: 0.5rem;
}

@media (max-width: 860px) {
  .hero-grid,
  .submit-grid,
  .product-card {
    grid-template-columns: 1fr;
  }

  .leaderboard-stats,
  .submissions-grid {
    grid-template-columns: 1fr;
  }

  .nav-wrap {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    max-width: none;
  }

  .section,
  .hero {
    padding: 3.5rem 0;
  }

  #sheet-embed {
    min-height: 540px;
  }
}
