/* Live Football — kid-friendly, matches the football game's green pitch palette. */
:root {
  --brand: #14532D;
  --brand-2: #2E9E4F;
  --accent: #F59E0B;
  --green: #22A04F;
  --gold: #FFD700;
  --danger: #E04A54;
  --bg: #eaf7ef;
  --card: #ffffff;
  --ink: #143226;
  --radius: 22px;
  --shadow: 0 6px 18px rgba(20, 83, 45, 0.16);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  min-height: 100%;
}
.grad-bg { background: linear-gradient(160deg, #d7f0e0 0%, #eaf7ef 45%, #fdf6e3 100%); }
a { color: inherit; text-decoration: none; }
.app { max-width: 640px; margin: 0 auto; min-height: 100vh; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 14px; }

.home-topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 2px 0; }
.back-link { font-weight: 800; color: var(--brand-2); font-size: 16px; white-space: nowrap; }
/* cross-game launcher pills (Football ⚽ / Explorer 🌍 / Hub 🏠) */
.topbar-links, .home-topbar-links { display: flex; align-items: center; gap: 8px; }
.hub-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 40px; padding: 6px 12px; border-radius: 999px; background: #fff;
  color: var(--brand); font-weight: 800; font-size: 14px; box-shadow: var(--shadow);
  border: 2px solid var(--brand-2); white-space: nowrap;
}
.hub-btn:active { transform: scale(0.95); }
.mascot { font-size: 64px; text-align: center; line-height: 1; filter: drop-shadow(0 6px 8px rgba(0,0,0,0.12)); }
.home-title { font-size: clamp(26px, 6vw, 40px); font-weight: 800; text-align: center; color: var(--brand); letter-spacing: -0.5px; margin: 20px 0 2px; }
.home-sub { color: var(--brand-2); text-align: center; margin: 0 0 10px; font-size: 16px; font-weight: 600; }

/* ---- quick-launch banner (Match Day Picker) ---- */
.cta-banner {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: linear-gradient(135deg, #14532D, #2E9E4F); color: #fff;
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin: 4px 0 14px;
}
.cta-banner:active { transform: scale(0.98); }
.cta-emoji { font-size: 34px; line-height: 1; }
.cta-text { flex: 1; min-width: 0; }
.cta-text strong { display: block; font-size: 17px; }
.cta-text small { display: block; font-size: 12px; opacity: .9; font-weight: 600; }
.cta-arrow { font-size: 28px; }

/* ---- league cards (hub page) ---- */
.league-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.league-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 12px; text-align: center; min-height: 160px; justify-content: center;
  transition: transform .12s ease; border-bottom: 4px solid var(--brand-2);
  opacity: 0; animation: pop .4s ease forwards;
}
.league-card:active { transform: scale(0.97); }
.league-badge {
  width: 88px; height: 88px; border-radius: 20px; display: flex; align-items: center; justify-content: center;
  background: var(--lbg, #14532D); box-shadow: inset 0 0 0 3px rgba(255,255,255,.28), var(--shadow); overflow: hidden;
}
.league-logo { width: 100%; height: 100%; object-fit: contain; }
.league-name { font-weight: 800; font-size: 17px; color: var(--brand); }
.league-country { font-size: 13px; color: var(--brand-2); font-weight: 600; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- league detail header ---- */
.league-header { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.league-header-logo { width: 64px; height: 64px; object-fit: contain; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 3px rgba(0,0,0,.06); padding: 6px; }
.league-header-text { min-width: 0; }
.league-header-name { margin: 0; font-size: 22px; font-weight: 800; color: var(--brand); }
.league-header-sub { margin: 4px 0 0; color: var(--brand-2); font-weight: 600; font-size: 14px; }

/* ---- tabs ---- */
.tabbar { display: flex; gap: 8px; }
.tab {
  flex: 1; min-height: 48px; border: none; border-radius: 14px; background: #fff; box-shadow: var(--shadow);
  font: inherit; font-weight: 800; font-size: 16px; color: var(--brand-2); cursor: pointer; transition: all .15s;
}
.tab.on { background: var(--brand-2); color: #fff; }

/* ---- panels ---- */
.panel { display: none; }
.panel.on { display: block; }
.panel-loading { min-height: 40px; display: flex; justify-content: center; }
.note { color: var(--brand-2); font-weight: 600; text-align: center; margin: 20px 0; }

/* ---- standings table ---- */
.table-scroll { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; }
table.standings { width: 100%; border-collapse: collapse; font-size: 14px; }
.standings th { text-align: center; padding: 10px 6px; color: var(--brand-2); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; font-weight: 800; border-bottom: 2px solid #e0f0e6; }
.standings th.l, .standings td.l { text-align: left; }
.standings td { text-align: center; padding: 9px 6px; border-bottom: 1px solid #eef6f0; font-weight: 600; }
.standings td.pos { color: var(--brand-2); font-weight: 800; }
.standings td.tm { text-align: left; display: flex; align-items: center; gap: 8px; min-width: 150px; }
.standings td.gd { color: var(--brand); }
.standings td.pts { font-weight: 800; color: var(--brand); font-size: 15px; }
.tname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.team-crest { width: 24px; height: 24px; border-radius: 50%; background: #f0f0f0; display: inline-block; }
.team-crest--empty { display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--brand-2); font-weight: 800; }
tr.zone.top1 td:first-child { color: var(--green); font-weight: 900; }
tr.zone.top3 td:first-child { color: var(--brand-2); font-weight: 800; }
tr.zone.bottom td.pos { color: var(--danger); }
.legend { text-align: center; color: var(--brand-2); font-weight: 600; font-size: 12px; margin: 12px 0 0; }

/* ---- calendar ---- */
.cal-title { color: var(--brand); font-size: 16px; font-weight: 800; margin: 18px 0 8px; }
.cal-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.match {
  display: grid; grid-template-columns: 36px 1fr auto 1fr; align-items: center; gap: 8px;
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 12px; font-size: 14px;
}
.match .md { color: var(--brand-2); font-weight: 700; font-size: 11px; }
.match .mt { font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match .mt { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-start; }
.match .mt:last-child { justify-content: flex-start; }
.match-crest { width: 22px; height: 22px; border-radius: 50%; background: #f0f0f0; flex: 0 0 auto; }
.match .mscore { font-weight: 800; color: var(--brand); background: #eaf7ef; padding: 4px 8px; border-radius: 8px; min-width: 56px; text-align: center; font-size: 13px; }
.match .score--fixture { color: var(--brand-2); background: #f4f4f4; font-weight: 600; font-size: 11px; }

.footnote { text-align: center; color: var(--brand-2); opacity: .75; font-size: 11px; margin-top: 16px; }

/* ---- top scorers leaderboard ---- */
.scorer-head, .scorer {
  display: grid; grid-template-columns: 34px 1fr minmax(120px, 190px) 44px;
  align-items: center; gap: 10px;
}
.scorer-head {
  padding: 8px 12px; color: var(--brand-2); font-size: 11px; text-transform: uppercase;
  font-weight: 800; letter-spacing: .5px;
}
.scorer-head .r { text-align: right; }
.scorer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.scorer {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 12px; font-size: 14px;
}
.scorer .rank { color: var(--brand-2); font-weight: 800; font-size: 15px; }
.scorer .player { font-weight: 800; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scorer .team { display: inline-flex; align-items: center; gap: 7px; color: var(--brand-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scorer .team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scorer .goals { text-align: right; font-weight: 800; color: var(--brand); font-size: 16px; }
.scorer-crest { width: 22px; height: 22px; border-radius: 50%; background: #f0f0f0; flex: 0 0 auto; }
.scorer-crest--empty { display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--brand-2); font-weight: 800; }
.scorer { border-left: 4px solid transparent; }
.scorer.medal-gold { border-left-color: var(--gold); }
.scorer.medal-silver { border-left-color: #C0C0C0; }
.scorer.medal-bronze { border-left-color: #CD7F32; }
.note-sm { text-align: center; color: var(--brand-2); opacity: .75; font-size: 11px; margin: 12px 0 0; }

/* ---- Match Day Picker ---- */
.block { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px; margin-top: 16px; }
.block-head { margin-bottom: 12px; }
.block-title { margin: 0; font-size: 18px; font-weight: 800; color: var(--brand); }
.block-sub { display: block; color: var(--brand-2); font-weight: 600; font-size: 13px; margin-top: 2px; }

.scorecard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.scorecell { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 10px; text-align: center; }
.scorenum { display: block; font-size: 26px; font-weight: 900; color: var(--brand); }
.scorelbl { display: block; font-size: 12px; color: var(--brand-2); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }

.league-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 2px solid var(--brand-2); background: #fff; color: var(--brand-2); font: inherit; font-weight: 800; font-size: 13px; padding: 8px 12px; border-radius: 999px; cursor: pointer; }
.chip.on { background: var(--brand-2); color: #fff; }
.chip:active { transform: scale(0.96); }

.team-chooser { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.tchip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); border: 2px solid transparent; font: inherit; font-weight: 700; font-size: 13px; color: var(--ink); cursor: pointer; text-align: left; }
.tchip .tchip-logo { width: 26px; height: 26px; border-radius: 50%; background: #f0f0f0; flex: 0 0 auto; }
.tchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tchip.on { border-color: var(--brand-2); background: #eaf7ef; }
.tchip:active { transform: scale(0.97); }

#matchdayList { display: flex; flex-direction: column; gap: 10px; }
.pick-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; }
.pick-card--none { display: flex; align-items: center; gap: 10px; opacity: .8; }
.pick-card--none .pick-info strong { color: var(--brand); display: block; }
.pick-none { color: var(--brand-2); font-weight: 600; font-size: 12px; }
.pick-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--brand-2); font-weight: 700; font-size: 12px; margin-bottom: 8px; }
.your-team-pill { background: var(--brand); color: #fff; font-weight: 800; font-size: 11px; padding: 3px 10px; border-radius: 999px; letter-spacing: .3px; white-space: nowrap; }
.pick-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.pick-team { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 800; color: var(--ink); font-size: 14px; text-align: center; }
.pick-team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pick-team.mine { color: var(--brand); border: 3px solid var(--brand-2); border-radius: 12px; padding: 8px 6px; background: #eaf7ef; box-shadow: 0 0 0 3px rgba(46,158,79,.18); }
.pick-team.opp { color: var(--brand-2); opacity: .72; font-weight: 700; }
.pick-team-logo { width: 44px; height: 44px; border-radius: 50%; background: #f0f0f0; }
.pick-vs { color: var(--brand-2); font-weight: 800; font-size: 13px; }
.pick-question { margin-top: 12px; text-align: center; font-weight: 800; color: var(--brand); font-size: 15px; }
.tricky { margin-top: 10px; text-align: center; background: #fff6e5; color: #b45309; font-weight: 800; font-size: 13px; padding: 6px 8px; border-radius: 10px; border: 1px dashed #e9a23b; }
.wdl-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.wdl { min-height: 46px; border: 2px solid var(--brand-2); background: #fff; color: var(--brand-2); font: inherit; font-weight: 800; font-size: 15px; border-radius: 12px; cursor: pointer; }
.wdl[data-pick="WIN"].on { background: var(--green); border-color: var(--green); color: #fff; }
.wdl[data-pick="DRAW"].on { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.wdl[data-pick="LOSE"].on { background: var(--danger); border-color: var(--danger); color: #fff; }
.wdl:active { transform: scale(0.96); }
.pick-outcome { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding: 10px 12px; border-radius: 12px; font-weight: 800; }
.pick-outcome.good { background: #eaf7ef; color: var(--green); }
.pick-outcome.bad { background: #fdecee; color: var(--danger); }
.pick-actual { text-align: center; color: var(--brand-2); font-weight: 600; font-size: 12px; margin-top: 6px; }
.outcome-pts { font-size: 18px; }

.badge-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.badge { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 12px; text-align: center; opacity: .35; }
.badge.earned { opacity: 1; border: 2px solid var(--gold); }
.badge-icon { font-size: 30px; }
.badge-name { font-weight: 800; font-size: 12px; color: var(--brand); margin-top: 4px; }
.badge-desc { font-size: 10px; color: var(--brand-2); margin-top: 2px; }

/* ---- last results strip ---- */
.results-list { display: flex; flex-direction: column; gap: 8px; }
.result-row {
  display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 8px;
  background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 8px 12px; font-size: 13px;
  border-left: 4px solid transparent;
}
.result-row.good { border-left-color: var(--green); }
.result-row.bad { border-left-color: var(--danger); }
.result-row .r-team { font-weight: 800; color: var(--brand); }
.result-row .r-vs { color: var(--brand-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-row .r-pick { color: var(--brand-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-row .r-pts { font-weight: 800; color: var(--brand); font-size: 15px; }
.result-row.good .r-pts { color: var(--green); }
.result-row.bad .r-pts { color: var(--danger); }

@media (min-width: 600px) {
  .league-grid { grid-template-columns: repeat(3, 1fr); }
  table.standings { font-size: 15px; }
  .tname { max-width: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}
