/* ==========================================================================
   DriftDex — Garage  (static reproduction)
   Design tokens mirror the reference app's CSS custom properties.
   ========================================================================== */

@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 200 1000;
  font-stretch: 100%;
  font-display: swap;
  src: url("../assets/fonts/nunito-sans-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito Sans";
  font-style: italic;
  font-weight: 200 1000;
  font-stretch: 100%;
  font-display: swap;
  src: url("../assets/fonts/nunito-sans-italic.woff2") format("woff2");
}

:root {
  --background: #121212;
  --foreground: #f5f5f5;
  --card: #1a1a1a;
  --card-foreground: #f5f5f5;
  --primary: #ff8533;
  --primary-foreground: #121212;
  --secondary: #2a2a2a;
  --secondary-foreground: #f5f5f5;
  --muted: #232323;
  --muted-foreground: #a3a3a3;
  --accent: #2a2a2a;
  --border: #2a2a2a;
  --input: #2a2a2a;
  --ring: #ff8533;
  --radius: 0.625rem;
  --header-h: 3.5rem;
  --font-sans: "Nunito Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "rlig" 1, "calt" 1;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
}

p { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
}

img { display: block; }

button {
  font-family: inherit;
  font-size: 14px;
  color: inherit;
  cursor: pointer;
}

::selection {
  background: rgba(255, 133, 51, 0.3);
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- layout */

.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 1rem;
}

main.page {
  padding-block: 2rem;
}

.stack-6 > * + * { margin-top: 1.5rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: rgba(18, 18, 18, 0.8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
  height: var(--header-h);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  flex-shrink: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.brand img { width: 28px; height: 28px; }

.brand-word {
  display: none;
  font-size: 1.5rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.025em;
  line-height: 1;
}

.brand-word .accent { color: var(--primary); }

.nav-link {
  display: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: color 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--foreground);
  background: var(--accent);
}

.nav-link[aria-current="page"] { color: var(--foreground); }

.header-right {
  display: none;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--input);
  border-radius: 0.375rem;
  background: var(--background);
  color: var(--foreground);
  transition: background-color 0.15s ease;
}

.icon-btn:hover { background: var(--accent); }

.menu-btn { display: inline-flex; }

body.sheet-open .menu-btn { opacity: 0; pointer-events: none; }
body.sheet-open { overflow: hidden; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding-inline: 0.75rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn svg { flex-shrink: 0; }

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover { background: #ff9350; }

.btn-outline {
  background: var(--background);
  border-color: var(--input);
  color: var(--foreground);
}

.btn-outline:hover { background: var(--accent); }

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--foreground);
}

.btn-ghost:hover { background: var(--accent); }

.btn-sm {
  height: 1.75rem;
  padding-inline: 0.625rem;
  font-size: 0.75rem;
}

.btn-block { width: 100%; }

/* ----------------------------------------------------------------- badges */

.badge {
  display: inline-flex;
  align-items: center;
  height: 1.25rem;
  padding-inline: 0.375rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.badge-solid {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.badge-outline {
  border-color: var(--border);
  color: var(--foreground);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted-foreground);
  white-space: nowrap;
}

/* -------------------------------------------------------------- segmented */

.segmented {
  display: inline-flex;
  width: 100%;
  height: 2.5rem;
  overflow: hidden;
  border: 1px solid var(--input);
  border-radius: 0.375rem;
}

.segmented button {
  display: inline-flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 100%;
  padding-inline: 0.75rem;
  border: 0;
  background: transparent;
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.segmented button + button { border-left: 1px solid var(--border); }

.segmented button:hover { background: var(--accent); }

.segmented button[aria-pressed="true"] {
  background: var(--primary);
  color: var(--primary-foreground);
}

.segmented button[aria-pressed="true"]:hover { background: #ff9350; }

.segmented img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* ----------------------------------------------------------------- inputs */

.search {
  position: relative;
  flex: 1 1 12rem;
  min-width: 0;
}

.search svg {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 2.5rem;
  padding: 0 0.75rem 0 2rem;
  border: 1px solid var(--input);
  border-radius: 0.375rem;
  background: var(--background);
  color: var(--foreground);
  font-family: inherit;
  font-size: 0.875rem;
}

.search input::placeholder { color: var(--muted-foreground); }

.search input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 1px var(--ring);
}

.select-wrap {
  position: relative;
  display: inline-flex;
  min-width: 0;
}

.select-wrap select {
  width: 100%;
  height: 2.5rem;
  padding: 0 2rem 0 0.75rem;
  border: 1px solid var(--input);
  border-radius: 0.375rem;
  background: var(--background);
  color: var(--foreground);
  font-family: inherit;
  font-size: 0.875rem;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.select-wrap select:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 1px var(--ring);
}

.select-wrap svg {
  position: absolute;
  top: 50%;
  right: 0.625rem;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  pointer-events: none;
}

/* -------------------------------------------------------------- page head */

.page-title {
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.page-sub {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.cars-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ------------------------------------------------------------- release hero */

.hero-banner {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
}

.hero-banner .shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 1s ease, transform 1s ease;
}

.hero-banner .shot.base { opacity: 1; }

.hero-banner .shot.alt { opacity: 0; }

.hero-banner:hover .shot.base { transform: scale(1.02); }

.hero-banner:hover .shot.alt { opacity: 1; transform: scale(1.02); }

.hero-banner .scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.3) 45%, rgba(0, 0, 0, 0));
}

.hero-banner .copy-block {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  color: #fff;
}

.hero-banner .eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.hero-banner .hero-title {
  font-size: 1.875rem;
  font-weight: 600;
  line-height: 1.15;
}

.hero-banner .hero-date {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

.hero-banner .hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.hero-banner .hero-cta svg { transition: transform 0.2s ease; }

.hero-banner:hover .hero-cta svg { transform: translateX(2px); }

/* ------------------------------------------------------------- language ui */

.lang-wrap { position: relative; }

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 2.25rem;
  padding-inline: 0.625rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.lang-btn:hover { background: var(--accent); color: var(--foreground); }

.lang-menu { min-width: 9rem; }

.lang-menu button {
  justify-content: space-between;
}

.lang-menu .tick { display: inline-flex; color: var(--primary); }

.user-chip-wrap { position: relative; }

.sheet-lang {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.lang-pill {
  flex: 1;
  height: 2rem;
  border: 1px solid var(--input);
  border-radius: 0.375rem;
  background: transparent;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.lang-pill.on {
  border-color: var(--primary);
  background: rgba(255, 133, 51, 0.12);
  color: var(--primary);
}

.pack-line {
  flex-basis: 100%;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.page-head h1 {
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.page-head .sub {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* --------------------------------------------------------------- toolbar */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.toolbar .group {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.toolbar .group::-webkit-scrollbar { display: none; }

.toolbar-right {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-left: auto;
}

/* ------------------------------------------------------------------ cards */

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

.car-card {
  display: block;
  overflow: hidden;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
  transition: border-color 0.15s ease;
}

.car-card:hover { border-color: rgba(163, 163, 163, 0.5); }

.car-card .media {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 6rem;
}

.car-card .media img {
  width: auto;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.car-card:hover .media img { transform: scale(1.03); }

.car-card .body { margin-top: 0.5rem; }

.car-card .title-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  max-width: 100%;
  min-width: 0;
}

.car-card .title-row .name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.car-card .title-row .badges {
  display: inline-flex;
  flex-shrink: 0;
  gap: 0.25rem;
}

.car-card .sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.car-card .type {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
}

.car-card .type img { width: 1rem; height: 1rem; object-fit: contain; }

.car-card .type span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.car-card .rank { width: 1.375rem; height: 1.375rem; object-fit: contain; }

.car-card .meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(42, 42, 42, 0.9);
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}

.dots { display: inline-flex; gap: 0.1875rem; }

.dots i {
  width: 0.3125rem;
  height: 0.3125rem;
  border-radius: 999px;
  background: #343434;
}

.dots i.on { background: var(--primary); }

/* ------------------------------------------------------------- empty state */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 3.5rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 0.625rem;
  background: var(--card);
  text-align: center;
}

.empty h3 { font-size: 1rem; }

.empty p {
  max-width: 26rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* ----------------------------------------------------------------- panels */

.panel {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.panel-head { padding: 1.5rem 1.5rem 0.75rem; }

.panel-head h3 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }

.panel-head .aside {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.panel-head.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.panel-body { padding: 0 1.5rem 1.5rem; }

/* ------------------------------------------------------------------ stats */

.stat-list { display: flex; flex-direction: column; gap: 0.75rem; }

.stat .line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.stat .label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
}

.stat .label img {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  object-fit: contain;
}

.stat .label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted-foreground);
}

.stat .value {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  margin-left: 0.375rem;
  padding: 0.0625rem 0.25rem;
  border-radius: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  vertical-align: 1px;
}

.delta.up { color: #4ade80; background: rgba(74, 222, 128, 0.14); }
.delta.down { color: #f87171; background: rgba(248, 113, 113, 0.14); }
.delta.same { color: var(--muted-foreground); background: rgba(163, 163, 163, 0.14); }

.stats-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.vs-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  height: 1.5rem;
  padding: 0 0.4375rem 0 0.5rem;
  border: 1px solid rgba(122, 162, 255, 0.38);
  border-radius: 999px;
  background: rgba(122, 162, 255, 0.12);
  color: #a8c0ff;
  font-size: 0.75rem;
  font-weight: 500;
}

.vs-chip:hover { background: rgba(122, 162, 255, 0.2); }

.vs-chip svg { width: 12px; height: 12px; opacity: 0.75; }

.vs-dot {
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: #7aa2ff;
}

.vs-lv { font-size: 0.6875rem; opacity: 0.75; }

.bar {
  position: relative;
  height: 0.375rem;
  margin-top: 0.25rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--muted);
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.25s ease;
}

.bar .marker {
  position: absolute;
  top: -1px;
  width: 3px;
  height: calc(100% + 2px);
  border-radius: 1px;
  background: #7aa2ff;
}

.sub-stat .line { font-size: 0.875rem; }

.sub-stat .label img { width: 1rem; height: 1rem; }

.sub-stat .value { font-weight: 500; }

.stat-divider {
  margin-block: 1.5rem;
  border: 0;
  border-top: 1px solid var(--border);
}

/* ------------------------------------------------------------- detail hero */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.back-link:hover { color: var(--foreground); }

.detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.detail-head h1 { font-size: 1.875rem; font-weight: 600; }

.detail-head .badge {
  height: 1.5rem;
  padding-inline: 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.detail-head .type-rank {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.detail-head .type {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-head .type img { width: 1.5rem; height: 1.5rem; object-fit: contain; }

.detail-head .base { display: inline-flex; align-items: center; gap: 0.25rem; }

.detail-head .base img { width: 1.375rem; height: 1.375rem; object-fit: contain; }

.detail-grid {
  display: grid;
  gap: 0.5rem;
}

.col { display: flex; flex-direction: column; gap: 1rem; }

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 14rem;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
  perspective: 900px;
}

.hero img {
  width: auto;
  max-width: 100%;
  max-height: 18rem;
  height: auto;
  object-fit: contain;
  transition: transform 0.12s ease-out;
  will-change: transform;
}

.hero .toggle {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.25rem;
}

.hero .toggle button.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

.hero.is-3d { height: 22rem; min-height: 22rem; }

.hero img[hidden] { display: none; }

.hero-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-stage[hidden] { display: none; }

.viewer-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.viewer-canvas:active { cursor: grabbing; }

.viewer-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  background: rgba(26, 26, 26, 0.55);
  pointer-events: none;
}

.viewer-loading[hidden] { display: none; }

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: dd-spin 0.8s linear infinite;
}

@keyframes dd-spin { to { transform: rotate(360deg); } }

.hero-fs {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: rgba(18, 18, 18, 0.6);
  color: var(--muted-foreground);
}

.hero-fs:hover { color: var(--foreground); background: var(--accent); }

.steer-ctl {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3125rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: rgba(18, 18, 18, 0.66);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  user-select: none;
}

.steer-ctl[hidden] { display: none; }

.steer-ctl.is-disabled { opacity: 0.45; }

.steer-ctl .cap { white-space: nowrap; }

.steer-ctl input[type="range"] {
  width: 8rem;
  height: 1rem;
  margin: 0;
}

.steer-ctl .val {
  min-width: 2.125rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}

.hero:fullscreen {
  height: 100vh;
  min-height: 100vh;
  border-radius: 0;
  border: 0;
}

.hero .toggle { z-index: 3; }

.skins { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.skin {
  width: 6rem;
  padding: 0.375rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: var(--card);
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.skin:hover { border-color: rgba(163, 163, 163, 0.5); }

.skin[aria-pressed="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.skin img { width: 100%; height: 3rem; object-fit: contain; }

.skin span {
  display: block;
  margin-top: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 11px;
  color: var(--muted-foreground);
}

/* ------------------------------------------------------------- rank / level */

.field-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.field + .field { margin-top: 1rem; }

.rank-options { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }

.rank-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--input);
  border-radius: 0.375rem;
  background: var(--background);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.rank-opt:hover { background: var(--accent); }

.rank-opt[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--primary);
}

.rank-opt img { width: 1.375rem; height: 1.375rem; object-fit: contain; }

.level-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.level-row .val { font-weight: 500; font-variant-numeric: tabular-nums; }

input[type="range"] {
  width: 100%;
  margin-top: 0.5rem;
  accent-color: var(--primary);
  cursor: pointer;
}

/* --------------------------------------------------------------- upgrades */

.upgrade {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
}

.upgrade.is-active { border-color: rgba(255, 133, 51, 0.4); }
.upgrade.is-locked { opacity: 0.45; }

.upgrade .main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.upgrade .main img { width: 1.375rem; height: 1.375rem; flex-shrink: 0; }

.upgrade .main span {
  min-width: 0;
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.35;
}

.upgrade .side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-left: 2.125rem;
}

.upgrade-list { display: flex; flex-direction: column; gap: 0.75rem; }

/* ------------------------------------------------------------------ parts */

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

.part-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 4.5rem;
  padding: 0.5rem 0.25rem;
  border: 1px dashed #3a3a3a;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--muted-foreground);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.part-slot:hover {
  border-color: rgba(163, 163, 163, 0.55);
  background: rgba(42, 42, 42, 0.35);
}

.part-slot .plus { font-size: 1.25rem; line-height: 1; font-weight: 300; }

.part-slot .slot-label { font-size: 0.75rem; }

.part-slot.filled {
  border-style: solid;
  border-color: var(--border);
  background: rgba(35, 35, 35, 0.6);
  color: var(--foreground);
}

.part-slot .part-img { width: 2rem; height: 2rem; object-fit: contain; }

.part-slot .part-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}

.part-slot .enh {
  display: inline-flex;
  gap: 0.25rem;
}

.part-slot .enh b {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  height: 1.125rem;
  padding-inline: 0.25rem;
  border-radius: 0.25rem;
  background: rgba(255, 133, 51, 0.16);
  color: var(--primary);
  font-size: 10px;
  font-weight: 600;
}

.part-slot .enh b img {
  width: 0.75rem;
  height: 0.75rem;
  object-fit: contain;
}

/* ------------------------------------------------------------------- menu */

.menu {
  position: absolute;
  top: calc(100% + 0.375rem);
  right: 0;
  z-index: 60;
  min-width: 12rem;
  padding: 0.375rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.menu[hidden] { display: none; }

.menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  font-size: 0.875rem;
  text-align: left;
}

.menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

.menu a:hover { background: var(--accent); }

.menu button:hover { background: var(--accent); }

.menu .sep {
  margin: 0.375rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.menu .who {
  padding: 0.5rem 0.625rem 0.375rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.user-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 0.5rem 0 0.375rem;
  border: 1px solid var(--input);
  border-radius: 999px;
  background: var(--background);
  font-size: 0.875rem;
}

.user-chip:hover { background: var(--accent); }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--foreground);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ------------------------------------------------------------------ sheet */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.sheet-backdrop.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 90;
  display: flex;
  width: min(20rem, 88vw);
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border-right: 1px solid var(--border);
  background: var(--card);
  transform: translateX(-102%);
  transition: transform 0.2s ease;
}

.sheet.open { transform: translateX(0); }

.sheet .sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.sheet a,
.sheet button.sheet-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  font-size: 0.9375rem;
  text-align: left;
}

.sheet a:hover,
.sheet button.sheet-link:hover { background: var(--accent); }

.sheet .sheet-foot {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ------------------------------------------------------------------ modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(0, 0, 0, 0.62);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.modal-backdrop.open { opacity: 1; pointer-events: auto; }

.modal {
  width: min(28rem, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem 0.75rem 0 0;
  background: var(--card);
  transform: translateY(12px);
  transition: transform 0.18s ease;
}

.modal-backdrop.open .modal { transform: translateY(0); }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.modal-head h3 { font-size: 1.0625rem; }

.modal-sub {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.modal .close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--muted-foreground);
}

.modal .close:hover { background: var(--accent); color: var(--foreground); }

.part-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: transparent;
  text-align: left;
}

.part-option + .part-option { margin-top: 0.5rem; }

.part-option:hover { border-color: rgba(163, 163, 163, 0.5); }

.part-option[aria-pressed="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.part-option img { width: 2.25rem; height: 2.25rem; object-fit: contain; }

.part-option .po-main { flex: 1; min-width: 0; }

.part-option .po-name { font-size: 0.875rem; font-weight: 500; }

.part-option .po-stats {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.enh-block {
  margin-top: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: rgba(18, 18, 18, 0.5);
}

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

.enh-row + .enh-row { margin-top: 0.625rem; }

.enh-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
}

.enh-stat img { width: 1rem; height: 1rem; object-fit: contain; }

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  border: 1px solid var(--input);
  border-radius: 0.375rem;
  overflow: hidden;
}

.stepper button {
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.875rem;
}

.stepper button:hover { background: var(--accent); }

.stepper span {
  min-width: 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

/* ------------------------------------------------------------------ toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 120;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #232323;
  color: var(--foreground);
  font-size: 0.8125rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, 8px);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ----------------------------------------------------------------- footer */

.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-block: 2rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.footer-inner .copy { font-weight: 500; color: var(--foreground); }

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.coffee svg { color: #ffdd00; }

/* -------------------------------------------------------------- insights */

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

.kpi {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
}

.kpi .k-label { font-size: 0.75rem; color: var(--muted-foreground); }

.kpi .k-value {
  margin-top: 0.25rem;
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.kpi .k-note { font-size: 0.6875rem; color: var(--muted-foreground); }

.dist-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr 2rem;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
}

.dist-row + .dist-row { margin-top: 0.5rem; }

.dist-row .track {
  height: 0.5rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--muted);
}

.dist-row .track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
}

.dist-row .n { text-align: right; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }

.rank-strip { display: flex; align-items: center; gap: 0.375rem; }

.mini-list { display: flex; flex-direction: column; gap: 0.5rem; }

.mini-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font-size: 0.8125rem;
}

.mini-row img.thumb { width: 2.5rem; height: 1.75rem; object-fit: contain; }

.mini-row .grow { flex: 1; min-width: 0; }

.mini-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mini-row .sm { font-size: 0.6875rem; color: var(--muted-foreground); }

/* ------------------------------------------------------------ breakpoints */

@media (max-width: 419px) {
  .parts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 640px) {
  .hero-banner { aspect-ratio: 3 / 1; }
  .hero-banner .scrim {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.35) 55%, rgba(0, 0, 0, 0));
  }
  .hero-banner .copy-block {
    inset: 0 auto 0 0;
    max-width: 28rem;
    justify-content: center;
    padding: 2rem;
  }
  .hero-banner .hero-title { font-size: 2.25rem; }

  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .car-card .media { height: 7rem; }
  .modal-backdrop { align-items: center; padding: 1rem; }
  .modal { border-radius: 0.75rem; }
  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
  }
  .footer-right { align-items: flex-end; }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .brand-word { display: inline; }
  .nav-link { display: inline-flex; }
  .header-right { display: flex; }
  .menu-btn { display: none; }

  .toolbar .group { width: auto; overflow: visible; }
  .segmented { width: auto; }
  .segmented button { flex: 0 0 auto; }
  .toolbar-right { width: auto; flex-wrap: nowrap; }
  .search { flex: 0 1 15rem; }

  .upgrade { flex-direction: row; align-items: center; gap: 0.75rem 0.75rem; padding-block: 0.5rem; }
  .upgrade .side { padding-left: 0; flex-shrink: 0; }
}

@media (min-width: 1024px) {
  .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
}

@media (max-width: 767px) {
  .segmented.type-group button .label { display: none; }
  .segmented.type-group button[data-value="All"] .label { display: inline; }
  .toolbar .sort { width: 100%; }
  .search { width: 100%; flex-basis: 100%; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .page-actions .btn { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ------------------------------------------------------------------
   Iteration 2026-11-10 — CJK fallback + community pages
   Design tokens stay identical to upstream (6f0ec322f0a14245.css).
   ------------------------------------------------------------------ */

h1, h2, h3, h4, h5, h6 {
  font-family: "Nunito Sans", "PingFang TC", "Noto Sans TC",
    "Microsoft JhengHei", ui-sans-serif, system-ui, sans-serif;
}

body {
  font-family: var(--font-sans), "PingFang TC", "Noto Sans TC",
    "Microsoft JhengHei", ui-sans-serif, system-ui, sans-serif;
}

.snapshot-note,
.readonly-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.snapshot-note svg { width: 15px; height: 15px; color: var(--primary); }
.readonly-note { margin-top: 0.75rem; border-left: 2px solid var(--primary); }
.readonly-note svg { width: 14px; height: 14px; color: var(--primary); flex-shrink: 0; }
.dot { opacity: 0.5; margin-inline: 0.125rem; }
.panel-note { margin: 0.875rem 0; font-size: 0.8125rem; color: var(--muted-foreground); }
.stack-note { font-size: 0.8125rem; color: var(--muted-foreground); }

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.section-count {
  padding: 0.0625rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.pack-section { margin-top: 1.75rem; }

.pack-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
}

.pack-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  background: var(--card);
}

.pack-hero { display: block; padding: 1rem 1rem 0.5rem; }
.pack-hero > img { display: block; width: 100%; height: 8.5rem; object-fit: contain; }
.pack-title { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.pack-title .nm { font-size: 1.125rem; font-weight: 600; }

.tag {
  display: inline-flex;
  align-items: center;
  height: 1.375rem;
  padding-inline: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted-foreground);
}

.tag.is-new { border-color: rgba(255, 133, 51, 0.45); background: rgba(255, 133, 51, 0.12); color: #ffab73; }

.pack-type { display: flex; align-items: center; gap: 0.375rem; margin-top: 0.375rem; font-size: 0.8125rem; color: var(--muted-foreground); }
.pack-type img { width: 1.25rem; height: 1.25rem; object-fit: contain; }
.pack-meta { padding: 0.375rem 0 0.5rem; }
.pack-meta .remain { font-size: 0.875rem; font-weight: 500; }
.pack-meta .dates { margin-top: 0.125rem; font-size: 0.75rem; color: var(--muted-foreground); }

.pack-rate { padding: 0.75rem 1rem 1rem; border-top: 1px solid var(--border); }
.pack-rate .cap { display: block; margin-bottom: 0.5rem; font-size: 0.75rem; color: var(--muted-foreground); }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.375rem; }

.rate-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.4375rem 0.1875rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font-size: 0.75rem;
}

.rate-chip:hover { border-color: var(--muted-foreground); }
.rate-chip img { width: 1.25rem; height: 1rem; object-fit: contain; }
.back-link { margin-top: 1.75rem; }

.livery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.livery-grid.is-featured { grid-template-columns: minmax(0, 1fr); }

.livery-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.livery-card:hover { border-color: var(--muted-foreground); transform: translateY(-2px); }
.livery-thumb { position: relative; display: block; aspect-ratio: 16 / 10; background: #0e0e0e; overflow: hidden; }
.livery-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

.feat {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.6875rem;
  font-weight: 700;
}

.livery-body { display: flex; flex-direction: column; gap: 0.1875rem; padding: 0.625rem 0.75rem 0.75rem; }
.livery-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 0.875rem; font-weight: 600; }
.livery-byline { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 0.75rem; color: var(--muted-foreground); }
.livery-stats { display: flex; flex-wrap: wrap; gap: 0.625rem; margin-top: 0.3125rem; font-size: 0.6875rem; color: var(--muted-foreground); }
.livery-stats span { display: inline-flex; align-items: center; gap: 0.1875rem; }
.livery-stats svg { width: 11px; height: 11px; }
.livery-toolbar { margin-bottom: 1rem; }
.livery-sort { width: auto; }
.livery-sort button { padding-inline: 0.625rem; }
.livery-sort button.on { background: var(--primary); color: var(--primary-foreground); }
.livery-modal .modal { width: min(40rem, 100%); }
.livery-full { display: block; width: 100%; border: 1px solid var(--border); border-radius: 0.375rem; }
.modal-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; margin: 0.75rem 0; font-size: 0.8125rem; color: var(--muted-foreground); }

.tabbar { display: flex; gap: 0.25rem; margin-top: 1.25rem; overflow-x: auto; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.tabbar::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  padding: 0.625rem 0.875rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  white-space: nowrap;
}

.tab:hover { color: var(--foreground); }
.tab.on { color: var(--foreground); border-bottom-color: var(--primary); }

.rank-list { display: flex; flex-direction: column; gap: 0.125rem; }

.rank-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
}

a.rank-row:hover { background: var(--accent); }
.rank-row .rk { width: 1.5rem; flex-shrink: 0; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.rank-row img.thumb { width: 2.75rem; height: 1.875rem; object-fit: contain; flex-shrink: 0; }
.rank-row .grow { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.rank-row .nm { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; min-width: 5rem; }
.rank-row .nm.is-wide { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; min-width: 12rem; }
.rank-row .cl { flex: 0 0 5rem; font-size: 0.75rem; color: var(--muted-foreground); }
.rank-row .sm { font-size: 0.6875rem; color: var(--muted-foreground); }
.rank-row .pills { display: inline-flex; flex-wrap: wrap; gap: 0.125rem; }
.rank-bar { flex: 1 1 4rem; min-width: 2rem; height: 0.375rem; overflow: hidden; border-radius: 999px; background: var(--secondary); }
.rank-bar i { display: block; height: 100%; background: var(--primary); }
.rank-row .own { min-width: 5.5rem; text-align: right; font-variant-numeric: tabular-nums; }

.stat-pill {
  display: inline-block;
  margin: 0.125rem 0.25rem 0 0;
  padding: 0.0625rem 0.3125rem;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  font-size: 0.6875rem;
}

.set-list { display: flex; flex-direction: column; }
.set-row { display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 0.625rem; border-bottom: 1px solid var(--border); font-size: 0.8125rem; }
.set-row:last-child { border-bottom: 0; }
.set-row .rk { width: 1.5rem; text-align: center; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.set-row .code { min-width: 3.5rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; letter-spacing: 0.05em; color: var(--primary); }
.set-parts { display: inline-flex; gap: 0.25rem; }
.set-parts img { width: 1.75rem; height: 1.75rem; object-fit: contain; }
.set-row .rank-bar { flex: 1 1 4rem; max-width: 22rem; }
.set-row .set-parts { flex: 0 0 auto; }
.set-row .own { font-variant-numeric: tabular-nums; }
.set-row .sm { min-width: 4rem; text-align: right; font-size: 0.6875rem; color: var(--muted-foreground); }

@media (min-width: 640px) {
  .pack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .livery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .livery-grid.is-featured { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .pack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .livery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pack-card.is-featured { grid-row: span 2; }
  .pack-card.is-featured .pack-hero { display: flex; flex: 1; flex-direction: column; justify-content: center; }
  .pack-card.is-featured .pack-hero > img { height: 15rem; }
  .pack-card.is-featured .pack-title .nm { font-size: 1.5rem; }
  .pack-card.is-featured .pack-meta .remain { font-size: 1rem; }
  .pack-rate { margin-top: auto; }
}

@media (max-width: 639px) {
  .snapshot-note .dot { display: none; }
  .rank-bar { display: none; }
  .rank-row .cl { display: none; }
  .rank-row .nm.is-wide { min-width: 7rem; }
  .rank-row .own { min-width: 4.25rem; font-size: 0.75rem; }
  .set-row .sm { display: none; }
  .set-parts img { width: 1.375rem; height: 1.375rem; }
  .pack-card.is-featured .pack-hero > img { height: 8.5rem; }
}

.pack-more {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  margin-left: 0.375rem;
  color: var(--primary);
  font-size: 0.75rem;
  white-space: nowrap;
}

.pack-more:hover { text-decoration: underline; }
.pack-more svg { width: 12px; height: 12px; }
