/* Mixly — Athletic / Nike-inspired
   Fonts (Inter, Archivo, Material Symbols Rounded) are bundled locally
   via @fontsource imports in src/main.jsx — no CDN dependency. */

.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
  font-weight: 500;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}
.sport-ms {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Inter', -apple-system, 'SF Pro Text', system-ui, sans-serif;
  background: var(--bg-1);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  transition: background-color 220ms var(--ease), color 220ms var(--ease);
}

:root {
  /* Nike-adjacent: off-black + true volt + warm ivory */
  --bg-0: #050505;
  --bg-1: #0A0A0A;
  --bg-2: #111111;
  --surface: #181818;
  --surface-2: #222222;
  --surface-3: #2E2E2E;
  /* Skeleton shimmer — base block + sweeping highlight, tuned per theme so the
     loading state reads clearly on either canvas. */
  --skel-base: #1C1C1C;
  --skel-hi: #2A2A2A;
  --line: rgba(245, 245, 243, 0.06);
  --line-2: rgba(245, 245, 243, 0.12);
  --text: #F5F5F3;
  --text-2: #A8A8A4;
  --text-3: #8A8A86;
  --accent: #CCFF00;         /* Nike Volt */
  --accent-2: #E5FF5E;
  --accent-glow: rgba(204, 255, 0, 0.22);
  /* Accent semantics — split so light mode can use black fills + a deep-green
     highlight. Dark values mirror today's behaviour (no visual change). */
  --on-accent: #0A0A0A;          /* text/icon sitting ON an accent fill */
  --accent-ink: var(--accent);   /* green highlight for text/icon/border */
  --accent-wash: rgba(204, 255, 0, 0.12); /* faint tint behind ink */
  --accent-edge: #8FB800;        /* bottom bevel under accent fills */
  --pin-fill: var(--accent);     /* fallback game-pin fill (dark glyph sits on it) */
  --success: #7BD88F;
  --warn: #FFB547;
  --error: #FF5247;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 140ms;
  --t: 240ms;
  --t-slow: 420ms;
  --display: 'Archivo', 'Inter', system-ui, sans-serif;

  /* Safe-area insets (iOS notch / home indicator / landscape) */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  /* Tabbar height + clearance — used by FAB and bottom-fade strip */
  --tabbar-h: 64px;
  --tabbar-clear: calc(var(--sab) + var(--tabbar-h) + 24px);
  /* Screen header top padding — clears notch/Dynamic Island on real phones,
     matches fake status bar on desktop preview (overridden in media query). */
  --screen-pt: calc(var(--sat) + 16px);
  --screen-pt-tight: calc(var(--sat) + 8px);
}

@media (min-width: 768px) {
  :root {
    /* Desktop iPhone preview — fake status bar is 48px tall, give 16px clearance below it */
    --screen-pt: 64px;
    --screen-pt-tight: 56px;
  }
}

/* ─────────────────────────────────────────────────────────────
   LIGHT MODE — applied via [data-theme="light"] on <html>
   The lime accent stays the same in both modes (brand colour).
   ───────────────────────────────────────────────────────────── */
:root[data-theme="light"] {
  --bg-0: #EDEDEA;
  --bg-1: #F5F5F3;       /* warm ivory canvas */
  --bg-2: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F0EFEA;
  --surface-3: #E2E1DC;
  --skel-base: #E4E3DD;
  --skel-hi: #F4F3EF;
  --line: rgba(10, 10, 10, 0.07);
  --line-2: rgba(10, 10, 10, 0.14);
  --text: #0A0A0A;
  --text-2: #4F4F4B;
  --text-3: #8A8A86;
  /* No neon in light mode: fills go black (white text), highlights deep green. */
  --accent: #0A0A0A;
  --accent-2: #1F1F1F;
  --on-accent: #FFFFFF;
  --accent-ink: #16A34A;
  --accent-wash: rgba(22, 163, 74, 0.14);
  --accent-glow: rgba(10, 10, 10, 0.16);
  --accent-edge: #000000;
  --pin-fill: #A8C62E;
}

/* Element-level overrides for the few places that hardcode dark colours
   (rgba(10,10,10,...)) — flip them to ivory equivalents in light mode. */
:root[data-theme="light"] .tabbar {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(10, 10, 10, 0.08);
  box-shadow: 0 12px 30px -10px rgba(10, 10, 10, 0.18);
}
:root[data-theme="light"] .tabbar-btn {
  color: var(--text-3);
}
:root[data-theme="light"] .sheet {
  background: linear-gradient(180deg, #FFFFFF, #F5F5F3);
  border-top: 1px solid var(--line-2);
  box-shadow: 0 -30px 60px -20px rgba(10, 10, 10, 0.18);
}
:root[data-theme="light"] .sheet-backdrop {
  background: rgba(245, 245, 243, 0.55);
}
:root[data-theme="light"] .sheet-handle {
  background: rgba(10, 10, 10, 0.18);
}
:root[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line-2);
  box-shadow: 0 16px 36px -12px rgba(10, 10, 10, 0.25);
}
.bottom-fade {
  background: linear-gradient(180deg, rgba(10,10,10,0) 0%, rgba(10,10,10,0.7) 25%, rgba(10,10,10,0.95) 45%, var(--bg-1) 65%);
}
:root[data-theme="light"] .bottom-fade {
  background: linear-gradient(180deg, rgba(245,245,243,0) 0%, rgba(245,245,243,0.7) 25%, rgba(245,245,243,0.95) 45%, var(--bg-1) 65%);
}
:root[data-theme="light"] .pattern-bg {
  background-image: radial-gradient(circle, rgba(10, 10, 10, 0.5) 1px, transparent 1.5px);
  opacity: 0.05;
}
:root[data-theme="light"] .map-pin-court {
  background: #0A0A0A;
  border: 1px solid var(--accent-ink);
}
:root[data-theme="light"] .map-pin-court .map-pin-glyph.material-symbols-rounded {
  color: var(--accent-ink);
}
/* btn-secondary inverts its own colour in light mode (was light on dark; now dark on light) */
:root[data-theme="light"] .btn-secondary {
  background: #0A0A0A; color: #F5F5F3;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -2px 0 rgba(0,0,0,0.4),
    0 2px 0 #2E2E2E,
    0 6px 16px -4px rgba(10,10,10,0.3);
}
:root[data-theme="light"] .btn-secondary:hover { background: #1A1A1A; }
/* btn-ghost / btn-icon read better with stronger borders in light mode */
:root[data-theme="light"] .btn-ghost,
:root[data-theme="light"] .btn-icon {
  border-color: var(--line-2);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.6),
    0 1px 2px rgba(10,10,10,0.04);
}

/* Universal app shell — every screen mounts inside this.
   Full-bleed on phones; fits inside the iPhone preview frame on desktop. */
.app-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

/* Floating bottom tabbar — moved here from index.html so it lives with the design system. */
.tabbar {
  position: fixed;
  left: max(16px, var(--sal));
  right: max(16px, var(--sar));
  bottom: max(12px, calc(var(--sab) + 8px));
  z-index: 60;
  height: var(--tabbar-h);
  border-radius: 22px;
  background: rgba(10,10,10,0.9);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid rgba(204,255,0,0.16);
  box-shadow: 0 12px 28px -14px rgba(0,0,0,0.6);
  display: flex; align-items: center; padding: 8px 10px;
  animation: tabbar-in 280ms var(--ease-bounce, cubic-bezier(0.34, 1.56, 0.64, 1));
}
@keyframes tabbar-in {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.tabbar-btn {
  flex: 1; height: 48px; min-height: 48px; border-radius: 14px;
  border: none; background: transparent; cursor: pointer;
  color: #6F6F6B; position: relative; z-index: 2;
  display: grid; place-items: center;
  transition: color 200ms ease, transform 220ms var(--ease-bounce, cubic-bezier(0.34, 1.56, 0.64, 1));
  -webkit-tap-highlight-color: transparent;
}
.tabbar-btn.on { color: var(--on-accent); }
.tabbar-indicator {
  position: absolute; top: 8px; left: 10px; height: 48px;
  background: linear-gradient(180deg, #E5FF5E, #CCFF00);
  border-radius: 14px;
  box-shadow: 0 8px 20px -6px var(--accent-glow);
  /* Slide via GPU-composited transform, not `left` — animating `left`/`width`
     forces a layout+paint every frame (the choppy/low-FPS jank). All 5 slots
     are equal width, so the box only needs to translate. */
  transition: transform 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
  z-index: 1;
}
:root[data-theme="light"] .tabbar-indicator { background: var(--accent); }

/* Desktop preview: tabbar is absolute inside the 390x844 frame, not fixed to viewport */
@media (min-width: 768px) {
  .tabbar {
    position: absolute;
    left: 16px; right: 16px;
    bottom: 22px;
  }
}

/* custom scrollbar inside device */
.device-scroll::-webkit-scrollbar { width: 0; height: 0; }

/* Ambient glow helpers */
.glow-lime { box-shadow: 0 0 0 1px var(--line-2), 0 12px 40px -12px var(--accent-glow); }
.glow-soft { box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 10px 30px -18px rgba(0,0,0,0.8); }

/* Reusable chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: -0.1px;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--line);
  transition: all var(--t-fast) var(--ease);
}
.chip.active {
  background: var(--accent);
  color: var(--on-accent); border-color: transparent;
  font-weight: 700;
}

/* Button base — always tactile, always reads as a button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 700; font-size: 14px; letter-spacing: 0.3px;
  text-transform: uppercase;
  border: none; cursor: pointer; user-select: none;
  padding: 0 18px; min-height: 48px;
  border-radius: 12px;
  transition: transform 120ms var(--ease), box-shadow 220ms var(--ease), background 180ms ease, border-color 180ms ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.btn:active { transform: translateY(1px) scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 -2px 0 rgba(0,0,0,0.18),
    0 2px 0 var(--accent-edge),
    0 6px 16px -4px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-2); box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -2px 0 rgba(0,0,0,0.18), 0 2px 0 var(--accent-edge), 0 10px 22px -4px var(--accent-glow); }
.btn-primary:active { box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), inset 0 -1px 0 rgba(0,0,0,0.15), 0 0 0 var(--accent-edge), 0 2px 8px -2px var(--accent-glow); }

.btn-ghost {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-2);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    inset 0 -2px 0 rgba(0,0,0,0.25),
    0 2px 0 rgba(0,0,0,0.35);
}
.btn-ghost:hover { background: var(--surface-2); border-color: rgba(245,245,243,0.22); }
.btn-ghost:active { box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -1px 0 rgba(0,0,0,0.2), 0 0 0 rgba(0,0,0,0); }

/* Secondary: inverted — dark text on light ivory */
.btn-secondary {
  background: #F5F5F3; color: #0A0A0A;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 -2px 0 rgba(0,0,0,0.18),
    0 2px 0 #B8B8B4,
    0 6px 16px -4px rgba(0,0,0,0.4);
}
.btn-secondary:hover { background: #FFFFFF; }

/* Icon button — circular/rounded square, clearly clickable */
.btn-icon {
  width: 44px; height: 44px; min-height: 44px;
  padding: 0; border-radius: 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-2);
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform 120ms var(--ease), background 180ms ease, border-color 180ms ease, box-shadow 220ms var(--ease);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    inset 0 -2px 0 rgba(0,0,0,0.25),
    0 2px 0 rgba(0,0,0,0.35);
  -webkit-tap-highlight-color: transparent;
}
.btn-icon:hover { background: var(--surface-2); border-color: rgba(245,245,243,0.22); }
.btn-icon:active { transform: translateY(1px) scale(0.96); box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -1px 0 rgba(0,0,0,0.2), 0 0 0 rgba(0,0,0,0); }

/* FAB — floating action button */
.btn-fab {
  width: 56px; height: 56px; min-height: 56px;
  padding: 0; border-radius: 18px;
  background: var(--accent); color: var(--on-accent);
  border: none; cursor: pointer;
  display: grid; place-items: center;
  transition: transform 120ms var(--ease), box-shadow 220ms var(--ease);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 -2px 0 rgba(0,0,0,0.18),
    0 3px 0 var(--accent-edge),
    0 12px 28px -6px var(--accent-glow);
}
.btn-fab:hover { background: var(--accent-2); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -2px 0 rgba(0,0,0,0.18), 0 4px 0 var(--accent-edge), 0 16px 32px -6px var(--accent-glow); }
.btn-fab:active { transform: translateY(2px) scale(0.97); box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 0 0 var(--accent-edge), 0 4px 10px -2px var(--accent-glow); }

/* Shine sweep on CTA */
@keyframes shine {
  0% { transform: translateX(-120%) skewX(-20deg); }
  100% { transform: translateX(220%) skewX(-20deg); }
}
.shine-wrap { position: relative; overflow: hidden; }
/* shine animation intentionally removed — too flashy for athletic aesthetic */

/* Mixly Plus "electric" set — the volt orb pulses and a lightning bolt flashes
   on an occasional beat, with the word "unlimited" zapping in sync. */
@keyframes orbZap {
  0%, 6.5%, 40%, 49%, 100% { opacity: 0.4; transform: scale(1); }
  1.4% { opacity: 1; transform: scale(1.12); }
  3.6% { opacity: 0.85; transform: scale(1.06); }
  44% { opacity: 0.85; transform: scale(1.06); }
}
@keyframes textZap {
  0%, 6.5%, 100% { text-shadow: none; }
  1.4% { text-shadow: 0 0 18px rgba(204,255,0,0.95), 0 0 42px rgba(204,255,0,0.5); }
  3.6% { text-shadow: 0 0 22px rgba(204,255,0,0.85); }
}
@keyframes ltngFlash {
  0%, 6%, 100% { opacity: 0; }
  1.4% { opacity: 1; }
  2.6% { opacity: 0.28; }
  3.6% { opacity: 1; }
  5% { opacity: 0.12; }
}

/* Pulse glow ring */
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.8); opacity: 0; }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}
.pulse-dot { position: relative; }
.pulse-dot::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: inherit; z-index: -1;
  animation: pulse-ring 2.2s var(--ease) infinite;
}

/* Stagger-in */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise 500ms var(--ease) both; }

/* Fade */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.fade-in { animation: fade 400ms var(--ease) both; }

/* Scale on tap helper */
.tap { transition: transform 120ms var(--ease), opacity 160ms ease; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tap:active { transform: scale(0.97); }
/* Resting → hover affordance on pointer devices: a clear "this is pressable" cue
   on top of the existing press + focus ring. Touch devices ignore :hover, so the
   phone resting look is unchanged. */
.tap:hover { opacity: 0.9; }
.tap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: inherit; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Interactive list / menu row — context menus, settings rows, option pickers.
   Reads as a tappable row (hover fill + press) instead of inert text. Works on a
   <button> or a <div onClick>. */
.menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  background: transparent; border: none; cursor: pointer;
  color: var(--text); font: inherit; font-size: 14px; text-align: left;
  transition: background 160ms ease, transform 120ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item:active { transform: scale(0.985); }
.menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.menu-item.danger { color: var(--error); }

/* Text-style button — inline things that DO something ("Reset", "Log in instead")
   that were rendered as plain coloured text. Now read as tappable (accent + a
   subtle hover pill) without becoming a heavy button. */
.link-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: none; cursor: pointer;
  color: var(--accent-ink); font: inherit; font-weight: 700;
  padding: 4px 6px; margin: -4px -6px; border-radius: var(--radius-sm);
  transition: background 160ms ease, transform 120ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.link-btn:hover { background: var(--accent-glow); }
.link-btn:active { transform: scale(0.97); }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Div-based "inputs" (date / time / location pickers rendered as tappable divs
   carrying .input) — give them the hover affordance a real control has so they
   don't look like static, read-only fields. */
.input.tap:hover { border-color: var(--line-2); background: var(--surface-2); opacity: 1; }

/* Generic disabled state for inline buttons that don't already style :disabled */
button:disabled { cursor: not-allowed; }

/* Leaflet — push zoom controls clear of the status bar + tabbar/FAB safe zones */
.leaflet-top.leaflet-right { top: 56px !important; }
.leaflet-bottom.leaflet-right { bottom: 110px !important; }
.leaflet-bottom.leaflet-left { bottom: 110px !important; }
.leaflet-control-attribution { font-size: 9px !important; opacity: 0.6; }

/* Hairline */
.hr { height: 1px; background: var(--line); margin: 12px 0; }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.card.featured {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border-color: var(--line-2);
}

/* Accent bar (card style 2) */
.accent-bar {
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent-ink);
  border-radius: 0 2px 2px 0;
}

/* avatar stack */
.av {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #3a4a2a, #5a6e3a);
  border: 2px solid var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--text);
}
.av-stack { display: inline-flex; }
.av-stack .av + .av { margin-left: -8px; }

/* Sport glyph placeholder tile */
.sport-tile {
  width: 56px; height: 56px; border-radius: 14px;
  background:
    radial-gradient(circle at 30% 30%, var(--accent-wash), transparent 60%),
    var(--surface-2);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-ink);
}

/* No-text style badge */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-ink); box-shadow: 0 0 10px var(--accent-glow); }

/* Sheet backdrop — z above the tabbar (60) so modals fully cover the chrome */
.sheet-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 65;
  animation: fade 240ms var(--ease) both;
}
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 70;
  background: linear-gradient(180deg, #1E2816, #161F11);
  border-top-left-radius: 28px; border-top-right-radius: 28px;
  border-top: 1px solid var(--line-2);
  box-shadow: 0 -30px 60px -20px rgba(0,0,0,0.6);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: sheet-up 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform;
}
@keyframes sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.sheet-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.2);
  margin: 10px auto 6px;
}

/* Slide-in right */
@keyframes slide-right { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slide-left { from { transform: translateX(-100%); } to { transform: translateX(0); } }

/* Shimmer (loading) */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Spinner (pull-to-refresh) */
@keyframes spin { to { transform: rotate(360deg); } }

/* Scrollable content areas */
.screen {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  background: var(--bg-1);
  -webkit-overflow-scrolling: touch;
}
.screen::-webkit-scrollbar { display: none; }
/* Sheets (and their scrollable rows) — desktop Chromium paints scrollbars
   inside the phone-frame preview otherwise */
.sheet, .sheet * { scrollbar-width: none; }
.sheet::-webkit-scrollbar, .sheet *::-webkit-scrollbar { display: none; }

/* Auth screens lay out as a flex column so the CTA footer sits in normal flow
   (margin-top:auto) and stays above the keyboard instead of floating over the
   form. With Keyboard.resize:"native" the webview shrinks and this reflows. */
.auth-screen { display: flex; flex-direction: column; }
/* Keyboard up (Capacitor adds body.kb-open): the sticky CTA footer would ride
   the shrunken viewport up and cover the inputs — drop it into normal flow.
   !important because the sticky position is set inline on the element. */
body.kb-open .auth-bottom { position: static !important; }
/* Same fix for the Host-a-game form's Post button — keep it from rising over the
   keyboard and covering the title/description fields while typing. */
body.kb-open .host-cta { position: static !important; }

/* Transitions between screens — a soft settle-in (decelerate) on every push. */
.screen-enter {
  animation: screen-enter 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes screen-enter {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Chat message entrance. React keys (message id) keep existing bubbles mounted,
   so on first open the whole thread does one gentle fade-up together and, after
   that, only a freshly-arrived bubble animates. Cheap (transform+opacity only). */
@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg-in { animation: msg-in 260ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@media (prefers-reduced-motion: reduce) {
  .msg-in { animation: none; }
}

/* ── Functional titles ──────────────────────────────────────────────
   Anything that *acts* like a title is uppercased for a consistent voice.
   User-generated strings (game/user names) deliberately do NOT use these. */
.title-xl {
  font-family: var(--display), 'Archivo', system-ui; font-style: italic;
  font-weight: 900; text-transform: uppercase; letter-spacing: -0.5px;
  line-height: 1; color: var(--text);
}
.title-lg {
  font-family: var(--display), 'Archivo', system-ui;
  font-weight: 800; text-transform: uppercase; letter-spacing: -0.3px;
  color: var(--text);
}
.section-title {
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px;
  font-size: 13px; color: var(--text-2);
}

/* Horizontal scroll rows (sport pills, "your games") — hide the scrollbar
   and keep momentum scrolling on touch. */
.hscroll { scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }
.hscroll::-webkit-scrollbar { display: none; }

/* Feed loading skeletons — reuse the shimmer keyframe. Reserves the card's
   height so the list doesn't jump when real data swaps in. */
.skeleton-card {
  height: 96px; border-radius: 16px;
  background: linear-gradient(90deg, var(--skel-base) 25%, var(--skel-hi) 37%, var(--skel-base) 63%);
  background-size: 200% 100%; animation: shimmer 1.4s ease infinite;
  border: 1px solid var(--line);
}
/* Reusable shimmer primitives for list rows + text bars. `.skeleton-block` is
   the bare shimmer surface; compose it for avatars (circle) and text lines. */
.skeleton-block {
  background: linear-gradient(90deg, var(--skel-base) 25%, var(--skel-hi) 37%, var(--skel-base) 63%);
  background-size: 200% 100%; animation: shimmer 1.4s ease infinite;
}
.skeleton-line { height: 12px; border-radius: 6px; }
.skeleton-circle { border-radius: 50%; flex-shrink: 0; }
.skeleton-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}

/* Tooltips for icon-only buttons — pure CSS, driven by a `data-tip` attribute.
   Gated to hover-capable pointer devices so it never fires on touch (where it'd
   just sit there after a tap). The element needs position:relative; .tap/.btn-*
   already establish that, and we add it defensively. */
@media (hover: hover) and (pointer: fine) {
  [data-tip] { position: relative; }
  [data-tip]::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px);
    padding: 5px 9px; border-radius: 8px; white-space: nowrap;
    background: rgba(10,10,10,0.95); color: #F5F5F3; border: 1px solid var(--line-2);
    font-size: 11px; font-weight: 600; letter-spacing: 0.2px; line-height: 1;
    box-shadow: 0 6px 18px -6px rgba(0,0,0,0.6);
    opacity: 0; pointer-events: none; z-index: 90;
    transition: opacity 140ms ease, transform 140ms ease;
  }
  [data-tip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Tab host — all five main tabs stay mounted; only the active pane is shown
   (display:none preserves React state + scroll position, killing the
   remount flash/refetch on every tab switch). */
.tab-host { position: absolute; inset: 0; overflow: hidden; }
/* Horizontal track holding all panes side by side; slides between tabs (taps +
   Instagram-style finger swipe). Width + transform are set inline per render. */
.tab-track {
  position: absolute; top: 0; left: 0; height: 100%; display: flex;
  transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.tab-pane { position: relative; flex: 1 0 0; min-width: 0; height: 100%; }
@media (prefers-reduced-motion: reduce) {
  .tab-track { transition: none; }
}

/* Keyboard up: hide the floating FAB so it doesn't ride the shrunken viewport
   over the inputs while the user is typing (e.g. the Home search field). */
body.kb-open .mixly-fab { display: none !important; }

/* Tab bar liquid active indicator */
.tab-indicator {
  position: absolute; top: 6px; width: 52px; height: 44px;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  transition: transform 380ms var(--ease-bounce), background 240ms ease;
  z-index: 0;
}

/* Map pin */
.map-pin {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent);
  box-shadow: 0 8px 24px -6px var(--accent-glow), 0 0 0 4px var(--accent-wash);
  color: var(--on-accent);
  transition: transform 220ms var(--ease-bounce);
}
.map-pin:hover { transform: scale(1.1); }
.map-pin.idle {
  background: var(--surface-2); color: var(--text-2);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Leaflet customization for the live map */
.leaflet-container { background: #0A0A0A; font-family: inherit; }
.leaflet-control-attribution {
  background: rgba(10,10,10,0.7) !important; color: #6F6F6B !important;
  font-size: 10px !important; padding: 2px 6px !important;
}
.leaflet-control-attribution a { color: #9b9b9b !important; }
.leaflet-control-zoom { border: 1px solid var(--line-2) !important; box-shadow: 0 8px 20px rgba(0,0,0,0.5) !important; }
.leaflet-control-zoom a {
  background: rgba(10,10,10,0.9) !important; color: var(--text) !important;
  border-bottom-color: var(--line) !important;
}
.leaflet-control-zoom a:hover { background: var(--surface-2) !important; }
.mixly-pin { background: transparent; border: none; }
.map-pin-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--pin-fill);
  display: grid; place-items: center;
  box-shadow: 0 6px 20px -4px rgba(0,0,0,0.5);
  border: 1px solid rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 200ms var(--ease-bounce);
}
.map-pin-icon:hover { transform: scale(1.12); }
.map-pin-glyph.material-symbols-rounded {
  font-size: 22px; line-height: 1;
  color: #0A0A0A;
  font-variation-settings: 'FILL' 1, 'wght' 700, 'GRAD' 0, 'opsz' 24;
}
/* Custom inline-SVG pins (badminton, table tennis, volleyball, rugby) draw with
   currentColor — pin it dark so the strokes read on the bright pin fills, same
   as the Material glyphs above. Without this the icon inherits near-white text
   and vanishes on the coloured circle. */
.map-pin-glyph.map-pin-svg { color: #0A0A0A; line-height: 0; }
/* Per-sport game pin colours — at-a-glance read on the map (QA #20).
   Glyph stays dark for contrast on these bright fills. */
.map-pin-basketball { background: #FF8A3D; }   /* orange */
.map-pin-volleyball { background: #FFD23D; }   /* yellow */
.map-pin-football   { background: #4ADE80; }   /* green */
.map-pin-badminton  { background: #6EC3FF; }   /* blue */
.map-pin-tennis     { background: #CCFF00; }   /* lime */
:root[data-theme="light"] .map-pin-tennis { background: #A8C62E; } /* muted, no neon */

/* Court pin — distinguish bookable venues from live games (lime → ivory ring) */
.map-pin-court {
  background: #F5F5F3;
  border: 1px solid var(--accent);
  box-shadow: 0 6px 20px -4px rgba(0,0,0,0.5), 0 0 0 2px var(--accent-wash);
}
.map-pin-court .map-pin-glyph.material-symbols-rounded { color: #0A0A0A; }
.mixly-me { background: transparent; border: none; }
.map-me-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: #6EC3FF; border: 3px solid #050505;
  box-shadow: 0 0 0 6px rgba(110,195,255,0.22), 0 0 18px rgba(110,195,255,0.5);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

/* input */
.input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  /* 16px is the floor that stops iOS Safari from auto-zooming the page when a
     text field gains focus — never drop below this on real inputs. */
  font-family: inherit; font-size: 16px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 200ms ease, background 160ms ease;
}
.input::placeholder { color: var(--text-3); }
.input:focus {
  border-color: var(--accent-ink);
  background: var(--surface-2);
  box-shadow: 0 0 0 4px var(--accent-wash);
}

/* Progress bar */
.progress {
  height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden;
}
.progress > span {
  display: block; height: 100%;
  background: var(--accent-ink);
  border-radius: 2px;
  transition: width 500ms var(--ease);
}

/* Toast — top-positioned so it stays visible above the iOS keyboard (bottom
   toasts were hidden behind it on the auth screens — "Email already in use" /
   "Reset link sent" went unseen). Auto-dismisses, pointer-events: none on
   the wrapper so it never swallows taps elsewhere on the screen. */
.toast {
  position: fixed;
  left: max(14px, var(--sal));
  right: max(14px, var(--sar));
  top: calc(var(--sat) + 14px);
  z-index: 80;
  pointer-events: none;
  display: flex; align-items: center; gap: 11px;
  background: linear-gradient(180deg, rgba(28,28,28,0.96), rgba(18,18,18,0.96));
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--line-2);
  border-radius: 16px; padding: 13px 16px 13px 12px;
  box-shadow: 0 24px 48px -14px rgba(0,0,0,0.78), inset 0 1px 0 rgba(255,255,255,0.05);
  animation: toast-in 420ms var(--ease-bounce) both;
}
.toast::before {
  content: ''; width: 3px; align-self: stretch; border-radius: 3px;
  background: var(--accent-ink);
  box-shadow: 0 0 12px var(--accent-glow);
}
.toast.toast-error { border-color: rgba(255,80,80,0.4); }
.toast.toast-error::before { background: #FF5050; box-shadow: 0 0 12px rgba(255,80,80,0.5); }
@keyframes toast-in {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Desktop preview: anchor the toast inside the iPhone frame */
@media (min-width: 768px) {
  .toast { position: absolute; top: 60px; }
}

/* Brand pattern tint overlay — neutral dot grid, no olive tint */
.pattern-bg {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.04;
  background-image:
    radial-gradient(circle, rgba(245,245,243,0.6) 1px, transparent 1.5px);
  background-size: 18px 18px;
}

/* Segmented */
.seg {
  display: inline-flex; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 3px; position: relative;
}
.seg > button {
  background: transparent; border: none; color: var(--text-2);
  font-family: inherit; font-weight: 600; font-size: 13px;
  padding: 7px 14px; border-radius: 9px; cursor: pointer;
  transition: color 200ms ease;
  position: relative; z-index: 1;
}
.seg > button.on { color: var(--on-accent); }
.seg-thumb {
  position: absolute; top: 3px; bottom: 3px;
  background: var(--accent);
  border-radius: 9px;
  transition: left 380ms var(--ease-bounce), width 380ms var(--ease-bounce);
  z-index: 0;
}

/* Tilted sports marquee — borrowed from the marketing site's hero banner.
   Used in the account-gate header band. Track holds two copies of the items so
   translateX(-50%) loops seamlessly. */
@keyframes gate-marquee { to { transform: translateX(-50%); } }
.gate-marquee { overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.gate-marquee-track { display: inline-flex; width: max-content; animation: gate-marquee 20s linear infinite; will-change: transform; }
.gate-marquee-item {
  display: inline-flex; align-items: center; gap: 16px; padding: 0 16px;
  font-family: var(--display), 'Archivo', system-ui; font-weight: 900; font-style: italic;
  font-size: 22px; text-transform: uppercase; letter-spacing: -0.02em; color: var(--text);
}
.gate-marquee-item .sep { color: var(--accent); font-size: 0.42em; }
.gate-marquee-item.dim { color: var(--surface-3); -webkit-text-stroke: 1px var(--line-2); }
@media (prefers-reduced-motion: reduce) { .gate-marquee-track { animation: none; } }
