  :root {
    --bg: #0f172a;
    --surface: rgba(15,23,42,0.88);
    --border: rgba(255,255,255,0.1);
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --radius: 12px;
    --glass-topbar: rgba(8,14,30,0.45);
    --glass-panel: rgba(8,14,30,0.5);
    --surface-solid: #0f172a;
  }
  [data-theme="light"] {
    --bg: #f1f5f9;
    --surface: rgba(248,250,252,0.90);
    --border: rgba(0,0,0,0.09);
    --text: #0f172a;
    --text-muted: #64748b;
    --accent: #15803d;
    --glass-topbar: rgba(248,250,252,0.75);
    --glass-panel: rgba(255,255,255,0.72);
    --surface-solid: #ffffff;
  }
  [data-theme="light"] #topbar {
    backdrop-filter: blur(40px) saturate(200%) brightness(1.05);
    -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(1.05);
    border-bottom: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 1px 0 rgba(255,255,255,0.7), 0 8px 32px rgba(0,0,0,0.08);
  }
  [data-theme="light"] #bottom-nav {
    backdrop-filter: blur(40px) saturate(200%) brightness(1.05);
    -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(1.05);
    border-top: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 -1px 0 rgba(255,255,255,0.7), 0 -8px 32px rgba(0,0,0,0.06);
  }
  [data-theme="light"] .nav-btn:hover {
    background: rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.1);
    color: var(--text);
  }
  [data-theme="light"] .nav-btn.active {
    background: rgba(21,128,61,0.12);
    border-color: rgba(21,128,61,0.3);
    box-shadow: 0 0 14px rgba(21,128,61,0.15), inset 0 1px 0 rgba(255,255,255,0.5);
  }
  [data-theme="light"] .nav-divider { background: rgba(0,0,0,0.1); }
  [data-theme="light"] .mobile-toggle {
    background: rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.1);
  }
  [data-theme="light"] .mobile-toggle.active {
    background: rgba(21,128,61,0.12);
    border-color: rgba(21,128,61,0.28);
    box-shadow: 0 0 10px rgba(21,128,61,0.12), inset 0 1px 0 rgba(255,255,255,0.4);
  }
  [data-theme="light"] #user-badge {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.1);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  }
  [data-theme="light"] #user-badge:hover {
    background: rgba(0,0,0,0.08);
    border-color: rgba(21,128,61,0.35);
    box-shadow: 0 0 12px rgba(21,128,61,0.12), inset 0 1px 0 rgba(255,255,255,0.6);
  }
  [data-theme="light"] .sport-tab { background: rgba(0,0,0,0.04); }
  [data-theme="light"] .sport-tab:hover { background: rgba(0,0,0,0.07); }
  [data-theme="light"] .stat-box { background: rgba(0,0,0,0.03); }
  [data-theme="light"] .btn-secondary { background: rgba(0,0,0,0.06); }
  [data-theme="light"] .btn-secondary:hover { background: rgba(0,0,0,0.1); }
  [data-theme="light"] .league-row:hover { background: rgba(0,0,0,0.04); }
  [data-theme="light"] .liga-modal-row:hover { background: rgba(0,0,0,0.03); }
  [data-theme="light"] .feed-item { border-bottom-color: rgba(0,0,0,0.06); }
  [data-theme="light"] .landmark-marker { background: rgba(255,255,255,0.95); }
  [data-theme="light"] .quest-bar-bg,
  [data-theme="light"] #attack-bar-bg,
  [data-theme="light"] #hex-def-bar-bg,
  [data-theme="light"] .season-bar-bg,
  [data-theme="light"] #sim-bar-bg { background: rgba(0,0,0,0.1); }
  [data-theme="light"] #left-panel::-webkit-scrollbar-thumb,
  [data-theme="light"] #right-panel::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); }
  [data-theme="light"] .effort-formula { background: rgba(0,0,0,0.04); }
  [data-theme="light"] .effort-calc { background: rgba(0,0,0,0.04); }
  [data-theme="light"] .effort-calc select { background: rgba(0,0,0,0.05); color: var(--text); }
  [data-theme="light"] .modal-close:hover { background: rgba(0,0,0,0.07); color: var(--text); }
  [data-theme="light"] .welcome-text,
  [data-theme="light"] .welcome-list li,
  [data-theme="light"] #strava-nudge .sn-text,
  [data-theme="light"] #push-nudge .sn-text { color: var(--text-muted); }
  [data-theme="light"] .welcome-btn-skip { border-color: rgba(0,0,0,0.12); }
  [data-theme="light"] .welcome-btn-skip:hover { background: rgba(0,0,0,0.05); }
  [data-theme="light"] .leaflet-container { background: #e2e8f0; }
  [data-theme="light"] #hex-close:hover { background: rgba(0,0,0,0.08); }
  [data-theme="light"] .panel {
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.8);
  }
  [data-theme="light"] #logo .wordmark { text-shadow: none; }
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, sans-serif; }

  /* ── TOPBAR — liquid glass ── */
  #topbar {
    position: fixed; top: 0; left: 0; right: 0;
    height: calc(52px + env(safe-area-inset-top)); z-index: 1000;
    background: var(--glass-topbar);
    backdrop-filter: blur(40px) saturate(200%) brightness(0.95);
    -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(0.95);
    border-bottom: 1px solid rgba(255,255,255,0.09);
    box-shadow: 0 1px 0 rgba(255,255,255,0.04), 0 8px 32px rgba(0,0,0,0.45);
    display: flex; align-items: center; padding: env(safe-area-inset-top) 16px 0; gap: 12px;
  }
  #logo { display: flex; flex-direction: column; line-height: 1; margin-right: 8px; }
  #logo .wordmark {
    font-size: 18px; font-weight: 800; letter-spacing: 0.08em; color: var(--accent);
    text-shadow: 0 0 20px rgba(34,197,94,0.4);
  }
  #logo .tagline  { font-size: 9px; letter-spacing: 0.12em; color: var(--text-muted); text-transform: uppercase; }
  .nav-divider { width: 1px; height: 28px; background: rgba(255,255,255,0.08); margin: 0 4px; }
  .nav-btn {
    background: none; border: 1px solid transparent; color: var(--text-muted); cursor: pointer;
    font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 20px;
    transition: all .2s; white-space: nowrap;
  }
  .nav-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.12);
    color: var(--text);
    backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
  }
  .nav-btn.active {
    background: rgba(34,197,94,0.18);
    border-color: rgba(34,197,94,0.3);
    color: var(--accent);
    box-shadow: 0 0 14px rgba(34,197,94,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
  }
  #user-badge {
    margin-left: auto; display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px; padding: 5px 12px; color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
    transition: all .2s;
  }
  #user-badge:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(34,197,94,0.35);
    box-shadow: 0 0 12px rgba(34,197,94,0.15), inset 0 1px 0 rgba(255,255,255,0.12);
  }
  #user-badge .avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #16a34a);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #fff;
    box-shadow: 0 0 8px rgba(34,197,94,0.35);
  }
  #user-badge .info { display: flex; flex-direction: column; line-height: 1.2; }
  #user-badge .name { font-size: 13px; font-weight: 600; }
  #user-badge .rank { font-size: 10px; color: var(--warning); }

  /* ── MAP ── */
  #map { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 1; }

  /* ── PANELS ── */
  .panel {
    position: fixed; z-index: 100;
    background: var(--glass-panel);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 16px; padding: 14px;
    backdrop-filter: blur(32px) saturate(160%);
    -webkit-backdrop-filter: blur(32px) saturate(160%);
    box-shadow: 0 8px 32px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06);
  }

  /* LEFT PANEL */
  #left-panel {
    left: 12px; top: calc(64px + env(safe-area-inset-top)); bottom: 12px; width: 268px;
    overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 12px;
  }
  #left-panel::-webkit-scrollbar { width: 4px; }
  #left-panel::-webkit-scrollbar-track { background: transparent; }
  #left-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

  .panel-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: 8px; }

  /* profile card */
  #profile-card { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
  #profile-avatar {
    width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700; border: 2px solid var(--accent);
  }
  #profile-info .player-name { font-size: 15px; font-weight: 700; }
  #profile-info .player-team { font-size: 11px; color: var(--accent); font-weight: 500; }
  #profile-info .player-league { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
  .achievement-badge {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 10px; font-weight: 600;
    padding: 2px 7px; border-radius: 999px;
    background: rgba(99,102,241,.12); border: 1px solid rgba(99,102,241,.25);
    color: #a5b4fc;
    cursor: default;
  }

  /* sport tabs */
  #sport-tabs { display: flex; gap: 4px; }
  .sport-tab {
    flex: 1; padding: 7px 4px; border-radius: 8px; border: 1px solid var(--border);
    background: rgba(255,255,255,0.03); color: var(--text-muted); cursor: pointer;
    font-size: 12px; text-align: center; transition: all .2s;
  }
  .sport-tab:hover { background: rgba(255,255,255,0.07); }
  .sport-tab.active { background: rgba(34,197,94,0.15); border-color: var(--accent); color: var(--accent); }

  /* stats row */
  #stats-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 6px; }
  .stat-box { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 8px; padding: 8px 6px; text-align: center; }
  .stat-val { font-size: 16px; font-weight: 700; color: var(--accent); line-height: 1; }
  .stat-lbl { font-size: 9px; color: var(--text-muted); margin-top: 3px; text-transform: uppercase; letter-spacing: .05em; }

  /* radar */
  #radar-wrap { position: relative; height: 180px; }

  /* action buttons */
  #action-btns { display: flex; gap: 7px; flex-direction: column; }
  .btn {
    width: 100%; padding: 10px; border-radius: 9px; border: none;
    font-size: 13px; font-weight: 600; cursor: pointer; transition: all .2s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
  }
  .btn-primary { background: var(--accent); color: #fff; }
  .btn-primary:hover { background: #16a34a; transform: translateY(-1px); }
  .btn-secondary { background: rgba(255,255,255,0.07); color: var(--text); border: 1px solid var(--border); }
  .btn-secondary:hover { background: rgba(255,255,255,0.12); }
  .btn-danger { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
  .btn-danger:hover { background: rgba(239,68,68,0.25); }
  .btn-warning { background: rgba(245,158,11,0.15); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }
  .btn-warning:hover { background: rgba(245,158,11,0.25); }
  .btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

  /* RIGHT PANEL */
  #right-panel {
    right: 12px; top: calc(64px + env(safe-area-inset-top)); bottom: 12px; width: 256px;
    overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 0;
  }
  #right-panel::-webkit-scrollbar { width: 4px; }
  #right-panel::-webkit-scrollbar-track { background: transparent; }
  #right-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

  .league-row {
    display: flex; align-items: center; gap: 7px; padding: 7px 8px;
    border-radius: 8px; transition: background .15s; font-size: 12px;
  }
  .league-row:hover { background: rgba(255,255,255,0.05); }
  .league-row.me { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.2); }
  .league-row.promote { background: rgba(34,197,94,0.06); }
  .league-row.relegate { background: rgba(239,68,68,0.06); }
  .rank-num { width: 18px; text-align: center; font-weight: 700; font-size: 11px; color: var(--text-muted); }
  .rank-num.gold { color: #fbbf24; }
  .rank-num.silver { color: #94a3b8; }
  .rank-num.bronze { color: #f97316; }
  .color-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
  .league-name { flex: 1; font-weight: 500; }
  .league-team { font-size: 10px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
  .league-team-logo { width: 13px; height: 13px; border-radius: 3px; object-fit: cover; flex-shrink: 0; }
  .league-pts { font-weight: 700; color: var(--accent); font-size: 12px; }
  .league-hex { font-size: 10px; color: var(--text-muted); }

  /* feed */
  #feed-list { display: flex; flex-direction: column; gap: 0; }
  .feed-item {
    display: flex; align-items: flex-start; gap: 8px; padding: 8px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 11.5px;
  }
  .feed-item:last-child { border-bottom: none; }
  .feed-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
  .feed-text { flex: 1; line-height: 1.4; }
  .feed-time { font-size: 10px; color: var(--text-muted); white-space: nowrap; margin-top: 2px; }

  /* HEX DETAIL PANEL */
  #hex-panel {
    bottom: calc(16px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
    width: 360px; display: none; z-index: 500;
  }
  #hex-panel.visible { display: block; }
  #route-claim-panel.visible { display: block !important; }
  #hex-panel-inner { position: relative; }
  #hex-close {
    position: absolute; top: -8px; right: -8px; width: 24px; height: 24px;
    border-radius: 50%; background: var(--surface); border: 1px solid var(--border);
    color: var(--text-muted); cursor: pointer; font-size: 14px; line-height: 24px;
    text-align: center; transition: all .2s;
  }
  #hex-close:hover { color: var(--text); background: rgba(255,255,255,0.1); }
  #hex-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
  #hex-owner-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
  #hex-owner-dot { width: 10px; height: 10px; border-radius: 50%; }
  #hex-owner-name { font-size: 12px; color: var(--text-muted); }
  #hex-def-wrap { margin-bottom: 10px; }
  #hex-def-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; display: flex; justify-content: space-between; }
  #hex-def-bar-bg { height: 6px; background: rgba(255,255,255,0.07); border-radius: 3px; overflow: hidden; }
  #hex-def-bar { height: 100%; border-radius: 3px; transition: width .3s; }
  #hex-actions { display: flex; gap: 8px; }
  #hex-actions .btn { flex: 1; padding: 9px; font-size: 12px; }
  #attack-progress { display: none; margin-top: 10px; }
  #attack-bar-bg { height: 8px; background: rgba(255,255,255,0.07); border-radius: 4px; overflow: hidden; }
  #attack-bar { height: 100%; background: var(--danger); border-radius: 4px; width: 0%; transition: width .08s; }
  #attack-label { font-size: 10px; color: var(--text-muted); margin-top: 4px; text-align: center; }

  /* NOTIFICATIONS */
  #notif-container {
    position: fixed; top: calc(60px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
    z-index: 3000; display: flex; flex-direction: column; gap: 8px; pointer-events: none;
    min-width: 320px;
  }
  .notif {
    background: var(--surface); border-radius: 10px; padding: 12px 16px;
    font-size: 13px; backdrop-filter: blur(16px); pointer-events: auto;
    border-left: 3px solid var(--accent);
    animation: slideDown .25s ease-out;
    display: flex; align-items: center; gap: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,.5);
    transition: opacity .4s, transform .4s;
  }
  .notif.success { border-left-color: var(--accent); }
  .notif.warning { border-left-color: var(--warning); }
  .notif.danger  { border-left-color: var(--danger); }
  .notif.info    { border-left-color: var(--info); }
  .notif.fade-out { opacity: 0; transform: translateY(-10px); }
  @keyframes slideDown { from { opacity:0; transform: translateY(-16px); } to { opacity:1; transform: translateY(0); } }

  /* ── WELCOME MODAL ── */
  #welcome-overlay {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(0,0,0,.75); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; animation: fadeIn .3s ease-out forwards;
  }
  #welcome-overlay.hidden { display: none; }
  @keyframes fadeIn { to { opacity: 1; } }
  #welcome-box {
    background: var(--surface-solid); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px; padding: 36px 32px 28px;
    max-width: 440px; width: calc(100% - 32px);
    box-shadow: 0 24px 80px rgba(0,0,0,.7);
    position: relative;
  }
  .welcome-step { display: none; }
  .welcome-step.active { display: block; }
  .welcome-logo { font-size: 13px; font-weight: 900; letter-spacing: .12em; color: var(--accent); margin-bottom: 20px; }
  .welcome-icon { font-size: 44px; margin-bottom: 14px; line-height: 1; }
  .welcome-title { font-size: 22px; font-weight: 800; margin-bottom: 10px; }
  .welcome-text { font-size: 14px; line-height: 1.7; color: #cbd5e1; margin-bottom: 20px; }
  .welcome-list { list-style: none; padding: 0; margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
  .welcome-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: #cbd5e1; line-height: 1.5; }
  .welcome-list li span.icon { font-size: 20px; flex-shrink: 0; width: 26px; text-align: center; margin-top: 1px; }
  .welcome-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 20px; }
  .welcome-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.2); transition: background .2s; }
  .welcome-dot.active { background: var(--accent); }
  .welcome-actions { display: flex; gap: 10px; }
  .welcome-btn-primary {
    flex: 1; background: var(--accent); color: #fff; border: none; border-radius: 10px;
    padding: 12px 18px; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .2s;
  }
  .welcome-btn-primary:hover { background: #16a34a; }
  .welcome-btn-skip {
    background: none; border: 1px solid rgba(255,255,255,0.12); color: var(--text-muted);
    border-radius: 10px; padding: 12px 16px; font-size: 13px; cursor: pointer; transition: all .2s;
  }
  .welcome-btn-skip:hover { color: var(--text); background: rgba(255,255,255,0.05); }

  /* ── STRAVA NUDGE BANNER ── */
  #strava-nudge {
    margin: 10px 0 4px; padding: 12px 14px;
    background: rgba(252,82,0,0.08); border: 1px solid rgba(252,82,0,0.25);
    border-radius: 10px; display: none; align-items: flex-start; gap: 10px;
  }
  #strava-nudge.visible { display: flex; }
  #strava-nudge .sn-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
  #strava-nudge .sn-body { flex: 1; }
  #strava-nudge .sn-title { font-size: 12px; font-weight: 700; color: #FC5200; margin-bottom: 3px; }
  #strava-nudge .sn-text { font-size: 11px; color: #cbd5e1; line-height: 1.5; margin-bottom: 8px; }
  #strava-nudge .sn-btn {
    display: inline-block; background: #FC5200; color: #fff; border-radius: 7px;
    padding: 6px 12px; font-size: 11px; font-weight: 700; text-decoration: none; cursor: pointer;
    border: none; transition: background .2s;
  }
  #strava-nudge .sn-btn:hover { background: #e04800; }
  #strava-nudge .sn-close {
    font-size: 16px; color: rgba(255,255,255,0.3); cursor: pointer; flex-shrink: 0;
    background: none; border: none; padding: 0; line-height: 1; margin-top: 2px;
  }
  #strava-nudge .sn-close:hover { color: var(--text-muted); }

  #push-nudge {
    margin: 8px 0 4px; padding: 12px 14px;
    background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.25);
    border-radius: 10px; display: none; align-items: flex-start; gap: 10px;
  }
  #push-nudge.visible { display: flex; }
  #push-nudge .sn-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
  #push-nudge .sn-body { flex: 1; }
  #push-nudge .sn-title { font-size: 12px; font-weight: 700; color: #818cf8; margin-bottom: 3px; }
  #push-nudge .sn-text  { font-size: 11px; color: #cbd5e1; line-height: 1.5; margin-bottom: 8px; }
  #push-nudge .sn-btn   {
    display: inline-block; background: #4f46e5; color: #fff; border-radius: 7px;
    padding: 6px 12px; font-size: 11px; font-weight: 700; cursor: pointer;
    border: none; transition: background .2s;
  }
  #push-nudge .sn-btn:hover { background: #4338ca; }
  #push-nudge .sn-close {
    font-size: 16px; color: rgba(255,255,255,0.3); cursor: pointer; flex-shrink: 0;
    background: none; border: none; padding: 0; line-height: 1; margin-top: 2px;
  }
  #push-nudge .sn-close:hover { color: var(--text-muted); }

  /* ZOOM HINT */
  #zoom-hint {
    position: fixed; bottom: calc(90px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
    z-index: 2000; background: var(--surface); border: 1px solid var(--border);
    border-radius: 20px; padding: 7px 16px; font-size: 12px; color: var(--text-muted);
    pointer-events: none; backdrop-filter: blur(12px);
    opacity: 0; transition: opacity .3s; white-space: nowrap;
  }
  #zoom-hint.visible { opacity: 1; }
  @keyframes hexFlash { 0% { opacity:1; } 25% { opacity:0.15; } 50% { opacity:0.85; } 75% { opacity:0.2; } 100% { opacity:1; } }
  .hex-flash { animation: hexFlash 0.7s ease-in-out; }

  /* LEGEND */
  #legend-panel {
    right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 200;
    padding: 10px 12px; min-width: 140px;
  }
  .legend-item { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-muted); margin-top: 5px; }
  .legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

  /* Leaflet overrides */
  .leaflet-container { background: var(--bg); }
  .landmark-marker {
    background: rgba(15,23,42,0.9); border: 1.5px solid var(--warning);
    border-radius: 8px; padding: 3px 7px; font-size: 11px; white-space: nowrap;
    color: var(--text); cursor: pointer; backdrop-filter: blur(8px);
    transition: all .2s; box-shadow: 0 2px 12px rgba(0,0,0,.4);
  }
  .landmark-marker:hover { background: rgba(245,158,11,0.15); transform: scale(1.05); }

  /* section separator */
  .section-sep { height: 1px; background: var(--border); margin: 8px 0; }

  /* progress indicator on simulate btn */
  #sim-bar-bg { height: 4px; background: rgba(255,255,255,0.07); border-radius: 2px; overflow: hidden; }
  #sim-bar { height: 100%; background: var(--accent); border-radius: 2px; width: 0%; transition: width .05s; }

  /* ── MODAL SYSTEM ── */
  .modal-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center;
  }
  .modal-overlay.open { display: flex; }
  .modal-box {
    background: var(--surface-solid); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px; width: 720px; max-width: 95vw;
    max-height: 85vh; overflow-y: auto; padding: 24px;
  }
  .modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .modal-header h2 { font-size: 18px; font-weight: 700; }
  .modal-close {
    background: none; border: none; color: #94a3b8; cursor: pointer;
    font-size: 20px; padding: 4px 8px; border-radius: 6px;
  }
  .modal-close:hover { background: rgba(255,255,255,0.07); color: #f1f5f9; }

  /* Liga Modal */
  .season-progress-wrap { margin-bottom: 20px; }
  .season-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
  .season-bar-bg { height: 8px; background: rgba(255,255,255,0.07); border-radius: 4px; overflow: hidden; }
  .season-bar { height: 100%; background: var(--accent); border-radius: 4px; }
  .liga-zone-label {
    font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
    padding: 4px 10px; margin: 4px 0 2px;
  }
  .liga-zone-aufstieg { color: #22c55e; background: rgba(34,197,94,0.08); border-radius: 4px; }
  .liga-zone-abstieg  { color: #ef4444; background: rgba(239,68,68,0.08); border-radius: 4px; }
  .liga-modal-row {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px;
    border-radius: 8px; font-size: 13px; transition: background .15s;
  }
  .liga-modal-row:hover { background: rgba(255,255,255,0.04); }
  .liga-modal-row.promotion { background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.15); margin-bottom: 2px; }
  .liga-modal-row.relegation { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.15); margin-bottom: 2px; }
  .liga-modal-row.current-user { outline: 2px solid rgba(34,197,94,0.4); }
  .liga-badge {
    font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 4px;
    white-space: nowrap;
  }
  .badge-up   { background: rgba(34,197,94,0.2);  color: #22c55e; }
  .badge-down { background: rgba(239,68,68,0.2);  color: #ef4444; }
  .liga-trend { font-size: 14px; margin-left: auto; }
  .liga-footer {
    margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border);
    font-size: 11px; color: var(--text-muted); text-align: center;
  }


  /* ── MOBILE — liquid glass ── */
  #mobile-toggles { display: none; gap: 6px; margin-left: 4px; }
  .mobile-toggle {
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-muted); cursor: pointer; border-radius: 20px; padding: 5px 12px;
    font-size: 13px; transition: all .2s;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  }
  .mobile-toggle.active {
    background: rgba(34,197,94,0.18); color: var(--accent);
    border-color: rgba(34,197,94,0.3);
    box-shadow: 0 0 12px rgba(34,197,94,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
  }
  #bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    height: calc(54px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--glass-topbar);
    backdrop-filter: blur(40px) saturate(200%) brightness(0.95);
    -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(0.95);
    border-top: 1px solid rgba(255,255,255,0.09);
    box-shadow: 0 -1px 0 rgba(255,255,255,0.04), 0 -8px 32px rgba(0,0,0,0.4);
    align-items: center; justify-content: space-around; z-index: 900;
  }
  .bottom-nav-btn {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    font-size: 10px; font-weight: 500; display: flex; flex-direction: column;
    align-items: center; gap: 2px; padding: 4px 10px; border-radius: 12px;
    transition: all .2s; white-space: nowrap;
  }
  .bottom-nav-btn span { font-size: 18px; line-height: 1.2; }
  .bottom-nav-btn:hover { color: var(--text); }
  .bottom-nav-btn.active {
    color: var(--accent);
    text-shadow: 0 0 12px rgba(34,197,94,0.5);
  }
  @media (max-width: 768px) {
    #mobile-toggles { display: flex; }
    .nav-btn { display: none; }
    .nav-divider { display: none; }
    #left-panel  { transform: translateX(calc(-100% - 20px)); transition: transform .3s ease; bottom: calc(58px + env(safe-area-inset-bottom)); }
    #right-panel { transform: translateX(calc( 100% + 20px)); transition: transform .3s ease; bottom: calc(58px + env(safe-area-inset-bottom)); }
    #left-panel.mobile-open  { transform: translateX(0); z-index: 200; }
    #right-panel.mobile-open { transform: translateX(0); z-index: 200; }
    #bottom-nav { display: flex; }
    #legend-panel { display: none; }
    #hex-panel { width: calc(100vw - 24px); bottom: calc(60px + env(safe-area-inset-bottom)); }
  }
  @media (max-width: 480px) {
    #user-badge .info { display: none; }
    .modal-box { padding: 14px; }
  }

  /* ── EFFORT MODAL ── */
  .effort-formula { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; padding: 14px; background: rgba(255,255,255,0.04); border-radius: 10px; justify-content: center; }
  .effort-box { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.22); border-radius: 8px; padding: 8px 10px; text-align: center; min-width: 68px; }
  .effort-box .label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
  .effort-box .value { font-size: 13px; font-weight: 700; color: var(--accent); margin-top: 2px; }
  .effort-op { font-size: 16px; color: var(--text-muted); font-weight: 700; }
  .effort-table { width: 100%; border-collapse: collapse; font-size: 12px; }
  .effort-table th { padding: 6px 8px; text-align: left; color: var(--text-muted); border-bottom: 1px solid var(--border); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
  .effort-table td { padding: 7px 8px; border-bottom: 1px solid rgba(255,255,255,0.04); }
  .effort-calc { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-top: 16px; }
  .effort-calc label { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 4px; }
  .effort-calc input[type=range] { width: 100%; accent-color: var(--accent); margin-bottom: 10px; cursor: pointer; }
  .effort-calc select { width: 100%; background: rgba(255,255,255,0.07); border: 1px solid var(--border); color: var(--text); border-radius: 7px; padding: 7px 8px; font-size: 12px; margin-bottom: 10px; }
  .effort-result { font-size: 22px; font-weight: 700; color: var(--accent); text-align: center; padding: 12px; background: rgba(34,197,94,0.08); border-radius: 8px; border: 1px solid rgba(34,197,94,0.2); margin-top: 2px; }

  /* ── MATCH DAY BANNER ── */
  #matchday-banner {
    position: fixed; top: 52px; left: 0; right: 0; z-index: 999;
    background: linear-gradient(90deg, #92400e, #b45309);
    color: #fef3c7; font-size: 13px; font-weight: 600;
    padding: 6px 16px; display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid #d97706;
  }
  #matchday-banner.hidden { display: none; }
  #happyhour-banner {
    position: fixed; top: 52px; left: 0; right: 0; z-index: 998;
    background: linear-gradient(90deg, #1e3a8a, #1d4ed8);
    color: #bfdbfe; font-size: 13px; font-weight: 600;
    padding: 6px 16px; display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid #2563eb;
  }
  #happyhour-banner.hidden { display: none; }
  body.happyhour-active #left-panel  { top: 98px; }
  body.happyhour-active #right-panel { top: 98px; }
  /* Shift panels down when banner is visible (~34px banner height); map stays full-screen */
  body.matchday-active #map       { top: 0; }
  body.matchday-active #left-panel  { top: calc(98px + env(safe-area-inset-top)); }
  body.matchday-active #right-panel { top: calc(98px + env(safe-area-inset-top)); }
  body.matchday-active #hex-panel { bottom: calc(16px + env(safe-area-inset-bottom)); }
  #matchday-countdown { font-variant-numeric: tabular-nums; color: #fde68a; }
  #matchday-banner-close {
    margin-left: auto; background: none; border: none;
    color: #fef3c7; cursor: pointer; font-size: 16px; padding: 0 4px;
  }

  /* ── MATCH DAY MODAL ── */
  .mdp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .mdp-table th { padding: 8px 10px; text-align: left; color: var(--text-muted); border-bottom: 1px solid var(--border); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
  .mdp-table td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,0.04); }
  .mdp-table tr:last-child td { border-bottom: none; }
  .mdp-table tr.mdp-me td { background: rgba(34,197,94,0.08); }
  .mdp-rank { font-weight: 700; font-size: 12px; width: 28px; text-align: center; }
  .mdp-rank.gold   { color: #fbbf24; }
  .mdp-rank.silver { color: #94a3b8; }
  .mdp-rank.bronze { color: #f97316; }
  .mdp-pts  { font-weight: 700; color: #fbbf24; }
  .mdp-hex  { color: var(--text-muted); font-size: 11px; }
  .matchday-info-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
  .matchday-chip { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.25); border-radius: 8px; padding: 6px 12px; font-size: 12px; color: #fcd34d; }
  .matchday-chip span { color: var(--text); font-weight: 600; }
  #matchday-modal-countdown { font-size: 22px; font-weight: 800; color: #fbbf24; font-variant-numeric: tabular-nums; }
  .mdp-zone-legend { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
  .mdp-zone-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
  .mdp-zone-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

  /* ── GUARDIAN BADGE ── */
  .guardian-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px; border-radius: 20px;
    font-size: 11px; font-weight: 600; margin-top: 7px;
    border: 1px solid; white-space: nowrap;
  }
  .guardian-badge.tier-1 { background: rgba(180,90,30,0.15); border-color: rgba(180,90,30,0.4); color: #cd7f32; }
  .guardian-badge.tier-2 { background: rgba(148,163,184,0.15); border-color: rgba(148,163,184,0.4); color: #94a3b8; }
  .guardian-badge.tier-3 { background: rgba(251,191,36,0.15); border-color: rgba(251,191,36,0.4); color: #fbbf24; }

  /* ── ROLE BADGE ── */
  .role-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 7px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
    background: rgba(168,85,247,0.12); border: 1px solid rgba(168,85,247,0.35); color: #a855f7;
    white-space: nowrap;
  }
  .league-role { font-size: 11px; opacity: .8; }

  /* ── SYNERGY BADGE ── */
  .synergy-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px; border-radius: 20px;
    font-size: 11px; font-weight: 600; margin-top: 7px;
    background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.35); color: #818cf8;
    white-space: nowrap;
  }

  /* ── SIEGE STATUS CARD ── */
  #hex-siege-card {
    margin-top: 10px; padding: 10px 12px; border-radius: 10px;
    background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.3);
    font-size: 12px; display: none;
  }
  #hex-siege-card.visible { display: block; }
  #hex-siege-card .siege-title {
    font-weight: 700; font-size: 12px; color: #ef4444; letter-spacing: .04em; margin-bottom: 6px;
  }
  #hex-siege-card .siege-row {
    display: flex; justify-content: space-between; align-items: center;
    color: var(--text-muted); margin-bottom: 3px;
  }
  #hex-siege-card .siege-row span:last-child { color: var(--text); font-weight: 600; }
  #hex-siege-card .siege-countdown {
    margin-top: 7px; text-align: center; font-size: 14px; font-weight: 700;
    color: #ef4444; font-variant-numeric: tabular-nums;
  }
  #hex-siege-card.announced { background: rgba(251,191,36,0.08); border-color: rgba(251,191,36,0.3); }
  #hex-siege-card.announced .siege-title { color: #fbbf24; }
  #hex-siege-card.announced .siege-countdown { color: #fbbf24; }

  /* ── RIVAL INFO ── */
  .rival-info {
    margin-top: 12px; padding: 8px 10px;
    background: rgba(167,139,250,0.08); border: 1px solid rgba(167,139,250,0.25);
    border-radius: 8px; font-size: 12px;
  }
  .rival-info .rival-label { color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 3px; }
  .rival-info .rival-name  { font-weight: 700; color: #a78bfa; }
  .rival-info .rival-gap   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

  /* quests */
  .quest-item { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
  .quest-item:last-child { border-bottom: none; }
  .quest-item.done { opacity: 0.55; }
  .quest-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; min-width: 26px; text-align: center; }
  .quest-body { flex: 1; min-width: 0; }
  .quest-title { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .quest-bar-bg { height: 4px; background: rgba(255,255,255,0.07); border-radius: 2px; overflow: hidden; margin: 5px 0 3px; }
  .quest-bar { height: 100%; border-radius: 2px; background: var(--accent); transition: width .3s; }
  .quest-meta { font-size: 10px; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center; }
  .quest-ep { color: var(--warning); font-weight: 600; }
  .quest-scope { font-size: 9px; padding: 1px 5px; border-radius: 3px; font-weight: 600; letter-spacing: .04em; }
  .quest-scope.daily  { background: rgba(59,130,246,0.18); color: #60a5fa; }
  .quest-scope.weekly { background: rgba(168,85,247,0.18); color: #c084fc; }

/* area summary card */
.area-card { background:rgba(34,197,94,0.07);border:1px solid rgba(34,197,94,0.18);border-radius:10px;padding:9px 12px;font-size:12px; }
.area-card .area-players { color:var(--text);font-weight:600; }
.area-card .area-md { color:var(--text-muted);font-size:11px;margin-top:4px; }
[data-theme="light"] .area-card { background:rgba(34,197,94,0.06);border-color:rgba(34,197,94,0.25); }

/* first-sync achievements row */
.fsm-achievements { margin-bottom:22px; }
.fsm-achievements .fsm-ach-label { font-size:10px;text-transform:uppercase;letter-spacing:.07em;color:var(--text-muted);margin-bottom:8px; }
.fsm-ach-list { display:flex;flex-wrap:wrap;gap:6px;justify-content:center; }
.fsm-ach-badge { background:rgba(34,197,94,0.08);border:1px solid rgba(34,197,94,0.22);border-radius:8px;padding:5px 10px;font-size:12px;display:flex;align-items:center;gap:5px; }
.fsm-ach-badge .ach-icon { font-size:14px; }
.fsm-ach-badge .ach-name { font-size:11px;font-weight:600;color:var(--text); }
