:root{
  --asphalt:#03090C;
  --asphalt-2:#0C181E;
  --asphalt-3:#132126;
  --line:rgba(255,255,255,0.09);
  --paint:#FF6A00;
  --paint-2:#FFB000;
  --paint-dim:#B34A00;
  --glow:rgba(255,106,0,0.38);
  --court-green:#3ED27E;
  --amber:#FF9F1C;
  --chalk:#FFFFFF;
  --chalk-dim:#91A1A8;
  --shell:#020709;
  --shell-blur:rgba(2,7,9,0.85);
  /* Neumorphic dual-shadow pair - only reads correctly on a mid-tone
     surface, so .courtrow/.gamecard/etc use --asphalt-2/3 (not pure
     black) as their base. */
  --nu-dark:rgba(0,0,0,0.55);
  --nu-light:rgba(255,255,255,0.035);
}
body.light{
  --asphalt:#F4F1EC;
  --asphalt-2:#FFFFFF;
  --asphalt-3:#ECE7DE;
  --line:#E1DACD;
  --paint:#E0590A;
  --paint-2:#FF9A2E;
  --paint-dim:#FFD9B8;
  --glow:rgba(224,89,10,0.22);
  --court-green:#1C9A5B;
  --amber:#C2600C;
  --chalk:#1A1408;
  --chalk-dim:#7A6F5C;
  --shell:#F4F1EC;
  --shell-blur:rgba(244,241,236,0.85);
  --nu-dark:rgba(190,175,150,0.55);
  --nu-light:rgba(255,255,255,0.9);
}
/* ---------- PER-SPORT THEME (set via body[data-sport]) ----------
   Only the accent triad changes per sport - everything else (surfaces,
   text, neumorphic shadows) stays constant so switching sport re-colors
   the app without re-designing it. Basketball's values above are also
   the default/neutral palette (used pre-login and on the sport picker,
   where body has no data-sport yet). */
body[data-sport="soccer"]{ --paint:#16C96B; --paint-2:#A5EF38; --paint-dim:#0E8A49; --glow:rgba(22,201,107,0.34); }
body[data-sport="tennis"]{ --paint:#B9EE00; --paint-2:#EAFF54; --paint-dim:#7C9E00; --glow:rgba(185,238,0,0.30); }
body[data-sport="netball"]{ --paint:#FF1688; --paint-2:#FF63BA; --paint-dim:#B00E5D; --glow:rgba(255,22,136,0.32); }
body[data-sport="volleyball"]{ --paint:#00AEEA; --paint-2:#37E5FF; --paint-dim:#0076A1; --glow:rgba(0,174,234,0.32); }
body[data-sport="rugby"]{ --paint:#8C3CFF; --paint-2:#CF76FF; --paint-dim:#5F1FCC; --glow:rgba(140,60,255,0.32); }
body[data-sport="cricket"]{ --paint:#E63946; --paint-2:#FF8A65; --paint-dim:#A11F2A; --glow:rgba(230,57,70,0.30); }
body.light[data-sport="soccer"]{ --paint:#128F4E; --paint-2:#4CAF50; --paint-dim:#CDEFD9; --glow:rgba(18,143,78,0.2); }
body.light[data-sport="tennis"]{ --paint:#7A9A00; --paint-2:#AEDC3C; --paint-dim:#E7F2C2; --glow:rgba(122,154,0,0.2); }
body.light[data-sport="netball"]{ --paint:#C20E68; --paint-2:#FF63BA; --paint-dim:#F9CBE3; --glow:rgba(194,14,104,0.18); }
body.light[data-sport="volleyball"]{ --paint:#0077A6; --paint-2:#37C6FF; --paint-dim:#C7EBFB; --glow:rgba(0,119,166,0.18); }
body.light[data-sport="rugby"]{ --paint:#6B21D8; --paint-2:#B27CFF; --paint-dim:#E3D2FB; --glow:rgba(107,33,216,0.18); }
body.light[data-sport="cricket"]{ --paint:#B3212D; --paint-2:#FF8A65; --paint-dim:#F8D3D0; --glow:rgba(179,33,45,0.18); }
body, .sidebar, .header, .tabbar, .courtrow, .gamecard, .statbox, .badge,
.rowlink, .search, .mapcard, .presencecard, .theme-toggle{
  transition:background .25s ease, background-color .25s ease, border-color .25s ease, color .25s ease;
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
html,body{margin:0; padding:0; height:100%; background:var(--asphalt);}
body{
  font-family:'Manrope','Segoe UI',system-ui,sans-serif;
  color:var(--chalk);
  display:flex;
  min-height:100vh;
  /* Ambient glow layered over a faint leather-texture dot pattern, so
     there's a "photographic" depth behind the UI without needing an
     actual photo file - same technique as .hero already used. */
  background:
    radial-gradient(circle at 82% 8%, var(--glow), transparent 42%),
    radial-gradient(circle at 8% 95%, rgba(255,255,255,0.03), transparent 40%),
    repeating-radial-gradient(circle at 20% 15%, rgba(255,255,255,0.015) 0 2px, transparent 2px 64px),
    var(--asphalt);
}
h1,h2,h3,.display{
  font-family:'Archivo Black','Arial Black',sans-serif;
  text-transform:uppercase;
  letter-spacing:0.01em;
  margin:0;
}
::-webkit-scrollbar{ width:8px; }
::-webkit-scrollbar-thumb{ background:var(--line); border-radius:8px; }

/* ---------- SIDEBAR ---------- */
.sidebar{
  width:220px; flex:none; background:var(--shell); border-right:1px solid var(--line);
  display:flex; flex-direction:column; padding:22px 14px; gap:4px;
  position:sticky; top:0; height:100vh;
}
.brand{ display:flex; align-items:center; gap:8px; padding:6px 10px 26px; }
.brand .mark{
  width:30px; height:30px; border-radius:8px; background:var(--paint);
  display:flex; align-items:center; justify-content:center;
  font-family:'Archivo Black',sans-serif; color:#000000; font-size:14px;
}
.brand b{ font-family:'Archivo Black',sans-serif; font-size:16px; letter-spacing:0.02em;}
.brand-logo-img{ height:45px; width:auto; display:block; }
.navitem{
  display:flex; align-items:center; gap:12px; padding:11px 12px; border-radius:10px;
  color:var(--chalk-dim); font-size:13.5px; font-weight:700; cursor:pointer;
  transition:background .15s ease, color .15s ease;
  text-decoration:none;
}
.navitem:hover{ background:var(--asphalt-3); color:var(--chalk); }
.navitem.on{ background:rgba(255,106,0,0.12); color:var(--paint); }
.navitem .ic{ width:18px; text-align:center; }
.sidebar-foot{ margin-top:auto; padding:12px 10px; }
.sidebar-foot .loc{ font-size:11px; color:var(--chalk-dim); letter-spacing:0.06em; text-transform:uppercase; }
.sidebar-foot .city{ font-size:13px; font-weight:800; margin-top:2px;}

/* ---------- MAIN ---------- */
.main{ flex:1; min-width:0; display:flex; flex-direction:column; position:relative; }
.main-bg{
  position:absolute; inset:0; z-index:0;
  background-size:cover; background-position:center;
}
.main-bg::after{
  content:""; position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(2,7,9,0.55), var(--asphalt) 92%);
}
.main > .header, .main > .content{ position:relative; z-index:1; }
.header{
  display:flex; align-items:center; justify-content:space-between;
  padding:26px 34px 18px; border-bottom:1px solid var(--line);
  position:sticky; top:0; background:var(--shell-blur); backdrop-filter:blur(8px); z-index:20;
}
.header .eyebrow{ font-size:10.5px; letter-spacing:0.16em; color:var(--paint); text-transform:uppercase; font-weight:800; margin-bottom:4px;}
.header .title{ font-size:24px; }
.search{
  display:flex; align-items:center; gap:8px; padding:10px 16px; background:var(--asphalt-2);
  border:1px solid var(--line); border-radius:10px; color:var(--chalk-dim); font-size:13px; width:280px;
  box-shadow:inset 3px 3px 8px var(--nu-dark), inset -3px -3px 8px var(--nu-light);
}
.avatarpill{
  width:38px; height:38px; border-radius:10px; background:linear-gradient(135deg, var(--paint), var(--paint-2));
  display:flex; align-items:center; justify-content:center; font-family:'Archivo Black',sans-serif; color:#000000; font-size:15px; cursor:pointer;
  text-decoration:none; box-shadow:0 6px 16px -6px var(--glow);
}
.headerright{ display:flex; align-items:center; gap:12px; }
.theme-toggle{
  width:38px; height:38px; border-radius:10px; background:var(--asphalt-2);
  border:1px solid var(--line); color:var(--chalk); font-size:16px;
  display:flex; align-items:center; justify-content:center; cursor:pointer; flex:none;
  box-shadow:4px 4px 10px var(--nu-dark), -4px -4px 10px var(--nu-light);
}
.theme-toggle:hover{ border-color:var(--paint-dim); }

.content{ padding:26px 34px 60px; }
.view{ display:none; }
.view.active{ display:block; animation:fade .25s ease; }
@keyframes fade{ from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:translateY(0);} }

.section-label{ font-size:11.5px; letter-spacing:0.14em; text-transform:uppercase; color:var(--chalk-dim); font-weight:800; margin:26px 0 12px;}
.section-label:first-child{ margin-top:0; }

/* Map + court grid */
.layout-2col{ display:grid; grid-template-columns:1.3fr 1fr; gap:22px; align-items:start; }
.mapcard{
  height:360px; border-radius:20px; position:relative; overflow:hidden;
  border:1px solid var(--line);
}
#leafletMap{ position:absolute; inset:0; z-index:1; }
.leaflet-container{ background:var(--asphalt-2) !important; font-family:inherit; }
.pin-icon{ width:14px; height:14px; border-radius:50%; box-shadow:0 0 0 6px rgba(0,0,0,0.25); }
.pin-icon.live{ background:var(--court-green); animation:pulse 1.8s infinite; }
.pin-icon.recent{ background:var(--amber); }
.pin-icon.quiet{ background:var(--chalk-dim); }

/* A court with a manager-uploaded photo gets a circular photo pin instead of
   a plain dot - the status colour moves to the ring around it. */
.pin-icon-photo{
  width:30px; height:30px; border-radius:50%; overflow:hidden;
  border:3px solid var(--chalk-dim); background:#fff; box-shadow:0 2px 8px rgba(0,0,0,0.35);
}
.pin-icon-photo img{ width:100%; height:100%; object-fit:cover; display:block; }
.pin-icon-photo.live{ border-color:var(--court-green); }
.pin-icon-photo.recent{ border-color:var(--amber); }
.pin-icon-photo.quiet{ border-color:var(--chalk-dim); }
@keyframes pulse{ 0%{box-shadow:0 0 0 0 rgba(62,210,126,0.5)} 70%{box-shadow:0 0 0 14px rgba(62,210,126,0)} 100%{box-shadow:0 0 0 0 rgba(62,210,126,0)} }
.you{ position:absolute; bottom:16px; right:18px; font-size:10px; color:var(--chalk-dim); letter-spacing:0.1em; text-transform:uppercase; z-index:5;}
.legend{ position:absolute; top:16px; left:18px; display:flex; gap:14px; font-size:10.5px; color:var(--chalk-dim); z-index:5; background:var(--shell-blur); padding:6px 10px; border-radius:8px;}
.legend span{ display:flex; align-items:center; gap:5px; }
.legend i{ width:8px; height:8px; border-radius:50%; display:inline-block; }
.leaflet-popup-content-wrapper{ background:var(--asphalt-2); color:var(--chalk); border:1px solid var(--line); }
.leaflet-popup-tip{ background:var(--asphalt-2); }
.leaflet-popup-content b{ display:block; margin-bottom:3px; }
.leaflet-popup-content a{ color:var(--paint); font-weight:700; text-decoration:none; }

.courtrow{
  padding:15px; background:var(--asphalt-2); border:1px solid var(--line);
  border-radius:14px; display:flex; gap:12px; align-items:center; cursor:pointer;
  transition:border-color .15s ease, transform .1s ease, box-shadow .15s ease; margin-bottom:10px;
  box-shadow:7px 7px 16px var(--nu-dark), -7px -7px 16px var(--nu-light);
}
.courtrow:hover{ border-color:var(--paint-dim); transform:translateX(2px); box-shadow:9px 9px 20px var(--nu-dark), -9px -9px 20px var(--nu-light); }
.courtrow .dot{ width:9px; height:9px; border-radius:50%; flex:none; }
.dot.live{ background:var(--court-green); box-shadow:0 0 0 4px rgba(62,210,126,0.15);}
.dot.recent{ background:var(--amber); }
.dot.quiet{ background:var(--chalk-dim); }
.courtrow .thumb{ width:36px; height:36px; border-radius:10px; overflow:hidden; flex:none; border:2px solid var(--chalk-dim); }
.courtrow .thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.courtrow .thumb.live{ border-color:var(--court-green); }
.courtrow .thumb.recent{ border-color:var(--amber); }
.courtrow .thumb.quiet{ border-color:var(--chalk-dim); }
.courtrow .meta{ flex:1; }
.courtrow .name{ font-size:14.5px; font-weight:800; }
.courtrow .sub{ font-size:11.5px; color:var(--chalk-dim); margin-top:3px; }
.courtrow .dist{ font-size:11px; color:var(--chalk-dim); text-align:right; flex:none; }

.cta{
  display:inline-block; padding:13px 22px; text-align:center;
  background:linear-gradient(100deg, var(--paint), var(--paint-2)); color:#000000; font-weight:800; letter-spacing:0.03em;
  border-radius:12px; font-size:13.5px; text-transform:uppercase; border:none; cursor:pointer;
  box-shadow:0 10px 24px -8px var(--glow);
  text-decoration:none; transition:transform .1s ease, box-shadow .15s ease;
}
.cta.ghost{
  background:var(--asphalt-2); color:var(--chalk); border:1px solid var(--line); box-shadow:4px 4px 12px var(--nu-dark), -4px -4px 12px var(--nu-light);
}
.cta:active{ transform:scale(0.98); }
.cta:disabled{ opacity:0.5; cursor:not-allowed; }

/* Court detail */
.courtdetail{ display:grid; grid-template-columns:1.4fr 1fr; gap:26px; align-items:start; }
.hero{
  height:220px; border-radius:20px; position:relative; overflow:hidden;
  background:linear-gradient(160deg, #1A1400 0%, #0D0A00 60%, #000000 100%);
  border:1px solid var(--line); display:flex; align-items:flex-end; padding:20px;
}
.hero::before{ content:""; position:absolute; inset:0; background:repeating-radial-gradient(circle at 30% 40%, rgba(255,106,0,0.10) 0 2px, transparent 2px 70px); }
.hero .hooptag{ position:relative; font-size:12px; color:var(--amber); font-weight:800; letter-spacing:0.08em; text-transform:uppercase; }
.statgrid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:16px; }
.statbox{ background:var(--asphalt-2); border:1px solid var(--line); border-radius:12px; padding:13px 15px; box-shadow:6px 6px 14px var(--nu-dark), -6px -6px 14px var(--nu-light); }
.statbox .k{ font-size:10px; color:var(--chalk-dim); text-transform:uppercase; letter-spacing:0.1em; }
.statbox .v{ font-size:15px; font-weight:800; margin-top:4px; }
.badgewrap{ display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.badge{ font-size:11.5px; padding:7px 12px; border-radius:10px; background:var(--asphalt-2); border:1px solid var(--line); color:var(--chalk-dim); box-shadow:4px 4px 10px var(--nu-dark), -4px -4px 10px var(--nu-light); }

.presencecard{
  padding:20px; border-radius:18px;
  background:linear-gradient(135deg, rgba(62,210,126,0.12), rgba(62,210,126,0.02));
  border:1px solid rgba(62,210,126,0.35);
  box-shadow:7px 7px 16px var(--nu-dark), -7px -7px 16px var(--nu-light);
}
.presencecard .num{ font-family:'Archivo Black',sans-serif; font-size:44px; color:var(--court-green); line-height:1; }
.presencecard .lbl{ font-size:12px; color:var(--chalk-dim); margin-top:4px; }
.presencecard .next{ font-size:12px; color:var(--chalk-dim); margin-top:10px; }
.presencecard .cta{ width:100%; margin-top:16px; }

/* Games */
.filterrow{ display:flex; gap:8px; margin-bottom:18px; flex-wrap:wrap; }
.filterchip{ font-size:12px; padding:9px 15px; border-radius:20px; background:var(--asphalt-2); border:1px solid var(--line); color:var(--chalk-dim); cursor:pointer; box-shadow:4px 4px 10px var(--nu-dark), -4px -4px 10px var(--nu-light); }
.filterchip.on{ background:var(--paint); border-color:var(--paint); color:#000000; font-weight:800; }
.gamesgrid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(260px,1fr)); gap:16px; }
.gamecard{ padding:18px; background:var(--asphalt-2); border:1px solid var(--line); border-radius:16px; box-shadow:7px 7px 16px var(--nu-dark), -7px -7px 16px var(--nu-light); }
.gamecard .row1{ display:flex; justify-content:space-between; align-items:flex-start;}
.gamecard .gname{ font-size:15.5px; font-weight:800; }
.gamecard .gtime{ font-size:11.5px; color:var(--amber); font-weight:700;}
.gamecard .gsub{ font-size:12px; color:var(--chalk-dim); margin:5px 0 12px; }
.fillbar{ height:6px; border-radius:4px; background:var(--line); overflow:hidden; margin-bottom:12px; }
.fillbar > i{ display:block; height:100%; background:var(--court-green); }
.gamecard .row2{ display:flex; justify-content:space-between; align-items:center; }
.tag{ font-size:11px; padding:4px 9px; border-radius:20px; background:rgba(255,255,255,0.06); color:var(--chalk-dim);}
.tag.hot{ background:rgba(255,106,0,0.14); color:var(--paint); font-weight:700;}
.joinbtn{ font-size:11.5px; font-weight:800; text-transform:uppercase; color:var(--paint); background:rgba(255,106,0,0.12); border:1px solid var(--paint-dim); padding:9px 16px; border-radius:10px; cursor:pointer;}
.joinbtn:disabled{ opacity:0.5; cursor:not-allowed; }
.joinbtn.joined{ background:rgba(62,210,126,0.14); color:var(--court-green); border-color:rgba(62,210,126,0.4); }

/* Check-in */
.checkinwrap{ display:flex; flex-direction:column; align-items:center; justify-content:center; padding:50px 20px; text-align:center; gap:20px; }
.ring{ width:180px; height:180px; border-radius:50%; border:2px dashed var(--court-green); display:flex; align-items:center; justify-content:center; position:relative; }
.ring::before{ content:""; position:absolute; inset:16px; border-radius:50%; background:rgba(62,210,126,0.08); animation:pulse 1.8s infinite;}
.ring .big{ font-family:'Archivo Black',sans-serif; font-size:48px; color:var(--court-green); position:relative;}
.checkinwrap h2{ font-size:24px; }
.checkinwrap p{ font-size:13.5px; color:var(--chalk-dim); max-width:320px; line-height:1.6; margin:0;}
.stampfeed{ font-size:12px; color:var(--chalk-dim); }
.stampfeed b{ color:var(--chalk); }
.checkinbtns{ display:flex; gap:10px; }

/* Profile */
.profilehead{ display:flex; gap:18px; align-items:center; margin-bottom:24px; }
.avatar{ width:76px; height:76px; border-radius:18px; background:linear-gradient(135deg, var(--paint), var(--paint-2)); display:flex; align-items:center; justify-content:center; font-family:'Archivo Black',sans-serif; font-size:26px; color:#000000; box-shadow:0 12px 28px -10px var(--glow); }
.profilehead .name{ font-size:21px; font-weight:800; }
.profilehead .pos{ font-size:12.5px; color:var(--paint); font-weight:700; margin-top:3px;}
.profilehead .loc{ font-size:11.5px; color:var(--chalk-dim); margin-top:3px;}
.profgrid{ display:grid; grid-template-columns:1fr 1fr; gap:22px; }
.rowlink{ padding:15px 17px; background:var(--asphalt-2); border:1px solid var(--line); border-radius:12px; display:flex; justify-content:space-between; align-items:center; font-size:13.5px; margin-bottom:10px; box-shadow:5px 5px 12px var(--nu-dark), -5px -5px 12px var(--nu-light); }
.rowlink .l{ color:var(--chalk-dim); }
.rowlink .r{ font-weight:700; }

/* ---------- MOBILE TAB BAR (hidden on desktop) ---------- */
.tabbar{
  display:none;
  position:fixed; left:0; right:0; bottom:0; z-index:60;
  justify-content:space-around; align-items:center;
  padding:8px 4px calc(10px + env(safe-area-inset-bottom));
  background:var(--shell-blur); backdrop-filter:blur(10px);
  border-top:1px solid var(--line);
}
.tabbar .tabitem{
  display:flex; flex-direction:column; align-items:center; gap:3px;
  color:var(--chalk-dim); font-size:9.5px; letter-spacing:0.03em; text-transform:uppercase;
  font-weight:700; padding:6px 10px; border-radius:10px; min-width:56px;
  text-decoration:none;
}
.tabbar .tabitem .ic{ font-size:19px; line-height:1; }
.tabbar .tabitem.on{ color:var(--paint); }

@media (max-width: 880px){
  body{ padding-bottom:0; }
  .sidebar{ display:none; }
  .tabbar{ display:flex; }

  .header{
    padding:16px 16px 12px;
    flex-wrap:wrap;
    row-gap:12px;
  }
  .header .title{ font-size:20px; }
  .header .eyebrow{ font-size:10px; }
  .headerright{ width:100%; gap:10px; }
  .search{ width:auto; flex:1; padding:11px 14px; font-size:13px; }
  .avatarpill{ width:38px; height:38px; flex:none; }

  .content{ padding:16px 16px calc(88px + env(safe-area-inset-bottom)); }

  .layout-2col, .courtdetail, .profgrid{ grid-template-columns:1fr; gap:16px; }
  .mapcard{ height:220px; border-radius:16px; }
  .legend{ font-size:9.5px; gap:10px; top:12px; left:14px; }

  .section-label{ margin:20px 0 10px; font-size:11px; }

  .courtrow{ padding:13px; border-radius:12px; }
  .courtrow .name{ font-size:14px; }
  .courtrow .sub{ font-size:11px; }

  .hero{ height:170px; border-radius:16px; padding:16px; }
  .statgrid{ grid-template-columns:1fr 1fr; gap:8px; }
  .statbox{ padding:11px 13px; border-radius:10px; }
  .badgewrap{ gap:6px; }
  .badge{ font-size:11px; padding:6px 10px; }

  .presencecard{ padding:18px; border-radius:16px; }
  .presencecard .num{ font-size:38px; }

  .gamesgrid{ grid-template-columns:1fr; gap:12px; }
  .gamecard{ padding:15px; border-radius:14px; }
  .filterrow{ flex-wrap:nowrap; overflow-x:auto; padding-bottom:4px; -webkit-overflow-scrolling:touch; }
  .filterrow::-webkit-scrollbar{ display:none; }
  .filterchip{ flex:none; }

  .checkinwrap{ padding:30px 16px; gap:16px; }
  .ring{ width:150px; height:150px; }
  .ring .big{ font-size:40px; }
  .checkinwrap h2{ font-size:20px; }
  .checkinwrap p{ font-size:13px; }
  .checkinbtns{ flex-direction:column; width:100%; }
  .checkinbtns .cta{ width:100%; }

  .profilehead{ margin-bottom:18px; }
  .avatar{ width:62px; height:62px; border-radius:14px; font-size:22px; }
  .profilehead .name{ font-size:18px; }
  .rowlink{ padding:13px 15px; font-size:13px; }

  .cta{ padding:14px 20px; font-size:13px; }
}

/* ---------- SPLASH ---------- */
.splash{
  position:fixed; inset:0; z-index:999;
  background:
    radial-gradient(circle at 82% 10%, var(--glow), transparent 42%),
    repeating-radial-gradient(circle at 25% 60%, rgba(255,106,0,0.06) 0 2px, transparent 2px 60px),
    var(--asphalt);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  transition:opacity .5s ease;
}
.splash.hide{ opacity:0; pointer-events:none; }
.splash.has-photo{ background-size:cover; background-position:center; }
.splash.has-photo::before{
  content:""; position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(2,7,9,0.5), var(--asphalt) 85%);
}
.splash.has-photo .splash-logo, .splash.has-photo .splash-barwrap{ position:relative; z-index:1; }
.splash-logo{ display:flex; flex-direction:column; align-items:center; gap:2px; }
.splash-mark{
  width:64px; height:64px; border-radius:18px; background:var(--paint);
  display:flex; align-items:center; justify-content:center;
  font-family:'Archivo Black',sans-serif; font-size:26px; color:#000000;
  box-shadow:0 16px 34px -12px rgba(255,106,0,0.6);
  margin-bottom:16px;
}
.splash-word{ font-family:'Archivo Black',sans-serif; font-size:22px; letter-spacing:0.03em; color:var(--chalk); }
.splash-logo-img{ width:min(140px, 40vw); height:auto; display:block; }
.splash-tag{ font-size:10.5px; letter-spacing:0.16em; text-transform:uppercase; color:var(--chalk-dim); margin-top:6px; }
.splash-barwrap{
  position:absolute; left:50%; bottom:48px; transform:translateX(-50%);
  width:200px; height:4px; border-radius:4px; background:var(--line); overflow:hidden;
}
.splash-bar{ height:100%; width:0%; background:var(--paint); border-radius:4px; }

@media (max-width: 420px){
  .header .title{ font-size:18px; }
  .presencecard .num{ font-size:34px; }
  .ring{ width:130px; height:130px; }
  .ring .big{ font-size:34px; }
}

/* ---------- AUTH PAGES ---------- */
.authwrap{
  flex:1; display:flex; align-items:center; justify-content:center; min-height:100vh; padding:24px;
  position:relative; overflow:hidden;
}
.authwrap::before{
  content:""; position:absolute; inset:0; z-index:0;
  background:
    radial-gradient(circle at 80% 10%, var(--glow), transparent 45%),
    repeating-radial-gradient(circle at 30% 70%, rgba(255,106,0,0.05) 0 2px, transparent 2px 60px);
}
.authcard{
  width:100%; max-width:380px; background:var(--asphalt-2); border:1px solid var(--line); border-radius:20px; padding:32px 28px;
  position:relative; z-index:1;
  box-shadow:0 24px 60px -16px rgba(0,0,0,0.6), 10px 10px 24px var(--nu-dark), -10px -10px 24px var(--nu-light);
}
.authcard .brand{ padding:0 0 22px; justify-content:center; }
.authcard h1{ font-size:19px; text-align:center; margin-bottom:6px; }
.authcard .subtext{ font-size:12.5px; color:var(--chalk-dim); text-align:center; margin-bottom:22px; }
.field{ margin-bottom:14px; }
.field label{ display:block; font-size:11.5px; color:var(--chalk-dim); text-transform:uppercase; letter-spacing:0.06em; font-weight:700; margin-bottom:6px; }
.field input, .field select{
  width:100%; padding:12px 14px; background:var(--asphalt-3); border:1px solid var(--line);
  border-radius:10px; color:var(--chalk); font-size:14px; font-family:inherit;
}
.field input:focus, .field select:focus{ outline:none; border-color:var(--paint-dim); }
.autherr{ background:rgba(255,106,0,0.1); border:1px solid var(--paint-dim); color:var(--paint); font-size:12.5px; padding:10px 14px; border-radius:10px; margin-bottom:14px; }
.authcard .cta{ width:100%; margin-top:6px; }
.authlink{ text-align:center; font-size:12.5px; color:var(--chalk-dim); margin-top:18px; }
.authlink a{ color:var(--paint); font-weight:700; text-decoration:none; }
/* Fixed centering with no height cap is what let a tall modal (Add a court has ~10 fields)
   push past the top/bottom of a short viewport with no way to scroll to the buttons at the
   bottom — the bug being fixed here. max-height + overflow-y keeps the card itself scrollable
   and always fully on-screen, on every viewport size, not just mobile. */
.modalbg{ position:fixed; inset:0; background:rgba(0,0,0,0.6); z-index:200; display:flex; align-items:center; justify-content:center; padding:20px; overflow-y:auto; }
.modalcard{
  width:100%; max-width:420px; background:var(--asphalt-2); border:1px solid var(--line); border-radius:20px; padding:26px;
  max-height:calc(100vh - 40px); max-height:calc(100dvh - 40px); overflow-y:auto; position:relative;
  box-shadow:0 20px 60px -12px rgba(0,0,0,0.7), 10px 10px 24px var(--nu-dark), -10px -10px 24px var(--nu-light);
}
.modalcard h3{ font-size:16px; margin-bottom:16px; padding-right:26px; }
.modal-actions{ display:flex; gap:10px; margin-top:8px; }
.modal-close{
  position:absolute; top:14px; right:14px; width:30px; height:30px; border-radius:50%;
  background:var(--asphalt-3); border:1px solid var(--line); color:var(--chalk);
  display:flex; align-items:center; justify-content:center; font-size:14px; cursor:pointer;
}

/* Phones — the fixed 20px surrounding padding plus a centered box eats too much of a narrow
   screen, and there's no way to keep a fixed height reachable while an on-screen keyboard is
   up. A bottom sheet fixes both: anchored to the bottom edge (nowhere for it to drift off-screen
   above the fold), full width, and sized off dvh so it correctly shrinks when the keyboard opens
   (plain vh doesn't). Same pattern used for jokas' stage modals. */
@media (max-width: 640px){
  .modalbg{ align-items:flex-end; padding:0; }
  .modalcard{ max-width:100%; width:100%; border-radius:20px 20px 0 0; max-height:90vh; max-height:90dvh; padding:22px 20px 26px; }
}

/* ---------- SPORT PICKER (landing grid) ---------- */
.sportswrap{ min-height:100vh; padding:40px 24px 60px; max-width:920px; margin:0 auto; }
.sportswrap .brand{ justify-content:center; padding-bottom:6px; }
.sportswrap h1{ font-size:24px; text-align:center; margin-top:10px; }
.sportswrap .subtext{ font-size:13.5px; color:var(--chalk-dim); text-align:center; margin-bottom:34px; }
.sportsgrid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); gap:16px; margin-bottom:36px; }
.sportcard{
  background:var(--asphalt-2); border:1px solid var(--line); border-radius:16px; padding:22px 14px;
  text-align:center; cursor:pointer; transition:border-color .15s, transform .15s, box-shadow .15s; text-decoration:none; color:inherit;
  box-shadow:6px 6px 14px var(--nu-dark), -6px -6px 14px var(--nu-light);
}
.sportcard:hover{ border-color:var(--paint-dim); transform:translateY(-2px); box-shadow:8px 8px 18px var(--nu-dark), -8px -8px 18px var(--nu-light); }
.sportcard .icon{ font-size:34px; display:block; margin-bottom:10px; }
.sportcard .name{ font-family:'Archivo Black',sans-serif; font-size:14px; }
.sportcard .count{ font-size:11px; color:var(--chalk-dim); margin-top:4px; text-transform:uppercase; letter-spacing:0.05em; }
.sportcard.current{ border-color:var(--court-green); }
.sports-create{ background:var(--asphalt-2); border:1px solid var(--line); border-radius:16px; padding:22px 24px; max-width:420px; margin:0 auto; box-shadow:7px 7px 16px var(--nu-dark), -7px -7px 16px var(--nu-light); }
.sports-create h3{ font-size:15px; margin-bottom:14px; }
.sports-switch{ text-align:center; margin-top:14px; }
.sports-switch a{ color:var(--paint); font-weight:700; font-size:12.5px; text-decoration:none; }
.modal-actions .cta{ flex:1; }
