/* EstSportz Rally HUB — WRC.com inspired clean UI (light) */

:root{
  /* Mid-dark: clearer separation between surfaces, less "flat dark" */
  --bg:#111d3a;
  --bg2:#0b1631;
  --card:#182851;
  --card2:#121f3e;
  --line:rgba(255,255,255,.12);
  --line2:rgba(255,255,255,.18);

  --text:#eef4ff;
  --muted:rgba(238,244,255,.80);
  --muted2:rgba(238,244,255,.62);

  --accent:#ff6a2a;
  --accent2:#ff8a3d;

  --good:#2ad67d;
  --warn:#ffb020;
  --bad:#ff4d5a;

  --r:12px;
  --r2:16px;
  --shadow: 0 16px 46px rgba(0,0,0,.24);

  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{
  margin:0;
  font-family:var(--sans);
  color:var(--text);
  background: var(--bg2);
  overflow-x:hidden;
}
body{
  margin:0;
  font-family:var(--sans);
  color:var(--text);
  background:var(--bg);
  overflow-x:hidden;
}

.bg-grid{display:none;} /* keep markup, hide background grid */

a{color:inherit}
.mono{font-family:var(--mono)}
.small{font-size:12px; color:var(--muted2); line-height:1.5}
.hr{height:1px; background:var(--line); margin:14px 0}

.topbar{
  position:sticky; top:0; z-index:60;
  display:flex; align-items:center; justify-content:space-between;
  gap:16px;
  padding:14px 18px;
  border-bottom:1px solid rgba(255,255,255,.10);
  background: rgba(18,28,54,.92);
}

.brand{display:flex; align-items:center; gap:12px; min-width:260px}
.brand__logo{width:40px; height:40px; object-fit:contain}
.brand__title{font-weight:900; letter-spacing:.2px; font-size:14px}
.brand__subtitle{font-size:12px; color:var(--muted2)}

.nav{display:flex; gap:18px; flex-wrap:wrap}
.nav__link{
  padding:10px 0;
  border-bottom:2px solid transparent;
  text-decoration:none;
  color:var(--muted);
  font-weight:800;
  font-size:12px;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.nav__link:hover{color:var(--text)}
.nav__link.is-active{
  color:var(--text);
  border-bottom-color: var(--accent);
}

.topbar__right{display:flex; align-items:center; gap:10px}

.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  font-size:12px;
  color:var(--muted);
  background: rgba(255,255,255,.02);
}

.app{max-width:1280px; margin:0 auto; padding:18px 18px 44px}
.grid{display:grid; gap:14px}
.grid--2{grid-template-columns:repeat(2, minmax(0,1fr))}
.grid--3{grid-template-columns:repeat(3, minmax(0,1fr))}
.grid--4{grid-template-columns:repeat(4, minmax(0,1fr))}
@media (max-width: 980px){.grid--4{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width: 700px){.grid--3,.grid--2{grid-template-columns:1fr}}
.row{display:flex; gap:12px; flex-wrap:wrap}
.row--between{justify-content:space-between; align-items:center}

.hero{
  border-radius: var(--r2);
  padding:16px 16px;
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(17,26,43,.92), rgba(15,23,38,.92));
  box-shadow: var(--shadow);
}
.h1{font-size:22px; margin:0 0 4px 0}
.h2{font-size:13px; margin:0; color:var(--muted); line-height:1.55}

.pageTabs{
  margin-top:12px;
  display:flex;
  gap:22px;
  flex-wrap:wrap;
  border-bottom:1px solid rgba(255,255,255,.10);
}
.pageTab{
  appearance:none;
  border:none;
  background:transparent;
  padding:12px 0;
  font-weight:900;
  font-size:12px;
  letter-spacing:.06em;
  color:var(--muted);
  text-transform:uppercase;
  border-bottom:3px solid transparent;
  cursor:pointer;
}
.pageTab:hover{color:var(--text)}
.pageTab.is-active{color:var(--text); border-bottom-color:var(--accent)}
.pageTab:hover{color:var(--text)}
.pageTab.is-active{color:var(--text); border-bottom-color:var(--accent)}

.btn{
  appearance:none;
  border:1px solid var(--line2);
  background: rgba(255,255,255,.04);
  color:var(--text);
  border-radius:10px;
  padding:10px 12px;
  font-weight:900;
  cursor:pointer;
  box-shadow:none;
}
.btn:hover{border-color:rgba(255,255,255,.26); background:rgba(255,255,255,.06)}
.btn--ghost{background:rgba(255,255,255,.03)}
.btn--danger{
  border-color: rgba(255,77,90,.40);
  color: rgba(255,132,140,.98);
  background: rgba(255,77,90,.10);
}
.btn:hover{border-color:#c8d1dd}
.btn--ghost{background: rgba(255,255,255,.04)}
.btn--danger{
  border-color: rgba(240,68,56,.35);
  color: #b42318;
  background: linear-gradient(180deg, rgba(17,26,43,.96), rgba(15,23,38,.96));
  color: var(--text);
}
.btn--sm{padding:8px 10px; font-size:12px; border-radius:10px}

.card{
  border-radius: var(--r2);
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(17,26,43,.92), rgba(15,23,38,.92));
  box-shadow: var(--shadow);
  overflow:hidden;
}
.card__body{padding:14px 14px 12px}
.card__title{font-weight:950; font-size:14px; margin:0 0 6px 0}
.card__meta{display:flex; gap:10px; flex-wrap:wrap; color:var(--muted); font-size:12px}

.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  color: rgba(238,244,255,.88);
  background: rgba(0,0,0,.22);
  font-size:12px;
}
.pill--accent{
  border-color: rgba(255,106,42,.40);
  color: rgba(255,230,220,.96);
  background: rgba(255,106,42,.16);
}
.pill--good{border-color: rgba(23,178,106,.30); color:#067647; background: rgba(42,214,125,.10)}
.pill--warn{border-color: rgba(247,144,9,.30); color:#b54708; background: rgba(255,176,32,.12)}
.pill--bad{border-color: rgba(240,68,56,.30); color:#b42318; background: rgba(255,77,90,.10)}

.input, select{
  width:100%;
  background: rgba(255,255,255,.03);
  border:1px solid var(--line2);
  border-radius:10px;
  padding:10px 12px;
  color:var(--text);
  outline:none;
}
.input:focus, select:focus{
  border-color: rgba(255,106,42,.55);
  box-shadow: 0 0 0 4px rgba(255,106,42,.14);
}
.input:focus, select:focus{
  border-color: rgba(255,75,31,.45);
  box-shadow: 0 0 0 4px rgba(255,75,31,.10);
}
label{display:block; font-size:12px; color:var(--muted); margin-bottom:6px}
.formRow{display:grid; gap:12px; grid-template-columns:repeat(2, minmax(0,1fr))}
@media (max-width: 740px){.formRow{grid-template-columns:1fr}}

.tabs{
  display:flex; gap:18px; flex-wrap:wrap;
  border-bottom:1px solid rgba(255,255,255,.10);
}
.tab{
  padding:10px 0;
  border:none;
  background:transparent;
  color:var(--muted);
  font-weight:900;
  cursor:pointer;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.06em;
  border-bottom:3px solid transparent;
}
.tab:hover{color:var(--text)}
.tab.is-active{color:var(--text); border-bottom-color:var(--accent)}
.tab:hover{color:var(--text)}
.tab.is-active{color:var(--text); border-bottom-color:var(--accent)}
.tabs--scroll{flex-wrap:nowrap; overflow:auto}

.tableHeader{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.tableHeader__title{
  font-weight:950;
  font-size:14px;
}
.filterPill{
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.selectSmall{
  width:auto;
  min-width:120px;
  padding:8px 10px;
  border-radius:999px;
}

.tableWrap{
  overflow:auto;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(15,23,38,.70);
}
table{width:100%; border-collapse:collapse; min-width:760px}
th, td{
  text-align:left;
  padding:11px 12px;
  border-bottom:1px solid rgba(255,255,255,.08);
  font-size:13px;
  vertical-align:middle;
}
th{
  color:rgba(234,240,255,.62);
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:11px;
  background: rgba(17,26,43,.55);
}
tr:hover td{background:rgba(255,255,255,.03)}
td.right, th.right{text-align:right}
td.center, th.center{text-align:center}

.rallyTile{
  border-radius:14px;
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(17,26,43,.96), rgba(15,23,38,.96));
  color: var(--text);
  transition:.12s ease;
}
.rallyTile:hover{border-color:#c8d1dd}
.rallyTile__top{padding:12px}
.rallyTile__flag{
  float:right;
  font-size:18px;
}
.rallyTile__name{font-weight:1000; font-size:14px; margin:0}
.rallyTile__sub{margin-top:6px; color:var(--muted); font-size:12px}

.drop{
  border:1px dashed var(--line2);
  background: linear-gradient(180deg, rgba(17,26,43,.96), rgba(15,23,38,.96));
  color: var(--text);
  border-radius:12px;
  padding:12px;
}

.footer{
  max-width:1280px;
  margin:0 auto;
  padding:16px 18px 24px;
  display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap;
  color:var(--muted2);
  border-top:1px solid rgba(255,255,255,.08);
  background:transparent;
}

.toast{
  position:fixed;
  bottom:18px; right:18px;
  max-width:380px;
  background:#111827;
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  padding:12px 14px;
  color:#fff;
  box-shadow: 0 14px 40px rgba(0,0,0,.22);
  display:none;
}
.toast.show{display:block}
.toast__title{font-weight:900; margin-bottom:4px}
.toast__msg{color:rgba(255,255,255,.78); font-size:13px; line-height:1.5}

.modalOverlay{
  position:fixed; inset:0;
  background:rgba(17,24,39,.55);
  display:flex; align-items:center; justify-content:center;
  padding:18px;
  z-index:100;
}
.modal{
  width:min(900px, 100%);
  border-radius:16px;
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(17,26,43,.96), rgba(15,23,38,.96));
  color: var(--text);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal__head{
  padding:14px 16px;
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.modal__title{font-weight:950; letter-spacing:.2px}
.modal__body{padding:14px 16px 16px}
kbd{
  font-family:var(--mono);
  font-size:11px;
  padding:3px 6px;
  border-radius:8px;
  border:1px solid var(--line);
  background:#f9fafb;
  color:var(--muted);
}

/* colored numeric columns like WRC style */
.colPenalty{ color: rgba(255,77,90,.96); font-variant-numeric: tabular-nums; }
.colDiff1st{ color: rgba(255,138,61,.92); font-variant-numeric: tabular-nums; }
.colTime{ font-variant-numeric: tabular-nums; }


/* ---- Rally cards (RaceNet-style) ---- */

.rallyCardsRow{
  display:flex;
  gap:14px;
  overflow:auto;
  padding-bottom:8px;
  scrollbar-width:thin;
}
.rallyCardsRow::-webkit-scrollbar{height:8px}
.rallyCardsRow::-webkit-scrollbar-thumb{background:rgba(255,255,255,.12); border-radius:999px}

.rallyCard{
  position:relative;
  width: 320px;
  min-width: 320px;
  height: 150px;
  border-radius:16px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(720px 220px at 15% 25%, rgba(255,106,42,.12), transparent 62%),
    linear-gradient(180deg, rgba(17,26,43,.92), rgba(15,23,38,.92));
  box-shadow: 0 18px 44px rgba(0,0,0,.26);
  cursor:pointer;
  transition: transform .15s ease, border-color .15s ease;
}
.rallyCard:hover{ transform: translateY(-2px); border-color: rgba(255,255,255,.18); }
.rallyCard.is-active{ border-color: rgba(255,106,42,.38); }

.rallyCard__img{
  position:absolute; inset:0;
  background-size:cover;
  background-position:center;
  opacity:.96;
  filter:saturate(1.05) contrast(1.02);
}
.rallyCard__img::after{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,.00) 32%, rgba(0,0,0,.55) 72%, rgba(0,0,0,.72));
}
.rallyCard__body{
  position:absolute; inset:auto 0 0 0;
  padding:12px 12px 12px 12px;
}
.rallyCard__title{
  font-weight:1000;
  font-size:16px;
  line-height:1.15;
  color: rgba(234,240,255,.96);
  text-shadow: 0 10px 30px rgba(0,0,0,.40);
}
.rallyCard__meta{
  margin-top:6px;
  display:flex;
  gap:10px;
  align-items:center;
  color: rgba(234,240,255,.78);
  font-size:12px;
}
.rallyCard__meta .dot{opacity:.6}
.rallyCard__flag{
  position:absolute;
  top:10px; right:10px;
  font-size:18px;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.45));
}
.rallyCard__subtle{
  position:absolute;
  top:10px; left:10px;
  color: rgba(234,240,255,.76);
  font-size:11px;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
  background: rgba(0,0,0,.24);
  border:1px solid rgba(255,255,255,.10);
  padding:4px 8px;
  border-radius:999px;
}
@media (max-width: 760px){
  .rallyCard{ width: 280px; min-width:280px; height: 142px; }
}

.btn--ghost{ background: rgba(255,255,255,.03) !important; }


/* ==== FINAL TOUCH v2 (fix white modals + file inputs + racenet tiles) ==== */

/* Modal must follow dark theme */
.modal{
  border:1px solid rgba(255,255,255,.12) !important;
  background: linear-gradient(180deg, rgba(17,26,43,.98), rgba(15,23,38,.98)) !important;
  color: var(--text) !important;
}
.modal__head{
  background: rgba(0,0,0,.12);
  border-bottom: 1px solid rgba(255,255,255,.10) !important;
}
.modal__title{ color: var(--text) !important; }
.modal__body{ color: var(--text) !important; }

kbd{
  background: rgba(255,255,255,.06) !important;
  border:1px solid rgba(255,255,255,.12) !important;
  color: var(--muted) !important;
}

/* Drop zones should never be white */
.drop{
  background: rgba(255,255,255,.03) !important;
  border:1px dashed rgba(255,255,255,.18) !important;
}

/* Native file input button styling (prevents white 'Choose File') */
input[type="file"]{
  color: var(--muted);
}
input[type="file"]::file-selector-button{
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding:8px 10px;
  border-radius:10px;
  font-weight:900;
  cursor:pointer;
  margin-right:10px;
}
input[type="file"]::file-selector-button:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.26);
}
input[type="file"]::-webkit-file-upload-button{
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding:8px 10px;
  border-radius:10px;
  font-weight:900;
  cursor:pointer;
  margin-right:10px;
}
input[type="file"]::-webkit-file-upload-button:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.26);
}

/* RaceNet-style rally tiles (image + bottom bar) */
.rallyRail{
  display:flex;
  gap:12px;
  overflow:auto;
  padding-bottom:6px;
  scroll-snap-type:x mandatory;
}
.rallyRail::-webkit-scrollbar{height:8px}
.rallyRail::-webkit-scrollbar-thumb{background:rgba(255,255,255,.12); border-radius:999px}
.rallyTileNet{
  width: min(320px, 82vw);
  flex: 0 0 auto;
  scroll-snap-align:start;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  overflow:hidden;
  background: rgba(255,255,255,.02);
  box-shadow: 0 16px 44px rgba(0,0,0,.38);
  cursor:pointer;
  transition: transform .12s ease, border-color .12s ease;
}
.rallyTileNet:hover{ transform: translateY(-1px); border-color: rgba(255,255,255,.22); }
.rallyTileNet.is-active{ border-color: rgba(255,106,42,.65); box-shadow: 0 18px 60px rgba(255,106,42,.12), 0 16px 44px rgba(0,0,0,.38); }
.rallyTileNet__img{
  height:110px;
  background-size:cover;
  background-position:center;
  position:relative;
}
.rallyTileNet__img:after{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,.00) 40%, rgba(0,0,0,.35), rgba(0,0,0,.65));
}
.rallyTileNet__body{
  padding:10px 12px;
  background: rgba(10,14,26,.78);
  border-top: 1px solid rgba(255,255,255,.10);
}
.rallyTileNet__name{
  font-weight:1000;
  font-size:14px;
  margin:0 0 6px 0;
}
.rallyTileNet__meta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  color: rgba(234,240,255,.70);
  font-size:12px;
}
.rallyTileNet__meta .dot{opacity:.65}
.rallyTileNet__meta .cal{opacity:.85}


/* ---- FULL PAUK OVERRIDES ---- */

/* Fix native file inputs + white blobs */
input[type="file"]{
  color: rgba(234,240,255,.70);
}
input[type="file"]::file-selector-button{
  margin-right:10px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.03);
  color: var(--text);
  border-radius:10px;
  padding:8px 10px;
  font-weight:900;
  cursor:pointer;
}
input[type="file"]::file-selector-button:hover{
  border-color: rgba(255,255,255,.26);
  background: rgba(255,255,255,.05);
}

/* Colored columns */
.colPenalty{ color: rgba(255,77,90,.96); font-variant-numeric: tabular-nums; }
.colDiff1st{ color: rgba(255,138,61,.92); font-variant-numeric: tabular-nums; }
.colTime{ font-variant-numeric: tabular-nums; }

/* Penalty edit hammer (admin only) */
.penHammer{
  appearance:none;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: rgba(234,240,255,.88);
  border-radius:10px;
  padding:3px 6px;
  font-size:12px;
  line-height:1;
  margin-left:8px;
  cursor:pointer;
}
.penHammer:hover{ border-color: rgba(255,106,42,.45); box-shadow: 0 0 0 3px rgba(255,106,42,.12); }

/* Championship top3 highlight (Overall Standings page) */
/* top3 highlight uses only left border + medals */
tr.top1 td:first-child{ border-left:3px solid rgba(255,199,0,.85); }
tr.top2 td:first-child{ border-left:3px solid rgba(196,205,217,.85); }
tr.top3 td:first-child{ border-left:3px solid rgba(205,127,50,.85); }

.medal{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:22px;
  height:22px;
  border-radius:999px;
  margin-right:8px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.22);
  font-size:13px;
}
.medal.gold{ border-color: rgba(255,199,0,.55); }
.medal.silver{ border-color: rgba(196,205,217,.55); }
.medal.bronze{ border-color: rgba(205,127,50,.55); }


/* Banner hero (event + home) */
.hero--banner{
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.hero__shade{
  position:absolute;
  inset:0;
  background: linear-gradient(180deg, rgba(7,11,22,.42), rgba(7,11,22,.72));
  pointer-events:none;
}
.hero__content{position:relative; z-index:1}

/* Home Top3 edges */
.edge-gold{border-left:3px solid rgba(255,199,0,.85); padding-left:10px}
.edge-silver{border-left:3px solid rgba(196,205,217,.85); padding-left:10px}
.edge-bronze{border-left:3px solid rgba(205,127,50,.85); padding-left:10px}

/* Driver clickable name */
.linkBtn{
  appearance:none;
  border:none;
  background:transparent;
  padding:0;
  color:rgba(238,244,255,.96);
  font-weight:950;
  cursor:pointer;
}
.linkBtn:hover{ color: rgba(255,138,61,.95); text-decoration: underline; text-underline-offset: 3px; }
.driverCard{
  display:grid;
  grid-template-columns: 1.3fr .9fr;
  gap:14px;
}
.driverCard .box{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  border-radius:14px;
  padding:12px;
}
.driverCard .kpi{
  display:flex; align-items:baseline; justify-content:space-between;
  padding:10px 0;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.driverCard .kpi:last-child{ border-bottom:none; }
.driverCard .kpi b{ font-size:16px; }
.driverCard .kpi span{ color: rgba(238,244,255,.70); font-size:12px; text-transform:uppercase; letter-spacing:.08em; }
.trophy{ margin-left:8px; }

/* ---- HOME: more engaging ---- */
.homeHero{
  position:relative;
  border-radius: 20px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(24,40,81,.92), rgba(18,31,62,.92));
  box-shadow: var(--shadow);
}
.homeHero__img{
  position:absolute; inset:0;
  background-size:cover;
  background-position:center;
  opacity:.40;
  filter:saturate(1.05) contrast(1.02);
}
.homeHero__shade{
  position:absolute; inset:0;
  background: linear-gradient(90deg, rgba(7,12,26,.74), rgba(7,12,26,.34) 56%, rgba(7,12,26,.64));
}
.homeHero__body{
  position:relative;
  padding:18px 18px;
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:14px;
}
@media (max-width:900px){ .homeHero__body{ grid-template-columns:1fr; } }

.homeHero__title{ font-size:28px; font-weight:1000; margin:0 0 6px 0; letter-spacing:.2px; }
.homeHero__sub{ margin:0; color: var(--muted); line-height:1.55; font-size:13px; }

.liveBadge{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,106,42,.10);
  color: rgba(255,210,195,.95);
  font-weight:950;
  font-size:11px;
  letter-spacing:.10em;
  text-transform:uppercase;
}
.liveDot{
  width:8px; height:8px; border-radius:999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(255,106,42,.14);
}

.featureBox{
  border-radius:16px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(6,10,20,.72);
  padding:12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.kv{
  display:flex; justify-content:space-between; gap:10px; align-items:baseline;
  padding:8px 0;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.kv:last-child{ border-bottom:none; }
.kv span{ color: var(--muted2); font-size:11px; letter-spacing:.08em; text-transform:uppercase; }
.kv b{ font-size:14px; }

.sectionTitle{
  margin:18px 0 10px 0;
  display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;
}
.sectionTitle h3{ margin:0; font-size:14px; letter-spacing:.08em; text-transform:uppercase; color: rgba(238,244,255,.82); }

.eventCards{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:14px;
  max-width: 900px;
  margin: 0; /* align with content, not centered huge gap */
}
@media (max-width:900px){ .eventCards{ grid-template-columns:1fr; } }

.eventCard{
  position:relative;
  border-radius:18px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(24,40,81,.92), rgba(18,31,62,.92));
  box-shadow: var(--shadow);
  cursor:pointer;
}
.eventCard:hover{ border-color: rgba(255,255,255,.20); }
.eventCard__img{ position:absolute; inset:0; background-size:cover; background-position:center; opacity:.30; }
.eventCard__shade{ position:absolute; inset:0; background: linear-gradient(180deg, rgba(0,0,0,.22), rgba(0,0,0,.58)); }
.eventCard__body{ position:relative; padding:14px; display:flex; flex-direction:column; gap:10px; min-height:138px; }
.eventCard__name{ font-weight:1000; font-size:16px; margin:0; }
.eventCard__meta{ display:flex; gap:10px; flex-wrap:wrap; color: var(--muted); font-size:12px; }
.eventCard__cta{ margin-top:auto; display:flex; gap:10px; flex-wrap:wrap; }

.highlightList .item{
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  padding:10px 0;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.highlightList .item:last-child{ border-bottom:none; }
.highlightList .name{ font-weight:950; }
.highlightList .val{ color: var(--muted); font-variant-numeric: tabular-nums; }


/* ---- V11 readability tweaks ---- */

.featureBox{
  background: rgba(0,0,0,.22) !important;
  border-color: rgba(255,255,255,.16) !important;
}
.featureBox .hr{ border-color: rgba(255,255,255,.10) !important; }
.featureBox .kv span{ color: rgba(238,244,255,.70) !important; }
.featureBox .kv b{ color: rgba(238,244,255,.96) !important; }
.homeHero__shade{
  background: linear-gradient(90deg, rgba(7,12,26,.78), rgba(7,12,26,.28) 56%, rgba(7,12,26,.66)) !important;
}

.eventCards{
  max-width: 980px;
  margin: 0 auto;
}

.ralliesHeader{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.ralliesHeader h3{ margin:0; }
.ralliesHeader .hint{ margin:0; color: rgba(238,244,255,.68); font-size:12px; }


/* Language selector */

.brand__lang{ margin-top:6px; }
.langSelect{
  appearance:none;
  font-family: var(--sans);
  font-weight: 900;
  font-size: 11px;
  color: rgba(238,244,255,.92);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  padding: 6px 28px 6px 10px;
  cursor: pointer;
}
.langSelect:hover{ border-color: rgba(255,255,255,.22); }
.langSelect:focus{ outline:none; box-shadow: 0 0 0 4px rgba(255,106,42,.14); }
.langSelect{
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(238,244,255,.75) 50%),
    linear-gradient(135deg, rgba(238,244,255,.75) 50%, transparent 50%);
  background-position: calc(100% - 14px) 12px, calc(100% - 9px) 12px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* Make native <select> dropdown options readable in Chromium (white menu bg) */
.langSelect option{
  color: #0b1631;
  background: #ffffff;
}

/* ---- Custom language dropdown ---- */
.brand__lang{ display:flex; align-items:center; }
.langDD{ position:relative; }
.langBtn{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:9px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.03);
  color: rgba(238,244,255,.94);
  font-weight:900;
  cursor:pointer;
  min-width: 176px;
}
.langBtn:hover{ border-color: rgba(255,255,255,.22); }
.langBtn .label{ display:flex; align-items:center; gap:8px; }
.langBtn .caret{ opacity:.85; font-size:12px; }
.langMenu{
  position:absolute;
  top: calc(100% + 8px);
  left:0;
  min-width: 240px;
  max-height: 340px;
  overflow:auto;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(12,18,35,.96);
  box-shadow: 0 18px 60px rgba(0,0,0,.40);
  padding:6px;
  z-index: 220;
  display:none;
}
.langDD.open .langMenu{ display:block; }
.langItem{
  width:100%;
  border:none;
  background:transparent;
  color: rgba(238,244,255,.92);
  font-weight:850;
  text-align:left;
  padding:10px 10px;
  border-radius:10px;
  cursor:pointer;
}
.langItem:hover{ background: rgba(255,255,255,.06); }
.langItem.active{
  background: rgba(255,106,42,.14);
  border:1px solid rgba(255,106,42,.24);
}

.langSelect{ display:none !important; }


/* ---- V17 final overrides: Active events row ---- */
.eventCards{
  display:flex !important;
  gap:14px !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 2px 6px 0;
  overflow-x:auto;
  overflow-y:hidden;
  scroll-snap-type: x mandatory;
}
.eventCards::-webkit-scrollbar{ height: 10px; }
.eventCards::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.12);
  border-radius: 999px;
}
.eventCard{
  flex: 0 0 520px;
  width: 520px;
  scroll-snap-align: start;
}
@media (max-width: 900px){
  .eventCard{ flex: 0 0 100%; width: 100%; }
}


/* Top-right user badge (name + role pills) */
#userBadge{
  max-width: 520px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ub-name{
  font-weight: 800;
  color: rgba(255,255,255,.92);
  letter-spacing: .2px;
}

.ub-badges{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-left:10px;
}

.ub-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 8px;
  border-radius:999px;
  font-size:11px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.88);
}

.ub-pill--member{ border-color: rgba(255,255,255,.18); background: rgba(0,0,0,.20); }
.ub-pill--unverified{ border-color: rgba(255,190,120,.25); background: rgba(0,0,0,.18); }
.ub-pill--owner{ border-color: rgba(255,215,0,.25); background: rgba(0,0,0,.22); }
.ub-pill--staff{ border-color: rgba(140,200,255,.22); background: rgba(0,0,0,.20); }

.userchip{
  display:flex; align-items:center; gap:10px;
  padding:6px 10px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  border-radius: 999px;
}
.userchip__name{
  font-weight: 700;
  color: rgba(244,248,255,.92);
  font-size: 12.5px;
}
.badge{
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .4px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: rgba(244,248,255,.88);
}
.badge--guest{ opacity:.78; }
.badge--member{
  border-color: rgba(255,106,42,.45);
  background: rgba(255,106,42,.16);
  color: rgba(255,230,220,.96);
}
.badge--admin{
  border-color: rgba(93,195,255,.45);
  background: rgba(93,195,255,.14);
  color: rgba(220,245,255,.96);
}
.badge--owner{
  border-color: rgba(255,215,0,.55);
  background: rgba(255,215,0,.14);
  color: rgba(255,245,210,.98);
}

.userName{
  font-weight:800;
  color: rgba(244,248,255,.92);
  font-size: 12.5px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.14);
  border-radius: 999px;
}
.badge--member{
  border-color: rgba(255,106,42,.45) !important;
  background: rgba(255,106,42,.16) !important;
  color: rgba(255,230,220,.96) !important;
}
.badge--admin{
  border-color: rgba(93,195,255,.45) !important;
  background: rgba(93,195,255,.14) !important;
  color: rgba(220,245,255,.96) !important;
}
.badge--owner{
  border-color: rgba(255,215,0,.55) !important;
  background: rgba(255,215,0,.14) !important;
  color: rgba(255,245,210,.98) !important;
}

/* Animations & subtle UX */
.app.view--fade{ animation:viewFade .32s ease both; }
@keyframes viewFade{ from{opacity:.92; transform:translateY(4px);} to{opacity:1; transform:none;} }

.rowEnter{ opacity:0; transform:translateY(6px); animation:fadeUp .38s ease forwards; animation-delay:calc(var(--d,0) * 35ms); }
@keyframes fadeUp{ to{opacity:1; transform:none;} }

.eventCard.is-active{ position:relative; }
.eventCard.is-active:before{
  content:"";
  position:absolute; inset:-1px;
  border-radius:18px;
  padding:1px;
  background: conic-gradient(from 180deg, rgba(91,220,255,.0), rgba(91,220,255,.85), rgba(91,220,255,.0));
  -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;
  mask-composite:exclude;
  animation:neonSpin 6s linear infinite;
  pointer-events:none;
}
@keyframes neonSpin{ to{transform:rotate(360deg);} }

.iconBtn{
  margin-left:10px;
  width:36px; height:36px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(10,16,32,.35);
  color:#eaf2ff;
  display:inline-flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.iconBtn:hover{ border-color:rgba(255,255,255,.22); background:rgba(10,16,32,.55); }

.fieldRow{ display:flex; gap:18px; flex-wrap:wrap; }
.switch{ display:flex; align-items:center; gap:10px; font-weight:600; }
.switch input{ width:18px; height:18px; }

@media (prefers-reduced-motion: reduce){
  .app.view--fade{ animation:none; }
  .rowEnter{ animation:none; opacity:1; transform:none; }
  .eventCard.is-active:before{ animation:none; }
}
