/* The Private edition's front door: the super64.app look (N64 start-up black, the four-colour cube, a checkerboard floor)
   around the menu and the player's profile. Loaded by frontdoor.mjs only; Beta never loads it. platforms/landing keeps
   its own stylesheet, so super64.app renders exactly as before. */
@font-face { font-family: "Open Runde"; font-weight: 400; src: url(fonts/OpenRunde-Regular.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Open Runde"; font-weight: 500; src: url(fonts/OpenRunde-Medium.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Open Runde"; font-weight: 700; src: url(fonts/OpenRunde-Bold.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Super64 Wordmark"; font-weight: 200 900; src: url(fonts/Unbounded.woff2) format("woff2"); font-display: swap; }

html.fd, html.fd body { background: #000; overflow: hidden; }
html.fd #app, html.fd #room { display: none; }
html.fd.loading #fd, html.fd.awaiting #fd { visibility: hidden; }
#fd { --body: "Open Runde", system-ui, sans-serif; --cyan: #fff; --violet: #8b6cff; --text: #fff; --soft: rgba(255,255,255,.8); --muted: rgba(255,255,255,.58); --line: rgba(255,255,255,.12); --panel: #0c0c14; --grey: rgba(128,128,136,.5);
  --u: calc(100vw / 393); --v: calc(100svh / 668);
  position: fixed; inset: 0; z-index: 5; overflow: hidden; color: #fff; font-family: var(--body); font-size: 16px; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  background: radial-gradient(ellipse 55% 60% at 50% 42%, #10101a 0%, #050508 60%, #000 100%); }
#fd input, #fd select { -webkit-user-select: text; user-select: text; }
#fd.hinge-in { animation: fd-in .3s ease-out both; }
#fd.hinge-out { animation: fd-out .24s ease-in both; }
@keyframes fd-in { from { opacity: 0; } }
@keyframes fd-out { to { opacity: 0; } }
#fd .fd-sr, #fd[data-view=pick] .fd-ribbon, #fd[data-view=pick] .fd-list { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; padding: 0; border: 0; }

/* The floor: black and dark-grey tiles, lit softly in the cube's four colours under and around it. */
#fd .fd-floor { position: absolute; left: -30%; right: -30%; bottom: 0; height: 110%; transform: perspective(800px) rotateX(48deg); transform-origin: 50% 100%; filter: blur(1.2px); -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.95), transparent 88%); mask-image: linear-gradient(to top, rgba(0,0,0,.95), transparent 88%); }
#fd .fd-tiles { position: absolute; inset: 0; background: repeating-conic-gradient(#2c2c30 0 25%, #0e0e10 0 50%) 0 0 / 112px 112px; }
#fd .fd-fall { display: none; }
#fd .fd-spill { position: absolute; inset: 0; mix-blend-mode: screen; -webkit-mask-image: repeating-conic-gradient(#000 0 25%, rgba(0,0,0,.45) 0 50%); -webkit-mask-size: 112px 112px; mask-image: repeating-conic-gradient(#000 0 25%, rgba(0,0,0,.45) 0 50%); mask-size: 112px 112px;
  background: radial-gradient(ellipse 17% 20% at 47% 54%, rgba(60,100,255,.9), transparent 100%), radial-gradient(ellipse 17% 20% at 53% 54%, rgba(255,215,50,.85), transparent 100%), radial-gradient(ellipse 17% 20% at 50% 47%, rgba(40,200,100,.75), transparent 100%), radial-gradient(ellipse 17% 20% at 50% 60%, rgba(255,60,70,.9), transparent 100%), radial-gradient(ellipse 30% 30% at 50% 54%, rgba(150,150,190,.4), transparent 100%); }

#fd .fd-top { position: absolute; z-index: 4; left: max(4vw, env(safe-area-inset-left) + 16px); right: max(4vw, env(safe-area-inset-right) + 16px); top: max(5vh, env(safe-area-inset-top) + 16px); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#fd .fd-word { margin: 0; font-family: "Super64 Wordmark", system-ui, sans-serif; font-weight: 700; font-size: clamp(30px, 3vw, 54px); line-height: 1.1; }
#fd .fd-top-right { display: flex; align-items: center; gap: clamp(14px, 2vw, 36px); }
#fd #shell-close { position: static; display: inline-flex; align-items: center; width: auto; height: auto; min-height: 48px; margin: 0; padding: 14px 26px; border: 0; border-radius: 999px; background: rgba(255,255,255,.08); color: #fff; font-size: clamp(16px, 1.1vw, 22px); font-weight: 500; }
#fd #shell-close svg { display: none; }
#fd #shell-close:focus-visible { background: rgba(255,255,255,.16); outline: none; }

/* Settings is a quiet word, Players the site's pill; Choose a Game appears to go back to the room. */
#fd:not(.fd-ingame) #menus { position: static; display: flex !important; grid-template-columns: none; align-items: center; width: auto; margin: 0; padding: 0; gap: clamp(14px, 2vw, 36px); border: 0; border-radius: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
#fd:not(.fd-ingame) #menus button { display: inline-flex; align-items: center; min-height: 48px; padding: 0 clamp(12px, 1.1vw, 26px); border-radius: 999px; background: none; color: rgba(255,255,255,.7); font: 500 clamp(15px, 1.23vw, 23px) var(--body); text-shadow: none; white-space: nowrap; }
#fd:not(.fd-ingame) #menus button::after, #fd:not(.fd-ingame) #menus .pip { display: none; }
#fd:not(.fd-ingame) #menus button:nth-child(1) { order: 1; }
#fd:not(.fd-ingame) #menus button:nth-child(3) { order: 2; }
#fd:not(.fd-ingame) #menus button:nth-child(2) { order: 3; background: rgba(255,255,255,.08); color: #fff; }
#fd[data-view=pick] #menus button:nth-child(1) { display: none; }
#fd:not(.fd-ingame) #menus button[aria-current=page] { background: rgba(255,255,255,.2); color: #fff; }
#fd:not(.fd-ingame) #menus button:focus-visible { background: rgba(255,255,255,.2); color: #fff; outline: none; }

/* The cube floats centred in the room. */
#fd .fd-stage { position: absolute; z-index: 1; left: 50%; top: 9.9vh; width: min(36vw, 53.5vh); aspect-ratio: 1; transform: translateX(-50%); }
#fd .fd-cube { position: relative; z-index: 2; display: block; width: 100%; height: 100%; object-fit: contain; cursor: pointer; filter: blur(.5px); }
#fd .fd-scene, #fd .fd-lit { display: none; }
@media (prefers-reduced-motion: no-preference) {
  #fd:not(.fd-ingame) .fd-scene { animation: fd-bob 6s ease-in-out infinite alternate; }
}
@keyframes fd-bob { from { transform: translateY(1.2%); } to { transform: translateY(-2.4%); } }
/* A section or a game's page is open: the room steps back. */
#fd:not([data-view=pick]):not(.fd-ingame) :is(.fd-cube, .fd-scene) { opacity: .28; filter: blur(2px); pointer-events: none; }

/* The chosen game, on the site's grey plate with its arrows and status word. */
#fd .fd-pick { position: absolute; z-index: 3; left: 50%; top: 82.3vh; transform: translateX(-50%); display: flex; align-items: stretch; width: clamp(440px, 29vw, 600px); background: var(--grey); font-size: clamp(24px, 2.12vw, 40px); font-weight: 700; }
#fd[data-view]:not([data-view=pick]) .fd-pick, #fd.fd-ingame .fd-pick { display: none; }
#fd .fd-pick button { color: #fff; font: inherit; }
#fd .fd-pick-main { flex: 1 1 auto; min-width: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; text-align: left; }
#fd .fd-pick-main span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#fd .fd-pick-main small { flex: none; font-size: .5em; font-weight: 500; color: rgba(255,255,255,.55); white-space: nowrap; }
#fd .fd-arrow { flex: none; width: 56px; font-size: 1.05em; line-height: 1; color: rgba(255,255,255,.55) !important; }
#fd .fd-arrow:focus-visible { color: #fff !important; outline: none; }
@media (hover: hover) and (pointer: fine) { #fd .fd-arrow:hover { color: #fff !important; } }
#fd .fd-pick:focus-within, #fd .fd-pick-main:focus-visible { outline: none; }
#fd .fd-pick-main:focus-visible { background: rgba(255,255,255,.1); }

#fd .fd-pick[hidden] { display: none; }
/* The menu panel (Players, Settings, a game's page) sits over the stepped-back room. */
#fd .fd-choose { position: absolute; z-index: 2; left: 50%; top: max(17vh, 100px); bottom: max(14vh, 104px); width: min(760px, 92vw); transform: translateX(-50%); display: flex; flex-direction: column; min-height: 0; pointer-events: none; }
#fd .fd-choose > * { pointer-events: auto; }
/* In the room itself the panel's empty space lets taps through to the cube. */
#fd:not(.fd-ingame):is([data-view=pick], [data-view=players]) #page { pointer-events: none; }
#fd:not(.fd-ingame):is([data-view=pick], [data-view=players]) #page :is(.card, button, input, a) { pointer-events: auto; }
#fd .fd-ribbon { flex: none; display: flex; align-items: center; gap: 14px; height: clamp(60px, 7.8vh, 90px); padding: 0 0 0 28px; }
#fd .fd-title { margin: 0; flex: none; white-space: nowrap; font-family: var(--body); font-size: clamp(24px, 1.9vw, 38px); font-weight: 700; line-height: 1.2; }
#fd .fd-step { display: none; flex: none; place-items: center; min-width: 44px; height: 44px; min-height: 44px; border-radius: 8px; border: 1px solid rgba(255,255,255,.35); border-bottom-width: 4px; color: rgba(255,255,255,.85); font-weight: 700; font-size: 17px; }
#fd.fd-ingame .fd-step { display: inline-grid; }
#fd .fd-step:focus-visible { background: rgba(255,255,255,.16); outline: none; }
#fd.fd-ingame #menus { min-width: 0; position: static; display: flex !important; grid-template-columns: none; width: auto; margin: 0 0 0 auto; padding: 0; gap: 6px; border: 0; border-radius: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; overflow-x: auto; scrollbar-width: none; }
#fd.fd-ingame #menus::-webkit-scrollbar { display: none; }
#fd.fd-ingame #menus button { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.7); font: 500 clamp(14px, 1vw, 19px) var(--body); text-shadow: none; white-space: nowrap; }
#fd.fd-ingame #menus button::after { display: none; }
#fd.fd-ingame #menus button[aria-current=page] { background: rgba(128,128,136,.5); color: #fff; }
#fd.fd-ingame #menus button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#fd.fd-ingame .fd-ribbon { flex-wrap: wrap; height: auto; min-height: clamp(60px, 7.8vh, 90px); row-gap: 8px; padding-bottom: 8px; }
#fd.fd-ingame #menus { flex: 1 1 100%; order: 3; margin: 0; padding-left: 28px; }
#fd .prow { grid-template-columns: auto minmax(0, 1fr) auto auto; }
#fd #shell-status { flex: none; margin: 0 0 8px 28px; color: var(--soft); font-size: 14px; }
#fd #page { position: relative; flex: 1 1 auto; min-height: 0; width: 100%; padding: 0 6px 12px 0; overflow-y: auto; overscroll-behavior: contain; perspective: none; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); }
#fd #page .face[data-page=play] { display: block; }
#fd .fd-list { display: grid; gap: 10px; }
#fd .fd-row > span { flex: 1 1 auto; min-width: 0; white-space: nowrap; }
#fd .fd-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; width: 100%; min-height: 56px; padding: 14px 28px; border-radius: 0; color: rgba(255,255,255,.78); font-size: clamp(28px, 2.2vw, 44px); font-weight: 700; text-align: left; }
#fd .fd-row small { font-size: clamp(14px, 1.05vw, 20px); font-weight: 500; color: rgba(255,255,255,.55); white-space: nowrap; }
#fd .fd-row:focus-visible, #fd .fd-row.focused { color: #fff; background: var(--grey); outline: none; }
#fd .setting.focused, #fd .hub-link.focused, #fd .prow.focused, #fd .prow:focus-within { background: var(--grey); }
#fd .setting.focused:focus-visible, #fd .setting:focus-visible { outline: none; }
#fd .card { background: rgba(0,0,0,.53); border: 0; border-radius: 0; }
#fd .card h2, #fd .section-title { font-family: var(--body); }
#fd .primary { background: #fff; color: #08080f; }
#fd .secondary { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); }
#fd .home-roster { display: grid; gap: 0; }
#fd .home-players .primary { height: 44px; padding: 0 18px; border-radius: 999px; background: #fff; color: #08080f; font-size: 14px; }
#fd .stats { margin-top: 20px; }
#fd .stats .section-title { margin: 0 0 4px; font-size: 18px; font-weight: 700; }

/* The player, bottom left, and the key legend, bottom right. */
#fd .fd-bottom { position: absolute; z-index: 4; left: max(4vw, env(safe-area-inset-left) + 16px); right: max(4vw, env(safe-area-inset-right) + 16px); bottom: max(4.4vh, env(safe-area-inset-bottom) + 16px); display: flex; align-items: center; justify-content: space-between; gap: 24px; pointer-events: none; }
#fd .fd-bottom > * { pointer-events: auto; }
#fd #profile.fd-card { position: static; display: flex; align-items: center; gap: 14px; width: auto; height: auto; min-height: 64px; margin: 0; padding: 6px 18px 6px 6px; border: 0; border-radius: 0; background: none; color: #fff; text-align: left; overflow: visible; }
#fd #profile.fd-card:focus-visible { background: var(--grey); outline: none; }
@media (hover: hover) and (pointer: fine) { #fd #profile.fd-card:hover { background: var(--grey); } }
#fd .pf-cube { flex: none; display: block; width: 60px; height: 60px; }
#fd .pf-text { display: grid; gap: 2px; min-width: 0; }
#fd .pf-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(20px, 1.45vw, 28px); font-weight: 700; }
#fd .pf-text small { font-size: clamp(14px, 1vw, 19px); font-weight: 500; color: rgba(255,255,255,.62); }
#fd .fd-legend { display: flex; gap: 36px; align-items: center; margin-left: auto; font-size: clamp(20px, 1.45vw, 28px); font-weight: 500; }
#fd .fd-legend span { display: none; align-items: center; white-space: nowrap; }
#fd:not(.pad-on)[data-view=pick] .keys.lg-play, #fd:not(.pad-on):not([data-view=pick]) .keys.lg-sub, #fd.pad-on[data-view=pick] .pad.lg-play, #fd.pad-on:not([data-view=pick]) .pad.lg-sub { display: inline-flex; }
#fd .fd-legend kbd { font: inherit; font-weight: 700; display: inline-grid; place-items: center; min-width: 46px; height: 46px; padding: 0 12px; margin-right: 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.35); border-bottom-width: 4px; color: rgba(255,255,255,.85); }
#fd .fd-legend kbd:last-of-type { margin-right: 16px; }
#fd .fd-legend i { font-style: normal; display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; margin-right: 16px; font-size: 22px; font-weight: 700; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
#fd .fd-legend .move { background: #55555f; } #fd .fd-legend .a { background: #3b5bdb; } #fd .fd-legend .b { background: #2f9e44; }

#fd:has(#page[data-page=characters]) .fd-stage { display: none; }
#fd:has(#page[data-page=characters]) .fd-choose { width: min(1200px, 88vw); }

/* In a game the menu keeps the cube beside the panel. */
#fd.fd-ingame .fd-stage { left: 19vw; top: 18vh; transform: none; width: min(26vw, 48vh); }
#fd.fd-ingame .fd-choose { left: 48vw; right: 0; width: auto; transform: none; top: 21vh; }
#fd.fd-ingame #page { width: min(40vw, 760px); }

/* Phones (portrait, or a small touch screen): the room is the menu. Drag the cube to turn it; its face toward you is the game. */
@media (max-aspect-ratio: 1/1), (pointer: coarse) and (max-width: 720px) {
  #fd:not(.fd-ingame) .fd-top { left: max(calc(20 * var(--u)), env(safe-area-inset-left)); right: max(calc(20 * var(--u)), env(safe-area-inset-right)); top: max(calc(18 * var(--v)), env(safe-area-inset-top) + 6px); }
  #fd:not(.fd-ingame) .fd-word { font-size: calc(28 * var(--u)); }
  #fd:not(.fd-ingame) .fd-top-right, #fd:not(.fd-ingame) #menus { gap: calc(16 * var(--u)); }
  #fd:not(.fd-ingame):not([data-view=pick]) .fd-word { font-size: calc(24 * var(--u)); }
  #fd:not(.fd-ingame):not([data-view=pick]) .fd-top-right, #fd:not(.fd-ingame):not([data-view=pick]) #menus { gap: calc(6 * var(--u)); }
  #fd:not(.fd-ingame):not([data-view=pick]) #menus button:nth-child(1) { font-size: 0; width: 36px; justify-content: center; }
  #fd:not(.fd-ingame):not([data-view=pick]) #menus button:nth-child(1)::before { content: "\2039"; font-size: 34px; line-height: 1; }
  #fd:not(.fd-ingame):not([data-view=pick]) #menus button:nth-child(2) { padding: 0 calc(14 * var(--u)); }
  #fd:not(.fd-ingame):not([data-view=pick]) #menus button:nth-child(3) { padding: 0 calc(8 * var(--u)); }
  #fd:not(.fd-ingame) #menus button { min-height: 44px; padding: 0 calc(20 * var(--u)); font-size: 16px; }
  #fd:not(.fd-ingame) #menus button:nth-child(3) { padding: 0; }
  #fd:not(.fd-ingame) #menus button:nth-child(1) { padding: 0; }
  #fd:not(.fd-ingame) #shell-close { padding: 12px 20px; font-size: 16px; }
  #fd .fd-floor { height: 150%; transform: perspective(800px) rotateX(52deg); -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.95), transparent 68%); mask-image: linear-gradient(to top, rgba(0,0,0,.95), transparent 68%); }
  #fd .fd-tiles { background: repeating-conic-gradient(#2c2c30 0 25%, #0c0c0e 0 50%) 0 0 / 100px 100px; }
  #fd .fd-spill { inset: auto; left: 50%; margin-left: -480px; top: 36%; width: 960px; height: 300px; filter: blur(16px); opacity: .95; -webkit-mask-image: none; mask-image: none;
    background: radial-gradient(ellipse 30% 36% at 40% 46%, rgba(56,97,255,.9), transparent 100%), radial-gradient(ellipse 30% 36% at 60% 44%, rgba(41,199,97,.8), transparent 100%), radial-gradient(ellipse 30% 34% at 50% 38%, rgba(255,214,46,.75), transparent 100%), radial-gradient(ellipse 30% 36% at 50% 58%, rgba(242,56,61,.8), transparent 100%), radial-gradient(ellipse 50% 50% at 50% 50%, rgba(120,120,160,.35), transparent 100%); }
  #fd .fd-fall { display: block; position: absolute; inset: auto; left: 50%; margin-left: -190px; top: calc(36% + 10px); width: 380px; height: 280px; background: radial-gradient(closest-side, rgba(0,0,0,.55), transparent); filter: blur(10px); }
  #fd:not(.fd-ingame) { background: radial-gradient(ellipse 90% 45% at 50% 30%, #10101a 0%, #050508 60%, #000 100%); }
  #fd:not(.fd-ingame) .fd-stage { inset: 0; left: 0; top: 0; width: auto; aspect-ratio: auto; transform: none; }
  #fd:not(.fd-ingame) .fd-cube, #fd:not(.fd-ingame) .fd-pick { display: none; }
  /* The cube: six glass faces in the four colours; every side face carries a game's name. */
  #fd:not(.fd-ingame) .fd-scene { --s: calc(112 * var(--u)); position: absolute; display: block; left: calc(50% - var(--s) / 2); top: calc(272 * var(--v)); width: var(--s); height: var(--s); perspective: 700px; z-index: 2; touch-action: none; cursor: grab; }
  #fd .fd-c { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--rx, -14deg)) rotateZ(var(--rz, 0deg)) rotateY(var(--ry, -20deg)); }
  #fd .fd-c .f { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: calc(8 * var(--u)); font-size: calc(14 * var(--u)); font-weight: 700; line-height: 1.1; text-wrap: balance; opacity: .72; color: rgba(255,255,255,.95); text-shadow: 0 1px 14px rgba(0,0,0,.45); backface-visibility: hidden; outline: 1px solid transparent; margin: -.5px; }
  #fd .fd-c .f0 { transform: translateZ(calc(var(--s) / 2)); background: linear-gradient(135deg, rgba(56,97,255,.72), rgba(41,199,97,.72) 50%, rgba(255,214,46,.7)); }
  #fd .fd-c .f1 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); background: linear-gradient(135deg, rgba(41,199,97,.72), rgba(255,214,46,.7) 55%, rgba(242,56,61,.7)); }
  #fd .fd-c .f2 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); background: linear-gradient(135deg, rgba(255,214,46,.7), rgba(242,56,61,.72) 55%, rgba(56,97,255,.72)); }
  #fd .fd-c .f3 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); background: linear-gradient(135deg, rgba(242,56,61,.72), rgba(56,97,255,.72) 55%, rgba(41,199,97,.72)); }
  #fd .fd-c .ft { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); background: linear-gradient(135deg, rgba(255,214,46,.6), rgba(41,199,97,.6)); }
  #fd .fd-c .fb { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); background: linear-gradient(135deg, rgba(242,56,61,.6), rgba(56,97,255,.6)); }
  /* The name lies on the floor in light. */
  #fd:not(.fd-ingame) .fd-lit { position: absolute; z-index: 1; display: block; left: 0; right: 0; top: calc(424 * var(--v)); text-align: center; white-space: nowrap; font-size: calc(26 * var(--u)); font-weight: 700; color: rgba(255,255,255,.55); text-shadow: 0 0 22px rgba(255,214,90,.7), 0 0 44px rgba(90,130,255,.6); transform: perspective(420px) rotateX(64deg); transform-origin: 50% 0; mix-blend-mode: screen; filter: blur(.6px); pointer-events: none; }
  #fd:not(.fd-ingame):not([data-view=pick]) .fd-lit { opacity: .3; }
  #fd:not(.fd-ingame) .fd-bottom { left: max(calc(20 * var(--u)), env(safe-area-inset-left)); bottom: max(calc(22 * var(--v)), env(safe-area-inset-bottom) + 8px); right: auto; }
  #fd:not(.fd-ingame) #profile.fd-card { min-height: 0; padding: 0; gap: 12px; }
  #fd:not(.fd-ingame) .pf-cube { width: 44px; height: 44px; }
  #fd:not(.fd-ingame) .pf-text b { font-size: 18px; }
  #fd:not(.fd-ingame) .pf-text small { font-size: 14px; }
  #fd:not(.fd-ingame) .fd-legend { display: none; }
  #fd:not(.fd-ingame).pad-on .fd-legend { display: flex; margin-left: 24px; font-size: 15px; }
  #fd:not(.fd-ingame) .fd-choose { left: calc(16 * var(--u)); right: calc(16 * var(--u)); width: auto; transform: none; top: calc(80 * var(--v)); bottom: calc(96 * var(--v)); }
  #fd:not(.fd-ingame) .fd-ribbon { height: auto; padding: 0 0 8px; }
  #fd:not(.fd-ingame) .fd-title { font-size: 24px; }
  #fd:not(.fd-ingame) #shell-status { margin-left: 0; }
  #fd:not(.fd-ingame) .fd-row { font-size: 24px; padding: 12px 16px; min-height: 48px; align-items: center; }
  #fd[data-view=players]:not(.fd-ingame) .fd-ribbon { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #fd[data-view=players]:not(.fd-ingame) .fd-choose { top: calc(340 * var(--v)); bottom: calc(180 * var(--v)); }
  #fd:not(.fd-ingame):has(#page[data-page=characters]) .fd-choose { left: calc(16 * var(--u)); }
  /* In a game on a phone the menu keeps the old single column. */
  #fd.fd-ingame { display: flex; flex-direction: column; gap: 12px; padding: max(16px, env(safe-area-inset-top) + 12px) max(16px, env(safe-area-inset-right) + 16px) max(20px, env(safe-area-inset-bottom) + 16px) max(16px, env(safe-area-inset-left) + 16px); }
  #fd.fd-ingame .fd-top, #fd.fd-ingame .fd-stage, #fd.fd-ingame .fd-choose, #fd.fd-ingame .fd-bottom { position: relative; left: auto; right: auto; top: auto; bottom: auto; transform: none; }
  #fd.fd-ingame .fd-word { font-size: 30px; }
  #fd.fd-ingame .fd-stage { flex: 1 1 0; min-height: min(150px, 19svh); width: auto; aspect-ratio: auto; display: flex; justify-content: center; align-items: flex-end; }
  #fd.fd-ingame .fd-cube { flex: 1 1 0; min-width: 0; width: auto; height: 70%; align-self: flex-start; }
  #fd.fd-ingame .fd-choose { flex: 0 1 auto; width: 100%; }
  #fd.fd-ingame .fd-ribbon { height: auto; padding: 0 0 6px; }
  #fd.fd-ingame .fd-title, #fd.fd-ingame .fd-step, #fd.fd-ingame .fd-legend { display: none; }
  #fd.fd-ingame #page { width: 100%; padding-right: 0; }
  #fd.fd-ingame .fd-row { font-size: 26px; padding: 12px 20px; min-height: 54px; align-items: center; }
  #fd.fd-ingame .fd-bottom { flex: none; }
}
@media (pointer: coarse) { #fd .fd-step { display: none !important; } }
/* Phones held sideways. */
@media (min-aspect-ratio: 1/1) and (max-height: 520px) {
  #fd .fd-choose { top: 17vh; bottom: 84px; } #fd .fd-ribbon { height: 48px; } #fd .fd-title { font-size: 22px; }
  #fd .fd-row { font-size: 22px; padding: 8px 18px; min-height: 44px; } #fd .fd-row small { font-size: 14px; }
  #fd .fd-legend { font-size: 16px; gap: 20px; } #fd .fd-legend kbd { height: 34px; min-width: 34px; }
  #fd #profile.fd-card { min-height: 52px; } #fd .pf-cube { width: 48px; height: 48px; }
}

/* The home room (room.mjs): one WebGL2 scene behind the menu draws the floor and the cube's light on it.
   The cube itself stays in the stage, drawn sharp. */
#fd .fd-gl { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; transition: opacity .4s ease, filter .4s ease; }
#fd.gl-room .fd-floor { display: none; }
#fd.gl-room .fd-cube { filter: none; }
#fd.gl-room:not([data-view=pick]) .fd-gl { opacity: .35; filter: blur(3px); }
#fd .fd-console { position: absolute; z-index: 1; padding: 0; border: 0; border-radius: 28px; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
#fd .fd-console span { position: absolute; left: 50%; top: 0; transform: translate(-50%, -70%); padding: 10px 20px; border-radius: 999px; background: rgba(255,255,255,.1); color: #fff; font: 500 clamp(15px, 1.1vw, 20px) var(--body); white-space: nowrap; opacity: 0; transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
#fd .fd-console:is(:hover, :focus-visible) span { opacity: 1; transform: translate(-50%, -100%); }
#fd .fd-console:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
#fd:not([data-view=pick]) .fd-console { display: none; }
/* Over the lit room the picker is frosted glass, so the floor and the cube's light show through it. */
#fd.gl-room .fd-pick { border-radius: 18px; background: rgba(28,28,36,.42); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); box-shadow: inset 0 1px 0 rgba(255,255,255,.14), inset 0 0 0 1px rgba(255,255,255,.07), 0 18px 40px rgba(0,0,0,.45); overflow: hidden; }
#fd.gl-room .fd-pick-main:focus-visible { background: rgba(255,255,255,.08); }
#fd.fd-flying :is(.fd-top, .fd-stage, .fd-pick, .fd-choose, .fd-bottom, .fd-console) { opacity: 0; pointer-events: none; transition: opacity .35s ease; }
@view-transition { navigation: auto; }
