/* Keep persistent controls outside the court in both pitch views. */
:root{--coach-board-safe-top:env(safe-area-inset-top,0px)}
html body.board-fullscreen #immersiveMenu,html body.board-fullscreen #coach212Handles,html body.board-fullscreen #coach206Mode{display:none!important}
html body.board-fullscreen #coachPlanBar{left:max(4px,env(safe-area-inset-left));right:max(4px,env(safe-area-inset-right));bottom:calc(4px + env(safe-area-inset-bottom));padding:4px;gap:4px;min-height:52px}
#coachBoardMenu,#coachBoardTools,#coachZoomReset{flex:none;min-width:38px;min-height:44px;padding:4px;font-size:19px;border-radius:9px}
#coachZoomReset{font-size:12px;min-width:46px}#coachZoomReset[hidden]{display:none!important}
.coach-plan-heading{display:flex;align-items:center;gap:5px;min-width:0;line-height:15px}
.coach-plan-heading #coachPlanName{flex:1;min-width:0;line-height:15px;font-size:10px}
#coachPlanTool{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:10px/15px system-ui;color:#bcd5e2}
html body.board-fullscreen #coachPlanTabs{gap:3px}html body.board-fullscreen #coachPlanTabs button{padding:3px 5px;min-width:32px;min-height:32px;height:32px}
html body.board-fullscreen #coachPlanPlay,html body.board-fullscreen #coachPlanNext{padding:5px 6px;font-size:12px;min-height:44px}
html body.board-fullscreen #rotationPanel.open{display:flex!important;flex-direction:column!important;position:fixed!important;left:auto!important;right:max(4px,env(safe-area-inset-right))!important;top:max(4px,env(safe-area-inset-top))!important;bottom:var(--coach-board-bottom,76px)!important;width:48px!important;max-width:48px!important;max-height:none!important;margin:0!important;padding:3px!important;transform:none!important;overflow-y:auto!important;justify-content:center;gap:4px;box-shadow:none!important;border-radius:10px!important;z-index:2147483499!important}
html body.board-fullscreen #rotationPanel.open p{font-size:9px!important;line-height:1.3;overflow-wrap:anywhere;max-height:26px;overflow:hidden;margin:0 0 4px!important;text-align:center}
html body.board-fullscreen #rotationPanel.open .rotation-controls{display:flex!important;flex-direction:column!important;gap:4px!important;flex-wrap:nowrap!important;flex:none}
html body.board-fullscreen #rotationPanel.open .rotation-controls button{flex:none!important;min-height:44px!important;width:100%!important;font-size:11px!important;padding:4px 0!important}
html body.board-fullscreen:has(#rotationPanel.open) #coach304Anim.coach304-open{right:56px!important}
html body.board-fullscreen #coach304Anim.coach304-open{max-height:calc(var(--coach305-fixed-height,100svh) - var(--coach-board-bottom,76px) - 8px)!important;overflow-y:auto}

/* Familiar words beside the primary controls, with one-tap undo. */
#coachBoardMenu,#coachBoardTools,#coachBoardUndo{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;flex:none;min-width:42px;min-height:44px;padding:3px 4px;border-radius:9px;font-size:18px;line-height:19px}
#coachBoardMenu small,#coachBoardTools small,#coachBoardUndo small{font:600 9px/12px system-ui;color:inherit}
#coachBoardUndo:disabled{opacity:.35}

#savedBackupOptions{margin-top:16px;padding-top:10px;border-top:1px solid #34445d}#savedBackupOptions>summary{font-size:13px;color:#b8c9dd;min-height:44px;padding:10px 0;cursor:pointer}

/* Persistent add/delete controls; only the numbered boards scroll. */
html body #coachPlanTabs{touch-action:pan-x!important;overscroll-behavior-x:contain;scroll-behavior:smooth}
html body #coachPlanTabs button{touch-action:pan-x!important}
html body #coachPlanAdd,html body #coachPlanDelete{flex:0 0 30px;min-width:30px;min-height:36px;padding:2px;font-size:18px}
html body #coachPlanNext{display:none}
#coachTeamEditor textarea{width:100%;box-sizing:border-box;min-height:110px;font:inherit;padding:10px}
#coachTeamEditor button,#rosterFields select{min-height:44px;margin:4px 0}
#coachTeamList{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0}
#coachMatchHistory{display:grid;gap:6px}#coachMatchHistory button{text-align:left;min-height:44px}

html body.board-fullscreen{touch-action:auto!important}
#coach212Sheet button[hidden]{display:none!important}

#coach294panel{padding-bottom:90px!important}

#coachPlayerActions{position:fixed;inset:0;z-index:2147483647;background:#04131bc9;display:flex;align-items:center;justify-content:center;padding:16px;box-sizing:border-box;touch-action:pan-y}
#coachPlayerActions[hidden]{display:none!important}
#coachPlayerActions section{width:min(420px,100%);max-height:85dvh;overflow:auto;background:#123441;border:1px solid #8cbbc7;border-radius:20px;padding:18px;color:white;box-sizing:border-box}
#coachPlayerActions button{display:block;width:100%;min-height:48px;margin:8px 0;font-size:18px}
#coachTeamEditor input{min-height:44px;max-width:100%;box-sizing:border-box}#coachTeamEditor label{display:block;margin:6px 0}

#coachTeams{position:fixed;inset:0;z-index:2147483647;background:#04131bd9;display:flex;align-items:center;justify-content:center;padding:12px;box-sizing:border-box;touch-action:pan-y}
#coachTeams[hidden],#coachTeams [hidden]{display:none!important}#coachTeams section{width:min(560px,100%);max-height:90dvh;overflow:auto;background:#123441;border:1px solid #8cbbc7;border-radius:20px;padding:18px;color:white;box-sizing:border-box}
#coachTeams header{display:flex;align-items:center;justify-content:space-between}#coachTeams label{display:block;margin:12px 0}#coachTeams input:not([type=checkbox]),#coachTeams select{display:block;width:100%;box-sizing:border-box;min-height:44px;font:inherit}#coachTeams button,#coachTeams a{min-height:44px;margin:6px 3px;padding:8px}#coachTeamsMembers>div{display:flex;align-items:center;justify-content:space-between;padding:6px;border-bottom:1px solid #52717b}#coachTeamsSetup{border:1px solid #e8c672;padding:12px}#coachTeamBadge{font:10px/14px system-ui;max-width:95px;min-height:24px!important;padding:2px 5px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:none}
