/* The original glass Cube is the main visual. Its face material and motion stay in shell.css. */
body:not(.hub-open) #app{width:min(100%,1180px);max-width:1180px;min-height:0;height:100svh;display:flex;flex-direction:column;padding:0 20px max(18px,env(safe-area-inset-bottom));gap:0;overflow:hidden}
#menus{display:none!important}
body:not(.hub-open) #profile{position:absolute;z-index:6;top:max(16px,env(safe-area-inset-top));left:max(20px,env(safe-area-inset-left));width:48px;height:48px;min-height:48px;border:0;background:rgba(255,255,255,.065)}
body:not(.hub-open) #shell-close{position:absolute;z-index:6;top:max(16px,env(safe-area-inset-top));right:max(16px,env(safe-area-inset-right));margin:0;padding:0 10px;color:var(--soft)}
body:not(.hub-open) #navigation{flex:none;min-width:0;padding-top:32px;height:218px}
body:not(.hub-open) #stage{display:grid;position:relative;inset:auto;width:100%;height:186px;min-height:0;--cube:clamp(140px,40vw,168px)}
body:not(.hub-open) #stage::after{bottom:2%;opacity:.55}
body:not(.hub-open) #room{bottom:auto;height:230px;opacity:.18}
body:not(.hub-open) #workspace{display:flex;flex:1 1 auto;flex-direction:column;min-width:0;min-height:0;padding:0;overflow:hidden}
body:not(.hub-open) #shell-status{margin:0 0 12px;font-size:13px}
body:not(.hub-open) #page{flex:1 1 auto;min-width:0;min-height:0;padding:0 2px 12px;overflow-y:auto;overscroll-behavior:contain;perspective:none}
body:not(.hub-open) #page>.face{gap:12px;backface-visibility:visible;-webkit-backface-visibility:visible}
body:not(.hub-open) #page .face[data-page=play],body:not(.hub-open) #page .face[data-page=profile]{display:block}

/* Available games, selected game details and the live roster share Home. */
body:not(.hub-open) .home-content{display:grid;gap:24px}
body:not(.hub-open) .game-library,body:not(.hub-open) .home-players{min-width:0}
body:not(.hub-open) .home-content h2,body:not(.hub-open) .section-title{margin:0 0 12px;color:var(--text);font:500 16px/1.3 var(--body);letter-spacing:0}
body:not(.hub-open) .game-index{display:grid;grid-auto-flow:column;grid-auto-columns:142px;gap:12px;overflow-x:auto;padding:3px 3px 8px;margin:0 -3px;scroll-snap-type:x proximity;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.18) transparent;overscroll-behavior-x:contain}
body:not(.hub-open) .game-index .game{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:0;width:100%;min-height:114px;aspect-ratio:auto;padding:0;overflow:hidden;border:0;border-radius:6px;background:rgba(255,255,255,.035);box-shadow:none;scroll-snap-align:start;text-align:left;transition:background-color .16s var(--snap)}
body:not(.hub-open) .game-index .game:hover{background:rgba(255,255,255,.075)}
body:not(.hub-open) .game-index .game[aria-pressed=true]{background:rgba(110,236,255,.11);outline:1px solid rgba(110,236,255,.45)}
body:not(.hub-open) .game-index .game[aria-pressed=true] img{opacity:1}
body:not(.hub-open) .game-index .game[aria-pressed=true] .game-name{color:var(--cyan)}
body:not(.hub-open) .game-index .game:focus-visible{outline:2px solid var(--cyan);outline-offset:2px;box-shadow:none}
body:not(.hub-open) .game-index .game img{display:block;flex:none;width:100%;max-width:none;height:76px;max-height:none;object-fit:cover;filter:none;opacity:.8}
body:not(.hub-open) .game-index .game .halo-scene{object-fit:contain;background:#071b2c}
body:not(.hub-open) .game-index .game .game-name{display:flex;align-items:center;flex:1;min-height:38px;padding:6px 9px;color:var(--text);font:500 12px/1.3 var(--body);text-align:left;white-space:normal}
body:not(.hub-open) .home-game-detail{display:grid;gap:10px;margin-top:16px;padding-top:14px;border-top:1px solid var(--line)}
body:not(.hub-open) .home-game-detail .hub-top{padding:0;border:0}
body:not(.hub-open) .home-game-detail .hub-heading h2{font-size:20px}
body:not(.hub-open) .home-game-detail .hub-secondary{grid-template-columns:1fr 1fr;gap:12px;padding:0}
body:not(.hub-open) .game-mark{display:grid;place-items:center;height:76px;background:linear-gradient(135deg,rgba(110,236,255,.04),rgba(139,108,255,.12));color:var(--soft);font:500 24px/1 var(--body)}
body:not(.hub-open) .empty{margin:0;padding:8px 0;color:var(--muted);font-size:13px;line-height:1.5}
body:not(.hub-open) .home-roster{display:grid;gap:0}
body:not(.hub-open) .home-players .prow{grid-template-columns:auto minmax(0,1fr) auto auto;gap:9px;min-height:58px;padding:7px 0}
body:not(.hub-open) .home-players .av{width:32px;height:32px;font-size:13px}
body:not(.hub-open) .home-players .who b{font-size:13px}
body:not(.hub-open) .home-players .who small{font-size:11px}
body:not(.hub-open) .home-players .primary{height:44px;min-height:44px;padding:0 5px;border:0;border-radius:0;background:none;color:var(--cyan);font-size:12px}
body:not(.hub-open) .home-players .player-stars{gap:4px}
body:not(.hub-open) .home-players .star-icon{width:20px;height:20px}
body:not(.hub-open) .home-players .star-number img{width:14px;height:14px}

/* Settings and collections are reached from the profile page. */
body:not(.hub-open) .page-back{display:inline-flex;align-items:center;gap:5px;min-height:44px;margin:0 0 10px;color:var(--muted);font-size:13px}
body:not(.hub-open) .page-back svg,body:not(.hub-open) .setting svg,body:not(.hub-open) .text-link svg{width:16px;height:16px;flex:none}
body:not(.hub-open) .profile-head{display:flex;align-items:center;gap:16px;margin:0 0 22px}
body:not(.hub-open) .profile-head h2{margin:0;min-width:0;font:600 20px/1.3 var(--body)}
body:not(.hub-open) .profile-actions{margin-bottom:24px}
body:not(.hub-open) .profile-actions .setting span{padding:0;border:0;border-radius:0;background:none}
body:not(.hub-open) .setting{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:54px;padding:0 2px;border:0;border-bottom:1px solid rgba(255,255,255,.1);border-radius:0;background:transparent;font-size:14px}
body:not(.hub-open) .setting span{display:flex;align-items:center;gap:8px;margin-left:16px}
body:not(.hub-open) .stats h3{margin:20px 0 4px;color:var(--muted);font:500 12px/1.4 var(--body)}
body:not(.hub-open) .stats dl{margin:0}
body:not(.hub-open) .stats dl div{display:flex;align-items:center;justify-content:space-between;min-height:42px;border-bottom:1px solid var(--line);font-size:13px}
body:not(.hub-open) .stats dd{margin:0;font-variant-numeric:tabular-nums}

/* The in-game roster keeps the original SM64 HUD star and digits at the right. */
body:not(.hub-open) .prow{min-height:58px;padding:7px 6px;border:0;border-bottom:1px solid rgba(255,255,255,.1);border-radius:0;background:transparent}
body:not(.hub-open) .here{min-height:60px;border:0;border-bottom:1px solid rgba(255,255,255,.1);border-radius:0;background:transparent}
html.embedded body:not(.hub-open) .setting.glass,html.embedded body:not(.hub-open) .prow.glass,html.embedded body:not(.hub-open) .here.glass{background:transparent}
body:not(.hub-open) .face[data-page=pause]{min-height:100%;display:flex;flex-direction:column;gap:16px}
body:not(.hub-open) .pause-session{display:grid;gap:4px;padding:0 0 14px;border:0}
body:not(.hub-open) .session-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
body:not(.hub-open) .session-heading h2{margin:0;color:var(--text);font:600 20px/1.25 var(--display)}
body:not(.hub-open) .text-link{display:inline-flex;align-items:center;gap:2px;min-height:44px;color:var(--muted);font-size:12px}
body:not(.hub-open) .pause-people{display:grid;align-content:start;gap:0}
body:not(.hub-open) .player-stars{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex:none;margin-left:auto;min-height:30px}
body:not(.hub-open) .player-stars img{display:block;image-rendering:pixelated;object-fit:contain}
body:not(.hub-open) .player-stars .star-icon{width:24px;height:24px}
body:not(.hub-open) .star-number{display:flex;align-items:center;gap:0}
body:not(.hub-open) .star-number img{width:17px;height:17px}
body:not(.hub-open) .location-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:14px 0 8px}
body:not(.hub-open) .location-heading h3{margin:0;color:var(--cyan);font:500 13px/1.35 var(--body)}
body:not(.hub-open) .people-count{color:var(--muted);font-size:12px}
body:not(.hub-open) .pause-actions{margin-top:auto;padding-top:12px;gap:10px}
body:not(.hub-open) .pause-actions .secondary{min-height:48px;height:48px;border-radius:8px}
html.embedded body:not(.hub-open) #app{width:calc(100% - 24px);max-width:1180px;height:calc(100dvh - 24px);min-height:0;padding:0 18px 18px}
html.in-game body:not(.hub-open) #navigation{height:210px;padding-top:32px}
html.in-game body:not(.hub-open) #stage{height:178px;--cube:140px}
html.embedded body:not(.hub-open) #workspace{overflow:hidden}
html.embedded body:not(.hub-open) #page{height:auto;flex:1 1 auto;overflow-y:auto}
html.embedded body:not(.hub-open) #page>.face{min-height:100%}

@media(min-width:900px){
  body:not(.hub-open) #app{display:grid;grid-template-columns:minmax(320px,.85fr) minmax(0,1.6fr);grid-template-rows:minmax(0,1fr);grid-template-areas:"cube work";gap:38px;padding:76px 38px 44px}
  body:not(.hub-open) #profile{top:24px;left:38px}
  body:not(.hub-open) #navigation{grid-area:cube;display:grid;align-content:center;height:auto;padding:0}
  body:not(.hub-open) #stage{--cube:244px;height:360px}
  body:not(.hub-open) #room{right:auto;bottom:0;width:40%;height:100%;opacity:.15}
  body:not(.hub-open) #workspace{grid-area:work;justify-content:center;padding-top:18px}
  body:not(.hub-open) #page{flex:0 1 auto;max-height:100%;padding-right:6px}
  body:not(.hub-open) .home-content{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:28px}
  body:not(.hub-open) .game-index{grid-auto-flow:row;grid-auto-columns:auto;gap:0;overflow:visible;padding:0;margin:0;scroll-snap-type:none}
  body:not(.hub-open) .game-index .game{flex-direction:row;align-items:center;gap:14px;min-height:70px;overflow:visible;padding:8px 0;border-bottom:1px solid var(--line);border-radius:0;background:none}
  body:not(.hub-open) .game-index .game:hover{background:rgba(255,255,255,.035)}
  body:not(.hub-open) .game-index .game img,body:not(.hub-open) .game-mark{width:72px;height:48px;border-radius:3px;font-size:18px}
  body:not(.hub-open) .game-index .game .game-name{min-height:0;padding:0;font-size:13px}
  body:not(.hub-open) .home-players .prow{gap:8px;min-height:70px}
  html.in-game body:not(.hub-open) #app{width:calc(100% - 48px);height:calc(100dvh - 48px);inset:24px;margin:auto;padding:70px 40px 36px;grid-template-columns:minmax(300px,.8fr) minmax(0,1.2fr);gap:50px}
  html.in-game body:not(.hub-open) #navigation{height:auto;padding:0}
  html.in-game body:not(.hub-open) #stage{--cube:220px;height:320px}
  html.in-game body:not(.hub-open) #workspace{padding-top:0;justify-content:flex-start}
  html.in-game body:not(.hub-open) #page{flex:1 1 auto;max-height:none}
}

@media(min-width:600px) and (max-height:500px){
  body:not(.hub-open) #app{display:grid;grid-template-columns:190px minmax(0,1fr);grid-template-rows:minmax(0,1fr);grid-template-areas:"cube work";gap:20px;padding:60px 20px 16px}
  body:not(.hub-open) #navigation,html.in-game body:not(.hub-open) #navigation{grid-area:cube;display:grid;align-content:center;height:auto;padding:0}
  body:not(.hub-open) #stage,html.in-game body:not(.hub-open) #stage{--cube:130px;height:190px}
  body:not(.hub-open) #workspace{grid-area:work;min-height:0}
  body:not(.hub-open) .home-content{gap:16px}
  html.embedded body:not(.hub-open) #app{padding:60px 18px 16px}
}

/* The accepted focused hubs keep their own layout. */
body.hub-open #navigation,body.hub-open #title,body.hub-open #profile,body.hub-open #shell-close{display:none!important}
body.hub-open #workspace{display:contents}

/* Give the character page the panel; keep the menu cube within thumb reach. */
html.in-game body:not(.hub-open):has(#page[data-page=characters]) #app{display:flex;padding:76px 18px 18px;gap:0}
html.in-game body:not(.hub-open):has(#page[data-page=characters]) #navigation{position:absolute;top:14px;left:calc(50% - 24px);width:48px;height:48px;padding:0}
html.in-game body:not(.hub-open):has(#page[data-page=characters]) #stage{--cube:32px;height:48px;min-height:48px}
html.in-game body:not(.hub-open):has(#page[data-page=characters]) #workspace{width:100%;padding:0}
html.in-game body:not(.hub-open):has(#page[data-page=characters]) .codex{max-width:900px;margin:0 auto}
@media(max-height:500px) and (min-width:600px){
 html.in-game body:not(.hub-open):has(#page[data-page=characters]) #app{padding-top:62px;padding-bottom:10px}
 .codex{grid-template-columns:80px minmax(0,1fr);gap:10px}
 .codex-banner{display:none}
 .codex-bar,.codex-section{grid-column:1/-1}
 .codex-strip{grid-column:1;grid-row:2;flex-direction:column;max-height:176px;overflow-y:auto;overscroll-behavior:contain}
 .codex-pick{min-height:76px}
 .codex-hero{grid-column:2;grid-row:2}
 .codex-stage{height:176px}
 .codex-title h2{min-height:44px;padding:8px;font-size:20px}
}
