/* 1TTD Trainer · R4 pitch-first presentation (private development, 11 Nov 2026). Presentation only; see trainer-r4.js. */
html.ttd-r4{--r4-brass:#c4a263;--r4-brass2:#e0c48a;--r4-chalk:#ece6d6;--r4-panel:#122319;--r4-line:#3a5044;--r4-bg:#0c1410;--r4-rail:420px}
/* compact title strip: the page title, sub-line and creator credit stay, on one short band */
html.ttd-r4 header.top{padding:6px 16px!important;display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 14px;min-height:0}
html.ttd-r4 header.top h1{font-size:18px!important;margin:0!important}
html.ttd-r4 header.top .sub,html.ttd-r4 header.top .creatorCredit{font-size:12px!important;margin:0!important}
/* workspace: big pitch on the left, one sticky rail on the right */
html.ttd-r4 main.layout{grid-template-columns:minmax(0,1fr) var(--r4-rail);max-width:1680px;align-items:start;gap:14px;padding:10px 14px}
html.ttd-r4 .r4-side{position:sticky;top:8px;max-height:calc(100vh - 16px);overflow:auto;overscroll-behavior:contain;align-self:start;padding:0!important;background:transparent;border:0}
html.ttd-r4 .r4-rail{display:flex;flex-direction:column;gap:10px}
html.ttd-r4 #ttdLayoutBar{margin:0;padding:0;max-width:none}
html.ttd-r4 .r4-railhead{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}
html.ttd-r4 .r4-skip{position:absolute;left:-9999px}
html.ttd-r4 .r4-skip:focus{position:static;color:var(--r4-brass2)}
html.ttd-r4 .r4-now{border:1px solid var(--r4-line);border-left:4px solid var(--r4-brass);background:var(--r4-panel);border-radius:10px;padding:8px 10px}
html.ttd-r4 .r4-mode{margin:0 0 6px;font:700 14px/1.35 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;color:var(--r4-chalk)}
html.ttd-r4[data-r4-mode="move"] .r4-mode,html.ttd-r4[data-r4-mode="block"] .r4-mode,html.ttd-r4[data-r4-mode="blitz"] .r4-mode,html.ttd-r4[data-r4-mode="transfer"] .r4-mode{color:#b6f0a1}
/* the selected-player dock no longer floats over the pitch: it sits in the rail */
html.ttd-r4 .r4-dock{position:static!important;transform:none!important;left:auto!important;bottom:auto!important;width:auto!important;box-shadow:none!important;margin:0 0 6px;padding:6px 8px!important}
html.ttd-r4 .r4-status{margin:0!important;position:static!important}
html.ttd-r4 .r4-actions{border:1px solid var(--r4-line);border-radius:10px;padding:8px;background:#0f1e15}
html.ttd-r4 .r4-actions #primaryBar{position:static!important;top:auto!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;display:flex;flex-wrap:wrap;gap:6px}
html.ttd-r4 .r4-actions #primaryBar > button{flex:1 1 30%;min-height:44px}
html.ttd-r4 .r4-actions .r4-helpers{margin:6px 0 0;display:flex;flex-wrap:wrap;gap:6px}
html.ttd-r4 .r4-actions .r4-helpers button{flex:1 1 30%;min-height:40px}
html.ttd-r4 .r4-prompts:empty{display:none}
html.ttd-r4 .r4-prompts{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
html.ttd-r4 .r4-tabs{display:flex;flex-wrap:wrap;gap:4px;border-bottom:2px solid var(--r4-line);padding-bottom:4px}
html.ttd-r4 .r4-tabs [role=tab]{flex:1 1 auto;min-height:40px;padding:6px 10px;border:1px solid var(--r4-line);border-radius:8px 8px 0 0;background:#132219;color:var(--r4-chalk);font:700 14px/1.1 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;cursor:pointer}
html.ttd-r4 .r4-tabs [role=tab][aria-selected=true]{background:var(--r4-brass);border-color:var(--r4-brass);color:#111}
html.ttd-r4 .r4-panel{display:flex;flex-direction:column;gap:8px}
html.ttd-r4 .r4-panel[hidden]{display:none!important}
html.ttd-r4 .r4-panel > .panel,html.ttd-r4 .r4-panel > details,html.ttd-r4 .r4-panel > section{margin:0!important}
html.ttd-r4 .r4-help{margin:2px 0;font-size:13px;color:#a9b5ac}
html.ttd-r4:not([data-ttd-layout="beginner"]) .r4-beginner-only{display:none}
html.ttd-r4 .r4-panel .setupActionDock{display:flex;flex-wrap:wrap;gap:6px}
html.ttd-r4 .r4-panel .setupActionDock button{flex:1 1 30%;min-height:40px}
html.ttd-r4 .r4-panel .r4-replay-buttons{display:flex;flex-wrap:wrap;gap:6px}
html.ttd-r4 .r4-panel .r4-replay-buttons button{flex:1 1 45%;min-height:40px}
html.ttd-r4 .r4-board{min-width:0}
html.ttd-r4 .r4-board #zoomBar{position:static!important;display:flex;flex-wrap:wrap;gap:6px;align-items:center}
html.ttd-r4 .r4-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;margin:0}
html.ttd-r4 #pitchScroll{position:relative}
html.ttd-r4 #pitchScroll:focus-visible{outline:3px solid #f7cf84;outline-offset:2px}
html.ttd-r4 .r4-cursor{position:absolute;z-index:30;pointer-events:none;box-shadow:inset 0 0 0 3px #f7cf84,0 0 0 2px #000;border-radius:3px}
html.ttd-r4 .r4-rail :focus-visible{outline:3px solid #f7cf84;outline-offset:2px}
html.ttd-r4 .r4-panel:focus-visible{outline:2px dashed #6f9274}
html.ttd-r4 #frenzyHotBar{position:static!important}
/* tablet and phone: one column; the rail opens up so the essentials sit above the pitch and the tabs below it.
   Nothing is fixed or sticky over the pitch. */
@media (max-width:1100px){html.ttd-r4{--r4-rail:360px}}
@media (max-width:900px){
  html.ttd-r4 main.layout{grid-template-columns:minmax(0,1fr);padding:6px;gap:8px}
  html.ttd-r4 .r4-side,html.ttd-r4 .r4-rail{display:contents}
  html.ttd-r4 .r4-railhead{order:1}
  html.ttd-r4 .r4-now{order:2}
  html.ttd-r4 .r4-actions{order:3}
  html.ttd-r4 .r4-board{order:4}
  html.ttd-r4 .r4-tabs{order:5}
  html.ttd-r4 .r4-panels{order:6;display:flex;flex-direction:column;gap:8px}
  html.ttd-r4 .r4-actions #primaryBar > button{flex:1 1 22%;min-height:44px;padding:4px 6px;font-size:13px}
  html.ttd-r4 .r4-tabs [role=tab]{flex:1 1 30%}
}
@media (max-width:420px){
  html.ttd-r4 .r4-actions #primaryBar > button{flex:1 1 30%}
  html.ttd-r4 header.top h1{font-size:16px!important}
}

/* ---------- Academy lesson view (trainer embedded in /academy) ----------
   Only the pitch, the trainer's own messages and (for Try) the action buttons are shown. */
html.ttd-a3 #ttdLayoutBar,html.ttd-a3 aside.right,html.ttd-a3 #emptyStartPanel,html.ttd-a3 #zoomBar,html.ttd-a3 #oddsTimelinePanel,
html.ttd-a3 #oddsAlternatePathsPanel,html.ttd-a3 .recordingAccess,html.ttd-a3 #replayToolsPanel,html.ttd-a3 .boardPanel > .inline,
html.ttd-a3 footer,html.ttd-a3 .creatorFooter,html.ttd-a3 #quickOddsPanel,html.ttd-a3 .legend details,
html.ttd-a3 #primaryBar .replayActionPair,html.ttd-a3 #primaryBar .setupActionDock > #place,html.ttd-a3 #primaryBar .setupActionDock > #choose,
html.ttd-a3 #primaryBar .setupActionDock > #remove,html.ttd-a3 #primaryBar .setupActionDock > #changeType,html.ttd-a3 #primaryBar .setupActionDock > #ball,
html.ttd-a3 #primaryBar #relocate{display:none!important}
html.ttd-a3 main.layout{grid-template-columns:minmax(0,1fr)!important;max-width:none!important;padding:4px!important;gap:4px!important}
html.ttd-a3 #playerDock{position:static!important;transform:none!important;width:auto!important;box-shadow:none!important;margin:4px 0}
html.ttd-a3 #primaryBar{position:static!important}
html.ttd-a3-watch #primaryBar,html.ttd-a3-watch .ttd-a3-helpers{display:none!important}
html.ttd-a3 .boardHint{font-size:13px}
html.ttd-a3-watch .boardHint{display:none}
html.ttd-a3 .ttd-a3-helpers{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0}
html.ttd-a3 #pitchScroll{background:transparent!important}
html.ttd-a3 #pitch{margin-left:auto!important;margin-right:auto!important}
html.ttd-a3 .ttd-a3-record{display:block;margin:6px 0;padding:8px;border:1px solid rgba(196,162,99,.45);border-radius:8px}

/* the site navigation scrolls away with the page in the trainer, so nothing sticky ever covers pitch squares */
html.ttd-r4 #siteNav,html.ttd-r4 .siteNav{position:static!important;top:auto!important}

/* R5: Academy practice-board notice in a full trainer opened from a lesson */
html.ttd-r4 .r4-academy-note{margin:0 0 .5rem;padding:.45rem .6rem;border:1px solid #b45309;background:#fffbeb;color:#3b2504;border-radius:6px;font-size:.9rem}
