/* ============================================================
   DKWallet — Prototype design system
   Source of truth: payment.v2.html + design-system-interaction.html
   Telegram mini-app · dark · lime accent · 430px column
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* surfaces */
  --bg:          #06080a;
  --surface:     #14171c;
  --card:        #1a1e25;
  --card-2:      #20252e;
  --input-bg:    #272d37;
  --input-bg-h:  #2f3742;
  --input-bg-a:  #3a4351;
  --hairline:    rgba(255, 255, 255, 0.08);
  --map-bg:      #0a0e13;

  /* text */
  --text:        #f0f3f6;
  --text-2:      #b0b8c4;
  --text-3:      #8a93a0;
  --muted:       #b0b8c4;

  /* accent (lime) */
  --accent:      #c4f23c;
  --accent-h:    #d3ff52;
  --accent-mute: #9bc230;
  --accent-ink:  #0a0c0e;
  --accent-soft: rgba(196, 242, 60, 0.12);

  /* semantic */
  --error:       #ff6b6b;
  --error-bg:    #2a1c20;
  --success:     #62d39a;
  --success-bg:  rgba(98, 211, 154, 0.12);
  --warn:        #f2c14e;
  --warn-bg:     rgba(242, 193, 78, 0.12);
  --focus-ring:  rgba(196, 242, 60, 0.22);
  --error-ring:  rgba(255, 107, 107, 0.20);

  /* glass */
  --glass-bg:        rgba(30, 36, 44, 0.72);
  --glass-bg-sheet:  rgba(30, 36, 44, 0.92);
  --glass-blur:      blur(24px) saturate(180%);

  /* elevation shadows */
  --sh-up:   0 -16px 40px rgba(0, 0, 0, 0.45);
  --sh-up-2: 0 -8px 24px rgba(0, 0, 0, 0.5);
  --sh-down: 0 8px 24px rgba(0, 0, 0, 0.45);
  --sh-pop:  0 8px 24px rgba(0, 0, 0, 0.5);
  --sh-pin:  0 4px 12px rgba(0, 0, 0, 0.5);

  /* tab bar inactive icon */
  --tab-ico-off: #8a93a0;

  /* geometry */
  --radius:      14px;
  --radius-sm:   12px;
  --radius-xs:   10px;
  --radius-md:   16px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-m:    14px; /* legacy alias of --radius */
  --radius-pill: 999px;
  --control-height: 52px;
  --control-padding-x: 16px;
  --page-padding-x: 16px;
  --max-w: 430px;

  /* motion */
  --t-fast:  0.15s;
  --t-med:   0.22s;
  --t-sheet: 0.28s cubic-bezier(0.16, 1, 0.3, 1);

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  color-scheme: dark;
}

/* ---- Light theme: white surfaces, lime accent kept, black ink on lime ---- */
:root[data-theme="light"] {
  /* surfaces */
  --bg:          #f3f5f7;
  --surface:     #ffffff;
  --card:        #ffffff;
  --card-2:      #f1f3f6;
  --input-bg:    #eceff3;
  --input-bg-h:  #e2e6ec;
  --input-bg-a:  #d7dce4;
  --hairline:    rgba(15, 20, 28, 0.10);
  --map-bg:      #e6ecf1;

  /* text */
  --text:        #0e1218;
  --text-2:      #495260;
  --text-3:      #6b7480; /* was #828c99 — below AA on white for small text */
  --muted:       #495260;

  /* accent (lime) — black ink on lime like Uber/fitness refs */
  --accent:      #c4f23c;
  --accent-h:    #b8e92c;
  --accent-mute: #6d8d1c;
  --accent-ink:  #0a0c0e;
  --accent-soft: rgba(143, 178, 30, 0.16);

  /* semantic */
  --error:       #dd4540;
  --error-bg:    #fdeceb;
  --success:     #2c9b68;
  --success-bg:  rgba(44, 155, 104, 0.13);
  --warn:        #c08a0c;
  --warn-bg:     rgba(217, 160, 20, 0.15);
  --focus-ring:  rgba(143, 178, 30, 0.30);
  --error-ring:  rgba(221, 69, 64, 0.22);

  /* glass */
  --glass-bg:        rgba(255, 255, 255, 0.74);
  --glass-bg-sheet:  rgba(255, 255, 255, 0.94);

  /* elevation shadows — soft, cool slate, ~16% */
  --sh-up:   0 -16px 40px rgba(15, 20, 28, 0.12);
  --sh-up-2: 0 -8px 24px rgba(15, 20, 28, 0.12);
  --sh-down: 0 8px 24px rgba(15, 20, 28, 0.12);
  --sh-pop:  0 8px 24px rgba(15, 20, 28, 0.16);
  --sh-pin:  0 4px 12px rgba(15, 20, 28, 0.16);

  /* tab bar inactive icon — dark #333 on light surface */
  --tab-ico-off: #333333;

  color-scheme: light;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
button { font-family: inherit; }
::selection { background: var(--accent-soft); }

/* ---------- Page frame ---------- */
.page {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 96px;
}
.page.has-tabbar { padding-bottom: 104px; }
.page.has-footer { padding-bottom: 200px; }

/* ---------- Header ---------- */
.header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(16px + var(--tg-content-top, 0px)) 16px 12px 12px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 30;
}
.header.scrolled { box-shadow: var(--sh-down); }
.header h1 { font-size: 22px; font-weight: 400; color: var(--text); flex: 1; min-width: 0; }
.header .header-action {
  margin-left: auto;
  background: none; border: 0; cursor: pointer; color: var(--text-2);
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast), color var(--t-fast);
}
.header .header-action:hover { background: var(--input-bg-h); color: var(--text); }

.back-btn {
  background: none; border: 0; cursor: pointer; color: var(--text);
  padding: 4px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-xs); transition: background var(--t-fast); flex-shrink: 0;
}
.back-btn:hover { background: var(--input-bg-h); }

/* ---------- Content ---------- */
.content {
  flex: 1;
  padding: 4px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.content.tight { gap: 10px; }

.lede {
  font-size: 14px; color: var(--text-2); line-height: 1.5;
  padding: 0 4px;
}
.section-label {
  font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-3); padding: 6px 4px 0;
}

/* ---------- Hero ---------- */
.hero { padding: 8px 4px 4px; display: flex; flex-direction: column; gap: 6px; }
.hero h1 { font-size: 22px; font-weight: 400; }
.hero .subtitle { font-size: 14px; color: var(--text-2); line-height: 1.5; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.card-title {
  font-size: 16px; font-weight: 400; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-2);
}
.card-head {
  padding: 18px 18px 14px; display: flex; align-items: center; gap: 8px;
}
.card-head .card-title { text-transform: none; letter-spacing: normal; font-size: 18px; color: var(--text); }
.card-head-pos { font-size: 13px; color: var(--text-3); font-family: var(--font-mono); font-feature-settings: "tnum"; }
.card-body { display: flex; flex-direction: column; gap: 16px; padding: 14px 18px 22px; }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.label {
  font-size: 14px; font-weight: 400; color: var(--text-2);
  display: flex; align-items: center; gap: 4px;
}
.label .req { color: var(--accent-mute); }
.field-hint { font-size: 13px; color: var(--text-3); line-height: 1.45; }

.input, .select {
  width: 100%;
  background: var(--input-bg);
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  height: var(--control-height);
  padding: 0 var(--control-padding-x);
  transition: background var(--t-fast), box-shadow var(--t-fast);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.input::placeholder { color: var(--text-3); }
.input:hover:not(:focus), .select:hover:not(:focus) { background: var(--input-bg-h); }
.input:focus, .select:focus { background: var(--input-bg-h); box-shadow: 0 0 0 2px var(--accent); }
.input.error, .select.error, .file-wrap.error, .amount-control.error {
  background: var(--error-bg); box-shadow: 0 0 0 2px var(--error);
}
textarea.input { height: auto; resize: vertical; min-height: 92px; padding: 14px; line-height: 1.45; }

.error-msg { font-size: 14px; color: var(--error); display: none; }
.field.has-error .error-msg { display: block; }

/* ---------- Select with display overlay ---------- */
.select-wrap { position: relative; }
.select-wrap .select { padding-right: 44px; }
.dropdown-chevron { width: 10px; height: 6px; flex-shrink: 0; color: var(--text-2); }
.select-wrap > .dropdown-chevron {
  position: absolute; right: var(--control-padding-x); top: 50%;
  transform: translateY(-50%); pointer-events: none;
}
.select-display {
  position: absolute; inset: 0; display: flex; align-items: center; gap: 10px;
  padding: 0 44px 0 var(--control-padding-x); pointer-events: none;
  font-size: 16px; color: var(--text);
}
.select-display .fi { width: 22px; height: 16px; border-radius: 2px; flex-shrink: 0; }
.select-display .ico { flex-shrink: 0; }
.select-display-placeholder { color: var(--text-3); }
.select-wrap.has-display .select { color: transparent; }
.select-wrap.is-locked .select { pointer-events: none; opacity: 0.45; cursor: not-allowed; }
.select-wrap.is-locked .dropdown-chevron { opacity: 0.45; }
.select-wrap.is-locked.has-display .select-display { opacity: 0.45; }

input[type="file"] { display: none; }

/* ---------- Buttons ---------- */
.btn {
  width: 100%; background: var(--accent); border: 0; border-radius: var(--radius-pill);
  color: var(--accent-ink); font-family: inherit; font-size: 16px; font-weight: 500;
  height: var(--control-height); padding: 0 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background var(--t-fast), transform 0.1s, color var(--t-fast), opacity var(--t-fast);
}
.btn:hover { background: var(--accent-h); }
.btn:active { transform: scale(0.99); }
.btn:disabled, .btn.is-disabled {
  opacity: 0.55; cursor: not-allowed; transform: none;
  background: var(--input-bg-h); color: var(--text-3);
}
.btn-secondary {
  width: 100%; height: var(--control-height); background: var(--input-bg); border: 0;
  border-radius: var(--radius-pill); color: var(--text); font-size: 16px; font-weight: 500;
  font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer; transition: background var(--t-fast), transform 0.1s;
}
.btn-secondary:hover { background: var(--input-bg-h); }
.btn-secondary:active { transform: scale(0.99); }
.btn-secondary svg { flex-shrink: 0; color: var(--text-2); }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 12px; }
.btn-row .btn, .btn-row .btn-secondary { flex: 1; }
.btn-danger { color: var(--error); }
.btn-danger:hover { background: var(--error-bg); }
.btn.btn-danger { background: var(--error); color: #fff; }
.btn.btn-danger:hover { background: var(--error); filter: brightness(0.94); }

.link-btn {
  background: none; border: 0; color: var(--accent); cursor: pointer;
  font-family: inherit; font-size: 14px; padding: 6px 4px; text-align: left;
}
.link-btn:hover { color: var(--accent-h); }

/* ---------- Fixed footer (glass) ---------- */
.footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  padding: 18px 16px 28px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top-left-radius: 22px; border-top-right-radius: 22px;
  z-index: 20; box-shadow: var(--sh-up);
}
.footer.plain { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 0; box-shadow: var(--sh-up-2); }
.footer-inner { width: 100%; max-width: var(--max-w); margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.footer .terms { margin: 0; }

.terms { font-size: 13px; color: var(--text-3); text-align: center; line-height: 1.5; padding: 0 8px; }
.terms a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
.terms a:hover { color: var(--text); }

/* ---------- Bottom tab bar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border-top-left-radius: 22px; border-top-right-radius: 22px;
  box-shadow: var(--sh-up); z-index: 25;
}
.tabbar-inner {
  max-width: var(--max-w); margin: 0 auto; display: flex; padding: 10px 24px 22px;
  justify-content: space-around;
}
.tab {
  background: none; border: 0; cursor: pointer; color: var(--text-3);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 600; font-family: inherit; padding: 4px 18px; border-radius: var(--radius-sm);
  transition: color var(--t-fast);
}
.tab svg { width: 24px; height: 24px; }
.tab:hover { color: var(--text-2); }
.tab.active { color: var(--text); }
/* Non-scrolling empty-state screens: drop the tab-bar shadow (nothing scrolls under it). */
#app:has(.empty) ~ .tabbar { box-shadow: none; }

/* ---------- List rows ---------- */
.list { display: flex; flex-direction: column; gap: 12px; }
.list-row {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  background: var(--card); border: 0; cursor: pointer; color: var(--text);
  padding: 14px 14px; border-radius: var(--radius); font-family: inherit;
  transition: background var(--t-fast); text-decoration: none;
}
.list-row:hover { background: var(--card-2); }
.list-row.static { cursor: default; }
.list-row.static:hover { background: var(--card); }
.row-ico {
  width: 42px; height: 42px; border-radius: var(--radius-pill); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; background: var(--input-bg);
  color: var(--text-2); font-size: 15px; overflow: hidden;
}
/* Row icons are uniformly neutral. Semantic meaning lives on amounts, pills and banners — not on the icon circles. */
.row-ico.accent, .row-ico.in, .row-ico.out { background: var(--input-bg); color: var(--text-2); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.row-title { font-size: 16px; color: var(--text); display: flex; align-items: center; gap: 7px; }
.row-sub { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.row-amount { font-size: 16px; font-feature-settings: "tnum"; }
.row-amount.in { color: var(--success); }
.row-amount.out { color: var(--text); }
.row-meta { font-size: 13px; color: var(--text-3); font-feature-settings: "tnum"; }
.row-chevron { color: var(--text-3); flex-shrink: 0; }

/* settings-style rows */
.list-row.setting .row-ico { width: 36px; height: 36px; background: var(--input-bg); border-radius: var(--radius-xs); }

/* ---------- Empty state ---------- */
.empty {
  background: var(--card); border-radius: var(--radius); padding: 36px 24px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
}
.empty .empty-ico {
  width: 56px; height: 56px; border-radius: var(--radius-pill); background: var(--input-bg);
  color: var(--text-3); display: flex; align-items: center; justify-content: center; margin-bottom: 8px;
}
.empty .empty-title { font-size: 18px; color: var(--text); }
.empty-desc { font-size: 14px; color: var(--text-3); line-height: 1.5; }
.empty .empty-desc { max-width: 30ch; }
.empty .btn, .empty .btn-secondary { margin-top: 14px; width: auto; min-width: 200px; padding: 0 24px; }

/* ---------- Guest welcome (profile tab, unauthenticated) ---------- */
.gw-card { background: var(--card); border-radius: var(--radius); padding: 24px 16px; display: flex; flex-direction: column; }
.gw-lead { text-align: center; margin-bottom: 24px; }
.gw-ico { width: 56px; height: 56px; background: var(--input-bg); border-radius: var(--radius-pill); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; color: var(--accent); }
.gw-ico svg { width: 28px; height: 28px; }
.gw-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.gw-sub { font-size: 13px; color: var(--text-2); line-height: 1.5; max-width: 280px; margin: 0 auto; }
.gw-benefits { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.gw-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px; background: var(--input-bg); border-radius: var(--radius-m); }
.gw-item-ico { color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.gw-item-ico svg { width: 20px; height: 20px; }
.gw-item-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.gw-item-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; line-height: 1.4; }
.gw-actions { display: flex; flex-direction: column; gap: 10px; }
.gw-btn-outline { background: transparent !important; border: 1.5px solid var(--accent); color: var(--accent); }
.gw-btn-outline:active { background: color-mix(in srgb, var(--accent) 10%, transparent) !important; }

/* ---------- Banner / callout ---------- */
.banner {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  background: var(--card); border-radius: var(--radius); font-size: 14px; color: var(--text-2); line-height: 1.5;
}
.banner.accent { background: var(--accent-soft); }
.banner.warn { background: var(--warn-bg); }
.banner.error { background: var(--error-bg); }
.banner .banner-ico { flex-shrink: 0; margin-top: 1px; }
.banner.accent .banner-ico { color: var(--accent); }
.banner.warn .banner-ico { color: var(--warn); }
.banner.error .banner-ico { color: var(--error); }
.banner strong { color: var(--text); font-weight: 400; }
.banner-action {
  margin-left: auto; align-self: center; background: none; border: 0; color: var(--accent);
  cursor: pointer; font-family: inherit; font-size: 14px; white-space: nowrap;
}

/* ---------- Status pill ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 12px; background: var(--input-bg); color: var(--text-2);
}
.pill.success { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.error { background: var(--error-bg); color: var(--error); }
.pill.accent { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.pill .pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: calc(28px + var(--control-height) + 36px); left: 50%;
  transform: translateX(-50%) translateY(8px); background: #1f242b; color: var(--text);
  font-size: 16px; padding: 12px 20px; border-radius: var(--radius-pill); width: max-content;
  max-width: calc(100% - 32px); text-align: center; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s; z-index: 300; box-shadow: var(--sh-pop);
}
.toast.err { background: var(--error-bg); color: var(--error); }
.toast.ok { background: var(--accent); color: var(--accent-ink); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Bottom sheet ---------- */
.sheet-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 200;
  display: flex; align-items: flex-end; justify-content: center; opacity: 0;
  pointer-events: none; transition: opacity var(--t-med) ease;
}
.sheet-overlay.open { opacity: 1; pointer-events: auto; }
.sheet {
  width: 100%; max-width: var(--max-w); background: var(--glass-bg-sheet);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border-top-left-radius: 22px; border-top-right-radius: 22px; padding: 8px 16px 24px;
  position: relative; transform: translateY(100%); transition: transform var(--t-sheet);
  max-height: 86vh; display: flex; flex-direction: column; box-shadow: var(--sh-up);
}
.sheet-overlay.open .sheet { transform: translateY(0); }
.sheet-handle { width: 100%; padding: 8px 0 14px; display: flex; justify-content: center; cursor: grab; touch-action: none; }
.sheet-handle::before { content: ''; width: 36px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.22); }
:root[data-theme="light"] .sheet-handle::before { background: rgba(15, 20, 28, 0.20); }
.sheet-header { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; padding-right: 40px; }
.sheet-title { flex: 1; min-width: 0; font-size: 22px; font-weight: 400; color: var(--text); }
.sheet-close {
  position: absolute; top: 16px; right: 16px; background: var(--input-bg-h); border: 0;
  width: 32px; height: 32px; border-radius: var(--radius-pill); color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background var(--t-fast); z-index: 1;
}
.sheet-close:hover { background: var(--input-bg-a); }
.sheet-subtitle { font-size: 14px; color: var(--text-2); margin: 0 0 32px; line-height: 1.5; }
.sheet-subtitle:empty { display: none; }
/* gutter so a focused input's 2px ring isn't clipped by the scroll edge (content stays aligned at 16px) */
.sheet-scroll { margin: 0 -16px; padding: 4px 16px; }
.sheet-body { overflow: visible; display: flex; flex-direction: column; gap: 12px; }
.sheet-search-wrap { margin-bottom: 10px; }
.sheet-search {
  width: 100%; background: var(--input-bg); border: 0; border-radius: var(--radius-sm); color: var(--text);
  font-size: 16px; font-family: inherit; height: var(--control-height); padding: 0 var(--control-padding-x); outline: none;
  transition: background var(--t-fast), box-shadow var(--t-fast);
}
.sheet-search:focus { background: var(--input-bg-h); box-shadow: 0 0 0 2px var(--accent); }
.sheet-list { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 4px 0; }
.sheet-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 16px; color: var(--text); transition: background var(--t-fast);
}
.sheet-item:hover { background: var(--input-bg); }
.sheet-item.selected { background: var(--input-bg-h); }
.sheet-item .fi { width: 22px; height: 16px; border-radius: 2px; flex-shrink: 0; }
.sheet-item .row-ico { width: 38px; height: 38px; }
.sheet-item-label { flex: 1; min-width: 0; }
.sheet-item-label small { display: block; color: var(--text-3); font-size: 13px; }
.sheet-item-code { color: var(--text-3); font-size: 14px; margin-left: auto; }
.sheet-item-check { color: var(--accent); flex-shrink: 0; }
.sheet-item-empty { padding: 24px 12px; text-align: center; color: var(--text-3); font-size: 14px; }
/* menu sheet (actions) */
.sheet-menu { display: flex; flex-direction: column; gap: 2px; }
.sheet-menu button {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; background: var(--input-bg);
  border: 0; cursor: pointer; color: var(--text); padding: 15px 16px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 16px; transition: background var(--t-fast);
}
.sheet-menu button:hover { background: var(--input-bg-h); }
.sheet-menu button svg { color: var(--text-2); flex-shrink: 0; }
.sheet-menu button.danger { color: var(--error); }
.sheet-menu button.danger svg { color: var(--error); }

/* ---------- Animations ---------- */
@keyframes shimmer { to { background-position: -220% 0; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.shake { animation: shake 0.33s ease; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 16px; height: 16px; border: 2px solid var(--text-3); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; }
.spinner.lg { width: 28px; height: 28px; border-width: 3px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Skeleton loading ---------- */
.skel { background: linear-gradient(90deg, var(--input-bg) 25%, var(--input-bg-h) 44%, var(--input-bg) 64%); background-size: 220% 100%; animation: shimmer 1.8s linear infinite; color: transparent; border-radius: 8px; }
.skel-line { height: 14px; border-radius: var(--radius-pill); }

/* ---------- Toggle switch ---------- */
.switch { position: relative; width: 46px; height: 28px; flex-shrink: 0; display: inline-block; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; background: var(--input-bg-h); border-radius: var(--radius-pill); transition: background var(--t-fast); }
.switch .thumb { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text-2); transition: transform var(--t-fast), background var(--t-fast); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked ~ .thumb { transform: translateX(18px); background: var(--accent-ink); }

.row-val { margin-left: auto; color: var(--text-3); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.toggle-row { display: flex; align-items: center; gap: 13px; padding: 4px 0; }
.toggle-row .tr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.toggle-row .tr-title { font-size: 16px; color: var(--text); }
.toggle-row .tr-sub { font-size: 13px; color: var(--text-3); line-height: 1.45; margin-top: 2px; }

/* ---------- Utilities ---------- */
.center { text-align: center; }
.muted { color: var(--text-3); }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }
.grow { flex: 1; }
.gap-8 { gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; }
.between { justify-content: space-between; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--hairline); }
.mt-4 { margin-top: 16px; } .mt-2 { margin-top: 8px; }
.fadeup { animation: fadeUp 0.3s ease both; }

/* ============================================================
   RESPONSIVE + TOP NAVIGATION + PUBLIC LANDING.
   Mobile-first base above is the Telegram-app column (430px).
   Desktop browsers (uxplay.pro/tennis) get a fixed top navbar
   (Главная / Корты / Теннисисты · Чаты / Профиль). Website guests
   (not logged in) get the public marketing landing on any width.
   ============================================================ */

@media (min-width: 768px)  { :root { --max-w: 600px; } }
@media (min-width: 1280px) { :root { --max-w: 900px; } }

/* ---- top navbar: floating glass pill island, centered (desktop + guest) ---- */
.topnav { display: none; }
.topnav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 60;
  width: max-content; max-width: calc(100vw - 24px);
  align-items: center; gap: 22px; padding: 8px 9px 8px 22px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: saturate(1.5) blur(20px); backdrop-filter: saturate(1.5) blur(20px);
  border: 1px solid color-mix(in srgb, var(--hairline) 80%, transparent);
  border-radius: var(--radius-pill);
  box-shadow: var(--sh-down);
}
.nav-left  { display: flex; align-items: center; gap: 18px; min-width: 0; }
.nav-right { display: flex; align-items: center; gap: 6px; }
.nav-brand { display: flex; align-items: center; gap: 9px; background: none; border: 0; cursor: pointer; color: var(--text); font-weight: 800; font-size: 18px; letter-spacing: -0.01em; padding: 0; }
.nav-brand svg { width: 26px; height: 26px; color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link  {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 0; cursor: pointer; color: var(--muted);
  font-size: 14px; font-weight: 600; letter-spacing: 0.01em;
  padding: 9px 14px; border-radius: var(--radius-pill); white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-link:hover  { color: var(--text); }
.nav-link.active { color: var(--text); background: color-mix(in srgb, var(--text) 9%, transparent); }
.nav-links .nav-ico { display: none; }
.nav-ico { position: relative; display: inline-flex; }
.nav-ico svg { width: 19px; height: 19px; }
.nav-badge { min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--radius-xs); background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.nav-ico .nav-badge { position: absolute; top: -6px; right: -8px; }
.nav-login { padding: 9px 22px; font-size: 14px; font-weight: 700; width: auto; border-radius: var(--radius-pill); }
.nav-icon-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--text-2); cursor: pointer; transition: background 0.15s, color 0.15s; }
.nav-icon-btn:hover { background: var(--input-bg); color: var(--text); }

/* hover dropdowns (Чаты sidebar · Профиль list) */
.nav-menu { position: relative; }
.nav-menu::after { content: ''; position: absolute; top: 100%; left: 0; right: 0; height: 12px; } /* hover bridge */
.nav-drop {
  position: absolute; top: calc(100% + 10px); right: 0; width: 300px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-md);
  box-shadow: 0 24px 60px rgba(0,0,0,.5); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
  z-index: 70;
}
.nav-menu:hover .nav-drop, .nav-drop:hover { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-drop-head  { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 8px; font-weight: 600; font-size: 13px; color: var(--muted); }
.nav-drop-all   { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 13px; }
.nav-drop-empty { padding: 18px 12px; color: var(--muted); font-size: 13px; text-align: center; }
.nav-drop-list  { display: flex; flex-direction: column; gap: 2px; }
.nav-drop-row   { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-xs); background: none; border: 0; cursor: pointer; color: var(--text); text-align: left; width: 100%; }
.nav-drop-row:hover { background: var(--card-2); }
.nav-drop-row .nav-ico svg { width: 18px; height: 18px; color: var(--muted); }
.nav-drop-row .pl-av { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px; }
.ndr-main { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 14px; }
.ndr-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ndr-last { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-drop-prof { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; border-bottom: 1px solid var(--hairline); margin-bottom: 6px; }
.ndp-av { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: 0 0 40px; display: inline-flex; align-items: center; justify-content: center; background: var(--card-2); font-weight: 700; }
.ndp-av img { width: 100%; height: 100%; object-fit: cover; }
.ndp-name { font-weight: 600; }

/* show navbar / hide bottom tabbar: on desktop OR for website guests (any width) */
@media (min-width: 1024px) {
  .topnav { display: flex; }
  .tabbar { display: none; }
  body { padding-top: 84px; }
  .page.has-tabbar { padding-bottom: 48px; }
  /* nav-links spell out sections, so the brand collapses to the ball logo (avoids "Корты · Корты") */
  .nav-brand span { display: none; }
}
body.guest .topnav { display: flex; }
body.guest .tabbar { display: none; }
body.guest { padding-top: 84px; }
@media (max-width: 1023px) {
  body.guest .nav-links { display: none; } /* guest mobile: brand + Войти only */
  .topnav { top: 10px; gap: 14px; padding: 6px 7px 6px 16px; }
  body.guest { padding-top: 70px; }
}

/* ---- public marketing landing ---- */
.home-page { max-width: none; width: 100%; height: auto; min-height: 100%; padding: 0; overflow-y: auto; align-items: stretch; }
.ln { width: 100%; max-width: 1040px; margin: 0 auto; padding: 12px 20px 64px; }
.ln-hero { text-align: center; padding: 40px 8px 26px; }
.ln-hero-ico { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.ln-hero-ico svg { width: 34px; height: 34px; }
.ln-h1 { font-size: clamp(26px, 4.4vw, 44px); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 14px; }
.ln-lead { font-size: clamp(15px, 1.8vw, 18px); color: var(--muted); max-width: 620px; margin: 0 auto; line-height: 1.5; }
.ln-cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 26px 0 8px; }
.ln-cta  { width: auto; padding: 13px 24px; display: inline-flex; align-items: center; gap: 9px; font-size: 15px; }
.ln-cta2 { width: auto; padding: 13px 22px; }
.btn-ghost { background: var(--card-2); color: var(--text); }
.btn-ghost:hover { background: var(--card); }
.ln-stats { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.ln-stat { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 14px 20px; min-width: 110px; }
.ln-stat-n { display: block; font-size: 26px; font-weight: 800; color: var(--accent); }
.ln-stat-l { font-size: 13px; color: var(--muted); }
.ln-sec { margin-top: 48px; }
.ln-h2 { font-size: clamp(20px, 2.6vw, 28px); font-weight: 700; text-align: center; margin: 0 0 22px; }
.ln-feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.ln-feat { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-md); padding: 22px 20px; }
.ln-feat-ico { width: 42px; height: 42px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.ln-feat h3 { font-size: 16px; margin: 0 0 6px; }
.ln-soon { display: inline-block; vertical-align: 2px; margin-left: 6px; padding: 2px 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; background: var(--accent-soft); color: var(--accent); }
.ln-feat p  { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }
.ln-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.ln-step { display: flex; gap: 14px; align-items: flex-start; }
.ln-step-n { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.ln-step h4 { margin: 4px 0 6px; font-size: 15px; }
.ln-step p  { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.ln-courts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.ln-court { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 14px 16px; color: var(--text); width: 100%; }
.ln-court.tappable { cursor: pointer; }
.ln-court.tappable:hover { border-color: var(--accent); }
.ln-court-ico { width: 38px; height: 38px; border-radius: var(--radius-xs); display: flex; align-items: center; justify-content: center; flex: 0 0 38px; background: var(--card-2); color: var(--muted); }
.ln-court-ico.school { background: var(--warn-bg); color: var(--warn); }
.ln-court-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ln-court-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ln-court-sub  { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ln-court-free { font-size: 13px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.ln-muted { color: var(--muted); text-align: center; }
.ln-final { margin-top: 56px; text-align: center; background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 40px 24px; }

/* ---- hero extras ---- */
.ln-eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: var(--radius-pill); padding: 6px 14px; margin-bottom: 16px; }
.ln-microtrust { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

/* ---- left-aligned section heads (gamify) ---- */
.ln-h2.left { text-align: left; }
.ln-lead.left { margin-left: 0; max-width: 520px; }

/* ---- gamification spotlight ---- */
.ln-gamify { background: linear-gradient(135deg, var(--accent-soft), var(--card)); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 32px 28px; display: grid; grid-template-columns: 1.25fr 1fr; gap: 28px; align-items: center; }
.ln-gamify-txt .ln-gx-grid { margin-top: 22px; }
.ln-gamify-txt h2 { margin-top: 0; }
.ln-gx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ln-gx { display: flex; gap: 12px; align-items: flex-start; }
.ln-gx-ico { flex: 0 0 38px; width: 38px; height: 38px; border-radius: var(--radius-xs); display: flex; align-items: center; justify-content: center; background: var(--card); border: 1px solid var(--hairline); color: var(--accent); }
.ln-gx h4 { margin: 3px 0 4px; font-size: 15px; }
.ln-gx p  { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }

/* gamification visual mock: live leaderboard + reliability ring */
.ln-gamify-viz { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ln-viz-card { background: color-mix(in srgb, var(--bg) 72%, transparent); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 16px; }
.ln-viz-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.ln-viz-head svg { width: 16px; height: 16px; color: var(--accent); }
.ln-viz-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius-sm); }
.ln-viz-board .ln-viz-row:nth-child(2) { background: var(--accent-soft); }
.ln-viz-pos { flex: 0 0 20px; width: 20px; text-align: center; font-weight: 800; font-size: 14px; color: var(--muted); }
.ln-viz-board .ln-viz-row:nth-child(2) .ln-viz-pos { color: var(--accent); }
.ln-viz-av { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: 0 0 38px; border: 1px solid var(--hairline); }
.ln-viz-name { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-weight: 600; font-size: 14px; }
.ln-viz-mayor { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; }
.ln-viz-mayor svg { width: 12px; height: 12px; }
.ln-viz-games { font-size: 13px; color: var(--muted); white-space: nowrap; }
.ln-viz-rel { display: flex; align-items: center; gap: 18px; }
.ln-ring-wrap { position: relative; flex: 0 0 124px; width: 124px; height: 124px; }
.ln-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ln-ring-bg { fill: none; stroke: var(--card-2); stroke-width: 10; }
.ln-ring-fg { fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(196, 242, 60, 0.35));
  transition: stroke-dashoffset 1.4s cubic-bezier(0.22, 0.8, 0.3, 1) 0.35s; }
.revealed .ln-ring-fg { stroke-dashoffset: 28.2; }
.ln-ring-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ln-ring-txt b { font-size: 27px; letter-spacing: -0.02em; }
.ln-ring-txt span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.ln-viz-badges { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.ln-viz-bdg { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text); background: var(--card-2); border: 1px solid var(--hairline); padding: 7px 12px; border-radius: var(--radius-pill); white-space: nowrap; }
.ln-viz-bdg svg { width: 14px; height: 14px; color: var(--accent); }
@media (max-width: 760px) {
  .ln-gamify { grid-template-columns: 1fr; gap: 22px; padding: 26px 20px; }
  .ln-gx-grid { grid-template-columns: 1fr; }
}

/* ---- FAQ ---- */
.ln-faqs { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.ln-faq { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 0 18px; }
.ln-faq summary { list-style: none; cursor: pointer; font-weight: 600; font-size: 15px; padding: 16px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ln-faq summary::-webkit-details-marker { display: none; }
.ln-faq summary::after { content: "+"; color: var(--accent); font-size: 20px; font-weight: 700; line-height: 1; flex: 0 0 auto; }
.ln-faq[open] summary::after { content: "\2212"; }
.ln-faq p { margin: 0 0 16px; font-size: 14px; color: var(--muted); line-height: 1.55; }

/* ---- footer ---- */
.ln-foot { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--hairline); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ln-foot > span:first-child { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); }
.ln-foot > span:first-child svg { width: 22px; height: 22px; }
.ln-foot b { color: var(--text); font-size: 15px; }
.ln-foot-sub { font-size: 13px; color: var(--muted); }

/* ---- hero: split text + live map, with lime glow ---- */
.ln-hero { position: relative; overflow: hidden; }
.ln-hero-glow { position: absolute; top: -120px; left: 50%; transform: translateX(-50%); width: 680px; height: 420px; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at center, var(--accent-soft), transparent 70%); filter: blur(8px); opacity: 0.9; }
.ln-hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr; gap: 32px; align-items: center; text-align: left; }
.ln-hero-txt { min-width: 0; }
.ln-hero .ln-lead, .ln-hero .ln-cta-row, .ln-hero .ln-microtrust { margin-left: 0; margin-right: 0; }
.ln-hero .ln-cta-row { justify-content: flex-start; }
.ln-map { height: 380px; border-radius: var(--radius-lg); border: 1px solid var(--hairline); overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.35); background: var(--card); z-index: 0; }
@media (max-width: 900px) {
  .ln-hero-grid { grid-template-columns: 1fr; text-align: center; }
  .ln-hero .ln-cta-row { justify-content: center; }
}

/* ---- court cards with photo ---- */
.ln-courts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ln-cc { display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden; isolation: isolate; background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-lg); color: var(--text);
  transition: transform 0.18s ease, box-shadow 0.18s ease; }
.ln-cc.tappable { cursor: pointer; }
.ln-cc.tappable:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(0,0,0,0.34); }
.ln-cc-media { position: relative; display: block; height: 146px; }
.ln-cc-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ln-cc-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.ln-cc-ph svg { width: 46px; height: 46px; color: var(--accent); opacity: 0.85; }
.ln-cc-ph.yard { background: linear-gradient(135deg, rgba(196,242,60,0.18), var(--card-2)); }
.ln-cc-ph.school { background: linear-gradient(135deg, rgba(255,176,32,0.18), var(--card-2)); }
.ln-cc-free { position: absolute; top: 10px; right: 10px; background: var(--accent); color: var(--accent-ink, #0a0c0e); font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: var(--radius-pill); }
.ln-cc-type { position: absolute; left: 10px; bottom: 10px; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: var(--radius-pill); color: var(--text);
  background: var(--glass-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--hairline); }
.ln-cc-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 4px; }
.ln-cc-name { font-weight: 700; font-size: 15px; }
.ln-cc-sub { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.ln-cc-sub svg { width: 13px; height: 13px; flex: 0 0 13px; color: var(--accent); }

/* ---- players catalog preview (reuse .pcard from catalog) ---- */
.ln-sub { margin: -10px auto 22px; max-width: 560px; text-align: center; }
.ln-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.ln-players .pcard { transition: transform 0.18s ease, box-shadow 0.18s ease; }
.ln-players .pcard:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,0.32); }
.pcard-ph { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent-soft), var(--card-2)); }
.pcard-ph svg { width: 40px; height: 40px; color: var(--accent); opacity: 0.75; }

/* ---- premium glass + hover on feature & stat cards ---- */
.ln-feat { transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease; }
.ln-feat:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 16px 34px rgba(0,0,0,0.3); }
.ln-stat { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: transform 0.18s ease, border-color 0.18s ease; }
.ln-stat:hover { transform: translateY(-3px); border-color: var(--accent); }
.ln-final { position: relative; overflow: hidden; }
.ln-final > * { position: relative; z-index: 1; }
.ln-final > .ln-hero-glow { position: absolute; z-index: 0; } /* keep the glow out of flow — it must not stretch the card */

/* ---- scroll-reveal ---- */
[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-reveal].revealed { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .ln-cc, .ln-feat, .pcard, .ln-stat { transition: none; }
}

/* ---- Wide: cap the reading column so lines stay legible ---- */
@media (min-width: 1440px) {
  :root { --max-w: 900px; }
}

/* ============================================================
   Landing: sporty desktop upgrade — big type, motion, lime energy
   ============================================================ */

/* -- accent word in H1 -- */
.ln-h1-hl { color: var(--accent); text-shadow: 0 0 36px rgba(196, 242, 60, 0.3); }
:root[data-theme="light"] .ln-h1-hl { color: var(--accent-mute); text-shadow: none; }

/* -- hero load-in: staggered rise -- */
@keyframes ln-rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.ln-hero-txt > * { opacity: 0; animation: ln-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }
.ln-hero-txt > :nth-child(1) { animation-delay: 0.05s; }
.ln-hero-txt > :nth-child(2) { animation-delay: 0.14s; }
.ln-hero-txt > :nth-child(3) { animation-delay: 0.26s; }
.ln-hero-txt > :nth-child(4) { animation-delay: 0.38s; }
.ln-hero-txt > :nth-child(5) { animation-delay: 0.5s; }
.ln-hero .ln-stats { opacity: 0; animation: ln-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.55s both; }

/* -- giant rotating tennis-ball outline behind the hero -- */
.ln-hero-ball { position: absolute; right: -170px; top: -170px; width: 560px; height: 560px; z-index: 0;
  fill: none; stroke: var(--accent); stroke-width: 1.2; opacity: 0.1; pointer-events: none;
  animation: ln-spin 90s linear infinite; }
@keyframes ln-spin { to { transform: rotate(360deg); } }
@media (max-width: 1023px) { .ln-hero-ball { display: none; } }

/* -- CTA: lime glow pulse + lift on hover -- */
@keyframes ln-glow { 0%, 100% { box-shadow: 0 10px 28px rgba(196, 242, 60, 0.2); } 50% { box-shadow: 0 14px 44px rgba(196, 242, 60, 0.4); } }
.ln-hero .ln-cta, .ln-final .ln-cta { animation: ln-glow 3s ease-in-out infinite; }
.ln-cta, .ln-cta2 { transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease; }
@media (hover: hover) {
  .ln-cta:hover { transform: translateY(-2px) scale(1.02); filter: brightness(1.07); }
  .ln-cta2:hover { transform: translateY(-2px); }
}

/* -- live map pins gently bob -- */
.ln-map .court-pin { animation: ln-bob 3.2s ease-in-out infinite; }
.ln-map .leaflet-marker-icon:nth-child(2n) .court-pin { animation-delay: 1.1s; }
.ln-map .leaflet-marker-icon:nth-child(3n) .court-pin { animation-delay: 2.2s; }
@keyframes ln-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* -- scroll-reveal: cards cascade inside each revealed section -- */
[data-reveal]:not(.revealed) :is(.ln-feats, .ln-courts, .ln-players, .ln-gx-grid, .ln-steps, .ln-faqs) > * { opacity: 0; }
[data-reveal].revealed :is(.ln-feats, .ln-courts, .ln-players, .ln-gx-grid, .ln-steps, .ln-faqs) > * {
  animation: ln-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
.revealed :is(.ln-feats, .ln-courts, .ln-players, .ln-gx-grid, .ln-steps, .ln-faqs) > :nth-child(1) { animation-delay: 0.02s; }
.revealed :is(.ln-feats, .ln-courts, .ln-players, .ln-gx-grid, .ln-steps, .ln-faqs) > :nth-child(2) { animation-delay: 0.08s; }
.revealed :is(.ln-feats, .ln-courts, .ln-players, .ln-gx-grid, .ln-steps, .ln-faqs) > :nth-child(3) { animation-delay: 0.14s; }
.revealed :is(.ln-feats, .ln-courts, .ln-players, .ln-gx-grid, .ln-steps, .ln-faqs) > :nth-child(4) { animation-delay: 0.2s; }
.revealed :is(.ln-feats, .ln-courts, .ln-players, .ln-gx-grid, .ln-steps, .ln-faqs) > :nth-child(5) { animation-delay: 0.26s; }
.revealed :is(.ln-feats, .ln-courts, .ln-players, .ln-gx-grid, .ln-steps, .ln-faqs) > :nth-child(6) { animation-delay: 0.32s; }
.revealed :is(.ln-feats, .ln-courts, .ln-players, .ln-gx-grid, .ln-steps, .ln-faqs) > :nth-child(7) { animation-delay: 0.38s; }
.revealed :is(.ln-feats, .ln-courts, .ln-players, .ln-gx-grid, .ln-steps, .ln-faqs) > :nth-child(8) { animation-delay: 0.44s; }

/* -- full-bleed hero: live map as background -- */
.ln-hero-bleed { display: flex; flex-direction: column; }
.ln-hero-bleed .ln-hero-grid { order: 1; }
.ln-hero-bleed .ln-hero-bg { order: 2; position: relative; height: 250px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--hairline); margin-top: 10px; animation: ln-fadein 1s ease 0.15s both; }
.ln-hero-bleed .ln-stats { order: 3; }
.ln-hero-bg .ln-map { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; border: none; box-shadow: none; }
.ln-hero-shade { display: none; }
.ln-ball-wrap { position: absolute; inset: 0; pointer-events: none; z-index: 1; will-change: transform; }
@keyframes ln-fadein { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 1024px) {
  .ln-hero-bleed { position: relative; margin: -20px calc(50% - 50vw) 0; padding: 110px 64px 56px; min-height: calc(100vh - 64px - 46px); justify-content: center; overflow: hidden; }
  .ln-hero-bleed + .ln-marquee { margin-top: 0; }
  .ln-hero-bleed .ln-hero-glow { display: none; }
  .ln-hero-bleed .ln-hero-bg { position: absolute; inset: 0; order: 0; height: auto; border: none; border-radius: 0; margin: 0; z-index: 0; }
  .ln-hero-shade { display: block; position: absolute; inset: 0; z-index: 1; pointer-events: none; background:
    linear-gradient(90deg, var(--bg) 4%, color-mix(in srgb, var(--bg) 86%, transparent) 36%, color-mix(in srgb, var(--bg) 20%, transparent) 66%, color-mix(in srgb, var(--bg) 55%, transparent) 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 78%, transparent) 0%, transparent 24%, transparent 64%, var(--bg) 100%); }
  .ln-hero-bleed .ln-hero-grid, .ln-hero-bleed .ln-stats { position: relative; z-index: 2; width: 100%; max-width: 1200px; margin-left: auto; margin-right: auto; }
  .ln-hero-bleed .ln-hero-grid { grid-template-columns: 1fr; pointer-events: none; }
  .ln-hero-bleed .ln-hero-txt { max-width: 680px; pointer-events: auto; }
  .ln-hero-bleed .ln-stats { justify-content: flex-start; margin-top: 72px; pointer-events: auto; }
  .ln-hero-bleed .ln-h1 { font-size: clamp(44px, 4.5vw, 68px); }
}

/* -- marquee: oversized outlined ticker -- */
.ln-marquee { overflow: hidden; margin: 48px calc(50% - 50vw) 0; white-space: nowrap; }
.ln-marquee-track { display: inline-flex; animation: ln-marq 38s linear infinite; will-change: transform; }
.ln-marquee-track > span { display: inline-block; padding-right: 28px; font-size: clamp(32px, 5vw, 72px); font-weight: 800; line-height: 1.15; text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--bg); -webkit-text-stroke: 3px color-mix(in srgb, var(--accent) 55%, transparent); paint-order: stroke fill; }
@keyframes ln-marq { to { transform: translateX(-50%); } }

/* -- numbered section tags -- */
.ln-tag { display: block; text-align: center; font-size: 13px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.ln-tag.left { text-align: left; }

/* -- juicier court media: zoom on hover, patterned placeholders -- */
.ln-cc-media { overflow: hidden; }
.ln-cc-img { transition: transform 0.5s ease; will-change: transform; }
@media (hover: hover) {
  /* first card pan via JS — skip CSS scale to avoid fighting the transform */
  #ln-courts .ln-cc:first-child:hover .ln-cc-img { transform: none; }
  .ln-cc:hover .ln-cc-img { transform: scale(1.07); }
  .ln-players .pcard:hover { border-color: var(--accent); }
}
.ln-cc-ph.yard { background:
  radial-gradient(130% 150% at 18% 0%, rgba(196, 242, 60, 0.32), transparent 56%),
  repeating-linear-gradient(115deg, transparent 0 26px, rgba(196, 242, 60, 0.07) 26px 27px), var(--card-2); }
.ln-cc-ph.school { background:
  radial-gradient(130% 150% at 18% 0%, rgba(255, 176, 32, 0.3), transparent 56%),
  repeating-linear-gradient(115deg, transparent 0 26px, rgba(255, 176, 32, 0.07) 26px 27px), var(--card-2); }
.ln-cc-ph svg { width: 64px; height: 64px; }
.ln-players .pcard-ph { background:
  radial-gradient(120% 130% at 25% 10%, rgba(196, 242, 60, 0.26), transparent 60%),
  repeating-linear-gradient(115deg, transparent 0 22px, rgba(196, 242, 60, 0.06) 22px 23px), var(--card-2); }

/* -- big sporty desktop type & spacing -- */
@media (min-width: 1024px) {
  .ln { max-width: 1200px; padding: 20px 32px 96px; }
  .ln-hero { padding: 72px 8px 40px; }
  .ln-hero-grid { gap: 48px; }
  .ln-h1 { font-size: clamp(40px, 3.9vw, 60px); line-height: 1.06; letter-spacing: -0.03em; margin-bottom: 20px; }
  .ln-lead { font-size: 19px; max-width: 660px; }
  .ln-eyebrow { font-size: 13px; padding: 8px 16px; }
  .ln-cta { padding: 17px 34px; font-size: 17px; border-radius: var(--radius-md); }
  .ln-cta2 { padding: 17px 28px; font-size: 16px; border-radius: var(--radius-md); }
  .ln-microtrust { font-size: 14px; }
  .ln-map { height: 480px; border-radius: 24px; }
  .ln-stats { gap: 40px; margin-top: 48px; }
  .ln-stat { background: transparent; border: none; border-left: 2px solid var(--accent); border-radius: 0; padding: 6px 0 6px 22px; min-width: 150px; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .ln-stat:hover { transform: none; }
  .ln-stat-n { font-size: 52px; line-height: 1.05; }
  .ln-stat-l { font-size: 14px; }
  .ln-sec { margin-top: 96px; }
  .ln-h2 { font-size: clamp(30px, 3.2vw, 44px); letter-spacing: -0.02em; margin-bottom: 36px; }
  .ln-lead.ln-sub { margin-bottom: 30px; }
  .ln-feats { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .ln-feat { padding: 28px 24px; border-radius: var(--radius-lg); }
  .ln-feat-ico { width: 52px; height: 52px; border-radius: var(--radius); margin-bottom: 18px; }
  .ln-feat-ico svg { width: 26px; height: 26px; }
  .ln-feat h3 { font-size: 18px; }
  .ln-feat p { font-size: 14px; }
  .ln-gamify { padding: 56px 48px; border-radius: var(--radius-xl); gap: 48px; }
  .ln-gx-grid { gap: 22px; }
  .ln-gx-ico { width: 46px; height: 46px; flex-basis: 46px; border-radius: var(--radius-sm); }
  .ln-gx h4 { font-size: 16px; }
  .ln-gx p { font-size: 14px; }
  .ln-gamify-txt .ln-gx-grid { margin-top: 30px; }
  .ln-viz-card { padding: 20px; border-radius: var(--radius-lg); }
  .ln-steps { gap: 26px; }
  .ln-step-n { width: 46px; height: 46px; flex-basis: 46px; font-size: 19px; }
  .ln-step h4 { font-size: 17px; margin-top: 6px; }
  .ln-step p { font-size: 14px; }
  /* editorial bento: hero court full-width, three below; photo fills card, copy overlays */
  .ln-courts { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .ln-cc { position: relative; min-height: 280px; border-radius: var(--radius-lg); }
  .ln-cc:first-child { grid-column: 1 / -1; min-height: 420px; }
  .ln-cc .ln-cc-media { position: absolute; inset: 0; height: auto; }
  .ln-cc-img { filter: grayscale(1) brightness(1.22) contrast(1.04); transition: transform 0.6s ease, filter 0.45s ease; will-change: transform, filter; }
  .ln-cc:hover .ln-cc-img { filter: grayscale(0) brightness(1.08) contrast(1); transform: scale(1.04); }
  .ln-cc-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 20px 22px 22px; gap: 5px;
    background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg) 72%, transparent) 58%, color-mix(in srgb, var(--bg) 92%, transparent)); }
  .ln-cc-name { font-size: 19px; }
  .ln-cc:first-child .ln-cc-name { font-size: 26px; letter-spacing: -0.01em; }
  .ln-cc-sub { font-size: 13px; }
  .ln-cc-type { top: 14px; left: 14px; bottom: auto; }
  .ln-cc-free { top: 14px; right: 14px; }
  .ln-players { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .ln-players .pcard-img { filter: grayscale(1) contrast(1.05); transition: filter 0.35s ease; }
  .ln-players .pcard:hover .pcard-img { filter: none; }
  .ln-faqs { max-width: 820px; }
  .ln-faq { padding: 0 22px; border-radius: var(--radius-md); }
  .ln-faq summary { font-size: 16px; padding: 20px 0; }
  .ln-faq p { font-size: 15px; }
  .ln-final { margin-top: 110px; padding: 76px 40px; border-radius: var(--radius-xl); }
  .ln-foot { margin-top: 72px; }
  .ln-hero-glow { width: 980px; height: 560px; top: -160px; }
}

/* -- motion off for users who ask for it -- */
@media (prefers-reduced-motion: reduce) {
  .ln-hero-txt > *, .ln-hero .ln-stats { animation: none; opacity: 1; }
  .ln-hero-ball, .ln-map .court-pin, .ln-hero .ln-cta, .ln-final .ln-cta { animation: none; }
  .ln-marquee-track { animation: none; }
  .ln-hero-bleed .ln-hero-bg { animation: none; opacity: 1; }
  .ln-cc-img { transition: none; }
  .ln-ring-fg { transition: none; stroke-dashoffset: 28.2; }
  [data-reveal]:not(.revealed) :is(.ln-feats, .ln-courts, .ln-players, .ln-gx-grid, .ln-steps, .ln-faqs) > * { opacity: 1; }
  [data-reveal].revealed :is(.ln-feats, .ln-courts, .ln-players, .ln-gx-grid, .ln-steps, .ln-faqs) > * { animation: none; }
}

/* ---- auth modal overlay ---- */
.auth-modal-ov {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(6,8,10,0.72);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.22s ease;
}
.auth-modal-ov.open { opacity: 1; }
.auth-modal-inner {
  position: relative; max-width: 460px; width: calc(100% - 32px); max-height: 88vh;
  overflow-y: auto; background: var(--card);
  border-radius: var(--radius-xl); border: 1px solid var(--hairline);
  box-shadow: 0 32px 80px rgba(0,0,0,0.56);
  transform: translateY(22px); transition: transform 0.26s ease;
}
.auth-modal-ov.open .auth-modal-inner { transform: none; }
.auth-modal-content .auth-screen { display: block; min-height: 0; padding: 28px 0 32px; }
.auth-modal-content .auth-card { max-width: none; padding: 0 28px; gap: 14px; }
.auth-sep { display: block; height: 1px; background: var(--hairline); border: none; margin: 32px -28px; }
.auth-modal-x {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--input-bg-h); border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--text);
}
.auth-modal-x:hover { background: var(--input-bg-a); }
.auth-modal-x svg { width: 16px; height: 16px; }
