/* A new composition, scoped to the garage; race controls keep their layout. */
body.live-garage #menu,body.live-garage #menu.has-art{background:radial-gradient(ellipse at 54% 44%,#fffdf8 0,#f4f0e9 45%,#e1d5ee 100%)!important;display:grid!important;grid-template-rows:auto minmax(220px,1fr) auto auto;gap:10px;padding:22px clamp(18px,4vw,60px);overflow:auto;min-height:100%;color:#43215f}
body.live-garage #menu{grid-template-columns:minmax(0,1fr)!important;grid-template-areas:none!important;grid-auto-flow:row!important}
body.live-garage #menu[hidden]{display:none!important}
#garage-top{display:flex;align-items:center;justify-content:space-between;gap:16px;position:relative;z-index:2}
#garage-top h1{font:800 clamp(23px,4vw,38px)/1.1 ui-rounded,'Arial Rounded MT Bold','Trebuchet MS',sans-serif;letter-spacing:-1px;text-transform:none;color:#43215f;margin:0}
#garage-top .menu-tools{display:flex;margin:0;gap:8px}
#garage-top .menu-tools button{background:transparent!important;border:0!important;border-radius:12px;color:#43215f!important;padding:10px 14px;min-height:44px;font:700 14px 'Trebuchet MS',sans-serif}
#garage-top #profile-label{font-size:12px;display:block;margin:5px 0 0;color:#765b88}
#garage-stage{position:relative;min-height:260px;isolation:isolate}
#garage-canvas{width:100%;height:calc(100% - 130px);min-height:180px;display:block;position:absolute;top:0;left:0}
#garage-partner{position:absolute;right:2%;bottom:11%;width:clamp(85px,17%,190px);height:70%;max-height:290px;padding:0;border:0;background:none;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;color:#43215f;filter:drop-shadow(0 12px 9px #43215f20)}
#garage-partner img{object-fit:contain;min-height:0;max-width:100%;height:88%;width:100%}
#garage-partner[data-kind=kumka]{height:43%;right:5%}
#garage-partner span{font-size:16px;background:#fffdf8e6;border-radius:30px;padding:8px 16px;white-space:nowrap;border:1px solid #ddd0e8}
#garage-partner:focus-visible{outline:3px solid #7040ab;outline-offset:6px}
.car-nav{position:absolute;top:43%;width:52px;height:58px;border:1px solid #cdbddd;border-radius:18px;background:#fffdf8e8;color:#7040ab;font-size:35px;z-index:3;box-shadow:0 4px 18px #43215f0e}
#car-prev{left:0}#car-next{right:0}
#garage-caption{text-align:center;position:absolute;bottom:0;left:0;right:0;z-index:2;pointer-events:none;margin:0;padding:0 20%}
#garage-caption h2{font:800 clamp(28px,4vw,44px)/1 ui-rounded,'Trebuchet MS',sans-serif;margin:0 0 8px;color:#43215f}
#vehicle-summary{display:block;font-size:14px;color:#654778}
#garage-specs{display:flex;justify-content:center;gap:18px;margin-top:12px;font-family:'Trebuchet MS',sans-serif}
#garage-specs span{display:flex;align-items:center;gap:6px;font-size:13px;color:#654778}
#garage-specs b{font-size:20px;color:#43215f}#garage-specs i{font-size:10px;font-style:normal}
#car-dots{display:flex;justify-content:center;gap:9px;margin:12px 0 0;pointer-events:auto;flex-wrap:wrap}
#car-dots button{width:26px;height:26px;border-radius:50%;border:3px solid #fffdf8;background:var(--car-color);box-shadow:0 0 0 1px #cbb8db;padding:0}
#car-dots button[aria-pressed=true]{box-shadow:0 0 0 3px #7040ab;transform:scale(1.1)}
#garage-launch{display:flex;align-items:center;justify-content:center;gap:20px;position:relative;z-index:2;margin:6px 0 0}
#garage-launch #start{width:clamp(200px,33vw,380px);min-height:68px;border-radius:20px!important;font-size:28px!important;justify-content:center;background:#ffb44c!important;color:#43215f!important;box-shadow:0 5px 0 #d98d29!important;letter-spacing:0}
body.live-garage #menu .race-card{position:static!important;display:flex!important;align-items:center;gap:12px;padding:0!important;margin:0!important;background:transparent!important;box-shadow:none!important;border:0!important;width:auto!important;max-width:320px;backdrop-filter:none;cursor:pointer}
body.live-garage #menu .race-card h2{font-size:16px!important;margin:0 0 5px!important}
body.live-garage #menu .race-card .track-meta{display:flex!important;font-size:11px!important;color:#765b88;gap:8px;flex-wrap:wrap}
body.live-garage #menu .card-bottom{display:block!important;margin:0!important}
body.live-garage #menu #menu-map{width:95px!important;height:65px!important}
body.live-garage #menu .race-card #track-difficulty,body.live-garage #menu #best,body.live-garage #menu #world-logo,body.live-garage #menu #cup-label,body.live-garage #menu #track-features,body.live-garage #menu .new-routes{display:none!important}
#garage-foot{font-size:12px;color:#806894;display:flex;justify-content:center;gap:8px;min-height:24px;margin:4px 0 0}
#garage-foot span{display:block}#garage-foot #driver-current{color:#43215f}
#menu .garage-legacy{display:none!important}
#garage-stage #garage-partner{bottom:145px;max-height:240px}
#garage-stage #garage-specs b{display:inline!important;visibility:visible!important;opacity:1!important}
#garage-caption #garage-type{font-size:13px;color:#765b88}
@media(max-width:600px){#garage-stage #garage-caption{margin:0}#garage-stage #garage-partner{bottom:155px;max-height:140px}}
@media(min-aspect-ratio:19/9) and (max-height:600px){#garage-stage #garage-canvas{height:100%;min-height:160px}#garage-stage #garage-partner{bottom:3%;max-height:175px}#garage-stage #garage-caption{right:auto}}
#touch-flight{background:#c3e867!important;color:#43215f!important}
#offline-state,#learning-state{font-size:13px;color:#654778;line-height:1.4}
.settings-extra{border-top:1px solid #ded1e6;padding-top:14px;margin-top:18px;display:grid;gap:10px}
.settings-extra button,.settings-extra a{background:#eee4f7;color:#43215f;border:0;border-radius:12px;padding:12px;text-decoration:none;text-align:center;min-height:44px;font-weight:700}
@media(max-width:600px){body.live-garage #menu{padding:14px 16px;gap:5px;grid-template-rows:auto minmax(240px,1fr) auto auto}#garage-top .menu-tools button{font-size:12px;padding:8px}#garage-partner{right:4%;width:22%;max-height:175px;height:62%;bottom:30%}#garage-partner[data-kind=kumka]{height:32%;bottom:32%}#garage-partner span{font-size:12px;padding:6px 10px}#garage-caption{padding:0 8%;margin-top:220px}#garage-caption h2{font-size:30px}#garage-specs{gap:12px}#garage-specs span{font-size:11px}#garage-launch{flex-direction:column-reverse;gap:10px}#garage-launch #start{width:100%;min-height:64px}#garage-launch .race-card{width:100%!important;max-width:none!important;justify-content:center}#garage-top h1{font-size:25px}.car-nav{width:44px;height:48px;top:38%}#car-dots{gap:7px}#car-dots button{width:23px;height:23px}#garage-foot{font-size:11px}}
@media(min-aspect-ratio:19/9) and (max-height:600px){body.live-garage #menu{grid-template-rows:45px minmax(170px,1fr) 58px 20px;padding:8px 35px;gap:4px}#garage-caption{position:absolute;left:0;bottom:14px;text-align:left;padding:0;width:25%;margin:0}#garage-caption h2{font-size:29px}#garage-specs{justify-content:flex-start;gap:10px}#car-dots{justify-content:flex-start;gap:6px}#car-dots button{width:18px;height:18px}#garage-canvas{min-height:160px}#garage-stage{min-height:160px}#garage-partner{right:7%;bottom:3%;height:94%;max-height:210px}#garage-partner[data-kind=kumka]{height:57%}#car-prev{left:29%}#car-next{right:27%}.car-nav{top:40%;width:40px;height:44px}#garage-launch{margin:0}#garage-launch #start{min-height:52px;font-size:24px!important;width:280px}#garage-top h1{font-size:25px}#garage-top #profile-label{display:none}}

/* Keep the scene and caption in separate, non-overlapping rows even inside a short portal frame. */
body.live-garage #menu{grid-template-rows:auto minmax(310px,1fr) auto auto!important;padding:16px clamp(18px,4vw,60px)!important}
#garage-stage{min-height:0!important}#garage-partner{max-height:calc(100% - 150px)!important}
@media(max-height:600px) and (max-aspect-ratio:19/9){body.live-garage #menu{grid-template-rows:44px minmax(250px,1fr) 70px 20px!important;gap:6px!important;padding:12px 24px!important}#garage-top #profile-label{display:none}#garage-top h1{font-size:27px}#garage-stage #garage-canvas{height:calc(100% - 108px);min-height:0}#garage-caption{height:103px;padding:0 10%;}#garage-caption h2{font-size:28px;margin-bottom:4px}#garage-specs{margin-top:6px}#garage-specs b{font-size:17px}#car-dots{margin-top:8px}#car-dots button{width:22px;height:22px}#garage-stage #garage-partner{bottom:118px;height:110px;max-height:110px!important}#garage-partner span{font-size:12px;padding:5px 10px}.car-nav{top:20%}#garage-foot{min-height:20px;margin:0}}
@media(min-aspect-ratio:19/9) and (max-height:600px){body.live-garage #menu{grid-template-rows:40px minmax(160px,1fr) 54px 18px!important;gap:4px!important;padding:8px 30px!important}#garage-stage #garage-partner{max-height:160px!important}#garage-stage #garage-canvas{height:100%;min-height:0}}

@media(max-width:600px) and (min-height:601px){#garage-stage #garage-canvas{width:83%;height:calc(100% - 205px);min-height:170px}#garage-stage #garage-caption{height:200px;padding:0}#garage-stage #garage-partner{right:0;bottom:220px;height:125px;max-height:125px!important}#garage-partner span{font-size:11px;padding:5px 8px}#car-dots{display:grid;grid-template-columns:repeat(5,44px);gap:6px;justify-content:center}#car-dots button{width:44px;height:44px}#garage-foot span:last-child,#garage-foot span:nth-child(2){display:none}}

body.offline-game #pause{display:grid!important}body.offline-game #garage-tools{display:flex;align-items:center;gap:8px}

body:not(.live-garage) #menu{visibility:hidden}
@media(max-width:600px) and (min-height:601px){#garage-stage .car-nav{top:18%}}
@media(min-width:701px){#hud #driver-badge{top:120px}}

/* Reserve the visible site header; garage controls must remain reachable below it. */
body.live-garage:not(.embedded) #menu{padding-top:96px!important}
@media(max-width:700px){body.live-garage:not(.embedded) #menu{padding-top:82px!important}}
@media(max-height:600px){body.live-garage #menu{grid-template-rows:auto minmax(250px,1fr) auto auto!important}}
@media(min-aspect-ratio:19/9) and (max-height:600px){body.live-garage #menu{grid-template-rows:auto minmax(160px,1fr) auto auto!important}}
body.live-garage.embedded #menu{padding-top:16px!important}

/* The same pedal symbols as the race, with comparable actual-speed bars. */
#garage-specs>.garage-stat{display:grid;grid-template-columns:18px auto;grid-template-areas:"symbol number" "meter meter";column-gap:5px;row-gap:3px;min-width:65px;--stat-color:#86b84b}
#garage-specs>.garage-stat[data-tier=turbo]{--stat-color:#309db2}
#garage-specs>.garage-stat[data-tier=nitro]{--stat-color:#c68025}
#garage-specs .garage-stat-symbol{grid-area:symbol;font-size:18px;color:#43215f}
#garage-specs .garage-stat-number{grid-area:number;display:flex;justify-content:center;gap:3px}
#garage-specs .garage-stat-meter{grid-area:meter;display:block;width:100%;height:5px;background:#d9cde5;border-radius:5px;overflow:hidden}
#garage-specs .garage-stat-meter i{display:block;height:100%;background:var(--stat-color);border-radius:5px}
@media(max-height:600px) and (max-aspect-ratio:19/9){#garage-caption{height:116px}#garage-stage #garage-canvas{height:calc(100% - 121px)}#garage-stage #garage-partner{bottom:131px}}
@media(min-aspect-ratio:19/9) and (max-height:600px){
 #garage-stage #garage-specs{flex-wrap:nowrap;gap:6px!important}
 #garage-specs>.garage-stat{min-width:0;grid-template-columns:12px auto;column-gap:3px}
 #garage-specs .garage-stat-symbol{font-size:14px}
 #garage-specs .garage-stat-number{gap:2px}
 #garage-stage #garage-specs .garage-stat-number b{font-size:16px!important}
 #garage-specs .garage-stat-number i{font-size:8.5px}
 body.live-garage:not(.embedded) #menu{padding-top:80px!important}
 #garage-top .menu-tools button{padding:6px 8px;font-size:12px;min-height:44px}
}
