*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, p, figure { margin: 0; }
button, input { font: inherit; }
button { border: 0; }
body { min-width: 320px; min-height: 100vh; overflow-x: hidden; background: var(--ff-color-background); color: var(--ff-color-text); }
button, .ff-button, .game-card, .session-screen, .session-screen *, .touch-controls, .touch-controls * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button, .ff-button, .game-card, .touch-controls * { -webkit-user-drag: none; }
.is-hidden { display: none !important; }
.portal-app { min-height: 100vh; }
.screen { min-height: 100vh; background: radial-gradient(circle at 80% 0%, color-mix(in srgb, var(--ff-color-brand-600) 10%, transparent), transparent 32rem), var(--ff-color-background); }
.screen--centered { display: grid; place-items: center; padding: clamp(1rem, 5vw, 4rem); }
.screen--wide { padding: clamp(1rem, 4vw, 3.75rem) 0 5rem; }
.portal-container { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.auth-shell { width: min(100%, 31rem); display: grid; gap: var(--ff-space-6); padding: clamp(1.5rem, 4vw, 2.5rem); box-shadow: var(--ff-shadow-md); }
.auth-shell--compact { gap: var(--ff-space-5); }
.brand-lockup { display: inline-flex; align-items: center; gap: .75rem; }
.brand-name { display: block; color: var(--ff-color-text); font-size: 1.1rem; font-weight: 850; letter-spacing: -.02em; }
.brand-caption { display: block; color: var(--ff-color-text-muted); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.ff-mark { display: grid; width: 3.25rem; height: 3.25rem; place-items: center; color: var(--ff-color-brand-600); background: color-mix(in srgb, var(--ff-color-brand-600) 12%, var(--ff-color-surface)); border: 1px solid color-mix(in srgb, var(--ff-color-brand-600) 35%, var(--ff-color-border)); border-radius: 1rem; box-shadow: 0 12px 25px color-mix(in srgb, var(--ff-color-brand-600) 14%, transparent); }
.ff-mark svg { width: 2.2rem; height: 2.2rem; }
.ff-mark--small { width: 2.35rem; height: 2.35rem; border-radius: .72rem; }
.ff-mark--small svg { width: 1.55rem; height: 1.55rem; }
.auth-copy { display: grid; gap: .65rem; }
.auth-copy h1, .hero-copy h1 { color: var(--ff-color-text); font-size: clamp(1.75rem, 4vw, 2.5rem); letter-spacing: -.045em; }
.auth-copy p, .hero-copy p { max-width: 41rem; color: var(--ff-color-text-muted); }
.portal-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: clamp(2rem, 5vw, 4.5rem); }
.user-chip { display: flex; align-items: center; gap: .65rem; color: var(--ff-color-text-muted); font-size: .9rem; font-weight: 700; }
.hero-copy { display: grid; gap: .7rem; margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ff-space-5); }
.game-card { position: relative; min-width: 0; padding: 0; overflow: hidden; }
.game-card--disabled { color: var(--ff-color-text); background: var(--ff-color-surface); border: 1px solid var(--ff-color-border); border-radius: var(--ff-radius-lg); box-shadow: var(--ff-shadow-sm); opacity: .62; filter: saturate(.65); cursor: not-allowed; }
.game-card--disabled .game-card__body { pointer-events: none; }
.game-banner { position: relative; height: 10rem; overflow: hidden; background: #18293e; }
.game-banner--palladium { background: linear-gradient(135deg, #1c3048, #5d361f 65%, #c16a1c); }
.game-banner--nations { background: linear-gradient(135deg, #111e3a, #243c7b 48%, #e26916); }
.banner-grid { position: absolute; inset: 0; background-image: linear-gradient(rgb(255 255 255 / .08) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .08) 1px, transparent 1px); background-size: 24px 24px; transform: perspective(400px) rotateX(58deg) scale(1.7); transform-origin: bottom; opacity: .45; }
.banner-orb { position: absolute; width: 14rem; height: 14rem; right: -2rem; top: -6rem; border-radius: 50%; background: radial-gradient(circle at 36% 38%, rgb(255 255 255 / .72), rgb(255 255 255 / .12) 18%, transparent 55%), color-mix(in srgb, var(--ff-color-brand-500) 72%, transparent); filter: blur(.2px); box-shadow: 0 0 60px rgb(226 105 22 / .45); }
.banner-word { position: absolute; left: 1.25rem; bottom: 1rem; color: rgb(255 255 255 / .88); font-size: clamp(1.35rem, 5vw, 2.6rem); font-weight: 900; letter-spacing: .08em; text-shadow: 0 4px 16px rgb(0 0 0 / .25); }
.game-card__body { display: grid; gap: 1rem; padding: var(--ff-space-5); }
.game-card__body p { min-height: 3.2em; }
.game-card__title-row { display: flex; align-items: center; gap: .8rem; }
.game-card__title-row h2 { margin-bottom: .35rem; color: var(--ff-color-text); font-size: 1.35rem; }
.game-logo { display: grid; width: 3rem; height: 3rem; flex: 0 0 auto; place-items: center; color: white; border-radius: .85rem; font-size: 1.45rem; font-weight: 900; box-shadow: inset 0 1px rgb(255 255 255 / .28), 0 8px 16px rgb(15 23 42 / .12); }
.game-logo--p { background: linear-gradient(135deg, #7a421a, #e26916); }
.game-logo--n { background: linear-gradient(135deg, #203e96, #e26916); }
.connector-mark { margin-bottom: -.5rem; }
.ff-badge--success { color: var(--ff-color-success); background: var(--ff-color-success-soft); }
.back-button { justify-self: start; }
.portal-footnote { margin-top: 2rem; color: var(--ff-color-text-muted); font-size: .8rem; text-align: center; }
.theme-control { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 20; display: flex; align-items: center; gap: .65rem; padding: .55rem .75rem; background: color-mix(in srgb, var(--ff-color-surface) 92%, transparent); border: 1px solid var(--ff-color-border); border-radius: 1rem; box-shadow: var(--ff-shadow-md); backdrop-filter: blur(16px); }
.theme-control__label, .theme-control__value { color: var(--ff-color-text-muted); font-size: .76rem; font-weight: 750; }
.theme-control__value { min-width: 3.4rem; color: var(--ff-color-text); }
.hover-tooltip { position: fixed; z-index: 40; max-width: 16rem; padding: .6rem .75rem; color: var(--ff-color-text); background: var(--ff-color-overlay-surface); border: 1px solid var(--ff-color-border); border-radius: .65rem; box-shadow: var(--ff-shadow-md); font-size: .78rem; font-weight: 700; pointer-events: none; opacity: 0; transform: translate(.75rem, .75rem) scale(.96); transition: opacity 140ms ease, transform 140ms ease; }
.hover-tooltip.is-visible { opacity: 1; transform: translate(.75rem, .75rem) scale(1); }
.session-screen { position: fixed; z-index: 100; inset: 0; min-width: 0; min-height: 0; background: #000 !important; border-radius: 0 !important; clip-path: none !important; box-shadow: none !important; }
.session-shell { position: relative; width: 100%; height: 100%; min-width: 0; min-height: 0; overflow: hidden; contain: strict; background: #000 !important; border: 0 !important; border-radius: 0 !important; clip-path: none !important; box-shadow: none !important; }
#novnc-frame { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; border: 0 !important; border-radius: 0 !important; clip-path: none !important; box-shadow: none !important; background: #000; contain: strict; }
.session-menu-button { position: absolute; top: 1rem; right: 1rem; z-index: 120; display: grid; width: 2.8rem; height: 2.8rem; place-content: center; gap: .25rem; border: 1px solid rgb(255 255 255 / .22); border-radius: .85rem; color: #fff; background: rgb(15 23 42 / .72); cursor: pointer; opacity: .3; transition: opacity 160ms ease, background-color 160ms ease; }
.session-menu-button:hover, .session-menu-button:focus-visible, .session-menu-button[aria-expanded="true"] { opacity: 1; background: rgb(15 23 42 / .94); }
.session-menu-button span { display: block; width: 1.1rem; height: 2px; background: currentColor; border-radius: 3px; transition: transform 160ms ease, opacity 120ms ease; }
.session-menu-button[aria-expanded="true"] span:nth-child(1) { transform: translateY(.34rem) rotate(45deg); }
.session-menu-button[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(.25); }
.session-menu-button[aria-expanded="true"] span:nth-child(3) { transform: translateY(-.34rem) rotate(-45deg); }
.session-menu-backdrop { position: absolute; inset: 0; z-index: 118; background: transparent; cursor: default; }
.session-menu-backdrop[hidden] { display: none; }
.session-menu { position: absolute; top: 4.5rem; right: 1rem; z-index: 119; display: grid; width: min(18rem, calc(100% - 2rem)); max-height: min(32rem, calc(100dvh - 5.5rem)); min-height: 0; gap: .65rem; padding: 1rem; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; -webkit-overflow-scrolling: touch; touch-action: pan-y; pointer-events: auto; background: rgb(15 23 42 / .95); border-color: rgb(255 255 255 / .14); box-shadow: 0 20px 70px rgb(0 0 0 / .45); backdrop-filter: blur(18px); }
.session-menu[hidden] { display: none; }
.session-menu::-webkit-scrollbar { width: .45rem; }
.session-menu::-webkit-scrollbar-thumb { background: rgb(255 255 255 / .28); border-radius: 999px; }
.session-menu::-webkit-scrollbar-track { background: transparent; }
.session-menu__title { margin-bottom: .25rem; color: #fff; font-size: .85rem; font-weight: 800; }
.session-menu__field { display: grid; gap: .32rem; color: rgb(255 255 255 / .88); font-size: .72rem; font-weight: 750; }
.session-menu__field select, .session-menu__field input[type="range"] { width: 100%; min-width: 0; color: #fff; background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .2); border-radius: .55rem; }
.session-menu__field select { min-height: 2.25rem; padding: 0 .55rem; }
.session-menu__field option { color: #0f172a; background: #fff; }
.session-menu__field input[type="range"] { accent-color: #8b5cf6; }
.session-menu__field span { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.session-menu__field output { color: rgb(255 255 255 / .68); font-size: .7rem; }
.session-menu__field small { min-height: 1em; color: rgb(255 255 255 / .5); font-size: .66rem; font-weight: 600; }
.session-menu .ff-alert { margin: 0; padding: .55rem .65rem; font-size: .7rem; }
.session-menu .ff-button--secondary { color: #fff; background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .2); }
.session-menu .ff-button--secondary:hover { background: rgb(255 255 255 / .16); }
.session-menu input, .session-menu select { -webkit-user-select: auto; user-select: auto; }
html[data-session-mode="mobile"][data-session-phase="game"] #novnc-frame { pointer-events: none; }
html[data-session-mode="mobile"][data-session-phase="launcher"] #novnc-frame { pointer-events: auto; }
html[data-session-phase="launcher"] .touch-controls { display: none !important; pointer-events: none !important; }
.touch-controls { position: absolute; inset: 0; z-index: 108; overflow: hidden; pointer-events: auto; user-select: none; touch-action: none; }
.touch-controls[hidden] { display: none; }
.touch-joystick { position: absolute; bottom: max(1.15rem, env(safe-area-inset-bottom)); display: grid; width: min(11rem, 27vw); height: min(11rem, 27vw); place-items: center; pointer-events: auto; touch-action: none; -webkit-tap-highlight-color: transparent; }
.touch-joystick--move { left: max(1rem, env(safe-area-inset-left)); }
.touch-joystick--look { right: max(1rem, env(safe-area-inset-right)); }
.touch-joystick__base { position: relative; display: grid; width: 100%; height: 100%; place-items: center; background: radial-gradient(circle at 40% 35%, rgb(255 255 255 / .16), rgb(15 23 42 / .72) 60%, rgb(2 6 23 / .92)); border: 1px solid rgb(255 255 255 / .28); border-radius: 50%; box-shadow: inset 0 0 0 .45rem rgb(255 255 255 / .06), 0 12px 32px rgb(0 0 0 / .28); }
.touch-joystick__ring { position: absolute; inset: 13%; border: 1px dashed rgb(255 255 255 / .25); border-radius: 50%; pointer-events: none; }
.touch-joystick__stick { position: absolute; left: 50%; top: 50%; width: 38%; height: 38%; transform: translate(-50%, -50%); will-change: transform; border: 2px solid rgb(255 255 255 / .5); border-radius: 50%; background: radial-gradient(circle at 35% 28%, #c4b5fd, #7c3aed 48%, #4c1d95); box-shadow: 0 6px 16px rgb(0 0 0 / .35), inset 0 1px rgb(255 255 255 / .35); pointer-events: none; transition: transform 80ms ease-out, filter 120ms ease-out; }
.touch-joystick.is-active .touch-joystick__stick { transition: none; filter: brightness(1.12); }
.touch-joystick__label { position: absolute; bottom: 12%; color: rgb(255 255 255 / .58); font-size: .55rem; font-weight: 850; letter-spacing: .12em; pointer-events: none; }
.touch-actions { position: absolute; left: 50%; bottom: max(1.15rem, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(2, minmax(4.5rem, 1fr)); gap: .45rem; width: min(13rem, 27vw); transform: translateX(-50%); pointer-events: none; }
.touch-action { min-height: 2.55rem; padding: .45rem .55rem; color: #fff; background: rgb(15 23 42 / .66); border: 1px solid rgb(255 255 255 / .23); border-radius: .7rem; box-shadow: 0 8px 24px rgb(0 0 0 / .2); font-size: .68rem; font-weight: 800; pointer-events: auto; backdrop-filter: blur(7px); -webkit-tap-highlight-color: transparent; touch-action: none; }
.touch-action.is-active { color: #fff; background: rgb(124 58 237 / .86); transform: scale(.95); }
.pointer-hint { position: absolute; left: 50%; bottom: 2rem; z-index: 110; display: flex; align-items: center; gap: .65rem; padding: .65rem 1rem; color: rgb(255 255 255 / .9); background: rgb(15 23 42 / .78); border: 1px solid rgb(255 255 255 / .15); border-radius: 999px; font-size: .78rem; transform: translateX(-50%); pointer-events: none; opacity: 0; transition: opacity 240ms ease; }
.pointer-hint.is-visible { opacity: 1; }
.pointer-hint__dot { display: grid; width: 1.5rem; height: 1.5rem; place-items: center; color: #fff; background: var(--ff-color-brand-600); border-radius: 50%; font-size: .95rem; }
kbd { padding: .1rem .35rem; color: #fff; border: 1px solid rgb(255 255 255 / .3); border-bottom-width: 2px; border-radius: .3rem; font-family: inherit; font-size: .7rem; }
@media (max-width: 720px) { .portal-header { align-items: flex-start; flex-direction: column; } .game-grid { grid-template-columns: 1fr; } .user-chip { width: 100%; justify-content: space-between; } .theme-control { right: .75rem; bottom: .75rem; } .pointer-hint { width: max-content; max-width: calc(100% - 2rem); text-align: center; } .session-menu-button { top: max(.65rem, env(safe-area-inset-top)); right: max(.65rem, env(safe-area-inset-right)); } .session-menu { top: max(4rem, calc(env(safe-area-inset-top) + 3.25rem)); right: max(.65rem, env(safe-area-inset-right)); max-height: calc(100dvh - env(safe-area-inset-top) - 5rem); } .touch-joystick { width: min(9rem, 28vw); height: min(9rem, 28vw); } .touch-actions--center { width: min(10rem, 28vw); } .touch-action { -webkit-backdrop-filter: none; backdrop-filter: none; } }
@media (orientation: portrait) and (max-width: 720px) { .touch-joystick { width: min(8.25rem, 28vw); height: min(8.25rem, 28vw); } .touch-actions--center { grid-template-columns: repeat(2, minmax(3.8rem, 1fr)); width: min(9rem, 29vw); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
