/* MotoRide prototype — hi-fi home screen */
:root {
  --primary: #ED7E1C;
  --primary-dark: #C5651A;
  --primary-light: #F9A857;
  --primary-soft: #FDF1E4;

  --secondary: #1F3E5B;
  --accent: #5693BF;
  --accent-light: #79B9E9;

  --success: #5A6B37;
  --success-light: #97AD65;
  --warning: #F5A623;
  --danger: #D64545;

  --bg: #FFFFFF;
  --bg-subtle: #F7F7F5;
  --bg-warm: #FAF6EF;
  --text: #1A1A1A;
  --text-muted: #6B6B6B;
  --text-faint: #9B9B96;
  --border: #E7E5DF;
  --border-strong: #D6D3CA;

  --sans: 'Inter', -apple-system, system-ui, sans-serif;
  --display: 'DM Sans', 'Inter', -apple-system, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  --phone-w: 402px;
  --phone-h: 844px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: #E9E5DC;
  font-family: var(--sans);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(237, 126, 28, 0.04), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(31, 62, 91, 0.04), transparent 40%);
}

/* ═══════════════════════════════════════════════════════════ */
/* MOBILE — show phone as a centered iPhone 16 mockup          */
/* ═══════════════════════════════════════════════════════════ */
@media (max-width: 820px) {
  html, body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
    /* A slightly deeper tone so the phone reads as a device sitting on paper */
    background: #D8D2C3 !important;
    background-image:
      radial-gradient(circle at 50% 50%, rgba(237,126,28,0.06), transparent 60%),
      radial-gradient(circle at 85% 85%, rgba(31,62,91,0.05), transparent 50%) !important;
  }
  .side-notes { display: none !important; }

  /* Breathing room so the phone reads as a mockup, not the app itself */
  .stage {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    box-sizing: border-box;
    padding:
      calc(32px + env(safe-area-inset-top))
      calc(20px + env(safe-area-inset-right))
      calc(40px + env(safe-area-inset-bottom))
      calc(20px + env(safe-area-inset-left)) !important;
    gap: 0 !important;
    overflow: hidden;
  }

  .phone-wrap {
    flex: 0 0 auto;
    /* --phone-scale is set by tab-nav.js on resize */
    transform: scale(var(--phone-scale, 0.9));
    transform-origin: center center;
  }

  .phone-wrap > div {
    /* Soft shadow so the phone floats on the surface — makes it feel like a mockup */
    box-shadow:
      0 24px 60px rgba(0,0,0,0.25),
      0 8px 20px rgba(0,0,0,0.12),
      0 0 0 1px rgba(0,0,0,0.08) !important;
  }

  /* Allow touch scrolling inside the phone's scrollable areas */
  .home-scroll,
  .map-scroll,
  .ride-scroll,
  .crew-scroll,
  .you-scroll,
  .sheet,
  .sheet-body,
  .app {
    touch-action: pan-y !important;
  }
}

/* ─── Stage: centers the phone and provides hints around it ─── */
.stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 56px;
  padding: 40px 28px;
  position: relative;
}

.side-notes {
  width: 260px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.7;
  letter-spacing: 0.02em;
}
.side-notes .brand {
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.side-notes .brand span { color: var(--primary); }
.side-notes .tag {
  display: inline-block;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 3px 7px;
  border-radius: 3px;
  margin-bottom: 12px;
}
.side-notes hr {
  border: none;
  border-top: 1px dashed var(--border-strong);
  margin: 18px 0;
}
.side-notes h4 {
  font-family: var(--mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text);
  margin: 0 0 6px;
}
.side-notes ul {
  padding: 0; margin: 0; list-style: none;
}
.side-notes li {
  padding: 4px 0 4px 14px;
  position: relative;
  font-size: 11px;
}
.side-notes li::before {
  content: '›';
  position: absolute; left: 0;
  color: var(--primary);
  font-weight: 700;
}
.side-notes kbd {
  font-family: var(--mono); font-size: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text);
}

/* ─── Phone canvas: the scaled-to-fit phone ─── */
.phone-wrap { flex-shrink: 0; }

/* The actual app viewport inside the phone bezel */
.app {
  width: 100%;
  height: 100%;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  font-family: var(--sans);
  color: var(--text);
}

/* ─── Status-bar-aware top padding (the IOSDevice has its own status bar) ─── */

/* ═══════════════════════════════════════════════════════════ */
/* HOME SCREEN                                                 */
/* ═══════════════════════════════════════════════════════════ */

.home-scroll {
  position: absolute;
  inset: 0 0 84px 0; /* leave room for tabbar */
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.home-scroll::-webkit-scrollbar { width: 0; }

/* Header — greeting + avatar */
.hdr {
  padding: 64px 20px 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg);
}
.hdr .greet-name {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.hdr .greet-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  max-width: 240px;
  line-height: 1.4;
}
.hdr-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  position: relative;
}
.icon-btn:active { transform: scale(0.94); background: #F0ECE3; }
.icon-btn .dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg-warm);
}

.avatar {
  display: inline-flex;
  align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #D1C6B0, #A89479);
  color: #fff;
  font-family: var(--mono);
  font-weight: 700;
  flex-shrink: 0;
}

/* Status strip — location + date + weather + crew */
.status-strip {
  margin: 0 20px 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 10px 12px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.status-strip .sep {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--border-strong);
}
.status-strip b { color: var(--text); font-weight: 700; }
.status-strip .live {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--success);
  font-weight: 700;
  margin-left: auto;
}
.status-strip .live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--success-light);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* Hero row — horizontal scroll-snap carousel for next + upcoming */
.hero-row {
  display: flex;
  gap: 12px;
  padding: 0 20px 18px;
  margin-top: 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-padding-left: 20px;
}
.hero-row::-webkit-scrollbar { height: 0; }
.hero-row > .hero-ride {
  margin: 0;
  flex-shrink: 0;
  width: calc(100% - 48px); /* main card leaves a peek of the next */
  scroll-snap-align: start;
}
.hero-row > .hero-ride.upcoming {
  width: calc(100% - 48px);
}

/* Peek dots under the row */
.hero-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: -10px 0 12px;
}
.hero-dots .d {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background 0.2s, width 0.2s;
}
.hero-dots .d.on { background: var(--primary); width: 16px; border-radius: 3px; }

/* Hero card — "then" variant is lighter */
.hero-ride.upcoming .hero-map {
  height: 100px;
  background:
    radial-gradient(circle at 70% 20%, rgba(86, 147, 191, 0.1), transparent 40%),
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(31, 62, 91, 0.02) 10px 11px),
    #EDE9DD;
}
.hero-ride.upcoming .route-line { stroke: var(--secondary); }
.hero-ride.upcoming .hero-pin .dot { background: var(--secondary); }
.hero-ride.upcoming .hero-pin.start .dot { background: var(--text-muted); }
.hero-ride.upcoming .hero-countdown {
  background: var(--secondary);
}
.hero-ride.upcoming .hero-badge {
  background: rgba(31, 62, 91, 0.9);
}
.hero-ride {
  margin: 4px 20px 18px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(31, 62, 91, 0.05);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hero-ride:active {
  transform: scale(0.99);
  box-shadow: 0 2px 8px rgba(31, 62, 91, 0.08);
}

/* Map surface inside hero */
.hero-map {
  height: 140px;
  position: relative;
  background:
    radial-gradient(circle at 20% 30%, rgba(237, 126, 28, 0.1), transparent 35%),
    radial-gradient(circle at 70% 80%, rgba(86, 147, 191, 0.08), transparent 35%),
    repeating-linear-gradient(45deg,
      transparent 0 10px,
      rgba(31, 62, 91, 0.025) 10px 11px
    ),
    repeating-linear-gradient(-45deg,
      transparent 0 14px,
      rgba(31, 62, 91, 0.02) 14px 15px
    ),
    #E8E4D5;
  overflow: hidden;
}
.hero-map::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(31, 62, 91, 0.07) 1px, transparent 1.5px);
  background-size: 22px 22px;
  opacity: 0.6;
}
.hero-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.route-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(237, 126, 28, 0.3));
}
.route-line.shadow {
  stroke: #fff;
  stroke-width: 6;
  opacity: 0.9;
  filter: none;
}

.hero-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  z-index: 2;
}
.hero-pin .dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--primary);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.hero-pin.start .dot { background: var(--secondary); }

.hero-badge {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(26, 26, 26, 0.92);
  color: #fff;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 6px;
  backdrop-filter: blur(6px);
}
.hero-countdown {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--primary);
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border-radius: 6px;
}

.hero-body { padding: 14px 16px 14px; }
.hero-title {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.hero-meta {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.hero-meta .bullet { color: var(--border-strong); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.stat-k {
  font-family: var(--mono);
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-faint);
}
.stat-v {
  font-family: var(--display);
  font-size: 16px; font-weight: 700;
  margin-top: 2px;
  letter-spacing: -0.01em;
}
.stat-v small {
  font-family: var(--sans);
  font-size: 11px; font-weight: 500;
  color: var(--text-muted);
  margin-left: 2px;
}

.hero-footer {
  padding: 10px 16px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--border);
}
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid #fff; margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack .more {
  width: 26px; height: 26px;
  background: var(--bg-warm);
  color: var(--text);
  border: 2px solid #fff;
  margin-left: -8px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: 9px; font-weight: 700;
}
.hero-footer .rsvp {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}
.hero-footer .chev {
  margin-left: auto;
  color: var(--text-faint);
}

/* Section header */
.sec-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 6px 20px 10px;
  margin-top: 8px;
}
.sec-h-title {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sec-h-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 8px;
  font-weight: 500;
}
.sec-h .see {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  cursor: pointer;
  padding: 4px 0;
}
.sec-h .see:active { opacity: 0.6; }

/* Stat row — points / credits / month */
.stat-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 10px;
  padding: 0 20px 18px;
}

/* First-time "How points work" handbook card — dismissible, stored in localStorage */
.intro-card {
  position: relative;
  margin: 4px 20px 14px;
  padding: 16px 18px 18px;
  background: #F7F2E8;
  border: 1px solid #E0D6C3;
  border-radius: 14px;
  animation: intro-card-in 220ms ease-out;
}
@keyframes intro-card-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.intro-card .ic-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.intro-card .ic-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 8px;
}
.intro-card .ic-body {
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.intro-card .ic-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.intro-card .ic-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 4px 8px;
  border-radius: 4px;
}
.intro-card .ic-dismiss {
  position: absolute;
  bottom: 12px;
  right: 14px;
  background: none;
  border: 0;
  padding: 4px 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}
.intro-card .ic-dismiss:hover { color: var(--primary); }
.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.stat-card:active { transform: scale(0.98); }
.stat-card.primary {
  background: linear-gradient(135deg, #1F3E5B 0%, #2D5173 100%);
  color: #fff;
  border: none;
  position: relative;
  overflow: hidden;
}
.stat-card.primary::after {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(237, 126, 28, 0.35), transparent 70%);
}
.stat-card .k {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.stat-card.primary .k { color: rgba(255,255,255,0.55); }
.stat-card .v {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 6px;
  line-height: 1;
}
.stat-card.primary .v { color: var(--primary-light); }
.stat-card .v small {
  font-family: var(--sans);
  font-size: 11px; font-weight: 500;
  color: var(--text-muted);
}
.stat-card.primary .v small { color: rgba(255,255,255,0.6); }
.stat-card .delta {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.04em;
}
.stat-card.primary .delta { color: rgba(255,255,255,0.6); }

/* Nearby quests — horizontal cards */
.quest-row {
  display: flex;
  gap: 12px;
  padding: 0 20px 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.quest-row::-webkit-scrollbar { height: 0; }
.quest-card {
  flex-shrink: 0;
  width: 210px;
  scroll-snap-align: start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease;
  position: relative;
}
.quest-card:active { transform: scale(0.98); }
.quest-photo {
  height: 92px;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.0) 40%, rgba(0,0,0,0.25) 100%),
    repeating-linear-gradient(135deg, transparent 0 8px, rgba(255,255,255,0.08) 8px 9px);
  position: relative;
}
.quest-photo.p1 { background-color: #8B9A6B; }
.quest-photo.p2 { background-color: #B58A5A; }
.quest-photo.p3 { background-color: #5693BF; }
.quest-photo.p4 { background-color: #9F6E4F; }
.quest-pts {
  position: absolute;
  top: 10px; right: 10px;
  background: #fff;
  color: var(--primary);
  font-family: var(--mono);
  font-size: 11px; font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 4px rgba(0,0,0,0.12);
}
.quest-type {
  position: absolute;
  top: 10px; left: 10px;
  color: #fff;
  font-family: var(--mono);
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  padding: 3px 6px;
  border-radius: 4px;
}
.quest-body { padding: 10px 12px 12px; }
.quest-title {
  font-family: var(--display);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.quest-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: 0.04em;
}

/* Crew activity card — Strava-ish */
.feed-card {
  margin: 0 20px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.feed-card:active { transform: scale(0.99); }
.feed-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 10px;
}
.feed-hd .name {
  font-family: var(--display);
  font-size: 13.5px; font-weight: 700;
}
.feed-hd .meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: 1px;
}
.feed-hd .more-btn {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 16px;
  padding: 4px 6px;
  line-height: 1;
}
.feed-title {
  padding: 0 14px;
  font-family: var(--display);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.feed-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 14px 10px;
}
.feed-stats .k {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.feed-stats .v {
  font-family: var(--display);
  font-size: 13px; font-weight: 700;
  margin-top: 2px;
  letter-spacing: -0.01em;
}
.feed-stats .v.win { color: var(--primary); }
.feed-map {
  height: 96px;
  position: relative;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 30% 50%, rgba(86, 147, 191, 0.08), transparent 35%),
    repeating-linear-gradient(45deg,
      transparent 0 10px,
      rgba(31, 62, 91, 0.025) 10px 11px
    ),
    #EDE9DD;
}
.feed-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.feed-foot {
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
}
.kudos-btn {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease;
}
.kudos-btn.on {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.kudos-btn:active { transform: scale(0.95); }

/* Bottom tab bar */
.tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 84px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding-bottom: 22px;
  z-index: 20;
}
.tab-item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.15s ease;
  user-select: none;
}
.tab-item:active { color: var(--text); }
.tab-item.active { color: var(--primary); }
.tab-item svg { width: 24px; height: 24px; }

/* ═══════════════════════════════════════════════════════════ */
/* SHEETS / MODALS                                             */
/* ═══════════════════════════════════════════════════════════ */

.sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0);
  pointer-events: none;
  transition: background 0.25s ease;
  z-index: 30;
}
.sheet-scrim.on {
  background: rgba(10, 10, 10, 0.4);
  pointer-events: auto;
}
.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 31;
  max-height: 88%;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.sheet.on { transform: translateY(0); }
.sheet-handle {
  width: 44px; height: 4px;
  background: var(--border-strong);
  border-radius: 4px;
  margin: 10px auto 0;
  flex-shrink: 0;
}
.sheet-body {
  overflow-y: auto;
  padding: 0 0 24px;
  flex: 1;
}
.sheet-body::-webkit-scrollbar { width: 0; }

/* Ride sheet */
.sheet-hero {
  height: 180px;
  position: relative;
  background:
    radial-gradient(circle at 30% 40%, rgba(237, 126, 28, 0.15), transparent 45%),
    repeating-linear-gradient(45deg,
      transparent 0 10px,
      rgba(31, 62, 91, 0.03) 10px 11px
    ),
    #E8E4D5;
  overflow: hidden;
}
.sheet-hero svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sheet-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(31, 62, 91, 0.08) 1px, transparent 1.5px);
  background-size: 22px 22px;
  opacity: 0.7;
}
.sheet-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sheet-pad { padding: 18px 20px; }
.sheet-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}
.sheet-title {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 4px;
  line-height: 1.15;
}
.sheet-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

.sheet-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 16px 20px 0;
  padding: 14px 10px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.sheet-stats .k {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.sheet-stats .v {
  font-family: var(--display);
  font-size: 15px; font-weight: 700;
  margin-top: 2px;
  letter-spacing: -0.01em;
}

.sheet-list-h {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 18px 20px 8px;
}
.sheet-item {
  padding: 10px 20px;
  display: flex; align-items: center; gap: 12px;
}
.sheet-item .marker {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}
.sheet-item .marker.end { background: var(--secondary); }
.sheet-item .marker.mid { background: var(--text-muted); width: 8px; height: 8px; }
.sheet-item .line {
  font-size: 13px; font-weight: 600;
}
.sheet-item .meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.03em;
}

.rsvp-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 16px 20px 0;
}
.rsvp-btn {
  padding: 12px 10px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}
.rsvp-btn:active { transform: scale(0.97); }
.rsvp-btn.on {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.rsvp-btn.on.maybe { background: var(--warning); border-color: var(--warning); }
.rsvp-btn.on.no { background: var(--text); border-color: var(--text); }

.sheet-actions {
  padding: 18px 20px 8px;
  display: flex; gap: 10px;
}
.btn-primary {
  flex: 1;
  height: 50px;
  background: var(--primary);
  color: #fff;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(237, 126, 28, 0.25);
  transition: transform 0.15s ease;
}
.btn-primary:active { transform: scale(0.98); }
.btn-ghost {
  height: 50px;
  padding: 0 18px;
  background: var(--bg-warm);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
}
.btn-ghost:active { transform: scale(0.97); }

/* Quest sheet variant */
.quest-sheet-hero {
  height: 160px;
  position: relative;
  overflow: hidden;
}
.quest-sheet-hero.p1 { background: linear-gradient(135deg, #6E8052 0%, #8B9A6B 70%); }
.quest-sheet-hero.p2 { background: linear-gradient(135deg, #9A7547 0%, #B58A5A 70%); }
.quest-sheet-hero.p3 { background: linear-gradient(135deg, #3E7BA3 0%, #5693BF 70%); }
.quest-sheet-hero.p4 { background: linear-gradient(135deg, #825A40 0%, #9F6E4F 70%); }
.quest-sheet-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(255,255,255,0.05) 10px 11px);
}
.quest-sheet-hero .geo {
  position: absolute;
  bottom: 16px; left: 16px; right: 16px;
  display: flex; align-items: center; gap: 10px;
  color: #fff;
}
.quest-sheet-hero .geo .ring {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.5);
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.2);
  backdrop-filter: blur(6px);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}
.quest-sheet-hero .geo .pts-big {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.quest-sheet-hero .geo .dist {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* Toast */
.toast {
  position: absolute;
  left: 20px; right: 20px;
  top: 100px;
  background: var(--secondary);
  color: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  transform: translateY(-200px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
  z-index: 40;
}
.toast.on { transform: translateY(0); opacity: 1; pointer-events: auto; }
.toast .ic {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.toast .t {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
}
.toast .s {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.7);
  margin-top: 1px;
}

/* Reward variant — warm celebration on quest complete */
.toast.reward {
  background: var(--primary);
  box-shadow: 0 10px 28px rgba(237,126,28,0.4), 0 2px 6px rgba(0,0,0,0.12);
  animation: toast-reward-flash 0.5s ease-out;
}
.toast.reward .ic {
  background: rgba(255,255,255,0.95);
  color: var(--primary);
}
.toast.reward .ic .pts-badge {
  font-family: var(--display);
  font-weight: 700;
  font-size: 12px;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.toast.reward .t {
  font-size: 14px;
  color: #fff;
}
.toast.reward .s {
  color: rgba(255,255,255,0.9);
  font-size: 10.5px;
  text-transform: uppercase;
}
@keyframes toast-reward-flash {
  0%   { transform: translateY(-12px); box-shadow: 0 0 0 0 rgba(255,255,255,0); }
  50%  { box-shadow: 0 10px 28px rgba(237,126,28,0.6), 0 0 0 8px rgba(255,255,255,0.15); }
  100% { transform: translateY(0); }
}

/* Tweaks panel (hidden until host activates) */
.tweaks-panel {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 1000;
  background: var(--text);
  color: #fff;
  padding: 14px 16px;
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 11px;
  min-width: 220px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}
.tweaks-panel h4 {
  margin: 0 0 10px;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.tweaks-panel .row { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tweaks-panel .row label {
  display: block;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 4px;
  width: 100%;
}
.tweak-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tweak-btn.on {
  background: var(--primary);
  border-color: var(--primary);
}

/* Hint pointer (design reviewer guides) */
.hint {
  position: absolute;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  pointer-events: none;
}
.hint::before {
  content: '';
  position: absolute;
  border-top: 1px dashed var(--border-strong);
}
