:root {
  /* Chalkboard palette */
  --bg: #15332a;
  --bg-2: rgba(255, 255, 255, 0.045);
  --panel: rgba(255, 255, 255, 0.035);
  --panel-2: rgba(255, 255, 255, 0.07);
  --line: rgba(242, 245, 238, 0.5);
  --text: #f2f5ee;
  --muted: #a9c2b4;
  --accent: #9be6a6;      /* green chalk */
  --accent-2: #9ec9ff;    /* blue chalk */
  --fav: #ffe08a;         /* yellow chalk */
  --fav-dim: rgba(255, 224, 138, 0.14);
  --banger: #ff9ec4;      /* pink chalk */
  --ko: #c9b6ff;          /* lilac chalk */
  --radius: 13px;
  --shadow: 0 0 0 rgba(0, 0, 0, 0);
  --chalk-font: "Patrick Hand", -apple-system, system-ui, sans-serif;
  --script-font: "Caveat", cursive;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; color-scheme: dark; }

body {
  margin: 0;
  font-family: var(--chalk-font);
  font-size: 16px;
  background:
    radial-gradient(1200px 700px at 70% -10%, #1c4537, transparent 60%),
    radial-gradient(900px 600px at 0% 100%, #123026, transparent 55%),
    #15332a fixed;
  color: var(--text);
  line-height: 1.45;
}
/* chalk dust + vignette */
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: .05; background-image: radial-gradient(#fff .7px, transparent .7px); background-size: 5px 5px; }
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  box-shadow: inset 0 0 220px rgba(0, 0, 0, .45); }
main, .site-header, .main-nav { position: relative; z-index: 1; }
.drawn { filter: url(#rough); }

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 20px 60px;
}

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(100deg, #0ca678 0%, #1971c2 55%, #6741d9 100%);
  border-bottom: 1px solid var(--line);
  color: #fff;
}
.site-header .subtitle { color: rgba(255, 255, 255, 0.82); }
.site-header .header-stats .stat b { color: #fff; }
.site-header .header-stats .stat span { color: rgba(255, 255, 255, 0.75); }
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.title-block h1 { margin: 0; font-size: 30px; letter-spacing: -0.5px; }
.trophy { filter: drop-shadow(0 2px 6px rgba(240, 140, 0, 0.5)); }
.subtitle { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.header-stats { display: flex; gap: 18px; }
.header-stats .stat { text-align: center; }
.header-stats .stat b { display: block; font-size: 26px; color: var(--accent); line-height: 1.1; }
.header-stats .stat span { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }

/* ---------- Big section headings ---------- */
.section-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.6px;
  margin: 10px 2px 18px;
  line-height: 1.15;
}
.section-title .st-sub {
  display: block;
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  margin-top: 4px;
}

/* ---------- Upcoming bangers (compact strip) ---------- */
.upcoming { margin-bottom: 22px; }
.upcoming[hidden] { display: none; }
.upcoming-head { font-size: 13px; font-weight: 700; color: var(--banger); margin: 0 2px 9px; letter-spacing: .3px; }
.upcoming-row { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: thin; }
.upcoming-row::-webkit-scrollbar { height: 5px; } .upcoming-row::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.ub-card {
  flex: 0 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 12px;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(232,89,12,.16);
}
.ub-card:hover { border-color: var(--banger); }
.ub-card.fav { border-color: rgba(240,140,0,.55); }
.ub-date { font-size: 11px; font-weight: 700; color: var(--accent-2); white-space: nowrap; }
.ub-teams { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.ub-teams img { width: 21px; height: 15px; border-radius: 2px; object-fit: cover; box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.ub-teams .vs { color: var(--muted); font-size: 10px; font-weight: 600; }
.ub-meta { font-size: 10.5px; color: var(--muted); margin-top: 4px; white-space: nowrap; }

/* ---------- Intro card (dismissible) ---------- */
.intro-card {
  position: relative;
  background: linear-gradient(100deg, rgba(12,166,120,.08), rgba(25,113,194,.08));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 22px;
}
.intro-card[hidden] { display: none; }
.intro-card h2 { margin: 0 0 10px; font-size: 17px; }
.intro-list { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 8px; }
.intro-list li { font-size: 13.5px; color: var(--muted); line-height: 1.5; padding-left: 2px; }
.intro-list li b { color: var(--text); font-weight: 600; }
.intro-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; font-size: 22px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 8px;
}
.intro-close:hover { color: var(--text); background: rgba(0,0,0,.04); }

/* ---------- Panels ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.panel-head h2 { margin: 0; font-size: 18px; }
.hint { margin: 0 0 12px; color: var(--muted); font-size: 13px; }

/* ---------- Picker controls ---------- */
.picker-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#team-search {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  min-width: 180px;
}
#team-search:focus { outline: none; border-color: var(--accent-2); }
.ghost-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
}
.ghost-btn:hover { color: var(--text); border-color: var(--muted); }

.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--accent); width: 15px; height: 15px; }

/* ---------- Chips ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  max-height: 132px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.chips.expanded { max-height: 1400px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-2);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px 6px 7px;
  font-size: 13.5px;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.chip:hover { transform: translateY(-1px); border-color: var(--accent-2); }
.chip img { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.chip .elo { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chip.selected {
  background: var(--fav-dim);
  border-color: var(--fav);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(240,140,0,.22);
}
.chip.selected::after { content: "★"; color: var(--fav); font-size: 12px; }
.chip.hidden { display: none; }

.expand-btn {
  margin-top: 12px;
  background: transparent;
  border: none;
  color: var(--accent-2);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 0;
}
.expand-btn:hover { text-decoration: underline; }

/* ---------- Controls bar ---------- */
.controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 0 4px;
}
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }
.swatch-fav { background: var(--fav); }
.swatch-banger { background: var(--banger); }
.swatch-ko { background: var(--ko); }
.view-toggles { display: flex; gap: 18px; }

/* ---------- Calendar ---------- */
.month { margin-bottom: 30px; }
.month-title {
  font-size: 20px;
  margin: 0 0 12px;
  padding-left: 4px;
  letter-spacing: -0.3px;
}
.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.weekdays span {
  text-align: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}
.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.day {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  min-height: 116px;
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.day.empty { background: transparent; border: none; }
.day.outside { opacity: 0.4; }
.day.has-fav { border-color: rgba(240, 140, 0, 0.55); box-shadow: inset 0 0 0 1px rgba(240,140,0,.18); }
.day.today { border-color: var(--accent); }
.day-num { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; }
.day-num .dot-fav { color: var(--fav); }

/* match pill */
.match {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-2);
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 3px 5px;
  font-size: 11px;
  cursor: pointer;
  position: relative;
}
.match:hover { border-color: var(--accent-2); }
.match .flag { width: 19px; height: 14px; border-radius: 2px; object-fit: cover; flex-shrink: 0; }
.match .ko-badge {
  width: 19px; height: 14px; border-radius: 2px; flex-shrink: 0;
  background: var(--ko); color: #fff; font-size: 8px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.match .vs { color: var(--muted); font-size: 9px; }
.match .mtime { margin-left: auto; color: var(--muted); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.match.fav { background: var(--fav-dim); border-color: rgba(240, 140, 0, 0.5); }
.match.banger { box-shadow: 0 0 0 1px rgba(232,89,12,.55); }
.match .flame { position: absolute; top: -6px; right: -4px; font-size: 11px; }
.match.dimmed { opacity: 0.28; }
.stage-tag {
  font-size: 8.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--ko); font-weight: 700;
}

/* ---------- My matches list ---------- */
.mm-empty { color: var(--muted); font-size: 14px; }
.mm-group { margin-bottom: 18px; }
.mm-team-head {
  display: flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 700; margin-bottom: 8px;
}
.mm-team-head img { width: 26px; height: 19px; border-radius: 3px; }
.mm-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 9px;
  background: var(--bg-2);
  margin-bottom: 6px;
  font-size: 13.5px;
}
.mm-row .mm-date { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.mm-row .mm-opp { display: flex; align-items: center; gap: 8px; }
.mm-row .mm-opp img { width: 22px; height: 16px; border-radius: 3px; }
.mm-row .mm-meta { color: var(--muted); font-size: 12px; text-align: right; }
.mm-row .mm-flame { color: var(--banger); }

/* ---------- Popover ---------- */
.popover {
  position: fixed;
  z-index: 50;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  max-width: 280px;
  font-size: 13px;
  pointer-events: none;
}
.popover.hidden { display: none; }
.popover.ko { max-width: 348px; }
.pv-ko { display: flex; gap: 12px; align-items: flex-start; margin: 8px 0 6px; }
.pv-side { flex: 1 1 0; min-width: 0; }
.pv-mid { align-self: center; color: var(--muted); font-weight: 800; font-size: 10px; flex: 0 0 auto; }
.pv-slot { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; margin-bottom: 7px; }
.pv-odds { display: flex; flex-direction: column; gap: 4px; }
.pv-odd { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.pv-odd.lead { color: var(--text); font-weight: 700; }
.pv-odd img { width: 18px; height: 13px; border-radius: 2px; object-fit: cover; flex: 0 0 auto; }
.pv-nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-pct { font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.popover h4 { margin: 0 0 8px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.popover .pv-teams { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 700; font-size: 14px; }
.popover .pv-teams img { width: 24px; height: 18px; border-radius: 3px; }
.popover .pv-row { color: var(--muted); margin: 3px 0; }
.popover .pv-elo { color: var(--banger); }

footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  border-top: 1px solid var(--line);
}

/* ---------- Agenda (mobile calendar) ---------- */
#calendar.agenda-view .month-title { margin: 22px 0 10px; }
.agenda-day {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.agenda-day.has-fav .agenda-date .ad-num { color: var(--fav); }
.agenda-date { text-align: center; padding-top: 2px; }
.ad-wd { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.ad-num { display: block; font-size: 23px; font-weight: 700; line-height: 1.1; }
.agenda-matches { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.agenda-match {
  background: var(--bg-2);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 11px;
}
.agenda-match.fav { background: var(--fav-dim); border-color: rgba(240, 140, 0, 0.5); }
.agenda-match.banger { box-shadow: 0 0 0 1px rgba(255, 107, 61, 0.5); }
.agenda-match.dimmed { opacity: 0.32; }
.ar-teams { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 14.5px; font-weight: 600; }
.ar-team { display: flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; }
.ar-team .flag { width: 24px; height: 18px; border-radius: 3px; object-fit: cover; flex-shrink: 0; }
.ar-team .ko-badge {
  width: 26px; height: 18px; border-radius: 3px; flex-shrink: 0;
  background: var(--ko); color: #fff; font-size: 9px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.ar-name { overflow-wrap: break-word; }
.ar-teams .flame { margin-left: auto; flex-shrink: 0; }
.ar-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }

@media (max-width: 720px) {
  .day { min-height: 92px; }
  .header-stats { width: 100%; justify-content: space-between; }
  .mm-row { grid-template-columns: 80px 1fr; }
  .mm-row .mm-meta { grid-column: 1 / -1; text-align: left; }
}

@media (max-width: 640px) {
  main { padding: 16px 13px 50px; }
  .header-inner { padding: 18px 14px; gap: 14px; }
  .title-block h1 { font-size: 22px; }
  .subtitle { font-size: 12px; }
  .header-stats { gap: 0; justify-content: space-around; }
  .header-stats .stat b { font-size: 21px; }
  .panel { padding: 14px; border-radius: 12px; }
  .panel-head { gap: 10px; }
  .panel-head h2 { font-size: 16px; }
  .picker-controls { width: 100%; }
  #team-search { flex: 1 1 auto; min-width: 0; }
  .controls-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .legend { gap: 12px; }
  .view-toggles { gap: 16px; }
  /* the popover is desktop-hover only; agenda already shows full detail */
  .popover { display: none !important; }
}

/* ====================================================================== */
/* NAV + VIEWS                                                            */
/* ====================================================================== */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 0 max(20px, calc((100% - 1180px) / 2));
}
.nav-link {
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 16px 12px;
  cursor: pointer;
  font-family: inherit;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--accent-2); border-bottom-color: var(--accent-2); }

/* one continuous page: every section is visible; tabs jump-scroll to them */
.view { scroll-margin-top: 58px; }
.view + .view { margin-top: 8px; }

/* ====================================================================== */
/* PICKER — single suggested row                                          */
/* ====================================================================== */
.chip-row {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.chip-row .chip { flex: 0 0 auto; }
.chip-row.hidden, .chips.hidden { display: none; }
.chip-more {
  border-style: dashed;
  border-color: var(--accent-2);
  color: var(--accent-2);
  background: transparent;
  font-weight: 600;
  padding: 6px 14px;
}
.chip-more:hover { background: rgba(25, 113, 194, 0.07); transform: none; }
.loc-pin { font-size: 11px; margin-right: -2px; }

/* ====================================================================== */
/* EMPTY STATE                                                            */
/* ====================================================================== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty-state.small { padding: 26px 20px; }
.es-emoji { font-size: 46px; margin-bottom: 6px; }
.empty-state h3 { margin: 6px 0; color: var(--text); font-size: 19px; }
.empty-state p { max-width: 440px; margin: 0 auto 18px; font-size: 14px; }
.cta-btn {
  background: var(--accent-2);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.cta-btn:hover { filter: brightness(1.06); }

/* ====================================================================== */
/* PLANNER                                                                */
/* ====================================================================== */
#planner-cal { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 8px; }
.pmonth { flex: 1 1 280px; max-width: 360px; }
.pmonth-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.pweekdays { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }
.pweekdays span { text-align: center; font-size: 10px; color: var(--muted); text-transform: uppercase; }
.pgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.pd {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.pd.empty { border: none; background: none; cursor: default; }
.pd.nomatch { color: var(--muted); opacity: 0.45; cursor: default; background: transparent; }
.pd:not(.nomatch):not(.empty):hover { border-color: var(--accent-2); }
.pd .pd-dot { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.pd.in-range { background: var(--fav-dim); border-color: rgba(240, 140, 0, 0.4); }
.pd.sel-end { background: var(--fav); border-color: var(--fav); color: #fff; }
.pd.sel-end .pd-dot { background: #fff; }

.planner-summary-bar {
  margin-top: 18px;
  padding: 12px 14px;
  background: var(--panel-2);
  border-radius: 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.planner-summary-bar .ss-fav { color: var(--fav); font-weight: 600; }
.planner-summary-bar .ss-banger { color: var(--banger); font-weight: 600; }
.pl-clear { margin-left: auto; padding: 5px 12px; font-size: 12px; }

#planner-queue { margin-top: 16px; display: flex; flex-direction: column; gap: 7px; }
.q-divider {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted);
  margin: 14px 2px 4px; font-weight: 700;
}
.q-row {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 14px;
}
.q-row.fav { border-color: rgba(240, 140, 0, 0.5); background: var(--fav-dim); }
.q-row.banger { box-shadow: inset 0 0 0 1px rgba(232, 89, 12, 0.4); }
.q-date { font-size: 13px; font-weight: 700; color: var(--accent-2); display: flex; flex-direction: column; }
.q-date .q-time { color: var(--muted); font-weight: 500; font-size: 12px; font-variant-numeric: tabular-nums; }
.q-main .ar-teams { font-size: 15px; }
.q-main .ar-meta { margin-top: 3px; }
.q-badges { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.q-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.q-fav { background: var(--fav-dim); color: #9a5b00; }
.q-banger { background: rgba(232, 89, 12, 0.12); color: var(--banger); }

/* ====================================================================== */
/* PROJECTED-SLOT ICONS (split-flag family)                               */
/* ====================================================================== */
.pic { display: inline-flex; align-items: center; vertical-align: middle; flex: 0 0 auto; }
.pic.single img { width: 24px; height: 18px; border-radius: 3px; object-fit: cover; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.pic.even2 { gap: 2px; }
.pic.even2 img { width: 18px; height: 14px; border-radius: 2px; object-fit: cover; box-shadow: 0 1px 2px rgba(0,0,0,.22); }
.pic.b2, .pic.b3 { position: relative; display: inline-block; }
.pic.b2 img, .pic.b3 img { position: absolute; width: 19px; height: 14px; border: 1px solid #fff; border-radius: 2px; object-fit: cover; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.pic.b2 { width: 27px; height: 19px; }
.pic.b2 .f1 { top: 0; left: 0; z-index: 2; } .pic.b2 .f2 { top: 5px; left: 8px; z-index: 1; }
.pic.b3 { width: 34px; height: 24px; }
.pic.b3 .f1 { top: 0; left: 0; z-index: 3; } .pic.b3 .f2 { top: 5px; left: 8px; z-index: 2; } .pic.b3 .f3 { top: 10px; left: 16px; z-index: 1; }
.pic.g4 { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 1px; width: 30px; height: 22px; background: #fff; border-radius: 3px; padding: 1px; box-shadow: 0 1px 2px rgba(0,0,0,.22); outline: 1px solid rgba(0,0,0,.06); }
.pic.g4 img { width: 100%; height: 100%; object-fit: cover; border-radius: 1px; display: block; }

/* compact icons inside the dense calendar month grid */
.match .pic.single img { width: 18px; height: 13px; }
.match .pic.even2 img { width: 14px; height: 11px; }
.match .pic.b2 { width: 22px; height: 15px; }
.match .pic.b2 img, .match .pic.b3 img { width: 15px; height: 11px; }
.match .pic.b2 .f2 { top: 4px; left: 6px; }
.match .pic.b3 { width: 26px; height: 18px; }
.match .pic.b3 .f2 { top: 4px; left: 6px; } .match .pic.b3 .f3 { top: 8px; left: 12px; }
.match .pic.g4 { width: 21px; height: 16px; }

/* ====================================================================== */
/* PROJECTIONS VIEW                                                       */
/* ====================================================================== */
#proj-intro p { margin: 6px 0 0; color: var(--muted); font-size: 13px; max-width: 720px; }
#proj-intro .proj-rule { margin-top: 10px; font-size: 12.5px; }
#proj-intro code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }
.proj-stage-head { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; margin: 20px 2px 10px; }
#proj-list { display: flex; flex-direction: column; gap: 11px; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 13px 15px; }
.pcard .phead { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 11px; }
.pcard .pwhen { font-weight: 700; color: var(--accent-2); font-size: 14px; }
.pcard .pwhere { color: var(--muted); font-size: 12px; }
.pside { display: flex; flex-direction: column; gap: 6px; }
.pside-main { display: flex; align-items: center; gap: 11px; font-size: 16px; font-weight: 700; min-height: 24px; }
.pside-prob { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 1px 0 4px; scrollbar-width: thin; }
/* desktop: probabilities sit inline, to the right of the slot label */
@media (min-width: 641px) {
  .pside { flex-direction: row; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
  .pside-main { flex: 0 0 auto; min-width: 168px; }
  .pside-prob { flex: 1 1 auto; flex-wrap: wrap; overflow: visible; padding: 0; }
}
.pside-prob::-webkit-scrollbar { height: 5px; } .pside-prob::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.ppill { display: inline-flex; align-items: center; gap: 5px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px 2px 4px; font-size: 11.5px; flex: 0 0 auto; }
.ppill img { width: 18px; height: 13px; border-radius: 2px; object-fit: cover; }
.ppill .pct { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.ppill.lead { border-color: rgba(25,113,194,.5); background: rgba(25,113,194,.07); }
.ppill { cursor: pointer; }
.ppill:hover { border-color: var(--accent-2); }

/* ---- drill-down modal (survival funnel) ---- */
.drill-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(20,30,60,.45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.drill-overlay.hidden { display: none; }
.drill { background: var(--panel); border-radius: 16px; max-width: 460px; width: 100%; padding: 22px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.32); max-height: 90vh; overflow: auto; }
.drill-head { display: flex; align-items: center; gap: 12px; margin-bottom: 2px; }
.drill-head img { width: 40px; height: 30px; border-radius: 4px; object-fit: cover; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.drill-head h3 { margin: 0; font-size: 19px; }
.drill-close { margin-left: auto; background: none; border: none; font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1; align-self: flex-start; }
.drill-close:hover { color: var(--text); }
.drill-sub { color: var(--muted); font-size: 12.5px; margin: 2px 0 12px; }
.drill-group { background: var(--bg); border-radius: 9px; padding: 9px 12px; font-size: 12px; color: var(--muted); margin: 0 0 16px; }
.drill-group b { color: var(--text); }
.dl-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr 46px; gap: 10px; align-items: center; margin-bottom: 8px; }
.dl-label { font-size: 12.5px; font-weight: 600; }
.dl-cond { color: var(--muted); font-size: 10.5px; font-weight: 400; display: block; }
.dl-bar { height: 18px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.dl-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 5px; }
.dl-pct { font-size: 13px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.drill-note { margin-top: 14px; color: var(--muted); font-size: 11.5px; border-top: 1px solid var(--line); padding-top: 12px; }
.pvs { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; margin: 9px 0 5px; padding-left: 3px; position: relative; }
.pvs::after { content: ""; position: absolute; left: 44px; right: 0; top: 50%; height: 1px; background: var(--line); }

@media (max-width: 640px) {
  .main-nav { padding: 0 4px; }
  .nav-link { flex: 1; padding: 13px 4px 11px; font-size: 13px; }
  #planner-cal { gap: 18px; }
  .pmonth { flex: 1 1 100%; max-width: none; }
  .q-row { grid-template-columns: 70px 1fr; }
  .q-badges { grid-column: 1 / -1; flex-direction: row; align-items: center; }
}

/* ====================================================================== */
/* CHALKBOARD THEME — structural overrides                                */
/* ====================================================================== */

/* hand fonts on headings (body is already Patrick Hand) */
.title-block h1 { font-family: var(--script-font); font-size: 42px; font-weight: 700;
  letter-spacing: .5px; text-shadow: 0 0 2px rgba(255,255,255,.25); }
.trophy { filter: none; }

/* header = chalk board band with faint pitch lines */
.site-header { background: transparent; border-bottom: 2px solid var(--line); color: var(--text); overflow: hidden; }
.site-header .subtitle { color: var(--muted); }
.header-pitch { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .13; pointer-events: none; }
.header-inner { position: relative; z-index: 1; }

/* nav: chalk tabs, hand-circled active */
.main-nav { background: rgba(21,51,42,.86); backdrop-filter: blur(6px); border-bottom: 2px solid var(--line); }
.nav-link { color: var(--muted); position: relative; }
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); border-bottom-color: transparent; }
.nav-link.active::after { content: ""; position: absolute; left: 7px; right: 7px; top: 7px; bottom: 8px;
  border: 2.5px solid var(--fav); border-radius: 60% 40% 55% 45% / 55% 60% 40% 45%; filter: url(#rough); pointer-events: none; }

/* flatten shadows; cards become chalk-outlined regions */
.panel, .pcard, .ub-card, .q-row, .pd, .planner-summary-bar, .popover, .drill,
.day, .agenda-day, .mm-row, .cta-btn, .chip, .ub-teams img, .chip img { box-shadow: none; }
.panel { border: 2px solid var(--line); }
.pcard, .q-row { border: 2px solid var(--line); background: var(--panel); }
.mm-row { border: 1px solid var(--line); }

/* gentle hand-drawn wobble on the showcase pieces (NOT the dense calendar, for perf) */
.chip, .ub-card, .pcard, .drill, .planner-summary-bar, .intro-card .node, .cta-btn { filter: url(#rough); }

/* chips */
.chip { border: 2px solid var(--line); background: rgba(255,255,255,.055); }
.chip:hover { background: rgba(255,255,255,.09); }
.chip.selected { background: var(--fav-dim); border-color: var(--fav); color: var(--text); }
.chip-more { border-color: var(--accent-2); color: var(--accent-2); }

/* upcoming bangers */
.ub-card { background: transparent; border: 2px solid var(--banger); }
.upcoming-head { color: var(--banger); }

/* favourite + banger accents in chalk */
.match.fav, .agenda-match.fav { border-color: var(--fav); }
.day.has-fav { border-color: var(--fav); }
.match.banger, .agenda-match.banger { box-shadow: 0 0 0 1.5px var(--banger); }
.q-row.fav { border-color: var(--fav); }
.q-row.banger { box-shadow: inset 0 0 0 1.5px var(--banger); }
.q-fav { color: var(--fav); background: var(--fav-dim); }

/* buttons */
.cta-btn { background: transparent; border: 2px solid var(--accent-2); color: var(--accent-2); }
.cta-btn:hover { background: rgba(158,201,255,.12); filter: url(#rough); }
.ghost-btn { border-color: var(--line); color: var(--muted); }

/* planner range select readable on yellow chalk */
.pd.sel-end { color: #15332a; }
.pd.in-range { background: var(--fav-dim); border-color: var(--fav); }

/* solid boards for floating surfaces so they read over content */
.popover { background: #1b3b30; border: 2px solid var(--line); }
.drill { background: #1b3b30; border: 2px solid var(--line); }
.drill-group { background: rgba(0,0,0,.18); }

/* ---- intro = "team talk" board ---- */
.intro-card { background: transparent; border: 2px solid var(--line); text-align: center; padding: 22px 24px 26px; }
.intro-tt { font-size: 14px; letter-spacing: 2px; text-transform: uppercase; color: var(--fav); }
.intro-h { font-family: var(--script-font); font-size: 34px; font-weight: 700; margin: 4px 0 2px; }
.intro-dek { color: var(--muted); font-size: 15px; margin: 0 0 20px; }
.intro-nodes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 800px; margin: 0 auto; }
.intro-card .node { border: 2.5px solid var(--line); border-radius: 14px; padding: 14px 10px; }
.intro-card .node:nth-child(1) { border-color: var(--accent-2); }
.intro-card .node:nth-child(2) { border-color: var(--banger); }
.intro-card .node:nth-child(3) { border-color: var(--accent); }
.intro-card .node:nth-child(4) { border-color: var(--fav); }
.intro-card .node .e { font-size: 25px; }
.intro-card .node b { display: block; font-size: 17px; margin-top: 5px; }
.intro-card .node p { margin: 1px 0 0; font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .intro-nodes { grid-template-columns: 1fr 1fr; } }

/* ====================================================================== */
/* CHALK THEME — round 2 tweaks                                           */
/* ====================================================================== */

/* collapsible picker: Done -> one-line preview -> Edit */
.picker-preview { display: none; align-items: center; gap: 10px; flex-wrap: wrap; }
#picker-panel.collapsed .picker-preview { display: flex; }
#picker-panel.collapsed .picker-body { display: none; }
.pp-text { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; }
.pp-label { font-size: 16px; }
.pp-flag { width: 24px; height: 17px; border-radius: 3px; object-fit: cover; }
.pp-count { color: var(--muted); font-size: 13px; }
.picker-foot { display: flex; justify-content: flex-end; margin-top: 14px; }
.done-btn { background: var(--fav); color: #15332a; border: none; border-radius: 10px; padding: 8px 24px;
  font-family: var(--chalk-font); font-size: 16px; cursor: pointer; filter: url(#rough); }
.done-btn:hover { filter: none; }

/* checkboxes -> switches */
.toggle input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 999px; margin: 0;
  background: rgba(255,255,255,.12); border: 1.5px solid var(--line); position: relative; cursor: pointer;
  transition: background .15s; flex: 0 0 auto;
}
.toggle input[type="checkbox"]::after {
  content: ""; position: absolute; top: 1.5px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--text); transition: transform .15s;
}
.toggle input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.toggle input[type="checkbox"]:checked::after { transform: translateX(15px); background: #15332a; }

/* legend squares -> dots */
.swatch { border-radius: 50%; }

/* upcoming bangers as a banner (remove the `banner` class to roll back) */
.upcoming.banner { border: 2px solid var(--banger); border-radius: var(--radius);
  padding: 12px 16px 8px; background: rgba(255,158,196,.05); margin-bottom: 24px; }
.upcoming.banner .upcoming-head { font-size: 14px; }

/* footer matches the board */
footer { background: transparent; border-top: 1px solid var(--line); color: var(--muted); }

/* planner range selection — cleaner, continuous, readable numbers */
.pd.in-range { background: var(--fav-dim); border-color: transparent; color: var(--text); }
.pd.sel-end { background: var(--fav-dim); border: 2px solid var(--fav); color: var(--text); }
.pd.sel-end .pd-dot { background: var(--accent); }
