@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ============================================================
   Sports Meetup Platform — App Shell CSS
   Theme tokens follow the design doc theme preference values:
     dark_pitch (default) | light | amber
   ============================================================ */

/* ─────────────────────────────────────────────
   CSS Custom Properties (Design Tokens)
   ───────────────────────────────────────────── */
:root {
  --color-bg: #0f1f14;
  --color-surface: #1a2f1f;
  --color-surface-alt: #213826;
  --color-primary: #3dba5e;
  --color-primary-hover: #2e8c46;
  --color-primary-text: #0f1f14;
  --color-text: #e8f5e9;
  --color-text-muted: #80b890;
  --color-border: #2d4a33;
  --color-error: #f44336;
  --color-warning: #ff9800;
  --color-success: #4caf50;
  --color-info: #2196f3;
  --color-danger: #e53935;
  --color-badge-public: #4caf50;
  --color-badge-invite-only: #ff9800;
  --color-badge-group: #2196f3;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 20px;
  --color-accent-legacy: #C2481F;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(27, 25, 24, 0.06);
  --font-display: 'Space Grotesk', -apple-system, sans-serif;
  --font-base: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --nav-height: 60px;
  --install-banner-height: 60px;
  /* Fixed CTA rule (2026-09-25, architect-directed): blue is exclusively for
     primary action buttons (Edit, Create, Save, Join, Add, Accept, RSVP...)
     across every screen and every theme. --color-primary stays reserved for
     status labels, tags, and links and remains theme-dependent; --color-cta
     is deliberately NOT overridden per-theme, since the CTA color is a fixed
     rule, not a theme choice. */
  --color-cta: #1D5FA3;
  --color-cta-text: #ffffff;
  /* Sign in with Apple (HIG): white button on dark backgrounds. */
  --color-apple-btn-bg: #ffffff;
  --color-apple-btn-fg: #000000;
  --color-apple-btn-border: #000000;
}

[data-theme="light"] {
  --color-bg: #FAF6F0;
  --color-surface: #ffffff;
  --color-surface-alt: #F4EFEB;
  --color-primary: #14406E;
  --color-primary-hover: #0d2a4a;
  --color-primary-text: #ffffff;
  --color-accent-gold: #FBC819;
  --color-text: #1B1918;
  --color-text-muted: #716B67;
  --color-border: #E8E2D9;
  --color-error: #c62828;
  --color-success: #1F7A73;
  /* Sign in with Apple (HIG): black button on light backgrounds. */
  --color-apple-btn-bg: #000000;
  --color-apple-btn-fg: #ffffff;
  --color-apple-btn-border: #000000;
}

[data-theme="amber"] {
  --color-bg: #1c1400;
  --color-surface: #2d2200;
  --color-surface-alt: #3a2c00;
  --color-primary: #ffb300;
  --color-primary-hover: #e6a100;
  --color-primary-text: #1c1400;
  --color-text: #fff8e1;
  --color-text-muted: #c8a850;
  --color-border: #4a3900;
}

/* ─────────────────────────────────────────────
   Reset & Base
   ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-base);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button { cursor: pointer; font-family: inherit; }

/* ─────────────────────────────────────────────
   Utility
   ───────────────────────────────────────────── */
.hidden { display: none !important; }

/* ─────────────────────────────────────────────
   Install Banner (R-026 — persistent, every page)
   ───────────────────────────────────────────── */
#install-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--color-cta);
  color: var(--color-cta-text);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.install-banner-icon { width: 24px; height: 24px; flex: 0 0 24px; display: inline-flex; align-items: center; justify-content: center; }
.si { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; vertical-align: middle; line-height: 0; }
.si svg { display: block; }

.install-banner-text { flex: 1; }
.install-banner-title { font-weight: 700; font-size: 0.9rem; }
.install-banner-subtitle { font-size: 0.78rem; opacity: 0.9; margin-top: 2px; }

.install-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }

#btn-install {
  background: var(--color-cta-text);
  color: var(--color-cta);
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  transition: opacity 0.2s;
}
#btn-install:hover { opacity: 0.85; }

#btn-install-dismiss {
  background: transparent;
  border: 1.5px solid var(--color-primary-text);
  color: var(--color-cta-text);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.82rem;
  transition: opacity 0.2s;
}
#btn-install-dismiss:hover { opacity: 0.75; }

/* ─────────────────────────────────────────────
   Push Permission Banner (DES-MEETUP-001 §4.11, R-026)
   Shares the install banner's visual language — same slot in the
   layout, mutually exclusive with it (never shown at the same time).
   ───────────────────────────────────────────── */
#push-permission-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--color-cta);
  color: var(--color-cta-text);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
  animation: slideDown 0.3s ease;
}

#btn-enable-push {
  background: var(--color-cta-text);
  color: var(--color-cta);
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  transition: opacity 0.2s;
}
#btn-enable-push:hover { opacity: 0.85; }

#btn-push-dismiss {
  background: transparent;
  border: 1.5px solid var(--color-cta-text);
  color: var(--color-cta-text);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.82rem;
  transition: opacity 0.2s;
}
#btn-push-dismiss:hover { opacity: 0.75; }

/* ─────────────────────────────────────────────
   iOS Install Modal
   ───────────────────────────────────────────── */
#ios-install-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ios-modal-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(60px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.ios-modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; }
.ios-modal-steps { font-size: 0.9rem; color: var(--color-text-muted); line-height: 1.7; margin-bottom: 20px; }
.ios-modal-steps strong { color: var(--color-text); }

#btn-ios-modal-close {
  width: 100%;
  padding: 12px;
  background: var(--color-primary);
  color: var(--color-cta-text);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
}

/* ─────────────────────────────────────────────
   Navigation
   games-groups-fold Scope §4: #app-nav renamed to #app-topbar and
   stripped down to brand (mobile) + notifications only — the rest of
   its former contents (category dropdowns, Settings/Admin/Sign Out)
   moved to the Profile screen or were retired as redundant with the
   primary nav. Selector renamed (not just restyled) so "confirm #app-nav
   is fully removed" is verifiable in the rendered DOM, not just visually.
   ───────────────────────────────────────────── */
#app-topbar {
  height: var(--nav-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.nav-right { display: flex; align-items: center; gap: 12px; }

/* ─────────────────────────────────────────────
   Notification Centre (in-app fallback)
   ───────────────────────────────────────────── */
.notif-wrapper { position: relative; }

#btn-notif-bell {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--color-text-muted);
  padding: 4px;
  position: relative;
  transition: color 0.2s;
}
#btn-notif-bell:hover { color: var(--color-text); }

#notif-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--color-error);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
}

#notif-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 320px;
  max-height: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow-y: auto;
  z-index: 300;
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  font-weight: 700;
}

#btn-mark-all-read {
  background: transparent;
  border: none;
  color: var(--color-primary);
  font-size: 0.78rem;
  font-weight: 600;
}

#notif-list { padding: 8px 0; }

.notif-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.15s;
}
.notif-item:hover { background: var(--color-surface-alt); }
.notif-item.unread { border-left: 3px solid var(--color-primary); }
.notif-item.read { opacity: 0.7; }
.notif-title { font-weight: 600; font-size: 0.88rem; margin-bottom: 2px; }
.notif-body { font-size: 0.82rem; color: var(--color-text-muted); }
.notif-time { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 4px; }
.notif-empty { padding: 24px 16px; text-align: center; color: var(--color-text-muted); font-size: 0.88rem; }

#notif-fallback-hint {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--color-warning);
  color: #1c1400;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  width: 240px;
  box-shadow: var(--shadow-sm);
  z-index: 300;
}

/* ─────────────────────────────────────────────
   Main Content Area
   ───────────────────────────────────────────── */
#app-main {
  flex: 1;
  padding: 20px 16px;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

/* Dashboard page overrides 800px cap (AD-10): this page only, other pages unchanged */
#app-main.app-main-dashboard,
#app-main:has(.dashboard-page) {
  max-width: 100%;
  width: 100%;
  padding: 0;
  margin: 0;
}

/* ─────────────────────────────────────────────
   Pages
   ───────────────────────────────────────────── */
.page { animation: fadeIn 0.2s ease; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h2 { font-size: 1.4rem; font-weight: 800; }

h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 16px; }
h3 { font-size: 1rem; font-weight: 700; margin: 20px 0 10px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.subtitle { color: var(--color-text-muted); font-size: 0.9rem; margin-top: 4px; }

/* ─────────────────────────────────────────────
   Auth Page
   ───────────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - var(--nav-height) - 60px);
  padding: 24px 16px;
}

.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.auth-logo { width: 48px; height: 48px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; }
.auth-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.auth-subtitle { color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: 28px; }

.auth-buttons { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }

.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  transition: transform 0.15s, opacity 0.15s;
}
.btn-oauth:hover { transform: translateY(-1px); opacity: 0.9; }

/* The auth card background is pure white in the light theme, so the
   Google button's official white/light style (#fff bg) needs a visible
   border + shadow of its own to read as a button rather than blending
   into the card — a faint #dadce0 border alone isn't enough on a white
   card (it's meant for Google's own light-grey page background). Uses
   Google's own documented shadow values for the light button variant. */
.btn-google {
  background: #fff;
  color: #3c4043;
  border-color: #747775;
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}
.btn-google:hover {
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 2px 6px 2px rgba(60, 64, 67, 0.15);
}
.btn-facebook { background: #1877f2; color: #fff; }

/* Fixed height and icon box (Apple HIG). Colors come from theme tokens only. */
.btn-apple {
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 0 16px;
  background: var(--color-apple-btn-bg);
  color: var(--color-apple-btn-fg);
  border-color: var(--color-apple-btn-border);
  gap: 8px;
  overflow: hidden;
}
.oauth-icon-apple {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: block;
  overflow: hidden;
}
.oauth-icon-apple svg {
  width: 18px;
  height: 18px;
  display: block;
}

.oauth-icon { font-weight: 800; font-size: 1.1rem; }
.oauth-icon-google { flex-shrink: 0; }

.auth-legal-notice {
  margin: 4px 0 0;
  font-size: 0.78rem;
  line-height: 18px;
  color: var(--color-text-muted);
  text-align: center;
}
.auth-legal-link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: underline;
}
.auth-note { font-size: 0.78rem; color: var(--color-text-muted); }

/* ─────────────────────────────────────────────
   Home Page Tabs
   ───────────────────────────────────────────── */
.home-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-border);
  margin: 16px 0 20px;
}
.home-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.home-tab-btn:hover { color: var(--color-text); }
.home-tab-btn.active.nav-pair-blue { color: var(--color-info); border-bottom-color: var(--color-info); }
.home-tab-btn.active.nav-pair-gold { color: var(--color-warning); border-bottom-color: var(--color-warning); }

/* ─────────────────────────────────────────────
   Card Grid (Home)
   ───────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.card-action {
  cursor: pointer;
  text-align: center;
}
.card-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.card-icon { font-size: 2rem; margin-bottom: 10px; }
.card-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.card-desc { font-size: 0.78rem; color: var(--color-text-muted); }

/* ─────────────────────────────────────────────
   Event Cards
   ───────────────────────────────────────────── */
.event-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: var(--shadow-sm);
}
.event-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.event-header { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.event-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 8px; overflow-wrap: anywhere; }
/* BUG: card tiles (.event-card) must clamp long/generated-string titles to
   2 lines instead of overflowing the card; the full detail-page header
   (.event-detail-card .event-title) is intentionally left unclamped so the
   full title is always readable there. */
.event-card .event-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
}
.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  max-width: 100%;
}
.event-meta span { overflow-wrap: anywhere; max-width: 100%; }

/* Event Detail */
.event-detail-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.event-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
.event-detail-meta strong { color: var(--color-text); }

.event-desc { font-size: 0.9rem; color: var(--color-text-muted); margin: 8px 0; line-height: 1.5; }

.event-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* ─────────────────────────────────────────────
   Group Cards
   ───────────────────────────────────────────── */
.group-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.group-name { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.group-desc { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 6px; }
.group-meta { font-size: 0.78rem; color: var(--color-text-muted); }

/* ─────────────────────────────────────────────
   Badges
   ───────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.badge-public { background: var(--color-badge-public); color: #fff; border-color: transparent; }
.badge-invite_only { background: var(--color-badge-invite-only); color: #fff; border-color: transparent; }
.badge-group { background: var(--color-badge-group); color: #fff; border-color: transparent; }
.badge-status { background: var(--color-surface-alt); }

/* games-groups-fold: type badges distinguishing tournament entries from
   adhoc ones in the merged Games/Groups lists. Reuses the app's existing
   blue=Games/Groups, gold=Tournaments/Teams token pairing (--color-info /
   --color-warning) so the distinction reads consistently in every theme. */
.badge-tournament-type { background: var(--color-warning); color: #1c1400; border-color: transparent; }
.badge-group-type { background: var(--color-info); color: #fff; border-color: transparent; }

/* ─────────────────────────────────────────────
   Kind toggle — R-264/R-265 segmented control (Create Game / Create
   Group), shared by both create-flow toggles.
   ───────────────────────────────────────────── */
.kind-toggle {
  display: flex;
  gap: 4px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
  max-width: fit-content;
}
.kind-toggle-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.kind-toggle-btn:hover { color: var(--color-text); }
.kind-toggle-btn.active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* ─────────────────────────────────────────────
   Buttons
   ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px solid transparent;
  transition: transform 0.12s, opacity 0.2s, box-shadow 0.12s;
  text-align: center;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); opacity: 0.9; }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--color-cta); color: var(--color-cta-text); }
.btn-secondary { background: var(--color-surface-alt); color: var(--color-text); border-color: var(--color-border); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-full { width: 100%; }

/* Sticky submit footer — pins the form submit button at the bottom of the
   viewport on short mobile screens while staying in-flow on tall screens. */
.form-sticky-footer {
  position: sticky;
  bottom: 0;
  background: var(--color-bg);
  padding: 12px 0 0;
  margin-top: 20px;
  border-top: 1px solid var(--color-border);
  z-index: 95; /* above .bottom-nav's z-index: 90 */
}
/* On mobile, .bottom-nav (position:fixed, ~59px tall + safe-area-inset-bottom,
   see .bottom-nav-inner) occupies the same bottom strip of the viewport.
   Without this offset, "bottom: 0" above sticks the footer flush to the
   screen edge, directly underneath the nav bar. */
@media (max-width: 768px) {
  .form-sticky-footer {
    bottom: calc(59px + env(safe-area-inset-bottom));
  }
}
.btn-back { margin-bottom: 16px; }

/* Create Game form — "new field system" (chip pickers for Sport/Skill/
   Visibility + restyled fields), 2026-09-25 CreateGameForm mockup.
   Scoped to .cg-form / .cg-chip so the shared .form-group input styling
   other forms (edit modals, tournament create, auth, etc.) still use is
   untouched. Direct-child combinator deliberately excludes the nested
   date/time inputs inside .datetime-row, which keep their own icon-
   padded styling further down this file. */
.cg-form .form-group > input,
.cg-form .form-group > select,
.cg-form .form-group > textarea {
  background: #ffffff;
  color: #1B1918;
  border: 1px solid #E7E0D6;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
}
.cg-form .form-group > input:focus,
.cg-form .form-group > select:focus,
.cg-form .form-group > textarea:focus {
  border-color: var(--color-cta);
}
.cg-form .form-group > label {
  font-size: 13px;
  font-weight: 600;
  color: #4A453F;
}
.cg-chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cg-chip {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border-width: 1px;
  border-style: solid;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.1s, opacity 0.15s;
}
.cg-chip:hover { opacity: 0.85; }

/* ─────────────────────────────────────────────
   Forms
   ───────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 18px; max-width: 480px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
  outline: none;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--color-primary);
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--color-surface-alt);
}

.form-group textarea { resize: vertical; min-height: 80px; }

/* .settings-grid is referenced across ~11 places in app.js (edit-event
   modal, tournament create/edit forms, team detail, now the Create Game
   cost/currency row) but had no CSS definition anywhere in this file --
   every inline `style="grid-template-columns: 1fr 1fr; gap: 15px;"` on it
   was a silent no-op without `display: grid` to activate it, so all of
   those rows have always rendered as plain stacked blocks instead of a
   2-column grid. Fixing the missing base rule here (not narrowly scoping
   it to the Create Game page) so every existing call site starts
   rendering as originally intended. */
.settings-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }

/* Date/Time picker enhancements */
.date-quick-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.chip {
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  border: 1.5px solid var(--color-border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}

.chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-surface);
}

.chip.chip-active {
  background: var(--color-primary);
  color: var(--color-cta-text);
  border-color: var(--color-primary);
}

.datetime-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.datetime-field {
  position: relative;
  display: flex;
  align-items: center;
}

.datetime-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

.datetime-field input[type="date"],
.datetime-field select {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px 10px 36px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
  outline: none;
  width: 100%;
}

.datetime-field input[type="date"]:focus,
.datetime-field select:focus {
  border-color: var(--color-primary);
}



/* ─────────────────────────────────────────────
   Nav User Area
   ───────────────────────────────────────────── */
#nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}

/* ─────────────────────────────────────────────
   Loading Spinner
   ───────────────────────────────────────────── */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ─────────────────────────────────────────────
   Toast Notifications
   ───────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.25s ease;
  pointer-events: auto;
  max-width: 300px;
}

.toast-success { background: var(--color-success); color: #fff; }
.toast-error { background: var(--color-error); color: #fff; }
.toast-info { background: var(--color-info); color: #fff; }
.toast-warning { background: var(--color-warning); color: #1c1400; }

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-fade-out {
  animation: fadeOut 0.4s ease forwards;
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(120%); }
}

/* ─────────────────────────────────────────────
   Empty States & Errors
   ───────────────────────────────────────────── */
.empty-state {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  padding: 16px 0;
  text-align: center;
}

.error {
  color: var(--color-error);
  padding: 16px 0;
  font-size: 0.9rem;
}

/* ─────────────────────────────────────────────
   Responsive
   ───────────────────────────────────────────── */
@media (max-width: 480px) {
  #app-main { padding: 16px 12px; }
  .auth-card { padding: 28px 20px; }
  .event-detail-card { padding: 16px; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  #notif-panel { width: calc(100vw - 24px); right: -8px; }
  .install-banner-subtitle { display: none; }
}

/* ─────────────────────────────────────────────
   PWA Standalone mode adjustments
   ───────────────────────────────────────────── */
@media (display-mode: standalone) {
  /* Ensure content doesn't overlap status bar on iOS */
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  /* Install banner never shows in standalone mode — it's removed by JS,
     but we add a CSS safety net */
  #install-banner { display: none !important; }
}

/* ─────────────────────────────────────────────
   Notification Preferences (DES-MEETUP-001 §4.11, R-026)
   ───────────────────────────────────────────── */
.notif-prefs-list { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.notif-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
}
.notif-pref-row:last-child { border-bottom: none; }
.notif-pref-row-global { font-weight: 700; }
.notif-pref-label { font-size: 0.9rem; color: var(--color-text); }
.notif-prefs-loading, .notif-prefs-error { font-size: 0.85rem; color: var(--color-text-muted); }

.toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: 999px;
  transition: background 0.15s ease;
  pointer-events: none;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: var(--color-surface);
  border-radius: 50%;
  transition: transform 0.15s ease;
}
.toggle-switch input:checked + .toggle-slider { background: var(--color-primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }
.toggle-switch input:focus-visible + .toggle-slider { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* ─────────────────────────────────────────────
   Settings Dashboard Layout
   ───────────────────────────────────────────── */
.theme-settings-card {
  margin-bottom: 24px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 15px;
}
.dashboard-col {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.section-title-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px;
}
.section-title-wrapper h3 {
  font-size: 1.05rem;
  font-weight: 700;
}
.badge-count {
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
}
.dashboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ─────────────────────────────────────────────
   Responsive — mobile/desktop visibility toggle
   games-groups-fold Scope §4: the nav-links-desktop / mobile drawer /
   desktop dropdown / nav-pair-dot rules that used to live in this
   section were all specific to the retired #app-nav bar and NAV_MENU
   dropdowns/mobile drawer — removed along with their markup. .mobile-only
   itself stays: #app-topbar's brand still uses it (shown on mobile,
   hidden on desktop where the sidebar already shows the brand).
   ───────────────────────────────────────────── */
.mobile-only {
  display: none !important;
}

@media (max-width: 1023px) {
  .mobile-only {
    display: block !important;
  }
  #app-topbar {
    gap: 8px;
  }
}

/* ─────────────────────────────────────────────
   Home page — consolidated menu (Games, Tournaments, Groups, Teams)
   ───────────────────────────────────────────── */
.menu-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 8px;
}

/* Give the 4-column menu more room than the default reading-width
   container other pages use, without affecting them. */
#app-main:has(.page-home) {
  max-width: 1100px;
}

@media (max-width: 900px) {
  .menu-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}
.menu-column {
  padding: 18px;
  border-top: 3px solid transparent;
  display: flex;
  flex-direction: column;
}
.menu-column.nav-pair-blue { border-top-color: var(--color-info); }
.menu-column.nav-pair-gold { border-top-color: var(--color-warning); }
.menu-column-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  min-height: 2.6em;
  margin: 0 0 4px;
}
.menu-column-desc {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--color-text-muted);
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
  /* Reserve space for 2 lines regardless of how many this particular
     description actually wraps to, so the divider below (and the item
     list that follows) lines up at the same height across every column
     — otherwise a 1-line vs 2-line description shifts everything below
     it out of alignment card to card. */
  min-height: calc(2 * 1.4em + 10px);
}
.menu-column-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.menu-column-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.menu-column-item:hover {
  background: var(--color-surface-alt);
  color: var(--color-primary);
}

@media (max-width: 768px) {
  .menu-columns {
    grid-template-columns: 1fr;
  }
}

.rsvp-status-badge {
  margin-bottom: 12px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.badge-going {
  background: var(--color-success) !important;
  color: white !important;
}
.badge-waitlisted {
  background: var(--color-warning) !important;
  color: white !important;
}
.badge-registration_open {
  background: var(--color-success) !important;
  color: white !important;
}
.badge-registration_closed,
.badge-schedule_draft {
  background: var(--color-warning) !important;
  color: white !important;
}
.badge-published,
.badge-in_progress,
.badge-registered {
  background: var(--color-info) !important;
  color: white !important;
}
.badge-completed {
  background: var(--color-text-muted) !important;
  color: white !important;
}

.autocomplete-container {
  position: relative;
  width: 100%;
}
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  margin-top: 4px;
}
.autocomplete-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-text);
  text-align: left;
}
.autocomplete-item:last-child {
  border-bottom: none;
}
.autocomplete-item:hover {
  background: var(--color-surface-alt);
}
.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.autocomplete-item-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Shared person avatar (userAvatarHtml): fixed size so rows align regardless of content. */
.user-avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 32px;
}
.user-avatar img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  display: block;
}
.autocomplete-title {
  height: 32px;
  line-height: 32px;
  padding: 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
}
.autocomplete-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.autocomplete-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-sizing: border-box;
}
.autocomplete-dot-group { background: var(--color-cta); }
.autocomplete-dot-other { background: transparent; border: 1.5px solid var(--color-text-muted); }
.autocomplete-item-group {
  background: color-mix(in srgb, var(--color-cta) 8%, var(--color-surface));
}
.autocomplete-item-other .user-avatar {
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
}
.autocomplete-chip {
  flex: 0 0 auto;
  max-width: 45%;
  height: 20px;
  line-height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-cta);
  border: 1px solid var(--color-cta);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.autocomplete-clear {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 24px;
  height: 24px;
  line-height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}
.autocomplete-item-pending {
  cursor: default;
  opacity: 0.6;
}
.autocomplete-item-pending:hover {
  background: transparent;
}

/* ============================================================
   Task: frontend-landing-discover-profile-signup
   Home / Discover / Profile / Signup + shared nav shell
   Visual/layout/interaction source: docs/meetup-prototype.html
   (client-approved mockup). Colors reuse the EXISTING [data-theme]
   custom properties above (they already match the mockup's hardcoded
   palette value-for-value in the light theme) -- nothing here
   hardcodes a hex value. Breakpoint (768px) matches the convention
   already used elsewhere in this file (Responsive Navigation Menu,
   above).
   ============================================================ */

/* ── App shell: sidebar (desktop) + bottom nav (mobile) ── */
.app-shell-v2 {
  display: flex;
  min-height: 100vh;
}

.side-nav {
  width: 220px;
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--install-banner-h, 0px);
  left: 0;
  height: calc(100dvh - var(--install-banner-h, 0px));
  z-index: 90;
  padding-bottom: 20px;
}
/* Applied by renderAppShellNav(): the padding the logo used to get from an inline style. */
.side-nav-logo.side-nav-logo-js { padding: 0; border-bottom: none; display: block; }
/* AD-16: the brand header exists in the markup but only shows at 1024px and up. */
.brand-header { display: none; }
/* AD-19 narrow-rail brand block (769-1023px): as wide as the rail (220px, covering its 1px border), 72px tall,
   brand blue, the header icon variant 40x40 with a 12px radius, centred; no wordmark, no white tile. */
.side-nav-logo .side-nav-brand-tablet {
  display: flex; align-items: center; justify-content: center;
  box-sizing: border-box; width: 220px; height: 72px; margin-right: -1px;
  background-color: var(--db-brand); text-decoration: none; color: inherit;
}
.side-nav-brand-tablet:focus-visible { outline: 3px solid var(--db-brand-accent); outline-offset: -5px; }
.side-nav-brand-tablet-icon { width: 40px; height: 40px; border-radius: 12px; object-fit: contain; display: block; }
.side-nav-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.side-nav-items {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  width: 100%;
}
.side-nav-item:hover { background: var(--color-surface-alt); }
.side-nav-item.active { background: color-mix(in srgb, var(--color-primary) 10%, transparent); color: var(--color-primary); }
.side-nav-item .sni-icon { font-size: 1.1rem; width: 22px; text-align: center; flex-shrink: 0; }
.side-nav-fab {
  margin: 4px 12px 0;
  background: var(--color-cta);
  color: var(--color-cta-text);
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 0;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}
.side-nav-fab:hover { background: color-mix(in srgb, var(--color-cta) 85%, black); }
.side-nav-secondary {
  padding: 10px 10px 0;
  border-top: 1px solid var(--color-border);
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-main-v2 {
  margin-left: 220px;
  flex: 1;
  min-width: 0; /* flex items default to min-width:auto, which lets
    intrinsic content width (e.g. .cards-row's children) prevent this
    from shrinking below their combined width, causing horizontal page
    overflow on mobile -- this is the standard fix. */
  background: var(--color-surface-alt);
  min-height: 100vh;
}
/* Logged-out state (login/signup): primary nav shell is hidden (see
   UI.updateNav() in app.js), so the content area shouldn't reserve
   space for it. */
.app-main-v2.app-main-v2-full { margin-left: 0; }
.page-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 28px 80px;
}

.mob-page-header {
  display: none;
  background: var(--color-primary);
  padding: 20px 16px 16px;
}

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  z-index: 90;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.12);
}
.bottom-nav-inner { display: flex; padding: 8px 0 max(8px, env(safe-area-inset-bottom)); position: relative; }
.bottom-nav-item {
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
}
.bottom-nav-item .bni-icon { font-size: 1.25rem; line-height: 1; }
.bottom-nav-item .bni-label { font-size: 0.62rem; color: var(--color-text-muted); font-weight: 400; }
.bottom-nav-item.active .bni-label { color: var(--color-primary); font-weight: 700; }
.bottom-nav-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--color-primary); }
.bottom-nav-fab-wrap { position: absolute; top: -24px; left: 50%; transform: translateX(-50%); }
.bottom-nav-fab {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--color-cta);
  border: 3px solid var(--color-surface-alt);
  color: var(--color-cta-text);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
}

/* ── Create action sheet (mobile FAB "+" → choose Game or Group) ── */
.create-action-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: flex-end; justify-content: center;
}
.create-action-sheet {
  background: var(--color-surface);
  border-radius: 20px 20px 0 0;
  padding: 12px 16px 32px;
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-md);
}
.create-action-sheet h3 {
  text-align: center; font-size: 0.85rem;
  color: var(--color-text-muted); margin-bottom: 16px;
  padding-top: 4px;
}
.create-action-btn {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 14px 16px; margin-bottom: 10px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text); font-size: 1rem; font-weight: 500;
  cursor: pointer; text-align: left;
}
.create-action-btn:hover { background: var(--color-border); }
.create-action-btn .cab-icon { width: 24px; height: 24px; flex: 0 0 24px; display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.create-action-cancel {
  display: block; width: 100%; padding: 12px;
  background: none; border: none;
  color: var(--color-text-muted); font-size: 0.95rem;
  cursor: pointer; margin-top: 4px;
}

@media (max-width: 768px) {
  .side-nav { display: none !important; }
  .app-main-v2 { margin-left: 0; }
  .page-content { padding: 0 0 100px; }
  .bottom-nav { display: block; }
  .mob-page-header { display: block; }
  .desktop-only { display: none !important; }
}
@media (min-width: 769px) {
  .mobile-page-only { display: none !important; }
  .bottom-nav { display: none !important; }
}

/* ── Filter chips (sport filter, Home + Discover) ── */
/* Scrollbars are hidden at rest on swipeable rows; they reappear while the
   user is actively scrolling (a JS scroll-listener adds .is-scrolling for
   300 ms, see app.js initScrollbarVisibility). */
.chips-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips-row::-webkit-scrollbar { height: 0; }
.chips-row.is-scrolling { scrollbar-width: thin; }
.chips-row.is-scrolling::-webkit-scrollbar { height: 4px; }
.chip {
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.chip.active { background: var(--color-primary); color: var(--color-cta-text); border-color: var(--color-primary); }
/* On the mobile header (primary-colored background) chips need inverted
   default styling for contrast -- same interaction, different palette. */
.mob-page-header .chips-row { padding-bottom: 0; }
.mob-page-header .chip {
  background: color-mix(in srgb, var(--color-primary-text) 18%, transparent);
  color: var(--color-primary-text);
  border: none;
}
.mob-page-header .chip.active { background: var(--color-primary-text); color: var(--color-primary); }

@media (min-width: 769px) {
  .chips-row { flex-wrap: wrap; }
  .chips-row:has(.stat-tile) {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    width: 100%;
  }
  .chips-row > .stat-tile {
    flex: 1;
    min-width: 0;
    width: 100%;
  }
}

/* ── Cards row: swipeable one-per-viewport on mobile, grid on desktop ── */
.cards-row {
  display: flex;
  flex-direction: row;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.cards-row::-webkit-scrollbar { height: 0; }
.cards-row.is-scrolling { scrollbar-width: thin; }
.cards-row.is-scrolling::-webkit-scrollbar { height: 4px; }
.cards-row > * {
  min-width: 100%;
  max-width: 100%;
  flex-shrink: 0;
  scroll-snap-align: start;
  margin-right: 0;
  box-sizing: border-box;
}

@media (min-width: 769px) {
  .cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    overflow-x: visible;
    padding-bottom: 0;
    width: 100%;
  }
  .cards-row:has(.quick-tile),
  .cards-row:has(.result-card) {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
  .cards-row > * { min-width: unset; max-width: unset; margin-right: 0; scroll-snap-align: unset; }
}

.section-pad { padding: 0 16px; }
.section-gap { margin-bottom: 24px; }
@media (min-width: 769px) {
  .section-pad { padding: 0; }
  .section-gap { margin-bottom: 28px; }
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.section-head-title { color: var(--color-text); font-size: 1.05rem; font-weight: 700; margin: 0; }
.section-head-sub { color: var(--color-text-muted); font-size: 0.78rem; margin: 2px 0 0; }
.section-head-action {
  color: var(--color-primary);
  font-size: 0.82rem;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

/* ── Game card ── */
.game-card {
  background: var(--color-surface);
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  position: relative;
  width: 100%;
}
.game-card.game-card-today { border: 1.5px solid var(--color-primary); }
.game-card-today-flag { display: flex; align-items: center; gap: 5px; margin-bottom: 8px; color: var(--color-primary); font-size: 0.68rem; font-weight: 700; letter-spacing: 1px; }
.game-card-today-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-primary); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.game-card-badge {
  position: absolute; top: 12px; right: 12px;
  border-radius: 6px; padding: 2px 7px;
  font-size: 0.62rem; font-weight: 700;
}
.game-card-badge-tournament { background: color-mix(in srgb, var(--color-warning) 15%, transparent); border: 1px solid var(--color-warning); color: var(--color-warning); }
.game-card-sport { width: 28px; height: 28px; margin-bottom: 6px; display: flex; align-items: center; justify-content: center; }
/* BUG: raw programmatic/test titles (e.g. long ALL_CAPS_UNDERSCORE ids with
   no spaces) don't wrap on their own and blow out the card width; clamp to
   2 lines and force mid-word wrapping as a fallback for unbroken tokens. */
.game-card-title {
  color: var(--color-text); font-weight: 700; font-size: 0.85rem; margin-bottom: 4px; line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.game-card-meta {
  color: var(--color-text-muted); font-size: 0.72rem; margin-bottom: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.game-card-row { display: flex; align-items: center; justify-content: space-between; margin: 10px 0; gap: 8px; }
.game-card-spots { font-size: 0.72rem; font-weight: 600; color: var(--color-text-muted); flex-shrink: 0; }
.game-card-spots.full { color: var(--color-danger); }
.game-card-spots.low { color: var(--color-warning); }
.game-card-via {
  font-size: 0.68rem; color: var(--color-text-muted); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.game-card-btn {
  width: 100%; border-radius: 8px; padding: 9px 0;
  font-size: 0.78rem; font-weight: 700; cursor: pointer; border: none;
}
.game-card-btn-join { background: var(--color-cta); color: var(--color-cta-text); }
.game-card-btn-full { background: var(--color-bg); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.game-card-btn-registered { background: color-mix(in srgb, var(--color-primary) 8%, transparent); color: var(--color-primary-hover); border: 1.5px solid color-mix(in srgb, var(--color-primary) 33%, transparent); }

.pill {
  display: inline-block;
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 0.68rem;
  font-weight: 700;
  border: 1px solid transparent;
}
/* Skill-level pills — real skill_level_requirement enum values
   (all_levels/beginner/intermediate/expert), not the mockup's
   placeholder Casual/Beginner/Intermediate/Advanced labels. */
.pill-skill-all_levels { background: color-mix(in srgb, var(--color-text-muted) 15%, transparent); color: var(--color-text-muted); border-color: color-mix(in srgb, var(--color-text-muted) 40%, transparent); }
.pill-skill-beginner { background: color-mix(in srgb, var(--color-info) 15%, transparent); color: var(--color-info); border-color: color-mix(in srgb, var(--color-info) 40%, transparent); }
.pill-skill-intermediate { background: color-mix(in srgb, var(--color-warning) 15%, transparent); color: var(--color-warning); border-color: color-mix(in srgb, var(--color-warning) 40%, transparent); }
.pill-skill-expert { background: color-mix(in srgb, var(--color-danger) 15%, transparent); color: var(--color-danger); border-color: color-mix(in srgb, var(--color-danger) 40%, transparent); }
.pill-role-organiser { background: color-mix(in srgb, var(--color-primary) 15%, transparent); color: var(--color-primary); border-color: color-mix(in srgb, var(--color-primary) 40%, transparent); }
.pill-role-player { background: color-mix(in srgb, var(--color-info) 15%, transparent); color: var(--color-info); border-color: color-mix(in srgb, var(--color-info) 40%, transparent); }

/* ── Stats tiles ── */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 769px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-tile {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.stat-tile-icon { width: 24px; height: 24px; margin-bottom: 4px; display: flex; align-items: center; justify-content: center; }
.stat-tile-value { color: var(--color-text); font-size: 1.35rem; font-weight: 800; }
.stat-tile-label { color: var(--color-text-muted); font-size: 0.72rem; margin-top: 2px; }
/* Compact horizontal variant used at the bottom of Home (sport-filtered) */
.stat-tile-compact { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.stat-tile-compact .stat-tile-value { font-size: 1.15rem; line-height: 1; }

/* ── Result rows (Recent Results, Match History) ── */
.result-row {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.result-row-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; flex-shrink: 0;
}
.result-won .result-row-icon { background: color-mix(in srgb, var(--color-primary) 15%, transparent); }
.result-lost .result-row-icon { background: color-mix(in srgb, var(--color-danger) 12%, transparent); }
.result-won { border-color: color-mix(in srgb, var(--color-primary) 33%, var(--color-border)); }
.result-lost { border-color: color-mix(in srgb, var(--color-danger) 33%, var(--color-border)); }
.result-row-outcome { font-weight: 700; font-size: 0.78rem; }
.result-won .result-row-outcome { color: var(--color-primary); }
.result-lost .result-row-outcome { color: var(--color-danger); }

/* Recent Results card variant used on Home (bigger, card layout) */
.result-card {
  background: var(--color-surface);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

/* ── Search panel (Home inline search + Discover page) ── */
.search-panel {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.search-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 769px) { .search-grid { grid-template-columns: 1fr 1fr; } }
.search-field {
  background: var(--color-surface-alt);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.88rem;
}
.search-field-wrap { position: relative; }
.search-field-gps {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--color-primary); font-size: 0.72rem; font-weight: 700; padding: 0;
}

/* ── Quick-access tiles (My Games & Groups) ── */
.quick-tile {
  background: var(--color-surface);
  border-radius: 14px;
  padding: 18px;
  border: 1px solid var(--color-border);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.quick-tile-icon { font-size: 1.75rem; margin-bottom: 8px; }
.quick-tile-title { color: var(--color-text); font-weight: 700; font-size: 0.92rem; margin-bottom: 4px; }
.quick-tile-sub { color: var(--color-text-muted); font-size: 0.8rem; }

/* ── Profile page ── */
.profile-hero {
  background: var(--color-primary);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.profile-hero-name { color: var(--color-cta-text); font-size: 1.25rem; font-weight: 800; }
.profile-hero-sports { color: color-mix(in srgb, var(--color-primary-text) 85%, transparent); font-size: 0.8rem; }
.profile-hero-badge {
  background: color-mix(in srgb, var(--color-primary-text) 20%, transparent);
  color: var(--color-cta-text);
  border-radius: 20px; padding: 2px 10px; font-size: 0.68rem; font-weight: 700;
  display: inline-block; margin-top: 6px;
}
.profile-avatar { border-radius: 50%; display: block; flex-shrink: 0; object-fit: cover; }
.profile-winrate-card {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--color-border);
  margin-bottom: 24px;
}
.profile-winrate-bar-track { background: var(--color-bg); border-radius: 6px; height: 8px; }
.profile-winrate-bar-fill { background: var(--color-primary); border-radius: 6px; height: 8px; }

/* ── Signup: email form + OTP screens ── */
.signup-field {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: 0.94rem;
  width: 100%;
}
.signup-back-link {
  background: none; border: none; color: var(--color-text-muted);
  font-size: 0.82rem; cursor: pointer; padding: 0; text-align: left;
}
/* Reset-password views (DES-MEETUP-ADDENDUM-email-auth fix round 2): 44px tap
   targets, theme tokens only. Used by the reset views' markup only. */
.reset-btn { min-height: 44px; }
.reset-link-btn {
  display: flex; align-items: center;
  min-height: 44px; min-width: 44px; padding: 0 8px;
  background: none; border: none; cursor: pointer;
  color: var(--color-text-muted); font-size: 0.9rem; text-align: left;
}
.reset-error { color: var(--color-error); font-size: 0.85rem; min-height: 1.2em; margin-top: 8px; }
.otp-row { display: flex; gap: 8px; justify-content: center; }
.otp-box {
  width: 44px; height: 52px;
  text-align: center; font-size: 1.25rem; font-weight: 700;
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.otp-box.filled { border: 2px solid var(--color-primary); }
.signup-divider { display: flex; align-items: center; gap: 12px; }
.signup-divider-line { flex: 1; height: 1px; background: var(--color-border); }
.signup-divider-text { color: var(--color-text-muted); font-size: 0.8rem; }

.two-col { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 769px) { .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } }

/* ═════════════════════════════════════════════════════════════
   GAMES LIST & EVENT DETAIL REDESIGN (DES-MEETUP-001 Visual System)
   Ivory background (#FAF6F0), Ink text (#1B1918), Space Grotesk / Manrope,
   20px radius cards with soft shadow, no left-border cards.
   Primary accent: var(--color-primary).
   Sport palettes (core 4 per design spec): Badminton #1F7A73, Football #8A5A1E,
   Basketball #6B4FA0, Tennis #B23A62.
   Extended (same lightness/saturation family): Volleyball #1E5E8A, Swimming #1B6E94,
   Cricket #7A4B1F, Rugby #4E6A9F, Hockey #1E7A5A, Running #4A7A1F,
   Cycling #1F5E8A, Squash #9B4F1E, Golf #4A6B1F, Others #52606D.
   ═════════════════════════════════════════════════════════════ */

/* ── Typography & Display Headings ── */
.games-heading {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 1.85rem;
  font-weight: 700;
  color: #1B1918;
  margin: 0;
  letter-spacing: -0.02em;
}

/* ── Filter Chips ── */
.filter-chips-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 20px 0 24px 0;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid #EAE4DC;
  background: #FFFFFF;
  color: #1B1918;
  font-family: var(--font-base, 'Manrope', sans-serif);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(27, 25, 24, 0.03);
}
.filter-chip:hover {
  border-color: #1B1918;
  transform: translateY(-1px);
}
.filter-chip.active {
  background: #1B1918;
  color: #FAF6F0;
  border-color: #1B1918;
  box-shadow: 0 4px 12px rgba(27, 25, 24, 0.15);
}
.filter-chip .chip-count {
  font-size: 0.76rem;
  opacity: 0.8;
  margin-left: 2px;
}

/* ── Games Card Grid ── */
.games-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

/* ── Game Card (No left border, 20px radius, soft shadow) ── */
.game-card-v2 {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 22px;
  border: 1px solid rgba(27, 25, 24, 0.06);
  box-shadow: 0 4px 20px rgba(27, 25, 24, 0.05);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  text-decoration: none;
  color: #1B1918;
}
.game-card-v2:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(27, 25, 24, 0.1);
}

/* ── Sport Tag Pills ── */
.sport-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--font-base, 'Manrope', sans-serif);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

/* ── Status Label Pills ── */
.status-label-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-base, 'Manrope', sans-serif);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.status-label-pill.status-hosting {
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
  border: 1px solid color-mix(in srgb, var(--color-primary) 25%, transparent);
}
.status-label-pill.status-joined {
  background: rgba(31, 122, 115, 0.12);
  color: #1F7A73;
  border: 1px solid rgba(31, 122, 115, 0.25);
}
.status-label-pill.status-waitlisted {
  background: rgba(138, 90, 30, 0.12);
  color: #8A5A1E;
  border: 1px solid rgba(138, 90, 30, 0.25);
}
.status-label-pill.status-cancelled {
  background: rgba(178, 58, 98, 0.12);
  color: #B23A62;
  border: 1px solid rgba(178, 58, 98, 0.25);
}
.status-label-pill.status-open {
  background: rgba(27, 25, 24, 0.06);
  color: #1B1918;
}
.status-label-pill.status-full {
  background: rgba(178, 58, 98, 0.12);
  color: #B23A62;
}

/* ── Card Body & Meta ── */
.game-card-title-v2 {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #1B1918;
  margin: 12px 0 10px 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.game-card-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: #716B67;
  margin-bottom: 6px;
}
.game-card-meta-row svg {
  flex-shrink: 0;
  stroke: #716B67;
}

/* ── Avatar Stack & Progress ── */
.avatar-stack {
  display: flex;
  align-items: center;
  margin-right: 8px;
}
.avatar-bubble {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #EAE4DC;
  border: 2px solid #FFFFFF;
  margin-left: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #716B67;
}
.avatar-bubble:first-child {
  margin-left: 0;
}
.avatar-bubble svg {
  width: 13px;
  height: 13px;
  stroke: #716B67;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: #EAE4DC;
  border-radius: 3px;
  overflow: hidden;
  margin: 10px 0 12px 0;
}
.progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.game-card-action-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  transition: gap 0.15s ease;
}
.game-card-v2:hover .game-card-action-link {
  gap: 9px;
}

/* ── Event Detail Two-Column Layout ── */
.event-detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
  margin-top: 16px;
}
@media (max-width: 860px) {
  .event-detail-layout {
    grid-template-columns: 1fr;
  }
}

.event-detail-card-v2 {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 4px 20px rgba(27, 25, 24, 0.05);
  border: 1px solid rgba(27, 25, 24, 0.06);
}

.key-value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.key-value-item {
  background: #FAF6F0;
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(27, 25, 24, 0.04);
}
.key-value-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #716B67;
  font-weight: 700;
  margin-bottom: 4px;
}
.key-value-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1B1918;
}

/* ── Cancel Event Button (Outline in #B23A62) ── */
.btn-cancel-outline {
  width: 100%;
  border: 1.5px solid #B23A62 !important;
  color: #B23A62 !important;
  background: transparent !important;
  border-radius: 12px;
  font-weight: 700;
  padding: 10px 18px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-cancel-outline:hover {
  background: rgba(178, 58, 98, 0.08) !important;
}





/* ============================================================
   DES-MEETUP-ADDENDUM-dashboard v1.0 & profile-onboarding v1.1
   Dashboard Components, Layout (1024px desktop breakpoint),
   and Onboarding Modal Styles.
   ============================================================ */

:root {
  --db-brand: #1E5BD6;
  --db-brand-deep: #0B3FA8;
  --db-brand-light: #3B82F6;
  --db-on-brand: #FFFFFF;
  --db-brand-accent: #FDE68A;
  --db-brand-tagline: #DBEAFE;
  --db-page: #F5F8FF;
  --db-card: #FFFFFF;
  --db-card-border: #E3EAF8;
  --db-text: #0F2350;
  --db-text-muted: #5B6B8C;
  --db-nav-inactive: #64748B;
  --db-badge-red: #DC2626;
  --db-going-bg: #DCFCE7;
  --db-going-text: #166534;
}

/* ── Dashboard Page Container ── */
.dashboard-page {
  background: var(--db-page);
  min-height: 100vh;
  padding-bottom: 90px;
}

.dashboard-container {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}

/* ── Banner (AD-1, §4) ── */
.dashboard-banner {
  background-color: var(--db-brand);
  height: 208px;
  position: relative;
  overflow: hidden;
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
  padding: 20px 20px 0;
  color: #FFFFFF;
}

.dashboard-banner-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.dashboard-banner-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.dashboard-banner-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* AD-17 phone brand block: icon straight on the blue (no tile), two-tone wordmark, tagline.
   Strings are rendered from BRAND_HEADER (theme-tokens.js); colours are the --db-* tokens. */
.dashboard-brand-block { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dashboard-brand-icon { width: 52px; height: 52px; border-radius: 12px; object-fit: contain; flex-shrink: 0; display: block; }
.dashboard-brand-text { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.dashboard-brand-wordmark { font-size: 26px; font-weight: 800; line-height: 1.1; color: var(--db-on-brand); white-space: nowrap; }
.dashboard-brand-accent { color: var(--db-brand-accent); }
.dashboard-brand-tagline { font-size: 9px; font-weight: 700; letter-spacing: 2.5px; line-height: 1.3; color: var(--db-brand-tagline); white-space: nowrap; }

.dashboard-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-bell-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: #FFFFFF;
  font-size: 1.2rem;
}

.dashboard-bell-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--db-badge-red);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1.5px solid #FFFFFF;
}

.dashboard-profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  object-fit: cover;
  cursor: pointer;
}

.dashboard-profile-avatar-fallback {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  background: var(--db-brand-light);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  cursor: pointer;
}

.dashboard-banner-greeting {
  margin-top: 14px;
}

.dashboard-greeting-sub {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.dashboard-greeting-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-top: 2px;
}

/* ── Next-game Card (AD-1, AD-7) ── */
.dashboard-next-game-wrap {
  padding: 0 16px;
  margin-top: -40px;
  position: relative;
  z-index: 3;
}

.dashboard-next-game-card {
  background: var(--db-card);
  border-radius: 22px;
  border: 1px solid var(--db-card-border);
  padding: 16px;
  box-shadow: 0 8px 24px rgba(15, 35, 80, 0.08);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-next-game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 35, 80, 0.12);
}

.dashboard-sport-tile {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-next-game-card .dashboard-sport-tile {
  width: 48px;
  height: 48px;
  border-radius: 16px;
}

.dashboard-next-game-info {
  flex: 1;
  min-width: 0;
}

.dashboard-next-game-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--db-brand);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dashboard-next-game-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--db-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 2px 0;
}

.dashboard-next-game-meta {
  font-size: 0.78rem;
  color: var(--db-text-muted);
}

.dashboard-chevron {
  color: var(--db-nav-inactive);
  font-size: 1.2rem;
  font-weight: 700;
  padding-left: 6px;
}

/* ── Sports Row (AD-9) ── */
.dashboard-sports-section {
  padding: 20px 0 12px;
}

.dashboard-sports-scroll {
  display: flex;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 16px 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.dashboard-sports-scroll::-webkit-scrollbar {
  display: none;
}

.dashboard-sport-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  outline: none;
  border-radius: 20px;
}

.dashboard-sport-chip-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--db-text);
  white-space: nowrap;
}

.dashboard-sport-chip.selected .dashboard-sport-tile,
.dashboard-sport-chip.active .dashboard-sport-tile {
  box-shadow: 0 0 0 2px var(--db-brand);
}

.dashboard-clear-filter-btn {
  background: none;
  border: none;
  color: var(--db-brand);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font: inherit;
  display: inline;
}

.dashboard-banner-count-chips {
  display: none;
}

.dashboard-banner-chip {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #FFFFFF;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.dashboard-banner-chip:hover {
  background: rgba(255, 255, 255, 0.3);
}

.dashboard-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 16px;
}

.dashboard-card-item {
  background: var(--db-card);
  border-radius: 22px;
  border: 1px solid var(--db-card-border);
  padding: 16px;
  box-shadow: 0 4px 16px rgba(15, 35, 80, 0.04);
}

.dashboard-shortcut-section {
  display: block;
  padding: 16px;
}

.dashboard-sport-chip-tile {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(15, 35, 80, 0.05);
  box-sizing: border-box;
}

.dashboard-sport-chip.active .dashboard-sport-chip-tile {
  border: 2px solid var(--db-brand);
}

.dashboard-sport-chip-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--db-text);
}

.dashboard-sport-chip.active .dashboard-sport-chip-label {
  color: var(--db-brand);
  font-weight: 700;
}

/* ── Dashboard Sections (My Games, My Groups, Recommended) ── */
.dashboard-section {
  padding: 12px 16px;
}

.dashboard-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.dashboard-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--db-text);
  margin: 0;
}

.dashboard-section-viewall {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--db-brand);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
}

.dashboard-rows-card {
  background: var(--db-card);
  border-radius: 20px;
  border: 1px solid var(--db-card-border);
  box-shadow: 0 4px 16px rgba(15, 35, 80, 0.04);
  overflow: hidden;
}

.dashboard-row-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--db-card-border);
  cursor: pointer;
  transition: background 0.1s ease;
}

.dashboard-row-item:last-child {
  border-bottom: none;
}

.dashboard-row-item:hover {
  background: rgba(245, 248, 255, 0.8);
}

.dashboard-row-icon-tile {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dashboard-row-body {
  flex: 1;
  min-width: 0;
}

.dashboard-row-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--db-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-row-meta {
  font-size: 0.78rem;
  color: var(--db-text-muted);
  margin-top: 2px;
}

.dashboard-row-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  flex-shrink: 0;
}

.dashboard-badge-going {
  background: var(--db-going-bg);
  color: var(--db-going-text);
}

/* ── Shortcut Tiles ── */
.dashboard-shortcut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dashboard-shortcut-tile {
  background: var(--db-card);
  border-radius: 20px;
  border: 1px solid var(--db-card-border);
  padding: 16px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(15, 35, 80, 0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease;
}

.dashboard-shortcut-tile:hover {
  transform: translateY(-2px);
}

.dashboard-shortcut-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
}

.dashboard-shortcut-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--db-text);
}

.dashboard-shortcut-sub {
  font-size: 0.78rem;
  color: var(--db-text-muted);
  font-weight: 600;
}

/* ── Empty & Error States (Section 5) ── */
.dashboard-empty-msg {
  padding: 18px 16px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--db-text-muted);
  background: var(--db-card);
  border-radius: 20px;
  border: 1px solid var(--db-card-border);
  margin: 0;
}

.dashboard-error-box {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFF1F2;
  border: 1px solid #FECDD3;
  border-radius: 16px;
  color: #BE123C;
  font-size: 0.85rem;
}

.dashboard-retry-btn {
  background: #BE123C;
  color: #FFFFFF;
  border: none;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

/* ── Skeletons ── */
.dashboard-skeleton-card {
  height: 80px;
  background: linear-gradient(90deg, #EDF2F7 25%, #E2E8F0 50%, #EDF2F7 75%);
  background-size: 200% 100%;
  animation: dbSkeleton 1.5s infinite;
  border-radius: 22px;
}

.dashboard-skeleton-row {
  height: 64px;
  background: linear-gradient(90deg, #EDF2F7 25%, #E2E8F0 50%, #EDF2F7 75%);
  background-size: 200% 100%;
  animation: dbSkeleton 1.5s infinite;
  border-bottom: 1px solid var(--db-card-border);
}

@keyframes dbSkeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Desktop Layout at 1024px+ (AD-10) ── */
@media (min-width: 1024px) {
  /* Home v2: the top bar (bell + profile photo) stays visible on desktop. */

  .dashboard-container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 24px 32px 60px;
    width: 100%;
    box-sizing: border-box;
  }

  .dashboard-banner {
    border-radius: 28px;
    height: 180px;
  }

  .dashboard-banner-count-chips {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .dashboard-next-game-wrap {
    margin-top: 20px;
    padding: 0;
  }

  .dashboard-sports-section {
    padding: 20px 0 16px;
  }

  .dashboard-sports-scroll {
    display: flex;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    padding: 4px 0 8px; /* Aligns to cards left edge */
  }

  /* Three EQUAL-width, EQUAL-height cards in one row, 24px gutters */
  .dashboard-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
    padding: 0;
    margin-top: 8px;
  }

  .dashboard-cards-grid > .dashboard-section {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0;
    min-width: 0;
  }

  .dashboard-card-item {
    padding: 20px;
  }

  .dashboard-cards-grid > .dashboard-section .dashboard-rows-card,
  .dashboard-cards-grid > .dashboard-section .dashboard-empty-msg,
  .dashboard-cards-grid > .dashboard-section .dashboard-error-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* Shortcut tiles are replaced by count chips on desktop */
  .dashboard-shortcut-section {
    display: none !important;
  }
}

/* ── Onboarding Modal Styles ── */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 35, 80, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.onboarding-modal {
  background: #FFFFFF;
  border-radius: 24px;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.onboarding-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid #E2E8F0;
}

.onboarding-step-indicator {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--db-brand);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.onboarding-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0F2350;
  margin: 0;
}

.onboarding-subtitle {
  font-size: 0.85rem;
  color: #5B6B8C;
  margin: 6px 0 0;
}

.onboarding-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.onboarding-actions {
  padding: 16px 24px;
  border-top: 1px solid #E2E8F0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.onboarding-skills-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.onboarding-skill-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #F1F5F9;
}

.onboarding-skill-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0F2350;
}

.onboarding-skill-options {
  display: flex;
  gap: 8px;
}

.skill-opt-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.skill-opt-btn.active {
  background: var(--db-brand);
  color: #FFFFFF;
  border-color: var(--db-brand);
}

.onboarding-phone-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.onboarding-field-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0F2350;
}

.onboarding-phone-input-row {
  display: flex;
  gap: 8px;
}

.onboarding-country-select {
  padding: 10px 8px;
  border: 1px solid #CBD5E1;
  border-radius: 12px;
  background: #FFFFFF;
  font-size: 0.85rem;
  max-width: 130px;
}

.onboarding-phone-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #CBD5E1;
  border-radius: 12px;
  font-size: 0.92rem;
}

.onboarding-consent-box {
  background: #F1F5F9;
  border-radius: 12px;
  padding: 12px;
  margin-top: 6px;
}

.onboarding-consent-text {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.4;
  margin: 0;
}

.onboarding-consent-version {
  display: block;
  font-size: 0.7rem;
  color: #94A3B8;
  margin-top: 6px;
}

/* ============================================================
   AD-16 Brand header (DES-MEETUP-ADDENDUM-dashboard v1.5), desktop web only.
   220x96 block at the top of the left menu, brand blue from the same token
   the dashboard banner uses (--db-brand). Phone and tablet widths keep the
   existing logo tile exactly as before.
   ============================================================ */
@media (min-width: 1024px) {
  .side-nav-logo.side-nav-logo-js { padding: 0; border-bottom: none; display: block; }
  .side-nav-logo .side-nav-brand-tablet { display: none; }
  .brand-header {
    display: flex; align-items: center; gap: 10px;
    box-sizing: border-box;
    width: 220px; height: 96px;
    margin-right: -1px;               /* cover the rail's 1px right border: the block is the full 220px menu width */
    padding: 0 12px;
    background-color: var(--db-brand);
    color: var(--db-on-brand);
    text-decoration: none;
    overflow: hidden;
  }
  .brand-header:focus-visible { outline: 3px solid var(--db-brand-accent); outline-offset: -5px; }
  .brand-header-icon { width: 48px; height: 48px; border-radius: 14px; object-fit: contain; flex-shrink: 0; display: block; }
  .brand-header-text { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
  .brand-header-wordmark { font-size: 28px; font-weight: 800; line-height: 1.1; color: var(--db-on-brand); white-space: nowrap; }
  .brand-header-accent { color: var(--db-brand-accent); }
  .brand-header-tagline { font-size: 10px; font-weight: 700; letter-spacing: 2px; line-height: 1.3; color: var(--db-brand-tagline); white-space: nowrap; }

  /* AD-10 (v1.5): the banner has no app icon on desktop; its actions stay on the right. */
  .dashboard-banner-top { justify-content: flex-end; }
}


/* ============================================================
   Home v2 (feat/home-v2): top bar, navigation drawer / left menu,
   banner carousel, tab tiles, shared card layout, WIP strip.
   Literal colours live ONLY in the token block below; every rule
   uses var(--...). The bottom menu rules above are untouched.
   ============================================================ */
:root {
  --hv2-blue: #1D4ED8;
  --hv2-green: #0F7B4F;
  --hv2-orange: #E8772E;
  --hv2-purple: #5B4BD6;
  --hv2-gold: #FFC83D;
  --hv2-on-gold: #2F2200;
  --hv2-on-solid: #FFFFFF;
  --hv2-scrim: rgba(11, 27, 63, 0.55);
  --hv2-drawer-head: #0B3B8C;
  --hv2-wip-bg: #FFE9B8;
  --hv2-wip-text: #6B4300;
  --hv2-av-0: #C9D6F2;
  --hv2-av-1: #F0D6B4;
  --hv2-av-2: #CBE5D2;
  --hv2-av-3: #E6D0EE;
  --hv2-av-4: #D5E3FF;
  --hv2-av-5: #F6D5D5;
  --hv2-av-text: #1B2B4D;
  --hv2-dot-idle: #B9C3DB;
  /* Fixed light palette. Home v2 does not read the theme tokens: custom properties declared on
     :root resolve var() against :root's own values (the dark base tokens), so a derived token
     here would stay dark even when body[data-theme="light"] overrides --color-surface. */
  --hv2-surface: #FFFFFF;
  --hv2-page: #F6F8FD;
  --hv2-border: #DCE3F0;
  --hv2-ink: #0B1B3F;
  --hv2-muted: #4A5675;
  --hv2-hover: #EEF1F7;
  --hv2-tile: #EEF3FF;
  --hv2-btn-bg: #E3ECFF;
  --hv2-btn-text: #1741B8;
  --hv2-shadow: 0 4px 20px rgba(11, 27, 63, 0.18);
  --hv2-drawer-head-2: #1448AE;
  --hv2-on-solid-soft: #DCE8FF;
  /* Menu section colours (fixed): active heading fill / text, sub-item bar, sub-item tint, guide line (~40%). */
  --hv2-sub-text: #5B6785;
  --hv2-g-fill: #E3F6EC;  --hv2-g-ink: #0A5A36; --hv2-g-bar: #0F7B4F; --hv2-g-sub: #F0FAF5; --hv2-g-guide: #9FCAB9;
  --hv2-o-fill: #FFF1E3;  --hv2-o-ink: #7A3500; --hv2-o-bar: #E8772E; --hv2-o-sub: #FFF8F1; --hv2-o-guide: #F6C9AB;
  --hv2-p-fill: #EEEBFF;  --hv2-p-ink: #3F3496; --hv2-p-bar: #6B5CE0; --hv2-p-sub: #F6F4FF; --hv2-p-guide: #C4BEF3;
  --hv2-blue-tint: #DFE6FA;  --hv2-blue-ink: #1741B8;
  --hv2-green-tint: #DDEDE6; --hv2-green-ink: #0A5A36; --hv2-green-soft: #E7F2ED; --hv2-green-edge: #BCDACE; --hv2-green-body: #2C5E46;
  --hv2-orange-tint: #F4E6DC; --hv2-orange-ink: #8A3F00; --hv2-orange-icon: #B34A06;
  --hv2-purple-tint: #E8E6F9; --hv2-purple-ink: #4338A8;
}

/* ── Top bar ── */
.topbar-menu-btn {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border: none; background: none; color: var(--color-text);
  margin-left: -8px;
}
@media (max-width: 768px) {
  #app-topbar .topbar-menu-btn:not(.hidden) { display: flex; }
}
.topbar-brand {
  display: none; align-items: center; gap: 6px;
  color: var(--color-text); text-decoration: none;
}
/* Below 1024px the rail's brand block is not the full header, so the top bar carries the brand. */
@media (max-width: 1023px) { .topbar-brand { display: flex; } }
.topbar-brand:hover { text-decoration: none; }
.topbar-app-icon { width: 30px; height: 30px; object-fit: contain; display: block; flex: none; }
.topbar-wordmark { font-weight: 700; font-size: 22px; letter-spacing: -0.3px; line-height: 1; }
.topbar-wordmark-accent { color: var(--color-accent-gold, var(--hv2-gold)); }
#nav-user { display: flex; align-items: center; gap: 6px; }
#btn-notif-bell { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.topbar-profile { display: block; text-decoration: none; }
.topbar-profile:hover { text-decoration: none; }
.topbar-profile-av, .nav-drawer-av {
  position: relative;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex: none;
  background: var(--hv2-av-0); color: var(--hv2-av-text);
  font-weight: 700; font-size: 13px;
}
.topbar-profile-av img, .nav-drawer-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* The dashboard no longer hides the top bar on desktop: it carries the bell and profile photo. */
#app-topbar { gap: 8px; }

/* Narrow layout: the brand is centred in the space between the hamburger (left) and the bell /
   profile photo (right); those controls keep their positions. */
@media (max-width: 768px) {
  #app-topbar .topbar-brand { flex: 1; min-width: 0; justify-content: center; }
}

/* ── Navigation: drawer (mobile web) and left menu (desktop) share .menu-* ── */
body.nav-drawer-open { overflow: hidden; }
.nav-drawer { position: fixed; inset: 0; z-index: 400; display: flex; }
.nav-drawer[hidden] { display: none; }
.nav-drawer-scrim { position: absolute; inset: 0; background: var(--hv2-scrim); }
.nav-drawer-panel {
  position: relative;
  width: min(328px, 88vw); height: 100%;
  background: var(--hv2-surface); color: var(--hv2-ink);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--hv2-shadow);
}
.nav-drawer-head {
  position: relative; flex: none;
  background: var(--hv2-drawer-head); color: var(--hv2-on-solid);
  padding: 28px 18px 20px; overflow: hidden;
}
.nav-drawer-head::before, .nav-drawer-head::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.nav-drawer-head::before { right: -40px; top: -50px; width: 190px; height: 190px; background: var(--hv2-drawer-head-2); }
.nav-drawer-head::after { right: 50px; bottom: -60px; width: 100px; height: 100px; background: var(--hv2-gold); opacity: 0.9; }
.nav-drawer-close {
  position: absolute; right: 6px; top: 6px; z-index: 1;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border: none; background: none; color: var(--hv2-on-solid);
}
.nav-drawer-who { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.nav-drawer-av { width: 60px; height: 60px; font-size: 20px; border: 3px solid var(--hv2-gold); background: var(--hv2-on-solid); color: var(--hv2-drawer-head); }
.nav-drawer-hello { font-size: 12px; opacity: 0.85; }
.nav-drawer-name { font-size: 21px; font-weight: 700; letter-spacing: -0.3px; }
.nav-drawer-viewprofile {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 10px; padding: 0 16px;
  border: none; border-radius: 12px; background: var(--hv2-gold); color: var(--hv2-on-gold);
  font-size: 13px; font-weight: 700;
}
.nav-drawer-body { flex: 1; overflow-y: auto; padding: 12px 12px 24px; }

.menu-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.menu-sec {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 56px; padding: 0 10px; border-radius: 16px;
  border: 1.5px solid transparent; background: none; text-align: left;
  color: var(--hv2-ink); font-size: 15px; font-weight: 700;
}
.menu-sec:hover { background: var(--hv2-hover); }
.menu-sec.active { background: var(--hv2-tile); color: var(--hv2-btn-text); border-color: var(--hv2-blue); }
/* Section holding the current route: tinted heading in the section's colour, no border (the border is Home's). */
.menu-sec.sec-active, .menu-sec.sec-active:hover { background: var(--menu-fill); color: var(--menu-fill-ink); }
.menu-sec.sec-active .menu-sec-icon, .menu-sec.sec-active .menu-badge { background: var(--hv2-surface); }
.menu-sec.sec-active .menu-chev { color: var(--menu-fill-ink); }
.menu-sec-icon {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--menu-tone); background: var(--menu-tint);
}
.menu-tone-blue { --menu-tone: var(--hv2-blue); --menu-tint: var(--hv2-blue-tint); --menu-ink: var(--hv2-blue-ink); }
.menu-tone-green { --menu-tone: var(--hv2-green); --menu-tint: var(--hv2-green-tint); --menu-ink: var(--hv2-green-ink); --menu-fill: var(--hv2-g-fill); --menu-fill-ink: var(--hv2-g-ink); --menu-bar: var(--hv2-g-bar); --menu-sub: var(--hv2-g-sub); --menu-guide: var(--hv2-g-guide); }
.menu-tone-orange { --menu-tone: var(--hv2-orange-icon); --menu-tint: var(--hv2-orange-tint); --menu-ink: var(--hv2-orange-ink); --menu-fill: var(--hv2-o-fill); --menu-fill-ink: var(--hv2-o-ink); --menu-bar: var(--hv2-o-bar); --menu-sub: var(--hv2-o-sub); --menu-guide: var(--hv2-o-guide); }
.menu-tone-purple { --menu-tone: var(--hv2-purple); --menu-tint: var(--hv2-purple-tint); --menu-ink: var(--hv2-purple-ink); --menu-fill: var(--hv2-p-fill); --menu-fill-ink: var(--hv2-p-ink); --menu-bar: var(--hv2-p-bar); --menu-sub: var(--hv2-p-sub); --menu-guide: var(--hv2-p-guide); }
.menu-sec-label { flex: 1; }
.menu-badge {
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  color: var(--menu-ink); background: var(--menu-tint);
}
.menu-chev { color: var(--hv2-muted); display: flex; transition: transform 0.15s; }  /* collapsed: points down */
.menu-chev.open { transform: rotate(180deg); }              /* expanded: points up */
.menu-items { list-style: none; display: flex; flex-direction: column; gap: 0; margin: 2px 0 6px 29px; border-left: 2px solid var(--menu-guide); }
.menu-items[hidden] { display: none; }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 40px; padding: 0 10px 0 14px; margin-left: -2px; border-radius: 0 10px 10px 0;
  border: none; border-left: 3px solid transparent; background: none; text-align: left;
  font-size: 13px; font-weight: 400; color: var(--hv2-sub-text); text-decoration: none;
}
.menu-item:hover { background: var(--hv2-hover); text-decoration: none; }
.menu-item.active { background: var(--menu-sub); border-left-color: var(--menu-bar); color: var(--menu-fill-ink); font-weight: 700; }
.menu-item-label { flex: 1; }
.menu-wip {
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: var(--hv2-wip-bg); color: var(--hv2-wip-text);
}
.menu-sec:focus-visible, .menu-item:focus-visible, .hv2-tab:focus-visible, .hv2-card-btn:focus-visible,
.hv2-viewall:focus-visible, .hv2-sport:focus-visible, .hv2-dot:focus-visible, .nav-drawer-viewprofile:focus-visible,
.nav-drawer-close:focus-visible, .hv2-create-btn:focus-visible, .hv2-slide-link:focus-visible {
  outline: 3px solid var(--hv2-blue); outline-offset: 2px;
}
/* Desktop left menu: on the light theme the menu uses the fixed colours above. On the dark / amber
   themes the rail itself is dark, so idle text and hover follow the theme there; selected and
   active-section items keep their fixed colours (they carry their own light fill). */
body:not([data-theme="light"]) .side-nav-items .menu-sec:not(.active):not(.sec-active),
body:not([data-theme="light"]) .side-nav-items .menu-item:not(.active) { color: var(--color-text); }
body:not([data-theme="light"]) .side-nav-items .menu-sec:hover:not(.active):not(.sec-active),
body:not([data-theme="light"]) .side-nav-items .menu-item:hover:not(.active) { background: var(--color-surface-alt); }
body:not([data-theme="light"]) .side-nav-items .menu-sec:not(.sec-active) .menu-chev { color: var(--color-text-muted); }
.side-nav-items { overflow-y: auto; }
.side-nav-items .menu-sec { min-height: 48px; font-size: 14px; }
.side-nav-items .menu-sec-icon { width: 34px; height: 34px; }

/* ── WIP strip (Tournaments, Tournament teams) ── */
.wip-strip {
  margin: 0 0 16px; padding: 10px 14px; border-radius: 12px;
  background: var(--hv2-wip-bg); color: var(--hv2-wip-text);
  font-size: 13px; font-weight: 600; line-height: 1.4;
}

/* ── Home page ── */
.hv2-page { padding-bottom: 96px; background: var(--hv2-page); }
.hv2-container { max-width: 720px; margin: 0 auto; padding: 8px 16px 0; }
.hv2-greeting-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hv2-greeting { min-width: 0; }
.hv2-greeting-prefix { font-size: 14px; color: var(--hv2-muted); }
.hv2-greeting-line { font-size: 24px; font-weight: 700; line-height: 1.15; letter-spacing: -0.4px; overflow-wrap: anywhere; }
.hv2-greeting-name { color: var(--hv2-blue); }
.hv2-sports {
  display: flex; align-items: center; gap: 2px; flex: none; max-width: 52%;
  overflow-x: auto; scrollbar-width: none;
  background: var(--hv2-surface); border: 1px solid var(--hv2-border);
  border-radius: 18px; padding: 3px 4px; margin-top: 2px;
}
.hv2-sports::-webkit-scrollbar { height: 0; }
.hv2-sport {
  width: 30px; height: 30px; flex: none; border-radius: 50%; padding: 0;
  border: 2px solid transparent; background: none;
  display: flex; align-items: center; justify-content: center;
}
.hv2-sport svg { width: 20px; height: 20px; }
.hv2-sport.selected { border-color: var(--hv2-blue); background: var(--hv2-tile); }

.hv2-banner { margin-top: 14px; }
.hv2-carousel { position: relative; }
.hv2-viewport { position: relative; overflow: hidden; border-radius: 18px; aspect-ratio: 3 / 1; touch-action: pan-y; background: var(--hv2-drawer-head); }
.hv2-track { display: flex; height: 100%; transition: transform 0.35s ease; }
.hv2-track.hv2-no-transition { transition: none; }
@media (prefers-reduced-motion: reduce) { .hv2-track { transition: none; } }
.hv2-slide { position: relative; flex: 0 0 100%; height: 100%; display: block; color: var(--hv2-on-solid); }
.hv2-slide img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.hv2-link-icon { position: absolute; top: 10px; right: 12px; color: var(--hv2-on-solid); filter: drop-shadow(0 1px 2px var(--hv2-scrim)); }
.hv2-ad-tag {
  position: absolute; right: 12px; bottom: 10px;
  font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 6px;
  border: 1px solid var(--hv2-on-solid); color: var(--hv2-on-solid); background: var(--hv2-scrim);
}
.hv2-fallback-art { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: var(--hv2-drawer-head); text-align: center; padding: 0 12px; }
.hv2-fallback-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hv2-fallback-word { position: relative; font-size: 32px; font-weight: 800; letter-spacing: -0.5px; color: var(--hv2-on-solid); }
.hv2-fallback-accent { color: var(--hv2-gold); }
.hv2-fallback-tag { position: relative; font-size: 13px; font-weight: 600; color: var(--hv2-on-solid-soft); }
.hv2-dots { display: flex; justify-content: center; align-items: center; gap: 0; height: 24px; margin-top: 2px; }
.hv2-dot { width: 24px; height: 24px; padding: 0; border: none; background: none; display: flex; align-items: center; justify-content: center; }
.hv2-dot::before { content: ""; width: 6px; height: 6px; border-radius: 3px; background: var(--hv2-dot-idle); transition: width 0.2s; }
.hv2-dot.active::before { width: 18px; background: var(--hv2-blue); }

.hv2-tabs { display: flex; gap: 10px; margin-top: 6px; }
.hv2-tab {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 10px;
  border-radius: 16px; border: 1px solid var(--hv2-border); background: var(--hv2-surface);
  color: var(--hv2-ink); text-align: left;
}
.hv2-tab.selected { border: 2px solid var(--hv2-blue); background: var(--hv2-tile); color: var(--hv2-ink); }
.hv2-tab-icon {
  width: 56px; height: 56px; border-radius: 16px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--hv2-tab-tint);
}
.hv2-tab-icon svg { width: 40px; height: 40px; display: block; }
.hv2-tab-games { --hv2-tab-tone: var(--hv2-blue); --hv2-tab-tint: var(--hv2-blue-tint); }
.hv2-tab-groups { --hv2-tab-tone: var(--hv2-green); --hv2-tab-tint: var(--hv2-green-tint); }
.hv2-tab-text { display: flex; flex-direction: column; min-width: 0; }
.hv2-tab-title { font-size: 12px; font-weight: 600; }
.hv2-tab-sub { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.hv2-count { font-size: 22px; font-weight: 700; line-height: 1.2; min-width: 1ch; }
.hv2-tab-sublabel { font-size: 12px; color: var(--hv2-muted); }

.hv2-panel { margin-top: 4px; }
.hv2-panel-head { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 6px; }
.hv2-panel-title { font-size: 18px; font-weight: 700; letter-spacing: -0.2px; }
.hv2-viewall { min-height: 44px; padding: 0 4px; border: none; background: none; font-size: 13px; font-weight: 600; color: var(--hv2-blue); }
.hv2-list { display: flex; flex-direction: column; gap: 10px; }
/* 1100px and up: game and group cards in two columns (each card keeps its own layout). */
@media (min-width: 1100px) {
  .hv2-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.hv2-empty, .hv2-error {
  padding: 18px 14px; border-radius: 16px; background: var(--hv2-surface); border: 1px solid var(--hv2-border);
  color: var(--hv2-muted); font-size: 14px;
}
.hv2-error { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hv2-retry { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--hv2-border); background: var(--hv2-surface); color: var(--hv2-ink); font-weight: 600; }
.hv2-skeleton {
  height: 100px; border-radius: 16px; margin-bottom: 10px;
  background: linear-gradient(90deg, var(--hv2-surface) 25%, var(--hv2-hover) 50%, var(--hv2-surface) 75%);
  background-size: 200% 100%; animation: dbSkeleton 1.4s infinite linear;
}
@media (prefers-reduced-motion: reduce) { .hv2-skeleton { animation: none; } }

/* Shared card: left tile | main | count + button. */
.hv2-card { display: flex; gap: 12px; padding: 12px; border-radius: 16px; background: var(--hv2-surface); border: 1px solid var(--hv2-border); }
.hv2-card-main { flex: 1; min-width: 0; }
.hv2-card-titlerow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hv2-card-title { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.hv2-pill { font-size: 11px; }
.hv2-card-detail { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--hv2-muted); margin-top: 3px; overflow-wrap: anywhere; }
.hv2-card-desc {
  font-size: 12px; color: var(--hv2-muted); margin-top: 3px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hv2-card-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; flex: none; }
.hv2-card-count { text-align: right; }
.hv2-card-count-n { display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; font-size: 14px; font-weight: 700; }
/* Row icons: 16px, decorative, never shrink or drop onto their own line. */
.hv2-row-icon { display: flex; flex: none; width: 16px; height: 16px; }
.hv2-row-icon svg { width: 16px; height: 16px; display: block; }
.hv2-card-detail-text { min-width: 0; }
.hv2-card-count-l { font-size: 12px; color: var(--hv2-muted); }
.hv2-card-btn {
  display: flex; align-items: center; min-height: 44px; padding: 0 14px; border: none; border-radius: 12px;
  background: var(--hv2-btn-bg); color: var(--hv2-btn-text); font-size: 12px; font-weight: 700; white-space: nowrap;
}
.hv2-datetile {
  width: 48px; height: 62px; border-radius: 12px; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--hv2-green-ink); background: var(--hv2-green-tint);
}
.hv2-datetile span { font-size: 11px; font-weight: 600; }
.hv2-datetile strong { font-size: 21px; font-weight: 700; line-height: 1.1; }
.hv2-logotile {
  width: 52px; height: 52px; border-radius: 14px; flex: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center; background: var(--hv2-hover);
}
.hv2-logotile img { width: 100%; height: 100%; object-fit: cover; }
/* Avatars. Fixed dimensions so initials / images / "+N" align (no content-driven sizing). */
.hv2-avstack { display: flex; align-items: center; height: 24px; margin-top: 7px; }
.hv2-av {
  position: relative; width: 22px; height: 22px; border-radius: 50%; flex: none; /* no overflow:hidden: it would clip the tooltip; the photo is rounded itself */
  border: 2px solid var(--hv2-surface); margin-left: -8px;
  display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  color: var(--hv2-av-text); font-size: 9px; font-weight: 700;
}
.hv2-av:first-child { margin-left: 0; }
.hv2-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
/* Instant tooltip (hover, keyboard focus, tap-to-focus): text comes from data-tip, drawn above the avatar. */
.hv2-av[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 200px; box-sizing: border-box;
  padding: 5px 8px; border-radius: 8px;
  background: var(--hv2-ink); color: var(--hv2-on-solid);
  font-size: 12px; font-weight: 600; line-height: 1.3; text-align: center; white-space: normal; overflow-wrap: anywhere;
  opacity: 0; visibility: hidden; pointer-events: none; z-index: 30;
}
/* The first avatar sits near the card's left edge: anchor its tooltip to the left so it stays on screen. */
.hv2-av[data-tip]:first-child::after { left: 0; transform: none; }
.hv2-av[data-tip]:hover, .hv2-av[data-tip]:focus { z-index: 20; outline: none; }
.hv2-av[data-tip]:hover::after, .hv2-av[data-tip]:focus::after { opacity: 1; visibility: visible; }
.hv2-av[data-tip]:focus-visible { box-shadow: 0 0 0 2px var(--hv2-blue); }
.hv2-av-c0 { background: var(--hv2-av-0); } .hv2-av-c1 { background: var(--hv2-av-1); } .hv2-av-c2 { background: var(--hv2-av-2); }
.hv2-av-c3 { background: var(--hv2-av-3); } .hv2-av-c4 { background: var(--hv2-av-4); } .hv2-av-c5 { background: var(--hv2-av-5); }
.hv2-av-more { width: 24px; height: 24px; background: var(--hv2-surface); border: 1px solid var(--hv2-border); font-size: 10px; font-weight: 600; color: var(--hv2-ink); }

/* Create Game card. */
.hv2-create { margin-top: 14px; }
.hv2-create-card {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px;
  background: var(--hv2-green-soft);
  border: 1px solid var(--hv2-green-edge);
}
.hv2-create-icon {
  width: 44px; height: 44px; border-radius: 50%; flex: none; color: var(--hv2-green);
  display: flex; align-items: center; justify-content: center;
  background: var(--hv2-green-tint);
}
.hv2-create-title { font-size: 14px; font-weight: 700; color: var(--hv2-green-ink); }
.hv2-create-body { font-size: 12px; color: var(--hv2-green-body); margin-top: 2px; }
.hv2-create-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; margin-top: 8px;
  border-radius: 14px; background: var(--hv2-green); color: var(--hv2-on-solid); font-weight: 700; font-size: 14px; text-decoration: none;
}
.hv2-create-btn:hover { text-decoration: none; filter: brightness(1.05); }

@media (min-width: 769px) {
  /* Desktop: Home fills the area right of the left menu (24px side padding). The banner is
     100% of that area, left-aligned, and no wider than 1400px so a 3:1 image stays under ~467px tall. */
  .hv2-container { max-width: none; margin: 0; padding: 16px 24px 0; }
  .hv2-banner { width: 100%; max-width: 1400px; }
  .hv2-viewport { width: 100%; height: auto; aspect-ratio: 3 / 1; }
  .hv2-slide img { object-position: center; }
  .hv2-sports { max-width: 60%; }
}

.icon-badge {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-surface-alt) 100%);
  color: var(--color-cta);
}
.icon-badge-cta { color: var(--color-cta); }
.icon-badge-warning { color: var(--color-warning); }
.icon-badge-success { color: var(--color-success); }
.icon-badge-danger { color: var(--color-danger); }

.page-profile, .page-edit-profile, .page-settings { max-width: 560px; margin: 0 auto; }
.profile-cover { position: relative; height: 140px; border-radius: var(--radius-lg); overflow: hidden; background: var(--color-cta); color: var(--color-cta-text); }
.profile-cover-img, .profile-cover-fallback, .profile-cover-fallback svg { width: 100%; height: 140px; object-fit: cover; display: block; }
.profile-cover-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; }
.profile-icon-btn { width: 40px; height: 40px; border-radius: 999px; border: 0; background: var(--color-cta); color: var(--color-cta-text); display: inline-flex; align-items: center; justify-content: center; }
.profile-cover { z-index: 0; }
.profile-identity { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; margin-top: -44px; }
.profile-avatar-photo, .profile-avatar-fallback { width: 88px; height: 88px; border-radius: 999px; border: 4px solid var(--color-bg); object-fit: cover; background: var(--color-cta); color: var(--color-cta-text); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.profile-name { margin: 8px 0 0; }
.profile-nick, .profile-muted { color: var(--color-text-muted); font-size: 0.85rem; }
.profile-stats { display: flex; gap: 8px; margin: 16px 0; }
.profile-stat { flex: 1; min-height: 112px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.profile-stat-num { font-weight: 800; height: 24px; line-height: 24px; }
.profile-stat-label { color: var(--color-text-muted); font-size: 0.78rem; height: 20px; line-height: 20px; }
.profile-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 16px; margin-bottom: 16px; }
.profile-card-head, .profile-skill-row, .profile-group-row, .profile-photo-actions, .profile-photo-row, .settings-link-row, .settings-delete-row, .profile-game-row, .profile-skill-card { display: flex; align-items: center; gap: 10px; }
.profile-card-head, .profile-skill-card, .profile-game-row, .settings-link-row, .settings-delete-row { min-height: 48px; }
.profile-card h3 { margin: 0; }
.profile-view-all, .profile-group-tile { background: transparent; border: 0; color: var(--color-cta); font-weight: 700; }
.profile-skill-row, .profile-group-row { flex-wrap: wrap; margin-top: 12px; }
.profile-skill-card { background: var(--color-surface-alt); border-radius: var(--radius-md); padding: 8px 12px; min-width: 160px; }
.profile-skill-name, .profile-game-title, .settings-link-label { font-weight: 700; height: 22px; line-height: 22px; }
.profile-skill-level, .profile-game-meta { color: var(--color-text-muted); font-size: 0.78rem; height: 18px; line-height: 18px; }
.profile-group-tile { flex-direction: column; width: 96px; color: var(--color-text); }
.profile-group-logo, .profile-group-initials { width: 48px; height: 48px; border-radius: var(--radius-md); object-fit: cover; }
.profile-group-initials { display: flex; align-items: center; justify-content: center; background: var(--color-cta); color: var(--color-cta-text); font-weight: 700; }
.profile-group-name { height: 36px; line-height: 18px; text-align: center; font-size: 0.78rem; }
.profile-game-row, .settings-link-row, .settings-delete-row { width: 100%; text-align: left; background: transparent; border: 0; color: inherit; text-decoration: none; }
.profile-game-copy, .settings-link-copy { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.profile-logout { width: 100%; height: 48px; background: var(--color-surface); color: var(--color-danger); border: 1px solid var(--color-danger); }
.profile-admin-link { width: 100%; height: 40px; margin-top: 8px; }
.profile-photo-actions { margin-top: 12px; flex-wrap: wrap; }
.settings-kicker { font-size: 0.75rem; letter-spacing: 0.04em; color: var(--color-text-muted); margin: 16px 0 8px; }
.settings-kicker-danger { color: var(--color-danger); }
.settings-chevron { margin-left: auto; color: var(--color-text-muted); }
.settings-toggle { width: 44px; height: 24px; margin-left: auto; }
.settings-delete-row { border: 1px solid var(--color-danger); border-radius: var(--radius-md); padding: 8px 12px; color: var(--color-danger); }
.settings-link-label { flex: 1; }
.wizard-progress { display: flex; gap: 6px; margin: 8px 0; }
.wizard-seg { flex: 1; height: 8px; border-radius: 999px; background: var(--color-surface-alt); }
.wizard-seg.on { background: var(--color-cta); }
