/* SpaceSense design tokens — the visual designer can restyle the whole app from here. */
:root {
  --sky: #e4edfc;
  --sky-deep: #cfdcf6;
  --surface: #ffffff;
  --surface-soft: #f3f7fe;
  --ink: #1d2f5e;
  --muted: #66749a;
  --line: #e2e9f7;
  --primary: #3d6fe0;
  --primary-2: #5d8cf4;
  --primary-ink: #ffffff;
  --warn: #f08a3c;
  --warn-2: #f6aa5c;

  /* one pastel pair per metric: tile background + icon colour */
  --noise-bg: #e8efff;
  --noise: #3d6fe0;
  --crowd-bg: #e1f5ec;
  --crowd: #1f9a68;
  --light-bg: #fff3d4;
  --light: #e09a00;

  --good-bg: #e1f5ec;
  --good: #1a8a59;
  --maybe-bg: #fff1dc;
  --maybe: #b86e00;
  --poor-bg: #ffe6e3;
  --poor: #c8402c;
  --neutral-bg: #edf0f6;
  --neutral: #66749a;

  --radius: 24px;
  --radius-sm: 16px;
  --shadow: 0 12px 32px rgb(61 111 224 / 0.16), 0 2px 6px rgb(29 47 94 / 0.08);
  --font: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --display: 'Nunito', 'Atkinson Hyperlegible', system-ui, sans-serif;
  --gutter: max(16px, env(safe-area-inset-left));
  --minimap: 156px;
  color-scheme: light;
}
@media (max-width: 520px) {
  :root { --minimap: 124px; }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink);
  background: var(--sky);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
p, h1, h2 { margin: 0; }
button { font: inherit; cursor: pointer; color: inherit; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.icon { display: inline-flex; flex: none; }
.icon svg { width: 18px; height: 18px; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* ----- splash / loading ----- */
.loading {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(60% 30% at 15% 85%, #fff 0 40%, transparent 70%),
    radial-gradient(50% 25% at 90% 92%, #fff 0 40%, transparent 70%),
    radial-gradient(35% 14% at 80% 18%, rgb(255 255 255 / 0.8) 0 40%, transparent 70%),
    linear-gradient(180deg, #cfe0fb 0%, #e7effd 60%, #f4f8ff 100%);
}
.loading[hidden] { display: none; }
.splash { text-align: center; max-width: 300px; }
.splash-mascot { width: 132px; height: auto; animation: float 3s ease-in-out infinite; }
.wordmark { font-family: var(--display); font-weight: 900; font-size: 46px; letter-spacing: -0.02em; line-height: 1; margin-top: 8px; }
.splash-tag { font-family: var(--display); font-weight: 800; color: var(--primary); margin-top: 6px; }
.splash-line { color: var(--muted); margin-top: 14px; }
.splash-status { color: var(--muted); font-size: 14px; margin-top: 22px; }
@keyframes float { 50% { transform: translateY(-8px); } }

.dest-tag {
  position: fixed; left: 0; top: 0; pointer-events: none;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  padding: 7px 14px 7px 10px; border-radius: 999px; font-family: var(--display); font-size: 15px; font-weight: 800; white-space: nowrap;
}
.dest-tag[hidden] { display: none; }
.dest-tag .icon { color: var(--primary); }
.dest-tag::after {
  content: ''; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; margin-left: -6px;
  background: var(--surface); transform: rotate(45deg); border-radius: 2px;
}

/* ----- top HUD: direction banner + space forecast ----- */
/* No transform here: on wide screens the forecast is position: fixed to the viewport,
   which a transformed ancestor would break. */
.hud-top {
  position: fixed; top: max(16px, env(safe-area-inset-top)); left: 0; right: 0; margin-inline: auto;
  width: min(420px, calc(100vw - 2 * var(--gutter)));
  display: grid; gap: 10px;
  pointer-events: none;
}
.hud-top button, .hud-top a, .forecast { pointer-events: auto; }
/* let long one-line text ellipsize instead of stretching the grid past the screen */
.hud-top > * { min-width: 0; }

.banner {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  color: var(--primary-ink); padding: 14px 18px; border-radius: var(--radius); box-shadow: var(--shadow);
}
.banner[data-kind='off'] { background: linear-gradient(120deg, var(--warn), var(--warn-2)); }
.banner-icon {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px;
  border-radius: 16px; background: rgb(255 255 255 / 0.22);
}
.banner-icon svg { width: 30px; height: 30px; }
.banner-title { font-family: var(--display); font-size: 23px; font-weight: 800; line-height: 1.1; }
.banner-sub { font-size: 15px; opacity: 0.92; margin-top: 2px; }

.forecast { background: var(--surface); padding: 10px 12px 10px 10px; border-radius: var(--radius); box-shadow: var(--shadow); }
.forecast.open { padding-bottom: 12px; }
.forecast-head { display: flex; align-items: center; gap: 10px; }
.forecast-title { flex: 1; min-width: 0; }
.forecast-name { font-family: var(--display); font-weight: 800; font-size: 18px; line-height: 1.15; }
.forecast-toggle {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  border: 0; background: none; padding: 2px 0; font: inherit; text-align: left; border-radius: 8px;
}
/* the destination name matters most: wrap to two lines rather than cut it short */
.forecast-toggle > span:first-child { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.forecast-toggle .caret { color: var(--primary); transition: transform 0.2s; }
.forecast-toggle[aria-expanded='true'] .caret { transform: rotate(180deg); }
.forecast-meta > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.round-btn {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-soft); color: var(--primary); text-decoration: none;
}
.round-btn svg { width: 20px; height: 20px; }
/* Wide screens: the forecast moves to the top-left corner beside the banner. */
@media (min-width: 760px) {
  .forecast { position: fixed; top: max(16px, env(safe-area-inset-top)); left: var(--gutter); width: 340px; }
  /* the banner centres in the space to the right of it */
  .hud-top { left: calc(340px + 2 * var(--gutter)); right: var(--gutter); width: auto; max-width: 420px; }
}
.forecast-meta { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; margin-top: 2px; }
.forecast-meta .icon svg { width: 15px; height: 15px; }

.fit-pill {
  flex: none; border: 0; border-radius: 999px; padding: 6px 12px 6px 8px; font-size: 14px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--neutral-bg); color: var(--neutral);
}
.fit-pill .icon svg { width: 17px; height: 17px; }
.fit-pill[data-verdict='good'] { background: var(--good-bg); color: var(--good); }
.fit-pill[data-verdict='maybe'] { background: var(--maybe-bg); color: var(--maybe); }
.fit-pill[data-verdict='poor'] { background: var(--poor-bg); color: var(--poor); }
.fit-pill[data-verdict='none'] { background: var(--noise-bg); color: var(--primary); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.tile {
  display: grid; justify-items: center; gap: 2px; text-align: center;
  padding: 10px 6px 9px; border-radius: var(--radius-sm); background: var(--surface-soft); border: 1px solid var(--line);
}
.tile-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; margin-bottom: 4px; }
.tile-icon svg { width: 24px; height: 24px; }
.tile strong { font-size: 15px; line-height: 1.15; }
.tile small { font-size: 12px; color: var(--muted); }
.tile[data-empty] strong { color: var(--muted); }
.m-noise .tile-icon { background: var(--noise-bg); color: var(--noise); }
.m-crowd .tile-icon { background: var(--crowd-bg); color: var(--crowd); }
.m-light .tile-icon { background: var(--light-bg); color: var(--light); }

/* level meter: 3 segments in the metric's colour; --fill is set per segment */
.meter { display: inline-flex; gap: 3px; width: 54px; margin: 5px 0 3px; }
.meter-seg {
  flex: 1; height: 7px; border-radius: 999px;
  background: linear-gradient(90deg, var(--c, var(--primary)) var(--fill), var(--line) 0);
}
.chip .meter { width: 30px; gap: 2px; margin: 0 0 0 4px; }
.chip .meter-seg { height: 5px; }
.choices .meter { width: 36px; margin: 4px 0 0; opacity: 0.55; }
.choices label:has(input:checked) .meter { opacity: 1; }
.fine { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; margin-top: 10px; }
.fine .icon svg { width: 14px; height: 14px; }

/* ----- bottom left: joystick ----- */
.joystick {
  position: fixed; left: max(24px, env(safe-area-inset-left)); bottom: max(24px, env(safe-area-inset-bottom));
  width: 128px; height: 128px; border-radius: 50%;
  background: radial-gradient(circle, rgb(255 255 255 / 0.35), rgb(255 255 255 / 0.7));
  border: 2px solid rgb(255 255 255 / 0.95);
  box-shadow: var(--shadow), inset 0 0 0 10px rgb(61 111 224 / 0.06);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.knob {
  position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px;
  border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); pointer-events: none;
  transition: transform 0.15s ease-out, background-color 0.15s;
}
.knob::after { content: ''; position: absolute; inset: 18px; border-radius: 50%; background: var(--sky-deep); }
.joystick.active .knob { transition: background-color 0.15s; background: var(--primary); }
.joystick.active .knob::after { background: rgb(255 255 255 / 0.45); }

/* ----- bottom right: actions stacked over the minimap ----- */
.dock {
  position: fixed; right: max(24px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.fabs { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.fab {
  width: 50px; height: 50px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--surface); color: var(--primary); box-shadow: var(--shadow);
}
.fab svg { width: 24px; height: 24px; }
.fab[hidden] { display: none; }
#voice-btn[aria-pressed='true'] { background: var(--primary); color: var(--primary-ink); }
.fab.go {
  width: 66px; height: 66px; gap: 0; align-content: center;
  background: linear-gradient(140deg, var(--primary), var(--primary-2)); color: var(--primary-ink);
  font-family: var(--display); font-size: 13px; font-weight: 900; letter-spacing: 0.06em;
}
.fab.go svg { width: 26px; height: 26px; }
.fab.go[aria-pressed='true'] { background: var(--ink); }

.minimap {
  position: relative; width: var(--minimap); height: var(--minimap); border-radius: 50%;
  border: 4px solid var(--surface); box-shadow: var(--shadow); background: var(--sky-deep);
}
.minimap canvas { width: 100%; height: 100%; display: block; border-radius: 50%; }
.minimap-you {
  position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  fill: var(--primary); stroke: #fff; stroke-width: 2.4; stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgb(29 47 94 / 0.35));
}
.minimap-north, .minimap-goal {
  position: absolute; left: 50%; top: 50%; display: grid; place-items: center; border-radius: 50%;
}
.minimap-north {
  width: 20px; height: 20px; margin: -10px 0 0 -10px;
  background: var(--ink); color: #fff; font: 900 11px/1 var(--display);
}
.minimap-goal {
  width: 24px; height: 24px; margin: -12px 0 0 -12px;
  background: var(--surface); color: var(--good); box-shadow: 0 1px 4px rgb(29 47 94 / 0.3);
}
.minimap-goal svg { width: 16px; height: 16px; }

.toast {
  position: fixed; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); color: var(--ink); padding: 10px 16px 10px 12px; border-radius: 999px; font-weight: 700;
  box-shadow: var(--shadow); white-space: nowrap;
}
.toast .icon { color: #f0607e; }
.toast[hidden] { display: none; }

/* ----- floating sheets (preferences, survey) ----- */
.sheet {
  border: 0; border-radius: 28px; padding: 22px; box-shadow: var(--shadow);
  width: min(440px, calc(100vw - 2 * var(--gutter))); max-height: calc(100dvh - 32px);
  color: var(--ink); background: var(--surface);
}
.sheet::backdrop { background: rgb(29 47 94 / 0.28); backdrop-filter: blur(2px); }
.sheet h2 { font-family: var(--display); font-size: 22px; font-weight: 800; line-height: 1.2; }
.sheet-sub { color: var(--muted); font-size: 15px; margin-top: 4px; }
.eyebrow {
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
  color: var(--primary); font-family: var(--display); font-weight: 800; font-size: 14px;
}
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.btn {
  border-radius: 999px; padding: 10px 22px; min-height: 46px; font-weight: 700;
  background: var(--surface-soft); color: var(--ink); border: 0;
}
.btn.primary { background: linear-gradient(120deg, var(--primary), var(--primary-2)); color: var(--primary-ink); }
.btn.wide { flex: 1; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.error { color: var(--poor); font-size: 14px; min-height: 1em; margin-top: 8px; }
.error:empty { display: none; }

/* a row per metric: icon + label, then a 3-way picker */
.prefs { display: grid; gap: 10px; margin: 16px 0 14px; }
#survey-fields { display: grid; gap: 10px; margin-top: 16px; }
.metric-row { border: 1px solid var(--line); border-radius: 18px; padding: 10px 12px 12px; margin: 0; min-width: 0; }
.metric-row legend { display: contents; }
.metric-label { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 10px; }
.metric-label .tile-icon { width: 34px; height: 34px; margin: 0; }
.metric-label .tile-icon svg { width: 20px; height: 20px; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.choices label {
  display: grid; justify-items: center; align-content: center; gap: 3px; text-align: center;
  min-height: 62px; padding: 8px 4px; border-radius: 14px; background: var(--surface-soft);
  border: 2px solid transparent; font-size: 13px; cursor: pointer; color: var(--muted);
}
.choices label svg { width: 22px; height: 22px; }
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices label:has(input:checked) { background: var(--surface); font-weight: 700; color: var(--ink); }
.m-noise .choices label:has(input:checked) { border-color: var(--noise); }
.m-crowd .choices label:has(input:checked) { border-color: var(--crowd); }
.m-light .choices label:has(input:checked) { border-color: var(--light); }
.m-noise .choices label:has(input:checked) svg { color: var(--noise); }
.m-crowd .choices label:has(input:checked) svg { color: var(--crowd); }
.m-light .choices label:has(input:checked) svg { color: var(--light); }
.choices label:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }

/* preference sliders: track runs from the metric's pastel to its full colour */
.pref-word { margin-left: auto; font-weight: 700; color: var(--c); }
.slider-row { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.slider-row .icon svg { width: 20px; height: 20px; }
.m-noise { --c: var(--noise); --c-bg: var(--noise-bg); }
.m-crowd { --c: var(--crowd); --c-bg: var(--crowd-bg); }
.m-light { --c: var(--light); --c-bg: var(--light-bg); }
.pref-range { -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 32px; margin: 0; background: transparent; cursor: pointer; }
.pref-range::-webkit-slider-runnable-track {
  height: 10px; border-radius: 999px; background: linear-gradient(90deg, var(--c-bg), var(--c));
}
.pref-range::-moz-range-track { height: 10px; border-radius: 999px; background: linear-gradient(90deg, var(--c-bg), var(--c)); }
.pref-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; margin-top: -9px; border-radius: 50%;
  background: var(--surface); border: 4px solid var(--c); box-shadow: var(--shadow);
}
.pref-range::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 4px solid var(--c); box-shadow: var(--shadow);
}
.pref-range:focus-visible { outline: none; }
.pref-range:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--primary); outline-offset: 2px; }
.pref-range:focus-visible::-moz-range-thumb { outline: 3px solid var(--primary); outline-offset: 2px; }

/* mascot cards */
.fit-card, .helper-card {
  display: flex; align-items: center; gap: 12px;
  border-radius: 20px; padding: 12px 14px; background: linear-gradient(120deg, #eaf1ff, #f5f8ff);
}
.fit-card > svg, .helper-card img { flex: none; width: 64px; height: auto; }
.fit-card.big { flex-direction: column; text-align: center; margin-top: 14px; padding: 20px 16px; }
.fit-card.big > svg { width: 120px; }
.fit-card.big .verdict { font-size: 22px; }
.fit-card.big ul { font-size: 15px; }
.fit-card .verdict { font-family: var(--display); font-weight: 800; font-size: 17px; }
.fit-card[data-verdict='good'] .verdict { color: var(--good); }
.fit-card[data-verdict='maybe'] .verdict { color: var(--maybe); }
.fit-card[data-verdict='poor'] .verdict { color: var(--poor); }
.fit-card ul { margin: 4px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.fit-card li strong { color: var(--ink); }
.helper-card { margin-top: 14px; }
.helper-card img { width: 52px; }
.helper-card p { font-size: 14px; color: var(--muted); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ===== home page (index.html): splash, search, recommendations, leaderboard ===== */
body.home-page { overflow: auto; height: auto; min-height: 100%; }
.logo { display: inline-flex; width: 64px; color: currentColor; }
.logo svg { width: 100%; height: auto; }
.logo.small { width: 18px; }
.avatar { display: inline-flex; flex: none; width: 64px; }
.avatar svg { width: 100%; height: auto; }
.avatar.small { width: 40px; }
.avatar.tiny { width: 30px; }

.splash-screen {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; overflow: hidden;
  color: #fff; text-align: center;
  background: radial-gradient(90% 60% at 50% 30%, #5d8cf4 0%, #3d6fe0 55%, #2a4fae 100%);
}
.splash-screen[hidden] { display: none; }
/* a faint floor plan behind the logo, standing in for a photo of the space */
.splash-bg { position: absolute; inset: -10%; opacity: 0.13; mix-blend-mode: luminosity; transform: rotate(-8deg); }
.splash-bg svg { width: 100%; height: 100%; }
.splash-inner { position: relative; display: flex; flex-direction: column; align-items: center; max-width: 320px; }
.splash-screen .logo { width: 72px; animation: float 3s ease-in-out infinite; }
.splash-screen .wordmark { margin-top: 14px; }
.splash-screen .splash-tag { color: #fff; font-size: 18px; }
.splash-screen .splash-line { color: rgb(255 255 255 / 0.85); }
.you-card {
  display: flex; align-items: center; gap: 12px; margin-top: 32px; padding: 10px 18px 10px 10px;
  background: var(--surface); color: var(--ink); border-radius: 999px; box-shadow: var(--shadow); text-align: left;
}
.you-card .avatar { width: 52px; }
.you-label { font-size: 13px; color: var(--muted); }
.you-name { font-family: var(--display); font-weight: 900; font-size: 20px; line-height: 1.1; }
.enter-btn {
  display: grid; place-items: center; width: 64px; height: 64px; margin-top: 28px; border: 0; border-radius: 50%;
  background: #fff; color: var(--primary); box-shadow: 0 10px 24px rgb(16 30 80 / 0.3);
}
.enter-btn svg { width: 28px; height: 28px; }
.enter-btn:focus-visible { outline-color: #fff; outline-offset: 4px; }

.home {
  max-width: 520px; margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) var(--gutter) max(32px, env(safe-area-inset-bottom));
  background: radial-gradient(120% 320px at 50% 0, #cfe0fb, transparent);
}
.home[hidden] { display: none; }
.home-head { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 900; font-size: 22px; color: var(--primary); }
.brand .logo.small { width: 20px; }
.points-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: var(--surface); color: var(--ink); font-weight: 700; text-decoration: none; box-shadow: var(--shadow);
}
.points-chip svg { width: 18px; height: 18px; color: #f0b400; }
.greet { display: flex; align-items: center; gap: 10px; margin-top: 22px; color: var(--muted); }
.greet strong { color: var(--ink); }
.home-title { font-family: var(--display); font-weight: 900; font-size: 30px; line-height: 1.1; margin-top: 8px; }
.home-title:focus { outline: none; }

.search {
  display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 0 16px;
  background: var(--surface); border-radius: 999px; box-shadow: var(--shadow); color: var(--muted);
}
.search:focus-within { outline: 3px solid var(--primary); outline-offset: 2px; }
.search .icon svg { width: 22px; height: 22px; }
.search input {
  flex: 1; min-width: 0; height: 54px; border: 0; background: none; outline: none;
  font: inherit; font-size: 17px; color: var(--ink);
}
.search input::placeholder { color: var(--muted); }
.results { list-style: none; margin: 8px 0 0; padding: 6px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); }
.results[hidden] { display: none; }
.result {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px;
  color: var(--ink); text-decoration: none;
}
a.result:hover { background: var(--surface-soft); }
.result > .icon { color: var(--primary); }
.result > span:not(.icon):not(.badge) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.result small { color: var(--muted); font-size: 13px; }
.result.empty { color: var(--muted); }

.prefs-card {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 16px; padding: 12px 14px;
  border: 0; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); text-align: left;
}
.prefs-card .tile-icon { margin: 0; background: var(--noise-bg); color: var(--primary); }
.prefs-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prefs-card-text small { color: var(--muted); font-size: 14px; }
.prefs-card > .icon { color: var(--primary); }

.section-title {
  display: flex; align-items: center; gap: 8px; margin-top: 28px;
  font-family: var(--display); font-weight: 900; font-size: 21px;
}
.section-title .icon { color: #f0b400; }
.section-title .icon svg { width: 22px; height: 22px; }
.section-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }

.cards { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.card {
  display: flex; overflow: hidden; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none;
}
.card:hover { transform: translateY(-1px); }
.thumb { flex: none; width: 108px; background: #c9d7ee; }
.thumb svg { display: block; width: 100%; height: 100%; }
.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px; }
.card-name { font-family: var(--display); font-weight: 800; font-size: 18px; line-height: 1.15; }
.card-meta { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; }
.card-meta .icon svg { width: 15px; height: 15px; }
.card-source { color: var(--muted); font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px 3px 5px; border-radius: 999px;
  background: var(--c-bg); color: var(--ink); font-size: 13px;
}
.chip .icon { color: var(--c); }
.chip .icon svg { width: 15px; height: 15px; }

.badge {
  flex: none; padding: 3px 10px; border-radius: 999px; font-family: var(--display); font-weight: 800; font-size: 13px;
  background: var(--neutral-bg); color: var(--neutral);
}
.badge[data-verdict='good'] { background: var(--good-bg); color: var(--good); }
.badge[data-verdict='maybe'] { background: var(--maybe-bg); color: var(--maybe); }
.badge[data-verdict='poor'] { background: var(--poor-bg); color: var(--poor); }

.lb { list-style: none; margin: 12px 0 0; padding: 6px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); }
.lb li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; }
.lb li.me { background: var(--noise-bg); font-weight: 700; }
.lb-rank { width: 22px; text-align: center; font-family: var(--display); font-weight: 900; color: var(--muted); }
.lb li:nth-child(1) .lb-rank { color: #d99a00; }
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-points { font-weight: 700; color: var(--primary); }
.lb-empty { color: var(--muted); }
.lb-you { color: var(--muted); font-size: 14px; margin-top: 10px; text-align: center; }
#leaderboard { scroll-margin-top: 16px; }

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