/* 1TTD Trainer · R5.4.x (presentation only; see trainer-r54x.js). The pitch, its colours and sizes are untouched. */
/* Beginner-only helpers: hidden in Advanced / Custom, so those layouts look exactly as in R5.4 (except Pitch help, below) */
html:not(.r54-beginner) #r54xGuide,html:not(.r54-beginner) #r54xSay,html:not(.r54-beginner) #r54xRoll,html:not(.r54-beginner) #r54xDetailsBtn{display:none!important}
.r54x-guide{margin:0 0 8px;padding:8px 10px;border:1px solid #c4a263;border-radius:9px;background:#1b2a1f}
.r54x-guide-h{margin:0;font:800 13px/1.2 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;letter-spacing:.06em;text-transform:uppercase;color:#e0c48a}
.r54x-guide-t{margin:3px 0 0;font-size:15px;line-height:1.4;color:#ece6d6}
.r54x-guide-b{display:flex;flex-wrap:wrap;gap:6px;margin-top:7px}
.r54x-guide-b[hidden]{display:none}
.r54x-guide-b button{flex:1 1 auto;min-height:44px;padding:6px 10px;border-radius:8px;border:1px solid #e0c48a;background:#c4a263;color:#15120a;font-weight:800}
.r54x-guide-b button+button{background:#1f3326;color:#ece6d6;border-color:#6f9274}
/* Beginner: the engine's mode / state-machine line sits behind "Details" (still updated by the engine, still in the page) */
html.r54-beginner #r4Now:not(.r54x-show-details) #r4Mode,html.r54-beginner #r4Now:not(.r54x-show-details) #status{display:none!important}
.r54x-say p[hidden]{display:none}
.r54x-say{display:flex;flex-wrap:wrap;align-items:center;gap:0 10px}
.r54x-say p{flex:1 1 200px}
/* Beginner, nothing selected: the guide already says "tap a player", so the empty selected-player card waits */
html.r54-beginner #r4Now.r54x-nosel #playerDock{display:none!important}
.r54x-say p{margin:4px 0 0;font-size:13.5px;line-height:1.4;color:#d6dace}
.r54x-say .r54x-say-main{font-weight:700;color:#ece6d6}
.r54x-details-btn{margin:4px 0 0 auto;min-height:32px;padding:4px 12px;border-radius:8px;border:1px solid #6f9274;background:transparent;color:#d6dace;font-size:13px}
.r54x-details-btn[aria-expanded="true"]{background:#1f3326}
/* current-roll chip */
.r54x-roll{margin:6px 0 0;padding:7px 10px;border:1px solid #648e72;border-left:4px solid #b6f0a1;border-radius:8px;background:#163222}
.r54x-roll[hidden]{display:none}
.r54x-roll-t{margin:0;font-weight:800;font-size:15px;color:#e8f7df;font-variant-numeric:tabular-nums}
.r54x-roll-d summary{cursor:pointer;font-size:13px;color:#c9e9cb;min-height:32px;display:flex;align-items:center}
.r54x-roll-body ul{list-style:none;margin:4px 0;padding:0;font-size:13px}
.r54x-roll-body li{display:flex;justify-content:space-between;gap:10px;padding:2px 0;border-bottom:1px solid #2c4a37}
.r54x-limit{margin:6px 0 0;font-size:12.5px;line-height:1.4;color:#f1d9a0}
/* Pitch help: colour key and pitch instructions, collapsed, right below the pitch (every layout) */
.r54x-pitchhelp{margin:6px 0;border:1px solid #33473b;border-radius:8px;background:#122319}
.r54x-pitchhelp>summary{cursor:pointer;min-height:40px;display:flex;align-items:center;padding:0 10px;font-weight:700;color:#e0c48a}
.r54x-pitchhelp>.boardHint,.r54x-pitchhelp>.legend{margin:0 10px 8px}
/* phones and small tablets: pitch first inside the board column; zoom controls and Pitch help follow the pitch.
   Nothing becomes fixed or sticky over the pitch. */
@media (max-width:900px){
  html.ttd-r4 .r4-board{display:flex;flex-direction:column}
  html.ttd-r4 .r4-board>*{min-width:0}
  html.ttd-r4 .r4-board>#zoomBar{order:2;margin-top:6px}
  html.ttd-r4 .r4-board>#r54xPitchHelp{order:3}
  html.ttd-r4 .r4-board>.inline{order:4}
  /* Beginner: the short layout note; unavailable helper buttons (Continue Blitz, Follow Up, New Hit) wait until usable */
  html.r54-beginner .r4-actions .r4-helpers button:disabled{display:none}
  html.r54-beginner .r4-actions #primaryBar>button:disabled{min-height:36px;font-size:12px;opacity:.75}
  html.r54-beginner #ttdLayoutBar .r54-layout-note{font-size:12.5px}
  /* Beginner, empty board: MOVE / BLOCK / BLITZ cannot do anything yet, so the action panel follows the pitch until a player is on it */
  html.r54-beginner.r54x-empty .r4-actions{order:5}
  html.r54-beginner.r54x-empty .r4-tabs{order:6}
  html.r54-beginner.r54x-empty .r4-panels{order:7}
  /* the one-Block modelling note shows while a Block or Blitz is being played (where it applies) */
  html.r54-beginner:not([data-r4-mode="block"]):not([data-r4-mode="blitz"]) .r4-actions #hitAllowanceStatus{display:none}
  .r54x-guide-b button{min-height:40px;font-size:14px}
}

/* R54-22: limitation line under the Advanced roll table */
#r54xLimitAdv{margin:6px 0 0;font-size:12px;line-height:1.4;opacity:.85}
