/* ===========================================================
   PULSE — Fantasy analytics design system
   Palette: floodlit navy base, dual heat scales that carry
   real meaning (amber/red = attacking threat, cyan/indigo =
   defensive danger). Everything data-driven wears these colors.
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@600;700;800;900&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root{
  --bg:        #0A0F1C;
  --bg-raise:  #0F1729;
  --surface:   #131D33;
  --surface-2: #1A2540;
  --border:    #26324F;
  --border-lo: #1B2740;
  --text:      #E9EEF9;
  --subtext:   #8C9AB8;
  --hint:      #5C6A88;
  --topbar-bg: rgba(10,15,28,0.88);

  /* Attack heat: threat rises → amber to red */
  --atk-0: #16233F;
  --atk-1: #4A3A2A;
  --atk-2: #B0552B;
  --atk-3: #E8622E;
  --atk-4: #FF4433;

  /* Defense-risk heat: goals conceded rises → cyan to indigo/violet */
  --def-0: #16233F;
  --def-1: #17415A;
  --def-2: #1C6E8C;
  --def-3: #3E5FD9;
  --def-4: #7A3FE0;

  --accent: #FF6A3D;
  --accent-2: #3FC1E0;
  --good: #35C97A;

  --radius: 10px;
  --font-display: 'Big Shoulders Display', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

html[data-theme="light"]{
  --bg:        #F4F5F8;
  --bg-raise:  #FFFFFF;
  --surface:   #FFFFFF;
  --surface-2: #EEF1F6;
  --border:    #DCE1EA;
  --border-lo: #E7EAF0;
  --text:      #14171F;
  --subtext:   #55607A;
  --hint:      #8792A8;
  --topbar-bg: rgba(255,255,255,0.88);
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a{ color: inherit; text-decoration: none; }

/* ---------- Layout shell ---------- */
.wrap{ max-width: 1180px; margin: 0 auto; padding: 0 24px; }

header.topbar{
  position: sticky; top: 0; z-index: 40;
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-lo);
}
.topbar .wrap{
  display:grid; grid-template-columns: 1fr auto 1fr; align-items:center;
  column-gap: 20px; height: 64px;
}

.brand{ display:flex; align-items:center; font-family: var(--font-display); font-weight:800; font-size: 24px; letter-spacing: 0.01em; justify-self:start; }
.brand-fantasy{ color: var(--text); }
.brand-90{
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

nav.mainnav{ display:flex; gap: 4px; justify-self:center; }
nav.mainnav a{
  padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--subtext); transition: all .15s ease; white-space:nowrap;
}
nav.mainnav a:hover{ color: var(--text); background: var(--surface-2); }
nav.mainnav a.active{ color: var(--bg); background: var(--text); }

.topbar-right{ display:flex; align-items:center; gap: 14px; justify-self:end; }

.theme-toggle{
  display:flex; align-items:center; gap:2px;
  border:1px solid var(--border); border-radius:999px; padding:3px;
  background: var(--surface-2);
}
.theme-toggle button{
  display:flex; align-items:center; justify-content:center;
  width:28px; height:28px; border-radius:999px; border:none; background:transparent;
  color: var(--hint); cursor:pointer; transition: all .15s ease;
}
.theme-toggle button:hover{ color: var(--text); }
.theme-toggle button.active-theme-btn{ background: var(--text); color: var(--bg); }
.theme-toggle-divider{ width:1px; height:16px; background: var(--border); }

footer{
  border-top: 1px solid var(--border-lo);
  margin-top: 80px;
  padding: 28px 0 60px;
  color: var(--hint);
  font-size: 13px;
}
.footer-blurb{ margin: 0 0 16px; }
.footer-bottom{
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px;
  padding-top:16px; border-top:1px solid var(--border-lo);
}
.footer-links{ display:flex; gap:20px; flex-wrap:wrap; }
.footer-links a{ color: var(--subtext); }
.footer-links a:hover{ color: var(--text); }
.footer-copy{ color: var(--hint); }

/* ---------- Type ---------- */
h1,h2,h3{ font-family: var(--font-display); font-weight: 800; letter-spacing: 0.01em; margin: 0; }
.eyebrow{
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-2); margin: 0 0 10px;
}
.lede{ color: var(--subtext); font-size: 17px; max-width: 640px; }
.mono{ font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- Hero ---------- */
.hero{ padding: 64px 0 40px; }
.hero h1{ font-size: clamp(40px, 6vw, 68px); line-height: 1.02; }
.hero .accent{ color: var(--accent); }

/* ---------- Cards / grid ---------- */
.card{
  background: var(--surface); border: 1px solid var(--border-lo); border-radius: var(--radius);
  padding: 20px;
}
.grid{ display:grid; gap: 16px; }
.grid-3{ grid-template-columns: repeat(3, 1fr); }
.grid-2{ grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px){ .grid-3, .grid-2{ grid-template-columns: 1fr; } }

/* ---------- Stat pills ---------- */
.stat-row{ display:flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
.stat{
  background: var(--surface); border: 1px solid var(--border-lo); border-radius: var(--radius);
  padding: 16px 20px; min-width: 160px;
}
.stat .num{ font-family: var(--font-display); font-size: 34px; font-weight: 800; }
.stat .lbl{ color: var(--subtext); font-size: 13px; margin-top: 2px; }

/* ---------- Team cards (Predictions page) ---------- */
.team-card{
  background: var(--surface); border: 1px solid var(--border-lo); border-radius: var(--radius);
  padding: 16px 18px; cursor: pointer; transition: border-color .15s ease, transform .15s ease;
}
.team-card:hover{ border-color: var(--accent-2); transform: translateY(-1px); }
.team-card .tname{ font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.team-card .trow{ display:flex; justify-content: space-between; align-items:baseline; margin-bottom: 8px; }
.team-card .tavg{ font-family: var(--font-mono); color: var(--subtext); font-size: 13px; }

.heatstrip{ display:flex; gap: 2px; margin-top: 6px; }
.heatstrip .cell{ flex:1; height: 22px; border-radius: 2px; }

.legend{ display:flex; align-items:center; gap: 8px; font-size: 12px; color: var(--subtext); }
.legend .swatch{ width: 14px; height: 14px; border-radius: 3px; }
.legend .ramp{ display:flex; width: 70px; height: 10px; border-radius: 3px; overflow:hidden; }
.legend .ramp span{ flex:1; }

/* ---------- Detail table (Excel-style grid) ---------- */
.detail{ margin-top: 18px; }

.xl-wrap{
  background: #ffffff;
  border-radius: 10px;
  overflow: auto;
  border: 1px solid #dcdcdc;
  max-width: 100%;
}
table.xl-table tbody tr.clickable-row{ cursor: pointer; }
table.xl-table tbody tr.clickable-row:hover td.label{ text-decoration: underline; }
table.xl-table{
  width:100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.xl-table thead th{
  background: #ffffff;
  color: #1a1a1a;
  text-align:left;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 12px 16px;
  border-bottom: 3px solid #1a1a1a;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
table.xl-table thead th:hover{ background: #f4f5f7; }
table.xl-table thead th.heat{ text-align:center; }
table.xl-table thead th .arrow{ opacity: 0.25; font-size: 10px; margin-left: 5px; }
table.xl-table thead th.sorted .arrow{ opacity: 1; color: var(--accent); }
table.xl-table tbody td{
  padding: 10px 16px;
  border-bottom: 1px solid #ececec;
  color: #1a1a1a;
  font-family: var(--font-mono);
}
table.xl-table thead th:first-child{ position: sticky; left: 0; z-index: 3; }
table.xl-table tbody td.label{
  font-family: var(--font-body);
  font-weight: 700;
  background: #ffffff;
  position: sticky;
  left: 0;
  z-index: 1;
}
table.xl-table tbody td.meta{ color: #4a4a4a; }
table.xl-table tbody tr:nth-child(even) td.label,
table.xl-table tbody tr:nth-child(even) td.meta{ background: #f4f5f7; }
table.xl-table tbody td.heat{
  text-align: center;
  font-weight: 700;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #ffffff;
}
table.xl-table tbody tr:hover td.label,
table.xl-table tbody tr:hover td.meta{ background: #eaf2ff; }

.venue-h{ color: #1C7A3B; font-weight:600; font-size:12px;}
.venue-a{ color: #6D6D72; font-weight:600; font-size:12px;}

/* ---------- Buttons / inputs ---------- */
.btn{
  display:inline-flex; align-items:center; gap:8px; padding: 10px 18px; border-radius: 999px;
  background: var(--accent); color: #100600; font-weight: 700; font-size: 14px; border: none; cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover{ transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,106,61,0.28); }
.btn.ghost{ background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover{ border-color: var(--accent-2); box-shadow:none; }

select, input[type=text], input[type=number], input[type=password]{
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 9px 12px; font-family: var(--font-body); font-size: 14px;
}

/* Chrome/Safari force a white background on autofilled inputs — override it so
   password fields (often autofilled by browsers/password managers) match email fields */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus{
  -webkit-box-shadow: 0 0 0px 1000px var(--surface-2) inset;
  -webkit-text-fill-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}

.search-row{ display:flex; gap: 10px; flex-wrap: wrap; align-items:center; margin: 22px 0; }

/* ---------- Empty / upload states ---------- */
.dropzone{
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  padding: 48px 24px; text-align:center; color: var(--subtext); background: var(--bg-raise);
  transition: border-color .15s ease, background .15s ease;
}
.dropzone.drag{ border-color: var(--accent-2); background: var(--surface-2); }
.dropzone .icon{ font-size: 32px; margin-bottom: 10px; }

.pill{
  display:inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight:700;
  letter-spacing: .04em; text-transform: uppercase;
}
.pill.soon{ background: var(--surface-2); color: var(--accent-2); border: 1px solid var(--border); }
.pill.live{ background: rgba(53,201,122,0.14); color: var(--good); border: 1px solid rgba(53,201,122,0.3); }

.roadmap-step{ display:flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border-lo); }
.roadmap-step .n{ font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--hint); width: 40px; flex-shrink:0; }
.roadmap-step:last-child{ border-bottom:none; }

.section{ padding: 40px 0; }
.section h2{ font-size: 28px; margin-bottom: 6px; }
.section .sub{ color: var(--subtext); margin-bottom: 22px; }

/* modal-ish inline panel */
.panel-close{ float:right; background:none; border:none; color:var(--subtext); font-size:20px; cursor:pointer; }
.panel-close:hover{ color: var(--text); }

/* ---------- Auth nav + forms ---------- */
.auth-nav{ display:flex; align-items:center; gap:10px; }
.auth-email{ font-size:13px; color:var(--subtext); font-family: var(--font-mono); }
.btn.small{ padding:6px 14px; font-size:13px; }

.auth-shell{ max-width: 420px; margin: 72px auto; }
.auth-tabs{ display:flex; gap:6px; margin-bottom:20px; }
.auth-tabs button{
  flex:1; padding:10px; border-radius:999px; border:1px solid var(--border);
  background: var(--surface); color: var(--subtext); font-weight:600; font-size:14px; cursor:pointer;
}
.auth-tabs button.active{ background: var(--text); color: var(--bg); border-color: var(--text); }
.auth-form label{ display:block; font-size:13px; color: var(--subtext); margin: 14px 0 6px; }
.auth-form input{ width:100%; }
.auth-form button[type=submit]{ width:100%; margin-top:20px; justify-content:center; }
.auth-msg{ margin-top:14px; font-size:13px; color: var(--subtext); min-height: 18px; }
.auth-msg.error{ color: var(--accent); }
.auth-msg.success{ color: var(--good); }
