/* Build 299 layout: slim phone chrome, one primary play action, cleaner Home, compact recruit cards, team select order. */
:root{--sdf299-bar:56px}

/* ---------- 1. One sticky phone bar ---------- */
@media(max-width:760px),(max-width:1000px) and (max-height:500px){
 html.sdf299-layout body:not(.ui221-startup-mode) .topbar{display:none!important}
 html.sdf299-layout body:not(.ui221-startup-mode) #webCloudBar{display:none!important}
 html.sdf299-layout #mobileStatus:not(.hidden){position:sticky!important;top:0!important;z-index:40!important;display:flex!important;align-items:center;gap:8px!important;height:var(--sdf299-bar);min-height:0!important;padding:6px 12px!important;box-sizing:border-box;background:rgba(4,13,21,.97)!important;border-bottom:1px solid #20394c!important;backdrop-filter:blur(10px)}
 html.sdf299-layout #mobileStatus>div{display:none!important}
 html.sdf299-layout #mobileStatus .mobile-team-logo{flex:0 0 auto;width:34px!important;height:34px!important;margin:0!important}
 html.sdf299-layout #mobileStatus .sdf299-bar-line{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;justify-content:center;line-height:1.2}
 html.sdf299-layout #mobileStatus .sdf299-bar-team{font-size:14px;font-weight:800;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 html.sdf299-layout #mobileStatus .sdf299-bar-week{font-size:12px;font-weight:650;color:#a9c1d0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 html.sdf299-layout #mobileStatus #mobileAdvance{flex:0 0 auto;min-height:40px!important;max-width:42vw;padding:6px 12px!important;font-size:12px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 html.sdf299-layout.sdf299-hero-play-visible #mobileStatus #mobileAdvance{display:none!important}
 html.sdf299-layout[data-sdf299-tab="gameday"] #mobileStatus #mobileAdvance{background:transparent!important;border:1px solid #3d6177!important;color:#d6e6f0!important;box-shadow:none!important}
 html.sdf299-layout #seasonProgress243{display:none!important}
 html.sdf299-layout #recruitAdvanceBtn{background:transparent!important;border:1px solid #3d6177!important;color:#d6e6f0!important;box-shadow:none!important}
}
.sdf299-save-chip{display:none}
@media(max-width:760px),(max-width:1000px) and (max-height:500px){
 html.sdf299-layout .sdf299-save-chip{flex:0 0 auto;display:inline-flex;flex-direction:column;align-items:center;justify-content:center;position:relative;width:46px;min-height:40px;padding:2px 0;border:1px solid #2e4a5c;border-radius:10px;background:#0d2232;color:#d6e6f0;cursor:pointer;line-height:1}
 html.sdf299-layout .sdf299-save-chip i{font-style:normal;font-size:15px}
 html.sdf299-layout .sdf299-save-chip small{font-size:9px;font-weight:750;margin-top:2px;white-space:nowrap}
 html.sdf299-layout .sdf299-save-chip:after{content:'';position:absolute;top:4px;right:5px;width:7px;height:7px;border-radius:50%;background:#e3b95a}
 html.sdf299-layout .sdf299-save-chip[data-state="synced"]:after,html.sdf299-layout .sdf299-save-chip[data-state="saved"]:after{background:#34d399}
 html.sdf299-layout .sdf299-save-chip[data-state="warn"]:after{background:#f87171}
 html.sdf299-layout .sdf299-save-chip:focus-visible{outline:2px solid #e3b95a;outline-offset:2px}
}

/* ---------- One compact navigation row per page ---------- */
@media(max-width:760px),(max-width:1000px) and (max-height:500px){
 html.sdf299-layout #gameScreen .tab-page{position:relative}
 html.sdf299-layout #gameScreen .tab-page .ui-section-nav-v219{position:relative!important;top:auto!important}
 html.sdf299-layout #homeDetailsCard #dashboardSectionNavV219.phone-visible-sections296,
 html.sdf299-layout #homeDetailsCard #dashboardSectionNavV219.phone-section-menu-v232:not(.phone-select-nav296),
 html.sdf299-layout .tab-page>.ui-section-nav-v219.phone-section-menu-v232:not(.phone-select-nav296),
 html.sdf299-layout .tab-page>.ui-section-nav-v219.phone-visible-sections296,
 html.sdf299-layout #gameScreen .tab-page>.ui-section-nav-v219.phone-section-menu-v232.phone-visible-sections296{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;grid-template-columns:none!important;gap:4px!important;padding:4px!important;margin:4px 0 8px!important;scrollbar-width:none;-webkit-overflow-scrolling:touch}
 html.sdf299-layout .ui-section-nav-v219::-webkit-scrollbar,html.sdf299-layout .area-navigation296::-webkit-scrollbar,html.sdf299-layout .roster-command-nav-v224::-webkit-scrollbar{display:none}
 html.sdf299-layout #homeDetailsCard #dashboardSectionNavV219:not(.phone-select-nav296)>button.ui-section-chip:not(.hidden),
 html.sdf299-layout .tab-page>.ui-section-nav-v219:not(.phone-select-nav296)>button.ui-section-chip:not(.hidden){flex:0 0 auto!important;width:auto!important;min-width:0!important;min-height:40px!important;padding:6px 12px!important;white-space:nowrap!important;font-size:12px!important}
 html.sdf299-layout .area-navigation296{display:flex;flex-wrap:nowrap!important;overflow-x:auto;gap:3px;padding:3px!important;margin:4px 0 6px!important;scrollbar-width:none}
 html.sdf299-layout .area-navigation296[hidden]{display:none!important}
 html.sdf299-layout .area-navigation296 button{flex:1 0 auto!important;min-height:40px!important;padding:6px 10px!important;white-space:nowrap;font-size:12px!important}
 html.sdf299-layout .phone-roster-command-v232 .roster-command-nav-v224,html.sdf299-layout .roster-command-nav-v224{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;grid-template-columns:none!important;gap:4px!important;scrollbar-width:none}
 html.sdf299-layout .roster-command-nav-v224 button{flex:0 0 auto!important;min-height:40px!important;padding:6px 12px!important;white-space:nowrap}
 html.sdf299-layout .section-view-label296:not([hidden]){display:flex!important;align-items:center;gap:8px;margin:4px 0 8px!important;padding:4px!important}
 html.sdf299-layout .section-view-label296>span{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
 html.sdf299-layout .section-view-label296 select{flex:1;min-width:0;min-height:40px!important;margin:0!important}
 html.sdf299-layout .sdf299-has-help{padding-right:52px!important}
 html.sdf299-layout .tab-page>.page-utilities296.sdf299-floating{position:absolute;right:4px;margin:0!important;z-index:3;width:auto}
 html.sdf299-layout .tab-page>.page-utilities296.sdf299-floating>.sdf-page-help{width:44px;min-width:44px;min-height:44px!important;padding:0!important;font-size:0!important;border-radius:10px;display:inline-flex;align-items:center;justify-content:center}
 html.sdf299-layout .tab-page>.page-utilities296.sdf299-floating>.sdf-page-help>*{display:none!important}
 html.sdf299-layout .tab-page>.page-utilities296.sdf299-floating>.sdf-page-help:before{display:none!important;content:none!important}
 html.sdf299-layout .tab-page>.page-utilities296.sdf299-floating>.sdf-page-help:after{content:'?';font-size:19px;font-weight:800}
}

/* ---------- 3. Home: heading becomes two icons on the nav row; hero, This Week, tiles, groups ---------- */
#homeDetailsCard.sdf299-home{position:relative}
#homeDetailsCard.sdf299-home>.home-details-heading{position:absolute;top:0;right:0;z-index:4;padding:4px 4px 0 0!important;margin:0!important;border:0!important;background:none!important;display:flex;gap:4px;align-items:center;min-height:0!important}
#homeDetailsCard.sdf299-home>.home-details-heading>div:first-child{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
#homeDetailsCard.sdf299-home>.home-details-heading .home-details-help,#homeDetailsCard.sdf299-home>.home-details-heading .home-options>summary{min-width:42px;min-height:42px;width:42px;height:42px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;padding:0!important}
html.sdf299-layout #homeDetailsCard.sdf299-home>.section-view-label296,html.sdf299-layout #homeDetailsCard.sdf299-home #dashboardSectionNavV219[class]{margin-right:96px!important}
#homeDetailsCard.sdf299-home>.section-view-label296{margin-top:4px!important}
#homeDetailsCard.sdf299-home .home-details-content{display:flex;flex-direction:column;gap:10px}
#homeDetailsCard.sdf299-home .home-details-content>*{order:6;margin-top:0!important;margin-bottom:0!important}
#homeDetailsCard.sdf299-home .home-details-content>#dashboardSectionNavV219{order:0}
#homeDetailsCard.sdf299-home .home-details-content>#gameCommandCenterV219:not([hidden]){display:contents!important}
#homeDetailsCard.sdf299-home #gameCommandCenterV219>*{order:6;margin-top:0!important;margin-bottom:0!important}
#homeDetailsCard.sdf299-home #gameCommandCenterV219>#sdf299Hero{order:1}
#homeDetailsCard.sdf299-home #gameCommandCenterV219>#seasonFlow242,#homeDetailsCard.sdf299-home #gameCommandCenterV219>#scenarioTracker241,#homeDetailsCard.sdf299-home #gameCommandCenterV219>#usageConsentV236{order:2}
#homeDetailsCard.sdf299-home .home-details-content>#seasonFlow242,#homeDetailsCard.sdf299-home .home-details-content>#scenarioTracker241{order:2}
#homeDetailsCard.sdf299-home .home-details-content>#sdf299ThisWeek{order:3}
#homeDetailsCard.sdf299-home #gameCommandCenterV219>.ui-command-grid{order:4}
#homeDetailsCard.sdf299-home #gameCommandCenterV219>#coachFirstWeekV236{order:5}
#homeDetailsCard.sdf299-home #gameCommandCenterV219>#sdf299MoreTiles{order:7}
#homeDetailsCard.sdf299-home #gameCommandCenterV219>#sdf299Brief{order:8}
#homeDetailsCard.sdf299-home .home-details-content>#sdf299Community{order:9}
#homeDetailsCard.sdf299-home #gameCommandCenterV219[hidden]~#sdf299ThisWeek,#homeDetailsCard.sdf299-home #gameCommandCenterV219[hidden]~#sdf299Community{display:none!important}
#homeDetailsCard.sdf299-home .home-details-content>#sdf299ThisWeek[hidden]{display:none!important}

.sdf299-hero{display:flex;flex-direction:column;gap:0;border:1px solid #304450;border-radius:16px;overflow:hidden;background:#0e1c27}
.sdf299-hero>.ui-program-hero{border:0!important;border-radius:0!important;margin:0!important;padding:12px 14px!important;box-shadow:none!important}
.sdf299-hero .ui-program-hero-team img{width:46px!important;height:46px!important}
.sdf299-hero .ui-program-hero-team h2{font-size:20px!important;line-height:1.15!important;margin:2px 0!important}
.sdf299-hero .ui-program-hero-team p{margin:0!important}
.sdf299-hero>.sdf299-last-slot:empty{display:none}
.sdf299-last{margin:0;padding:8px 14px;font-size:13px;color:#cfe0ea;border-top:1px solid #23394a;background:#0b1822}
.sdf299-last small{color:#8fa9b9;font-weight:800;letter-spacing:.06em;font-size:10px;margin-right:4px}
.sdf299-last.win b{color:#4ade80}.sdf299-last.loss b{color:#f87171}
.sdf299-hero>.ui-next-game-stage{border:0!important;border-top:1px solid #23394a!important;border-radius:0!important;margin:0!important;padding:10px 14px 12px!important;box-shadow:none!important}
.sdf299-hero .ui-stage-side img{width:40px!important;height:40px!important}
.sdf299-hero .ui-stage-actions{display:flex!important;flex-wrap:wrap;align-items:center;gap:6px 10px!important}
.sdf299-hero .btn.sdf299-play{flex:1 1 100%;min-height:48px!important;font-size:15px!important;font-weight:800;background:linear-gradient(180deg,#22c55e,#15803d)!important;border:1px solid #4ade80!important;color:#fff!important;text-transform:none!important;letter-spacing:.01em!important}
.sdf299-hero .btn.sdf299-play:disabled{opacity:.55}
.sdf299-hero .ui-stage-complete{flex-wrap:wrap}
.btn.sdf299-secondary,.sdf299-hero .btn.sdf299-secondary{background:transparent!important;border:1px solid #33546a!important;color:#cfe0ea!important;box-shadow:none!important;min-height:40px!important;font-weight:700}
.sdf299-hero .ui-stage-actions .btn.sdf299-secondary{flex:1 1 0}
#gamedayTab .btn.sdf299-primary{box-shadow:0 0 0 2px rgba(74,222,128,.25)}
#quickSimGameBtn.sdf299-secondary{text-transform:none!important;letter-spacing:0!important}

#sdf299ThisWeek.sdf299-this-week{border:1px solid color-mix(in srgb,#e3b95a 45%,#304450);border-radius:16px;background:linear-gradient(160deg,#132637,#0c1a25);padding:12px 14px!important}
#sdf299ThisWeek .sdf299-title{margin:0 0 8px!important;font-size:12px!important;font-weight:850;letter-spacing:.1em;text-transform:uppercase;color:#e3b95a}
#sdf299ThisWeek .sdf299-section+.sdf299-section{border-top:1px solid #23394a;margin-top:10px;padding-top:10px}

#homeDetailsCard.sdf299-home #gameCommandCenterV219>.ui-command-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important}
#homeDetailsCard.sdf299-home #gameCommandCenterV219>.ui-command-grid .ui-command-tile{min-height:0!important;padding:10px 8px!important;align-items:flex-start}
#homeDetailsCard.sdf299-home #gameCommandCenterV219>.ui-command-grid .ui-command-icon,#homeDetailsCard.sdf299-home #gameCommandCenterV219>.ui-command-grid .ui-command-arrow{display:none!important}
#homeDetailsCard.sdf299-home #gameCommandCenterV219>.ui-command-grid .ui-command-tile b{font-size:13px!important;line-height:1.2}
#homeDetailsCard.sdf299-home #gameCommandCenterV219>.ui-command-grid .ui-command-tile em{font-size:11px!important;line-height:1.3}
.sdf299-group{border:1px solid #2b3f4d;border-radius:14px;background:#0c1924}
.sdf299-group>summary{list-style:none;cursor:pointer;min-height:44px;display:flex;align-items:center;gap:8px;padding:8px 14px;font-weight:750;font-size:13px;color:#cfe0ea}
.sdf299-group>summary::-webkit-details-marker{display:none}
.sdf299-group>summary:before{content:'▸';color:#8fa9b9;transition:transform .15s}
.sdf299-group[open]>summary:before{transform:rotate(90deg)}
.sdf299-group>summary:focus-visible{outline:2px solid #e3b95a;outline-offset:-2px;border-radius:14px}
.sdf299-group.attention>summary{color:#f6d58b}
.sdf299-group[open]{padding-bottom:8px}
.sdf299-group>:not(summary){margin:0 8px!important}
.sdf299-group .sdf299-more-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:6px}
.sdf299-group>#coachBriefV236,.sdf299-group>#sdf-growth-dynasty{border:0!important;background:none!important;box-shadow:none!important;padding:4px 6px!important}
@media(max-width:360px){#homeDetailsCard.sdf299-home #gameCommandCenterV219>.ui-command-grid{grid-template-columns:1fr!important}}

/* ---------- 4. Compact recruit cards ---------- */
.sdf299-rc .sdf299-scout{display:inline-block;margin-top:3px;padding:2px 8px;border-radius:999px;background:#12324a;border:1px solid #2f6f8f;color:#bfe8ff;font-size:11px;font-weight:800;letter-spacing:.02em}
.sdf299-rc:not(.sdf299-open) .motivation-row>.motivation-chip:nth-child(n+2),
.sdf299-rc:not(.sdf299-open) .mobile-race-list,
.sdf299-rc:not(.sdf299-open) .recruit-rank-help290,
.sdf299-rc:not(.sdf299-open) .recruit-contact-hint280,
.sdf299-rc:not(.sdf299-open) .mobile-data-grid>div:nth-child(n+5){display:none!important}
.sdf299-rc .mobile-data-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:4px!important}
.sdf299-rc .mobile-data-grid>div{min-width:0;padding:6px 4px!important}
.sdf299-rc .mobile-data-grid small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10px!important}
.sdf299-rc .motivation-row{margin:4px 0!important}
.sdf299-rc:not(.sdf299-open) .recruit-card-action-grid-v226>button:not(.sdf299-key):not(.sdf299-more-btn){display:none!important}
.sdf299-rc .recruit-card-action-grid-v226{display:flex!important;flex-wrap:wrap;gap:6px!important}
.sdf299-rc .recruit-card-action-grid-v226>button{flex:1 1 calc(33% - 6px);min-width:0;min-height:42px!important;height:auto!important;margin:0!important;display:inline-flex!important;align-items:center;justify-content:center;text-align:center;padding:6px 8px!important;line-height:1.2}
.sdf299-rc .recruit-card-action-grid-v226>button.sdf299-key{order:-1}
.sdf299-rc:not(.sdf299-open) .recruit-card-action-grid-v226>button.sdf299-key{flex:1 1 0}
.sdf299-rc .recruit-card-action-grid-v226>.sdf299-more-btn{flex:0 0 auto;width:auto!important;order:3;padding:6px 10px!important;background:transparent!important;border:1px dashed #3d6177!important;color:#cfe0ea!important}
.sdf299-rc.sdf299-open .recruit-card-action-grid-v226>.sdf299-more-btn{order:5;flex-basis:100%}
.sdf299-rc .recruit-card-action-grid-v226>p{flex:1 1 100%;order:4}
.sdf299-rc:not(.sdf299-open) .recruit-status-message:not(:empty){font-size:12px!important;line-height:1.35!important;padding:6px 9px!important;margin:4px 0!important}
.sdf299-rc.recruit-blocked .recruit-status-message{display:block!important;margin:4px 0!important;padding:0!important;border:0!important;background:none!important;color:#f3a6a6!important;font-size:12px!important;line-height:1.35}
.sdf299-rc.recruit-blocked .recruit-status-message>b{display:none!important}
.sdf299-rc.recruit-blocked .recruit-status-message>span:before{content:'🔒 '}
.sdf299-rc .mobile-data-card,.sdf299-rc{padding-bottom:10px!important}
@media(min-width:761px){.sdf299-rc .recruit-card-action-grid-v226>button{flex:1 1 calc(25% - 6px)}}

/* ---------- 5. Team select ---------- */
.sdf299-recommended{margin:10px 0!important;padding:12px!important;border:1px solid color-mix(in srgb,#e3b95a 45%,#304450)!important;border-radius:16px!important;background:linear-gradient(160deg,#132637,#0c1a25)!important}
.sdf299-recommended header small{color:#e3b95a;font-weight:850;letter-spacing:.1em;font-size:11px}
.sdf299-recommended header h3{margin:2px 0!important;font-size:18px}
.sdf299-recommended header p{margin:0 0 8px!important;color:#a9c1d0;font-size:13px}
.sdf299-rec-list{display:grid;gap:8px}
@media(min-width:900px){.sdf299-rec-list{grid-template-columns:repeat(3,minmax(0,1fr))}}
.sdf299-rec{display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid #2b3f4d;border-left:4px solid var(--card-primary);border-radius:12px;background:#0c1924}
.sdf299-rec img{width:40px;height:40px;object-fit:contain;flex:0 0 auto}
.sdf299-rec>div{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.25}
.sdf299-rec b{font-size:14px;line-height:1.2}
.sdf299-rec small{color:#a9c1d0;font-size:11px}
.sdf299-rec span{color:#8fa9b9;font-size:11px}
.sdf299-rec .btn{flex:0 0 auto;min-height:40px;padding:6px 12px;font-size:12px;margin:0}
.sdf299-custom-league{margin:12px 0}
.sdf299-custom-league #creationLeague293{border:0!important;background:none!important;box-shadow:none!important;margin:0!important;padding:4px 8px!important}
/* Coach-style and difficulty descriptions are read before choosing: never truncate them. */
.coach-create-modal-v220 .setup-choice small,.coach-create-modal-v219 .setup-choice small,#modal .new-dynasty-setup .setup-choice small{display:block!important;-webkit-line-clamp:unset!important;-webkit-box-orient:initial!important;overflow:visible!important;white-space:normal!important;text-overflow:clip!important;max-height:none!important}
/* Build 299 QA: version line in Settings (phone hides the topbar release label) */
#appSettingsModal .settings-version299{font-size:12px;margin:6px 0 0;opacity:.8;letter-spacing:.02em}
/* Build 299 QA: body overflow-x:hidden made <body> a scroll container, so the sticky phone bar scrolled away. clip keeps the no-horizontal-scroll guard without that (browsers without clip keep hidden). */
html.sdf299-layout body{overflow-x:hidden;overflow-x:clip}
