/* =============================================================
   CREDIT TO DU BOIS — MOBILE STYLESHEET
   Edit variables in :root to retheme.
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700;800&display=swap');

:root {
  --bg:           #FFFEE7;
  --surface:      #ffffff;
  --surface2:     #f5f4d8;
  --border:       #dddcb8;
  --border-dark:  #b8b6a0;

  --header-bg:    #205D86;
  --header-text:  #ffffff;

  --blue:         #205D86;
  --red:          #AD281C;
  --muted:        #555544;
}

/* -----------------------------------------------------------
   RESET & BASE
   ----------------------------------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Manrope', sans-serif;
  background: var(--bg);
  color: #000;
}

/* -----------------------------------------------------------
   HEADER
   ----------------------------------------------------------- */
header {
  background: var(--header-bg);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.header-logo  { height: 32px; width: auto; flex-shrink: 0; }
.header-title { font-size: 16px; font-weight: 800; color: var(--header-text); flex: 1; }

/* Tab switcher */
.tabs {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.35);
  flex-shrink: 0;
}
.tab {
  background: transparent;
  color: rgba(255,255,255,0.6);
  border: none;
  padding: 6px 16px;
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab.active { background: rgba(255,255,255,0.2); color: #fff; }
.tab:first-child { border-right: 1px solid rgba(255,255,255,0.35); }

/* -----------------------------------------------------------
   ERROR BANNER
   ----------------------------------------------------------- */
.error-banner {
  display: none;
  background: #fff3cd;
  border-bottom: 2px solid var(--red);
  color: #7a4400;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  text-align: center;
  flex-shrink: 0;
}
.error-banner.visible { display: block; }

/* -----------------------------------------------------------
   PANELS
   ----------------------------------------------------------- */
.panels {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 54px); /* full height minus header */
}

.panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.panel.hidden { display: none; }

.panel-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.panel-scroll::-webkit-scrollbar { display: none; }

/* -----------------------------------------------------------
   EMPTY STATE
   ----------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  gap: 12px;
  color: var(--muted);
  text-align: center;
}
.empty-state .icon { font-size: 40px; opacity: 0.35; }
.empty-state p { font-size: 14px; }

/* -----------------------------------------------------------
   FIXTURES
   ----------------------------------------------------------- */
.round-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface2);
  border-bottom: 1px solid var(--border-dark);
  border-top: 2px solid var(--border);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 800;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 8px;
}
.round-header::before {
  content: '';
  width: 3px; height: 14px;
  background: var(--blue);
  border-radius: 2px;
  flex-shrink: 0;
}

.fixture-card {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.venue {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 10px;
}

/* Logo row */
.matchup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 12px;
}

.team-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  display: block;
}

.vs {
  font-size: 18px;
  font-weight: 800;
  color: var(--muted);
}

/* Full-width slider */
.slider-wrap {
  position: relative;
  height: 40px; /* tall touch target */
  display: flex;
  align-items: center;
  width: 100%;
}

.slider-track {
  position: absolute;
  left: 0; right: 0;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(to right, var(--blue) 0%, #FFFEE7 50%, var(--red) 100%);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.12);
}

/* Centre marker */
.slider-track::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 2px; height: 18px;
  background: rgba(0,0,0,0.2);
  border-radius: 1px;
}

input[type=range] {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 40px;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
  padding: 0; margin: 0;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  background: #fff;
  border-radius: 50%;
  border: 2px solid #444;
  box-shadow: 0 2px 6px rgba(0,0,0,0.28);
}
input[type=range]::-webkit-slider-runnable-track { background: transparent; }

/* -----------------------------------------------------------
   LADDER
   ----------------------------------------------------------- */
.ladder-table {
  width: 100%;
  border-collapse: collapse;
}

.ladder-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface2);
}

.ladder-table th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 9px 12px;
  text-align: left;
  border-bottom: 2px solid var(--border-dark);
}
.ladder-table th:not(:nth-child(2)) { text-align: center; }

.ladder-table tbody tr {
  border-bottom: 1px solid var(--border);
}
.ladder-table td { padding: 8px 12px; }

/* Separators */
.sep-row td      { padding: 0; height: 3px; border: none; }
.top6-sep td     { background: var(--blue); }
.mid-sep td      { background: var(--red); }

/* Rank */
.rank {
  font-size: 17px;
  font-weight: 800;
  text-align: center;
  color: var(--muted);
  width: 32px;
}
.rank.top6 { color: var(--blue); }
.rank.mid  { color: var(--red);  }

/* Team logo cell */
.ladder-team {
  display: flex;
  justify-content: center;
  align-items: center;
}
.ladder-team .team-logo {
  width: 34px;
  height: 34px;
}

/* Stats */
.stat {
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
}

.pts {
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  color: var(--muted);
}
.pts.top6 { color: var(--blue); }
.pts.mid  { color: var(--red);  }

.no-data-row td {
  text-align: center;
  padding: 40px;
  color: var(--muted);
  font-size: 14px;
}
