// screens.jsx — Hi-fi mocks of go's app screens
//
// Each screen is a self-contained React component sized to fit inside
// IOSDevice (default 402×874) and AndroidDevice viewports.
// They are styled to match the actual codebase: lowercase typography,
// Fraunces display, Inter body, warm paper + terracotta.

// ─────────────────────────────────────────────────────────────
// Shared screen primitives
// ─────────────────────────────────────────────────────────────
const screenBg = {
  background: 'var(--paper)',
  color: 'var(--ink)',
  minHeight: '100%',
  fontFamily: 'var(--sans)',
  fontSize: 14,
  lineHeight: 1.4,
};

function ScreenTopBar({ wordmarkSize = 22, neighborhood, dark = false }) {
  return (
    <div style={{
      display: 'flex', alignItems: 'center', gap: 10,
      padding: '14px 20px 10px',
    }}>
      <LogoWordmark size={wordmarkSize} color="var(--ink)" />
      {neighborhood && (
        <div style={{
          flex: 1,
          display: 'flex', alignItems: 'center', gap: 4,
          color: 'var(--ink-2, #5B4B3D)',
          fontSize: 12,
          fontWeight: 500,
        }}>
          <svg width="11" height="11" viewBox="0 0 24 24" fill="currentColor">
            <path d="M12 2C8 2 5 5 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-4-3-7-7-7zm0 9.5a2.5 2.5 0 110-5 2.5 2.5 0 010 5z"/>
          </svg>
          <span>{neighborhood}</span>
        </div>
      )}
      <button style={{
        width: 32, height: 32, borderRadius: 999,
        background: 'var(--paper-lift, #FBF6EC)',
        border: '1px solid var(--border, #E2D7C2)',
        display: 'flex', alignItems: 'center', justifyContent: 'center',
        color: 'var(--ink)', cursor: 'pointer',
      }}>
        <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.2" strokeLinecap="round">
          <line x1="4" y1="6" x2="20" y2="6"/>
          <line x1="4" y1="12" x2="14" y2="12"/>
          <line x1="4" y1="18" x2="9" y2="18"/>
        </svg>
      </button>
    </div>
  );
}

// Tab bar at the bottom
function ScreenTabBar({ active = 'explore' }) {
  const tabs = [
    { id: 'explore', label: 'explore', icon: 'M12 2C8 2 5 5 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-4-3-7-7-7zm0 9.5a2.5 2.5 0 110-5 2.5 2.5 0 010 5z' },
    { id: 'activity', label: 'activity', icon: 'M12 2L4 6v6c0 5 3.5 9.5 8 10 4.5-.5 8-5 8-10V6l-8-4z' },
    { id: 'create', label: '', icon: 'CTA' },
    { id: 'chat', label: 'chat', icon: 'M21 11.5c0 4.7-4 8.5-9 8.5-1.4 0-2.7-.3-3.9-.8L3 21l1.3-4.5C3.5 15.2 3 13.4 3 11.5 3 6.8 7 3 12 3s9 3.8 9 8.5z' },
    { id: 'profile', label: 'profile', icon: 'M12 12a4 4 0 100-8 4 4 0 000 8zm0 2c-4 0-8 2-8 6v2h16v-2c0-4-4-6-8-6z' },
  ];
  return (
    <div style={{
      position: 'absolute', bottom: 0, left: 0, right: 0,
      paddingBottom: 28,
      background: 'linear-gradient(to top, var(--paper) 70%, transparent)',
      pointerEvents: 'none',
    }}>
      <div style={{
        margin: '0 16px',
        display: 'flex', alignItems: 'center', justifyContent: 'space-around',
        background: 'var(--paper-lift, #FBF6EC)',
        border: '1px solid var(--border, #E2D7C2)',
        borderRadius: 999,
        padding: '10px 6px',
        pointerEvents: 'auto',
        boxShadow: '0 8px 24px rgba(26,20,15,0.08)',
      }}>
        {tabs.map(t => t.id === 'create' ? (
          <div key={t.id} style={{
            width: 44, height: 44, borderRadius: '50%',
            background: 'var(--accent)',
            display: 'flex', alignItems: 'center', justifyContent: 'center',
            color: 'var(--on-accent)',
            boxShadow: '0 6px 16px rgba(196,80,45,0.32)',
          }}>
            <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.6" strokeLinecap="round">
              <line x1="12" y1="5" x2="12" y2="19"/>
              <line x1="5" y1="12" x2="19" y2="12"/>
            </svg>
          </div>
        ) : (
          <div key={t.id} style={{
            display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 2,
            color: active === t.id ? 'var(--ink)' : 'var(--ink-3, #8E7C68)',
            fontSize: 10,
            fontWeight: active === t.id ? 700 : 500,
            letterSpacing: 0.4,
            minWidth: 50,
          }}>
            <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor">
              <path d={t.icon}/>
            </svg>
            <span>{t.label}</span>
            {active === t.id && (
              <div style={{ width: 4, height: 4, borderRadius: '50%', background: 'var(--accent)' }} />
            )}
          </div>
        ))}
      </div>
    </div>
  );
}

function Eyebrow({ children }) {
  return (
    <div style={{
      fontFamily: 'var(--sans)',
      fontSize: 10,
      fontWeight: 700,
      letterSpacing: '0.14em',
      textTransform: 'uppercase',
      color: 'var(--ink-3, #8E7C68)',
    }}>{children}</div>
  );
}

// ─────────────────────────────────────────────────────────────
// Faux London map — terracotta-toned, with activity-glyph pins
// ─────────────────────────────────────────────────────────────

// Each glyph is a tiny inline SVG group, designed to read at ~12-14px
// inside a pin disc. Lines only — no fills — to match the brand's
// editorial / line-drawn vibe.
const ACTIVITY_GLYPHS = {
  // basketball — hoops
  basketball: (
    <g fill="none" stroke="currentColor" strokeWidth="1.1" strokeLinecap="round">
      <circle cx="0" cy="0" r="4.2" />
      <path d="M-4.2 0 L 4.2 0 M 0 -4.2 L 0 4.2 M -3 -3 L 3 3 M -3 3 L 3 -3" />
    </g>
  ),
  // tennis / padel — racket shape
  racket: (
    <g fill="none" stroke="currentColor" strokeWidth="1.1" strokeLinecap="round" strokeLinejoin="round">
      <ellipse cx="0" cy="-1.4" rx="3" ry="3.4" />
      <path d="M -1.6 -1.4 L 1.6 -1.4 M 0 -4.4 L 0 1.4" />
      <path d="M -0.6 1.6 L -1.5 4.5 M 0.6 1.6 L 1.5 4.5" />
    </g>
  ),
  // dice / board games — three pips
  dice: (
    <g fill="none" stroke="currentColor" strokeWidth="1.1" strokeLinejoin="round">
      <rect x="-3.6" y="-3.6" width="7.2" height="7.2" rx="1" />
      <circle cx="-1.5" cy="-1.5" r="0.75" fill="currentColor" stroke="none" />
      <circle cx="1.5" cy="1.5" r="0.75" fill="currentColor" stroke="none" />
      <circle cx="1.5" cy="-1.5" r="0.75" fill="currentColor" stroke="none" />
    </g>
  ),
  // pencil — diagonal pencil
  pencil: (
    <g fill="none" stroke="currentColor" strokeWidth="1.1" strokeLinecap="round" strokeLinejoin="round">
      <path d="M -3.5 3.5 L 3 -3 L 4.5 -1.5 L -2 5 Z" />
      <path d="M 1.5 -1.5 L 3 0" />
    </g>
  ),
  // running shoe — simpler silhouette
  shoe: (
    <g fill="none" stroke="currentColor" strokeWidth="1.1" strokeLinecap="round" strokeLinejoin="round">
      <path d="M -4 2.5 L -3.8 -1 Q -3.6 -2.5 -2 -2.5 L 1 -1 L 3.6 0.5 L 4.2 2 L 4.2 3 L -4 3 Z" />
    </g>
  ),
  // knife & fork
  fork: (
    <g fill="none" stroke="currentColor" strokeWidth="1.1" strokeLinecap="round" strokeLinejoin="round">
      <path d="M -2.6 -4 L -2.6 -1.5 Q -2.6 0 -1.4 0 L -1.4 4" />
      <path d="M -1.4 -4 L -1.4 -1.5" />
      <path d="M -3.8 -4 L -3.8 -1.5" />
      <path d="M 2.4 -4 Q 1.4 -4 1.4 -2 Q 1.4 0 2.4 0 L 2.4 4" />
    </g>
  ),
  // music note — 8th note
  note: (
    <g fill="none" stroke="currentColor" strokeWidth="1.1" strokeLinecap="round" strokeLinejoin="round">
      <ellipse cx="-1.6" cy="3" rx="2" ry="1.5" fill="currentColor" stroke="none" />
      <path d="M 0.3 3 L 0.3 -3.8 L 4 -3" stroke="currentColor" fill="none" strokeWidth="1.1" />
    </g>
  ),
  // lotus / yoga — single bloom
  lotus: (
    <g fill="none" stroke="currentColor" strokeWidth="1.1" strokeLinecap="round" strokeLinejoin="round">
      <path d="M -4.5 2.5 Q -4.5 -3 0 -3.5 Q 4.5 -3 4.5 2.5 Z" />
      <path d="M 0 -3.5 L 0 2.5 M -2.2 -2 L -1.5 2.5 M 2.2 -2 L 1.5 2.5" />
    </g>
  ),
  // wave — 3 little waves
  wave: (
    <g fill="none" stroke="currentColor" strokeWidth="1.2" strokeLinecap="round">
      <path d="M -4 -2.2 Q -2 -4 0 -2.2 T 4 -2.2" />
      <path d="M -4 0.6 Q -2 -1.2 0 0.6 T 4 0.6" />
      <path d="M -4 3.4 Q -2 1.6 0 3.4 T 4 3.4" />
    </g>
  ),
  // chess — pawn
  chess: (
    <g fill="none" stroke="currentColor" strokeWidth="1.1" strokeLinecap="round" strokeLinejoin="round">
      <path d="M -3.6 4.5 L 3.6 4.5 L 2.6 2 L -2.6 2 Z" />
      <ellipse cx="0" cy="0.6" rx="2.4" ry="1.6" />
      <circle cx="0" cy="-2.4" r="1.6" />
    </g>
  ),
  // pint glass — tilted
  pint: (
    <g fill="none" stroke="currentColor" strokeWidth="1.1" strokeLinecap="round" strokeLinejoin="round">
      <path d="M -3 -3.5 L -2 4 L 2 4 L 3 -3.5 Z" />
      <path d="M -2.8 -1 L 2.8 -1" />
    </g>
  ),
  // camera
  camera: (
    <g fill="none" stroke="currentColor" strokeWidth="1.1" strokeLinecap="round" strokeLinejoin="round">
      <rect x="-4" y="-2" width="8" height="5.4" rx="0.8" />
      <circle cx="0" cy="0.7" r="1.6" />
      <rect x="-2.4" y="-3.4" width="3" height="1.4" rx="0.3" />
    </g>
  ),
};

// One pin = a teardrop body with a glyph cut out of its center.
function MapPin({ x, y, color, glyph, big = false, halo = false }) {
  const r = big ? 13 : 11;
  return (
    <g transform={`translate(${x} ${y})`}>
      {halo && (
        <>
          <circle r={r + 8} fill="none" stroke={color} strokeWidth="1.2" opacity="0.42" />
          <circle r={r + 16} fill="none" stroke={color} strokeWidth="0.9" opacity="0.2" />
        </>
      )}
      {/* drop shadow */}
      <ellipse cx="0" cy={r + 2} rx={r * 0.55} ry="1.4" fill="#1A140F" opacity="0.22" />
      {/* teardrop body */}
      <path
        d={`M 0 ${r + 4} L -${r * 0.7} ${r * 0.4} A ${r} ${r} 0 1 1 ${r * 0.7} ${r * 0.4} Z`}
        fill={color}
        stroke="#FBF6EC"
        strokeWidth="1.6"
      />
      {/* glyph — sits in the round part */}
      <g transform={`translate(0 -${r * 0.32}) scale(${big ? 1.2 : 1.0})`} color="#FBF6EC">
        {ACTIVITY_GLYPHS[glyph] || ACTIVITY_GLYPHS.dice}
      </g>
    </g>
  );
}

function FauxMap({ width = 360, height = 200, pinCount = 9 }) {
  return (
    <svg viewBox="0 0 360 200" width={width} height={height} style={{ display: 'block' }}>
      <defs>
        <pattern id="map-paper" width="6" height="6" patternUnits="userSpaceOnUse">
          <rect width="6" height="6" fill="#EFE7D7" />
          <circle cx="2" cy="2" r="0.3" fill="#D8C9A8" opacity="0.5" />
        </pattern>
      </defs>
      {/* Base */}
      <rect width="360" height="200" fill="url(#map-paper)" />
      {/* River Thames */}
      <path
        d="M-10 160 Q 50 145, 100 158 T 220 150 T 380 165 L 380 200 L -10 200 Z"
        fill="#C9DDE3"
        opacity="0.9"
      />
      <path
        d="M-10 160 Q 50 145, 100 158 T 220 150 T 380 165"
        stroke="#7FA8B5"
        strokeWidth="1"
        fill="none"
        opacity="0.5"
      />
      {/* Parks — sage blobs */}
      <path d="M50 30 Q 90 20, 105 40 T 90 75 Q 50 80, 40 60 Z" fill="#DDE3D2" opacity="0.9" />
      <path d="M220 25 Q 270 15, 290 45 T 270 80 Q 220 75, 215 50 Z" fill="#DDE3D2" opacity="0.9" />
      <path d="M170 90 Q 200 85, 205 105 Q 200 125, 170 120 Q 155 105, 170 90 Z" fill="#DDE3D2" opacity="0.7" />
      {/* Streets */}
      <g stroke="#D8C9A8" strokeWidth="1" fill="none" opacity="0.85">
        <path d="M0 60 L 360 70" />
        <path d="M0 100 L 360 95" />
        <path d="M0 130 L 360 135" />
        <path d="M80 0 L 110 200" />
        <path d="M180 0 L 200 200" />
        <path d="M280 0 L 270 200" />
      </g>
      {/* Major roads */}
      <g stroke="#C8B690" strokeWidth="1.6" fill="none" opacity="0.7">
        <path d="M0 80 Q 90 75, 180 90 T 360 88" />
        <path d="M150 0 Q 145 80, 180 120 T 220 200" />
      </g>
      {/* Activity pins */}
      {[
        // The featured/active pin — basketball (matches the hero card)
        { x: 110, y: 50, color: '#C4502D', glyph: 'basketball', big: true, halo: true },
        // Around — varied activities, varied tones
        { x: 180, y: 102, color: '#C4502D', glyph: 'shoe' },
        { x: 95, y: 108, color: '#7C8F6B', glyph: 'lotus' },
        { x: 240, y: 58, color: '#C68A2B', glyph: 'dice' },
        { x: 285, y: 92, color: '#A85C3C', glyph: 'fork' },
        { x: 150, y: 142, color: '#6E4A6B', glyph: 'pencil' },
        { x: 65, y: 78, color: '#C4502D', glyph: 'racket' },
        { x: 220, y: 128, color: '#5B7A85', glyph: 'chess' },
        { x: 310, y: 132, color: '#9A4A5A', glyph: 'note' },
        { x: 45, y: 130, color: '#C4502D', glyph: 'pint' },
        { x: 270, y: 32, color: '#7C8F6B', glyph: 'wave' },
        { x: 130, y: 95, color: '#A85C3C', glyph: 'camera' },
      ].slice(0, pinCount).map((p, i) => (
        <MapPin key={i} {...p} />
      ))}
      {/* You — small disc */}
      <g>
        <circle cx="160" cy="162" r="8" fill="#3478F6" opacity="0.18" />
        <circle cx="160" cy="162" r="4" fill="#3478F6" stroke="#fff" strokeWidth="1.6" />
      </g>
    </svg>
  );
}

// ─────────────────────────────────────────────────────────────
// Avatars
// ─────────────────────────────────────────────────────────────
function AvatarDot({ size = 24, letter = 'A', tone = 'sage', stack = false }) {
  const tones = {
    sage: '#7C8F6B', ochre: '#C68A2B', plum: '#6E4A6B',
    accent: '#C4502D', berry: '#9A4A5A', slate: '#5B7A85',
    rust: '#A85C3C',
  };
  return (
    <div style={{
      width: size, height: size, borderRadius: '50%',
      background: tones[tone],
      color: '#FFFCF5',
      display: 'flex', alignItems: 'center', justifyContent: 'center',
      fontFamily: 'var(--sans)',
      fontWeight: 600,
      fontSize: size * 0.4,
      border: stack ? '2px solid var(--paper-lift, #FBF6EC)' : 'none',
      flexShrink: 0,
    }}>{letter}</div>
  );
}

function AvatarStack({ avatars = [], size = 24 }) {
  return (
    <div style={{ display: 'flex', alignItems: 'center' }}>
      {avatars.map((a, i) => (
        <div key={i} style={{ marginLeft: i === 0 ? 0 : -size * 0.32 }}>
          <AvatarDot size={size} letter={a.letter} tone={a.tone} stack />
        </div>
      ))}
    </div>
  );
}

// ─────────────────────────────────────────────────────────────
// 1) Welcome screen
// ─────────────────────────────────────────────────────────────
function WelcomeScreen() {
  return (
    <div style={{ ...screenBg, height: '100%', display: 'flex', flexDirection: 'column', padding: '64px 28px 32px' }}>
      <div style={{ paddingTop: 8 }}>
        <LogoWordmark size={28} color="var(--ink)" />
      </div>
      <div style={{ flex: 1, display: 'flex', flexDirection: 'column', justifyContent: 'center' }}>
        <div style={{
          fontFamily: 'var(--display)',
          fontWeight: 700,
          fontVariationSettings: '"opsz" 144, "SOFT" 60',
          fontSize: 44,
          lineHeight: 1.02,
          letterSpacing: -0.6,
          color: 'var(--ink)',
          textTransform: 'lowercase',
        }}>
          find{' '}
          <span style={{ position: 'relative', display: 'inline-block' }}>
            your people
            <svg width="100%" height="10" viewBox="0 0 220 10" preserveAspectRatio="none" style={{ position: 'absolute', left: 0, bottom: -4, color: 'var(--accent)' }}>
              <path d="M2 6 Q 60 1, 110 5 T 218 4" stroke="currentColor" strokeWidth="3" fill="none" strokeLinecap="round" />
            </svg>
          </span>
          {'\n'}through<br />what you love.
        </div>
        <div style={{
          marginTop: 24,
          fontFamily: 'var(--sans)',
          fontSize: 14,
          lineHeight: 1.55,
          color: 'var(--ink-2, #5B4B3D)',
        }}>
          pickup hoops, board game nights, life-drawing, salsa class — anything you're into, with people nearby.
        </div>
      </div>
      <div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
        <button style={{
          width: '100%', padding: '14px 18px', borderRadius: 999,
          border: '1px solid var(--border, #E2D7C2)',
          background: 'var(--paper-lift, #FBF6EC)',
          fontFamily: 'var(--sans)',
          fontSize: 14,
          fontWeight: 600,
          color: 'var(--ink)',
          display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 10,
          cursor: 'pointer',
        }}>
          <svg width="16" height="16" viewBox="0 0 48 48">
            <path fill="#4285F4" d="M45.12 24.5c0-1.56-.14-3.06-.4-4.5H24v8.51h11.84c-.51 2.75-2.06 5.08-4.39 6.64v5.52h7.11c4.16-3.83 6.56-9.47 6.56-16.17z"/>
            <path fill="#34A853" d="M24 46c5.94 0 10.92-1.97 14.56-5.33l-7.11-5.52c-1.97 1.32-4.49 2.1-7.45 2.1-5.73 0-10.58-3.87-12.31-9.07H4.34v5.7C7.96 41.07 15.4 46 24 46z"/>
            <path fill="#FBBC05" d="M11.69 28.18C11.25 26.86 11 25.45 11 24s.25-2.86.69-4.18v-5.7H4.34C2.85 17.09 2 20.45 2 24c0 3.55.85 6.91 2.34 9.88l7.35-5.7z"/>
            <path fill="#EA4335" d="M24 10.75c3.23 0 6.13 1.11 8.41 3.29l6.31-6.31C34.91 4.18 29.93 2 24 2 15.4 2 7.96 6.93 4.34 14.12l7.35 5.7c1.73-5.2 6.58-9.07 12.31-9.07z"/>
          </svg>
          continue with google
        </button>
        <button style={{
          width: '100%', padding: '14px 18px', borderRadius: 999,
          border: 'none',
          background: 'var(--ink)',
          fontFamily: 'var(--sans)',
          fontSize: 14,
          fontWeight: 600,
          color: 'var(--paper)',
          cursor: 'pointer',
        }}>sign up with email</button>
        <div style={{
          textAlign: 'center', marginTop: 4,
          fontFamily: 'var(--sans)',
          fontSize: 13,
          color: 'var(--ink-2, #5B4B3D)',
        }}>
          already in? <span style={{ fontWeight: 700, color: 'var(--ink)' }}>sign in →</span>
        </div>
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────
// 2) Explore screen (the hero)
// ─────────────────────────────────────────────────────────────
function ExploreScreen({ neighborhood = 'belsize park' }) {
  return (
    <div style={{ ...screenBg, height: '100%', position: 'relative', paddingTop: 0 }}>
      <ScreenTopBar neighborhood={neighborhood} />
      {/* Map */}
      <div style={{
        margin: '4px 16px 16px',
        borderRadius: 18,
        overflow: 'hidden',
        border: '1px solid var(--border, #E2D7C2)',
        position: 'relative',
      }}>
        <FauxMap width="100%" height={196} />
        {/* count chip */}
        <div style={{
          position: 'absolute', top: 12, left: 12,
          display: 'flex', alignItems: 'center', gap: 6,
          background: 'var(--paper-lift, #FBF6EC)',
          padding: '6px 10px', borderRadius: 999,
          border: '1px solid var(--border, #E2D7C2)',
          fontFamily: 'var(--sans)', fontSize: 11, fontWeight: 700,
          color: 'var(--ink)',
          boxShadow: '0 4px 12px rgba(26,20,15,0.06)',
        }}>
          <div style={{ width: 6, height: 6, borderRadius: '50%', background: 'var(--accent)' }} />
          27 nearby
        </div>
        {/* expand */}
        <div style={{
          position: 'absolute', top: 12, right: 12,
          width: 28, height: 28, borderRadius: 8,
          background: 'var(--paper-lift, #FBF6EC)',
          border: '1px solid var(--border, #E2D7C2)',
          display: 'flex', alignItems: 'center', justifyContent: 'center',
        }}>
          <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.2">
            <path d="M4 14v6h6M20 10V4h-6"/>
          </svg>
        </div>
      </div>

      {/* What you're into */}
      <div style={{ padding: '0 20px', marginBottom: 10 }}>
        <Eyebrow>WHAT YOU'RE INTO</Eyebrow>
      </div>

      <FeaturedCard />

      {/* Also happening */}
      <div style={{
        marginTop: 16, paddingTop: 14,
        borderTop: '1px solid var(--divider, #EBE1CD)',
      }}>
        <div style={{ padding: '0 20px', marginBottom: 8 }}>
          <Eyebrow>ALSO HAPPENING</Eyebrow>
        </div>
        <MiniEventRow
          dot="ochre"
          title="catan night @ the holly bush"
          meta="games · hampstead · 0.4mi"
          when="tonight 7pm"
          letter="J"
          tone="ochre"
        />
        <MiniEventRow
          dot="sage"
          title="sunrise run @ the heath"
          meta="sports · hampstead · 0.7mi"
          when="wed 6am"
          letter="M"
          tone="sage"
        />
        <MiniEventRow
          dot="plum"
          title="life drawing class"
          meta="arts · fitzrovia · 2.3mi"
          when="thu 7pm"
          letter="A"
          tone="plum"
        />
      </div>

      <div style={{ height: 100 }} />

      <ScreenTabBar active="explore" />
    </div>
  );
}

function FeaturedCard() {
  return (
    <div style={{
      margin: '0 20px',
      background: 'var(--paper-lift, #FBF6EC)',
      border: '1px solid var(--border, #E2D7C2)',
      borderRadius: 16,
      overflow: 'hidden',
      boxShadow: '0 2px 8px rgba(26,20,15,0.04)',
    }}>
      {/* Image / swatch */}
      <div style={{
        position: 'relative', height: 130,
        background: 'linear-gradient(135deg, #C4502D 0%, #A85C3C 100%)',
        overflow: 'hidden',
      }}>
        {/* Halftone dots */}
        <div style={{
          position: 'absolute', top: -60, right: -40,
          width: 220, height: 220, borderRadius: '50%',
          background: 'rgba(255,255,255,0.1)',
        }} />
        <div style={{
          position: 'absolute', bottom: -80, left: -40,
          width: 260, height: 260, borderRadius: '50%',
          background: 'rgba(255,255,255,0.08)',
        }} />
        {/* Basketball icon centered */}
        <div style={{
          position: 'absolute', inset: 0,
          display: 'flex', alignItems: 'center', justifyContent: 'center',
          opacity: 0.35,
        }}>
          <svg width="68" height="68" viewBox="0 0 24 24" fill="none" stroke="#fff" strokeWidth="1.5">
            <circle cx="12" cy="12" r="10"/>
            <path d="M5 5l14 14M19 5L5 19M12 2v20M2 12h20"/>
          </svg>
        </div>
        {/* time pill */}
        <div style={{
          position: 'absolute', bottom: 12, left: 14,
          background: 'var(--ink)',
          color: '#FFFCF5',
          padding: '5px 10px',
          fontFamily: 'var(--sans)',
          fontSize: 11,
          fontWeight: 700,
          letterSpacing: 0.4,
          borderRadius: 3,
        }}>tonight 7pm</div>
      </div>
      {/* Body */}
      <div style={{ padding: 18 }}>
        <div style={{
          fontFamily: 'var(--display)',
          fontWeight: 700,
          fontVariationSettings: '"opsz" 144, "SOFT" 60',
          fontSize: 24,
          lineHeight: 1.08,
          letterSpacing: -0.4,
          color: 'var(--ink)',
        }}>pickup hoops</div>
        <div style={{
          display: 'flex', alignItems: 'center', gap: 6, marginTop: 6,
          fontFamily: 'var(--sans)',
          fontSize: 12,
          color: 'var(--ink-2, #5B4B3D)',
        }}>
          <div style={{ width: 6, height: 6, borderRadius: '50%', background: 'var(--accent)' }} />
          sports · belsize park · 0.2mi away
        </div>
        {/* attendees */}
        <div style={{ display: 'flex', alignItems: 'center', gap: 8, marginTop: 12 }}>
          <AvatarStack avatars={[
            { letter: 'S', tone: 'sage' },
            { letter: 'A', tone: 'ochre' },
            { letter: 'J', tone: 'plum' },
          ]} size={22} />
          <div style={{ fontSize: 12, color: 'var(--ink-2, #5B4B3D)' }}>7 are in</div>
        </div>
        {/* CTA row */}
        <div style={{
          display: 'flex', alignItems: 'center', justifyContent: 'flex-end', gap: 6,
          marginTop: 14,
        }}>
          <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="var(--accent)" strokeWidth="1.6" strokeLinecap="round" style={{ transform: 'rotate(-12deg)' }}>
            <path d="M5 12h12m0 0l-4-4m4 4l-4 4" />
          </svg>
          <div style={{
            background: 'var(--accent)',
            color: 'var(--on-accent)',
            padding: '8px 18px',
            borderRadius: 999,
            fontFamily: 'var(--sans)',
            fontSize: 13,
            fontWeight: 700,
            letterSpacing: 0.1,
          }}>I'm in</div>
        </div>
      </div>
    </div>
  );
}

function MiniEventRow({ dot, title, meta, when, letter, tone }) {
  const tones = {
    sage: '#7C8F6B', ochre: '#C68A2B', plum: '#6E4A6B',
    accent: '#C4502D', berry: '#9A4A5A',
  };
  return (
    <div style={{
      display: 'flex', alignItems: 'center', gap: 12,
      padding: '12px 20px',
      borderBottom: '1px solid var(--divider, #EBE1CD)',
    }}>
      <AvatarDot size={36} letter={letter} tone={tone} />
      <div style={{ flex: 1, minWidth: 0 }}>
        <div style={{
          fontFamily: 'var(--sans)',
          fontSize: 14,
          fontWeight: 600,
          color: 'var(--ink)',
          whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis',
          letterSpacing: -0.1,
        }}>{title}</div>
        <div style={{
          display: 'flex', alignItems: 'center', gap: 6, marginTop: 2,
          fontFamily: 'var(--sans)',
          fontSize: 11.5,
          color: 'var(--ink-2, #5B4B3D)',
        }}>
          <div style={{ width: 5, height: 5, borderRadius: '50%', background: tones[dot] }} />
          {meta}
        </div>
      </div>
      <div style={{
        fontFamily: 'var(--sans)',
        fontSize: 11,
        fontWeight: 700,
        color: 'var(--ink)',
        textAlign: 'right',
        letterSpacing: 0.2,
      }}>{when}</div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────
// 3) Event Detail
// ─────────────────────────────────────────────────────────────
function EventDetailScreen() {
  return (
    <div style={{ ...screenBg, height: '100%', position: 'relative', overflow: 'hidden' }}>
      {/* Hero image */}
      <div style={{
        position: 'relative',
        height: 280,
        background: 'linear-gradient(135deg, #6E4A6B 0%, #9A4A5A 100%)',
        overflow: 'hidden',
      }}>
        <div style={{ position: 'absolute', top: -80, right: -50, width: 280, height: 280, borderRadius: '50%', background: 'rgba(255,255,255,0.08)' }} />
        <div style={{ position: 'absolute', bottom: -100, left: -60, width: 300, height: 300, borderRadius: '50%', background: 'rgba(255,255,255,0.07)' }} />
        <div style={{ position: 'absolute', inset: 0, display: 'flex', alignItems: 'center', justifyContent: 'center', opacity: 0.4 }}>
          <svg width="80" height="80" viewBox="0 0 24 24" fill="none" stroke="#fff" strokeWidth="1.2">
            <path d="M4 19h16M4 19V8l8-5 8 5v11M9 14h6M9 17h6"/>
          </svg>
        </div>
        {/* Back */}
        <div style={{
          position: 'absolute', top: 50, left: 16,
          width: 36, height: 36, borderRadius: '50%',
          background: 'rgba(255,252,245,0.92)',
          display: 'flex', alignItems: 'center', justifyContent: 'center',
        }}>
          <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round">
            <path d="M15 18l-6-6 6-6"/>
          </svg>
        </div>
        {/* Save */}
        <div style={{
          position: 'absolute', top: 50, right: 16,
          width: 36, height: 36, borderRadius: '50%',
          background: 'rgba(255,252,245,0.92)',
          display: 'flex', alignItems: 'center', justifyContent: 'center',
        }}>
          <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
            <path d="M19 21l-7-5-7 5V5a2 2 0 012-2h10a2 2 0 012 2z"/>
          </svg>
        </div>
        {/* Eyebrow */}
        <div style={{
          position: 'absolute', bottom: 22, left: 20,
          color: '#FFFCF5',
          fontFamily: 'var(--sans)',
          fontSize: 10,
          fontWeight: 700,
          letterSpacing: '0.16em',
          whiteSpace: 'nowrap',
        }}>● ARTS · BLOOMSBURY</div>
      </div>
      {/* Sheet */}
      <div style={{
        position: 'relative',
        marginTop: -16,
        background: 'var(--paper)',
        borderTopLeftRadius: 20,
        borderTopRightRadius: 20,
        padding: '24px 22px',
      }}>
        <div style={{
          fontFamily: 'var(--display)',
          fontWeight: 700,
          fontVariationSettings: '"opsz" 144, "SOFT" 60',
          fontSize: 30,
          lineHeight: 1.04,
          letterSpacing: -0.5,
          color: 'var(--ink)',
          textTransform: 'lowercase',
        }}>life drawing class</div>
        {/* Host row */}
        <div style={{ display: 'flex', alignItems: 'center', gap: 10, marginTop: 16 }}>
          <AvatarDot size={36} letter="A" tone="plum" />
          <div style={{ flex: 1 }}>
            <div style={{ fontSize: 13, fontWeight: 700, color: 'var(--ink)' }}>amaal hosts</div>
            <div style={{ fontSize: 11.5, color: 'var(--ink-2, #5B4B3D)' }}>5 events · usually on thursdays</div>
          </div>
          <div style={{
            padding: '6px 14px',
            borderRadius: 999,
            border: '1px solid var(--border, #E2D7C2)',
            fontSize: 11.5, fontWeight: 600, color: 'var(--ink)',
          }}>say hi</div>
        </div>
        {/* Meta rows */}
        <div style={{
          marginTop: 18,
          display: 'flex', flexDirection: 'column', gap: 14,
        }}>
          <DetailRow icon="time" primary="thursday, 7:00 – 9:00pm" secondary="weekly · skip a week anytime" />
          <DetailRow icon="pin" primary="fitzroy square studio" secondary="fitzrovia · 1.8mi · 5 min walk from goodge st" />
          <DetailRow icon="users" primary="9 of 14 in" secondary="warm group · most come solo · all levels" />
        </div>
        {/* Going avatars */}
        <div style={{
          marginTop: 18, paddingTop: 16,
          borderTop: '1px solid var(--divider, #EBE1CD)',
          display: 'flex', alignItems: 'center', gap: 10,
        }}>
          <AvatarStack avatars={[
            { letter: 'S', tone: 'sage' },
            { letter: 'M', tone: 'ochre' },
            { letter: 'P', tone: 'rust' },
            { letter: 'N', tone: 'slate' },
          ]} size={28} />
          <div style={{ fontSize: 12.5, color: 'var(--ink-2, #5B4B3D)' }}>
            sam, mira & 7 others. <span style={{ color: 'var(--accent)', fontWeight: 600 }}>2 friends going</span>
          </div>
        </div>
      </div>
      {/* CTA pinned */}
      <div style={{
        position: 'absolute', bottom: 0, left: 0, right: 0,
        padding: '12px 20px 28px',
        background: 'linear-gradient(to top, var(--paper) 70%, transparent)',
      }}>
        <div style={{
          background: 'var(--accent)',
          color: 'var(--on-accent)',
          padding: '14px 18px',
          borderRadius: 999,
          fontFamily: 'var(--sans)',
          fontSize: 15,
          fontWeight: 700,
          textAlign: 'center',
          boxShadow: '0 8px 20px rgba(196,80,45,0.32)',
        }}>I'm in — see you thursday</div>
      </div>
    </div>
  );
}

function DetailRow({ icon, primary, secondary }) {
  const icons = {
    time: <circle cx="12" cy="12" r="9" />,
    pin: <path d="M12 2C8 2 5 5 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-4-3-7-7-7zm0 9.5a2.5 2.5 0 110-5 2.5 2.5 0 010 5z" fill="currentColor" stroke="none" />,
    users: <path d="M16 11a4 4 0 100-8 4 4 0 000 8zm0 2c-4 0-8 2-8 6v2h16v-2c0-4-4-6-8-6zM6 8a3 3 0 100-6 3 3 0 000 6z" fill="currentColor" stroke="none" />,
  };
  return (
    <div style={{ display: 'flex', alignItems: 'flex-start', gap: 12 }}>
      <div style={{
        width: 30, height: 30, borderRadius: 999,
        background: 'var(--accent-soft, #F4DACE)',
        display: 'flex', alignItems: 'center', justifyContent: 'center',
        color: 'var(--accent)',
        flexShrink: 0,
      }}>
        <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
          {icon === 'time' ? <><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></> : icons[icon]}
        </svg>
      </div>
      <div style={{ flex: 1, paddingTop: 2 }}>
        <div style={{ fontSize: 13.5, fontWeight: 600, color: 'var(--ink)' }}>{primary}</div>
        <div style={{ fontSize: 11.5, color: 'var(--ink-2, #5B4B3D)', marginTop: 2 }}>{secondary}</div>
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────
// 4) Chat screen
// ─────────────────────────────────────────────────────────────
function ChatScreen() {
  return (
    <div style={{ ...screenBg, height: '100%', position: 'relative', paddingTop: 0, display: 'flex', flexDirection: 'column' }}>
      {/* Header */}
      <div style={{
        display: 'flex', alignItems: 'center', gap: 12,
        padding: '14px 20px 14px',
        borderBottom: '1px solid var(--divider, #EBE1CD)',
      }}>
        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round">
          <path d="M15 18l-6-6 6-6"/>
        </svg>
        <div style={{ flex: 1, minWidth: 0 }}>
          <div style={{
            fontFamily: 'var(--display)',
            fontWeight: 700,
            fontVariationSettings: '"opsz" 144, "SOFT" 60',
            fontSize: 18,
            color: 'var(--ink)',
            letterSpacing: -0.2,
            whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis',
          }}>pickup hoops</div>
          <div style={{ fontSize: 11, color: 'var(--ink-2, #5B4B3D)' }}>
            7 in · tonight 7pm · belsize park
          </div>
        </div>
        <AvatarStack avatars={[
          { letter: 'S', tone: 'sage' },
          { letter: 'A', tone: 'ochre' },
          { letter: 'J', tone: 'plum' },
        ]} size={24} />
      </div>
      {/* Day separator */}
      <div style={{
        textAlign: 'center', padding: '14px 0 6px',
        fontSize: 10, fontWeight: 700,
        color: 'var(--ink-3, #8E7C68)',
        letterSpacing: '0.18em',
        textTransform: 'uppercase',
      }}>· today ·</div>
      {/* Messages */}
      <div style={{ flex: 1, padding: '6px 16px 12px', display: 'flex', flexDirection: 'column', gap: 8, overflow: 'auto' }}>
        <ChatBubble from="sam" tone="sage" message="warming up at 6:45 — courts are dry, we're good." time="5:12pm" />
        <ChatBubble from="ade" tone="ochre" message="bringing a friend, that ok?" time="5:18pm" />
        <ChatBubble self message="of course — court fits 10!" time="5:20pm" />
        <ChatBubble self message="i'll grab some waters on the way" time="5:20pm" />
        <ChatBubble from="jo" tone="plum" message="legend. running 5 late though" time="5:34pm" />
        <ChatBubble from="mira" tone="rust" message="omw 🙏" time="6:48pm" />
        <SystemMessage>liv joined</SystemMessage>
        <ChatBubble from="liv" tone="berry" message="hi! first time playing here, anything I should know?" time="6:52pm" />
      </div>
      {/* Input */}
      <div style={{
        padding: '10px 16px 18px',
        borderTop: '1px solid var(--divider, #EBE1CD)',
        background: 'var(--paper-lift, #FBF6EC)',
        display: 'flex', alignItems: 'center', gap: 10,
      }}>
        <div style={{ width: 28, height: 28, borderRadius: '50%', background: 'var(--paper-recess, #EFE7D7)', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
          <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round">
            <line x1="12" y1="5" x2="12" y2="19"/>
            <line x1="5" y1="12" x2="19" y2="12"/>
          </svg>
        </div>
        <div style={{
          flex: 1,
          padding: '10px 14px',
          background: 'var(--paper)',
          borderRadius: 999,
          border: '1px solid var(--border, #E2D7C2)',
          fontSize: 13,
          color: 'var(--ink-3, #8E7C68)',
        }}>say something nice…</div>
        <div style={{
          width: 32, height: 32, borderRadius: '50%',
          background: 'var(--accent)',
          color: 'var(--on-accent)',
          display: 'flex', alignItems: 'center', justifyContent: 'center',
        }}>
          <svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor">
            <path d="M2 12l20-9-4 20-7-7-9-4z"/>
          </svg>
        </div>
      </div>
    </div>
  );
}

function ChatBubble({ from, tone, message, time, self }) {
  if (self) {
    return (
      <div style={{ display: 'flex', justifyContent: 'flex-end', gap: 6, alignItems: 'flex-end' }}>
        <div style={{ fontSize: 10, color: 'var(--ink-3, #8E7C68)' }}>{time}</div>
        <div style={{
          maxWidth: '70%',
          padding: '8px 14px',
          background: 'var(--ink)',
          color: 'var(--paper)',
          borderRadius: '18px 18px 4px 18px',
          fontSize: 13.5,
          lineHeight: 1.42,
        }}>{message}</div>
      </div>
    );
  }
  return (
    <div style={{ display: 'flex', gap: 8, alignItems: 'flex-end' }}>
      <AvatarDot size={26} letter={from[0].toUpperCase()} tone={tone} />
      <div style={{ maxWidth: '72%' }}>
        <div style={{ fontSize: 10, fontWeight: 700, color: 'var(--ink-2, #5B4B3D)', marginBottom: 3, marginLeft: 4 }}>{from}</div>
        <div style={{
          padding: '8px 14px',
          background: 'var(--paper-lift, #FBF6EC)',
          border: '1px solid var(--border, #E2D7C2)',
          color: 'var(--ink)',
          borderRadius: '4px 18px 18px 18px',
          fontSize: 13.5,
          lineHeight: 1.42,
        }}>{message}</div>
      </div>
      <div style={{ fontSize: 10, color: 'var(--ink-3, #8E7C68)' }}>{time}</div>
    </div>
  );
}

function SystemMessage({ children }) {
  return (
    <div style={{
      textAlign: 'center',
      padding: '6px 0',
      fontSize: 10.5,
      color: 'var(--ink-3, #8E7C68)',
      fontStyle: 'italic',
      fontFamily: 'var(--display)',
      fontVariationSettings: '"opsz" 144, "SOFT" 100',
    }}>{children}</div>
  );
}

// ─────────────────────────────────────────────────────────────
// 5) Profile screen
// ─────────────────────────────────────────────────────────────
function ProfileScreen() {
  return (
    <div style={{ ...screenBg, height: '100%', position: 'relative', paddingTop: 0, overflow: 'auto' }}>
      <div style={{
        display: 'flex', alignItems: 'center', justifyContent: 'space-between',
        padding: '14px 20px 8px',
      }}>
        <LogoWordmark size={22} color="var(--ink)" />
        <div style={{
          width: 32, height: 32, borderRadius: 999,
          background: 'var(--paper-lift, #FBF6EC)',
          border: '1px solid var(--border, #E2D7C2)',
          display: 'flex', alignItems: 'center', justifyContent: 'center',
        }}>
          <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.2" strokeLinecap="round">
            <circle cx="12" cy="12" r="3"/>
            <path d="M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 11-2.83 2.83l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 11-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 11-2.83-2.83l.06-.06a1.65 1.65 0 00.33-1.82 1.65 1.65 0 00-1.51-1H3a2 2 0 110-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 112.83-2.83l.06.06a1.65 1.65 0 001.82.33H9a1.65 1.65 0 001-1.51V3a2 2 0 114 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 112.83 2.83l-.06.06a1.65 1.65 0 00-.33 1.82V9a1.65 1.65 0 001.51 1H21a2 2 0 110 4h-.09a1.65 1.65 0 00-1.51 1z"/>
          </svg>
        </div>
      </div>

      {/* Identity */}
      <div style={{ padding: '24px 22px 12px', display: 'flex', flexDirection: 'column', alignItems: 'flex-start', gap: 14 }}>
        <div style={{
          width: 76, height: 76, borderRadius: '50%',
          background: 'linear-gradient(135deg, #C68A2B 0%, #C4502D 100%)',
          color: '#FFFCF5',
          display: 'flex', alignItems: 'center', justifyContent: 'center',
          fontFamily: 'var(--display)',
          fontWeight: 700,
          fontSize: 32,
          fontVariationSettings: '"opsz" 144, "SOFT" 60',
        }}>R</div>
        <div style={{ width: '100%' }}>
          <div style={{
            fontFamily: 'var(--display)',
            fontWeight: 700,
            fontSize: 26,
            lineHeight: 1.05,
            letterSpacing: -0.4,
            color: 'var(--ink)',
            fontVariationSettings: '"opsz" 144, "SOFT" 60',
            textTransform: 'lowercase',
          }}>rae nightingale</div>
          <div style={{ fontSize: 12, color: 'var(--ink-2, #5B4B3D)', marginTop: 4 }}>
            belsize park · joined apr 2026
          </div>
        </div>
        <div style={{
          fontFamily: 'var(--display)',
          fontVariationSettings: '"opsz" 144, "SOFT" 100',
          fontStyle: 'italic',
          fontSize: 14.5,
          lineHeight: 1.42,
          color: 'var(--ink-2, #5B4B3D)',
        }}>
          "tennis on the weekends, board games on the rainy ones, always up for a new café."
        </div>
      </div>

      {/* Stats strip */}
      <div style={{
        display: 'flex',
        margin: '18px 20px',
        border: '1px solid var(--border, #E2D7C2)',
        borderRadius: 14,
        background: 'var(--paper-lift, #FBF6EC)',
        overflow: 'hidden',
      }}>
        {[
          { num: '42', label: 'gone to' },
          { num: '11', label: 'hosted' },
          { num: '28', label: 'friends' },
        ].map((s, i) => (
          <div key={i} style={{
            flex: 1, padding: '14px 8px', textAlign: 'center',
            borderLeft: i > 0 ? '1px solid var(--divider, #EBE1CD)' : 'none',
          }}>
            <div style={{
              fontFamily: 'var(--display)', fontWeight: 700,
              fontVariationSettings: '"opsz" 144, "SOFT" 60',
              fontSize: 24, color: 'var(--accent)',
            }}>{s.num}</div>
            <div style={{ fontSize: 10.5, color: 'var(--ink-3, #8E7C68)', letterSpacing: 0.4, textTransform: 'uppercase', marginTop: 2, fontWeight: 600 }}>{s.label}</div>
          </div>
        ))}
      </div>

      {/* Into */}
      <div style={{ padding: '10px 20px 0' }}>
        <Eyebrow>WHAT I'M INTO</Eyebrow>
        <div style={{ display: 'flex', flexWrap: 'wrap', gap: 6, marginTop: 12 }}>
          {[
            ['tennis', 'accent'], ['catan', 'ochre'], ['life drawing', 'plum'],
            ['sourdough', 'rust'], ['salsa', 'berry'], ['easy run', 'sage'],
            ['poker', 'slate'], ['stargazing', 'plum'], ['+12 more', 'mute'],
          ].map(([label, tone], i) => (
            <div key={i} style={{
              padding: '7px 12px',
              borderRadius: 999,
              background: tone === 'mute' ? 'transparent' : 'var(--paper-lift, #FBF6EC)',
              border: '1px solid var(--border, #E2D7C2)',
              fontSize: 12,
              fontWeight: 500,
              color: tone === 'mute' ? 'var(--ink-3, #8E7C68)' : 'var(--ink)',
              display: 'inline-flex', alignItems: 'center', gap: 6,
            }}>
              {tone !== 'mute' && (
                <div style={{ width: 6, height: 6, borderRadius: '50%', background: { accent: '#C4502D', ochre: '#C68A2B', plum: '#6E4A6B', rust: '#A85C3C', berry: '#9A4A5A', sage: '#7C8F6B', slate: '#5B7A85' }[tone] }} />
              )}
              {label}
            </div>
          ))}
        </div>
      </div>

      <div style={{ height: 120 }} />
      <ScreenTabBar active="profile" />
    </div>
  );
}

// ─────────────────────────────────────────────────────────────
// 6) Onboarding — pick activities
// ─────────────────────────────────────────────────────────────
function OnboardingScreen() {
  const groups = [
    { name: 'sports', tone: 'accent', items: ['tennis', 'football', 'basketball', 'climbing', 'running', 'cycling'] },
    { name: 'games',  tone: 'ochre',  items: ['catan', 'chess', 'codenames', 'dnd', 'poker'] },
    { name: 'outdoor', tone: 'sage',  items: ['hiking', 'swimming', 'picnics'] },
    { name: 'arts',   tone: 'plum',   items: ['life drawing', 'pottery', 'photography'] },
    { name: 'food',   tone: 'rust',   items: ['supper clubs', 'wine tasting'] },
  ];
  return (
    <div style={{ ...screenBg, height: '100%', position: 'relative', display: 'flex', flexDirection: 'column', paddingTop: 0 }}>
      <div style={{ padding: '14px 20px 0', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
        <div style={{ fontSize: 11.5, fontWeight: 600, color: 'var(--ink-2, #5B4B3D)' }}>step 2 of 3</div>
        <div style={{ fontSize: 11.5, fontWeight: 600, color: 'var(--accent)' }}>skip →</div>
      </div>
      <div style={{ padding: '18px 24px 6px' }}>
        <div style={{
          fontFamily: 'var(--display)',
          fontWeight: 700,
          fontVariationSettings: '"opsz" 144, "SOFT" 60',
          fontSize: 32,
          lineHeight: 1.04,
          letterSpacing: -0.5,
          color: 'var(--ink)',
          textTransform: 'lowercase',
        }}>what are you{' '}
          <span style={{ position: 'relative', display: 'inline-block' }}>
            into?
            <svg width="100%" height="9" viewBox="0 0 80 9" preserveAspectRatio="none" style={{ position: 'absolute', left: 0, bottom: -4, color: 'var(--accent)' }}>
              <path d="M2 5 Q 20 1, 40 4 T 78 4" stroke="currentColor" strokeWidth="3" fill="none" strokeLinecap="round"/>
            </svg>
          </span>
        </div>
        <div style={{ fontSize: 13, lineHeight: 1.5, color: 'var(--ink-2, #5B4B3D)', marginTop: 10 }}>
          pick whatever sounds like you. tap a category to see more — we'll surface events that match.
        </div>
      </div>
      <div style={{ flex: 1, overflow: 'auto', padding: '14px 20px 110px' }}>
        {groups.map(g => (
          <div key={g.name} style={{ marginTop: 18 }}>
            <div style={{
              display: 'flex', alignItems: 'center', gap: 8,
              fontFamily: 'var(--sans)',
              fontSize: 11, fontWeight: 700,
              letterSpacing: '0.16em', textTransform: 'uppercase',
              color: 'var(--ink-2, #5B4B3D)',
              marginBottom: 10,
            }}>
              <div style={{ width: 8, height: 8, borderRadius: '50%', background: { accent: '#C4502D', ochre: '#C68A2B', sage: '#7C8F6B', plum: '#6E4A6B', rust: '#A85C3C' }[g.tone] }} />
              {g.name}
            </div>
            <div style={{ display: 'flex', flexWrap: 'wrap', gap: 6 }}>
              {g.items.map((it, i) => {
                const picked = (g.name === 'sports' && (it === 'tennis' || it === 'running')) || (g.name === 'games' && it === 'catan') || (g.name === 'arts' && it === 'life drawing');
                return (
                  <div key={it} style={{
                    padding: '8px 14px',
                    borderRadius: 999,
                    background: picked ? 'var(--accent)' : 'var(--paper-lift, #FBF6EC)',
                    color: picked ? 'var(--on-accent)' : 'var(--ink)',
                    border: '1px solid ' + (picked ? 'var(--accent)' : 'var(--border, #E2D7C2)'),
                    fontSize: 13,
                    fontWeight: 500,
                  }}>{it}{picked ? ' ✓' : ''}</div>
                );
              })}
            </div>
          </div>
        ))}
      </div>
      <div style={{
        position: 'absolute', bottom: 0, left: 0, right: 0,
        padding: '14px 20px 32px',
        background: 'linear-gradient(to top, var(--paper) 70%, transparent)',
      }}>
        <div style={{ fontSize: 11.5, color: 'var(--ink-3, #8E7C68)', marginBottom: 8, textAlign: 'center' }}>4 picked · 596 more to explore</div>
        <div style={{
          background: 'var(--ink)',
          color: 'var(--paper)',
          padding: '14px 18px',
          borderRadius: 999,
          fontSize: 14,
          fontWeight: 700,
          textAlign: 'center',
        }}>continue →</div>
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────
// 7) Create Event
// ─────────────────────────────────────────────────────────────
function CreateEventScreen() {
  return (
    <div style={{ ...screenBg, height: '100%', position: 'relative', display: 'flex', flexDirection: 'column', paddingTop: 0 }}>
      <div style={{
        display: 'flex', alignItems: 'center', gap: 12,
        padding: '14px 20px 14px',
        borderBottom: '1px solid var(--divider, #EBE1CD)',
      }}>
        <div style={{ fontSize: 13, fontWeight: 600, color: 'var(--ink-2, #5B4B3D)' }}>cancel</div>
        <div style={{
          flex: 1, textAlign: 'center',
          fontFamily: 'var(--display)', fontWeight: 700,
          fontSize: 16, color: 'var(--ink)', letterSpacing: -0.1,
          fontVariationSettings: '"opsz" 144, "SOFT" 60',
        }}>plan something</div>
        <div style={{ fontSize: 13, fontWeight: 700, color: 'var(--accent)' }}>post →</div>
      </div>

      <div style={{ flex: 1, overflow: 'auto', padding: '22px 22px 120px' }}>
        <div style={{
          fontFamily: 'var(--display)',
          fontWeight: 700,
          fontVariationSettings: '"opsz" 144, "SOFT" 60',
          fontSize: 28,
          lineHeight: 1.05,
          letterSpacing: -0.4,
          color: 'var(--ink)',
          textTransform: 'lowercase',
        }}>sunday yoga in the park</div>
        <div style={{
          fontSize: 12, color: 'var(--ink-3, #8E7C68)',
          marginTop: 6, fontStyle: 'italic',
          fontFamily: 'var(--display)',
          fontVariationSettings: '"opsz" 144, "SOFT" 100',
        }}>name your event — keep it warm</div>

        <FieldBlock label="ACTIVITY" value="yoga · vinyasa" tone="sage" />
        <FieldBlock label="WHEN" value="sunday · 10:00 – 11:00am" extra="every sunday" />
        <FieldBlock label="WHERE" value="regent's park bandstand" extra="regent's park · 1.4mi from you" />
        <FieldBlock label="WHO" value="up to 25 people" extra="open · all levels welcome" />
        <FieldBlock label="A FEW WORDS" value="bring a mat. expect easy stretches, sun, and good company. we go for coffee after — optional but recommended." multi />
      </div>
    </div>
  );
}

function FieldBlock({ label, value, extra, tone, multi }) {
  return (
    <div style={{
      marginTop: 18,
      paddingTop: 14,
      borderTop: '1px solid var(--divider, #EBE1CD)',
    }}>
      <div style={{
        display: 'flex', alignItems: 'center', gap: 8,
        fontSize: 10, fontWeight: 700, color: 'var(--ink-3, #8E7C68)',
        letterSpacing: '0.18em', textTransform: 'uppercase',
        marginBottom: 10,
      }}>
        {tone && <div style={{ width: 6, height: 6, borderRadius: '50%', background: tone === 'sage' ? '#7C8F6B' : '#C4502D' }} />}
        {label}
      </div>
      <div style={{
        fontSize: multi ? 13.5 : 16,
        fontWeight: multi ? 400 : 600,
        color: 'var(--ink)',
        lineHeight: multi ? 1.55 : 1.3,
        letterSpacing: multi ? 0 : -0.2,
      }}>{value}</div>
      {extra && (
        <div style={{
          fontSize: 12, color: 'var(--ink-2, #5B4B3D)', marginTop: 4,
        }}>{extra}</div>
      )}
    </div>
  );
}

// ─────────────────────────────────────────────────────────────
// 8) Empty state — nothing matches yet → plan one
// ─────────────────────────────────────────────────────────────
function EmptyStateScreen() {
  return (
    <div style={{ ...screenBg, height: '100%', position: 'relative', paddingTop: 0, display: 'flex', flexDirection: 'column' }}>
      <ScreenTopBar neighborhood="stoke newington" />
      {/* Soft map background */}
      <div style={{
        margin: '4px 16px 16px',
        borderRadius: 18,
        overflow: 'hidden',
        border: '1px solid var(--border, #E2D7C2)',
        position: 'relative',
        opacity: 0.55,
      }}>
        <FauxMap width="100%" height={140} pinCount={0} />
        <div style={{
          position: 'absolute', inset: 0,
          background: 'linear-gradient(to bottom, transparent 30%, var(--paper) 100%)',
        }} />
        <div style={{
          position: 'absolute', top: 12, left: 12,
          display: 'flex', alignItems: 'center', gap: 6,
          background: 'var(--paper-lift, #FBF6EC)',
          padding: '6px 10px', borderRadius: 999,
          border: '1px solid var(--border, #E2D7C2)',
          fontFamily: 'var(--sans)', fontSize: 11, fontWeight: 700,
          color: 'var(--ink-2, #5B4B3D)',
        }}>
          <div style={{ width: 6, height: 6, borderRadius: '50%', background: 'var(--ink-3)' }} />
          0 nearby
        </div>
      </div>

      <div style={{ flex: 1, padding: '12px 24px 100px', display: 'flex', flexDirection: 'column', alignItems: 'center', textAlign: 'center' }}>
        {/* Hand-drawn empty illo — a sketchbook with a pencil */}
        <svg width="78" height="64" viewBox="0 0 92 80" style={{ marginBottom: 14, marginTop: 4 }}>
          <g fill="none" stroke="var(--accent)" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round">
            <path d="M14 16 L 70 14 L 72 64 L 18 66 Z" />
            <path d="M22 28 L 60 26 M 22 38 L 56 36 M 22 48 L 50 46" opacity="0.4" />
            <path d="M64 8 L 86 30 L 74 42 L 52 20 Z" fill="var(--paper)" />
            <path d="M82 18 L 88 24" />
            <path d="M52 20 L 56 24" />
          </g>
        </svg>
        <div style={{
          fontFamily: 'var(--display)',
          fontWeight: 700,
          fontVariationSettings: '"opsz" 144, "SOFT" 60',
          fontSize: 22,
          lineHeight: 1.1,
          letterSpacing: -0.3,
          color: 'var(--ink)',
          textTransform: 'lowercase',
          maxWidth: 220,
        }}>
          <div>nothing matches yet —</div>
          <div>be{' '}
            <span style={{ position: 'relative', display: 'inline-block' }}>
              the spark
              <svg width="100%" height="8" viewBox="0 0 90 8" preserveAspectRatio="none" style={{ position: 'absolute', left: 0, bottom: -3, color: 'var(--accent)' }}>
                <path d="M2 5 Q 22 1, 45 4 T 88 4" stroke="currentColor" strokeWidth="3" fill="none" strokeLinecap="round"/>
              </svg>
            </span>.
          </div>
        </div>
        <div style={{
          marginTop: 16,
          fontFamily: 'var(--sans)',
          fontSize: 12.5,
          lineHeight: 1.55,
          color: 'var(--ink-2, #5B4B3D)',
          maxWidth: 220,
        }}>
          adjust your filters, or start something — people nearby will see it.
        </div>
        <div style={{
          marginTop: 24,
          display: 'flex', flexDirection: 'column', gap: 10,
          width: '100%', maxWidth: 220,
        }}>
          <div style={{
            background: 'var(--accent)',
            color: 'var(--on-accent)',
            padding: '11px 16px',
            borderRadius: 999,
            fontSize: 13,
            fontWeight: 700,
            textAlign: 'center',
          }}>plan something →</div>
          <div style={{
            background: 'transparent',
            color: 'var(--ink)',
            padding: '11px 16px',
            borderRadius: 999,
            border: '1px solid var(--border, #E2D7C2)',
            fontSize: 13,
            fontWeight: 600,
            textAlign: 'center',
          }}>widen the radius</div>
        </div>
      </div>
      <ScreenTabBar active="explore" />
    </div>
  );
}

// ─────────────────────────────────────────────────────────────
// 9) Filter / Discover screen
// ─────────────────────────────────────────────────────────────
function FilterScreen() {
  return (
    <div style={{ ...screenBg, height: '100%', position: 'relative', paddingTop: 0, display: 'flex', flexDirection: 'column' }}>
      {/* Header */}
      <div style={{
        display: 'flex', alignItems: 'center', gap: 12,
        padding: '14px 20px 14px',
      }}>
        <div style={{ fontSize: 13, fontWeight: 600, color: 'var(--ink-2, #5B4B3D)' }}>cancel</div>
        <div style={{
          flex: 1, textAlign: 'center',
          fontFamily: 'var(--display)', fontWeight: 700,
          fontSize: 18, color: 'var(--ink)', letterSpacing: -0.2,
          fontVariationSettings: '"opsz" 144, "SOFT" 60',
        }}>filters</div>
        <div style={{ fontSize: 13, fontWeight: 700, color: 'var(--accent)' }}>reset</div>
      </div>

      <div style={{ flex: 1, overflow: 'hidden', padding: '6px 22px 22px' }}>
        {/* WHEN — segmented */}
        <Eyebrow>WHEN</Eyebrow>
        <div style={{ display: 'flex', gap: 6, marginTop: 10, marginBottom: 22 }}>
          {[
            { label: 'tonight', on: true },
            { label: 'tomorrow', on: false },
            { label: 'this week', on: false },
            { label: 'any', on: false },
          ].map((c, i) => (
            <div key={i} style={{
              flex: 1,
              padding: '9px 4px',
              borderRadius: 999,
              background: c.on ? 'var(--ink)' : 'transparent',
              border: '1px solid ' + (c.on ? 'var(--ink)' : 'var(--border, #E2D7C2)'),
              color: c.on ? 'var(--paper)' : 'var(--ink)',
              fontSize: 11.5, fontWeight: 600, textAlign: 'center',
              whiteSpace: 'nowrap',
            }}>{c.label}</div>
          ))}
        </div>

        {/* WITHIN — slider */}
        <div style={{ display: 'flex', alignItems: 'baseline', justifyContent: 'space-between' }}>
          <Eyebrow>WITHIN</Eyebrow>
          <div style={{ fontSize: 13, fontWeight: 700, color: 'var(--accent)', fontFamily: 'var(--sans)' }}>
            2.0 mi <span style={{ color: 'var(--ink-3)', fontWeight: 500 }}>· 12 min walk</span>
          </div>
        </div>
        <div style={{ position: 'relative', height: 28, marginTop: 14, marginBottom: 22 }}>
          <div style={{ position: 'absolute', top: 12, left: 0, right: 0, height: 4, borderRadius: 999, background: 'var(--paper-recess, #EFE7D7)' }} />
          <div style={{ position: 'absolute', top: 12, left: 0, width: '35%', height: 4, borderRadius: 999, background: 'var(--accent)' }} />
          <div style={{
            position: 'absolute', top: 4, left: '32%',
            width: 20, height: 20, borderRadius: '50%',
            background: 'var(--paper-lift)',
            border: '2px solid var(--accent)',
            boxShadow: '0 2px 6px rgba(196,80,45,0.32)',
          }} />
          <div style={{ position: 'absolute', top: 22, left: 0, fontSize: 10, color: 'var(--ink-3)' }}>0.5mi</div>
          <div style={{ position: 'absolute', top: 22, right: 0, fontSize: 10, color: 'var(--ink-3)' }}>10mi</div>
        </div>

        {/* CATEGORIES — chip grid */}
        <Eyebrow>CATEGORIES</Eyebrow>
        <div style={{ display: 'flex', flexWrap: 'wrap', gap: 6, marginTop: 10, marginBottom: 22 }}>
          {[
            { label: 'sports', tone: '#C4502D', on: true },
            { label: 'games', tone: '#C68A2B', on: true },
            { label: 'outdoor', tone: '#7C8F6B', on: false },
            { label: 'arts', tone: '#6E4A6B', on: true },
            { label: 'food', tone: '#A85C3C', on: false },
            { label: 'music', tone: '#9A4A5A', on: false },
            { label: 'wellness', tone: '#5B7A85', on: false },
            { label: 'learning', tone: '#7C8F6B', on: false },
          ].map((c, i) => (
            <div key={i} style={{
              display: 'inline-flex', alignItems: 'center', gap: 6,
              padding: '7px 11px',
              borderRadius: 999,
              background: c.on ? 'var(--paper-lift, #FBF6EC)' : 'transparent',
              border: '1px solid ' + (c.on ? c.tone : 'var(--border, #E2D7C2)'),
              color: c.on ? 'var(--ink)' : 'var(--ink-2, #5B4B3D)',
              fontSize: 12,
              fontWeight: c.on ? 700 : 500,
            }}>
              <div style={{ width: 6, height: 6, borderRadius: '50%', background: c.tone }} />
              {c.label}
              {c.on && <span style={{ color: c.tone, fontSize: 11 }}>✓</span>}
            </div>
          ))}
        </div>

        {/* VIBE — pill row */}
        <Eyebrow>THE VIBE</Eyebrow>
        <div style={{ display: 'flex', flexWrap: 'wrap', gap: 6, marginTop: 10 }}>
          {[
            { l: 'beginner-friendly', on: true },
            { l: 'solo-friendly', on: true },
            { l: 'small group', on: false },
            { l: 'free / low cost', on: false },
            { l: 'no booking needed', on: false },
            { l: 'outdoors', on: false },
          ].map((c, i) => (
            <div key={i} style={{
              padding: '7px 12px',
              borderRadius: 999,
              background: c.on ? 'var(--ink)' : 'transparent',
              border: '1px solid ' + (c.on ? 'var(--ink)' : 'var(--border, #E2D7C2)'),
              color: c.on ? 'var(--paper)' : 'var(--ink)',
              fontSize: 12,
              fontWeight: c.on ? 700 : 500,
            }}>{c.l}</div>
          ))}
        </div>
      </div>

      {/* Apply CTA */}
      <div style={{
        padding: '14px 20px 28px',
        background: 'linear-gradient(to top, var(--paper) 70%, transparent)',
      }}>
        <div style={{
          background: 'var(--accent)',
          color: 'var(--on-accent)',
          padding: '14px 18px',
          borderRadius: 999,
          fontFamily: 'var(--sans)',
          fontSize: 14,
          fontWeight: 700,
          textAlign: 'center',
          boxShadow: '0 8px 20px rgba(196,80,45,0.32)',
        }}>show 27 events →</div>
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────
// 10) Map detail — zoomed pin with peek sheet
// ─────────────────────────────────────────────────────────────
function MapDetailScreen() {
  return (
    <div style={{ ...screenBg, height: '100%', position: 'relative', paddingTop: 0, overflow: 'hidden' }}>
      {/* Header */}
      <div style={{
        position: 'absolute', top: 0, left: 0, right: 0,
        zIndex: 5,
        padding: '14px 16px',
        display: 'flex', alignItems: 'center', gap: 10,
      }}>
        <div style={{
          width: 38, height: 38, borderRadius: '50%',
          background: 'var(--paper-lift, #FBF6EC)',
          border: '1px solid var(--border, #E2D7C2)',
          display: 'flex', alignItems: 'center', justifyContent: 'center',
          boxShadow: '0 4px 12px rgba(26,20,15,0.08)',
        }}>
          <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round">
            <path d="M15 18l-6-6 6-6"/>
          </svg>
        </div>
        <div style={{
          flex: 1,
          padding: '10px 14px',
          background: 'var(--paper-lift, #FBF6EC)',
          border: '1px solid var(--border, #E2D7C2)',
          borderRadius: 999,
          fontSize: 12.5,
          color: 'var(--ink-2, #5B4B3D)',
          display: 'flex', alignItems: 'center', gap: 8,
          boxShadow: '0 4px 12px rgba(26,20,15,0.08)',
        }}>
          <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.4"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4-4"/></svg>
          search this area
        </div>
      </div>

      {/* Full-bleed map */}
      <div style={{ position: 'absolute', inset: 0 }}>
        <ZoomedMap />
      </div>

      {/* Peek sheet */}
      <div style={{
        position: 'absolute', left: 12, right: 12, bottom: 12,
        background: 'var(--paper)',
        borderRadius: 18,
        border: '1px solid var(--border, #E2D7C2)',
        padding: '14px 16px 14px',
        boxShadow: '0 16px 36px rgba(26,20,15,0.18)',
      }}>
        {/* handle */}
        <div style={{
          width: 40, height: 4, borderRadius: 999,
          background: 'var(--paper-recess, #EFE7D7)',
          margin: '0 auto 12px',
        }} />
        <div style={{ display: 'flex', alignItems: 'flex-start', gap: 12 }}>
          {/* glyph chip */}
          <div style={{
            width: 44, height: 44, borderRadius: 12,
            background: 'var(--accent)',
            color: 'var(--on-accent)',
            display: 'flex', alignItems: 'center', justifyContent: 'center',
            flexShrink: 0,
          }}>
            <svg width="22" height="22" viewBox="-12 -12 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round">
              <circle cx="0" cy="0" r="8"/>
              <path d="M-8 0 L 8 0 M 0 -8 L 0 8 M -6 -6 L 6 6 M -6 6 L 6 -6"/>
            </svg>
          </div>
          <div style={{ flex: 1, minWidth: 0 }}>
            <div style={{
              fontFamily: 'var(--display)', fontWeight: 700,
              fontVariationSettings: '"opsz" 144, "SOFT" 60',
              fontSize: 18, lineHeight: 1.1,
              letterSpacing: -0.2, color: 'var(--ink)',
              whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis',
            }}>pickup hoops</div>
            <div style={{ display: 'flex', alignItems: 'center', gap: 6, marginTop: 4 }}>
              <div style={{ width: 5, height: 5, borderRadius: '50%', background: 'var(--accent)' }} />
              <div style={{ fontSize: 11.5, color: 'var(--ink-2, #5B4B3D)' }}>
                belsize courts · tonight 7pm
              </div>
            </div>
            <div style={{ display: 'flex', alignItems: 'center', gap: 8, marginTop: 8 }}>
              <AvatarStack avatars={[
                { letter: 'S', tone: 'sage' },
                { letter: 'A', tone: 'ochre' },
                { letter: 'J', tone: 'plum' },
              ]} size={20} />
              <div style={{ fontSize: 11, color: 'var(--ink-2)' }}>7 in · 3 spots left</div>
            </div>
          </div>
          <div style={{
            alignSelf: 'center',
            background: 'var(--accent)',
            color: 'var(--on-accent)',
            padding: '8px 14px',
            borderRadius: 999,
            fontSize: 12,
            fontWeight: 700,
          }}>I'm in</div>
        </div>
      </div>
    </div>
  );
}

function ZoomedMap() {
  // Zoomed-in street view. viewBox sized close to a tall phone aspect so
  // content reads without slice cropping. Active pin sits in the upper-
  // middle so the peek sheet (bottom) doesn't cover it.
  return (
    <svg viewBox="0 0 270 580" width="100%" height="100%"
         preserveAspectRatio="xMidYMid slice" style={{ display: 'block' }}>
      <defs>
        <pattern id="zmap-paper-2" width="6" height="6" patternUnits="userSpaceOnUse">
          <rect width="6" height="6" fill="#EFE7D7" />
          <circle cx="2" cy="2" r="0.4" fill="#D8C9A8" opacity="0.6" />
        </pattern>
      </defs>
      {/* Paper background fills the whole map */}
      <rect width="270" height="580" fill="url(#zmap-paper-2)" />

      {/* Park — top-left blob */}
      <path d="M-20 30 Q 60 0, 140 50 Q 200 80, 200 150 Q 160 200, 80 180 Q 10 160, -20 130 Z"
            fill="#DDE3D2" opacity="0.88" />
      <text x="36" y="120" fontFamily="Fraunces, serif" fontStyle="italic" fontSize="14"
            fill="#7C8F6B" opacity="0.85">Belsize Park</text>

      {/* Water — small canal sliver bottom-right */}
      <path d="M180 540 Q 220 520, 270 520 L 270 580 L 180 580 Z"
            fill="#B7CFD8" opacity="0.5" />

      {/* Streets — denser, all clearly inside viewBox */}
      <g stroke="#D8C9A8" strokeWidth="2.8" fill="none" opacity="0.85">
        <path d="M-10 240 Q 70 232, 140 248 T 280 240" />
        <path d="M-10 370 Q 70 360, 140 378 T 280 370" />
        <path d="M-10 480 Q 70 472, 140 490 T 280 480" />
        <path d="M70 -10 Q 80 180, 110 360 T 130 600" />
        <path d="M190 -10 Q 200 180, 220 360 T 240 600" />
      </g>
      {/* Major street — thicker */}
      <g stroke="#C8B690" strokeWidth="4.5" fill="none" opacity="0.7">
        <path d="M-10 310 Q 90 300, 180 312 T 280 308" />
      </g>

      {/* Street labels */}
      <text x="14" y="236" fontFamily="Inter, sans-serif" fontSize="9"
            fill="#8E7C68" letterSpacing="0.6">HAVERSTOCK HILL</text>
      <text x="14" y="306" fontFamily="Inter, sans-serif" fontSize="9"
            fill="#8E7C68" letterSpacing="0.6" fontWeight="600">PRIMROSE HILL RD</text>
      <text x="14" y="366" fontFamily="Inter, sans-serif" fontSize="9"
            fill="#8E7C68" letterSpacing="0.6">ENGLAND'S LANE</text>
      <text x="14" y="476" fontFamily="Inter, sans-serif" fontSize="9"
            fill="#8E7C68" letterSpacing="0.6">CHALK FARM RD</text>

      {/* Building blocks — subtle */}
      <g fill="#E7DAC0" opacity="0.55">
        <rect x="14"  y="244" width="46" height="55" rx="2" />
        <rect x="72"  y="244" width="46" height="55" rx="2" />
        <rect x="14"  y="316" width="46" height="42" rx="2" />
        <rect x="14"  y="384" width="46" height="55" rx="2" />
        <rect x="200" y="384" width="60" height="55" rx="2" />
        <rect x="200" y="316" width="60" height="42" rx="2" />
      </g>

      {/* Ambient pin — basketball — top-right */}
      <g transform="translate(212 200)">
        <ellipse cx="0" cy="13" rx="6" ry="1.2" fill="#1A140F" opacity="0.18" />
        <path d="M 0 17 L -7.7 4.4 A 11 11 0 1 1 7.7 4.4 Z" fill="#C68A2B" stroke="#FBF6EC" strokeWidth="1.6" />
        <circle cx="0" cy="-4" r="4.2" fill="none" stroke="#FBF6EC" strokeWidth="1.2"/>
        <path d="M-4 -4 L 4 -4 M 0 -8 L 0 0" stroke="#FBF6EC" strokeWidth="1" fill="none"/>
      </g>

      {/* Ambient pin — board game — bottom-left */}
      <g transform="translate(48 422)">
        <ellipse cx="0" cy="13" rx="6" ry="1.2" fill="#1A140F" opacity="0.18" />
        <path d="M 0 17 L -7.7 4.4 A 11 11 0 1 1 7.7 4.4 Z" fill="#7C8F6B" stroke="#FBF6EC" strokeWidth="1.6" />
        <g transform="translate(0 -4)">
          <rect x="-3.4" y="-3.4" width="6.8" height="6.8" rx="1" fill="none" stroke="#FBF6EC" strokeWidth="1.1"/>
          <circle cx="-1.5" cy="-1.5" r="0.8" fill="#FBF6EC"/>
          <circle cx="1.5"  cy="1.5"  r="0.8" fill="#FBF6EC"/>
          <circle cx="1.5"  cy="-1.5" r="0.8" fill="#FBF6EC"/>
        </g>
      </g>

      {/* Ambient pin — coffee — middle-left */}
      <g transform="translate(34 290)">
        <ellipse cx="0" cy="13" rx="6" ry="1.2" fill="#1A140F" opacity="0.18" />
        <path d="M 0 17 L -7.7 4.4 A 11 11 0 1 1 7.7 4.4 Z" fill="#6E4A6B" stroke="#FBF6EC" strokeWidth="1.6" />
        <g transform="translate(0 -4)" stroke="#FBF6EC" strokeWidth="1.1" fill="none">
          <path d="M -3 -2 L -3 2 A 3 3 0 0 0 3 2 L 3 -2 Z" />
          <path d="M 3 -1 Q 5 -1 5 1" />
        </g>
      </g>

      {/* Active pin — tennis — middle, with pulsing halo */}
      <g transform="translate(135 318)">
        <circle r="36" fill="#C4502D" opacity="0.18">
          <animate attributeName="r" values="36;52;36" dur="2.4s" repeatCount="indefinite" />
          <animate attributeName="opacity" values="0.20;0;0.20" dur="2.4s" repeatCount="indefinite" />
        </circle>
        <circle r="22" fill="none" stroke="#C4502D" strokeWidth="1.5" opacity="0.55" />
        <ellipse cx="0" cy="20" rx="10" ry="2" fill="#1A140F" opacity="0.22" />
        <path d="M 0 26 L -11 6.5 A 16 16 0 1 1 11 6.5 Z" fill="#C4502D" stroke="#FBF6EC" strokeWidth="2.4" />
        <g transform="translate(0 -6) scale(1.4)" stroke="#FBF6EC" strokeWidth="1" fill="none" strokeLinecap="round">
          <circle cx="0" cy="0" r="4.5" />
          <path d="M -4.5 0 Q 0 -2.5 4.5 0 Q 0 2.5 -4.5 0" />
        </g>
      </g>

      {/* You — bottom-right, blue dot */}
      <g transform="translate(190 432)">
        <circle r="14" fill="#3478F6" opacity="0.18" />
        <circle r="6"  fill="#3478F6" stroke="#fff" strokeWidth="2.4" />
      </g>
    </svg>
  );
}

// CreateEventScreen already defined above — re-export

Object.assign(window, {
  WelcomeScreen, ExploreScreen, EventDetailScreen, ChatScreen, ProfileScreen,
  OnboardingScreen, CreateEventScreen,
  EmptyStateScreen, FilterScreen, MapDetailScreen,
  FauxMap, AvatarDot, AvatarStack,
});
