/* ===========================================================================
   Coaches Lab — dark, professional, mobile-first theme.
   Job types are constant everywhere: Ball = red, Bag = blue, Backup = green.
   Category accents are set inline (per scenario/category) so they never read
   as a job color. Designed dark-first; tuned for coaches on a phone in a dugout
   and kids studying on a tablet.
   =========================================================================== */
:root {
  /* job types — brightened for a dark canvas */
  --ball:   #ff5168;
  --bag:    #4aa3ff;
  --backup: #34d27f;
  --gold:   #ffc94d;

  /* surfaces & ink */
  --bg:        #0b1220;
  --surface:   #131c2c;
  --surface-2: #1a2436;
  --surface-3: #223048;
  --line:        rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.17);
  --ink:       #eaf0f7;
  --ink-soft:  #93a1b5;
  --ink-faint: #7e8da3;
  --ink-on-color: #0b1220; /* dark ink for text sitting on bright accent fills */

  /* brand */
  --brand-1: #2f6df6;
  --brand-2: #19c7d6;
  --brand-grad: linear-gradient(115deg, var(--brand-1), var(--brand-2));
  /* filled components need the gradient to stay dark enough for white text */
  --brand-grad-strong: linear-gradient(115deg, #2f6df6, #2389e8);

  --radius:  16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --radius-pill: 999px;
  --text-2xs: 0.72rem; /* floor for micro-labels — nothing renders below ~11.5px */
  --shadow:      0 6px 18px rgba(0, 0, 0, 0.22);
  --shadow-lift: 0 14px 34px rgba(0, 0, 0, 0.4);
  --ring: 0 0 0 1px var(--line);

  --font:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Space Grotesk', 'Inter', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Fixed atmosphere layers — compositor-friendly (background-attachment: fixed janks mobile scroll). */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 620px at 84% -8%, rgba(25, 199, 214, 0.16), transparent 60%),
    radial-gradient(1000px 560px at -8% -4%, rgba(47, 109, 246, 0.22), transparent 58%),
    radial-gradient(1200px 800px at 50% 115%, rgba(52, 210, 127, 0.06), transparent 65%);
}
/* Faint field-diagram watermark in the top-right corner. */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.04;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpolygon points='500,880 720,660 500,440 280,660'/%3E%3Cline x1='500' y1='880' x2='960' y2='420'/%3E%3Cline x1='500' y1='880' x2='40' y2='420'/%3E%3Cpath d='M40,420 A480 480 0 0 1 960,420'/%3E%3Ccircle cx='500' cy='660' r='30'/%3E%3C/g%3E%3C/svg%3E") no-repeat right -160px top -120px / 880px;
}
.wrap { width: min(1200px, 92vw); margin: 0 auto; }
a { color: #7fc0ff; text-decoration: none; }
h1, h2, h3 { letter-spacing: -0.01em; }
img, svg { max-width: 100%; }

/* job color text helpers */
.job-ball   { color: var(--ball); }
.job-bag    { color: var(--bag); }
.job-backup { color: var(--backup); }

:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; }

/* Visually hidden but available to screen readers. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* -------------------------------------------------------------- header */
.site-header {
  background: rgba(11, 18, 32, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; gap: 1rem 1.5rem; padding: 0.75rem 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 1.4rem; letter-spacing: -0.02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; }
.brand-mark svg { display: block; }
.brand-text b { color: var(--brand-2); }
.top-nav { display: flex; gap: 0.2rem; margin-left: auto; }
.top-nav a { color: var(--ink-soft); font-weight: 600; font-size: 0.95rem; padding: 0.4rem 0.75rem; border-radius: var(--radius-xs); transition: color 0.14s ease, background-color 0.14s ease; min-height: 44px; display: inline-flex; align-items: center; }
.top-nav a.is-active { color: #fff; background: var(--surface-3); }

/* Slim non-sticky strip under the header — keeps the sticky bar one stable row. */
.golden-strip { background: var(--surface); border-bottom: none; padding: 0.45rem 0; position: relative; }
.golden-strip::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--ball), var(--bag) 50%, var(--backup)); opacity: 0.5; }
.golden-strip .wrap { display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; }
.gr-label { font-family: var(--display); font-weight: 700; font-size: var(--text-2xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; }
.gr-text { font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); }
.gr-text b { padding: 0 0.12em; font-weight: 800; }

main.wrap { padding: 1.6rem 0 3rem; }

/* -------------------------------------------------------------- hero */
.hero { text-align: center; padding: 1.6rem 0 0.6rem; }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(1.85rem, 6vw, 3.1rem); line-height: 1.06; margin: 0.2rem auto 0.6rem; max-width: 24ch; text-wrap: balance; }
.hero h1 .accent, .home-hero h1 .accent { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { color: var(--ink-soft); font-size: clamp(1rem, 2.5vw, 1.12rem); max-width: 640px; margin: 0 auto 1.3rem; }

.progress-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.2rem; max-width: 540px; margin: 0 auto; }
.progress-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; gap: 0.5rem; }
.progress-label { font-weight: 700; color: var(--ink); }
.progress-label #studied-count { color: var(--backup); font-weight: 800; }
.progress-bar { height: 12px; background: var(--surface-3); border-radius: 99px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line), inset 0 2px 4px rgba(0, 0, 0, 0.35); }
.progress-fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--backup), #36c97e); transition: width 0.55s cubic-bezier(.4,0,.2,1); }

/* -------------------------------------------------------------- recently viewed */
.section-title { font-family: var(--display); font-weight: 700; font-size: clamp(1.4rem, 1.15rem + 1.1vw, 1.75rem); letter-spacing: -0.02em; line-height: 1.15; margin: 1.8rem 0 0.85rem; color: var(--ink); }
.calc-content .section-title { margin-top: 3rem; }
.detail-grid .section-title { margin-top: 2.2rem; }
.detail-grid .section-title:first-child { margin-top: 0.35rem; }
.section-sub { color: var(--ink-faint); font-weight: 500; }
.recent-row { margin-top: 1.8rem; }
.recent-cards { display: flex; gap: 0.7rem; overflow-x: auto; padding-bottom: 0.5rem; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.recent-card { flex: 0 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 0.7rem 0.95rem; min-width: 200px; border-left: 4px solid var(--badge-color, #888); transition: transform 0.15s ease, border-color 0.15s ease; scroll-snap-align: start; }
/* Returning visitors (html.has-recent, set pre-paint) get the row reserved immediately
   so populating it never shifts the grid. */
html.has-recent .recent-row[hidden] { display: block; }
html.has-recent .recent-cards { min-height: 76px; }
.recent-badge { display: block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--badge-color, var(--ink-soft)); }
.recent-title { display: block; font-weight: 700; color: var(--ink); margin-top: 0.25rem; line-height: 1.25; }

/* -------------------------------------------------------------- filters */
.controls { margin: 1.6rem 0 1rem; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft);
  min-height: 44px; padding: 0.5rem 0.95rem; border-radius: var(--radius-pill); font-family: var(--font); font-weight: 700; font-size: 0.9rem;
  cursor: pointer; transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; white-space: nowrap; display: inline-flex; align-items: center; gap: 0.45rem;
}
.chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--chip-color, var(--ink-faint)); flex: 0 0 auto; }
.chip[data-filter="all"]::before, .chip-fav::before { display: none; }
.chip.is-active { background: var(--chip-color, var(--brand-1)); border-color: var(--chip-color, var(--brand-1)); color: var(--ink-on-color); }
.chip.is-active[data-filter="all"] { color: #fff; }
.chip.is-active::before { background: rgba(11, 18, 32, 0.55); }
.chip-fav.is-active { background: var(--gold); border-color: var(--gold); color: #4a3600; }

/* -------------------------------------------------------------- card grid */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; }
.play-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; overflow: hidden; }
.play-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--badge-color, transparent); }
.card-link { display: block; padding: 1.05rem 1.1rem 1.05rem 1.25rem; color: inherit; height: 100%; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.badge { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-on-color); background: var(--badge-color, #888); padding: 0.28rem 0.62rem; border-radius: var(--radius-pill); white-space: nowrap; }
.studied-tick { opacity: 0; color: var(--backup); font-weight: 800; font-size: 1.15rem; transition: opacity 0.2s; }
.play-card.is-studied .studied-tick { opacity: 1; }
.play-card.is-studied { border-color: rgba(52, 210, 127, 0.5); box-shadow: 0 0 0 1px rgba(52, 210, 127, 0.45), var(--shadow); }
.card-title { font-family: var(--display); font-weight: 600; font-size: 1.12rem; margin: 0.7rem 0 0.3rem; line-height: 1.18; color: var(--ink); }
.card-key { font-weight: 700; color: var(--brand-2); font-size: 0.88rem; margin: 0 0 0.55rem; font-family: var(--font); }
.card-desc { color: var(--ink-soft); font-size: 0.9rem; margin: 0 0 0.85rem; line-height: 1.45; }
.card-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; padding-right: 56px; min-height: 44px; align-items: center; }
.meta-pill { font-size: 0.74rem; font-weight: 600; color: var(--ink-soft); background: var(--surface-2); border: 1px solid var(--line); padding: 0.22rem 0.55rem; border-radius: var(--radius-pill); }
.fav-btn { position: absolute; bottom: 0.85rem; right: 0.7rem; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink-faint); width: 44px; height: 44px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease; line-height: 1; z-index: 2; }
.play-card.is-fav .fav-btn { color: var(--gold); border-color: var(--gold); background: rgba(255, 201, 77, 0.14); }

.empty-state { text-align: center; color: var(--ink-soft); font-weight: 600; padding: 2.5rem 1rem; }
.alert-error { background: rgba(255, 81, 104, 0.12); color: #ff97a6; border: 1px solid rgba(255, 81, 104, 0.4); padding: 0.9rem 1.1rem; border-radius: var(--radius-sm); margin: 1rem 0; font-weight: 600; }
.alert-error a { color: #fff; text-decoration: underline; }

/* -------------------------------------------------------------- detail page */
.breadcrumb { margin: 0.3rem 0 1rem; font-weight: 600; }
.breadcrumb a { color: var(--ink-soft); }
.detail-head { display: flex; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap; align-items: flex-start; margin-bottom: 1.4rem; }
.detail-head-main { min-width: 0; }
.detail-head h1 { font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 5vw, 2.3rem); margin: 0.55rem 0 0.3rem; line-height: 1.1; }
.detail-key { font-weight: 700; color: var(--brand-2); font-size: 1rem; margin: 0 0 0.45rem; }
.detail-desc { color: var(--ink-soft); max-width: 660px; margin: 0; line-height: 1.55; }
.detail-head-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.btn { border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); padding: 0.62rem 1.05rem; border-radius: var(--radius-sm); font-family: var(--font); font-weight: 700; cursor: pointer; transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; font-size: 0.94rem; line-height: 1; display: inline-flex; align-items: center; gap: 0.4rem; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-ghost { background: var(--surface); }
.btn-primary { background: var(--brand-grad-strong); color: #fff; border-color: rgba(255, 255, 255, 0.16); }
.btn-watch { font-size: 1.02rem; padding: 0.75rem 1.3rem; min-width: 12.5rem; justify-content: center; }
.btn-primary.btn-watch {
  padding: 0.85rem 1.5rem; border-radius: var(--radius-sm); border: none; color: #fff;
  background: var(--brand-grad-strong);
  box-shadow: 0 10px 28px rgba(47, 109, 246, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-studied.is-on { background: var(--backup); border-color: var(--backup); color: #042b16; }
.btn-fav.is-on { background: var(--gold); border-color: var(--gold); color: #4a3600; }
.btn-ghost.btn-sm { color: var(--ink-soft); }

.detail-grid { display: grid; grid-template-columns: 1fr; gap: 1.3rem; align-items: start; }

/* field panel */
.field-shell { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0.75rem; }
.field-mount svg { width: 100%; height: auto; display: block; border-radius: 12px; }
.field-mount text { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: -0.5px; fill: var(--ink-on-color); pointer-events: none; }

.fielder { cursor: pointer; transition: opacity 0.2s ease; }
.fielder .fielder-dot { transition: transform 0.2s ease; }
.fielder.is-on .fielder-dot { stroke: var(--gold); stroke-width: 7; filter: drop-shadow(0 0 9px rgba(255, 201, 77, 0.95)); }
.field-mount.has-highlight .fielder:not(.is-on) { opacity: 0.26; }

.arrow { stroke-width: 4.5; stroke-dasharray: 3 11; stroke-linecap: round; opacity: 0.85; fill: none; transition: opacity 0.2s ease, stroke-width 0.2s ease; }
.arrow.is-on { opacity: 1; stroke-width: 8; stroke-dasharray: none; }
.field-mount.has-highlight .arrow:not(.is-on) { opacity: 0.07; }
.field-mount.has-highlight .arrow-halo { opacity: 0.05; }

.runner-path { stroke-width: 5; stroke-dasharray: 3 10; stroke-linecap: round; opacity: 0.75; }
.runner circle { transition: opacity 0.2s; }
.base { fill: #f4ead4; stroke: #c9a464; stroke-width: 2; }
.home-plate { fill: #ffffff; }

.anim-controls { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; margin: 0.9rem 0 0.8rem; }
.speed-control { display: flex; align-items: center; gap: 0.3rem; margin-left: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.25rem; }
.speed-label { font-weight: 600; font-size: 0.78rem; color: var(--ink-soft); padding: 0 0.35rem; }
.speed-btn { border: none; background: transparent; font-family: var(--font); font-weight: 700; font-size: 0.84rem; min-height: 38px; padding: 0.34rem 0.62rem; border-radius: var(--radius-xs); cursor: pointer; color: var(--ink-soft); transition: color 0.12s ease, background-color 0.12s ease; }
.speed-btn.is-active { background: var(--brand-1); color: #fff; }

.step-tracker { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0.95rem 1.05rem; display: flex; align-items: center; gap: 1rem; }
.step-count { font-family: var(--display); font-weight: 700; font-size: 1.35rem; background: var(--brand-grad-strong); color: #fff; border-radius: var(--radius-sm); padding: 0.35rem 0.7rem; white-space: nowrap; min-width: 64px; text-align: center; }
.step-label { margin: 0; font-weight: 600; color: var(--ink-soft); min-height: 2.9em; }
.step-label b { color: var(--ink); }

/* info panel */
.callout { background: linear-gradient(160deg, rgba(255, 201, 77, 0.16), rgba(255, 201, 77, 0.03)); border: 1px solid rgba(255, 201, 77, 0.45); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.callout-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.45rem; flex-wrap: wrap; }
.callout-pos { font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.callout-jobtag { color: var(--ink-on-color); font-weight: 800; font-size: 0.72rem; padding: 0.22rem 0.6rem; border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: 0.04em; }
.callout-instruction { margin: 0; font-weight: 500; color: var(--ink); }

.legend { display: flex; gap: 1rem; flex-wrap: wrap; margin: -0.3rem 0 0.85rem; }
.legend-item { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; font-size: 0.84rem; color: var(--ink-soft); }
.dot { width: 13px; height: 13px; border-radius: 50%; display: inline-block; }

.job-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.55rem; }
.job-row { display: flex; width: 100%; text-align: left; font: inherit; color: inherit; gap: 0.8rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.7rem 0.85rem; cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; }
.job-row.is-active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 201, 77, 0.4); background: rgba(255, 201, 77, 0.06); }
.job-pos { flex: 0 0 auto; width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--job-color, #888); color: var(--ink-on-color); font-family: var(--display); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 0.92rem; }
.job-body { flex: 1; min-width: 0; }
.job-row-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.job-name { font-weight: 700; color: var(--ink); }
.job-chip { font-size: var(--text-2xs); font-weight: 800; color: var(--ink-on-color); background: var(--job-color, #888); padding: 0.17rem 0.5rem; border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.job-instruction { display: block; margin: 0.28rem 0 0; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.45; font-weight: 400; }

.coaching { display: grid; gap: 0.7rem; }
.coach-card { border-radius: var(--radius-sm); padding: 0.85rem 1rem; border-left: 4px solid var(--c, var(--brand-1)); background: var(--surface); border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.coach-point { --c: var(--ball); }
.coach-drill { --c: var(--bag); }
.coach-watch { --c: var(--backup); }
.coach-tag { display: block; font-family: var(--display); font-weight: 700; font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: 0.12em; color: var(--c); margin-bottom: 0.25rem; }
.coach-card p { margin: 0; font-weight: 500; color: var(--ink); }

/* -------------------------------------------------------------- footer */
.site-footer { margin-top: 2.5rem; padding: 1.8rem 0; color: var(--ink-soft); border-top: 1px solid var(--line); background: rgba(11, 18, 32, 0.6); }
.site-footer p { margin: 0; font-weight: 500; line-height: 1.6; }
.footer-note { color: var(--ink-faint); font-size: 0.88rem; }

/* -------------------------------------------------------------- printables (print.php) */
.print-intro { text-align: center; padding: 1.4rem 0 0.4rem; }
.print-intro h1 { font-family: var(--display); font-weight: 700; font-size: clamp(1.7rem, 5vw, 2.6rem); margin: 0.2rem 0 0.5rem; }
.print-intro p { color: var(--ink-soft); max-width: 640px; margin: 0 auto; font-size: 1.05rem; }

.print-toolbar { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin: 1.2rem 0 1.4rem; padding: 0.9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.print-toolbar .spacer { flex: 1; }
.print-toolbar .tb-title { font-family: var(--display); font-weight: 600; font-size: 1.05rem; }

.print-menu-section { margin: 1.8rem 0; }
.print-grid { display: grid; gap: 0.7rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.print-tile { display: flex; flex-direction: column; gap: 0.25rem; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--tile-color, var(--brand-1)); border-radius: var(--radius-sm); padding: 0.85rem 0.95rem; color: var(--ink); transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; }
.print-tile .pt-big { font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
.print-tile .pt-sub { color: var(--ink-soft); font-size: 0.82rem; }
.print-tile-wide { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }

/* a printed sheet (screen preview + paper) */
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; margin-bottom: 1.4rem; box-shadow: var(--shadow); }
.sheet-head { display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.sheet-head h2 { font-family: var(--display); font-weight: 700; font-size: 1.4rem; margin: 0; }
.sheet-sit { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.3rem 0 0.7rem; }
.sheet-desc { color: var(--ink-soft); margin: 0 0 1rem; line-height: 1.5; }
.sheet-key { font-weight: 700; color: var(--brand-2); }
.sheet-grid { display: grid; grid-template-columns: 1fr; gap: 1.1rem; align-items: start; }
.static-field-svg { width: 100%; height: auto; display: block; border-radius: var(--radius-sm); background: #236626; }
.static-field-svg text { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: -0.5px; fill: var(--ink-on-color); }

/* position study card rows */
.pos-hero { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.pos-badge { width: 64px; height: 64px; border-radius: var(--radius); background: var(--brand-grad-strong); color: #fff; font-family: var(--display); font-weight: 700; font-size: 1.5rem; display: grid; place-items: center; flex: 0 0 auto; }
.pos-hero h1 { font-family: var(--display); font-weight: 700; margin: 0; font-size: clamp(1.4rem, 4vw, 2rem); }
.pos-hero p { margin: 0.1rem 0 0; color: var(--ink-soft); }
.pos-cat-head { font-family: var(--display); font-weight: 600; font-size: 1.05rem; color: var(--ink); margin: 1.3rem 0 0.6rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 0.5rem; }
.pos-cat-head .cat-dot { width: 11px; height: 11px; border-radius: 50%; }
.pos-row { display: grid; grid-template-columns: auto 1fr; gap: 0.7rem 0.9rem; align-items: start; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.pos-row:last-child { border-bottom: none; }
.pos-row .job-chip { align-self: start; }
.pos-row-main { min-width: 0; }
.pos-row-title { font-weight: 700; color: var(--ink); }
.pos-row-sit { color: var(--ink-faint); font-size: 0.82rem; font-weight: 600; }
.pos-row-instr { color: var(--ink-soft); margin: 0.2rem 0 0; line-height: 1.45; }

.legend-print { display: flex; gap: 1.1rem; flex-wrap: wrap; margin: 0.4rem 0 0; }

@media (min-width: 900px) {
  .sheet-grid { grid-template-columns: 0.92fr 1.08fr; gap: 1.4rem; }
}

/* Hover affordances only on devices that actually hover — no sticky states on touch. */
@media (hover: hover) {
  a:hover { color: #a6d4ff; }
  .top-nav a:hover { color: var(--ink); background: var(--surface-2); }
  .chip:hover { color: var(--ink); border-color: var(--chip-color, var(--brand-2)); }
  .play-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); }
  .recent-card:hover { transform: translateY(-3px); }
  .fav-btn:hover { border-color: var(--gold); color: var(--gold); }
  .btn:hover { background: var(--surface-3); border-color: var(--line-strong); }
  .btn-primary:hover { background: var(--brand-grad-strong); filter: brightness(1.12); }
  .btn-primary.btn-watch:hover { box-shadow: 0 14px 36px rgba(47, 109, 246, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.22); transform: translateY(-1px); filter: none; }
  .speed-btn:hover { color: var(--ink); }
  .job-row:hover { border-color: var(--job-color, var(--brand-2)); background: var(--surface-2); }
  .print-tile:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
  .breadcrumb a:hover { color: var(--ink); }
}

/* -------------------------------------------------------------- responsive */
@media (min-width: 900px) {
  .detail-grid { grid-template-columns: 1.05fr 0.95fr; gap: 1.6rem; }
}
/* One boundary for the whole single-column range (phones + tablets) so touch
   ergonomics apply everywhere the layout is stacked. */
@media (max-width: 899.98px) {
  .wrap { width: 94vw; }
  main.wrap { padding: 1.1rem 0 2.5rem; }
  .header-inner { gap: 0.6rem; padding: 0.6rem 0; }
  .brand { font-size: 1.25rem; }
  /* Let the filter bar scroll horizontally instead of stacking tall on phones */
  .filter-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.5rem; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .filter-bar::-webkit-scrollbar { display: none; }
  .detail-head-actions { width: 100%; }
  .detail-head-actions .btn { flex: 1 1 auto; justify-content: center; }
  .anim-controls { gap: 0.5rem; }
  .btn-watch { flex: 1 1 100%; justify-content: center; }
  .speed-control { margin-left: 0; width: 100%; justify-content: space-between; }
  .speed-btn { flex: 1; }
  .card-grid { grid-template-columns: 1fr; }
}

/* respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* -------------------------------------------------------------- print (all pages) */
@media print {
  /* Darken the palette once — every var-based color prints legibly on white. */
  :root {
    --ink: #111; --ink-soft: #333; --ink-faint: #555;
    --ball: #b3243a; --bag: #1a5fb4; --backup: #177a4a;
    --brand-2: #0a6c74; --gold: #a97a12;
  }
  @page { margin: 12mm; }
  body { background: #fff; color: #111; }
  body::before, body::after { display: none; }

  .no-print, .site-header, .site-footer, .golden-strip, .anim-controls, .step-tracker,
  .callout, .breadcrumb, .detail-head-actions, #ball { display: none !important; }
  /* Arrows and the legend are hidden only on the play-page cheat sheet;
     booklet diagrams keep them — they are the teaching content. */
  .page-detail .legend { display: none !important; }
  .page-detail .field-mount .arrow, .page-detail .field-mount .arrow-halo { display: none !important; }
  main.wrap { padding: 0; }

  .sheet, .static-field-svg, .field-shell, .job-row, .coach-card { box-shadow: none; }
  .sheet { border: 1px solid #bbb; background: #fff; break-inside: avoid; page-break-inside: avoid; margin-bottom: 0; }
  .sheet + .sheet { page-break-before: always; }
  .field-shell, .job-row, .coach-card { border: 1px solid #ccc; background: #fff; }
  .sheet-head h2, .pos-row-title, .pos-hero h1, .pos-cat-head,
  .job-name, .coach-card p, .detail-head h1, .card-title { color: #111; }
  .sheet-desc, .pos-row-instr, .job-instruction { color: #333; }
  .pos-badge { background: #222 !important; }
  .static-field-svg, .badge, .job-chip, .meta-pill, .cat-dot, .pos-badge, .job-pos, .dot,
  .fielder-dot, .arrow { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .pos-page { page-break-after: always; }
  .pos-row, .job-row, .coach-card { break-inside: avoid; page-break-inside: avoid; }
  .pos-cat-head, .section-title { break-after: avoid; page-break-after: avoid; }
  .play-card, .field-mount svg { break-inside: avoid; }

  .detail-grid { grid-template-columns: 0.85fr 1.15fr; gap: 1rem; }
  .detail-head h1 { font-size: 1.4rem; }
  .job-list { gap: 0.3rem; }
  .job-row { padding: 0.35rem 0.5rem; }
  .job-instruction { font-size: 0.82rem; }
  a { color: #000; }
}


/* ==========================================================================
   Landing, tools hub, and calculator pages
   ========================================================================== */

/* --- shared devices: eyebrows, tri-dots, arrow links, section heads --- */
.eyebrow { display: flex; align-items: center; gap: 0.55rem; font-size: var(--text-2xs); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 0.55rem; }
.tri-dot { display: inline-flex; gap: 4px; align-items: center; }
.tri-dot i { width: 7px; height: 7px; border-radius: 50%; }
.tri-dot i:nth-child(1) { background: var(--ball); }
.tri-dot i:nth-child(2) { background: var(--bag); }
.tri-dot i:nth-child(3) { background: var(--backup); }
.link-arrow { font-weight: 700; font-size: 0.95rem; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
.link-arrow span { transition: transform 0.15s ease; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin: 0 0 1.4rem; }
.section-head .section-title { margin: 0; }
.section-head .eyebrow { margin-bottom: 0.5rem; }
.home-tools, .home-how, .home-faq { margin: 4.2rem 0 0; }

/* --- hero --- */
.home-hero { display: grid; grid-template-columns: 1fr; gap: 2.2rem; align-items: center; padding: 1.6rem 0 0; position: relative; }
.home-hero::before { content: ""; position: absolute; top: -20%; left: -12%; width: 640px; height: 520px; border-radius: 50%; background: radial-gradient(closest-side, rgba(47, 109, 246, 0.18), transparent 70%); filter: blur(20px); pointer-events: none; }
.hero-copy { position: relative; }
.home-hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.04; letter-spacing: -0.03em; margin: 0 0 1rem; max-width: 16ch; }
.home-hero .hero-sub { color: var(--ink-soft); font-size: clamp(1rem, 1.6vw, 1.13rem); line-height: 1.65; max-width: 48ch; margin: 0 0 1.7rem; }
.hero-ctas { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.hero-field { position: relative; display: block; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lift); }
.hero-field .field-mount { display: block; }
.hero-field .static-field-svg { border-radius: 0; }
.hero-field .arrow, .hero-field .arrow-halo { animation: heroMarch 1.4s linear infinite; }
.hero-field .runner-path { animation: heroMarch 2s linear infinite; }
@keyframes heroMarch { to { stroke-dashoffset: -28; } }
@media (prefers-reduced-motion: reduce) { .hero-field .arrow, .hero-field .arrow-halo, .hero-field .runner-path { animation: none; } }
.hero-field-tag svg { vertical-align: -1px; margin-right: 0.15rem; }
.hero-field-tag {
  position: absolute; left: 0.85rem; bottom: 0.85rem;
  background: rgba(11, 18, 32, 0.78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--line-strong); color: var(--ink); font-weight: 700; font-size: 0.8rem;
  padding: 0.35rem 0.75rem; border-radius: var(--radius-pill);
}
@media (min-width: 900px) {
  .home-hero { grid-template-columns: 1.04fr 0.96fr; gap: 3.2rem; padding: 2.8rem 0 0.6rem; }
}

/* --- golden rule statement band --- */
.rule-band { margin: 4.2rem 0 0; text-align: center; }
.rule-line { display: flex; gap: 6px; width: 132px; margin: 0 auto 1.15rem; }
.rule-line i { height: 3px; flex: 1; border-radius: var(--radius-pill); }
.rule-line i:nth-child(1) { background: var(--ball); }
.rule-line i:nth-child(2) { background: var(--bag); }
.rule-line i:nth-child(3) { background: var(--backup); }
.rule-text { font-family: var(--display); font-weight: 600; font-size: clamp(1.3rem, 3.2vw, 2rem); letter-spacing: -0.02em; line-height: 1.28; margin: 0 auto; max-width: 30ch; }
.rule-tail { display: block; font-size: 0.72em; font-weight: 500; color: var(--ink-soft); margin-top: 0.35rem; letter-spacing: 0; }

/* --- tool cards --- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 0.9rem; }
@media (min-width: 1000px) { .tool-grid { grid-template-columns: repeat(3, 1fr); } }
.tool-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 0.45rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.2rem 1.05rem; color: var(--ink); transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease; }
a.tool-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--tile-color, var(--brand-2)); }
.tool-card-name { font-family: var(--display); font-weight: 600; font-size: 1.06rem; line-height: 1.3; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.tool-card-desc { color: var(--ink-soft); font-size: 0.89rem; line-height: 1.55; }
.tool-card-cta { margin-top: auto; padding-top: 0.7rem; font-weight: 700; font-size: 0.85rem; color: var(--brand-2); display: inline-flex; align-items: center; gap: 0.3rem; }
.tool-card-cta span { transition: transform 0.15s ease; }
.tool-card.is-soon { border-style: dashed; background: transparent; }
.tool-card.is-soon .tool-card-name { color: var(--ink-soft); }
.tool-card.is-soon .tool-card-desc { color: var(--ink-faint); }
.soon-tag { font-size: var(--text-2xs); font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-faint); border: 1px solid var(--line-strong); border-radius: var(--radius-pill); padding: 0.16rem 0.5rem; }

/* --- workflow steps --- */
.how-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.8rem; }
.how-step { border-top: 2px solid var(--step-c, var(--line-strong)); padding-top: 1.05rem; }
.how-num { font-family: var(--display); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.1em; color: var(--step-c, var(--brand-2)); display: block; margin-bottom: 0.45rem; }
.how-step h3 { font-family: var(--display); font-weight: 600; font-size: 1.08rem; letter-spacing: -0.01em; margin: 0 0 0.35rem; }
.how-step p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; line-height: 1.6; }

/* --- FAQ --- */
.faq-grid { display: grid; grid-template-columns: 1fr; column-gap: 3rem; }
@media (min-width: 820px) { .faq-grid { grid-template-columns: 1fr 1fr; } }
.faq-item { border-top: 1px solid var(--line); }
.faq-item summary { cursor: pointer; font-weight: 700; padding: 0.95rem 1.8rem 0.95rem 0; list-style: none; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 0.2rem; top: 50%; transform: translateY(-50%); color: var(--ink-faint); font-weight: 600; font-size: 1.25rem; transition: transform 0.18s ease; }
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item p { margin: 0; padding: 0 0 1.05rem; color: var(--ink-soft); line-height: 1.65; }

/* --- footer --- */
.site-footer { margin-top: 4.5rem; padding: 2.1rem 0 2.5rem; color: var(--ink-soft); border-top: 1px solid var(--line); background: transparent; }
.footer-inner { display: grid; grid-template-columns: 1fr; gap: 1.7rem; }
@media (min-width: 720px) { .footer-inner { grid-template-columns: 1.5fr 1fr 1fr; } }
.footer-brand { margin: 0 0 0.4rem; font-weight: 500; }
.footer-note { display: flex; align-items: center; gap: 0.55rem; color: var(--ink-faint); font-size: 0.88rem; margin: 0; }
.footer-head { display: block; font-size: var(--text-2xs); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.55rem; }
.footer-links { display: flex; flex-direction: column; gap: 0.4rem; }
.footer-links a { color: var(--ink-soft); font-weight: 600; font-size: 0.9rem; }

/* --- landing hover states --- */
@media (hover: hover) {
  .link-arrow:hover { color: var(--ink); }
  .link-arrow:hover span { transform: translateX(3px); }
  a.tool-card:hover { transform: translateY(-3px); border-color: rgba(74, 163, 255, 0.45); background: var(--surface-2); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(74, 163, 255, 0.25); }
  a.tool-card:hover .tool-card-cta span { transform: translateX(3px); }
  a.hero-field:hover { border-color: var(--brand-2); }
  a.hero-field:hover .hero-field-tag { background: var(--brand-2); color: #04222a; border-color: transparent; }
  .footer-links a:hover { color: var(--ink); }
}

/* --- calculator pages --- */
.calc-intro { padding: 1.4rem 0 0.4rem; max-width: 800px; }
.calc-intro h1 { font-family: var(--display); font-weight: 700; font-size: clamp(1.7rem, 5vw, 2.6rem); letter-spacing: -0.025em; margin: 0.2rem 0 0.5rem; }
.calc-intro p { color: var(--ink-soft); font-size: 1.05rem; line-height: 1.6; }
.callout-info { background: rgba(47, 109, 246, 0.1); border: 1px solid rgba(47, 109, 246, 0.4); border-radius: var(--radius-sm); padding: 0.85rem 1.05rem; margin: 1rem 0; color: var(--ink); line-height: 1.55; }
.calc-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem 1.4rem; margin: 1.2rem 0 1.6rem; }
.calc-fields { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: flex-end; }
.calc-field { display: flex; flex-direction: column; gap: 0.35rem; }
.calc-field label, .calc-field legend { font-weight: 700; font-size: 0.85rem; color: var(--ink-soft); }
.calc-field input[type="date"], .calc-field select {
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink);
  border-radius: var(--radius-xs); padding: 0.55rem 0.7rem; font-family: var(--font); font-size: 1rem; min-height: 44px;
  color-scheme: dark;
}
.calc-sport { border: none; margin: 0; padding: 0; display: flex; flex-direction: row; gap: 0.4rem; align-items: center; }
.calc-sport legend { margin-bottom: 0.35rem; }
.calc-field select {
  -webkit-appearance: none; appearance: none; padding-right: 2.3rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2393a1b5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.8rem center;
}
.calc-field input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0.55; cursor: pointer; }
.calc-field input[type="date"]:hover::-webkit-calendar-picker-indicator { opacity: 0.9; }
.radio-pill { position: relative; display: inline-flex; align-items: center; gap: 0.45rem; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-pill); padding: 0.5rem 0.9rem; font-weight: 700; font-size: 0.9rem; cursor: pointer; min-height: 44px; }
.radio-pill:has(input:checked) { background: var(--brand-1); border-color: var(--brand-1); color: #fff; }
.radio-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.radio-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--ink-faint); flex: 0 0 auto; transition: border-color 0.15s ease, background-color 0.15s ease; }
.radio-pill:has(input:checked)::before { border-color: #fff; background: #fff; }
.radio-pill:has(input:focus-visible) { outline: 3px solid var(--brand-2); outline-offset: 2px; }
.age-empty { color: var(--ink-faint); font-weight: 600; margin: 1.1rem 0 0; }
.age-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.8rem; margin-top: 1.2rem; }
.age-card { position: relative; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0.95rem 1.05rem 0.9rem; display: flex; flex-direction: column; gap: 0.2rem; box-shadow: var(--shadow); }
.age-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--brand-grad); }
.age-card:first-child { background: linear-gradient(180deg, rgba(47, 109, 246, 0.12), var(--surface-2)); border-color: rgba(47, 109, 246, 0.45); }
.age-card-org { font-size: var(--text-2xs); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-2); }
.age-card-value { font-family: var(--display); font-weight: 700; font-size: 1.45rem; color: var(--ink); }
.age-card-sub { color: var(--ink-soft); font-size: 0.84rem; line-height: 1.45; }
.age-note { margin: 1.1rem 0 0; }
.calc-content { max-width: 800px; }
.calc-content p { color: var(--ink-soft); line-height: 1.65; }
.calc-content p b { color: var(--ink); }
.calc-list { color: var(--ink-soft); line-height: 1.65; padding-left: 1.2rem; display: grid; gap: 0.5rem; }
.calc-list b { color: var(--ink); }
.calc-table-title { font-family: var(--display); font-weight: 600; font-size: 1.125rem; letter-spacing: -0.01em; color: var(--ink); margin: 2rem 0 0.6rem; }
.page-calc main.wrap { width: min(880px, 92vw); }
.calc-note-sm { font-size: 0.85rem; color: var(--ink-faint); }
.table-scroll { overflow-x: auto; }
.ref-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; font-size: 0.9rem; }
.ref-table th, .ref-table td { text-align: left; padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--line); }
.ref-table thead th { background: var(--surface-2); font-family: var(--display); font-weight: 600; }
.ref-table tbody th { font-weight: 700; color: var(--brand-2); white-space: nowrap; }
.ref-table td { color: var(--ink-soft); }
.ref-table tr:last-child th, .ref-table tr:last-child td { border-bottom: none; }

/* --- hero proof chips, credibility strip, soon strip, closing CTA (landing) --- */
.hero-points { list-style: none; display: flex; gap: 0.5rem 0.55rem; flex-wrap: wrap; padding: 0; margin: 0 0 1.7rem; }
.hero-points li { font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 0.32rem 0.75rem; }
.hero-points li:last-child { color: var(--backup); border-color: rgba(52, 210, 127, 0.35); }

.cred-strip { margin: 3rem 0 0; text-align: center; }
.cred-stats { list-style: none; display: flex; justify-content: center; gap: clamp(1.5rem, 5vw, 4rem); flex-wrap: wrap; margin: 0 0 1rem; padding: 0; }
.cred-stats b { display: block; font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.02em; }
.cred-stats span { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.cred-orgs { color: var(--ink-soft); font-size: 0.88rem; max-width: 62ch; margin: 0 auto; }
.cred-orgs b { color: var(--ink); font-weight: 600; }

.soon-strip { margin: 1rem 0 0; padding: 0.7rem 1.1rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--ink-faint); font-size: 0.86rem; display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }

.home-cta { margin: 4.5rem 0 0; padding: 3rem 1.5rem; text-align: center; background: linear-gradient(180deg, var(--surface) 0%, transparent 100%); border: 1px solid var(--line); border-radius: var(--radius); }
.home-cta h2 { font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 3.4vw, 2.3rem); letter-spacing: -0.02em; margin: 0 0 0.6rem; }
.home-cta p { color: var(--ink-soft); max-width: 44ch; margin: 0 auto 1.6rem; }
.home-cta .hero-ctas { justify-content: center; }
.home-cta .rule-line { display: flex; gap: 6px; width: 132px; margin: 0 auto 1.2rem; }

/* --- mini field thumbnail inside a tool card --- */
.tool-card-thumb { display: block; border-radius: var(--radius-sm); overflow: hidden; margin: -0.35rem -0.35rem 0.6rem; aspect-ratio: 16 / 9; }
.tool-card-thumb .field-mount { display: block; }
.tool-card-thumb svg { width: 100%; height: auto; margin-top: -12%; display: block; }

/* --- mobile ergonomics (spec A16) --- */
@media (max-width: 899.98px) {
  .header-inner { row-gap: 0.15rem; padding: 0.55rem 0; }
  .top-nav { width: 100%; margin-left: 0; gap: 0; justify-content: space-between; }
  .top-nav a { flex: 1; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0.3rem 0.5rem; }
  .filter-bar { margin-inline: -3vw; padding-inline: 3vw; scroll-padding-inline: 3vw; }
  .controls { position: relative; }
  .controls::after { content: ""; position: absolute; top: 0; bottom: 0.5rem; right: -3vw; width: 40px; background: linear-gradient(90deg, transparent, var(--bg)); pointer-events: none; }
  .btn { min-height: 44px; }
  .speed-btn { min-height: 44px; }
  .gr-label { display: none; }
  .golden-strip { padding: 0.4rem 0; }
  .gr-text { font-size: 0.84rem; }
}
@media (max-width: 640px) {
  .hero-ctas { flex-direction: column; align-items: stretch; gap: 0.9rem; }
  .hero-ctas .link-arrow { justify-content: center; display: inline-flex; padding: 0.6rem; }
  .calc-fields { gap: 0.9rem; }
  .calc-field { width: 100%; }
  .calc-field input[type="date"], .calc-field select { width: 100%; }
  .calc-sport { width: 100%; }
  .radio-pill { flex: 1; justify-content: center; }
  .ref-table { font-size: 0.8rem; font-variant-numeric: tabular-nums; }
  .ref-table th, .ref-table td { padding: 0.45rem 0.5rem; white-space: nowrap; }
}

/* ==========================================================================
   Tool pages: pitch count, bat size, field dimensions, practice planner
   ========================================================================== */

/* The hidden attribute must always win, even over classes that set display. */
[hidden] { display: none !important; }

.callout-warn { background: rgba(255, 81, 104, 0.1); border: 1px solid rgba(255, 81, 104, 0.45); border-radius: var(--radius-sm); padding: 0.85rem 1.05rem; margin: 0.8rem 0 0; color: var(--ink); line-height: 1.55; }
.callout-warn b { color: var(--ball); }
.calc-field input[type="number"], .calc-field input[type="time"] {
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink);
  border-radius: var(--radius-sm); padding: 0.55rem 0.7rem; font: inherit; min-height: 44px; width: 8.5rem;
}
.label-opt { color: var(--ink-faint); font-weight: 500; }
.check-row { display: flex; align-items: center; gap: 0.55rem; margin-top: 1rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--brand-1); flex: 0 0 auto; }
.check-row em { font-style: normal; color: var(--ink-faint); font-weight: 500; }

/* --- field dimensions diagram --- */
.dim-diagram { margin-top: 1.4rem; }
.dim-svg { display: block; width: 100%; max-width: 460px; margin: 0 auto; }
.dim-text { fill: var(--ink-soft); font-family: var(--font); font-size: 13px; font-weight: 700; }
.dim-text-ball { fill: var(--ball); }
.dim-text-gold { fill: var(--gold); }

/* --- practice planner --- */
.pp-focus { border: none; margin: 1.1rem 0 0; padding: 0; }
.pp-focus legend { font-weight: 700; font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.45rem; }
.pp-focus-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.pp-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.25rem; }
.pp-plan-head { margin-top: 0.4rem; }
.pp-plan { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.pp-row { display: flex; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--pp-c, var(--brand-1)); border-radius: var(--radius-sm); padding: 0.85rem 1rem; box-shadow: var(--shadow); }
.pp-time { flex: 0 0 auto; min-width: 7.6rem; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.85rem; color: var(--ink-soft); padding-top: 0.2rem; }
.pp-body { flex: 1 1 auto; min-width: 0; }
.pp-row-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.pp-chip { font-size: var(--text-2xs); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--pp-c, var(--brand-2)); border: 1px solid currentColor; border-radius: var(--radius-pill); padding: 0.14rem 0.5rem; }
.pp-name { font-family: var(--display); font-weight: 600; font-size: 1.02rem; }
.pp-dur { color: var(--ink-faint); font-size: 0.8rem; font-weight: 700; }
.pp-swap { margin-left: auto; }
.pp-do { margin: 0.4rem 0 0; color: var(--ink-soft); line-height: 1.55; font-size: 0.92rem; }
.pp-say { margin: 0.45rem 0 0; color: var(--ink); line-height: 1.5; font-size: 0.92rem; }
.pp-say b { color: var(--gold); font-size: var(--text-2xs); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.pp-row-water { border-style: dashed; border-color: rgba(255, 201, 77, 0.5); border-left-style: solid; background: rgba(255, 201, 77, 0.05); box-shadow: none; }
.pp-row-water .pp-do { color: var(--ink); }

/* --- share mode (plays.php) + team study list (share.php) --- */
.share-launch { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.share-hint { color: var(--ink-soft); font-size: 0.88rem; font-weight: 600; }
body.share-mode .fav-btn { display: none; }
body.share-mode .play-card { cursor: pointer; }
body.share-mode main.wrap { padding-bottom: 120px; }
.play-card.is-sel { border-color: var(--brand-2); box-shadow: 0 0 0 2px var(--brand-2), var(--shadow); }
.play-card.is-sel::after { content: "✓ On the list"; position: absolute; bottom: 0.7rem; right: 0.7rem; background: var(--brand-grad-strong); color: #fff; font-size: var(--text-2xs); font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.28rem 0.6rem; border-radius: var(--radius-pill); pointer-events: none; }
.share-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--surface); border-top: 1px solid var(--line-strong); box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45); padding: 0.8rem max(1rem, 3vw) calc(0.8rem + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: center; gap: 0.9rem; flex-wrap: wrap; }
.share-count { font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.share-count b { color: var(--brand-2); font-size: 1.15em; }
.share-count-max { animation: sharePulse 0.35s ease; }
.share-count-max b { color: var(--ball); }
@keyframes sharePulse { 30% { transform: scale(1.12); } }
.share-url { flex: 1 1 220px; max-width: 430px; min-height: 44px; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink-soft); border-radius: var(--radius-sm); padding: 0.5rem 0.7rem; font-size: 0.8rem; font-family: inherit; }
.share-bar-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.share-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-grad-strong); color: #fff; font-size: 0.78rem; font-weight: 800; margin-right: 0.45rem; flex: 0 0 auto; }
.share-foot { margin: 2rem 0 0; }

@media (max-width: 640px) {
  .calc-field input[type="number"], .calc-field input[type="time"] { width: 100%; }
  .pp-row { flex-direction: column; gap: 0.4rem; }
  .pp-time { min-width: 0; padding-top: 0; }
  .pp-swap { min-height: 36px; }
}

/* ==========================================================================
   Phase 3 tools: stats, eligibility board, lineup generator
   ========================================================================== */

.calc-block-title { font-family: var(--display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; margin: 0 0 0.9rem; }
.calc-card + .calc-card { margin-top: 0; }
.calc-field input[type="text"], .calc-field textarea {
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink);
  border-radius: var(--radius-sm); padding: 0.55rem 0.7rem; font: inherit; min-height: 44px;
}
.calc-field textarea { min-height: 8rem; resize: vertical; width: 100%; line-height: 1.6; }
.lu-roster-field { flex: 1 1 320px; max-width: 420px; }

/* --- eligibility board --- */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.8rem; margin-bottom: 2rem; }
.board-card { position: relative; background: var(--surface); border: 1px solid var(--line-strong); border-left: 5px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0.9rem 1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 0.25rem; }
.board-card.is-ok { border-left-color: var(--backup); }
.board-card.is-warn { border-left-color: var(--gold); }
.board-card.is-out { border-left-color: var(--ball); }
.board-name { font-family: var(--display); font-weight: 700; font-size: 1.05rem; display: flex; align-items: baseline; gap: 0.5rem; }
.board-age { font-size: var(--text-2xs); font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.board-status { font-weight: 800; font-size: 0.95rem; }
.is-ok .board-status { color: var(--backup); }
.is-warn .board-status { color: var(--gold); }
.is-out .board-status { color: var(--ball); }
.board-note { margin: 0; color: var(--ink-soft); font-size: 0.84rem; line-height: 1.45; }
.board-remove { align-self: flex-start; margin-top: 0.4rem; }

/* --- lineup generator --- */
.lu-grid-wrap { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .lu-grid-wrap { grid-template-columns: minmax(180px, 0.32fr) 1fr; } }
.lu-order { margin: 0.8rem 0 0; padding-left: 1.6rem; display: grid; gap: 0.3rem; font-weight: 600; }
.lu-order li::marker { color: var(--brand-2); font-weight: 800; }
.lu-table select { width: 100%; min-width: 6.5rem; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); border-radius: var(--radius-xs, 6px); padding: 0.35rem 0.4rem; font: inherit; font-size: 0.85rem; min-height: 38px; }
.lu-table td.lu-cell { padding: 0.3rem 0.35rem; }
.lu-bench-row th, .lu-bench-cell { background: var(--surface-2); }
.lu-bench-cell { font-size: 0.8rem; color: var(--ink-soft); }
.lu-checks { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.lu-check { display: flex; gap: 0.6rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; color: var(--ink-soft); line-height: 1.5; font-size: 0.92rem; }
.lu-check-icon { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 800; margin-top: 0.1rem; }
.lu-ok .lu-check-icon { background: rgba(52, 210, 127, 0.18); color: var(--backup); }
.lu-warn .lu-check-icon { background: rgba(255, 201, 77, 0.18); color: var(--gold); }
.lu-fail .lu-check-icon { background: rgba(255, 81, 104, 0.2); color: var(--ball); }
.lu-note .lu-check-icon { background: var(--surface-3); color: var(--ink-faint); }
.lu-fail { border-color: rgba(255, 81, 104, 0.45); color: var(--ink); }
.lu-warn { border-color: rgba(255, 201, 77, 0.4); }

@media print {
  /* Eligibility board + lineup card print clean */
  .board-grid { grid-template-columns: repeat(3, 1fr); gap: 0.4rem; margin-bottom: 0.8rem; }
  .board-card { background: #fff; box-shadow: none; border: 1px solid #ccc; border-left-width: 5px; padding: 0.4rem 0.6rem; break-inside: avoid; }
  .board-note { color: #333; font-size: 0.72rem; }
  .page-board .calc-intro p, .page-lineup .calc-intro p { display: none; }
  .page-board .calc-intro h1, .page-lineup .calc-intro h1 { font-size: 1.4rem; margin: 0 0 0.3rem; }
  .lu-grid-wrap { grid-template-columns: 0.3fr 1fr; gap: 0.8rem; }
  .lu-checks { display: none; } /* the card is for the dugout; checks are for the coach's screen */
  .lu-table select { border: none; background: #fff; color: #111; padding: 0; min-height: 0; appearance: none; -webkit-appearance: none; font-size: 0.8rem; }
  .lu-bench-cell, .lu-bench-row th { background: #eee; }
  .lu-order { gap: 0.15rem; font-size: 0.85rem; }
  .page-lineup .section-title, .page-board .section-title { font-size: 1rem; margin-top: 0.5rem; }
}

@media print {
  /* Practice plan prints as a clean one-pager: chrome and form carry
     .no-print; the plan itself compresses. */
  .page-planner .calc-intro p { display: none; }
  .page-planner .calc-intro h1 { font-size: 1.5rem; margin: 0; }
  .page-planner .pp-plan-head .section-title { font-size: 1.1rem; }
  .pp-plan { gap: 0.3rem; margin-top: 0.5rem; }
  .pp-row { break-inside: avoid; page-break-inside: avoid; background: #fff; box-shadow: none; border: 1px solid #ccc; border-left: 4px solid #888; padding: 0.4rem 0.6rem; }
  .pp-row-water { background: #fff; border-style: dashed; }
  .pp-name, .pp-say { color: #111; }
  .pp-do { color: #333; font-size: 0.85rem; margin-top: 0.15rem; }
  .pp-say { font-size: 0.85rem; margin-top: 0.2rem; }
  .pp-time { color: #333; padding-top: 0; }
  .share-bar, .share-launch { display: none !important; }

  /* Situation pills ("Bases empty", "0 out") keep their dark fill in print
     (print-color-adjust: exact) — so their text must stay white, not the
     print-dark ink the rest of the page switches to. */
  .meta-pill { color: #fff; }

  /* --- booklet sheets: one play = one printed page, guaranteed by compaction.
         The screen layout is roomy; print flattens it hard so a full sheet
         (title + diagram + 9 jobs + coaching) lands inside a Letter page. --- */
  .sheet { padding: 0.55rem 0.8rem; }
  .sheet-head { margin-bottom: 0.25rem; gap: 0.5rem; }
  .sheet-head h2 { font-size: 1.15rem; }
  .sheet-sit { margin: 0.15rem 0 0.3rem; }
  .sheet-desc { font-size: 0.8rem; line-height: 1.4; margin: 0 0 0.45rem; }
  .sheet-grid { grid-template-columns: 0.78fr 1.22fr; gap: 0.7rem; }
  .sheet .field-mount svg { max-height: 88mm; width: auto; margin: 0 auto; display: block; }
  .sheet .legend-print { font-size: 0.7rem; gap: 0.7rem; margin: 0 0 0.25rem; }
  .sheet .job-list { gap: 0.14rem; margin-bottom: 0.3rem; }
  .sheet .job-row { padding: 0.18rem 0.4rem; gap: 0.45rem; }
  .sheet .job-pos { width: 26px; height: 26px; font-size: 0.72rem; border-radius: 4px; }
  .sheet .job-name { font-size: 0.76rem; }
  .sheet .job-chip { font-size: 0.58rem; padding: 0.1rem 0.4rem; }
  .sheet .job-instruction { font-size: 0.7rem; line-height: 1.3; margin-top: 0.12rem; }
  .sheet .coaching { grid-template-columns: 1fr 1fr 1fr; gap: 0.4rem; margin-top: 0.4rem; }
  .sheet .coach-card { padding: 0.35rem 0.5rem; border-left-width: 3px; }
  .sheet .coach-tag { font-size: 0.56rem; margin-bottom: 0.1rem; }
  .sheet .coach-card p { font-size: 0.7rem; line-height: 1.35; margin: 0; }

  /* Position study cards: keep every row on one page with its header. */
  .pos-row { padding: 0.3rem 0; gap: 0.4rem 0.6rem; }
  .pos-row-instr { font-size: 0.74rem; line-height: 1.35; margin: 0.1rem 0 0; }
  .pos-row-title { font-size: 0.82rem; }
  .pos-hero { margin-bottom: 0.4rem; }
  .pos-cat-head { margin: 0.6rem 0 0.2rem; font-size: 0.9rem; }
}
