/* Shared controls and motion. The board and the game viewport own their transforms. */
:root {
  --neo-ease: cubic-bezier(.2,.75,.25,1);
  --neo-panel: #212124;
  --neo-stroke: #39393c;
  --neo-focus: #ffd340;
}
:where(button,a,input,select,textarea,summary):focus-visible {
  outline: 2px solid var(--neo-focus);
  outline-offset: 3px;
}
:where(button,.button,summary) { touch-action: manipulation; }
:where(.community-page,.games-page,.workspace-page,.connect-page,.engine-guide) {
  scroll-margin-top: 5.5rem;
}
body:has(> #main),body:has(.home-brand) {background:#171719;color:#f4f4f5}
body:has(> #main) > header {
  background:#202023;
  backdrop-filter:none;
  border-bottom:1px solid var(--neo-stroke);
}
body:has(> #main) > header .brand {flex-shrink:0}
header nav a[aria-current=page] {background:#ffd34014;color:#ffdb5c}
body:has(> #main) header #account {max-width:14rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
:is(.search-row,.page-heading,.community-toolbar,.game-info) > * {min-width:0}
.search-row :is(input,select),#modal :is(input:not([type=checkbox]),textarea,select) {border-color:var(--neo-stroke)}
.search-row :is(input,select):focus,#modal :is(input,textarea,select):focus {border-color:#ddbd52}
.game-card,.home-card {background:var(--neo-panel);border-color:var(--neo-stroke);border-radius:14px}
:is(.builder-section,.engine-guide section,#unreal) {scroll-margin-top:5.5rem}
#unreal .game-info h3 {font-size:1.18rem;overflow-wrap:anywhere}
.game-info .actions {gap:.5rem}
.video-copy h3 {font-weight:680;letter-spacing:-.02em}
.video-thumb,.game-cover {isolation:isolate;border-radius:12px}
.video-thumb .play {pointer-events:none}
#main > .loading {display:flex;justify-content:center;align-items:center;gap:.8rem;min-height:35vh;color:#bfbfc3}
#main > .loading::before {content:"";width:1rem;height:1rem;border:2px solid #56565a;border-top-color:var(--neo-focus);border-radius:50%}
dialog {max-height:90dvh;overscroll-behavior:contain}
dialog::backdrop {background:rgb(7 7 10 / 72%)}
#ueProgress {accent-color:var(--neo-focus);width:100%}
@media(min-width:761px) and (max-width:1279px) {
  body:has(> #main) > header {gap:12px;padding-inline:16px}
  body:has(> #main) header nav {min-width:0;overflow-x:auto;scrollbar-width:thin}
  body:has(> #main) header nav a.sub-nav {margin-left:0}
}
@media(max-width:760px) {
  body:has(> #main) header nav {
    display:flex;align-items:stretch;gap:2px;height:calc(62px + env(safe-area-inset-bottom));
    padding:4px 6px calc(4px + env(safe-area-inset-bottom));background:#202023;
  }
  body:has(> #main) header nav a:not(.sub-nav) {flex:1 1 0;min-width:0;min-height:44px}
  body:has(> #main) header #account {max-width:26vw}
  body:has(> #main) #toast {bottom:calc(78px + env(safe-area-inset-bottom));width:max-content}
  .games-page .actions {flex-wrap:wrap}
  .search-row input,.search-row select,dialog input,dialog textarea,dialog select {font-size:16px}
}
@keyframes neo-rise {from{opacity:.55;translate:0 6px}to{opacity:1;translate:0 0}}
@keyframes neo-sheet {from{opacity:0;translate:0 8px;scale:.985}to{opacity:1;translate:0 0;scale:1}}
@keyframes neo-dim {from{opacity:0}to{opacity:1}}
@keyframes neo-spin {to{rotate:1turn}}
@media(prefers-reduced-motion:no-preference) {
  :where(button,.button,header nav a,summary) {
    transition:background-color 140ms,border-color 140ms,color 140ms,transform 150ms var(--neo-ease);
  }
  :where(button:not(:disabled),.button,header nav a):active {scale:.97}
  #main>.loading::before {animation:neo-spin .85s linear infinite}
  :is(.page-heading,.community-toolbar,.auth-form,.watch-options,.engine-guide > h1) {animation:neo-rise 210ms var(--neo-ease)}
  dialog[open] {animation:neo-sheet 160ms var(--neo-ease)}
  dialog[open]::backdrop {animation:neo-dim 140ms ease-out}
  #toast:not([hidden]) {animation:neo-rise 170ms var(--neo-ease)}
  @media(hover:hover) and (pointer:fine) {
    .game-card,.home-card {transition:border-color 150ms ease,translate 170ms var(--neo-ease)}
    :is(.game-card,.home-card):has(a:hover,button:hover) {border-color:#756747;translate:0 -2px}
    .video-thumb img {transition:transform 200ms var(--neo-ease)}
  }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    scroll-behavior:auto!important;
    animation-duration:.01ms!important;animation-delay:0s!important;animation-iteration-count:1!important;
    transition-duration:0s!important;transition-delay:0s!important;
  }
}
.video-spotlight {
  grid-column:1/-1; display:grid; grid-template-columns:minmax(250px,.84fr) minmax(0,1.35fr);
  overflow:hidden; border:1px solid #39393d; border-radius:18px; background:#202024;
}
.spotlight-copy {display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding:clamp(24px,4vw,64px);min-width:0}
.spotlight-label {display:flex;align-items:center;gap:.65rem;color:#ffda61;font-size:.72rem;letter-spacing:.12em;text-transform:uppercase;font-weight:750}
.spotlight-label::before {content:"";width:1.6rem;height:2px;background:currentColor}
.spotlight-copy h2 {font-family:system-ui,sans-serif;margin:.55em 0 .32em;font-size:clamp(1.85rem,3.5vw,3.8rem);line-height:1.01;letter-spacing:-.055em;overflow-wrap:anywhere;text-wrap:balance}
.spotlight-creator {font-size:.88rem;color:#c9c9ce}
.spotlight-play {margin-top:clamp(18px,2.6vw,36px);display:inline-flex;align-items:center;gap:.65rem;font-weight:700}
.spotlight-art {position:relative;display:block;align-self:stretch;min-width:0;background:#161619}
.spotlight-art img {display:block;width:100%;height:100%;position:absolute;inset:0;object-fit:cover}
.spotlight-art::before {content:"";display:block;aspect-ratio:16/8}
.clip-length {position:absolute;bottom:12px;right:14px;padding:4px 7px;border-radius:5px;background:#121215df;color:white;font-size:.75rem;font-variant-numeric:tabular-nums}
.auth-screen .auth-art {
  isolation:isolate;color:#181819;background:#ffce31;
  background-image:linear-gradient(145deg,#ffe77e 0%,#ffd139 44%,#edb71e 100%);
}
.auth-art::after {
  content:"";position:absolute;z-index:-1;inset:17% -17% 4% 18%;pointer-events:none;
  background:#ffe998;opacity:.55;
  clip-path:polygon(0 100%,0 0,17% 0,78% 61%,78% 0,100% 0,100% 100%,83% 100%,22% 40%,22% 100%);
}
.auth-screen .auth-art .auth-note {font-family:system-ui,sans-serif;font-weight:760;font-size:clamp(42px,6vw,94px);letter-spacing:-.077em;line-height:1;color:#191919}
.auth-screen .auth-note > span {color:#383325;font-weight:500;line-height:1.5;letter-spacing:0}
.auth-screen .auth-art :is(.auth-brand,.auth-foot) {color:#201e19}
.auth-screen .auth-form h1 {letter-spacing:-.045em;font-weight:670}
.games-page .page-heading h1,.community-toolbar h1 {font-weight:730;letter-spacing:-.055em;line-height:1.05}
.games-page .starter-grid {gap:12px}
.starter-grid .starter-theme {border-radius:12px;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-end;min-height:124px;padding:18px;font-size:17px}
.starter-grid [data-theme]::before {content:"";width:25px;height:25px;border:2px solid #fffc;border-radius:50%;margin-bottom:13px;background:#16161955}
.starter-grid .thumbnail-tile {justify-content:center;align-items:center;font-size:clamp(18px,2vw,28px);letter-spacing:-.035em;text-align:center}
@media(max-width:640px) {
 .video-spotlight {display:flex;flex-direction:column-reverse;border-radius:14px}
 .spotlight-art::before {aspect-ratio:2.05}
 .spotlight-copy {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;align-items:center;padding:17px 16px}
 .spotlight-label,.spotlight-copy h2,.spotlight-creator {grid-column:1}
 .spotlight-copy h2 {font-size:clamp(1.3rem,6vw,2rem);margin:0;line-height:1.1}
 .spotlight-play {grid-column:2;grid-row:2/4;margin:0;padding:10px 12px;font-size:.79rem}
 .auth-screen .auth-art {min-height:180px}
 .auth-screen .auth-art .auth-note {font-size:clamp(38px,10vw,56px)}
}
.admin-navigation {position:relative;flex-shrink:0;font-size:.85rem}
.admin-navigation summary {list-style:none;cursor:pointer;color:inherit;padding:8px 10px;border:1px solid var(--neo-stroke);border-radius:7px}
.admin-navigation summary::-webkit-details-marker {display:none}
.admin-navigation summary::after {content:"⌄";margin-inline-start:5px}
.admin-navigation[open] summary {border-color:#b49739;color:#ffda62}
.admin-navigation > div {position:absolute;right:0;z-index:51;min-width:165px;padding:5px;margin-top:7px;border-radius:10px;background:#252528;border:1px solid #45454a;box-shadow:0 14px 36px #0006}
.admin-navigation a {display:block;padding:10px;border-radius:6px}
.admin-navigation a:hover,.admin-navigation a:focus-visible {background:#343438}
@media(max-width:500px) {
 body:has(.admin-navigation) > header {padding-inline:10px;gap:6px}
 body:has(.admin-navigation) > header .beta-tag {display:none}
}
@media(prefers-reduced-motion:no-preference) {
 .admin-navigation[open] > div {animation:neo-sheet 140ms var(--neo-ease)}
}
@media(max-width:760px){body:has(> #main) header nav{flex-direction:row;flex-wrap:nowrap}}

@media(max-width:760px){
 body:has(> #main)>header{height:auto;flex-wrap:wrap;padding:8px 10px 0;row-gap:5px}
 body:has(> #main)>header nav{position:static;order:20;flex:0 0 100%;height:auto;border:0;padding:2px 0 4px;gap:0;overflow-x:auto}
 body:has(> #main)>header nav a:not(.sub-nav){padding:3px 1px;font-size:10px}
 body:has(> #main)>header nav a.sub-nav{display:none}
}

.boost-label{display:block;width:fit-content;margin:.4rem 0;padding:.2rem .5rem;border-radius:5px;background:#332e21;color:#ffe192;font-size:.8rem}
