@font-face{font-family:Golos;src:url('/assets/golos-cyrl.woff2') format('woff2');font-weight:400 900;font-display:swap;unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:Golos;src:url('/assets/golos-latin.woff2') format('woff2');font-weight:400 900;font-display:swap}
@font-face{font-family:RobotoDeck;src:url('/assets/rc-latin.woff2') format('woff2');font-weight:500 900;font-display:swap}
@font-face{font-family:RobotoDeck;src:url('/assets/rc-cyrl.woff2') format('woff2');font-weight:500 900;font-display:swap;unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}

:root {
  color-scheme: dark;
  --base: #000000;
  --raised: #090909;
  --hover: #131313;
  --line: #292523;
  --line-hi: #615650;
  --white: #F0ECE8;
  --orange: #FF7A24;
  --lavender: #B997E8;
  --error: #FF6654;
  --quiet: #A8A09B;
  --sans: Golos, Arial, sans-serif;
  --display: RobotoDeck, 'Arial Narrow', Golos, sans-serif;
  --mono: 'Cascadia Mono', 'SFMono-Regular', Consolas, monospace;
  --fast: 157ms ease-out;
  --settle: 310ms cubic-bezier(.22,.74,.26,1);
  --pad: clamp(1.125rem, 4vw, 4.5rem);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--base); color: var(--white); font: 400 .94rem/1.52 var(--sans); }
body:has(.session) { overflow: hidden; }
body:has(dialog[open]) { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, summary, select { cursor: pointer; }
a { color: inherit; }
h1,h2,h3,p { margin: 0; }
h1,h2,h3 { line-height: .98; }
h1,h2 { font-family: var(--display); font-weight: 770; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible, [data-pad-focus] { outline: 3px solid var(--lavender); outline-offset: 4px; }
[hidden] { display: none !important; }
.svg-defs { position: absolute; overflow: hidden; pointer-events: none; }
.icon {
  width: 1.22rem; height: 1.22rem; flex: none; stroke: currentColor; fill:none;
  stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem; text-decoration: none;
  font-family: var(--display); font-weight: 820; font-size: 1.65rem; line-height: 1;
  letter-spacing: -.045em; white-space: nowrap;
}
.brand-mark {
  width: 2.65rem; height: 1.65rem; overflow: visible; color: var(--orange); fill: none;
  stroke: currentColor; stroke-width: 2.65; stroke-linecap: square; stroke-linejoin: round;
}
.brand-wire { stroke: var(--lavender); }
.boot { min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: .95rem; }
.boot .brand-mark { width: 4.8rem; height: 3rem; }
.boot span { font: 780 1.7rem/1 var(--display); }
.button {
  border: 1px solid transparent; border-radius: 3px; min-height: 2.85rem; padding: .68rem 1rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .57rem;
  font-weight: 650; line-height: 1.25; text-align: center; text-decoration: none;
  background: transparent; white-space: nowrap;
  transition: background var(--fast), color var(--fast), border-color var(--fast), transform var(--fast);
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { opacity: .46; cursor: not-allowed; }
.button.primary { color: var(--base); background: var(--orange); }
.button.primary:hover:not(:disabled) { background: #FF9651; }
.button.secondary { border-color: var(--line-hi); color: var(--white); }
.button.secondary:hover:not(:disabled), .button.tertiary:hover:not(:disabled) { background: var(--hover); border-color: var(--quiet); }
.button.danger { color: var(--error); border-color: currentColor; }
.button.danger:hover:not(:disabled) { background: #24100D; }
.button.icon-only { width: 2.85rem; padding: .65rem; }
.button.quiet { border-color: var(--line-hi); color: var(--white); }
.button.quiet:hover:not(:disabled) { border-color: var(--orange); background: var(--hover); }
.button.wide { width: 100%; }
.button .trailing { margin-left: auto; }
.link-button {
  border: 0; background: transparent; padding: 0; color: inherit; text-underline-offset: 4px;
  text-decoration: underline; font-weight: 650; min-height: 2rem;
}
.link-button:hover { text-decoration-color: var(--orange); }
.machine-label, .caption {
  font: 610 .715rem/1.45 var(--mono); letter-spacing: .13em; text-transform: uppercase;
}
.machine-label { color: var(--quiet); }
.dim { color: var(--quiet); }
.wire-rule { height: 1px; background: var(--line); border: 0; margin: 0; }

.auth {
  min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(25rem, 35%);
}
.auth-stage { min-height: 45rem; isolation: isolate; position: relative; padding: 2.4rem var(--pad) 2rem; display: flex; flex-direction: column; align-items: flex-start; overflow: hidden; }
.auth-stage::before, .auth-stage::after { content: ''; position: absolute; z-index: -1; inset: 0; pointer-events: none; }
.auth-stage::before {
  background: var(--base) url('/assets/equipment.webp') 58% 53% / cover no-repeat;
  filter: grayscale(.98) sepia(.27) saturate(.88);
}
.auth-stage::after {
  background: linear-gradient(114deg, #000e 0%, #000b 25%, transparent 76%),
  linear-gradient(0deg, #000e 0%, transparent 22%);
}
.auth-copy { margin-top: clamp(4.5rem, 11vh, 9rem); max-width: 41rem; }
.auth-copy h1 { font-size: clamp(4.25rem, 7vw, 8.6rem); line-height: .86; letter-spacing: -.041em; }
.auth-copy p { color: var(--white); font-size: clamp(.96rem, 1.45vw, 1.19rem); max-width: 20rem; margin-top: 1.5rem; text-wrap: pretty; }
.auth-rule { display: flex; width: 100%; margin-top: auto; padding-top: 9rem; align-items: center; gap: .85rem; }
.auth-rule .caption { color: var(--white); letter-spacing: .105em; }
.auth-rule .auth-track { flex: 1; height: 1px; background: var(--line-hi); position: relative; }
.auth-track::before, .auth-track::after { content: ''; position: absolute; width: .34rem; height: .34rem; top: -.14rem; background: var(--orange); }
.auth-track::after { right: 0; }
.auth-panel {
  background: var(--raised); color: var(--white); position: relative;
  display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem, 5vw, 4.65rem) clamp(2rem, 4vw, 4.4rem);
  border-left: 1px solid var(--line);
}
.auth-panel::before { content: ''; position: absolute; left: -1px; top: 10%; width: .18rem; height: 3.75rem; background: var(--orange); }
.auth-panel h2 { font-size: clamp(2.9rem, 4.15vw, 4.3rem); letter-spacing: -.04em; margin: .6rem 0 1.6rem; }
.auth-panel .caption { color: var(--quiet); }
.auth-choice { display: flex; gap: 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.auth-choice button {
  padding: .55rem 0 .7rem; border: solid transparent; border-width: 0 0 3px; color: var(--quiet);
  background: transparent; font-weight: 620; margin-bottom: -1px; min-height: 2.75rem;
}
.auth-choice button[aria-pressed="true"] { color: var(--white); border-color: var(--orange); }
.auth-form { display: grid; gap: .88rem; }
.field { display: grid; gap: .4rem; font-weight: 650; min-width: 0; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 2.87rem; padding: .58rem .72rem;
  border: 1px solid var(--line-hi); border-radius: 2px; background: var(--base); color: var(--white);
  font-weight: 430;
}
.field textarea { resize: vertical; min-height: 4.5rem; }
.field input::placeholder, .field textarea::placeholder { color: var(--quiet); opacity: 1; }
.field small, .form-note { font-weight: 420; font-size: .78rem; color: var(--quiet); overflow-wrap: anywhere; }
.form-error { font-size: .84rem; color: var(--error); line-height: 1.45; }
.auth-foot { margin-top: 1.85rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.auth-foot .button { padding-inline: .72rem; min-height: 2.5rem; font-size: .78rem; }
.get-apps { display: flex; flex-wrap: wrap; gap: .45rem; }
.auth-foot .form-note { margin-bottom: .62rem; }

.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner {
  min-height: 4.7rem; max-width: 99rem; margin: auto; padding: 0 var(--pad);
  display: flex; justify-content: space-between; gap: 1.6rem; align-items: center;
}
.nav { display: flex; align-items: stretch; align-self: stretch; gap: 1.58rem; }
.nav button {
  border: solid transparent; border-width: 0 0 2px; padding: 0 .2rem; min-height: 3.2rem;
  background: transparent; display: flex; align-items: center; gap: .5rem; color: var(--quiet);
  font-weight: 620;
}
.nav button:hover { color: var(--white); }
.nav button[aria-current="page"] { border-bottom-color: var(--orange); color: var(--white); }
.account { position: relative; align-self: center; flex-shrink: 0; }
.account summary { list-style: none; display: flex; gap: .65rem; align-items: center; }
.account summary::-webkit-details-marker { display: none; }
.account-letter {
  width: 2.7rem; height: 2.7rem; border-radius: 2px; display: grid; place-items: center;
  background: var(--raised); border: 1px solid var(--line-hi); color: var(--orange); font: 740 1.1rem/1 var(--display);
}
.account-name { max-width: 11rem; display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu { position: absolute; right: 0; top: calc(100% + .6rem); z-index: 4; border: 1px solid var(--line-hi); min-width: 13.5rem; padding: .6rem; background: var(--raised); box-shadow: 0 1.2rem 2.2rem #0007; }
.account-menu .button { width: 100%; justify-content: flex-start; white-space: nowrap; }
.main { max-width: 99rem; margin: auto; padding: 2.8rem var(--pad) 4rem; }
.page-title { font-size: clamp(3.25rem, 7.2vw, 7.1rem); letter-spacing: -.045em; overflow-wrap: anywhere; }
.page-heading {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.65rem;
}
.page-heading p { margin-top: .65rem; color: var(--quiet); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: 1.05rem; }
.section-heading h2 { font-size: 2rem; letter-spacing: -.035em; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .62rem; }
.port-grid { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(14.5rem, 1fr); gap: 1rem; }
.port {
  min-height: 17rem; position: relative; isolation: isolate; overflow: hidden;
  border: 1px solid var(--line-hi); background: var(--raised); display: flex; flex-direction: column;
  align-items: flex-start; padding: clamp(1.15rem, 2.5vw, 2.35rem);
}
.port::after {
  content: ''; position: absolute; top: .55rem; right: .55rem; border-top: 1px solid var(--line-hi);
  border-right: 1px solid var(--line-hi); width: 1rem; height: 1rem;
}
.port h2 { font-size: clamp(2.5rem, 4.4vw, 4.65rem); letter-spacing: -.043em; margin: .46rem 0 .65rem; max-width: 64%; overflow-wrap: anywhere; }
.port p { max-width: 25rem; color: var(--quiet); font-size: .91rem; }
.port .actions { margin-top: auto; padding-top: 1.35rem; }
.port-art { position: absolute; z-index: -1; pointer-events: none; inset: 0 0 0 auto; width: 57%; height: 100%; }
.diagram-drill { fill: var(--line); }
.diagram-outline { fill: none; stroke: #51433C; stroke-width: 1.25; }
.diagram-trace { fill: none; stroke: #6A5243; stroke-width: 1.25; }
.diagram-node { fill: var(--quiet); }
.diagram-pulse { fill: none; }
.diagram-live .diagram-node, .diagram-live .diagram-trace { stroke: var(--orange); }
.diagram-live .diagram-node { fill: var(--orange); }
.diagram-live .diagram-pulse { stroke: var(--white); stroke-dasharray: 15 260; animation: cable-check 1.4s var(--settle) 1 both; }
@keyframes cable-check { from { stroke-dashoffset: 251; } to { stroke-dashoffset: 0; } }
.port-status { display: inline-flex; align-items: center; gap: .5rem; }
.led { width: .55rem; height: .55rem; background: var(--quiet); flex: none; border-radius: 1px; }
.led.on { background: var(--orange); }
.rack { display: flex; flex-direction: column; padding: 1rem .93rem .9rem; border: 1px solid var(--line); background: var(--raised); min-width: 0; }
.rack-head { display: flex; justify-content: space-between; align-items: center; min-height: 2.4rem; margin: -.2rem 0 .5rem; gap: .5rem; }
.rack-head .button { min-height: 2.25rem; width: 2.25rem; }
.rack-empty { color: var(--quiet); padding: .8rem .15rem; font-size: .88rem; }
.rack-list { display: grid; gap: .3rem; }
.device-row {
  border: 1px solid transparent; background: transparent; display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto; text-align: left; align-items: center; gap: .6rem;
  width: 100%; min-height: 3.15rem; padding: .5rem .55rem;
}
.device-row:hover { background: var(--hover); }
.device-row[aria-pressed="true"] { border-left-color: var(--orange); background: var(--hover); }
.device-row .device-name { min-width: 0; overflow-wrap: anywhere; }
.device-row .device-name strong, .device-row .device-name small { display: block; }
.device-row .device-name small { color: var(--quiet); font-size: .75rem; }
.rack-foot { margin-top: auto; padding: .72rem .14rem .15rem; color: var(--quiet); }
.library { margin-top: clamp(2.3rem, 4.5vw, 4rem); }
.empty-library { min-height: 8.45rem; display: grid; align-content: center; grid-template-columns: auto minmax(0, 1fr); gap: .3rem 1rem; padding: 1.2rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.empty-library > .icon { color: var(--orange); grid-row: 1 / span 2; align-self: center; width: 1.8rem; height: 1.8rem; margin-right: .5rem; }
.empty-library p { color: var(--quiet); max-width: 37rem; }
.library-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14.5rem), 1fr)); gap: .85rem; }
.game-tile { --art: #160D09; --art-ink: var(--orange); min-width: 0; position: relative; }
.game-tile.tone-1 { --art: #1A100B; --art-ink: #FFA16B; }
.game-tile.tone-2 { --art: var(--hover); --art-ink: #C6BDB6; }
.game-tile.tone-3 { --art: #171210; --art-ink: #C9A18B; }
.game-launch {
  display: grid; width: 100%; min-height: 11rem; border: 1px solid var(--line); background: var(--raised);
  padding: 0; text-align: left; align-content: stretch; isolation: isolate; transition: transform var(--settle), border-color var(--fast);
}
.game-launch:hover:not(:disabled), .game-launch[data-pad-focus] { transform: translateY(-3px); border-color: var(--orange); }
.game-launch:disabled { cursor: default; }
.game-art { color: var(--art-ink); background: var(--art); position: relative; isolation: isolate; overflow: hidden; min-height: 8rem; display: grid; place-items: center; padding: .2rem 1.25rem; }
.game-art::before, .game-art::after { content: ''; position: absolute; pointer-events: none; z-index: -1; }
.game-art::before { inset: 16% 10%; border: 1px solid var(--art-ink); opacity: .45; transform: skew(-10deg); }
.game-art::after { inset: 29% -11%; background: repeating-linear-gradient(0deg, transparent 0 7px, var(--art-ink) 7px 8px); opacity: .12; transform: skew(-10deg); }
.game-art > span { font: 850 clamp(3.8rem, 7vw, 6.4rem)/.86 var(--display); letter-spacing: -.068em; }
.game-meta { min-height: 3.7rem; display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .52rem 3rem .52rem .8rem; }
.game-meta strong { overflow-wrap: anywhere; min-width: 0; }
.game-meta .icon { color: var(--quiet); }
.game-edit { position: absolute; right: .45rem; bottom: .45rem; z-index: 1; }
.game-edit.button { width: 2.4rem; min-height: 2.65rem; padding: .55rem; }
.downloads { border-top: 1px solid var(--line); margin-top: 3.8rem; padding-top: 1rem; display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
.downloads .button { font-size: .82rem; min-height: 2.55rem; }

.device-list { border-top: 1px solid var(--line-hi); }
.device-line { min-height: 5rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 0; }
.device-line-name { display: flex; gap: .75rem; min-width: 0; align-items: center; }
.device-line-name .icon { width: 1.7rem; height: 1.7rem; color: var(--orange); }
.device-line h2 { font-family: var(--sans); font-weight: 650; font-size: 1.08rem; line-height: 1.3; overflow-wrap: anywhere; }
.device-line .device-status { display: flex; gap: .4rem; align-items: center; color: var(--quiet); font-size: .78rem; margin-top: .25rem; }
.device-line .actions { flex-shrink: 0; }

.sofa { min-height: 100svh; max-width: 112rem; margin: auto; display: flex; flex-direction: column; padding: 0 var(--pad); }
.sofa-top { display: flex; justify-content: space-between; align-items: center; gap: .85rem; min-height: 4.8rem; border-bottom: 1px solid var(--line); }
.sofa .brand { font-size: 1.9rem; }
.sofa-station { display: flex; align-items: center; gap: .56rem; overflow-wrap: anywhere; text-align: right; color: var(--quiet); }
.sofa-content { flex: 1; padding: clamp(2.1rem, 9vh, 6.4rem) 0 2rem; display: flex; flex-direction: column; justify-content: center; }
.sofa .page-title { font-size: clamp(3.65rem, 10vw, 11.4rem); }
.sofa .section-heading { margin-top: clamp(1.3rem, 4vh, 3.2rem); }
.sofa-rail { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x proximity; margin: -.4rem -1rem; padding: .8rem 1rem 1rem; scrollbar-color: var(--line-hi) var(--base); }
.sofa-rail .game-tile { flex: 0 0 clamp(13.1rem, 26.5vw, 26rem); scroll-snap-align: center; }
.sofa .game-art { min-height: clamp(7.3rem, 16vw, 14.7rem); }
.sofa .game-art > span { font-size: clamp(4.8rem, 11vw, 11rem); }
.sofa .game-meta { font-size: clamp(1rem, 2.6vw, 1.6rem); min-height: 3.9rem; padding-right: .85rem; }
.sofa .game-launch[data-pad-focus], .sofa .game-launch:focus-visible { outline-offset: 3px; border-color: var(--orange); }
.sofa .primary { min-height: 3.25rem; }
.sofa-controls { display: flex; flex-wrap: wrap; padding: 1rem 0 max(1rem, env(safe-area-inset-bottom)); gap: 1rem; color: var(--quiet); border-top: 1px solid var(--line); align-items: center; }
.key-hint { display: inline-flex; align-items: center; gap: .45rem; }
kbd {
  display: inline-grid; place-items: center; border: 1px solid var(--line-hi); border-bottom-width: 2px;
  border-radius: 3px; min-width: 1.66rem; min-height: 1.48rem; padding: .05rem .3rem;
  color: var(--white); font: 620 .74rem/1 var(--mono);
}

.dialog {
  width: min(32.5rem, calc(100% - 2rem)); max-height: calc(100% - 2rem);
  background: var(--raised); color: var(--white); border: 1px solid var(--line-hi);
  border-top: 3px solid var(--orange); padding: 1.35rem; margin: auto; overflow: auto;
  border-radius: 3px; box-shadow: 0 1.35rem 4rem #000b;
}
.dialog[open] { animation: dialog-in var(--settle) both; }
.dialog::backdrop { background: #000b; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .55rem; margin-bottom: .92rem; }
.dialog h2 { font-size: clamp(2.1rem, 6vw, 3rem); letter-spacing: -.04em; overflow-wrap: anywhere; }
.dialog-head .button { margin: -.45rem -.4rem 0 0; }
.dialog-form { display: grid; gap: .92rem; }
.dialog-form p, .dialog > p { color: var(--quiet); }
.dialog-form .button, .dialog .actions { margin-top: .3rem; }
.dialog-actions { justify-content: flex-end; }
.dialog .commands { display: block; padding: .58rem .68rem; background: var(--base); color: var(--orange); overflow-wrap: anywhere; user-select: all; }
.dialog details { border-top: 1px solid var(--line); padding-top: .6rem; }
.dialog details summary { min-height: 1.85rem; }
.pair-code {
  display: flex; justify-content: space-between; gap: .7rem; align-items: center; background: var(--base);
  padding: .9rem .85rem; border: 1px solid var(--line); margin: .95rem 0 .7rem;
}
.pair-code output { color: var(--orange); font: 670 clamp(1.65rem, 8vw, 2.72rem)/1 var(--mono); letter-spacing: .16em; user-select: all; }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.field-check { display: flex; min-height: 2.25rem; align-items: center; gap: .62rem; color: var(--white); }
.field-check input { accent-color: var(--orange); width: 1.12rem; height: 1.12rem; flex: none; }
.toast {
  position: fixed; bottom: max(1.1rem, env(safe-area-inset-bottom)); right: 1.1rem; z-index: 30;
  max-width: min(26rem, calc(100% - 2.2rem)); background: var(--hover); color: var(--white);
  padding: .72rem 1.1rem; border-left: 3px solid var(--orange); box-shadow: 0 .6rem 2rem #0007;
  animation: dialog-in var(--settle) both; overflow-wrap: anywhere; pointer-events: none;
}
.toast.bad { border-left-color: var(--error); }
body:has(.session:not(.minimal)) .toast { bottom: calc(4.7rem + env(safe-area-inset-bottom)); }

.session {
  position: fixed; inset: 0; z-index: 10; background: var(--base); color: var(--white); display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; min-width: 0;
}
.session.minimal { display: block; }
.session.minimal .session-top, .session.minimal .session-bottom { display: none; }
.session.minimal .screen { position: absolute; inset: 0; }
.session-top, .session-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .8rem;
  background: var(--base); border-bottom: 1px solid var(--line);
}
.session-top { padding-top: max(.55rem, env(safe-area-inset-top)); }
.session-bottom { border: 0; border-top: 1px solid var(--line); padding-bottom: max(.55rem, env(safe-area-inset-bottom)); }
.session-top .button, .session-bottom .button { min-height: 2.57rem; padding: .5rem .62rem; }
.session-top .button.icon-only, .session-bottom .button.icon-only { width: 2.57rem; }
.session-name { font: 760 1.3rem/1 var(--display); overflow-wrap: anywhere; }
.session-brand { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.session-stats { display: flex; flex-wrap: wrap; align-items: center; gap: .37rem .8rem; color: var(--quiet); font: 600 .73rem/1.4 var(--mono); }
.session-actions { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.session-dismiss { color: var(--error); }
.trackpad-tools {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: .4rem 1rem; padding: .45rem .8rem; border-top: 1px solid var(--line); background: var(--raised);
}
.trackpad-tools strong { display: block; font-size: .81rem; }
.trackpad-hint { font-size: .75rem; color: var(--quiet); }
.trackpad-actions { display: flex; gap: .38rem; }
.trackpad-actions .button { min-height: 2.75rem; min-width: 2.75rem; padding: .5rem .75rem; font-size: .81rem; touch-action: manipulation; }
.trackpad-actions [aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: var(--base); }
.trackpad-actions [aria-pressed="true"]:hover:not(:disabled) { background: #FF9651; border-color: #FF9651; color: var(--base); }
.screen { position: relative; background: #000; overflow: hidden; min-height: 0; }
.screen video {
  width: 100%; height: 100%; display: block; object-fit: contain; background: #000;
  touch-action: none; user-select: none; outline-offset: -3px;
}
.screen video:focus:not(:focus-visible) { outline: 0; }
.stream-message {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .8rem;
  padding: 1rem; background: var(--base); text-align: center;
}
.stream-message strong { font: 730 clamp(2rem, 5vw, 3.6rem)/.98 var(--display); }
.stream-message span { color: var(--quiet); max-width: 27rem; }
.stream-link-visual { overflow: visible; width: 6rem; height: 4.5rem; stroke: var(--orange); fill: none; stroke-width: 1.6; }
.stream-link-visual .moving { stroke: var(--white); stroke-dasharray: 12 70; animation: connecting 1.55s ease-out infinite; }
@keyframes connecting { to { stroke-dashoffset: -82; } }
.stream-message.failed .moving { animation: none; stroke-dasharray: none; }
.stream-menu-pin {
  position: absolute; z-index: 3; right: max(.65rem, env(safe-area-inset-right)); top: max(.65rem, env(safe-area-inset-top));
  width: 2.9rem; height: 2.9rem; min-height: 0; padding: .3rem; color: var(--white);
  background: #090909df; border: 1px solid var(--line-hi); border-radius: 2px; display: none;
}
.session.minimal .stream-menu-pin { display: grid; place-items: center; }
.touch-controls {
  position: absolute; z-index: 2; inset: 0; pointer-events: none; user-select: none; touch-action: none;
  padding: .65rem max(1rem, env(safe-area-inset-right)) max(.85rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  display: flex; align-items: flex-end; justify-content: space-between; color: var(--white);
}
.touch-stick {
  --dx: 0px; --dy: 0px; pointer-events: auto; position: relative; touch-action: none;
  width: clamp(4.7rem, 15vw, 7.5rem); aspect-ratio: 1; border-radius: 50%; border: 1px solid #FF7A24AD; background: #090909B5;
}
.touch-stick::before { content: ''; position: absolute; inset: 30%; border-radius: 50%; background: #FF7A2496; border: 1px solid var(--orange); transform: translate(var(--dx), var(--dy)); }
.touch-cluster { display: grid; pointer-events: none; grid-template-columns: repeat(3, auto); grid-template-rows: repeat(3, auto); gap: .12rem; }
.touch-button {
  width: clamp(2.45rem, 8vw, 3.15rem); height: clamp(2.45rem, 8vw, 3.15rem); border: 1px solid #FF7A24AD;
  border-radius: 50%; background: #090909B5; color: var(--white); pointer-events: auto;
  touch-action: none; font: 690 .9rem/1 var(--mono); padding: 0;
}
.touch-button.is-down { background: var(--orange); color: var(--base); }
.touch-button:nth-child(1) { grid-column: 2; }
.touch-button:nth-child(2) { grid-column: 1; grid-row: 2; }
.touch-button:nth-child(3) { grid-column: 3; grid-row: 2; }
.touch-button:nth-child(4) { grid-column: 2; grid-row: 3; }
.touch-shoulders { display: flex; align-items: center; gap: .4rem; margin-bottom: .15rem; }
.touch-shoulders button { border-radius: 4px; height: 2.55rem; min-width: 2.65rem; }
.remote-keyboard { width: 1px; height: 1px; opacity: 0; position: absolute; bottom: 0; left: 0; }
.touch-controls .touch-shoulders { align-self: flex-end; }

@media (max-width: 58rem) {
  .auth { grid-template-columns: minmax(0, 1fr) minmax(20rem, 40%); }
  .auth-copy h1 { font-size: clamp(3.65rem, 8vw, 6.6rem); }
  .auth-stage { padding-inline: clamp(1.6rem, 4vw, 2.8rem); }
  .auth-panel { padding-inline: 1.65rem; }
  .port h2 { max-width: 85%; }
  .masthead-inner { gap: .75rem; }
  .nav { gap: .75rem; }
  .nav button { font-size: .84rem; }
  .account-name { display: none; }
}
@media (max-width: 43.5rem) {
  .auth { grid-template-columns: 1fr; }
  .auth-stage { min-height: clamp(19.9rem, 46svh, 24.5rem); padding: 1.15rem var(--pad) .78rem; }
  .auth-stage::before { background-position: center 55%; }
  .auth-stage::after { background: linear-gradient(110deg, #000e, #0005 78%), linear-gradient(0deg, #000d 0%, transparent 22%); }
  .auth-copy { margin-top: auto; padding-top: 1.5rem; }
  .auth-copy h1 { font-size: clamp(3.25rem, 10.7vw, 4.8rem); }
  .auth-copy p { margin-top: .75rem; max-width: 17rem; font-size: .83rem; }
  .auth-rule { padding-top: 1.35rem; }
  .auth-rule .caption { font-size: .58rem; }
  .auth-panel { padding: 1.55rem var(--pad) 1.75rem; border: 0; border-top: 1px solid var(--line); }
  .auth-panel::before { height: .18rem; top: -1px; left: 0; width: 3rem; }
  .auth-panel h2 { margin: .4rem 0 .72rem; }
  .auth-choice { margin-bottom: .85rem; }
  .auth-foot { margin-top: 1.35rem; }
  .masthead-inner { flex-wrap: wrap; min-height: 0; gap: 0 .72rem; padding-top: .68rem; }
  .masthead .brand { order: 0; }
  .masthead .account { order: 1; }
  .masthead .nav { order: 2; flex: 0 0 100%; margin-top: .45rem; justify-content: space-between; gap: .3rem; }
  .masthead .nav button { gap: .38rem; min-height: 2.9rem; font-size: .79rem; justify-content: center; }
  .masthead .nav button .icon { width: 1rem; height: 1rem; }
  .main { padding-top: 1.55rem; padding-bottom: 2rem; }
  .page-heading { margin-bottom: 1.1rem; align-items: flex-start; flex-direction: column; }
  .page-title { font-size: clamp(3.1rem, 12vw, 5.25rem); }
  .page-heading p { margin-top: .4rem; }
  .port-grid { grid-template-columns: 1fr; gap: .72rem; }
  .port { min-height: 13.75rem; }
  .port h2 { margin: .48rem 0 .5rem; }
  .port p { max-width: 18rem; font-size: .84rem; }
  .port-art { width: 55%; opacity: .66; }
  .port .actions { padding-top: .65rem; }
  .rack-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); }
  .rack-foot { display: none; }
  .rack-empty { padding: .2rem .14rem .44rem; }
  .library { margin-top: 2rem; }
  .library-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .58rem; }
  .game-launch { min-height: 8.25rem; }
  .game-art { min-height: 6rem; }
  .game-meta { min-height: 3rem; padding: .38rem 2.35rem .38rem .5rem; font-size: .8rem; }
  .game-meta .icon { display: none; }
  .game-edit.button { width: 2.1rem; min-height: 2.1rem; bottom: .35rem; right: .25rem; }
  .section-heading h2 { font-size: 1.7rem; }
  .section-heading .button { padding-inline: .55rem; min-height: 2.5rem; font-size: .84rem; }
  .downloads { flex-direction: column; align-items: flex-start; gap: .55rem; margin-top: 2.4rem; }
  .device-line { gap: .42rem; }
  .device-line .actions { gap: .34rem; }
  .device-line .actions .button { font-size: .8rem; padding-inline: .48rem; }
  .sofa-top .brand { font-size: 1.52rem; }
  .sofa-station { font-size: .75rem; }
  .sofa-content { padding-top: 1.8rem; }
  .sofa .section-heading { flex-wrap: wrap; }
  .sofa .game-meta { min-height: 3.2rem; }
  .sofa-controls { font-size: .78rem; gap: .58rem; }
  .session-top, .session-bottom { padding-inline: .4rem; }
  .session-brand { gap: .3rem; }
  .session-brand .brand-mark { width: 1.85rem; }
  .session-actions { gap: .22rem; }
  .session-top .button.icon-only, .session-bottom .button.icon-only { min-height: 2.22rem; width: 2.22rem; padding: .3rem; }
  .session-stats { font-size: .66rem; gap: .1rem .5rem; }
  .session-name { font-size: 1.12rem; }
  .session-bottom .hint-long { display: none; }
  .trackpad-tools { padding-inline: .4rem; }
}
@media (max-width: 22rem) {
  .masthead .nav button .icon { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
  .sofa-top .button .label { display: none; }
}
@media (min-width: 56rem) and (max-height: 49rem) {
  .sofa-content { padding-top: clamp(1.6rem, 6vh, 3rem); padding-bottom: 1rem; }
  .sofa .section-heading { margin-top: clamp(1rem, 3vh, 1.5rem); }
}
@media (orientation: landscape) and (max-height: 32rem) {
  .sofa-top { min-height: 3.4rem; }
  .sofa-content { padding: 1.1rem 0 .6rem; }
  .sofa .page-title { font-size: clamp(3rem, 13vh, 5rem); }
  .sofa .section-heading { margin-top: .8rem; }
  .sofa .game-art { min-height: 5.4rem; }
  .sofa .game-meta { min-height: 2.8rem; font-size: 1rem; }
  .sofa-controls { padding-block: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
