/* Artwork replaces labels visually; the native button text remains its accessible name. */
button[data-gallery-choice]{min-height:88px;position:relative;border:1px solid #a2b8a04d!important;border-radius:8px!important;background-color:#132a29!important;box-shadow:0 2px 8px #0003;overflow:visible}
button[data-gallery-choice]:focus-visible{outline:3px solid #ffe4a0!important;outline-offset:3px}
button[data-gallery-choice]:disabled{opacity:.55;filter:grayscale(.65);cursor:default}
button[data-gallery-choice].selected{border-color:#ffe1a3!important;box-shadow:0 0 0 2px #ffe1a3!important}
button[data-gallery-choice][data-gallery-style="part"] .part-icon{display:block;width:204px;min-width:204px;height:184px;font-size:0;color:transparent;background:var(--selected-button-art) center/contain no-repeat}
button[data-gallery-choice][data-gallery-style="course"] b,button[data-gallery-choice][data-gallery-style="mode"] b{display:block;font-size:0!important;color:transparent!important;min-height:220px;background:var(--selected-button-art) center/contain no-repeat}
button[data-gallery-choice][data-gallery-style="course"]:not(:has(b)),button[data-gallery-choice]:is([data-gallery-style="plain"],[data-gallery-style="engine"],[data-gallery-style="launch"],[data-gallery-style="practice"],[data-gallery-style="camera"],[data-gallery-style="pedal"],[data-gallery-style="pause"],[data-gallery-style="show"],[data-gallery-style="tune"]){font-size:0!important;color:transparent!important;padding:6px!important;line-height:0!important}
button[data-gallery-choice][data-gallery-style="course"]:not(:has(b))::before,button[data-gallery-choice]:is([data-gallery-style="plain"],[data-gallery-style="engine"],[data-gallery-style="launch"],[data-gallery-style="practice"],[data-gallery-style="camera"],[data-gallery-style="pedal"],[data-gallery-style="pause"],[data-gallery-style="show"],[data-gallery-style="tune"])::before{content:"";display:block;pointer-events:none;width:100%;height:var(--selected-art-height,180px);background:var(--selected-button-art) center/contain no-repeat}
button[data-gallery-choice][data-gallery-style="launch"]{--selected-art-height:300px;min-width:min(540px,100%);max-width:100%;width:100%}
button[data-gallery-choice][data-gallery-style="practice"]{--selected-art-height:230px;width:100%}
button[data-gallery-choice][data-gallery-style="plain"]{--selected-art-height:128px;min-width:176px}
button[data-gallery-choice][data-gallery-style="engine"]{--selected-art-height:116px;min-width:216px;max-width:270px}
button[data-gallery-choice][data-gallery-style="camera"]{--selected-art-height:84px;min-width:136px}
button[data-gallery-choice][data-gallery-style="camera"] .race-camera-label{display:block;font-size:11px!important;line-height:1.2!important;color:#ffe8b9!important;margin-top:3px}
button[data-gallery-choice][data-gallery-style="pause"]{--selected-art-height:106px;min-width:128px}
button[data-gallery-choice][data-gallery-style="pedal"]{--selected-art-height:140px;min-width:108px;touch-action:none}
button[data-gallery-choice][data-gallery-style="show"]{--selected-art-height:184px;min-width:250px;flex:1}
button[data-gallery-choice][data-gallery-style="tune"]{--selected-art-height:172px}
@media(max-width:600px){
 button[data-gallery-choice][data-gallery-style="part"] .part-icon{width:148px;min-width:148px;height:144px}
 button[data-gallery-choice]:is([data-gallery-style="course"],[data-gallery-style="mode"]) b{min-height:168px}
 button[data-gallery-choice][data-gallery-style="launch"]{--selected-art-height:236px}
 button[data-gallery-choice][data-gallery-style="practice"]{--selected-art-height:180px}
 button[data-gallery-choice][data-gallery-style="show"]{--selected-art-height:156px;min-width:216px}
 button[data-gallery-choice][data-gallery-style="tune"]{--selected-art-height:134px}
 button[data-gallery-choice][data-gallery-style="engine"]{--selected-art-height:98px;min-width:184px;max-width:220px}
 button[data-gallery-choice][data-gallery-style="pedal"]{--selected-art-height:112px}
 button[data-gallery-choice][data-gallery-style="pause"]{--selected-art-height:76px;min-width:98px}
 button[data-gallery-choice][data-gallery-style="camera"]{--selected-art-height:66px;min-width:102px}
}
/* Inspection leaders reserve the original 44px-high target geometry. */
button[data-gallery-choice][data-gallery-style="engine"]{--selected-art-height:64px;min-width:88px;max-width:224px;height:88px}
@media(max-width:600px){button[data-gallery-choice][data-gallery-style="engine"]{--selected-art-height:64px;min-width:88px;max-width:224px}}
button[data-gallery-choice]:is([data-gallery-style="course"],[data-gallery-style="mode"]) :is(small,span){color:#e4e8d5!important}
button[data-gallery-choice][data-gallery-style="course"]:not(:has(b)){min-width:250px;width:calc(50% - 12px);--selected-art-height:200px}
@media(max-width:600px){button[data-gallery-choice][data-gallery-style="course"]:not(:has(b)){min-width:200px;--selected-art-height:156px}}
/* Preserve the engine leader geometry and absolute positioning. */
button[data-gallery-choice][data-gallery-style="engine"]{position:absolute!important}
/* Pedal illustrations stay inside the original touch-control row. */
.mobile-ui button[data-gallery-choice][data-gallery-style="pedal"]{height:128px!important;padding:3px!important;--selected-art-height:112px}

/* Additional exact choices retain native status, price, character and menu captions. */
button[data-gallery-choice]:is([data-gallery-style="compact"],[data-gallery-style="fullscreen"],[data-gallery-style="tab"],[data-gallery-style="rev"],[data-gallery-style="action"]){font-size:0!important;color:transparent!important;line-height:0!important;padding:4px!important}
button[data-gallery-choice]:is([data-gallery-style="compact"],[data-gallery-style="fullscreen"],[data-gallery-style="tab"],[data-gallery-style="rev"],[data-gallery-style="action"],[data-gallery-style="status"])::before{content:"";display:block;pointer-events:none;height:var(--selected-art-height,116px);width:100%;background:var(--selected-button-art) center/contain no-repeat}
button[data-gallery-choice][data-gallery-style="compact"]{--selected-art-height:80px;min-width:144px}
button[data-gallery-choice][data-gallery-style="tab"]{--selected-art-height:104px;min-width:0}
button[data-gallery-choice][data-gallery-style="tab"][aria-pressed="true"]{outline:2px solid #ffe1a3;outline-offset:-2px}
button[data-gallery-choice][data-gallery-style="fullscreen"]{--selected-art-height:72px;width:124px!important;min-width:124px!important}
button[data-gallery-choice][data-gallery-style="fullscreen"][aria-label="Exit fullscreen"]::after{content:"EXIT";position:absolute;right:2px;bottom:1px;font:700 8px/1 sans-serif;color:#ffe4b3;background:#122725}
button[data-gallery-choice][data-gallery-style="status"]{font-size:12px!important;line-height:1.3!important;color:#ffe4b3!important;padding:6px!important;--selected-art-height:116px;white-space:normal}
button[data-gallery-choice][data-gallery-style="status"]::before{margin-bottom:4px}
button[data-gallery-choice][data-gallery-style="status"] small{font-size:10px!important;line-height:1.2!important;color:#dbe7d5!important}
button[data-gallery-choice][data-gallery-style="action"]{--selected-art-height:212px;min-width:250px;max-width:100%;width:100%}
button[data-gallery-choice][data-gallery-style="rev"]{--selected-art-height:72px;min-width:108px;touch-action:none}
button#car-rev[data-gallery-choice]{position:absolute!important;height:88px;width:120px}
button[data-gallery-choice][data-gallery-style="destination"]{padding:3px!important;gap:1px!important;border-radius:3px!important}
button[data-gallery-choice][data-gallery-style="destination"] svg{display:none}
button[data-gallery-choice][data-gallery-style="destination"]::before{content:"";display:block;pointer-events:none;height:68px;width:100%;flex-shrink:0;background:var(--selected-button-art) center/contain no-repeat}
button[data-gallery-choice][data-gallery-style="character"]{position:absolute!important}
button[data-gallery-choice][data-gallery-style="character"]>img,button[data-gallery-choice][data-gallery-style="character"]>.player-plus{display:none}
button[data-gallery-choice][data-gallery-style="character"]::before{content:"";display:block;pointer-events:none;width:84px;height:88px;flex:none;background:var(--selected-button-art) center/contain no-repeat}
@media(max-width:600px){button[data-gallery-choice][data-gallery-style="action"]{--selected-art-height:166px}button[data-gallery-choice][data-gallery-style="status"]{--selected-art-height:100px}button[data-gallery-choice][data-gallery-style="destination"]::before{height:48px}}
@media(orientation:landscape) and (max-height:430px){button[data-gallery-choice][data-gallery-style="destination"]::before{height:42px}button[data-gallery-choice][data-gallery-style="tab"]{--selected-art-height:76px}}
/* Restore the existing native car/build tabs for the selected touch-layout controls. */
.mobile-ui .garage-tabs:has(button[data-gallery-choice]){display:flex!important}
.mobile-ui .studio-sidebar[data-panel="cars"] .studio-build{display:none!important}
.mobile-ui .studio-sidebar[data-panel="build"] .roster{display:none!important}

/* Two-times artwork layout: reserve space rather than transform hit targets. */
button[data-gallery-choice]{flex-shrink:0;max-width:none}
button[data-gallery-choice][data-gallery-style="part"]{flex-wrap:wrap}
button[data-gallery-choice][data-gallery-style="engine"]{height:88px!important}
button#car-rev[data-gallery-choice]{height:88px;width:120px}
.garage-destinations{height:auto;min-height:172px;grid-template-columns:repeat(5,minmax(130px,1fr));overflow-x:auto;align-items:stretch}
.studio-hero{--garage-dock:172px}
.mobile-ui .studio-hero{--garage-dock:140px}
.mobile-ui .garage-destinations{min-height:140px;grid-template-columns:repeat(5,minmax(120px,1fr))}
button[data-gallery-choice][data-gallery-style="character"]{min-width:100px;min-height:100px}
button[data-gallery-choice][data-gallery-style="destination"]::before{min-width:100px}
button[data-gallery-choice]:is([data-gallery-style="course"],[data-gallery-style="mode"]){min-width:220px}
button[data-gallery-choice][data-gallery-style="course"]:not(:has(b)){width:100%}
.mobile-ui button[data-gallery-choice][data-gallery-style="pedal"]{height:128px!important;min-width:108px}
@media(max-width:600px){
 button[data-gallery-choice]:is([data-gallery-style="course"],[data-gallery-style="mode"]){min-width:200px}
 .model-grid,.mode-grid,.race-choices{grid-template-columns:1fr}
}
/* Keep doubled pedals separate from steering and boost hit areas. */
.mobile-ui .mobile-drive button[data-hold="arrowup"]{width:108px;right:var(--safe-right)}
.mobile-ui .mobile-drive button[data-hold="arrowdown"]{width:108px;right:calc(var(--safe-right) + 116px)}
.mobile-ui .mobile-drive button[data-hold="shift"]{bottom:calc(var(--safe-bottom) + 136px)}
.mobile-ui .race-top{flex-wrap:wrap}
.mobile-ui .race-event{flex-basis:100%}
.mobile-ui .race-position,.mobile-ui .race-speed,.mobile-ui #minimap,.mobile-ui .race-objective{top:166px}
.mobile-ui .race-controls{bottom:calc(var(--safe-bottom) + 202px)}
.mobile-ui .condition-note{bottom:calc(var(--safe-bottom) + 250px)}
.mobile-ui .race-times{bottom:calc(var(--safe-bottom) + 172px)}
.course-options,.setting-group,.studio-views{flex-wrap:wrap}
.mobile-ui .setting-group,.mobile-ui .course-options{display:grid;grid-template-columns:1fr}
@media(max-width:380px){
 .mobile-ui .mobile-drive [data-hold="arrowleft"],.mobile-ui .mobile-drive [data-hold="arrowright"]{bottom:calc(var(--safe-bottom) + 136px)}
 .mobile-ui .mobile-drive [data-hold=" "]{bottom:calc(var(--safe-bottom) + 200px)}
}
.studio-views{right:16px;max-width:calc(100% - 36px)}
@media(max-width:600px){
 .studio-hero,.mobile-ui .studio-hero{height:760px!important;min-height:760px;--studio-heading-height:270px;--garage-dock:282px}
 .garage-destinations,.mobile-ui .garage-destinations{grid-template-columns:repeat(2,minmax(0,1fr));height:282px;min-height:282px;overflow:visible}
 .garage-destination{min-height:94px}
 .mobile-ui .studio{display:block;overflow:auto}
 .mobile-ui .studio-sidebar{overflow:visible;max-height:none}
 .studio-views,.mobile-ui .studio-views{right:16px;flex-wrap:wrap}
 .mobile-ui .mobile-bar{height:auto;min-height:88px;flex-wrap:wrap}
}
/* Existing fixed-height utility rules must grow with their artwork. */
button[data-gallery-choice]:not([data-gallery-style="engine"]):not([data-gallery-style="character"]):not([data-gallery-style="pedal"]){height:auto!important;min-height:calc(var(--selected-art-height,44px) + 12px)!important}
.studio-views{align-items:center}
@media(max-width:600px){.studio-views{gap:8px}.studio-hero,.mobile-ui .studio-hero{--studio-heading-height:280px}}
button[data-gallery-choice][data-gallery-style="status"]{min-width:216px}
button[data-gallery-choice][data-gallery-style="tab"]{min-width:150px}
button[data-gallery-choice][data-gallery-style="tune"]{min-width:180px}
.mobile-ui .garage-tabs{flex-wrap:wrap}
.mobile-ui .mobile-menu-grid{grid-template-columns:1fr}
.mobile-ui .mobile-drive button[data-hold="shift"]{bottom:calc(var(--safe-bottom) + 190px)}
.mobile-ui .race-controls{bottom:var(--safe-bottom)}
.mobile-ui .race-times{bottom:calc(var(--safe-bottom) + 254px)}
.mobile-ui .condition-note{bottom:calc(var(--safe-bottom) + 296px)}
@media(max-width:600px){
 .mobile-ui .race-top{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:center}
 .mobile-ui .race-event{grid-column:1/-1}
 .mobile-ui .race-position,.mobile-ui .race-speed,.mobile-ui #minimap{top:250px}
 .mobile-ui .race-objective{top:325px}
 .mobile-ui .race-top .race-utility{width:100%}
}
.desktop-ui .studio-hero{--garage-dock:172px;--studio-heading-height:220px;min-height:700px;height:700px}
@media(max-width:600px){.desktop-ui .studio-hero{--garage-dock:282px;--studio-heading-height:280px;min-height:760px;height:760px}}
.mobile-ui{--bar-height:88px}
/* Short landscape viewports scroll the play area instead of shrinking artwork. */
@media(max-height:600px) and (orientation:landscape){
 html.touch-root{overflow-y:auto}
 body.mobile-ui{height:auto;min-height:100dvh;overflow-y:auto}
 .mobile-ui.v2 main{height:740px}
 .mobile-ui .race-shell{min-height:740px}
 .mobile-ui .race-top{display:flex;flex-wrap:wrap}
 .mobile-ui .race-event{flex-basis:100%}
 .mobile-ui .race-position,.mobile-ui .race-speed,.mobile-ui #minimap{top:190px}
 .mobile-ui .race-objective{top:270px}
}

/* Landscape garage needs a full-height bay before its workshop panel. */
@media(max-height:600px) and (orientation:landscape){
 .mobile-ui .studio{display:block;height:auto;overflow:visible}
 .mobile-ui .studio-hero{height:760px!important;min-height:760px;--studio-heading-height:280px;--garage-dock:140px}
 .mobile-ui .studio-sidebar{overflow:visible;max-height:none}
}
/* Match the original width-limited artwork, including its unscaled padding. */
button[data-gallery-choice][data-gallery-style="plain"]::before{width:134.375px;margin-inline:auto}
button[data-gallery-choice][data-gallery-style="pause"]::before{width:100px;margin-inline:auto}
@media(max-width:600px){button[data-gallery-choice][data-gallery-style="pause"]::before{width:70px}}
@media(max-height:600px) and (orientation:landscape){
 .mobile-ui[data-game-mode="race"] main,.mobile-ui[data-game-mode="drag"] main{height:calc(100dvh - 88px)}
 .mobile-ui .race-shell{height:100%;min-height:0}
 .mobile-ui .race-top{flex-wrap:nowrap;align-items:start}
 .mobile-ui .race-event{flex-basis:auto;flex:1;min-width:0}
 .mobile-ui .race-position,.mobile-ui .race-speed,.mobile-ui #minimap{top:130px}
 .mobile-ui .race-speed{right:250px}
 .mobile-ui .race-objective{top:130px;max-width:180px;font-size:12px}
 .mobile-ui .race-objective b{font-size:16px}
 .mobile-ui .race-times,.mobile-ui .condition-note{top:210px;bottom:auto}
 .mobile-ui .race-controls{bottom:var(--safe-bottom)}
 .mobile-ui .mobile-drive button[data-hold="shift"]{right:var(--safe-right);bottom:calc(var(--safe-bottom) + 136px)}
 .mobile-ui .race-card{min-height:0;max-height:calc(100dvh - 112px);margin:0 auto;align-self:start;overflow:auto}
}
@media(max-height:600px) and (orientation:landscape){
 .mobile-ui .mobile-drive button[data-hold="shift"]{left:calc(var(--safe-left) + 150px);right:auto;bottom:calc(var(--safe-bottom) + 64px)}
}
@media(max-width:600px){
 button[data-gallery-choice][data-gallery-style="mode"] b{max-width:calc((100vw - 94px) / 3 * 2);margin-inline:auto}
}
/* Two old half-row content boxes fit in one new row, excluding old padding twice. */
.mechanical-buttons:has([data-gallery-style="tune"]){flex-wrap:wrap}
.mechanical-buttons button[data-gallery-style="tune"]{flex:0 0 100%;min-width:0}
.mechanical-buttons button[data-gallery-style="tune"]::before{width:calc(100% - 22px);margin-inline:auto}
.mobile-ui .mechanical-buttons button[data-gallery-style="tune"]::before{width:calc(100% - 19px)}
/* Let wide launch illustrations use the existing horizontal padding space. */
button[data-gallery-choice][data-gallery-style="launch"]::before{width:calc(100% + 12px);margin-inline:-6px}
@media(max-height:600px) and (orientation:landscape){
 .mobile-ui .race-objective{left:var(--safe-left);top:90px;transform:none;width:210px;max-width:210px;font-size:10px}
 .mobile-ui .race-objective b{font-size:12px;display:inline}
 .mobile-ui .condition-note{top:117px;left:var(--safe-left);right:auto;max-width:220px;font-size:7px}
 .mobile-ui .race-times{top:120px;left:170px;transform:none;gap:8px;font-size:6px}
 .mobile-ui .race-times b{font-size:12px;margin-top:1px}
}
@media(max-height:600px) and (orientation:landscape){
 .mobile-ui .rival-gap,.mobile-ui .practice-coach{left:var(--safe-left);top:60px;transform:none;width:210px;max-width:210px;font-size:10px;padding:5px}
}
/* Preserve the original three-column artwork limit while stacking larger choices. */
.setting-group:has(button[data-gallery-style="mode"]){display:grid;grid-template-columns:1fr}
.setting-group button[data-gallery-style="mode"]{min-width:0;width:100%}
.setting-group button[data-gallery-style="mode"] b{width:calc((100% - 40px) / 3 * 2);max-width:none;margin-inline:auto}
@media(max-width:760px){.setting-group button[data-gallery-style="mode"] b{width:calc((100% - 34px) / 3 * 2)}}
.mobile-ui .race-card .setting-group button[data-gallery-style="mode"] b{width:calc((100% - 36px) / 3 * 2)}
@media(max-height:600px) and (orientation:landscape){
 .mobile-ui .race-objective{width:150px;max-width:150px}
 .mobile-ui .condition-note{max-width:150px}
}
