: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-success,
.button-success:hover {
  background: #166534;
  color: #fff;
  transform: none;
}

.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;
}

.submissions-filter-panel {
  margin: 0 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.submissions-filter-panel summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.15rem;
  font-weight: 800;
}

.submissions-filter-panel summary::-webkit-details-marker {
  display: none;
}

.submissions-filter-panel[open] summary {
  border-bottom: 1px solid var(--line);
}

.submissions-filters {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)) auto;
  gap: 0.85rem;
  align-items: end;
  padding: 1rem 1.15rem 1.15rem;
}

.filter-field {
  display: grid;
  gap: 0.35rem;
}

.filter-field span {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.filter-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  font: inherit;
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.filter-field input:focus {
  outline: 2px solid rgba(245, 158, 11, 0.22);
  outline-offset: 1px;
  border-color: #f59e0b;
}

.filter-reset {
  align-self: stretch;
}

.submissions-results-copy {
  margin: 0 0 1rem;
  color: var(--muted);
}

.submissions-controls {
  display: grid;
  gap: 0.8rem;
  justify-items: center;
  margin: 1.1rem 0 0;
}

.submissions-controls[hidden] {
  display: none;
}

.submissions-controls-copy {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.submissions-controls-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.submissions-controls-actions .button[hidden] {
  display: none;
}

.submissions-controls-actions .button:disabled,
.submissions-controls-actions .button:disabled:hover {
  opacity: 0.5;
  transform: none;
  cursor: not-allowed;
}

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

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

.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 {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #111827 0%, #334155 100%);
}

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

.submission-photo iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.submission-photo-flag,
.submission-photo-mileage {
  position: absolute;
  z-index: 1;
  backdrop-filter: blur(8px);
}

.submission-photo-flag {
  top: 0.85rem;
  left: 0.85rem;
  padding: 0.36rem 0.72rem;
  border-radius: 999px;
  background: #fbbf24;
  color: #111827;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.2);
}

.submission-photo-mileage {
  right: 0.85rem;
  bottom: 0.85rem;
  display: grid;
  gap: 0.08rem;
  min-width: 7.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 16px;
  background: rgba(255, 247, 237, 0.9);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #7c2d12;
  text-align: right;
}

.submission-photo-mileage strong {
  font-size: 1.05rem;
  line-height: 1;
}

.submission-photo-mileage span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

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

.submission-photo-fallback-label {
  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-card h3,
.submission-meta,
.submission-story {
  margin: 0;
}

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

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

.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);
}

.upload-main {
  min-height: calc(100vh - 120px);
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
}

.upload-hero {
  padding-top: 4rem;
}

.upload-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 1.5rem;
  align-items: start;
}

.upload-intro,
.upload-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.upload-intro {
  padding: 2rem;
}

.upload-title {
  max-width: 11ch;
}

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

.upload-steps {
  margin: 1.2rem 0 0;
  padding-left: 1.2rem;
}

.upload-card {
  padding: 1.4rem;
  display: grid;
  gap: 1rem;
}

.submissions-empty {
  grid-column: 1 / -1;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  color: var(--muted);
  box-shadow: var(--shadow);
}

.upload-code-box {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 18px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.upload-code-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-dark);
  font-weight: 700;
}

.upload-code {
  display: inline-block;
  width: fit-content;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #7c2d12;
  background: #ffedd5;
}

.upload-form {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field span {
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid rgba(245, 158, 11, 0.22);
  outline-offset: 1px;
  border-color: #f59e0b;
}

.file-input {
  padding: 0.6rem;
  background: #f8fafc;
}

.upload-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  align-items: center;
}

.upload-status,
.upload-result {
  border-radius: 18px;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
}

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

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

.upload-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #0f172a;
}

.upload-preview img {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: cover;
}

.upload-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.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,
  .upload-layout {
    grid-template-columns: 1fr;
  }

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

  .submissions-filters {
    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;
  }
}
