/* ===========================================================================
   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: #6a7a90;

  /* brand */
  --brand-1: #2f6df6;
  --brand-2: #19c7d6;
  --brand-grad: linear-gradient(115deg, var(--brand-1), var(--brand-2));

  --radius:  16px;
  --radius-sm: 12px;
  --shadow:      0 10px 30px rgba(0, 0, 0, 0.38);
  --shadow-lift: 0 18px 46px rgba(0, 0, 0, 0.55);
  --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:
    radial-gradient(1100px 620px at 84% -8%, rgba(25, 199, 214, 0.10), transparent 60%),
    radial-gradient(1000px 560px at -8% -4%, rgba(47, 109, 246, 0.14), transparent 58%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.wrap { width: min(1200px, 92vw); margin: 0 auto; }
a { color: #7fc0ff; text-decoration: none; }
a:hover { color: #a6d4ff; }
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; border-radius: 6px; }

/* -------------------------------------------------------------- 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-ball {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: var(--brand-grad); font-size: 1.15rem; box-shadow: 0 6px 16px rgba(47, 109, 246, 0.4);
}
.brand-text b { color: var(--brand-2); }
.top-nav { display: flex; gap: 0.2rem; }
.top-nav a { color: var(--ink-soft); font-weight: 700; font-size: 0.95rem; padding: 0.4rem 0.75rem; border-radius: 10px; transition: all 0.14s ease; }
.top-nav a:hover { color: var(--ink); background: var(--surface-2); }
.top-nav a.is-active { color: #fff; background: var(--surface-3); }

.golden-rule {
  margin-left: auto; text-align: right; line-height: 1.3;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 0.45rem 0.85rem;
}
.gr-label { display: block; font-family: var(--display); font-weight: 700; font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); }
.gr-text { font-size: 0.9rem; 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 0 0.6rem; }
.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; }
.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: 600; font-size: 1.2rem; margin: 1.8rem 0 0.85rem; color: var(--ink); }
.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: 14px; 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; }
.recent-card:hover { transform: translateY(-3px); }
.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);
  padding: 0.5rem 0.95rem; border-radius: 99px; font-family: var(--font); font-weight: 700; font-size: 0.9rem;
  cursor: pointer; transition: all 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:hover { color: var(--ink); border-color: var(--chip-color, var(--brand-2)); transform: translateY(-2px); }
.chip.is-active { background: var(--chip-color, var(--brand-1)); border-color: var(--chip-color, var(--brand-1)); color: #fff; }
.chip.is-active::before { background: rgba(255, 255, 255, 0.9); }
.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: 5px; background: var(--badge-color, transparent); }
.play-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); }
.card-link { display: block; padding: 1.05rem 1.1rem 3rem 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: #fff; background: var(--badge-color, #888); padding: 0.28rem 0.62rem; border-radius: 99px; white-space: nowrap; }
.studied-tick { opacity: 0; color: var(--backup); font-weight: 900; 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; }
.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: 99px; }
.fav-btn { position: absolute; bottom: 0.7rem; right: 0.7rem; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink-faint); width: 40px; height: 40px; border-radius: 50%; font-size: 1.15rem; cursor: pointer; transition: all 0.15s ease; line-height: 1; z-index: 2; }
.fav-btn:hover { transform: scale(1.1); border-color: var(--gold); color: var(--gold); }
.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: 12px; margin: 1rem 0; font-weight: 600; }
.alert-error a { color: #fff; text-decoration: underline; }

/* -------------------------------------------------------------- detail page */
.breadcrumb { margin: 0.3rem 0 1rem; font-weight: 700; }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--ink); }
.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: all 0.15s ease; font-size: 0.94rem; line-height: 1; display: inline-flex; align-items: center; gap: 0.4rem; }
.btn:hover { transform: translateY(-2px); border-color: var(--line-strong); background: var(--surface-3); box-shadow: var(--shadow); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-ghost { background: var(--surface); }
.btn-primary { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 8px 20px rgba(47, 109, 246, 0.35); }
.btn-primary:hover { box-shadow: 0 12px 28px rgba(47, 109, 246, 0.5); }
.btn-watch { font-size: 1.02rem; padding: 0.75rem 1.3rem; }
.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: 30px; fill: #fff; pointer-events: none; }

.fielder { cursor: pointer; transition: opacity 0.2s ease; }
.fielder circle { transition: transform 0.2s ease; }
.fielder.is-on circle { 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: 5; stroke-dasharray: 4 12; stroke-linecap: round; opacity: 0.45; 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; }

.runner-path { stroke-width: 5; stroke-dasharray: 2 12; stroke-linecap: round; opacity: 0.6; }
.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: 700; 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; padding: 0.34rem 0.62rem; border-radius: 8px; cursor: pointer; color: var(--ink-soft); transition: all 0.12s ease; }
.speed-btn:hover { color: var(--ink); }
.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); color: #fff; border-radius: 12px; 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); }
.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: #fff; font-weight: 800; font-size: 0.72rem; padding: 0.22rem 0.6rem; border-radius: 99px; 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: 700; 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; gap: 0.8rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0.7rem 0.85rem; cursor: pointer; transition: all 0.15s ease; }
.job-row:hover { border-color: var(--job-color, var(--brand-2)); transform: translateX(3px); background: var(--surface-2); }
.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: 12px; background: var(--job-color, #888); color: #fff; 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: 0.68rem; font-weight: 800; color: #fff; background: var(--job-color, #888); padding: 0.17rem 0.5rem; border-radius: 99px; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.job-instruction { margin: 0.28rem 0 0; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.45; }

.coaching { display: grid; gap: 0.7rem; }
.coach-card { border-radius: 14px; padding: 0.85rem 1rem; border-left: 5px 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: 0.68rem; 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; }

/* -------------------------------------------------------------- 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: 12px; padding: 0.85rem 0.95rem; color: var(--ink); transition: all 0.15s ease; }
.print-tile:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); color: var(--ink); }
.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: 12px; background: #236626; }
.static-field-svg text { font-family: var(--display); font-weight: 700; font-size: 30px; fill: #fff; }

/* 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: 16px; background: var(--brand-grad); 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: 820px) {
  .sheet-grid { grid-template-columns: 0.92fr 1.08fr; gap: 1.4rem; }
}

/* paper output */
@media print {
  .sheet, .static-field-svg { box-shadow: none; }
  .sheet { border: 1px solid #bbb; background: #fff; page-break-inside: avoid; break-inside: avoid; margin-bottom: 0; }
  .sheet + .sheet { page-break-before: always; }
  .sheet-head h2, .pos-row-title, .pos-hero h1, .pos-cat-head { color: #111; }
  .sheet-desc, .pos-row-instr { color: #333; }
  .pos-badge { background: #222 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .static-field-svg, .badge, .job-chip, .meta-pill, .cat-dot, .pos-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pos-page { page-break-after: always; }
}

/* -------------------------------------------------------------- responsive */
@media (min-width: 900px) {
  .detail-grid { grid-template-columns: 1.05fr 0.95fr; gap: 1.6rem; }
}
@media (max-width: 720px) {
  .wrap { width: 94vw; }
  main.wrap { padding: 1.1rem 0 2.5rem; }
  .golden-rule { margin-left: 0; text-align: left; width: 100%; }
  .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: dugout cheat sheet */
@media print {
  body { background: #fff; color: #111; }
  .no-print, .site-header, .site-footer, .anim-controls, .step-tracker,
  .callout, .legend, .breadcrumb, .detail-head-actions, .arrow, .ball, #ball { display: none !important; }
  .field-mount .arrow, .field-mount #ball { display: none !important; }
  main.wrap { padding: 0; }
  .detail-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .field-shell, .job-row, .coach-card { box-shadow: none; border: 1px solid #ccc; background: #fff; }
  .job-name, .coach-card p, .detail-head h1, .card-title { color: #111; }
  .job-instruction { color: #333; }
  .play-card, .field-mount svg { break-inside: avoid; }
  .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; }
}
