:root {
  color-scheme: dark;
  --bg: #121117;
  --panel: #1b1922;
  --edge: #302d3a;
  --text: #faf6fd;
  --muted: #b2a9be;
  --accent: #ffb991;
  --ink: #211510;
  --green: #a9edc5;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
body:not(.on-host) .host-only, body.on-host .remote-only { display: none; }
a { color: inherit; }
button, input, select, summary { font: inherit; }
button, summary, a, select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .64; }
button, input { color: inherit; }
:focus-visible { outline: 3px solid #fcb88f; outline-offset: 4px; }
.skip { position: fixed; z-index: 10; top: -100px; left: 16px; padding: 12px; background: var(--panel); }
.skip:focus { top: 10px; }
.shell {
  display: grid;
  min-height: 100vh;
  grid-template: 76px 1fr / 168px minmax(0, 1fr);
}
.top {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 clamp(16px, 4.3vw, 64px) 0 25px;
  border-bottom: 1px solid var(--edge);
}
.wordmark, .utilities {
  display: flex; gap: 10px; align-items: center; border: 0; padding: 8px 0;
  background: none; font-size: 20px; font-weight: 780; letter-spacing: -.06em; min-height: 46px;
}
.mark {
  display: flex; align-items: center; justify-content: center; gap: 3px;
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent);
}
.mark i { height: 12px; width: 3px; transform: rotate(30deg); border-radius: 2px; background: var(--ink); }
.mark i:nth-child(2) { height: 17px; }
.mark i:nth-child(3) { height: 9px; }
.utilities { padding-inline: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0; color: var(--muted); }
.rail {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 29px 12px;
  border-right: 1px solid var(--edge);
}
.rail button {
  display: flex; align-items: center; gap: 11px; min-height: 50px; padding: 0 13px;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted);
  text-align: left; font-size: 14px; font-weight: 660; white-space: nowrap;
}
.rail button span { width: 19px; flex: 0 0 19px; text-align: center; font-size: 22px; line-height: 1; }
.rail button:hover { color: var(--text); background: var(--panel); }
.rail button[aria-current="page"] { color: var(--accent); background: #2b2228; border-color: #3d2d38; }
main { width: 100%; max-width: 1560px; margin: 0 auto; padding: 31px clamp(18px, 4.3vw, 64px) 27px; }
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 335px; border: 1px solid #433142; border-radius: 21px;
  background: linear-gradient(108deg, #261c2c 8%, #2e2036 48%, #512e48 100%);
}
.hero-copy { position: relative; z-index: 1; padding: clamp(24px, 4.1vw, 59px); }
.hero h1 { font-size: clamp(46px, 6.4vw, 91px); line-height: .93; letter-spacing: -.078em; margin: 0; }
.hero-copy > p { color: #d4c4d8; line-height: 1.6; margin: 19px 0 23px; max-width: 330px; }
.hero-art { position: absolute; inset: 0 0 0 39%; overflow: hidden; pointer-events: none; }
.orb {
  position: absolute; top: 49%; left: 63%; transform: translate(-50%, -50%);
  width: clamp(290px, 36vw, 535px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(ellipse at 35% 25%, #ffc696 0%, #ed907c 20%, #b75478 42%, #733a6f 62%, #3b274c 83%);
  box-shadow: inset -15px -12px 72px #342040, 0 0 85px #e87c825c;
}
.ring {
  position: absolute; top: 49%; left: 56%; width: 115%; height: 41%; border: 1px solid #ffd1c488;
  border-radius: 50%; transform: translate(-50%, -50%) rotate(-27deg);
  box-shadow: 0 0 17px #eba68782, inset 0 0 14px #eba68763;
}
.ring.second { width: 132%; height: 53%; opacity: .58; }
.ring.third { width: 143%; height: 65%; opacity: .31; }
.actions, .form-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.primary, .secondary, .text-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 11px; border: 1px solid transparent;
  min-height: 46px; padding: 0 15px; border-radius: 9px; text-decoration: none; font-size: 14px; font-weight: 720; text-align: center;
}
.primary { background: var(--accent); color: var(--ink); }
.primary:hover { background: #ffcdb1; }
.secondary { background: #2a2733; border-color: #422f43; color: var(--text); }
.secondary:hover { background: #383342; }
.on-hero { background: #271d2cf2; border-color: #695263; }
.text-button { background: transparent; color: var(--accent); padding-inline: 8px; }
.text-button:hover { text-decoration: underline; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 32px 0 13px; }
.section-head h2, .panel h2, .game-card h2, .player-head h2 { margin: 0; font-size: 21px; letter-spacing: -.035em; }
.section-head p, .page-head p { margin: 5px 0 0; }
p, small { line-height: 1.55; }
p { color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.card, .shortcut {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; text-align: left;
  padding: 17px; color: var(--text); text-decoration: none;
  border: 1px solid var(--edge); border-radius: 13px; overflow: hidden; min-width: 0; background: var(--panel);
}
.card { min-height: 145px; isolation: isolate; }
.card:hover, .shortcut:hover { border-color: #a47a93; }
.card em { align-self: flex-start; color: #ebe7ee; font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 3px 7px; border: 1px solid #ffffff36; border-radius: 5px; background: #131219c4; margin-bottom: auto; }
.card strong, .shortcut strong { margin: 10px 0 2px; font-size: 17px; letter-spacing: -.025em; line-height: 1.25; }
.card small, .shortcut small { color: #d0c8d7; font-size: 12px; }
.card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #120e1240 10%, #110d13ee 96%); }
.card.dw { background: radial-gradient(ellipse at 82% 0%, #3a5c91, #22213c 62%); }
.card.azeera { background: radial-gradient(ellipse at 79% 0%, #9b7133, #362635 62%); }
.card.nasa { background: radial-gradient(ellipse at 82% 0%, #606dab, #28223b 63%); }
.card.lofi, .card.twitch { background: radial-gradient(ellipse at 82% 0%, #795486, #30233e 65%); }
.card-arrow { position: absolute; right: 13px; top: 12px; font-size: 15px; }
.shortcut { min-height: 110px; }
.shortcut span { color: var(--accent); font-size: 20px; }
.shortcut.twitch span { color: #cfb4ff; }
.shortcut.games span { color: #abe8c0; }
.page-head { margin: 10px 0 26px; }
.page-head h1 { margin: 0; font-size: clamp(40px, 6vw, 72px); line-height: 1; letter-spacing: -.075em; }
.provider-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.search-panel, .panel, .game-card { border: 1px solid var(--edge); border-radius: 13px; background: var(--panel); padding: 20px; }
form label, details label, .invite label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
input, select {
  display: block; padding: 11px 12px; min-height: 46px; width: 100%; min-width: 0;
  border: 1px solid #443d50; border-radius: 9px; background: #15131c; color: var(--text); font-size: 16px;
}
.form-row { flex-wrap: nowrap; }
.form-row input { flex: 1; }
.feedback { margin: 8px 0; }
.feedback:empty, #game-message:empty { display: none; }
.games-grid, .two-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.game-card { min-height: 250px; display: flex; flex-direction: column; align-items: flex-start; }
.game-card p { max-width: 320px; margin: 8px 0 18px; }
.game-card > .primary, .game-card > .secondary { margin-top: auto; }
.game-pc { background: radial-gradient(ellipse at 97% 1%, #57394b, var(--panel) 72%); }
.game-xbox { background: radial-gradient(ellipse at 100% 0%, #2d4c42, var(--panel) 72%); }
.game-symbol { margin-bottom: 13px; font-size: 35px; line-height: 1; color: #f7c5e0; }
.setup-steps { padding-inline-start: 24px; margin: 0 0 20px; color: var(--muted); }
.setup-steps li { padding-inline-start: 4px; margin-bottom: 12px; line-height: 1.6; }
.setup-steps a, .setup-steps code { color: var(--accent); }
.game-xbox .game-symbol { color: var(--green); }
#game-settings, .game-invite, .compact, .stream-panel { margin-top: 13px; }
[data-view-controls] { margin-bottom: 13px; }
[data-page="settings"] > .panel + .panel { margin-top: 13px; }
.view-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 13px; margin-top: 13px; }
.view-setting label { display: block; margin-bottom: 5px; font-size: 14px; font-weight: 700; }
.compact { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.compact p { margin: 5px 0 0; }
.first-head { margin-top: 0; }
.host-panel { min-width: 0; }
.host-panel h3, .invite h3 { font-size: 15px; margin: 18px 0 6px; }
.state { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.state.active { color: var(--green); }
details { margin: 11px 0; }
details summary { cursor: pointer; padding: 8px 0; color: var(--muted); font-size: 14px; }
#pair-form, .invite { margin-top: 15px; }
.invite { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 13px; align-items: start; }
.invite canvas { background: white; width: min(35vw, 162px); height: auto; image-rendering: pixelated; border-radius: 7px; }
.invite h3 { margin-top: 0; }
.invite p { margin: 4px 0 9px; }
.invite .actions { margin-top: 6px; }
.device-list { list-style: none; padding: 0; margin: 9px 0 0; }
.device-list li { display: flex; justify-content: space-between; gap: 7px; align-items: center; border-top: 1px solid var(--edge); padding: 6px 0; min-height: 39px; }
.device-list li > span { overflow-wrap: anywhere; }
.device-list small { display: block; color: var(--muted); }
video { display: block; width: 100%; background: #0a090d; max-height: 72vh; border-radius: 8px; aspect-ratio: 16 / 9; }
footer { margin-top: 34px; font-size: 12px; color: var(--muted); }
footer span { padding-inline: 7px; color: var(--accent); }
dialog { width: min(94vw, 990px); max-height: 92vh; padding: 15px; background: var(--panel); color: var(--text); border: 1px solid var(--edge); border-radius: 14px; }
dialog::backdrop { background: #0b0811dc; }
.player-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
#player-content iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; background: #0c0b0f; border-radius: 9px; }
#player-content.twitch-player iframe { min-height: 300px; }
dialog > p { margin: 4px 0 0; }
@media (max-width: 800px) {
  .shell { grid-template: auto auto 1fr / minmax(0, 1fr); }
  .top { height: 59px; padding-inline: 17px; }
  .rail { flex-direction: row; overflow-x: auto; padding: 7px 12px; border: 0; border-bottom: 1px solid var(--edge); }
  .rail button { gap: 4px; padding: 0 8px; flex: 1 0 auto; min-height: 45px; justify-content: center; }
  .rail button span { font-size: 18px; width: 15px; flex-basis: 15px; }
  main { padding-top: 16px; }
  .hero { min-height: 0; }
}
@media (max-width: 580px) {
  .rail button { font-size: 12px; }
  .hero-art { opacity: .66; inset-inline-start: 36%; }
  .hero-copy { background: linear-gradient(90deg, #241a2be0 8%, #261c2c95 48%, transparent 82%); }
  .hero-copy > p { font-size: 14px; margin: 15px 0 18px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards.games-grid, .two-panels { grid-template-columns: minmax(0, 1fr); }
  .show-viewer-first [data-page="pc"] { display: flex; flex-direction: column; }
  .show-viewer-first .two-panels { display: contents; }
  .show-viewer-first .host-panel { order: 2; margin-top: 13px; }
  .section-head { margin-top: 24px; }
  .first-head { margin-top: 0; }
  .card { min-height: 130px; padding: 11px; }
  .search-panel, .panel, .game-card { padding: 14px; }
  .game-card { min-height: 205px; }
  #pair-form .form-row { flex-wrap: wrap; }
  #device-label { flex-basis: 100%; }
  .controller { align-items: flex-start; flex-direction: column; }
  #player-content iframe { min-height: 200px; }
}
