/* One title treatment, over real gameplay, shared by the arcade and web games. */
.game-loading{position:absolute;inset:0;z-index:9;display:grid;place-items:center;overflow:auto;padding:24px;background:radial-gradient(ellipse at 50% 25%,#20344b,#060c18 70%);color:#f5f7ff;font:16px/1.5 system-ui,sans-serif;text-align:center;touch-action:manipulation}
.game-loading[hidden],.game-loading [hidden]{display:none!important}body>.game-loading{position:fixed;z-index:100}
.loading-card{box-sizing:border-box;width:min(100%,420px);margin:auto;padding:clamp(20px,5vw,40px);border:1px solid #52677d;border-radius:20px;background:#101b2de8;box-shadow:0 20px 80px #0006}
.loading-card h2{margin:18px 0 8px;font-size:clamp(1.8rem,5vw,2.6rem);font-weight:800;letter-spacing:-.04em;line-height:1.15;color:#f5f7ff}
.loading-card p{margin:12px 0;color:#bccce3;overflow-wrap:anywhere}.loading-card .loading-title{font-size:1.1rem;font-weight:700;color:#e0f5b9}.loading-card [role=status]{min-height:3em}
.loading-spinner{box-sizing:border-box;display:block;width:48px;height:48px;margin:auto;border:4px solid #c9fa6533;border-top-color:#c9fa65;border-radius:50%;animation:loading-spin 1s linear infinite}
.loading-card progress{display:block;width:100%;height:10px;margin:20px 0 24px;border:0;border-radius:8px;accent-color:#c9fa65;overflow:hidden;background:#2a3b53}
.loading-card progress::-webkit-progress-bar{background:#2a3b53}.loading-card progress::-webkit-progress-value{background:#c9fa65}.loading-card progress::-moz-progress-bar{background:#c9fa65}
.loading-card button,.loading-card a{box-sizing:border-box;display:inline-flex;justify-content:center;align-items:center;min-height:44px;margin:4px;padding:10px 20px;border:1px solid #9baec8;border-radius:8px;background:#182b45;color:#f5f7ff;font:600 16px/1.4 system-ui,sans-serif;text-decoration:none;cursor:pointer}
.loading-card button:focus-visible,.loading-card a:focus-visible{outline:3px solid #c9fa65;outline-offset:3px}
@keyframes loading-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.loading-spinner{animation:none}}
@media(max-height:480px){.game-loading{padding:12px}.loading-card{padding:16px 24px}.loading-spinner{width:32px;height:32px}.loading-card h2{font-size:1.8rem;margin:10px 0 8px}.loading-card p{margin:8px 0}.loading-card [role=status]{min-height:1.5em}.loading-card progress{margin:12px 0}}
.arcade-home{position:absolute;z-index:8;isolation:isolate;overflow:hidden;container-type:inline-size;background:#040915;color:#fff7e8;pointer-events:auto}
.arcade-home::before{content:'';position:absolute;inset:2.5%;border:1px solid #e5eaff38;box-shadow:inset 0 0 0 5px #07102230;pointer-events:none}
.home-title-art{position:absolute;left:6%;top:4%;width:78%;max-width:1050px;filter:drop-shadow(0 5px 12px #000b)}
.game-logo{--title-colour:#ffcf7a;--title-light:#c6eaff;position:relative;width:100%;color:var(--title-colour);text-align:left;line-height:1}
.game-emblem{width:clamp(130px,29cqw,390px);margin-left:2%;opacity:.95;filter:drop-shadow(0 0 12px color-mix(in srgb,var(--title-colour) 38%,transparent))}.game-emblem svg{display:block;width:100%;height:auto}
.logo-strap{font:800 clamp(8px,1.1cqw,19px)/1.4 system-ui,sans-serif;letter-spacing:.22em;margin:0 0 1.2%;color:var(--title-light);text-shadow:0 2px 3px #000}
.logo-words{font:1000 italic clamp(30px,8.9cqw,190px)/.82 Impact,'Arial Black',system-ui,sans-serif;letter-spacing:-.045em;transform:skewY(-3deg);transform-origin:left bottom;white-space:nowrap}
.logo-words span{display:block;width:max-content;max-width:100%;padding-right:.15em;background:linear-gradient(#fffbea 2%,var(--title-light) 26%,var(--title-colour) 54%,#5d4776 56%,var(--title-colour) 74%,#fff4ce 93%);background-clip:text;-webkit-background-clip:text;color:transparent;-webkit-text-stroke:clamp(1px,.15cqw,3px) #fff4d999;filter:drop-shadow(3px 4px 0 #080d1d) drop-shadow(1px 2px 0 var(--title-colour))}
.logo-native-title{font:600 clamp(9px,1.15cqw,22px)/1.4 system-ui,sans-serif;color:#f7f2e5;letter-spacing:.05em;margin:3.4% 0 0;max-width:80%;text-shadow:0 2px 3px #000}
.game-logo[data-game=type-in-061-star-swarm] .logo-words{letter-spacing:.02em;transform:skewY(-4deg)}.game-logo[data-game=invaders] .logo-words,.game-logo[data-game=defender-campaign] .logo-words{font-size:clamp(26px,7.7cqw,160px)}
.game-logo[data-game=potato-octopus] .logo-words{font-size:clamp(22px,7cqw,160px);transform:rotate(-2deg);letter-spacing:-.05em}.game-logo[data-game=aroids2] .logo-words span:first-child,.game-logo[data-game=aroids-campaign] .logo-words span:first-child{font-size:.48em;font-style:normal;letter-spacing:.03em;margin-bottom:1.5%}
.home-actions{position:absolute;left:6%;bottom:7%;display:flex;flex-wrap:wrap;gap:12px;align-items:center;max-width:88%}.home-actions button{font:800 clamp(12px,1.4cqw,25px)/1.2 system-ui,sans-serif;min-height:44px;padding:.8em 1.25em;border:1px solid #d6e9ff78;border-radius:4px;box-shadow:0 4px #020611;background:#11223be8;color:#f5f4e9;cursor:pointer}.home-actions .primary{background:#f6d078;color:#141b27;border-color:#fff0b3}.home-key-hint{position:absolute;bottom:1.4%;left:6%;font:600 clamp(9px,1cqw,16px) system-ui;color:#c4d2e3}.clean-title .home-actions,.clean-title .home-key-hint{display:none}.clean-title .home-title-art{top:5%}.home-open~.game-controls,.home-open .game-controls{visibility:hidden}
#screen-stage.home-open~#game-menu-button,#game-frame:has(#arcade-home:not([hidden]))>.game-menu-button,#game-frame:has(#arcade-home:not([hidden]))>#game-menu-button,#game-frame:has(#arcade-home:not([hidden]))>.game-controls{visibility:hidden}
@media(max-height:500px){.home-title-art{top:2%;width:70%}.game-emblem{width:clamp(80px,20cqw,180px)}.logo-words{font-size:clamp(28px,8cqw,94px)}.home-actions{bottom:8%;gap:7px}.home-actions button{padding:.6em .9em;min-height:40px}.logo-native-title{margin-top:2%}.clean-title .home-title-art{top:2%}}
@media(prefers-reduced-motion:no-preference){.arcade-home:not(.clean-title) .home-title-art{animation:home-arrive .3s ease-out both}@keyframes home-arrive{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}}

body:has(#world).home-open #overlay,body:has(#world).home-open #hud,body:has(#world).home-open .touch-controls,body:has(#world).home-open .standalone-home-button{visibility:hidden}
body:has(#world)>.arcade-home{position:fixed;z-index:30}
.standalone-home-button{position:fixed;right:16px;top:16px;z-index:6;min-width:64px;min-height:44px;padding:10px 16px;background:#10243de0;border:1px solid #d5e7ff80;border-radius:5px;color:white;font:700 16px system-ui}.home-open>.standalone-home-button{visibility:hidden}
.fuzzy-title-logo{width:clamp(200px,22vw,440px);margin:0}.fuzzy-title-logo .game-emblem{width:60%}.fuzzy-title-logo .logo-words{font-size:clamp(44px,6vw,100px)}.fuzzy-title-logo .logo-strap{font-size:10px}.fuzzy-title-logo .logo-native-title{display:none}

.home-scene{position:absolute;inset:0;width:100%;height:100%;z-index:-2;object-fit:fill;pointer-events:none}
.arcade-home::after{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,#020612b0 0%,#03091960 42%,#05091510 85%),linear-gradient(0deg,#03071180,transparent 42%);pointer-events:none}
.home-snapshot>canvas{display:none!important}

body:has(#world).home-open>.topbar{visibility:hidden}

body.home-snapshot{min-height:100dvh}.standalone-stage{aspect-ratio:16/9}

body:has(#world) .top-actions .standalone-home-button{position:static;min-width:44px;min-height:44px;padding:8px 10px}
@media(max-width:600px){body:has(#world) .topbar{gap:8px;padding-inline:12px}body:has(#world) .topbar .build,body:has(#world) .brand span,body:has(#world) .options-shortcut span:last-child{display:none}body:has(#world) .top-actions .standalone-home-button{padding-inline:8px;font-size:12px}}

/* The real game is the backdrop. Contrast belongs to the lettering and controls. */
.arcade-home::before,.arcade-home::after{display:none}
.home-title-art{filter:drop-shadow(0 2px 2px #07121dcc) drop-shadow(0 8px 18px #07121d66)}
.logo-strap{margin-bottom:2%;letter-spacing:.18em}
.logo-words{position:relative;z-index:1;font-weight:900;letter-spacing:-.035em}
.logo-words span{background:none;color:#fff3d6;-webkit-text-stroke:clamp(1px,.12cqw,2.5px) #102535;paint-order:stroke fill;filter:drop-shadow(2px 3px 0 #102535) drop-shadow(0 2px 0 var(--title-colour))}
.game-emblem:not(.game-mascots){color:var(--title-colour);filter:drop-shadow(0 2px 0 #07121d) drop-shadow(0 0 8px #07121d55)}
.character-portrait{display:block;flex:none;width:64px;aspect-ratio:1;background-image:url('./art/arcade-crew-v1.webp');background-repeat:no-repeat;background-size:200% 200%;background-position:0 0}
.character-portrait[data-character=carl]{background-position:100% 0}
.character-portrait[data-character=potato]{background-position:0 100%}
.character-portrait[data-character=octopus]{background-position:100% 100%}
.game-mascots{display:flex;align-items:flex-end;justify-content:center;gap:0;width:clamp(120px,27cqw,390px);margin:0 0 -1.5% 0;filter:none}
.game-mascots .character-portrait{width:100%;min-width:0;flex:1 1 0}
.game-mascots:has(.character-portrait:nth-child(2)){width:clamp(150px,36cqw,490px)}
.game-logo[data-game=fuzzy-racer] .game-mascots{margin-left:1%;margin-bottom:-2.5%}
.game-logo[data-game=type-in-041-coal-cart-carl] .game-mascots{width:clamp(100px,23cqw,310px)}
.home-actions button{background:#10283c40;border-color:#d6e9ff80;border-radius:12px;box-shadow:0 2px 12px #0003;color:#fff9e9;text-shadow:0 1px 3px #07121d}
.home-actions .primary{background:#f6d07838;border-color:#f6d078cc;color:#fff9e9}
.home-actions button:hover{background:#10283c88;border-color:#fff4ce}
.home-actions button:focus-visible{outline:3px solid #fff4ce;outline-offset:4px}
.home-key-hint{color:#edf5ff;text-shadow:0 1px 3px #07121d}
.standalone-home-button{background:#10243d40;backdrop-filter:none;text-shadow:0 1px 3px #07121d}
.fuzzy-title-logo{container-type:inline-size}
.fuzzy-title-logo .game-mascots{width:65%;margin-left:3%;margin-bottom:-5%}
.fuzzy-title-logo .logo-words{font-size:clamp(42px,27cqw,112px)}
.fuzzy-title-logo .logo-strap{font-size:clamp(7px,2.3cqw,10px)}
.fuzzy-title-logo .game-logo{filter:drop-shadow(0 3px 8px #07121d88)}
@media(max-height:500px){.game-mascots{width:clamp(70px,15cqw,160px)}.game-mascots:has(.character-portrait:nth-child(2)){width:clamp(100px,24cqw,240px)}}
@media(prefers-contrast:more){.home-actions button{background:#10283cbd;border-color:#fff}.home-actions .primary{background:#71551dcc}}

@media(orientation:landscape) and (max-height:580px){.fuzzy-title-logo{width:clamp(140px,22vw,220px)}.fuzzy-title-logo .game-mascots{width:44%;margin-bottom:-3%}.fuzzy-title-logo .logo-words{font-size:clamp(30px,24cqw,58px)}}

@media(max-height:500px){.game-logo[data-game=type-in-041-coal-cart-carl] .game-mascots{width:clamp(80px,15cqw,150px)}}

.game-loading{background:#07121d24;backdrop-filter:none}
.loading-card{background:#10233580;border-color:#c0dced88;box-shadow:0 12px 48px #0004;text-shadow:0 1px 3px #020a12}
.loading-card button,.loading-card a{background:#10283c40;border-color:#c0dced80}

/* Motion connects states; the live game remains still underneath the UI. */
:root{--ui-enter:280ms;--ui-exit:200ms;--ui-ease:cubic-bezier(.16,1,.3,1)}
:is(.arcade-home,.game-overlay,.game-loading,.overlay,#garage,#hud,#touch,#replay-controls)[hidden],dialog:not([open]){pointer-events:none;interactivity:inert}
@media(prefers-reduced-motion:no-preference){
 :is(.arcade-home,.game-overlay,.game-loading,.overlay,#garage,#hud,#touch,#replay-controls){opacity:1;transition:opacity var(--ui-enter) ease}
 :is(.arcade-home,.game-overlay,.game-loading,.overlay,#garage,#hud,#touch,#replay-controls)[hidden]{opacity:0;transition-duration:var(--ui-exit)}
 @starting-style{:is(.arcade-home,.game-overlay,.game-loading,.overlay,#garage,#hud,#touch,#replay-controls):not([hidden]){opacity:0}}
 /* Delay removal only when the outgoing controls can also become inert. */
 @supports(interactivity:inert){
  :is(.arcade-home,.game-overlay,.game-loading,.overlay,#garage,#hud,#touch,#replay-controls){transition:opacity var(--ui-enter) ease,display var(--ui-enter) allow-discrete}
  :is(.arcade-home,.game-overlay,.game-loading,.overlay,#garage,#hud,#touch,#replay-controls)[hidden]{transition-duration:var(--ui-exit)}
  dialog{transition:opacity var(--ui-enter) ease,translate var(--ui-enter) var(--ui-ease),display var(--ui-enter) allow-discrete,overlay var(--ui-enter) allow-discrete}
 }
 dialog{opacity:0;translate:0 10px}
 dialog[open]{opacity:1;translate:0 0}
 dialog:not([open]){transition-duration:var(--ui-exit)}
 @starting-style{dialog[open]{opacity:0;translate:0 10px}}
 dialog::backdrop{opacity:0;transition:opacity var(--ui-enter) ease,display var(--ui-enter) allow-discrete,overlay var(--ui-enter) allow-discrete}
 dialog[open]::backdrop{opacity:1}
 dialog:not([open])::backdrop{pointer-events:none}
 @starting-style{dialog[open]::backdrop{opacity:0}}
 :is(.menu-card,.loading-card,.overlay .modal){opacity:1;translate:0 0;transition:opacity var(--ui-enter) ease,translate var(--ui-enter) var(--ui-ease)}
 :is(.game-overlay,.game-loading,.overlay)[hidden] :is(.menu-card,.loading-card,.modal){opacity:0;translate:0 12px}
 @starting-style{:is(.game-overlay,.game-loading,.overlay):not([hidden]) :is(.menu-card,.loading-card,.modal){opacity:0;translate:0 12px}}
 .arcade-home:not(.clean-title) .home-title-art{animation:none;opacity:1;translate:0 0;transition:opacity var(--ui-enter) ease,translate 420ms var(--ui-ease)}
 .arcade-home[hidden]:not(.clean-title) .home-title-art{opacity:0;translate:0 -12px}
 @starting-style{.arcade-home:not([hidden]):not(.clean-title) .home-title-art{opacity:0;translate:0 22px}}
 .arcade-home:not([hidden]):not(.clean-title) .home-actions button{animation:ui-item-in 380ms var(--ui-ease) backwards;animation-delay:100ms}
 .home-actions button:nth-child(2){animation-delay:150ms!important}.home-actions button:nth-child(3){animation-delay:200ms!important}
}
@keyframes ui-item-in{from{opacity:0;translate:0 14px}to{opacity:1;translate:0 0}}
@keyframes ui-page-in{from{opacity:0;translate:0 8px}to{opacity:1;translate:0 0}}
@keyframes ui-logo-float{0%,100%{translate:0 0;rotate:-.5deg}50%{translate:0 -5px;rotate:.5deg}}
@keyframes ui-selection{0%{scale:.92}55%{scale:1.06}100%{scale:1}}
/* Frozen Home art has one exact final composition, including during capture. */
.arcade-home.clean-title,.arcade-home.clean-title *{animation:none!important;transition:none!important}
.arcade-home.clean-title{opacity:1;translate:none;scale:none}
:is(.home-actions button,.menu-card button,.loading-card button){transition:background 180ms ease,border-color 180ms ease,box-shadow 180ms ease,translate 160ms var(--ui-ease),scale 160ms var(--ui-ease)}
@media(hover:hover){:is(.home-actions button,.menu-card button,.loading-card button):hover{translate:0 -2px;box-shadow:0 5px 20px #05131c55,0 0 0 1px #f7e2ac55}}
:is(.home-actions button,.menu-card button,.loading-card button):active{translate:0 1px;scale:.975}
body[data-motion=off] :is(.arcade-home,.arcade-home *,.game-overlay,.game-loading,.overlay,#garage,#garage *,#hud,#touch,#replay-controls,dialog,dialog *,.game-card){animation:none!important;transition-duration:0s!important}
body[data-motion=off] dialog::backdrop{transition-duration:0s!important}
body.page-hidden :is(.game-card,.arcade-home .game-mascots),body.racing #garage .game-mascots{animation-play-state:paused!important}
@media(prefers-reduced-motion:reduce){
 :is(.arcade-home,.arcade-home *,.game-overlay,.game-loading,.overlay,#garage,#garage *,#hud,#touch,#replay-controls,dialog,dialog *,.game-card){animation:none!important;transition-duration:0s!important;translate:none!important;scale:none!important}
 dialog::backdrop{transition-duration:0s!important}
 button{translate:none!important;scale:none!important}
}
