:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #676767;
  --line: #dddddd;
  --paper: #f7f4ee;
  --panel: #ffffff;
  --hide: #242424;
  --ride: #e4492e;
  --ride-dark: #b92f19;
  --focus: #0f6f74;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}

button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.app-shell {
  width: min(100%, 620px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.records-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
}

.detail-link,
.primary-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
}

.primary-link-button {
  border: 0;
  background: var(--ride);
  color: #fff;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 12vw, 3.25rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.65rem;
  line-height: 1.05;
}

.progress-pill {
  flex: 0 0 auto;
  min-width: 72px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.vehicle-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e9e3d9;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.vehicle-card img {
  display: block;
  width: 100%;
  height: min(64vh, 610px);
  min-height: 360px;
  object-fit: cover;
  object-position: center;
}

.vote-panel,
.result-panel,
.message-panel {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.prompt {
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 750;
  text-align: center;
}

.vote-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.vote-button {
  min-height: 64px;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 900;
}

.vote-button.hide {
  background: var(--hide);
}

.vote-button.ride {
  background: var(--ride);
}

.vote-button:active,
.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.hidden {
  display: none;
}

.vote-result {
  margin-bottom: 8px;
  color: var(--ride-dark);
  font-weight: 900;
}

.milestone-banner {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 2px solid var(--ride);
  border-radius: 8px;
  background: #fff8d7;
  color: var(--ink);
  font-weight: 900;
}

.milestone-banner p {
  margin-bottom: 5px;
}

.milestone-banner p:last-child {
  margin-bottom: 0;
}

.milestone-watch {
  padding: 12px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 0 #d7d0c3;
}

.milestone-watch-inner {
  display: grid;
  gap: 8px;
}

.watch-event {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.watch-event h3 {
  margin: 0 0 5px;
  font-size: 1rem;
  line-height: 1.15;
}

.watch-event p,
.watch-empty {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.35;
}

.watch-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.watch-meta span {
  color: var(--ride-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84rem;
  font-weight: 900;
  text-transform: uppercase;
}

.watch-meta a {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration-color: var(--ride);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-transform: uppercase;
}

.vehicle-meta,
.local-result,
.message-panel p {
  color: var(--muted);
  line-height: 1.45;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  font-weight: 900;
}

.primary-button {
  background: var(--ride);
  color: #fff;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}

.stat {
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 7px;
  font-size: 1.35rem;
  line-height: 1.05;
}

.playful-line {
  margin-bottom: 12px;
  font-weight: 850;
}

.final-actions {
  display: grid;
  gap: 8px;
}

.records-shell {
  width: min(100%, 760px);
}

.record-book {
  padding: 16px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    repeating-linear-gradient(0deg, #171717 0 2px, #e4492e 2px 4px) border-box;
  box-shadow: 0 12px 0 #d7d0c3;
}

.dev-warning {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #c9b45d;
  border-radius: 8px;
  background: #fff4b8;
  color: #463b05;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.35;
  text-transform: uppercase;
}

.record-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.scoreboard-cell {
  min-height: 74px;
  padding: 10px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #161616;
  color: #f7f4ee;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.scoreboard-cell span {
  display: block;
  color: #f3d45f;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.scoreboard-cell strong {
  display: block;
  margin-top: 6px;
  color: #ffffff;
  font-size: 1.65rem;
  line-height: 1;
}

.leaderboard {
  display: grid;
  gap: 8px;
}

.record-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.record-rank {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 900;
}

.record-row h2 {
  margin-bottom: 3px;
  font-size: 1rem;
  line-height: 1.15;
}

.record-row p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.3;
}

.record-row strong {
  grid-column: 2;
  color: var(--ride-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  line-height: 1.15;
}

.record-holder-link {
  color: var(--ink);
  font-weight: 900;
  text-decoration-color: var(--ride);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.fake-record {
  background: #f3f6f5;
}

.record-actions {
  margin-top: 14px;
}

.charts-shell {
  width: min(100%, 920px);
}

.charts-list {
  display: grid;
  gap: 14px;
}

.chart-section {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.chart-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.chart-heading h2 {
  margin-bottom: 0;
  font-size: 1.1rem;
  line-height: 1.15;
}

.chart-heading p,
.chart-empty {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.35;
}

.chart-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.chart-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.chart-table th,
.chart-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.chart-table th {
  background: #161616;
  color: #f7f4ee;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.chart-table tr:last-child td {
  border-bottom: 0;
}

.chart-table a,
.record-holder-grid a {
  color: var(--ink);
  font-weight: 900;
  text-decoration-color: var(--ride);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.chart-rank {
  color: var(--ride-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 900;
}

.record-holder-grid {
  display: grid;
  gap: 8px;
}

.record-holder-grid article {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.record-holder-grid span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.record-holder-grid strong {
  color: var(--ride-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.vehicle-shell {
  width: min(100%, 760px);
}

.vehicle-detail-card img {
  height: min(54vh, 560px);
}

.vehicle-profile,
.badge-panel,
.share-panel {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.vehicle-profile .stat-grid {
  grid-template-columns: 1fr 1fr;
}

.vehicle-attribution {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.vehicle-attribution a {
  color: var(--ink);
  font-weight: 800;
}

.badge-panel h3,
.share-panel h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  text-transform: uppercase;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-list span {
  padding: 7px 9px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff8d7;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.vehicle-empty,
.copy-status {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 800;
}

.share-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.share-panel textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
}

.copy-status {
  min-height: 22px;
  margin-top: 8px;
}

.suggest-shell {
  width: min(100%, 820px);
}

.suggest-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.suggest-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.suggest-form label {
  display: grid;
  gap: 6px;
}

.suggest-form span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.suggest-form input,
.suggest-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
}

.suggest-form textarea {
  resize: vertical;
}

.suggest-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.suggest-list-header h2 {
  margin-bottom: 0;
}

.suggest-list {
  display: grid;
  gap: 8px;
}

.suggest-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.suggest-item h3 {
  margin: 0 0 3px;
  font-size: 1.05rem;
  line-height: 1.2;
}

.suggest-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.4;
}

.suggest-item a {
  color: var(--ink);
  font-weight: 900;
  text-decoration-color: var(--ride);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.suggest-item span,
.suggest-empty {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.suggest-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.danger-button {
  color: var(--ride-dark);
}

@media (min-width: 640px) {
  .app-shell {
    padding-top: 28px;
  }

  .vehicle-card img {
    height: 640px;
  }

  .record-row {
    grid-template-columns: 48px minmax(0, 1fr) minmax(120px, auto);
    align-items: center;
  }

  .record-row p {
    margin-bottom: 0;
  }

  .record-row strong {
    grid-column: auto;
    text-align: right;
  }

  .suggest-form {
    grid-template-columns: 1fr 1fr;
  }

  .suggest-form .full-field,
  .suggest-form .primary-button,
  .suggest-form .copy-status {
    grid-column: 1 / -1;
  }

  .suggest-actions {
    grid-template-columns: 1fr 1fr;
  }
}
