/* =========================================
   BSCDA Fantasy – Global Styles (styles.css)
   Theme: Black + Fluorescent Green + White
   Pages: pick team, my team, transfers, league, login, admin

   Key mobile fix included:
   - DO NOT force the login "Show/Hide" password buttons full-width on mobile
   - Fixes stray brace + cleans up banner CSS nesting ========================================= */

/* -----------------------------
   Core colour system
----------------------------- */
:root{
  --bg: #060606;
  --card: #0d0d0d;
  --text: #ffffff;
  --muted: #a3a3a3;
  --line: rgba(255,255,255,0.12);

  /* Fluorescent green accents */
  --accent: #a2cf37;
  --good: #8fdb2c;

  --warn: #ffb020;
  --bad:  #ff3b3b;

  /* heights (used for padding offsets) */
  --topbar-h: 56px;
  --statusbar-h: 72px;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }

/* ✅ Prevent mobile scroll lock issues */ html, body{
  height: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body{
  margin:0;
  font-family: Arial, sans-serif;
  background:
    radial-gradient(900px 500px at 15% 0%,rgba(0,255,102,0.12), transparent 60%),
    radial-gradient(700px 400px at 85% 20%,rgba(0,255,102,0.10), transparent 55%),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* -----------------------------
   Layout / type
----------------------------- */
.wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px;
}

/* ✅ Pick Team only needs padding for topbar + fixed statusbar */ body.pick .wrap{
  padding-top: calc(var(--topbar-h) + var(--statusbar-h) + env(safe-area-inset-top, 0px) + 14px); }

/* ✅ Other pages do not have the statusbar */ body.league .wrap, body.login .wrap, body.transfers .wrap, body.admin .wrap, body.myteam .wrap{
  padding-top: 14px;
}

h1{
  margin: 6px 0 8px;
  font-size: 22px;
  color: var(--accent);
}
h2{
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--accent);
}
h3{
  margin: 18px 0 10px;
  font-size: 16px;
  color: var(--accent);
}
p{ margin:0; }

.row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

.split{
  display:grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 12px;
  align-items:start;
}

.small{ font-size: 12px; }
.right{ text-align:right; }

.muted{ color: var(--muted); }
.warnText{ color: #ffe1a6; }
.badText{ color: #ffd0d0; }

/* Accessibility focus */
:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* -----------------------------
   Top brand + nav (sticky)
----------------------------- */
.topbar{
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(6,6,6,0.92);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);

  transform: translateZ(0);
  -webkit-transform: translateZ(0);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.topbarInner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 14px;
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 190px;
}

.logo{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  object-fit: contain;
  background: transparent;
  box-shadow: 0 0 18px rgba(0,255,102,0.18);
  flex: 0 0 auto;
}

.brandText{
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1.1;
}

.brandText small{
  display:block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.nav{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
}

.nav a{
  color: var(--text);
  text-decoration:none;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  font-size: 14px;
  white-space: nowrap;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease, background 0.15s ease; }

.nav a:hover{
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 16px rgba(0,255,102,0.22); }

.nav a.active{
  border-color: var(--accent);
  background: rgba(0,255,102,0.15);
  color: var(--accent);
  font-weight: 800;
  box-shadow: 0 0 18px rgba(0,255,102,0.25); }

/* -----------------------------
   Sticky status bar (Pick Team)
   ✅ Fixed so it never vanishes on mobile
----------------------------- */
.statusbar{
  position: fixed;
  left: 0;
  right: 0;
  top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  z-index: 900;

  border-bottom: 1px solid var(--line);
  background: rgba(6,6,6,0.98);

  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform;

  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important; }

.statusInner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 14px;
  display:flex;
  flex-direction: column;
  gap: 8px;
}

.statusRow{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  justify-content:space-between;
}

.statusLeft{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}

/* Pills */
.pill{
  display:inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.pill.good{
  color: var(--accent);
  border-color: rgba(0,255,102,0.60);
  background: rgba(0,255,102,0.12);
  font-weight: 800;
}

.pill.warn{
  color: #ffe1a6;
  border-color: rgba(255,176,32,0.45);
  background: rgba(255,176,32,0.10);
  font-weight: 800;
}

.pill.bad{
  color: #ffd0d0;
  border-color: rgba(255,59,59,0.55);
  background: rgba(255,59,59,0.10);
  font-weight: 800;
}

/* Stat boxes */
.stat{
  display:flex;
  gap:8px;
  align-items:baseline;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  white-space: nowrap;
}

.stat b{
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat span{
  font-size: 14px;
  color: var(--text);
  font-weight: 900;
}

/* Jump bar */
.jumpWrap{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap: nowrap;
  width: 100%;
}

.jumpLabel{
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.jumpBar{
  display:flex;
  gap:8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
  flex: 1 1 auto;
}
.jumpBar::-webkit-scrollbar{ display:none; }

.jumpBtn{
  border: 1px solid rgba(0,255,102,0.35);
  background: rgba(0,255,102,0.10);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  flex: 0 0 auto;
}

.jumpBtn:hover{
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 14px rgba(0,255,102,0.25); }

/* Optional per-grade accents */
.jumpBtn.Superstar{ border-color: rgba(255,122,122,0.35); background: rgba(255,122,122,0.10); }
.jumpBtn.Red{       border-color: rgba(255,179,179,0.35); background: rgba(255,179,179,0.08); }
.jumpBtn.Blue{      border-color: rgba(147,197,253,0.35); background: rgba(147,197,253,0.08); }
.jumpBtn.Yellow{    border-color: rgba(253,230,138,0.35); background: rgba(253,230,138,0.08); }
.jumpBtn.White{     border-color: rgba(229,231,235,0.22); background: rgba(229,231,235,0.06); }

/* Anchors so headings don't hide under bars */ .gradeSection{ scroll-margin-top: 150px; }

/* -----------------------------
   Cards / panels
----------------------------- */
.card{
  border: 1px solid var(--line);
  background: rgba(13,13,13,0.85);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  overflow:hidden;
  margin: 12px 0;
}

.divider{
  height: 1px;
  background: var(--line);
  margin: 12px 0;
}

/* Inputs */
label{
  display:block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input, select, textarea{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 14px;
}

input::placeholder, textarea::placeholder{
  color: rgba(255,255,255,0.35);
}

input:focus, select:focus, textarea:focus{
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(0,255,102,0.20); }

/* -----------------------------
   Buttons (neon)
----------------------------- */
button{
  cursor:pointer;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: #000;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 0 16px rgba(0,255,102,0.35);
  transition: box-shadow 0.15s ease, transform 0.05s ease, opacity 0.15s ease; }

button:hover{ box-shadow: 0 0 28px rgba(0,255,102,0.65); } button:active{ transform: translateY(1px); }

button:disabled{
  cursor:not-allowed;
  background: #222;
  border-color: #333;
  color: #666;
  box-shadow: none;
  opacity: 0.8;
}

.btnSecondary{
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  box-shadow: none;
  text-transform: none;
  letter-spacing: 0;
}

.btnSecondary:hover{
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(0,255,102,0.20); }

/* -----------------------------
   Driver cards
----------------------------- */
.driver{
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  padding: 12px;
  margin: 10px 0;
}

.driver.selected{
  border-color: rgba(0,255,102,0.55);
  background: rgba(0,255,102,0.08);
}

.driverTop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

/* Grade label colours */
.grade{ font-weight: 900; }
.grade.Superstar{ color: #ff7a7a; }
.grade.Red{ color: #ffb3b3; }
.grade.Blue{ color: #93c5fd; }
.grade.Yellow{ color: #fde68a; }
.grade.White{ color: #e5e7eb; }

/* -----------------------------
   How to play (collapsible)
----------------------------- */
.helpToggle{
  width:100%;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  padding: 12px 12px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 900;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: none;
}

.helpToggle:hover{
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(0,255,102,0.20); }

.helpChevron{ transition: transform .15s ease; }

.helpBody{
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.helpGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.helpH{
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--accent);
}

.helpList{
  margin:0;
  padding-left: 18px;
  color: var(--muted);
}
.helpList b{ color: var(--text); }
.helpList li{ margin: 6px 0; }

.helpTip{
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0,255,102,0.25);
  background: rgba(0,255,102,0.08);
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
}

/* -----------------------------
   Success banner (global)
----------------------------- */
.successBanner{
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  z-index: 9999;
  display: none;
  pointer-events: none;
  background: var(--accent);
  color: #000;
}

/* banner variants */
.successBanner.success { background: var(--accent); color:#000; }
.successBanner.error   { background: #ff3b3b;      color:#fff; }
.successBanner.info    { background: #ffb020;      color:#000; }

@keyframes slideDown{
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* -----------------------------
   League – table layout
   Desktop: no sideways scroll
   Mobile: stacked rows (no sideways scroll)
----------------------------- */
.leagueTableWrap{
  max-width: 100%;
  overflow: visible;
}

.leagueTable{
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* Cells */
.leagueTable th,
.leagueTable td{
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

/* Header */
.leagueTable th{
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  white-space: nowrap;
}

/* Column widths (desktop) */
.leagueTable th:nth-child(1),
.leagueTable td:nth-child(1){ width: 56px; } /* Pos */

.leagueTable th:nth-child(5),
.leagueTable td:nth-child(5){ width: 90px; } /* Points */

.leagueTable th:nth-child(4),
.leagueTable td:nth-child(4){ width: 150px; } /* Grade */

.leagueTable th:nth-child(3),
.leagueTable td:nth-child(3){ width: 170px; } /* Player */

.leagueTable th:nth-child(2),
.leagueTable td:nth-child(2){
  width: auto;
  min-width: 0;
}

/* Team cell tidy layout */
.teamCell{
  display:flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.teamNameRow{
  display:flex;
  align-items:center;
  gap: 6px;
  min-width: 0;
}

.teamName{
  display:block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

/* Player column truncate on desktop */
.leagueTable td:nth-child(3){
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hover */
.leagueTable tr:hover td{
  background: rgba(255,255,255,0.03);
}

/* Badge (league) */
.badge{
  display:inline-flex;
  gap: 6px;
  align-items:center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}
.badge small{ color: var(--muted); font-weight: 700; letter-spacing: 0.02em; }

.badge.superstar{ border-color: rgba(255,93,93,0.35);  color:#ffd0d0; }
.badge.red{       border-color: rgba(255,176,32,0.35); color:#ffe1a6; }
.badge.blue{      border-color: rgba(93,214,255,0.45); color:#ccefff; }
.badge.yellow{    border-color: rgba(253,230,138,0.35);color:#fde68a; }
.badge.white{     border-color: rgba(255,255,255,0.18);color:#e5e7eb; }

.novice{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
}

/* ================================
   Highlight YOUR team in league
================================ */
.myRow td {
  background: rgba(162, 207, 55, 0.15);
  border-bottom-color: rgba(162, 207, 55, 0.4); } .myRow .teamName { color: var(--accent); }

/* ==================================================
   Back to top button (desktop + mobile safe) ================================================== */ .backToTop{
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  padding: 10px 14px;
  font-size: 14px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #000;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  display: none;
  z-index: 9999;
  width: auto;                 /* critical for mobile */
  touch-action: manipulation;  /* iOS tap reliability */ }

.backToTop:hover{ opacity: 0.9; }
.backToTop.show{ display: block; }

/* -----------------------------
   Password toggle (login page)
   ✅ IMPORTANT: prevent mobile "button{width:100%}" from stretching it
----------------------------- */
.pwWrap{
  display:flex;
  gap: 8px;
  align-items: center;
}
.pwWrap input{ flex: 1; }

/* if you keep the login-page inline styles, this still helps override width behaviour */ .pwWrap .pwToggle{
  width: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}

/* -----------------------------
   Responsive
----------------------------- */
@media (max-width: 900px){
  .helpGrid{ grid-template-columns: 1fr; }
  .split{ grid-template-columns: 1fr; }
}

@media (max-width: 700px){
  .topbarInner{ gap:8px; }
  .brand{ min-width: 0; }
  .brandText{ font-size: 14px; }
  .brandText small{ font-size: 11px; }
  .nav a{ font-size: 13px; padding: 7px 9px; }

  /* iOS blur + sticky issues */
  .topbar{
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(6,6,6,0.98) !important;
  }

  .statusInner{ gap: 6px; padding: 6px 12px; }

  .stat{ padding: 4px 8px; border-radius: 10px; }
  .stat b{ display:none; }
  .pill{ padding: 3px 8px; font-size: 11px; }

  .jumpLabel{ font-size: 10px; }
  .jumpBtn{ padding: 4px 8px; font-size: 11px; }

  .gradeSection{ scroll-margin-top: 140px; }

  /* Default: stack buttons full width on mobile... */
  button{ width:100%; }
  .row{ flex-direction: column; align-items: stretch; }
  #quickHint{ display:none; }

  /* ✅ ...BUT NOT the password "Show/Hide" buttons */
  .pwWrap .pwToggle{
    width: auto !important;
    flex: 0 0 auto !important;
  }
}

/* Mobile: convert league rows into stacked cards */ @media (max-width: 820px){
  .leagueTableWrap{ overflow: visible; }

  .leagueTable thead{ display:none; }

  .leagueTable,
  .leagueTable tbody,
  .leagueTable tr{
    display:block;
    width:100%;
  }

  .leagueTable tr{
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.03);
    border-radius: 14px;
    padding: 10px;
    margin: 10px 0;
  }

  .leagueTable td{
    display:grid;
    grid-template-columns: 90px 1fr;
    gap: 8px;
    padding: 6px 0;
    border: 0;
  }

  .leagueTable td:nth-child(1)::before{ content:"Pos";     color:var(--muted); font-weight: 800; }
  .leagueTable td:nth-child(2)::before{ content:"Team";    color:var(--muted); font-weight: 800; }
  .leagueTable td:nth-child(3)::before{ content:"Player";  color:var(--muted); font-weight: 800; }
  .leagueTable td:nth-child(4)::before{ content:"Grade";   color:var(--muted); font-weight: 800; }
  .leagueTable td:nth-child(5)::before{ content:"Points";  color:var(--muted); font-weight: 800; }

  .teamName{
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  .leagueTable td:nth-child(3){
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  .leagueTable td:nth-child(5){
    font-weight: 900;
  }
}

/* Extra-small phones: make Show/Hide even tighter */ @media (max-width: 480px){
  .pwWrap{ gap: 6px; }
  .pwWrap .pwToggle{
    padding: 6px 8px !important;
    font-size: 11px !important;
    border-radius: 8px !important;
    width: auto !important;
  }
}


