/* Motorfiction — design system v2
   Direction: sporty, aggressive, technical. Mobile-first.
   Type: Saira Condensed for display (motorsport condensed caps),
         Saira for UI. Chosen over Orbitron, which reads as sci-fi cliché.
   Colour: carbon ground, blaze orange-red for action, volt lime for data. */

:root {
  --bg: #08090b;
  --surface: #0f1115;
  --surface-2: #15181e;
  --surface-3: #1c2027;
  --line: #262a33;
  --line-soft: #1a1d24;

  --text: #f3f5f8;
  --muted: #99a0ad;
  --dim: #666d7a;

  --blaze: #ff3b14;       /* action, likes, primary CTA */
  --volt: #c8ff2e;        /* data, scores, telemetry */

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  --display: 'Saira Condensed', 'Arial Narrow', sans-serif;
  --ui: 'Saira', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --shell: 620px;
  --ease: cubic-bezier(.22,.8,.28,1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--ui);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--blaze); color: #fff; }

/* --------------------------------- type ---------------------------------- */
.h1, .h2, .eyebrow, .brand, .spec-card .v, .rating-score, .stat b, .seg button {
  font-family: var(--display);
}
.h1 {
  font-size: 30px; font-weight: 800; letter-spacing: -0.01em;
  text-transform: uppercase; margin: 0 0 8px; line-height: 1.02;
}
.h2 { font-size: 19px; font-weight: 700; text-transform: uppercase; margin: 0 0 12px; }
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--dim);
}
.muted { color: var(--muted); font-size: 13.5px; }

/* -------------------------------- top bar -------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8,9,11,.86);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: 1060px; margin: 0 auto; padding: 0 14px;
  height: 56px; display: flex; align-items: center; gap: 10px;
}
.brand {
  font-size: 19px; font-weight: 800; letter-spacing: .02em;
  text-transform: uppercase; display: flex; align-items: center; gap: 9px;
  margin-right: auto;
}
/* Supplied brand mark. Height-locked so the bar never shifts. */
.brand-mark { height: 17px; width: auto; display: block; }
@media (max-width: 420px) { .brand-mark { height: 15px; } }
.nav { display: flex; align-items: center; gap: 3px; }
.nav a, .nav button {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: var(--r-pill);
  border: 0; background: transparent; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  transition: color .18s var(--ease), background .18s var(--ease);
}
.nav a:hover, .nav button:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { color: var(--text); background: var(--surface-2); }

/* Buttons inside the nav must keep button styling, not link styling. */
.nav .btn {
  font-family: var(--display); font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 9px 17px; color: #fff; background: var(--blaze); border: 1px solid var(--blaze);
}
.nav .btn:hover { background: var(--blaze); color: #fff; }
.nav .btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.nav .btn.ghost:hover { background: var(--surface-2); color: var(--text); }

/* -------------------------------- layout --------------------------------- */
.page { max-width: 1060px; margin: 0 auto; padding: 16px 12px 90px; }
.cols { display: grid; grid-template-columns: minmax(0,var(--shell)) 292px; gap: 24px; justify-content: center; }
.shell { max-width: var(--shell); margin: 0 auto; width: 100%; }
@media (max-width: 940px) { .cols { grid-template-columns: minmax(0,var(--shell)); } .side { display: none; } }

/* ------------------------------- controls -------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--r-pill);
  border: 1px solid var(--blaze); background: var(--blaze); color: #fff;
  font-family: var(--display); font-weight: 700; font-size: 15px;
  text-transform: uppercase; letter-spacing: .04em;
  cursor: pointer; white-space: nowrap;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px -10px var(--blaze); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--surface-3); box-shadow: none; }
.btn.volt { background: var(--volt); border-color: var(--volt); color: #0b0d07; }
.btn.volt:hover { box-shadow: 0 8px 22px -10px var(--volt); }
.btn.sm { padding: 9px 16px; font-size: 13px; }
.btn.block { width: 100%; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--dim); margin-bottom: 7px; }
.field input, .field textarea, .field select, .picker-btn {
  width: 100%; padding: 13px 15px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text); outline: none;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--dim); }
.field input:focus, .field textarea:focus, .field select:focus, .picker-btn:focus-visible {
  border-color: var(--blaze); background: var(--surface-3);
}
.field textarea { resize: vertical; min-height: 84px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); overflow: hidden;
}
.card + .card { margin-top: 14px; }
.card-pad { padding: 20px; }

.avatar {
  width: 38px; height: 38px; border-radius: var(--r-pill);
  object-fit: cover; background: var(--surface-3); flex: none;
  border: 1px solid var(--line);
}
.avatar.lg { width: 82px; height: 82px; }
.avatar.sm { width: 28px; height: 28px; }
.avatar-fallback {
  display: grid; place-items: center; font-family: var(--display);
  font-weight: 800; color: var(--muted); font-size: 15px;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface-2);
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
}
.chip.solid { background: var(--blaze); border-color: var(--blaze); color: #fff; }
.chip.volt { background: var(--volt); border-color: var(--volt); color: #0b0d07; }

/* --------------------------------- post ---------------------------------- */
.post {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); overflow: hidden; margin-bottom: 14px;
}
.post-head { display: flex; align-items: center; gap: 10px; padding: 13px 14px; }
.post-head .who { min-width: 0; }
.post-head .name { font-weight: 650; font-size: 14px; }
.post-head .sub {
  font-family: var(--display); font-size: 12.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.post-head .spacer { margin-left: auto; }

.post-media { position: relative; background: #000; }
.post-media .frames { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.post-media .frames::-webkit-scrollbar { display: none; }
.post-media .frames > figure { margin: 0; flex: 0 0 100%; scroll-snap-align: center; }

/* Uploads arrive at every shape a phone can produce. The feed forces one
   ratio with a centre cover crop so the column stays even; the post page
   uses the image's own ratio so nothing is lost. The file is never altered. */
.post-media.feed .frames > figure { aspect-ratio: 4 / 5; }
.post-media.feed img { width: 100%; height: 100%; object-fit: cover; object-position: center; }

.post-media.detail .frames > figure { aspect-ratio: var(--ratio, 1); }
.post-media.detail img { width: 100%; height: 100%; object-fit: cover; }
.frame-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.frame-dots i { width: 5px; height: 5px; border-radius: var(--r-pill); background: rgba(255,255,255,.4); transition: background .2s; }
.frame-dots i.on { background: #fff; }

.car-tag {
  position: absolute; left: 10px; bottom: 10px;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(8,9,11,.72); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r-pill); padding: 7px 13px;
  font-family: var(--display); font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
}

/* ---------------------- animated spec / edit cards ----------------------- */
.spec-strip {
  display: flex; gap: 8px; padding: 12px 14px 2px;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
}
.spec-strip::-webkit-scrollbar { display: none; }

.spec-card {
  flex: 0 0 auto; min-width: 104px; scroll-snap-align: start;
  border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 13px 11px; background: var(--surface-2);
  opacity: 0; transform: translateY(12px) scale(.97);
  position: relative; overflow: hidden;
}
.spec-card.in { animation: cardIn .5s var(--ease) forwards; }
@keyframes cardIn { to { opacity: 1; transform: none; } }

.spec-card .k {
  font-size: 9.5px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--dim); margin-bottom: 4px;
}
.spec-card .v {
  font-size: 21px; font-weight: 800; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums; line-height: 1.05;
}
.spec-card .v small { font-size: 11px; font-weight: 600; color: var(--dim); margin-left: 3px; }
.spec-card .d { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* Performance figures read as telemetry. */
.spec-card:not(.is-edit):not(.is-stock) .v { color: var(--volt); }
/* Edits are the point of the product, so they carry the brand colour. */
.spec-card.is-edit { border-color: rgba(255,59,20,.42); background: rgba(255,59,20,.07); }
.spec-card.is-edit .k { color: var(--blaze); }
.spec-card.is-stock .v { font-size: 15px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .spec-card, .spec-card.in { opacity: 1; transform: none; animation: none; }
  html { scroll-behavior: auto; }
}

/* ------------------------------- actions --------------------------------- */
.post-actions { display: flex; align-items: center; gap: 4px; padding: 8px 10px 2px; }
.act {
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; background: transparent; cursor: pointer;
  padding: 8px 10px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 650; color: var(--muted);
  font-variant-numeric: tabular-nums;
  transition: color .16s var(--ease), background .16s var(--ease);
}
.act:hover { background: var(--surface-2); color: var(--text); }
.act svg { width: 21px; height: 21px; }
.act.on { color: var(--blaze); }
.act.on svg { fill: var(--blaze); stroke: var(--blaze); }
.act.pop svg { animation: pop .4s var(--ease); }
@keyframes pop { 40% { transform: scale(1.32); } 100% { transform: scale(1); } }

.post-body { padding: 4px 14px 14px; }
.caption { font-size: 14.5px; margin: 6px 0 0; }
.caption b { font-weight: 650; margin-right: 6px; }

/* -------------------------------- rating --------------------------------- */
.rating-box {
  margin: 10px 14px 14px; padding: 13px 15px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2);
}
.rating-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.rating-score {
  font-size: 27px; font-weight: 800; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums; color: var(--volt); line-height: 1;
}
.rating-score span { font-size: 13px; color: var(--dim); }
/* Ten columns so the scale always fits one row, at any width. */
.rating-scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.rating-scale button {
  width: 100%; height: 34px; border-radius: 11px; padding: 0;
  border: 1px solid var(--line); background: var(--surface-3);
  cursor: pointer; font-family: var(--display); font-size: 14px; font-weight: 700;
  color: var(--muted); font-variant-numeric: tabular-nums;
  transition: transform .14s var(--ease), background .14s var(--ease), color .14s var(--ease);
}
.rating-scale button:hover { color: var(--text); border-color: var(--volt); transform: translateY(-2px); }
.rating-scale button.picked { background: var(--volt); border-color: var(--volt); color: #0b0d07; }
.rating-note { font-size: 12px; color: var(--dim); margin: 9px 0 0; }

/* ------------------------------- comments -------------------------------- */
.comments { border-top: 1px solid var(--line-soft); padding: 14px; }
.comment { display: flex; gap: 10px; margin-bottom: 12px; }
.comment .body { font-size: 14px; }
.comment .meta { font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.comment.reply { margin-left: 38px; }
.comment-form { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.comment-form input {
  flex: 1; padding: 11px 15px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface-2); outline: none;
}
.comment-form input:focus { border-color: var(--blaze); }

/* -------------------------------- profile -------------------------------- */
.profile-head { display: flex; gap: 18px; align-items: center; padding: 20px; flex-wrap: wrap; }
.stat-row { display: flex; gap: 20px; margin: 10px 0 6px; }
.stat b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat span { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.grid a { position: relative; aspect-ratio: 1; background: var(--surface-2); overflow: hidden; }
.grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.grid a:hover img { transform: scale(1.06); }

.garage-car {
  display: flex; gap: 13px; align-items: center;
  padding: 12px; border: 1px solid var(--line-soft); border-radius: var(--r-md);
  margin-bottom: 9px; background: var(--surface-2);
  transition: border-color .18s var(--ease);
}
.garage-car:hover { border-color: var(--line); }
.garage-car img { width: 78px; height: 58px; object-fit: cover; border-radius: 10px; flex: none; }
.garage-car .ph { width: 78px; height: 58px; border-radius: 10px; background: var(--surface-3); flex: none; }

/* -------------------------------- lobbies -------------------------------- */
.lobby-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .lobby-grid { grid-template-columns: 1fr; } }

/* A lobby card is a photograph with a solid plate under it. No gradients:
   the cover is a real image, the overlay is a flat tint, the logo is a solid
   block of the lobby accent. */
.lobby-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  background: var(--surface); overflow: hidden;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.lobby-card:hover { border-color: var(--line); transform: translateY(-2px); }

.lobby-card .cover {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--surface-3);
  border-bottom: 2px solid var(--lobby-accent);
}
.lobby-card .cover img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.92) contrast(1.04);
  transition: transform .5s var(--ease);
}
.lobby-card:hover .cover img { transform: scale(1.04); }
/* Flat tint, not a gradient, so text stays readable on any photo. */
.lobby-card .cover::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(8, 9, 11, .34);
}
/* No cover photo: a dark plate with the monogram in the lobby accent and the
   same accent stripe the photo cards carry. Restrained, not a colour field. */
.lobby-card .cover.block {
  background: var(--surface-2);
  display: grid; place-items: center;
}
.lobby-card .cover.block::after { content: none; }
.lobby-card .cover.block .mono {
  font-family: var(--display); font-weight: 800; font-size: 68px; line-height: .9;
  color: var(--lobby-accent); transform: skewX(-9deg);
}
.lobby-card .cover.block .logo.solo {
  position: static; width: 56px; height: 56px; border-radius: 15px;
}

/* Solid accent plate carrying the lobby monogram or uploaded logo.
   Sits top-left, clear of the accent stripe along the bottom edge. */
.lobby-card .logo {
  position: absolute; left: 12px; top: 12px; z-index: 2;
  width: 38px; height: 38px; border-radius: 11px; overflow: hidden;
  background: var(--lobby-accent); color: #0b0d10;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 18px; line-height: 1;
}
.lobby-card .logo img { width: 100%; height: 100%; object-fit: cover; }

.lobby-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.lobby-card h3 {
  font-family: var(--display); font-size: 19px; font-weight: 800;
  text-transform: uppercase; margin: 0 0 5px; letter-spacing: .01em;
}
.lobby-card .desc {
  font-size: 12.5px; color: var(--muted); margin: 0 0 12px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lobby-card .meta {
  margin-top: auto; display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .1em;
}
.lobby-card .meta b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.lobby-card .meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line); }

/* Lobby page banner: photograph with a flat tint and the accent stripe. */
.lobby-banner {
  position: relative; aspect-ratio: 3 / 1; overflow: hidden;
  border-bottom: 2px solid var(--lobby-accent); background: var(--surface-3);
}
.lobby-banner img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.92); }
.lobby-banner::after { content: ''; position: absolute; inset: 0; background: rgba(8,9,11,.42); }
@media (max-width: 620px) { .lobby-banner { aspect-ratio: 5 / 2; } }

.lobby-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.lobby-item:last-child { border-bottom: 0; }
.lobby-item .ico {
  width: 42px; height: 42px; border-radius: 12px; overflow: hidden;
  background: var(--surface-3); display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 16px; flex: none;
}
.lobby-item .ico img { width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------ feed filter ------------------------------- */
/* Horizontally scrollable on phones so nine options never wrap into a wall. */
.feed-filter {
  display: flex; gap: 7px; margin-bottom: 14px;
  overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
}
.feed-filter::-webkit-scrollbar { display: none; }
.feed-filter a {
  flex: none; padding: 8px 15px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  font-family: var(--display); font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
  transition: color .16s var(--ease), border-color .16s var(--ease), background .16s var(--ease);
}
.feed-filter a:hover { color: var(--text); border-color: var(--surface-3); }
.feed-filter a.on { background: var(--blaze); border-color: var(--blaze); color: #fff; }
.feed-filter a.clear { color: var(--dim); border-style: dashed; }
.feed-filter a.clear:hover { color: var(--blaze); border-color: var(--blaze); }

/* ---------------------------- discipline chips ---------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips button, .chips a {
  padding: 8px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
  font-family: var(--display); font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; cursor: pointer;
  transition: color .16s var(--ease), border-color .16s var(--ease), background .16s var(--ease);
}
.chips button:hover, .chips a:hover { color: var(--text); border-color: var(--surface-3); }
.chips button.on, .chips a.on { background: var(--blaze); border-color: var(--blaze); color: #fff; }

/* ------------------------------ lobby board ------------------------------- */
.board-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 12px;
}
.board-bar .seg { flex: none; }
.board-bar .btn { margin-left: auto; }

.board {
  border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  background: var(--surface); overflow: hidden;
}
.thread {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 15px; border-bottom: 1px solid var(--line-soft);
  transition: background .16s var(--ease);
}
.thread:last-child { border-bottom: 0; }
.thread:hover { background: var(--surface-2); }

/* Upvote only. There is deliberately no public downvote. */
.thread .vote {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  flex: none; width: 46px; padding: 6px 0;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); color: var(--muted);
  cursor: pointer; font-family: var(--display); font-weight: 800; font-size: 14px;
  font-variant-numeric: tabular-nums;
  transition: color .16s var(--ease), border-color .16s var(--ease), transform .16s var(--ease);
}
.thread .vote svg { width: 17px; height: 17px; }
.thread .vote:hover { color: var(--text); border-color: var(--lobby-accent, var(--blaze)); transform: translateY(-1px); }
.thread .vote.on { color: var(--blaze); border-color: var(--blaze); background: rgba(255,59,20,.09); }

.thread-main { min-width: 0; flex: 1; display: block; }
.thread-kicker {
  display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--lobby-accent, var(--blaze)); margin-bottom: 5px;
}
.thread-kicker i { font-style: normal; color: var(--dim); margin: 0 5px; }
.thread-main h3 {
  font-family: var(--display); font-size: 18px; font-weight: 700; line-height: 1.2;
  margin: 0 0 5px; text-transform: uppercase;
}
.thread-preview {
  font-size: 13px; color: var(--muted); margin: 0 0 7px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.thread-foot { font-size: 11.5px; color: var(--dim); }
.thread-foot b { color: var(--muted); font-weight: 600; }
.thread-foot i { font-style: normal; margin: 0 5px; }
.thread-thumb {
  width: 78px; height: 62px; flex: none; border-radius: 11px;
  overflow: hidden; background: var(--surface-3);
}
.thread-thumb img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 480px) {
  .thread { padding: 12px; gap: 10px; }
  .thread .vote { width: 40px; }
  .thread-main h3 { font-size: 16px; }
  .thread-thumb { width: 62px; height: 52px; }
}

/* Discussion shown in the main feed. */
.discussion-post .discussion-body { display: block; padding: 2px 14px 12px; }
.discussion-post .discussion-body h2 {
  font-family: var(--display); font-size: 20px; font-weight: 700;
  text-transform: uppercase; margin: 0 0 7px; line-height: 1.18;
}
.discussion-post .discussion-body p { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.55; }
.discussion-full p { font-size: 15.5px; line-height: 1.7; margin: 0 0 14px; }

/* Nested replies. Indentation is capped by --depth. */
.comment { margin-left: calc(var(--depth, 0) * 22px); }
.comment[style*="--depth:0"] { border-left: 0; }
.comment:not([style*="--depth:0"]) {
  border-left: 2px solid var(--line); padding-left: 11px;
}
@media (max-width: 480px) { .comment { margin-left: calc(var(--depth, 0) * 13px); } }

/* ---------------------------------- news ---------------------------------- */
.news-lead {
  display: block; margin-bottom: 12px; overflow: hidden;
  border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  background: var(--surface);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.news-lead:hover { border-color: var(--line); transform: translateY(-2px); }
.news-lead .shot { display: block; aspect-ratio: 16 / 10; background: var(--surface-3);
  border-bottom: 2px solid var(--blaze); overflow: hidden; }
.news-lead .shot img { width: 100%; height: 100%; object-fit: cover; }
.news-lead .meta { display: block; padding: 18px 20px 20px; }
.news-lead h2 {
  font-family: var(--display); font-size: 25px; font-weight: 800; line-height: 1.08;
  margin: 6px 0 8px; text-transform: uppercase;
}

.news-list { display: flex; flex-direction: column; gap: 10px; }
.news-card {
  display: flex; gap: 14px; align-items: stretch; padding: 12px;
  border: 1px solid var(--line-soft); border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.news-card:hover { border-color: var(--line); transform: translateY(-2px); }
.news-card .shot {
  width: 104px; flex: none; border-radius: 11px; overflow: hidden;
  background: var(--surface-3); aspect-ratio: 1;
}
.news-card .shot img { width: 100%; height: 100%; object-fit: cover; }
.news-card .meta { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.news-card h3 {
  font-family: var(--display); font-size: 17px; font-weight: 700; line-height: 1.15;
  margin: 4px 0 5px; text-transform: uppercase;
}

.news-card .kicker, .news-lead .kicker {
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--blaze);
}
.news-card .sum, .news-lead .sum {
  font-size: 13px; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card .sum { -webkit-line-clamp: 2; }
.news-lead .sum { -webkit-line-clamp: 3; }

.news-hero { aspect-ratio: 16 / 10; background: var(--surface-3); border-bottom: 2px solid var(--blaze); }
.news-hero img { width: 100%; height: 100%; object-fit: cover; }
.news-standfirst { font-size: 16px; color: var(--muted); line-height: 1.6; margin: 0 0 18px; }
.news-body p { font-size: 16px; line-height: 1.75; margin: 0 0 15px; }

/* Arabic copy needs right alignment and a little more line height. */
[dir='rtl'] { text-align: right; }
.news-body[dir='rtl'] p, .news-standfirst[dir='rtl'] { line-height: 1.95; }

@media (max-width: 480px) {
  .news-card .shot { width: 84px; }
  .news-card h3 { font-size: 15.5px; }
  .news-lead h2 { font-size: 21px; }
}

/* ------------------------ verification + ranking -------------------------- */
.verified {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px 4px 8px; border-radius: var(--r-pill);
  background: var(--volt); color: #0b0d07;
  font-family: var(--display); font-size: 11.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .1em; white-space: nowrap;
}
.verified svg { width: 11px; height: 11px; }
.verified.compact {
  padding: 0; width: 17px; height: 17px; border-radius: 50%;
  justify-content: center; flex: none;
}
.verified.compact svg { width: 10px; height: 10px; }

/* Automatic position. Claimed entries look deliberately provisional. */
.rank {
  display: inline-flex; align-items: baseline; gap: 1px;
  padding: 5px 11px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
  font-family: var(--display); font-size: 15px; font-weight: 800;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rank i { font-style: normal; opacity: .5; font-size: 11px; }
.rank em {
  font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; opacity: .6; margin-left: 6px;
}
.rank.is-verified { border-color: var(--volt); color: var(--volt); background: rgba(200,255,46,.08); }
.rank.compact { padding: 4px 9px; font-size: 13px; flex: none; }

.post-media .rank {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  background: rgba(8,9,11,.72); backdrop-filter: blur(10px);
  border-color: rgba(255,255,255,.14);
}

.verify-panel {
  margin: 0 20px 20px; padding: 15px 16px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2);
}
.verify-panel.ok { border-color: var(--volt); }
.verify-panel.ok .eyebrow { color: var(--volt); }
.verify-panel.bad { border-color: var(--blaze); }
.verify-panel.bad .eyebrow { color: var(--blaze); }
.verify-panel .dropzone { padding: 20px 16px; }

.verify-review {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 15px; margin-bottom: 12px; background: var(--surface-2);
}
.claim-figs { display: flex; gap: 18px; flex-wrap: wrap; margin: 10px 0 12px; }
.claim-figs span { display: flex; flex-direction: column; gap: 2px; }
.claim-figs em {
  font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--dim);
}
.claim-figs b {
  font-family: var(--display); font-size: 17px; font-weight: 800;
  color: var(--volt); font-variant-numeric: tabular-nums;
}
.review-note {
  width: 100%; padding: 10px 13px; margin: 4px 0 10px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-3); color: var(--text); outline: none;
}
.review-note:focus { border-color: var(--blaze); }

/* ------------------------------ leaderboard ------------------------------- */
.lb { display: flex; flex-direction: column; }
.lb-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  transition: background .16s var(--ease);
}
.lb-row:last-child { border-bottom: 0; }
.lb-row:hover { background: var(--surface-2); }
.lb-row .pos {
  width: 30px; flex: none; text-align: right;
  font-family: var(--display); font-size: 19px; font-weight: 800;
  color: var(--dim); font-variant-numeric: tabular-nums;
}
.lb-row.is-verified .pos { color: var(--volt); }
.lb-row .shot {
  width: 60px; height: 42px; flex: none; border-radius: 9px;
  object-fit: cover; background: var(--surface-3);
}
.lb-row .who { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.lb-row .name {
  font-weight: 650; font-size: 14px; display: flex; align-items: center; gap: 7px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-row .figs { text-align: right; flex: none; display: flex; flex-direction: column; }
.lb-row .figs b {
  font-family: var(--display); font-size: 19px; font-weight: 800;
  color: var(--volt); font-variant-numeric: tabular-nums; line-height: 1;
}
.lb-row .figs > span { font-size: 9.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--dim); }
.lb-row .figs em { font-style: normal; font-size: 11px; color: var(--dim); margin-top: 3px; }
@media (max-width: 480px) {
  .lb-row .figs em { display: none; }
  .lb-row .shot { width: 48px; height: 36px; }
  .lb-row { gap: 9px; padding: 10px 11px; }
}

/* Segmented control used as links on the leaderboard. */
.seg a {
  padding: 9px 20px; border-radius: var(--r-pill);
  font-family: var(--display); font-size: 14px; font-weight: 700;
  color: var(--dim); text-transform: uppercase; letter-spacing: .05em;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.seg a.on { background: var(--blaze); color: #fff; }

/* --------------------------- sheets and modals ---------------------------- */
.scrim {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(4,5,7,.72); backdrop-filter: blur(6px);
  opacity: 0; animation: fade .22s var(--ease) forwards;
}
@keyframes fade { to { opacity: 1; } }

.sheet {
  position: fixed; z-index: 91; background: var(--surface);
  border: 1px solid var(--line); display: flex; flex-direction: column;
  left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: min(520px, calc(100vw - 24px)); max-height: min(78vh, 640px);
  border-radius: var(--r-lg); overflow: hidden;
  animation: sheetIn .26s var(--ease);
}
@keyframes sheetIn { from { opacity: 0; transform: translate(-50%,-46%) scale(.97); } }

@media (max-width: 620px) {
  .sheet {
    left: 0; right: 0; bottom: 0; top: auto; transform: none;
    width: 100%; max-height: 86vh;
    border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: 0;
    animation: sheetUp .3s var(--ease);
  }
  @keyframes sheetUp { from { transform: translateY(100%); } }
}

.sheet-head {
  display: flex; align-items: center; gap: 10px; padding: 15px 16px;
  border-bottom: 1px solid var(--line-soft); flex: none;
}
.sheet-head h3 { font-family: var(--display); font-size: 18px; font-weight: 800;
  text-transform: uppercase; margin: 0; flex: 1; }
.sheet-close {
  width: 32px; height: 32px; border-radius: var(--r-pill); flex: none;
  border: 1px solid var(--line); background: var(--surface-2);
  cursor: pointer; font-size: 15px; line-height: 1; color: var(--muted);
}
.sheet-close:hover { color: var(--text); }
.sheet-search { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); flex: none; }
.sheet-search input {
  width: 100%; padding: 12px 15px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); outline: none;
}
.sheet-search input:focus { border-color: var(--blaze); }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 0 14px; }

.opt {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 16px; border: 0; background: transparent; cursor: pointer;
  text-align: left; font-size: 15px; color: var(--text);
}
.opt:hover, .opt:focus-visible { background: var(--surface-2); outline: none; }
.opt .count { margin-left: auto; font-size: 11.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.opt .initial {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: var(--surface-3); display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 14px; color: var(--muted);
}
.sheet-group {
  padding: 12px 16px 5px; font-family: var(--display); font-size: 12px;
  font-weight: 700; letter-spacing: .18em; color: var(--dim); text-transform: uppercase;
}

.picker-btn {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; text-align: left; gap: 10px;
}
.picker-btn .ph { color: var(--dim); }
.picker-btn .caret { color: var(--dim); flex: none; }
.picker-btn:disabled { opacity: .5; cursor: not-allowed; }

/* --------------------------- auth gate prompt ----------------------------- */
.gate { text-align: center; padding: 26px 22px 24px; }
.gate .mark { display: block; margin: 0 auto 16px; height: 26px; width: auto; }
.gate h3 { font-family: var(--display); font-size: 23px; font-weight: 800;
  text-transform: uppercase; margin: 0 0 6px; }
.gate p { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.gate .btn { width: 100%; margin-bottom: 9px; }

/* -------------------------------- states --------------------------------- */
.empty { text-align: center; padding: 44px 22px; }
.empty h3 { font-family: var(--display); font-size: 20px; font-weight: 800;
  text-transform: uppercase; margin: 0 0 7px; }
.empty p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }

.notice { padding: 12px 15px; border-radius: var(--r-md); font-size: 13.5px;
  margin-bottom: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.notice.err { border-color: var(--blaze); color: #ff7a5e; }
.notice.ok { border-color: var(--volt); color: var(--volt); }

.skel { background: var(--surface-2); border-radius: var(--r-md); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .5 } }

.spinner {
  width: 17px; height: 17px; border-radius: var(--r-pill);
  border: 2px solid var(--line); border-top-color: currentColor;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* ------------------------------- composer -------------------------------- */
.dropzone {
  border: 1.5px dashed var(--line); border-radius: var(--r-md);
  padding: 28px 18px; text-align: center; cursor: pointer;
  color: var(--muted); font-size: 14px; background: var(--surface-2);
  transition: border-color .18s var(--ease), color .18s var(--ease);
}
.dropzone:hover { border-color: var(--blaze); color: var(--text); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 11px; }
.thumbs figure { margin: 0; position: relative; }
.thumbs img { width: 76px; height: 76px; object-fit: cover; border-radius: 12px; }
.thumbs button {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px;
  border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--surface-3); color: var(--text); cursor: pointer; font-size: 12px; line-height: 1;
}

.edit-row { display: grid; grid-template-columns: 122px 1fr 1fr 34px; gap: 7px; margin-bottom: 7px; align-items: center; }
.edit-row select, .edit-row input {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); color: var(--text); width: 100%; outline: none;
}
.edit-row button { border: 1px solid var(--line); background: var(--surface-3);
  color: var(--muted); border-radius: var(--r-pill); height: 34px; cursor: pointer; }
@media (max-width: 620px) { .edit-row { grid-template-columns: 1fr 1fr 34px; } .edit-row select { grid-column: 1 / -1; } }

.seg { display: inline-flex; padding: 4px; border: 1px solid var(--line);
  border-radius: var(--r-pill); gap: 4px; background: var(--surface-2); }
.seg button {
  border: 0; background: transparent; padding: 9px 20px; border-radius: var(--r-pill);
  cursor: pointer; font-size: 14px; font-weight: 700; color: var(--dim);
  text-transform: uppercase; letter-spacing: .05em;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.seg button.on { background: var(--blaze); color: #fff; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { cursor: pointer; position: relative; }
.swatches input { position: absolute; opacity: 0; pointer-events: none; }
.swatches i {
  display: block; width: 32px; height: 32px; border-radius: 10px;
  border: 2px solid transparent; transition: transform .16s var(--ease);
}
.swatches input:checked + i { border-color: var(--text); transform: scale(1.12); }

/* ------------------------- mobile bottom navigation ----------------------- */
.tabbar { display: none; }
@media (max-width: 940px) {
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(8,9,11,.9); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line-soft);
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    justify-content: space-around; align-items: center;
  }
  .tabbar a {
    display: grid; place-items: center; width: 48px; height: 42px;
    border-radius: 14px; color: var(--dim);
    transition: color .16s var(--ease), background .16s var(--ease);
  }
  .tabbar a.active { color: var(--text); background: var(--surface-2); }
  .tabbar a.accent { color: var(--blaze); }
  .tabbar svg { width: 23px; height: 23px; }
  .tabbar .avatar { width: 26px; height: 26px; }

  /* The tab bar carries navigation on small screens; the top bar keeps only
     the brand and the account actions. Every nav destination must be listed
     here or it will push the sign-up button off the edge. */
  .nav a[href="/"], .nav a[href="/lobbies"], .nav a[href="/garage"],
  .nav a[href="/admin"], .nav a[href="/compose"], .nav a[href="/leaderboard"] { display: none; }
  body:has(.tabbar) .nav > a[href^="/@"] { display: none; }
  body:has(.tabbar) { padding-bottom: 60px; }
  .page { padding: 12px 10px 26px; }
  .card, .post { border-radius: var(--r-md); }
  .h1 { font-size: 26px; }
}
@media (max-width: 400px) {
  .rating-scale { gap: 3px; }
  .rating-scale button { height: 31px; font-size: 13px; border-radius: 9px; }
}

.footer-note { text-align: center; color: var(--dim); font-size: 11.5px; padding: 22px 16px; }
.side .card-pad { padding: 16px; }
