/* ============================================================
   PCL SCORECARD — STYLES
   Branding derived from procorporateleague.com
   (theme color #061a44, gold trophy accent)
   ============================================================ */

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

:root{
  --navy-deep:#04122e;
  --navy:#061a44;
  --navy-panel:#0b234f;
  --navy-panel-raised:#0f2b5c;
  --line:#1e3a6e;
  --cream:#f4f1e8;
  --cream-dim:#b9c3d8;
  --gold:#e6b94d;
  --gold-dim:#8a6f2c;
  --red:#c1442d;
  --sky:#7fa8d9;
}

*{box-sizing:border-box; margin:0; padding:0;}
html{scroll-behavior:smooth;}

body{
  background:
    radial-gradient(ellipse at 50% -10%, #10306b 0%, transparent 55%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 42px),
    var(--navy-deep);
  color:var(--cream);
  font-family:'Inter', sans-serif;
  min-height:100vh;
  padding-bottom:60px;
}

/* ================= HEADER ================= */
.site-header{
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg, var(--navy-panel-raised), transparent);
}
.site-header-inner{
  max-width:1100px;
  margin:0 auto;
  padding:16px 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
}
.brand-badge{
  width:38px; height:38px;
  border-radius:8px;
  background:linear-gradient(160deg, var(--gold), #b98f2f);
  display:flex; align-items:center; justify-content:center;
  font-family:'Teko', sans-serif;
  font-weight:700;
  font-size:20px;
  color:var(--navy-deep);
  box-shadow:0 0 16px rgba(230,185,77,.35);
}
.brand-text .name{
  font-family:'Teko', sans-serif;
  font-weight:600;
  font-size:22px;
  letter-spacing:.02em;
  color:var(--cream);
  line-height:1;
}
.brand-text .tag{
  font-family:'IBM Plex Mono', monospace;
  font-size:10px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--gold);
}

.tournament-picker{
  display:flex;
  align-items:center;
  gap:8px;
}
.tournament-picker label{
  font-family:'IBM Plex Mono', monospace;
  font-size:10px;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--cream-dim);
}
.tournament-picker select{
  background:var(--navy-panel);
  border:1px solid var(--line);
  color:var(--cream);
  font-family:'Inter', sans-serif;
  font-size:13px;
  padding:8px 12px;
  border-radius:6px;
  cursor:pointer;
}
.tournament-picker select:focus{outline:2px solid var(--gold); outline-offset:1px;}

/* ================= HERO / SCOREBOARD ================= */
.hero{
  padding:32px 20px 24px;
  max-width:1100px;
  margin:0 auto;
}
.hero-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  flex-wrap:wrap;
  gap:14px;
  border-bottom:1px dashed var(--line);
  padding-bottom:20px;
  margin-bottom:22px;
}
.eyebrow{
  font-family:'IBM Plex Mono', monospace;
  font-size:11px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--gold);
  display:flex;
  align-items:center;
  gap:8px;
}
.eyebrow::before{
  content:"";
  width:7px; height:7px;
  border-radius:50%;
  background:var(--gold);
  box-shadow:0 0 8px 2px rgba(230,185,77,.7);
  display:inline-block;
}
.eyebrow.live::before{ background:var(--red); box-shadow:0 0 8px 2px rgba(193,68,45,.7); animation:pulse 1.4s infinite; }
@keyframes pulse{0%,100%{opacity:1;}50%{opacity:.3;}}

h1.title{
  font-family:'Teko', sans-serif;
  font-weight:600;
  font-size:clamp(34px, 6vw, 56px);
  line-height:0.98;
  letter-spacing:.01em;
  color:var(--cream);
  text-transform:uppercase;
  margin-top:6px;
}
h1.title span{color:var(--gold);}

.meta-block{
  text-align:right;
  font-family:'IBM Plex Mono', monospace;
  font-size:12px;
  color:var(--sky);
  line-height:1.7;
}
.meta-block strong{color:var(--cream-dim); font-weight:500;}

.scoreboard{
  background:linear-gradient(180deg, var(--navy-panel-raised), var(--navy-panel));
  border:1px solid var(--line);
  border-radius:6px;
  padding:22px 18px;
  display:grid;
  grid-template-columns:repeat(5, 1fr);
  gap:0;
  position:relative;
  overflow:hidden;
}
.cell{
  text-align:center;
  padding:6px 8px;
  border-right:1px solid var(--line);
}
.cell:last-child{border-right:none;}
.digit{
  font-family:'Teko', sans-serif;
  font-weight:600;
  font-size:clamp(30px, 4.6vw, 48px);
  color:var(--gold);
  line-height:1;
  text-shadow:0 0 14px rgba(230,185,77,.5), 0 0 2px rgba(230,185,77,.9);
  letter-spacing:.02em;
  font-variant-numeric:tabular-nums;
}
.cell-label{
  font-family:'IBM Plex Mono', monospace;
  font-size:10px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--sky);
  margin-top:2px;
}

/* ================= STATE MESSAGES ================= */
.state-msg{
  max-width:1100px;
  margin:40px auto;
  padding:0 20px;
  text-align:center;
  font-family:'IBM Plex Mono', monospace;
  color:var(--cream-dim);
  font-size:13px;
}
.state-msg .spinner{
  width:26px; height:26px;
  border:3px solid var(--line);
  border-top-color:var(--gold);
  border-radius:50%;
  margin:0 auto 14px;
  animation:spin .8s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg);}}
.state-msg.error{color:var(--red);}
.state-msg.error .hint{color:var(--cream-dim); font-size:11px; margin-top:8px; display:block;}

/* ================= NAV TABS ================= */
.tabs{
  max-width:1100px;
  margin:30px auto 0;
  padding:0 20px;
  display:flex;
  gap:4px;
  flex-wrap:wrap;
  border-bottom:1px solid var(--line);
}
.tab-btn{
  font-family:'IBM Plex Mono', monospace;
  background:none;
  border:none;
  color:var(--sky);
  font-size:12px;
  letter-spacing:.08em;
  text-transform:uppercase;
  padding:12px 16px;
  cursor:pointer;
  position:relative;
  transition:color .2s ease;
}
.tab-btn .num{color:var(--gold-dim); margin-right:6px; transition:color .2s ease;}
.tab-btn:hover{color:var(--cream);}
.tab-btn.active{color:var(--gold);}
.tab-btn.active .num{color:var(--gold);}
.tab-btn.active::after{
  content:"";
  position:absolute; left:16px; right:16px; bottom:-1px;
  height:2px;
  background:var(--gold);
  box-shadow:0 0 6px rgba(230,185,77,.7);
}

/* ================= CONTENT ================= */
.content{
  max-width:1100px;
  margin:0 auto;
  padding:28px 20px 0;
}
.panel{display:none;}
.panel.active{display:block; animation:fadein .35s ease;}
@keyframes fadein{from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:translateY(0);}}

.section-head{
  display:flex;
  align-items:baseline;
  gap:12px;
  margin-bottom:16px;
}
.section-head h2{
  font-family:'Teko', sans-serif;
  font-weight:600;
  font-size:28px;
  text-transform:uppercase;
  color:var(--cream);
  letter-spacing:.01em;
}
.section-head .sub{
  font-family:'IBM Plex Mono', monospace;
  font-size:11px;
  color:var(--sky);
  letter-spacing:.05em;
}

table{
  width:100%;
  border-collapse:collapse;
  font-family:'IBM Plex Mono', monospace;
  font-size:13px;
}
thead th{
  text-align:left;
  font-size:10px;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--sky);
  font-weight:500;
  padding:0 12px 10px;
  border-bottom:1px solid var(--line);
}
thead th.num, tbody td.num{text-align:right;}
tbody tr{border-bottom:1px solid rgba(30,58,110,.5);}
tbody tr:nth-child(odd){background:rgba(255,255,255,0.015);}
tbody tr:hover{background:rgba(230,185,77,.06);}
tbody td{padding:10px 12px; color:var(--cream-dim);}
tbody td.rank{color:var(--gold); font-weight:600; width:34px;}
tbody td.name{color:var(--cream); font-family:'Inter',sans-serif; font-weight:600; font-size:13.5px;}
tbody td.team{color:var(--sky); font-family:'Inter',sans-serif; font-size:12.5px;}
tbody td.hl{color:var(--gold); font-weight:600;}

.table-wrap{
  overflow-x:auto;
  border:1px solid var(--line);
  border-radius:6px;
  background:var(--navy-panel);
  padding:8px 4px;
  margin-bottom:34px;
}
.empty-row{
  padding:20px;
  text-align:center;
  color:var(--cream-dim);
  font-family:'IBM Plex Mono', monospace;
  font-size:12px;
}

/* record cards */
.cards{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(260px,1fr));
  gap:14px;
  margin-bottom:36px;
}
.record-card{
  background:var(--navy-panel);
  border:1px solid var(--line);
  border-radius:6px;
  padding:16px 18px;
}
.record-card .badge{
  font-family:'IBM Plex Mono', monospace;
  font-size:10px;
  letter-spacing:.1em;
  color:var(--navy-deep);
  background:var(--gold);
  display:inline-block;
  padding:2px 8px;
  border-radius:3px;
  margin-bottom:10px;
  font-weight:600;
}
.record-card .matchup{
  font-family:'Inter', sans-serif;
  font-weight:700;
  font-size:15px;
  color:var(--cream);
  margin-bottom:4px;
}
.record-card .matchup .win{color:var(--gold);}
.record-card .score-line{
  font-family:'Teko', sans-serif;
  font-size:28px;
  font-weight:600;
  color:var(--cream);
  letter-spacing:.02em;
  margin:6px 0 2px;
}
.record-card .score-line .vs{color:var(--sky); font-size:18px; margin:0 6px;}
.record-card .meta{
  font-family:'IBM Plex Mono', monospace;
  font-size:11px;
  color:var(--sky);
  display:flex;
  justify-content:space-between;
  margin-top:8px;
  border-top:1px dashed var(--line);
  padding-top:8px;
}
.record-card .meta .margin{color:var(--red); font-weight:600;}

footer{
  max-width:1100px;
  margin:30px auto 0;
  padding:16px 20px 0;
  border-top:1px solid var(--line);
  font-family:'IBM Plex Mono', monospace;
  font-size:11px;
  color:var(--sky);
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:8px;
}

@media (max-width:640px){
  .scoreboard{grid-template-columns:repeat(2,1fr);}
  .cell:nth-child(2n){border-right:none;}
  .cell{border-bottom:1px solid var(--line); padding:14px 8px;}
  .meta-block{text-align:left;}
  .hero-top{flex-direction:column;}
  .site-header-inner{flex-direction:column; align-items:flex-start;}
}

/* ================= PLAYER CARDS (Top Batters / Bowlers / All-Rounders) ================= */
.player-section-head{
  display:flex; align-items:flex-end; justify-content:space-between;
  flex-wrap:wrap; gap:10px;
}
.showing-count{
  font-family:'IBM Plex Mono', monospace;
  font-size:11px; letter-spacing:.06em;
  color:var(--sky);
}
.player-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(230px, 1fr));
  gap:18px;
  margin-bottom:36px;
}
.player-card{
  position:relative;
  background:#ffffff;
  border:1px solid #e3e7ee;
  border-radius:16px;
  padding:16px 16px 18px;
  box-shadow:0 10px 24px rgba(10,20,40,.10);
  overflow:hidden;
}
.player-card.tier-1{ border-color:#0f1f3d; box-shadow:0 14px 30px rgba(15,31,61,.16); }
.player-card.tier-2{ border-color:#9aa4b2; }
.player-card.tier-3{ border-color:#d98a3d; }

.rank-ribbon{
  display:inline-block;
  font-family:'Inter', sans-serif;
  font-weight:800; font-size:13px;
  color:#fff;
  padding:6px 18px 6px 12px;
  border-radius:0 999px 999px 0;
  margin:0 0 12px -16px;
}
.player-card.tier-1 .rank-ribbon{ background:linear-gradient(90deg, #0f1f3d, #1c3a73); }
.player-card.tier-2 .rank-ribbon{ background:linear-gradient(90deg, #9aa4b2, #6c7686); }
.player-card.tier-3 .rank-ribbon{ background:linear-gradient(90deg, #e08a3c, #c96a1f); }

.rank-pill-inline{
  display:inline-flex;
  font-family:'IBM Plex Mono', monospace;
  font-size:11px; font-weight:700;
  color:#5b6472;
  background:#eef0f4;
  padding:4px 10px;
  border-radius:999px;
  margin-bottom:10px;
}

.player-name{
  font-family:'Inter', sans-serif;
  font-weight:800; font-size:17px;
  color:#0f1f3d;
  margin-bottom:8px;
}
.player-badges{
  display:flex; flex-wrap:wrap; gap:6px;
  margin-bottom:14px;
}
.hof-badge, .role-chip{
  font-family:'Inter', sans-serif;
  font-size:9.5px; font-weight:700;
  letter-spacing:.03em; text-transform:uppercase;
  padding:5px 9px;
  border-radius:999px;
}
.hof-badge{ background:#fbe9c6; color:#8a5a11; }
.role-chip{ background:#fdeecb; color:#a86a12; border:1px solid #f0d9a3; }

.player-team-logo{
  width:52px; height:52px;
  margin:0 auto 10px;
  border-radius:50%;
  background:#fff;
  border:1.5px solid #e3e0d2;
  display:flex; align-items:center; justify-content:center;
  font-family:'Inter', sans-serif;
  font-weight:800; font-size:13px;
  color:#5b6472;
  box-shadow:0 2px 8px rgba(10,20,40,.08);
}
.player-photo-wrap{
  position:relative;
  width:104px; height:104px;
  margin:0 auto 20px;
  border-radius:50%;
  border:3px solid #e9b74d;
  padding:4px;
  display:flex; align-items:center; justify-content:center;
  background:#f4f1e8;
}
.player-card.tier-2 .player-photo-wrap{ border-color:#aab2bf; }
.player-card.tier-3 .player-photo-wrap{ border-color:#df8a3c; }
.player-card.tier-plain .player-photo-wrap{ border-color:#1c2b4f; }
.player-silhouette{
  width:78%; height:78%;
  fill:#0f1f3d;
  opacity:.85;
}
.player-rank-chip{
  position:absolute;
  bottom:-11px; left:50%; transform:translateX(-50%);
  white-space:nowrap;
  font-family:'Inter', sans-serif;
  font-size:10px; font-weight:800;
  color:#fff;
  background:#0f1f3d;
  padding:5px 12px;
  border-radius:999px;
  box-shadow:0 3px 8px rgba(10,20,40,.25);
}

.player-stat-row{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:6px;
  margin-top:22px;
  text-align:center;
}
.player-stat-value{
  font-family:'Inter', sans-serif;
  font-weight:800; font-size:17px;
  color:#0f1f3d;
}
.player-stat-label{
  font-family:'Inter', sans-serif;
  font-size:9.5px; font-weight:700;
  letter-spacing:.06em; text-transform:uppercase;
  color:#8892a3;
  margin-top:2px;
}
.player-ai-line{
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid #eef0f4;
  display:flex; flex-wrap:wrap; gap:8px;
  font-family:'IBM Plex Mono', monospace;
  font-size:10.5px;
  color:#5b6472;
}
.player-ai-line b{ color:#0f1f3d; }

/* ================= AI TEAM RANKINGS (team-tier cards, matches reference) ================= */
.team-tier-podium{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(240px, 1fr));
  gap:20px;
  align-items:end;
  margin-bottom:24px;
}
.team-tier-card{
  position:relative;
  background:#fff;
  border-radius:18px;
  border:1px solid #e3e7ee;
  overflow:hidden;
  box-shadow:0 12px 26px rgba(10,20,40,.12);
}
.team-tier-card.lead{
  border-color:#e0b559;
  box-shadow:0 18px 36px rgba(224,181,89,.28);
  transform:translateY(-8px);
}
.tt-banner{
  position:relative;
  height:130px;
  display:flex; align-items:center; justify-content:center;
}
.team-tier-card.tier-1 .tt-banner{ background:linear-gradient(160deg, #f1cf7d, #b8860b); }
.team-tier-card.tier-2 .tt-banner{ background:linear-gradient(160deg, #d7dee6, #8a97a8); }
.team-tier-card.tier-3 .tt-banner{ background:linear-gradient(160deg, #d99a55, #8a5a26); }
.tt-rank-pill{
  position:absolute; top:12px; left:12px;
  font-family:'Inter', sans-serif;
  font-size:11px; font-weight:800;
  background:rgba(255,255,255,.9);
  color:#0f1f3d;
  padding:5px 11px;
  border-radius:999px;
}
.tt-pts-pill{
  position:absolute; top:12px; right:12px;
  font-family:'Inter', sans-serif;
  font-size:11px; font-weight:800;
  background:#0f1f3d;
  color:#fff;
  padding:5px 11px;
  border-radius:999px;
}
.tt-logo{
  width:74px; height:74px;
  border-radius:50%;
  background:#fff;
  display:flex; align-items:center; justify-content:center;
  font-family:'Inter', sans-serif;
  font-weight:800; font-size:16px;
  color:#0f1f3d;
  box-shadow:0 6px 16px rgba(10,20,40,.25);
}
.tt-body{ padding:16px 18px 20px; text-align:center; }
.tt-name{
  font-family:'Inter', sans-serif;
  font-weight:800; font-size:19px;
  color:#0f1f3d;
}
.tt-tier-label{
  font-family:'Inter', sans-serif;
  font-size:10px; font-weight:700;
  letter-spacing:.08em; text-transform:uppercase;
  margin-top:4px;
}
.team-tier-card.tier-1 .tt-tier-label{ color:#a67c1d; }
.team-tier-card.tier-2 .tt-tier-label{ color:#6c7686; }
.team-tier-card.tier-3 .tt-tier-label{ color:#a3611f; }
.tt-stat-row{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:8px;
  margin-top:16px;
}
.tt-stat{
  background:#eef2fb;
  border-radius:10px;
  padding:10px 6px;
}
.tt-stat-value{
  font-family:'Inter', sans-serif;
  font-weight:800; font-size:16px;
  color:#1c3a73;
}
.tt-stat-label{
  font-family:'Inter', sans-serif;
  font-size:9px; font-weight:700;
  letter-spacing:.05em; text-transform:uppercase;
  color:#7c8698;
  margin-top:2px;
}

.team-tier-list{
  display:flex; flex-direction:column; gap:10px;
  margin-bottom:36px;
}
.team-tier-mini{
  display:flex; align-items:center; gap:14px;
  background:#fff;
  border:1px solid #e3e7ee;
  border-radius:12px;
  padding:12px 16px;
}
.ttm-rank{
  font-family:'Inter', sans-serif;
  font-weight:800; font-size:13px;
  color:#8892a3;
  width:32px; flex:none;
}
.ttm-logo{
  width:38px; height:38px; flex:none;
  border-radius:50%;
  background:#f4f1e8;
  border:1px solid #e3e0d2;
  display:flex; align-items:center; justify-content:center;
  font-family:'Inter', sans-serif;
  font-weight:800; font-size:11px;
  color:#5b6472;
}
.ttm-info{ flex:1; min-width:0; }
.ttm-name{
  font-family:'Inter', sans-serif;
  font-weight:700; font-size:13.5px;
  color:#0f1f3d;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.ttm-sub{
  font-family:'IBM Plex Mono', monospace;
  font-size:10px;
  color:#8892a3;
  margin-top:2px;
}
.ttm-pts{
  flex:none;
  font-family:'Inter', sans-serif;
  font-weight:800; font-size:12px;
  color:#fff;
  background:#0f1f3d;
  padding:6px 12px;
  border-radius:999px;
}

/* Light backdrop so the white player/team cards read cleanly against the panel */
#batters, #bowlers, #allrounders, #ai-rankings{
  background:#f4f1e8;
  margin:0 -20px;
  padding:28px 20px 8px;
  border-radius:14px;
}
#batters .section-head h2, #bowlers .section-head h2, #allrounders .section-head h2, #ai-rankings .section-head h2{
  color:#0f1f3d;
}
#batters .section-head .sub, #bowlers .section-head .sub, #allrounders .section-head .sub, #ai-rankings .section-head .sub{
  color:#5b6472;
}
#batters .showing-count, #bowlers .showing-count, #allrounders .showing-count{
  color:#7c8698;
}

@media (max-width:640px){
  .player-grid{ grid-template-columns:repeat(auto-fill, minmax(160px,1fr)); gap:12px; }
  .team-tier-podium{ grid-template-columns:1fr; }
  .team-tier-card.lead{ transform:none; }
}
