/* ============================================================
   Eurohockey Watch — Liiga team pages (/teams and /teams/<team>)
   Index: grid of team tiles (mini rank wheel + forecast chips).
   Team page: blue hero, the 12-stat rank wheel, rank profile, table.
   Data: assets/data/team_cards_<seasonEnd>.json (built daily by
   scripts/build_team_cards.py), forecast chips parsed from the
   homepage standings table so there is one source of truth.
   ============================================================ */

:root{
  --rank-best:#2F6BFF;
  --rank-mid:#1B2A78;
  --rank-worst:#B3243A;
  --accent:#6FA0FF;
}

.wrap-wide{max-width:1180px;margin:0 auto;padding:0 24px}

/* ---------- shared bits ---------- */
.eyebrow{
  font-family:var(--font-ui);
  font-size:12.5px;font-weight:700;letter-spacing:0.16em;text-transform:uppercase;
  color:var(--blue-muted);
}
.tp-updated{
  font-size:13px;color:var(--blue-muted);margin-top:10px;
}
.tp-updated strong{color:var(--blue);font-weight:700}
.tp-loading,.tp-error{
  font-size:14px;color:var(--blue-muted);padding:48px 0;text-align:center;
}
.tp-error a{text-decoration:underline;text-underline-offset:3px}

.chip{
  display:inline-flex;align-items:center;gap:6px;
  font-family:var(--font-body);font-size:11.5px;font-weight:700;letter-spacing:0.02em;
  padding:4px 9px;border-radius:5px;
  background:rgba(2,31,148,0.08);color:var(--blue);
  white-space:nowrap;line-height:1.3;
}
.chip .k{font-weight:600;opacity:0.7}
.chip.rank{color:#fff}
.chip.on-blue{background:rgba(245,242,243,0.14);color:var(--white)}
.chip.on-blue .k{opacity:0.75}

/* ---------- /teams index ---------- */
.teams-hero{padding:104px 0 8px}
.teams-hero .sectiontitle{margin-top:10px}
.teams-toolbar{
  display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;
  margin-top:28px;padding-bottom:14px;
  border-bottom:1px solid rgba(2,31,148,0.16);
}
.season-switch{display:inline-flex;gap:6px}
.season-switch button{
  font-family:var(--font-ui);font-size:12px;font-weight:700;letter-spacing:0.08em;text-transform:uppercase;
  padding:9px 16px;border-radius:999px;border:1px solid rgba(2,31,148,0.22);
  background:none;color:var(--blue-muted);cursor:pointer;
  transition:background .15s ease,color .15s ease,border-color .15s ease;
}
.season-switch button:hover{border-color:var(--blue);color:var(--blue)}
.season-switch button.active{background:var(--blue);color:var(--white);border-color:var(--blue)}
.sort-select{
  display:inline-flex;align-items:center;gap:10px;
  font-family:var(--font-ui);font-size:12px;font-weight:700;letter-spacing:0.08em;text-transform:uppercase;
  color:var(--blue-muted);
}
.sort-select select{
  font-family:var(--font-body);font-size:13px;font-weight:600;color:var(--blue);
  padding:8px 12px;border:1px solid rgba(2,31,148,0.22);border-radius:6px;background:#fff;
}

.teams-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:14px;
  margin-top:22px;
}
.team-tile{
  display:flex;align-items:center;gap:14px;
  padding:14px 16px 14px 14px;
  border:1px solid rgba(2,31,148,0.14);border-radius:10px;
  background:rgba(255,255,255,0.55);
  transition:border-color .15s ease,background .15s ease,transform .15s ease;
  min-width:0;
}
.team-tile:hover{border-color:var(--blue);background:#fff;transform:translateY(-1px)}
.team-tile .mini-wheel{width:84px;height:84px;flex-shrink:0}
.team-tile .mini-wheel svg{width:100%;height:100%;display:block}
.team-tile-body{min-width:0;display:flex;flex-direction:column;gap:7px}
.team-tile-name{
  font-family:var(--font-display);font-size:22px;letter-spacing:0.01em;line-height:1;
  color:var(--blue);text-transform:uppercase;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.team-tile-sub{font-size:12px;color:var(--blue-muted);font-weight:600;margin-top:-3px}
.team-tile-chips{display:flex;flex-wrap:wrap;gap:5px}

.teams-note{
  font-size:12.5px;color:var(--blue-muted);line-height:1.6;max-width:760px;margin-top:28px;
}

/* ---------- /teams/<team> page ---------- */
.team-hero{
  background:var(--blue);color:var(--white);
  padding:112px 0 40px;
}
.team-hero .wrap-wide{display:flex;align-items:flex-end;justify-content:space-between;gap:32px;flex-wrap:wrap}
.team-hero-left{display:flex;align-items:center;gap:26px;min-width:0}
.team-hero-logo{
  width:112px;height:112px;border-radius:50%;background:var(--white);flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
}
.team-hero-logo img{width:72%;height:72%;object-fit:contain;display:block}
.team-hero-name{
  font-family:var(--font-display);font-size:clamp(44px,7vw,92px);line-height:0.95;
  text-transform:uppercase;letter-spacing:0.01em;color:var(--white);
}
.team-hero-season{font-size:15px;font-weight:500;color:var(--white-muted);margin-top:8px}
.team-hero-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:14px}
.team-hero-right{text-align:right;flex-shrink:0}
.team-hero-ord{font-family:var(--font-display);font-size:clamp(56px,7vw,84px);line-height:1;color:var(--white)}
.team-hero-ordlab{font-size:13px;font-weight:600;color:var(--white-muted);letter-spacing:0.04em;text-transform:uppercase}

.team-crumbs{
  display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;
  padding:18px 0;border-bottom:1px solid rgba(2,31,148,0.14);
}
.team-crumbs a,.team-crumbs span{
  font-family:var(--font-ui);font-size:12px;font-weight:700;letter-spacing:0.08em;text-transform:uppercase;
  color:var(--blue-muted);
}
.team-crumbs a:hover{color:var(--blue)}
.team-crumbs .crumb-nav{display:flex;gap:18px}

.team-section{padding:36px 0 8px}
.team-section h2{
  font-family:var(--font-display);font-style:italic;font-weight:400;
  font-size:clamp(24px,3.4vw,32px);letter-spacing:0.01em;line-height:1.1;color:var(--blue);
}
.team-section .lede{margin-top:8px;font-size:13.5px}

.team-cols{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:28px;margin-top:22px;align-items:start}

/* The card: same look as the social carousel slide, brand blue tile */
.team-card{
  background:var(--blue);color:var(--white);border-radius:14px;
  padding:26px 26px 20px;
}
.team-card-head{display:flex;align-items:baseline;justify-content:space-between;gap:16px}
.team-card-title{font-family:var(--font-display);font-size:28px;text-transform:uppercase;letter-spacing:0.01em;line-height:1}
.team-card-sub{font-size:12.5px;color:var(--white-muted);margin-top:4px}
.team-card-ord{font-family:var(--font-display);font-size:40px;line-height:1}
.team-card-ordlab{font-size:11px;font-weight:600;color:var(--white-muted);text-align:right;letter-spacing:0.04em;text-transform:uppercase}
.wheel{width:100%;margin-top:10px}
.wheel svg{width:100%;height:auto;display:block}
.wheel .w-rank{font-family:var(--font-display);font-size:48px}
.wheel .w-lab{font-family:var(--font-body);font-size:15px;font-weight:700;letter-spacing:0.5px;text-transform:uppercase}
.wheel .w-grp{font-family:var(--font-body);font-size:17px;font-weight:700;letter-spacing:2px;text-transform:uppercase;fill:var(--accent)}
.wheel path.petal{transition:opacity .15s ease}
.wheel:hover path.petal{opacity:0.82}
.wheel path.petal:hover{opacity:1}
.legend{margin:8px auto 0;width:min(380px,100%);text-align:center}
.legend-bar{height:8px;border-radius:8px;background:linear-gradient(90deg,var(--rank-best),var(--rank-mid),var(--rank-worst))}
.legend-labels{display:flex;justify-content:space-between;font-size:12px;color:var(--white-muted);margin-top:6px}
.team-card-foot{font-size:11.5px;color:var(--white-muted);line-height:1.5;margin-top:16px}

/* Rank profile: four groups of three rank chips (hockeystats-style components) */
.profile{display:flex;flex-direction:column;gap:14px}
.profile-group{
  border:1px solid rgba(2,31,148,0.14);border-radius:10px;padding:14px 16px;background:rgba(255,255,255,0.55);
}
.profile-group h3{
  font-family:var(--font-ui);font-size:11.5px;font-weight:700;letter-spacing:0.14em;text-transform:uppercase;
  color:var(--blue-muted);margin-bottom:10px;
}
.profile-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.profile-stat{
  border-radius:8px;padding:10px 10px 9px;color:#fff;
  display:flex;flex-direction:column;gap:2px;min-width:0;
}
.profile-stat .ord{font-family:var(--font-display);font-size:26px;line-height:1}
.profile-stat .lab{font-size:11px;font-weight:700;letter-spacing:0.04em;text-transform:uppercase;opacity:0.92;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.profile-stat .val{font-size:12px;font-weight:600;opacity:0.85}
.profile-stat.navy{color:var(--blue)}

/* Statistics table */
.stats-table{width:100%;border-collapse:collapse;margin-top:18px;font-family:var(--font-body)}
.stats-table th{
  text-align:left;font-size:12px;font-weight:700;letter-spacing:0.08em;text-transform:uppercase;
  color:var(--blue-muted);padding:0 10px 10px;border-bottom:1px solid rgba(2,31,148,0.22);white-space:nowrap;
}
.stats-table td{padding:11px 10px;font-size:14.5px;border-top:1px solid rgba(2,31,148,0.09);vertical-align:middle}
.stats-table th.num,.stats-table td.num{text-align:right;font-variant-numeric:tabular-nums}
.stats-table tr.grp td{
  padding:16px 10px 6px;border-top:none;
  font-family:var(--font-ui);font-size:11.5px;font-weight:700;letter-spacing:0.14em;text-transform:uppercase;color:var(--blue-muted);
}
.stats-table td.stat{font-weight:700;color:var(--blue)}
.stats-table td.stat small{display:block;font-weight:400;font-size:12px;color:var(--blue-muted);margin-top:2px}
.stats-table .rank-pill{
  display:inline-block;min-width:44px;text-align:center;color:#fff;font-weight:700;font-size:13px;
  padding:3px 8px;border-radius:6px;
}
.stats-table .rank-pill.navy{color:var(--blue)}
.stats-table td.best{color:var(--blue-muted);font-size:13px}
.stats-table td.best img{width:16px;height:16px;object-fit:contain;vertical-align:-3px;margin-right:5px}

.team-foot{
  font-size:12.5px;color:var(--blue-muted);line-height:1.6;max-width:820px;margin-top:28px;
}
.team-pager{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  margin-top:36px;padding-top:18px;border-top:1px solid rgba(2,31,148,0.14);
}
.team-pager a{
  display:inline-flex;align-items:center;gap:10px;
  font-family:var(--font-ui);font-size:12.5px;font-weight:700;letter-spacing:0.08em;text-transform:uppercase;color:var(--blue-muted);
}
.team-pager a:hover{color:var(--blue)}
.team-pager a img{width:22px;height:22px;object-fit:contain}

@media (max-width:900px){
  .team-cols{grid-template-columns:1fr}
}
@media (max-width:640px){
  .teams-hero{padding:92px 0 4px}
  .teams-grid{grid-template-columns:1fr 1fr;gap:10px}
  .team-tile{flex-direction:column;align-items:flex-start;gap:10px;padding:12px}
  .team-tile .mini-wheel{width:64px;height:64px}
  .team-tile-name{font-size:19px}
  .team-hero{padding:92px 0 30px}
  .team-hero-left{gap:16px}
  .team-hero-logo{width:72px;height:72px}
  .team-hero-right{text-align:left}
  .team-card{padding:18px 14px 14px;border-radius:10px}
  .team-card-title{font-size:22px}
  .team-card-ord{font-size:32px}
  .profile-stat .ord{font-size:22px}
  .profile-stat .lab{font-size:10px}
  .stats-table th,.stats-table td{padding-left:6px;padding-right:6px}
  .stats-table td{font-size:13.5px}
  .stats-table td.best{display:none}
  .stats-table th.best{display:none}
  .stats-table td.stat small{display:none}
  .stats-table th .full{display:none}
  .profile-stat .lab{white-space:normal;line-height:1.2}
}
.stats-table th .short{display:none}
@media (max-width:640px){ .stats-table th .short{display:inline} }

/* Error / not-found on the team page: the hero shell is hidden, so clear the fixed nav. */
#team-root .tp-error,#team-root > .tp-loading{padding-top:140px;padding-bottom:80px}
