:root {
  --bg: #0d0d0f;
  --bg-2: #131316;
  --bg-3: #1a1a1e;
  --ember: #ff5a1f;
  --ember-2: #ff7a18;
  --flame: #ff3d00;
  --text: #f4f1ec;
  --muted: #a8a29a;
  --line: rgba(255,255,255,.08);
  --flame-grad: linear-gradient(135deg, #ff7a18, #ff3d00);
  --ok: #8bbf4a;
  --err: #e05252;
  --gold: #f5c04a;
  --silver: #c9ccd4;
  --bronze: #cd8f5a;
  --maxw: 1720px;
  --head-h: 62px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

/* accessibility: skip link + visible keyboard focus */
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 100;
  background: var(--flame-grad); color: #fff; padding: 10px 16px; border-radius: 8px;
  text-decoration: none; font-family: "Oswald", sans-serif; transition: top .15s;
}
.skip-link:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--ember-2); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background:
    radial-gradient(900px 480px at 8% -8%, rgba(255,90,31,.08), transparent 60%),
    radial-gradient(720px 420px at 100% 0%, rgba(255,61,0,.05), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  min-height: 100vh;   /* fallback for older iPad Safari */
  min-height: 100svh;
  display: flex; flex-direction: column;
}
h1, h2, h3 {
  font-family: "Oswald", system-ui, sans-serif; text-transform: uppercase;
  font-weight: 700; letter-spacing: 1.2px; line-height: 1.1;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); margin: 26px 0 10px; }
h2 { font-size: clamp(1.15rem, 2.4vw, 1.5rem); margin: 36px 0 14px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
h2::before { content: ""; width: 22px; height: 3px; background: var(--flame-grad); border-radius: 2px; align-self: center; flex: none; }
h3 { font-size: 1rem; margin-bottom: 8px; }
a { color: var(--ember-2); text-decoration-color: rgba(255,122,24,.35); text-underline-offset: 2px; }
a:hover { color: var(--ember); }
.ember-text {
  background: var(--flame-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.wrap { width: min(var(--maxw), 96vw); margin: 0 auto; flex: 1; padding-bottom: 80px; }
.lead { color: var(--muted); max-width: 90ch; margin-bottom: 14px; font-size: 1.03rem; }
.fine { color: var(--muted); font-size: .82rem; font-family: "Inter", sans-serif; text-transform: none; letter-spacing: 0; font-weight: 400; }
.crumb { margin-top: 18px; font-size: .85rem; }
.crumb a { text-decoration: none; color: var(--muted); }
.crumb a:hover { color: var(--ember-2); }
.hint { color: var(--muted); font-size: .82rem; margin-top: 10px; }

/* ---------- header / footer ---------- */
.site-head {
  /* NOTE: no min-height from --head-h here — tables.js measures this element
     to set --head-h for sticky table offsets, and feeding the measurement back
     into min-height ratchets the header taller after any transient wrap. */
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px clamp(14px, 2.5vw, 36px); border-bottom: 1px solid var(--line);
  flex-wrap: wrap; background: rgba(13,13,15,.86);
  -webkit-backdrop-filter: blur(12px);   /* iPad/older Safari needs the prefix */
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand .mark { width: 32px; height: 32px; filter: drop-shadow(0 3px 10px rgba(255,77,0,.45)); }
.brand b { font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 1.4px; font-size: 1rem; }
.brand-exit:hover b { color: var(--ember-2); }
.brand-exit:hover .ember-text { filter: brightness(1.2); }
.brand .brand-app {
  font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 1.6px;
  font-size: .74rem; font-weight: 600; color: var(--muted);
  border-left: 1px solid var(--line); padding-left: 10px; white-space: nowrap;
}

/* leave-site confirmation (brand click -> saucyrossybbq.com) */
dialog.leave-modal {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 16px; padding: 26px 28px; max-width: min(430px, 92vw);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
dialog.leave-modal::backdrop {
  background: rgba(6,6,8,.65);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.leave-modal h2 { font-size: 1.25rem; margin-bottom: 6px; }
.leave-modal p { color: var(--muted); font-size: .94rem; margin-bottom: 18px; }
.leave-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.head-nav { display: flex; align-items: center; gap: 4px clamp(4px, 1vw, 8px); flex-wrap: wrap; }
.head-nav a {
  color: var(--text); text-decoration: none; font-family: "Oswald", sans-serif;
  text-transform: uppercase; letter-spacing: 1.2px; font-size: .8rem; font-weight: 600;
  padding: 7px 14px; border-radius: 999px; border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.head-nav a:hover { border-color: var(--line); background: rgba(255,255,255,.04); }
.head-nav a[aria-current="page"] { background: var(--flame-grad); color: #fff; }
.head-nav .nav-search { font-size: 1.15rem; line-height: 1; padding: 6px 12px; }
.head-nav .nav-coffee { background: #ffdd00; color: #17120b; border-color: transparent; }
.head-nav .nav-coffee:hover { background: #ffe74d; color: #17120b; border-color: transparent; }
.head-nav .nav-coffee .cup { font-size: .95rem; }

/* ---------- landing ---------- */
.hero-lander { text-align: center; padding: clamp(30px, 6vw, 70px) 0 30px; }
.hero-lander .eyebrow { justify-content: center; }
.hero-lander h1 { font-size: clamp(2.3rem, 6vw, 4rem); margin: 14px 0; }
.hero-lander .lead { margin: 0 auto 26px; text-align: center; }
.lander-search { display: flex; gap: 10px; max-width: 640px; margin: 0 auto 30px; }
.lander-search input { margin-top: 0; font-size: 1.05rem; padding: 14px 18px; border-radius: 12px; }
.lander-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px clamp(18px, 4vw, 44px); }
.lander-stats a, .lander-stats span { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--text); }
.lander-stats b {
  font-family: "Oswald", sans-serif; font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1;
  background: var(--flame-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.lander-stats span span, .lander-stats a span { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: 1.5px; margin-top: 5px; }
.lander-stats a:hover b { filter: brightness(1.15); }
.season-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.season-nav { display: flex; gap: 8px; }
.recap-block { margin: 6px 0 18px; }
.recap-stats { justify-content: flex-start; margin: 10px 0 6px; }
.recap-list li { border-bottom: 0; padding: 5px 2px; }
.site-foot { border-top: 1px solid var(--line); padding: 26px; text-align: center; color: var(--muted); font-size: .84rem; }
.site-foot .fine { margin-top: 4px; font-size: .74rem; opacity: .8; }
.foot-support {
  display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 14px;
  padding: 9px 18px; border-radius: 999px; text-decoration: none;
  font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 1.1px;
  font-weight: 600; font-size: .76rem; background: #ffdd00; color: #17120b;
  box-shadow: 0 10px 28px rgba(255,221,0,.2); transition: transform .18s, box-shadow .18s;
}
.foot-support:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(255,221,0,.38); color: #17120b; }
.foot-support .cup { font-size: 1rem; line-height: 1; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; cursor: pointer;
  font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 1.2px;
  font-weight: 600; font-size: .86rem; padding: 11px 20px; border-radius: 999px; border: 0;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary { background: var(--flame-grad); color: #fff; box-shadow: 0 10px 28px rgba(255,77,0,.28); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: rgba(255,255,255,.05); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-danger { background: var(--err); color: #fff; }
.linklike { background: none; border: 0; color: var(--ember-2); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.inline-form { display: inline; }
label { display: block; margin: 12px 0; font-weight: 500; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], select, textarea {
  width: 100%; margin-top: 5px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-3); color: var(--text);
  font: inherit; transition: border-color .15s;
}
input:hover, select:hover { border-color: rgba(255,255,255,.18); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ember); outline-offset: 0; border-color: transparent; }
select { cursor: pointer; }
optgroup { background: var(--bg-2); font-style: normal; }

/* filter bar = a panel */
.filter-row {
  display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin: 16px 0 22px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px;
}
.filter-row input, .filter-row select { width: auto; min-width: 150px; margin-top: 4px; }
.filter-row input[type="search"] { min-width: 230px; }
.filter-row label { margin: 0; }
.flash { border-radius: 10px; padding: 10px 14px; margin: 12px 0; font-size: .92rem; }
.flash-ok { background: rgba(139,191,74,.12); border: 1px solid rgba(139,191,74,.4); color: #cde8a8; }
.flash-err { background: rgba(224,82,82,.12); border: 1px solid rgba(224,82,82,.4); color: #f2b8b8; }
.flash ul { margin-left: 18px; }

/* ---------- panels ---------- */
.auth-panel { max-width: 480px; margin: 40px auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.auth-panel.wide { max-width: 680px; margin: 20px 0; }
.auth-panel h1 { margin-top: 0; }
.danger-zone { border-color: rgba(224,82,82,.4); }

/* ---------- stat cards ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 14px; margin: 22px 0; }
.stat-card {
  position: relative; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px 16px;
  transition: transform .18s ease, border-color .18s ease;
}
.stat-card::before { content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 3px; background: var(--flame-grad); opacity: .75; }
.stat-card:hover { transform: translateY(-3px); border-color: rgba(255,122,24,.35); }
.stat-card h3 { font-size: .74rem; letter-spacing: 2px; color: var(--muted); font-weight: 600; }
.stat-card .big {
  font-family: "Oswald", sans-serif; font-size: clamp(1.7rem, 2.6vw, 2.3rem); font-weight: 700; line-height: 1.25;
  background: var(--flame-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-card .sub { color: var(--muted); font-size: .8rem; }
.tagchip { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; font-size: .68rem;
  font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); vertical-align: middle; }
.tagchip.gold { border-color: rgba(245,192,74,.5); color: var(--gold); }
.tagchip.ok { border-color: rgba(139,191,74,.5); color: var(--ok); }
.tagchip.err { border-color: rgba(224,82,82,.55); color: #f0a2a2; }
.tagchip.info { border-color: rgba(59,160,214,.55); color: #9fd0ec; }

/* cancelled-event notice on the event detail page */
.cancel-banner {
  background: rgba(224,82,82,.1); border: 1px solid rgba(224,82,82,.45);
  color: #f2c0c0; border-radius: 12px; padding: 12px 16px; margin: 10px 0 16px;
  font-size: .95rem;
}
.cancel-banner b { color: #f6d7d7; text-transform: uppercase; letter-spacing: .8px; font-size: .85rem; }

/* judging-class notice (same shape, informational blue) */
.class-banner {
  background: rgba(59,160,214,.1); border: 1px solid rgba(59,160,214,.45);
  color: #c4e2f4; border-radius: 12px; padding: 12px 16px; margin: 10px 0 16px;
  font-size: .95rem;
}
.class-banner b { color: #dbeefa; text-transform: uppercase; letter-spacing: .8px; font-size: .85rem; }
.event-list { list-style: none; }
.event-list li { padding: 9px 2px; border-bottom: 1px solid var(--line); }

/* ---------- tables ---------- */
.list-table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin: 12px 0 26px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  /* no overflow:hidden here — it would turn the table into the sticky
     containing block and break the pinned headers */
}
.list-table thead th {
  position: sticky; top: var(--head-h); z-index: 5;
  background: #17171b; text-align: left;
  font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 1.2px;
  font-size: .72rem; color: var(--muted); font-weight: 600;
  padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.list-table thead th:first-child { border-top-left-radius: 14px; }
.list-table thead th:last-child { border-top-right-radius: 14px; }
.list-table tbody tr:last-child td:first-child { border-bottom-left-radius: 14px; }
.list-table tbody tr:last-child td:last-child { border-bottom-right-radius: 14px; }
.list-table td { padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.05); font-size: .93rem; }
.list-table tbody tr:last-child td { border-bottom: 0; }
.list-table tbody tr:nth-child(even) td { background: rgba(255,255,255,.015); }
.list-table tbody tr:hover td { background: rgba(255,122,24,.07); }
.list-table tbody tr[data-href]:active td { background: rgba(255,122,24,.14); }  /* touch feedback */
.list-table .score { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.list-table.compact th { padding: 8px 12px; }
.list-table.compact td { padding: 7px 12px; font-size: .86rem; }
.list-table tr.muted td { opacity: .55; }
.list-table a { text-decoration: none; }
.list-table a:hover { text-decoration: underline; }

/* sortable columns */
table.sortable thead th { cursor: pointer; user-select: none; }
table.sortable thead th:hover { color: var(--text); }
table.sortable thead th[aria-sort]::after { content: " ↑"; color: var(--ember-2); }
table.sortable thead th[aria-sort="descending"]::after { content: " ↓"; }

/* clickable rows */
tr[data-href] { cursor: pointer; }

/* place badges + score bars */
.place {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 24px; padding: 0 7px; border-radius: 999px;
  font-family: "Oswald", sans-serif; font-weight: 600; font-size: .8rem;
  background: rgba(255,255,255,.05); color: var(--muted);
}
.place.p1 { background: rgba(245,192,74,.16); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(245,192,74,.45); }
.place.p2 { background: rgba(201,204,212,.12); color: var(--silver); box-shadow: inset 0 0 0 1px rgba(201,204,212,.35); }
.place.p3 { background: rgba(205,143,90,.14); color: var(--bronze); box-shadow: inset 0 0 0 1px rgba(205,143,90,.4); }
.bar {
  position: relative; display: block; min-width: 110px; padding: 2px 8px;
  border-radius: 6px; text-align: center; overflow: hidden;
}
.bar::before {
  content: ""; position: absolute; inset: 0; border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,90,31,.28), rgba(255,122,24,.12));
  width: var(--w, 0%);
}
.bar span { position: relative; z-index: 1; }
.bar.perfect::before { background: linear-gradient(90deg, rgba(245,192,74,.42), rgba(245,192,74,.16)); }
.bar.perfect span { color: var(--gold); font-weight: 700; }

/* ---------- podium ---------- */
.podium { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 14px; margin: 20px 0; }
.podium-card {
  position: relative; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; overflow: hidden; transition: transform .18s ease;
}
.podium-card:hover { transform: translateY(-3px); }
.podium-card::before { content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 4px; }
.podium-card.p1::before { background: linear-gradient(90deg, #f5c04a, #ffdf8e); }
.podium-card.p2::before { background: linear-gradient(90deg, #c9ccd4, #eceef2); }
.podium-card.p3::before { background: linear-gradient(90deg, #cd8f5a, #e8b98b); }
.podium-card .medal { font-size: 1.6rem; line-height: 1; }
.podium-card .team { font-family: "Oswald", sans-serif; font-size: 1.15rem; font-weight: 600; letter-spacing: .5px; margin: 6px 0 2px; }
.podium-card .team a { color: var(--text); text-decoration: none; }
.podium-card .team a:hover { color: var(--ember-2); }
.podium-card .pts { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- results + charts ---------- */
.results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 18px; align-items: start; }
.results-block { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px 16px 8px; }
.results-block h3 { display: flex; align-items: center; gap: 8px; }
.results-block h3::before { content: ""; width: 14px; height: 3px; background: var(--flame-grad); border-radius: 2px; flex: none; }
.results-block .list-table { border: 0; background: transparent; margin: 8px 0 6px; }
.results-block .list-table thead th { top: var(--head-h); background: var(--bg-2); }
.chart-block { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; margin: 18px 0; }
.chart-block h2 { margin: 0 0 12px; }
/* bounded chart canvases — charts fill this box, never grow unbounded */
.cbox { position: relative; width: 100%; height: 300px; margin: 4px 0 8px; }
.cbox.tall { height: 340px; }
.cbox.sm { height: 260px; max-width: 440px; margin-inline: auto; }
.cbox > canvas { position: absolute; inset: 0; }
@media (max-width: 640px) { .cbox { height: 260px; } .cbox.sm { height: 230px; } }
.results-filter { margin: 14px 0 4px; }
.results-filter input { max-width: 420px; }

/* events map (Leaflet + OSM, tiles darkened to match the theme) */
.map-box { height: 420px; border-radius: 12px; overflow: hidden; background: var(--bg-3); }
.map-box .leaflet-tile { filter: invert(1) hue-rotate(190deg) brightness(.9) contrast(.85) saturate(.5); }
.map-box .leaflet-container { background: #14141a; font: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--bg-2) !important; color: var(--text) !important; }
.leaflet-popup-content a { color: var(--ember-2); }
.leaflet-popup-content .pop-fine { color: var(--muted); font-size: .8rem; }
.leaflet-popup-content .pop-count {
  font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 1px;
  font-size: .7rem; color: var(--ember-2); margin-bottom: 6px;
}
.leaflet-popup-content .pop-sep { border: 0; border-top: 1px solid var(--line); margin: 7px 0; }
.leaflet-popup-content .pop-cancel { color: #e05252; text-transform: uppercase; font-size: .7rem; letter-spacing: .5px; }
.leaflet-popup-content .pop-class { color: #3ba0d6; text-transform: uppercase; font-size: .7rem; letter-spacing: .5px; }
.leaflet-container .leaflet-control-attribution { background: rgba(13,13,15,.7); color: var(--muted); }
.leaflet-container .leaflet-control-attribution a { color: var(--muted); }
@media (max-width: 640px) { .map-box { height: 300px; } }

/* storyline cards */
.story-card { padding-bottom: 16px; }
.story-card h3 { font-size: 1.02rem; }
.story-card p { color: var(--muted); }
.story-card p b, .story-card p a { color: var(--text); }
.story-card p a:hover { color: var(--ember-2); }

/* opponent-search table on the compare page */
.opp-table td { vertical-align: middle; }
.opp-table .opp-name { font-family: "Oswald", sans-serif; font-size: 1.05rem; letter-spacing: .4px; }
.opp-table .opp-action { text-align: right; width: 1%; white-space: nowrap; }
.opp-table tbody tr:hover td { background: rgba(255,122,24,.07); }
.btn-sm { padding: 8px 18px; font-size: .8rem; }

/* head-to-head compare table */
.compare-table td { text-align: center; font-size: 1.02rem; }
.compare-table .mid { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: 1.5px; font-family: "Oswald", sans-serif; width: 40%; }
.compare-table .cmp { font-variant-numeric: tabular-nums; font-weight: 600; }
.compare-table .cmp.win { color: var(--gold); }
.compare-table thead th { text-align: center; }
.compare-table thead th:nth-child(2) { width: 40%; }

@media (max-width: 900px) {
  /* wide tables scroll sideways inside their card; tables marked .fit are
     narrow enough to stay in normal table layout and span full width */
  .list-table:not(.fit) { display: block; overflow-x: auto; }
  .list-table thead th { position: static; }
}
/* in-content ad units (AdSense). Muted, labeled, bounded so they never shove
   the data around; the footer one sits at the end of every page. */
.ad-slot {
  display: block; margin: 26px auto; max-width: 970px; min-height: 90px;
  text-align: center; overflow: hidden;
}
.ad-slot .ad-label {
  display: block; font-size: .62rem; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); opacity: .6; margin-bottom: 4px;
}
.ad-slot .adsbygoogle { display: block; }

/* tool cards on the landing page */
.tools-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 26px 0 8px; }
.tool-card {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 18px;
  transition: border-color .15s, transform .15s;
}
.tool-card:hover { border-color: rgba(255,122,24,.5); transform: translateY(-2px); }
.tool-card .tool-emoji { font-size: 1.6rem; }
.tool-card b { font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 1px; }
.tool-card .fine { color: var(--muted); }

.action-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* team chips (teams-like-this) */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0; }
.team-chip {
  display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
  transition: border-color .15s, transform .15s;
}
.team-chip:hover { border-color: rgba(255,122,24,.5); transform: translateY(-2px); }
.team-chip b { font-size: .95rem; }
.team-chip .fine { color: var(--muted); }

/* admin merge tool */
.merge-group { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 12px 0; background: var(--bg-2); }
.merge-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 8px; }
.merge-form label { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); gap: 4px; }
.merge-form select, .merge-form input { margin: 0; }

/* planner controls */
.planner-controls { align-items: center; margin-bottom: 12px; }
.planner-radius { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.planner-radius select { margin: 0; }
#planner-hint { color: var(--muted); }
#planner-map { margin-bottom: 10px; }

@media (max-width: 640px) {
  h1 { margin-top: 18px; }
  .filter-row input, .filter-row select { min-width: 130px; flex: 1 1 40%; }
  .filter-row .btn { flex: 1 1 100%; justify-content: center; }
  /* keep the sticky header compact on phones: one row, nav swipes sideways */
  .site-head { padding: 8px 10px; gap: 6px; flex-wrap: nowrap; }
  .brand b, .brand .brand-app { display: none; }
  .head-nav {
    flex-wrap: nowrap; overflow-x: auto; min-width: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* fade the clipped edge so it reads as "more to swipe" */
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent);
  }
  .head-nav::-webkit-scrollbar { display: none; }
  .head-nav.nav-at-end { -webkit-mask-image: none; mask-image: none; }
  .head-nav a { padding: 6px 10px; font-size: .72rem; letter-spacing: .8px; white-space: nowrap; flex: 0 0 auto; }
  .head-nav .nav-search { font-size: 1rem; padding: 5px 9px; }
  /* landing search stacks */
  .lander-search { flex-direction: column; }
  .lander-search .btn { width: 100%; justify-content: center; }
  .lander-stats { gap: 10px 22px; }
  /* action buttons in table rows stay tappable without blowing up rows */
  .btn-sm { padding: 7px 12px; font-size: .72rem; }
  .opp-table .opp-name { font-size: .92rem; }
}

/* ---------- print: clean white pages of the data, chrome stripped ---------- */
@media print {
  :root { --text: #111; --muted: #444; --line: #ccc; --bg: #fff; --bg-2: #fff; --bg-3: #fff; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff !important; color: #111; }
  .site-head, .site-foot, .head-nav, .filter-row, .planner-controls,
  .map-box, .chart-block, #planner-map, .season-nav, .nav-search,
  .lander-search, .tools-row, form, .btn, dialog.leave-modal, .ad-slot,
  .share-btn, .share-btn-compact, dialog.share-modal { display: none !important; }
  a { color: #111 !important; text-decoration: none; }
  main.wrap { max-width: none; padding: 0; }
  h1 { margin: 0 0 8px; }
  .lead { color: #333; }
  .stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .stat-card, .results-block, .story-card, section {
    background: #fff !important; border: 1px solid #ccc; break-inside: avoid; page-break-inside: avoid;
  }
  .story-card p b, .story-card p a { color: #111 !important; }
  .list-table { display: table !important; width: 100%; overflow: visible !important; font-size: 11px; }
  .list-table thead th { position: static !important; background: #eee !important; color: #111 !important; }
  .list-table td, .list-table th { border-bottom: 1px solid #ddd; }
  .tagchip { border-color: #999 !important; color: #333 !important; }
  .bar { background: none !important; }
  .bar > span { color: #111 !important; position: static; }
  .ember-text, .brand-app { color: #111 !important; -webkit-text-fill-color: #111 !important; }
  /* a printed page should say where it came from */
  main.wrap::after {
    content: "Saucy Rossy KCBS Helper App · data from kcbs.us";
    display: block; margin-top: 16px; padding-top: 8px; border-top: 1px solid #ccc;
    font-size: 10px; color: #666;
  }
}

/* ---- Scorecard Coach --------------------------------------------------- */
.sc-privacy { margin-top: -6px; }
.sc-form { margin: 18px 0 8px; }
.sc-sheet {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.sc-meat {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px 16px; transition: border-color .15s;
}
.sc-meat.sc-has { border-color: rgba(255,90,31,.4); }
.sc-meat legend {
  font-family: "Oswald", sans-serif; font-weight: 600; font-size: 1.05rem;
  letter-spacing: .5px; padding: 0 8px; color: var(--text);
}
.sc-grid { width: 100%; border-collapse: collapse; }
.sc-grid th, .sc-grid td { padding: 3px 4px; text-align: center; }
.sc-grid thead th {
  font-size: .68rem; letter-spacing: 1px; color: var(--muted); font-weight: 600;
  text-transform: uppercase;
}
.sc-grid tbody th {
  font-size: .8rem; color: var(--muted); font-weight: 600; width: 2.4em;
}
.sc-grid input[type="number"] {
  width: 3.2em; margin: 0; padding: 6px 2px; text-align: center; font-size: .95rem;
  -moz-appearance: textfield;
}
.sc-grid input[type="number"]::-webkit-outer-spin-button,
.sc-grid input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sc-grid input.sc-bad { outline: 2px solid var(--err); }
.sc-javg { font-size: .82rem; color: var(--muted); min-width: 2.4em; }
.sc-live {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: .9rem; display: flex; align-items: baseline; gap: 8px;
}
.sc-live-label { color: var(--muted); font-size: .78rem; letter-spacing: 1px; text-transform: uppercase; }
.sc-cat { font-family: "Oswald", sans-serif; font-size: 1.15rem; color: var(--ember-2); }
.sc-meat.sc-has .sc-cat { color: var(--ember); }

.sc-actions { display: flex; align-items: center; gap: 14px; margin: 18px 0; flex-wrap: wrap; }
.sc-running { color: var(--muted); }
.sc-running b { color: var(--text); font-family: "Oswald", sans-serif; }

/* feedback panel */
.sc-feedback { margin-top: 10px; scroll-margin-top: 80px; }
.sc-summary { margin: 8px 0 6px; }
.sc-lead-note { font-size: 1.02rem; margin: 6px 0 18px; }
.sc-empty, .sc-move-clean p { font-size: 1.02rem; }
.sc-empty {
  background: var(--bg-2); border: 1px dashed var(--line); border-radius: 12px;
  padding: 18px 20px;
}
.sc-move {
  background: linear-gradient(135deg, rgba(255,90,31,.12), rgba(255,61,0,.05));
  border: 1px solid rgba(255,90,31,.35); border-radius: 14px;
  padding: 16px 18px; margin: 6px 0 22px;
}
.sc-move-tag {
  display: inline-block; font-family: "Oswald", sans-serif; font-size: .72rem;
  letter-spacing: 2px; text-transform: uppercase; color: var(--ember-2);
  margin-bottom: 6px;
}
.sc-move p { margin: 4px 0; }
.sc-tip { color: var(--muted); font-size: .93rem; }
.sc-sub { margin: 22px 0 10px; }
.sc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.sc-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.sc-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sc-card-meat { font-family: "Oswald", sans-serif; font-size: 1.05rem; }
.sc-card-score { font-family: "Oswald", sans-serif; font-size: 1.05rem; color: var(--ember-2); }
.sc-card-tier { font-size: .9rem; margin: 6px 0 10px; color: var(--muted); }
.sc-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.sc-facts li { font-size: .9rem; line-height: 1.35; }
.sc-ic { margin-right: 4px; }
.sc-badge { font-size: .8rem; }
.sc-badge-hi { color: var(--ok); }
.sc-badge-mid { color: var(--gold); }
.sc-badge-lo { color: var(--ember-2); }
.sc-lesson {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 4px 18px 16px; margin-top: 20px;
}
.sc-close { font-size: 1.02rem; margin: 20px 0 8px; }
.sc-foot { margin-top: 22px; }

/* ---- Scoring Explained ------------------------------------------------- */
.se-toc {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 26px;
  padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
}
.se-toc a {
  font-size: .82rem; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); text-decoration: none; transition: .15s;
}
.se-toc a:hover { border-color: var(--ember); color: var(--text); }
#scoring, .scoring-explained { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 80px; }

.se-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 16px 0; }
.se-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 5px;
}
.se-card b { font-family: "Oswald", sans-serif; font-size: 1.05rem; letter-spacing: .3px; }
.se-emoji { font-size: 1.7rem; line-height: 1; }
.se-crit .se-card .fine, .se-card .fine { line-height: 1.4; }

.se-list { margin: 12px 0 12px 4px; padding-left: 20px; display: grid; gap: 9px; }
.se-list li { line-height: 1.45; }

.se-callout {
  background: var(--bg-3); border: 1px solid var(--line); border-left: 3px solid var(--ember-2);
  border-radius: 12px; padding: 14px 18px; margin: 18px 0; line-height: 1.5;
}
.se-callout-hot {
  background: linear-gradient(135deg, rgba(255,90,31,.12), rgba(255,61,0,.05));
  border-color: rgba(255,90,31,.35); border-left-color: var(--ember);
}

.se-scale-table td:first-child { width: 64px; }
.se-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; font-family: "Oswald", sans-serif;
  font-weight: 600; color: #111;
}
.se-n9 { background: #7ec850; } .se-n8 { background: #a6cf4e; } .se-n7 { background: #c9d24a; }
.se-n6 { background: #f5c04a; } .se-n5 { background: #f0a848; } .se-n4 { background: #ec8e46; }
.se-n3 { background: #e57244; } .se-n2 { background: #e05252; } .se-n1 { background: #b23838; color: #fff; }

.se-weights { display: grid; gap: 10px; margin: 18px 0; }
.se-wrow { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 12px; }
.se-wlabel { font-size: .9rem; color: var(--muted); text-align: right; }
.se-wbar {
  display: flex; align-items: center; justify-content: flex-end;
  width: var(--w); min-width: 92px; height: 34px; padding: 0 12px; border-radius: 8px;
  background: rgba(255,255,255,.1); color: var(--text);
}
.se-wbar b { font-family: "Oswald", sans-serif; }
.se-wbar-hot { background: var(--flame-grad); color: #fff; }

.se-formula {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 6px 4px; margin: 16px 0; max-width: 460px;
}
.se-frow {
  display: grid; grid-template-columns: 1.2fr 1fr .9fr; gap: 8px;
  padding: 9px 16px; font-variant-numeric: tabular-nums;
}
.se-frow span:nth-child(2) { color: var(--muted); text-align: center; }
.se-frow span:last-child { text-align: right; font-family: "Oswald", sans-serif; }
.se-ftotal { border-top: 1px solid var(--line); margin-top: 2px; }
.se-ftotal span:last-child { color: var(--ember); }

.se-steps { margin: 14px 0 14px 4px; padding-left: 22px; display: grid; gap: 11px; }
.se-steps li { line-height: 1.45; }
.se-steps li::marker { color: var(--ember); font-family: "Oswald", sans-serif; font-weight: 700; }

.se-sheet-meta {
  display: flex; flex-wrap: wrap; gap: 22px; margin: 14px 0;
  padding: 14px 18px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
}
.se-sheet-meta b { font-family: "Oswald", sans-serif; font-size: 1.05rem; }
.se-sheet { font-variant-numeric: tabular-nums; }
.se-sheet tfoot th { background: var(--bg-3); font-family: "Oswald", sans-serif; }
.se-sheet tfoot th:last-child { color: var(--ember); text-align: right; }
.se-dropped td { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(255,255,255,.3); }
.se-drop-tag {
  display: inline-block; text-decoration: none; font-size: .62rem; letter-spacing: 1px;
  text-transform: uppercase; color: var(--err); border: 1px solid var(--err); border-radius: 999px;
  padding: 0 7px; margin-left: 4px; vertical-align: middle;
}

.se-faq { display: grid; gap: 8px; margin: 14px 0; }
.se-faq details {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 2px 16px;
}
.se-faq summary {
  cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.se-faq summary::after { content: "+"; color: var(--ember); font-family: "Oswald", sans-serif; font-size: 1.3rem; }
.se-faq details[open] summary::after { content: "\2013"; }
.se-faq summary::-webkit-details-marker { display: none; }
.se-faq details p { padding: 0 0 14px; color: var(--muted); line-height: 1.5; }

.se-glossary {
  display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 14px 0;
}
.se-glossary dt { font-family: "Oswald", sans-serif; font-weight: 600; color: var(--ember-2); }
.se-glossary dd { margin: 0; color: var(--muted); line-height: 1.45; }

.se-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 8px; }
.se-foot { margin-top: 22px; }

@media (max-width: 560px) {
  .se-glossary { grid-template-columns: 1fr; gap: 2px 0; }
  .se-glossary dd { margin-bottom: 10px; }
  .se-frow { grid-template-columns: 1fr .8fr .8fr; padding: 8px 12px; font-size: .9rem; }
  .se-wrow { grid-template-columns: 84px 1fr; }
}

/* ---- Share ("share your result") -------------------------------------- */
/* compact icon variant that rides in the corner of a stat card */
.share-btn-compact {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 30px; height: 30px; padding: 0; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .95rem; border-radius: 9px;
  background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--muted);
  opacity: 0; transition: opacity .15s, background .15s, color .15s, border-color .15s;
}
.stat-card:hover .share-btn-compact,
.share-btn-compact:focus-visible { opacity: 1; }
.share-btn-compact:hover { background: rgba(255,90,31,.16); border-color: rgba(255,90,31,.5); color: var(--text); }
/* touch devices have no hover — keep the icon visible so it stays reachable */
@media (hover: none) { .share-btn-compact { opacity: .7; } }

/* the share sheet */
dialog.share-modal {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 18px; padding: 24px 26px 20px; max-width: min(560px, 94vw); width: 100%;
  box-shadow: 0 30px 90px rgba(0,0,0,.65);
}
dialog.share-modal::backdrop {
  background: rgba(6,6,8,.7); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.share-modal .share-close {
  position: absolute; top: 12px; right: 14px; background: none; border: 0; cursor: pointer;
  color: var(--muted); font-size: 1.1rem; line-height: 1; padding: 6px;
}
.share-modal .share-close:hover { color: var(--text); }
.share-heading { font-size: 1.25rem; margin: 0 0 14px; }
.share-preview {
  border-radius: 12px; overflow: hidden; border: 1px solid var(--line);
  background: var(--bg); aspect-ratio: 1200 / 630; display: flex; align-items: center; justify-content: center;
}
.share-preview img { display: block; width: 100%; height: auto; }
.share-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 4px; }
.share-actions .btn { font-size: .8rem; padding: 9px 16px; }
.share-note { margin-top: 8px; }

@media (max-width: 560px) {
  .share-actions .btn { flex: 1 1 auto; justify-content: center; }
}

