/* Shared production APK/browser layout, adapted from the separate demo. */
/* Matches use the available display width, without imposing a desktop minimum on phones. */
body:has(#rounds.active) main{width:100%!important;max-width:none!important;min-width:0!important;box-sizing:border-box}
#rounds,#roundList,#roundList .roundScreen{max-width:none!important;min-width:0}
.timingFields[hidden],#untimedRoundCount[hidden]{display:none!important}
#optionalTimings{margin:12px 0}
#untimedRoundCount input{max-width:180px}
/* Keep individual games distinct even when the round fills a wide display. */
#roundList .roundScreen.phoneRoundActive>.match{border:1px solid var(--rr-border)!important;border-radius:10px!important;background:var(--rr-surface)!important;box-sizing:border-box;margin:0 0 6px!important}
#roundList .rrAllCourts.phoneRoundActive>.match{margin:0!important}
.phoneRoundNav{display:flex!important;align-items:center;gap:6px;padding:6px!important;background:var(--navy);border-radius:11px}
.phoneRoundNav>#phonePreviousRound,.phoneRoundNav>#phoneNextRound{flex:0 0 42px;min-height:36px!important;height:36px;padding:2px!important;background:#173550!important;color:white!important}
.phoneRoundNav>#phoneRoundPosition{flex:1;min-width:0;color:white;text-align:center;font-size:14px}
.phoneRoundNav>#phoneRoundTools{display:none!important}
.sitControlRow{display:grid;grid-template-columns:84px minmax(0,1fr) 100px;align-items:center;gap:8px;width:100%}
.sitControlRow>b{font-size:13px;color:var(--rr-text)}
.sitControlRow>button{height:36px!important;min-height:36px!important;padding:4px 8px!important;font-size:13px!important;background:var(--rr-surface)!important;color:var(--rr-text)!important;border:1px solid var(--rr-border)!important}
.sitControlRow>button:disabled{opacity:.55}
.rrOriginalSitToggle{display:none!important}
.roundScreen .sit>.roundActions{display:none!important}
#rounds.phoneToolsOpen .roundScreen.phoneRoundActive .sit>.roundActions{display:grid!important;grid-auto-flow:column;grid-auto-columns:minmax(140px,1fr);gap:6px;margin-top:10px!important;overflow-x:auto;max-width:100%}
#rounds.phoneToolsOpen .roundScreen.phoneRoundActive,#roundList .phoneRoundActive.rrSitOpen{height:auto!important;max-height:none!important;overflow:visible!important}
#roundList .phoneRoundActive .editRoundPlayers{display:none!important}
#rounds.phoneToolsOpen #roundList .phoneRoundActive .editRoundPlayers{display:block!important;margin-bottom:5px!important}
#roundList .phoneRoundActive .match{min-width:0}
#roundList .roundScreen.phoneRoundActive>.match{height:var(--rr-match-height,100px)!important;min-height:var(--rr-match-height,100px)!important;flex:0 0 var(--rr-match-height,100px)!important}
#roundList .roundScreen.phoneRoundActive>.roundHead{display:none!important}
#roundList .roundScreen.phoneRoundActive>.sit{flex:0 0 auto!important}
#roundList .phoneRoundActive .teamNames{min-width:0;overflow-wrap:anywhere}
.courtRangeNav{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}
.courtRangeNav button{flex:1;min-height:36px;background:var(--rr-surface);color:var(--rr-text);border:1px solid var(--rr-border);font-size:13px}
.courtRangeNav button[aria-pressed=true]{background:var(--rr-accent);color:var(--navy)}
#roundList .courtPageHidden{display:none!important}
#roundList .rrAllCourts.phoneRoundActive{height:auto!important;max-height:none!important}
.scoreSheet .keypad{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-template-rows:repeat(4,minmax(32px,1fr))!important;gap:6px!important;min-height:0!important}
.scoreSheet .keypad button{min-width:0!important;min-height:32px!important;padding:4px!important;touch-action:manipulation}
@media(min-width:1200px){#roundList .rrAllCourts.phoneRoundActive{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}#roundList .rrAllCourts>.sit,#roundList .rrAllCourts>.editRoundPlayers{grid-column:1/-1}}
@media(orientation:landscape) and (max-height:700px){.scoreSheet{max-height:calc(100dvh - 24px)!important;overflow:auto!important;padding:10px 14px!important}.scoreSheet .scoreSides{grid-template-columns:1fr 1fr!important;gap:10px!important;min-height:0!important}.scoreSheet .scorePanel{padding:6px 9px!important;min-height:0!important}.scoreSheet .bigScore{height:28px!important;font-size:25px!important;line-height:28px!important}.scoreSheet .scorePanel>b{font-size:12px!important;min-height:17px!important}.scoreSheet .keypad{grid-template-rows:repeat(4,32px)!important}.scoreSheet>.primary{min-height:38px!important;padding:6px!important}}
/* Expand below the matches. Never shrink courts to make room for tools or sitters. */
#roundList .roundScreen.phoneRoundActive{height:auto!important;max-height:none!important;overflow:visible!important;overflow-anchor:none}
#rounds.phoneToolsOpen .roundScreen.phoneRoundActive .sit>.roundActions{grid-auto-flow:row!important;grid-auto-columns:auto!important;grid-template-columns:repeat(auto-fit,minmax(145px,1fr))!important;overflow:visible!important;width:100%!important;padding:10px!important;border:1px solid var(--rr-border);border-radius:12px;box-sizing:border-box}
#rounds.phoneToolsOpen .sit>.roundActions>button,#rounds.phoneToolsOpen .sit>.roundActions #downloadRunningOrder{width:100%!important;min-width:0!important;margin:0!important;background:white!important;color:#10233a!important;height:56px!important}
#rounds.phoneToolsOpen .sit>.roundActions>#withdrawPlayer{color:#b42318!important;border:1px solid #b42318!important}
#saveState{display:none!important}
body:has(#settings.active) .buildTag,body:has(#settings.active) #fullscreenToggle{display:none!important}
#rounds .teams>span{font-size:16px!important;line-height:1.15!important}
body.matchSizeLarge #rounds .teams>span{font-size:18px!important}
body.matchSizeXLarge #rounds .teams>span{font-size:20px!important}
#rounds .teams>strong{font-size:28px!important}
body.matchSizeLarge #rounds .teams>strong{font-size:31px!important}
body.matchSizeXLarge #rounds .teams>strong{font-size:34px!important}
@media(min-width:1000px){#rounds .teamNames{display:flex!important;flex-wrap:wrap;gap:0!important}#rounds .teamNames:last-child{justify-content:flex-end}#rounds .teamNames i{display:inline!important;font-style:normal}#rounds .teamNames i+i:before{content:' & ';white-space:pre}}
.scoreSheet{width:min(720px,calc(100vw - 24px))!important;height:auto!important;max-height:calc(100dvh - 24px)!important;overflow:auto!important}
#closeDisplaySettings{display:grid!important;place-items:center!important;padding:0!important;line-height:1!important}
.sitDetails:not([hidden]){display:flex!important;flex-wrap:wrap;align-items:center;gap:8px;padding:12px!important}
.sitDetails button{color:var(--rr-text)!important;background:var(--rr-surface)!important;border:1px solid var(--rr-border)!important;border-radius:7px;padding:6px 10px!important}
.sitControlRow{padding:6px;box-sizing:border-box}
.sitControlRow>button{border-radius:9px!important}
#roundList .roundScreen.phoneRoundActive{border-radius:16px!important;isolation:isolate;background:var(--rr-surface)!important;border:1px solid var(--rr-border)!important;padding:10px!important}
#roundList .roundScreen.phoneRoundActive>.sit{border-radius:12px!important;margin-top:8px}
#players .player{display:grid;grid-template-columns:minmax(0,1fr) 92px 86px max-content 44px!important;min-width:0}
#players .player.simple{grid-template-columns:minmax(0,1fr) max-content 44px!important}
#players .player>input,#players .player>select{min-width:0!important;width:100%!important;max-width:100%;box-sizing:border-box}
#players .player>button:not(.playerRemove){min-width:5.5em;width:auto!important;white-space:nowrap;padding-left:.75em!important;padding-right:.75em!important}
#players .player>.playerRemove{width:44px!important;min-width:0!important;padding:4px!important}
@media(max-width:700px){#players .player,#players .player.simple{grid-template-columns:minmax(0,1fr) max-content 44px!important}}
#rounds .teamNames{display:flex!important;flex-wrap:nowrap!important;align-items:center!important;gap:0!important;min-width:0}
#rounds .teamNames i{display:block!important;font-style:normal;white-space:nowrap;flex:0 0 auto;margin:0!important}
#rounds .teamNames i+i:before{content:' & ';white-space:pre}
#rounds .teamNames:last-child{justify-content:flex-end}
#rounds .teamNames.rrStackedPair{flex-direction:column!important;align-items:flex-start!important}
#rounds .teamNames.rrStackedPair:last-child{align-items:flex-end!important}
#rounds .teamNames.rrStackedPair i{white-space:normal;overflow-wrap:anywhere;max-width:100%}
#rounds .teamNames.rrStackedPair i+i:before{content:none!important}
html[data-rr-theme] #settings .connectionCard,html[data-rr-theme] #settings .connectionSummary{background:var(--rr-surface)!important;color:var(--rr-text)!important;border-color:var(--rr-border)!important}
html[data-rr-theme] #settings .connectionSummary :is(small,b,span),html[data-rr-theme] #settings :is(.connectionSafety,.connectionMessage,#portalHelp){color:var(--rr-text)!important}
html[data-rr-theme] #settings .connectionDot{border:1px solid var(--rr-border)}
html[data-rr-theme] #settings .connectionSafety{background:var(--rr-soft)!important;border-color:var(--rr-border)!important}
html[data-rr-theme] #settings label{color:var(--rr-text)!important}
#rounds.phoneToolsOpen .roundScreen .sit>.roundActions,#rounds.phoneToolsOpen .roundScreen .sit>.editRoundPlayers{box-sizing:border-box!important;width:100%!important;max-width:100%!important;margin-left:0!important;margin-right:0!important}
#rounds.phoneToolsOpen .roundScreen .sit>.editRoundPlayers{margin-top:10px!important;margin-bottom:5px!important}
.rrFontIcon{display:block;width:30px;height:30px;flex:none}
#displaySettingsToggle{display:grid;place-items:center;width:46px;height:44px;min-width:46px;min-height:44px;padding:6px!important;border:1px solid #527089!important;border-radius:11px!important;background:#173550!important;color:#fff!important;box-shadow:inset 0 1px 0 #ffffff12;transition:background .15s,border-color .15s}
#displaySettingsToggle:hover,#displaySettingsToggle[aria-expanded="true"]{background:#224764!important;border-color:#a7d946!important}
#displaySettingsToggle:focus-visible{outline:2px solid #a7d946;outline-offset:3px}
#displaySettingsToggle{width:38px!important;min-width:38px!important;height:37px!important;min-height:37px!important;flex:0 0 38px!important;border-radius:9px!important;padding:3px!important}
@media(max-width:700px){#displaySettingsToggle{width:36px!important;min-width:36px!important;height:35px!important;min-height:35px!important;flex-basis:36px!important}}
#partnerOptions>label{display:block!important;line-height:1.4;margin-bottom:12px!important}
#partnerOptions select{display:block!important;box-sizing:border-box;min-height:46px;padding-right:42px!important;margin-bottom:12px!important;appearance:none;-webkit-appearance:none;background-image:linear-gradient(45deg,transparent 50%,var(--rr-text) 50%),linear-gradient(135deg,var(--rr-text) 50%,transparent 50%)!important;background-position:calc(100% - 23px) 50%,calc(100% - 18px) 50%!important;background-size:5px 5px!important;background-repeat:no-repeat!important}
#partnerOptions :is(.hint,p,small),#partnerOptions+ :is(.hint,p){display:block;position:static!important;margin-top:10px!important;line-height:1.45!important}
#sessionPlayOptions>.tick{margin-top:14px!important}
#modeHelp{position:static!important;margin:14px 0!important;line-height:1.45!important;clear:both}
#players .player.simple{grid-template-columns:minmax(0,1fr) max-content 44px!important;align-items:stretch}
#players .player.simple>input{grid-column:1!important;grid-row:1!important;padding-right:52px!important}
#players .player.simple>.sessionAbility{grid-column:1;grid-row:1}
#players .player.simple>button:not(.playerRemove){grid-column:2!important;grid-row:1!important}
#players .player.simple>.playerRemove{grid-column:3!important;grid-row:1!important;width:44px!important;min-width:0!important}
#players .sessionAbility{justify-self:end;align-self:center;z-index:1;pointer-events:none;display:block;margin:0 10px 0 0;padding:0;border:0;color:var(--rr-text);background:transparent;font-size:13px;font-weight:800;line-height:1.4;white-space:nowrap}
@media(orientation:landscape){
 #roundList .roundScreen.phoneRoundActive{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px}
 #roundList .roundScreen.phoneRoundActive>.match{margin:0!important}
 #roundList .roundScreen.phoneRoundActive>.sit,#roundList .roundScreen.phoneRoundActive>.editRoundPlayers{grid-column:1/-1}
}
@media(orientation:portrait){#roundList .roundScreen.phoneRoundActive{display:flex!important;flex-direction:column!important}}
.runnerVersion p{margin:0;color:var(--rr-text);font-size:15px;line-height:1.5}
.runnerVersion .statusVersion{font-weight:800;color:var(--rr-text)}
#roundList .roundScreen>:is(.rotationComplete,.coachCompleteRound){grid-column:1/-1!important;width:100%!important;max-width:none!important;margin:6px 0 0!important;box-sizing:border-box}
