
:root {
  color-scheme: dark;
  font-family: Inter, Arial, sans-serif;
  --page: #111713;
  --chrome: #121a15;
  --surface: #1a231b;
  --surface-raised: #202a20;
  --line: #445041;
  --text: #f5f5e8;
  --muted: #c1c9b9;
  --accent: #daf56e;
  --accent-ink: #172008;
  --platform-accent: #c6ee67;
  --gutter: 40px;
  --shell-gutter: 28px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
p, h1, h2, h3, dl, dd, figure { margin: 0; }
p { line-height: 1.55; }
:focus-visible { outline: 2px solid #faffdb; outline-offset: 4px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; z-index: 5; padding: 10px 14px; color: var(--accent-ink); background: var(--accent); transform: translateY(-120%); }
.skip:focus { transform: translateY(0); }
.shell { width: min(1200px, calc(100% - var(--shell-gutter) * 2)); margin-inline: auto; }

/* Shared platform shell */
.site-head, .site-foot { color: #f4f6f7; background: var(--chrome); border-color: #ffffff20; border-style: solid; border-width: 0; }
.site-head { position: relative; z-index: 3; border-bottom-width: 1px; }
.header-inner { display: flex; align-items: center; height: 87px; gap: 42px; }
.brand { font-size: 26px; font-weight: 900; letter-spacing: -.8px; white-space: nowrap; }
.brand strong { color: var(--platform-accent); }
.desktop-nav { align-self: stretch; display: flex; gap: 32px; }
.desktop-nav a { display: grid; place-items: center; white-space: nowrap; border-bottom: 3px solid transparent; color: #c8cdd0; }
.desktop-nav a.current { border-color: var(--platform-accent); color: #f4f6f7; }
.locale { display: flex; gap: 2px; margin-left: auto; }
.locale > * { display: grid; place-items: center; min-width: 40px; min-height: 44px; font-size: 13px; font-weight: 750; border-radius: 6px; }
.locale span { background: #adf96f17; color: var(--platform-accent); }
.mobile-nav { display: none; }
.site-foot { border-top-width: 1px; }
.footer-inner { min-height: 83px; display: flex; justify-content: space-between; align-items: center; gap: 24px; color: #c8cdd0; font-size: 14px; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-foot a:hover, .desktop-nav a:hover { color: #fff; }

main { width: min(100%, 1280px); margin-inline: auto; }
.hero { position: relative; isolation: isolate; overflow: clip; min-height: 615px; padding: 85px var(--gutter) 55px; }
.hero-art { position: absolute; inset: 0 0 0 20%; z-index: -2; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 12% 42%; }
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, var(--page) 19%, #111713db 29%, #11171341 52%, #11171300 77%, var(--page) 100%),
    linear-gradient(0deg, var(--page) 1%, #11171300 34%),
    linear-gradient(180deg, var(--chrome) 0%, #121a1500 14%);
}
.hero-content { width: min(560px, 100%); }
.game-meta { font: 750 14px/1.3 ui-monospace, monospace; letter-spacing: .08em; color: var(--accent); }
.game-meta span { padding-inline: 5px; }
.title-block h1 { font-size: clamp(64px, 7.75vw, 112px); line-height: .98; font-weight: 900; letter-spacing: -.055em; margin: 8px 0 14px -.055em; }
.title-block > p:last-child { font-size: clamp(18px, 2vw, 24px); font-weight: 590; color: var(--text); line-height: 1.38; letter-spacing: -.02em; }

.launch {
  margin-top: 28px; width: min(100%, 514px); overflow: hidden;
  border: 1px solid #778768; border-top: 2px solid var(--accent);
  border-radius: 8px; background: #171f18;
  box-shadow: 0 17px 54px #0209068f;
}
.launch-web { padding: 17px 18px 16px; }
.launch-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.launch-heading > span { color: var(--muted); font-size: 12px; }
.launch-label { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text); font-weight: 760; }
.launch-label svg { width: 19px; height: 19px; color: var(--accent); }
.launch-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn {
  min-height: 48px; display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  padding: 9px 13px; border: 1px solid var(--line); border-radius: 5px;
  color: var(--text); background: var(--surface); font-size: 14px; line-height: 1.3; font-weight: 790;
  text-align: center;
}
.btn svg { width: 19px; height: 19px; }
.btn.primary { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.launch-actions .btn { min-height: 53px; font-size: 15px; }
.btn.primary:hover { background: #ecff9d; border-color: #ecff9d; }
.btn.secondary:hover { background: #2a3828; border-color: #67775c; }
.launch-install { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); background: #202b20; }
.install-action {
  display: grid; grid-template-columns: 23px minmax(0, 1fr) 16px; align-items: center; gap: 9px;
  background: transparent; border: 0; color: var(--text); padding: 13px 15px; min-height: 64px; text-align: left;
}
.install-action + .install-action { border-left: 1px solid var(--line); }
.install-action b, .install-action small { display: block; }
.install-action b { font-size: 14px; font-weight: 780; }
.install-action small { color: var(--muted); font-size: 12px; margin-top: 3px; }
.install-action svg { color: var(--accent); }
.install-action .tail { width: 16px; height: 16px; color: var(--muted); }
.install-action:hover { background: #2a3828; }
.install-action:focus-visible { outline-offset: -4px; }

.content { padding: 42px var(--gutter); border-top: 1px solid var(--line); scroll-margin-top: 20px; }
h2 { font-size: clamp(29px, 4vw, 44px); font-weight: 850; line-height: 1.05; letter-spacing: -.055em; }
h3 { font-size: 21px; font-weight: 800; letter-spacing: -.035em; }
.section-header { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-header p, .guide-text p { color: var(--muted); margin-top: 8px; max-width: 55ch; font-size: 15px; }
.section-header .btn { flex-shrink: 0; }
.coop { background: #151e16; }
.coop-layout { display: grid; grid-template-columns: 1.45fr 1fr; gap: 14px; }
.directory, .invitation { min-width: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.directory { background: var(--surface); }
.directory-head {
  min-height: 62px; padding: 8px 12px 8px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border-bottom: 1px solid var(--line);
}
.directory-head h3 { font-size: 16px; letter-spacing: -.015em; }
.icon-action { display: grid; place-items: center; color: var(--text); border: 1px solid var(--line); background: #202b20; border-radius: 5px; width: 44px; height: 44px; padding: 0; }
.icon-action:hover { background: #2a3828; }
.icon-action svg { width: 18px; height: 18px; }
.directory-result { min-height: 140px; }
.directory-result > p { display: grid; align-content: center; min-height: 140px; padding: 18px; font-size: 15px; color: var(--muted); }
.directory-result > p strong { color: var(--text); }
.directory-result > p small { margin-top: 3px; font-size: 14px; }
.directory-result > p a { width: fit-content; margin-top: 4px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.room-list { list-style: none; margin: 0; padding: 0; }
.room-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 11px; align-items: center; padding: 10px 12px 10px 18px; }
.room-row + .room-row { border-top: 1px solid var(--line); }
.room-row strong { overflow-wrap: anywhere; }
.room-row .room-size { color: var(--muted); font-size: 13px; white-space: nowrap; }
.room-row .btn { min-height: 44px; }
.invitation { isolation: isolate; display: flex; align-items: center; position: relative; background: #253421; padding: 20px; }
.invitation img { position: absolute; right: -13px; bottom: -15px; width: clamp(118px, 16vw, 215px); height: auto; z-index: -2; }
.invitation::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #253421 45%, #253421aa 64%, transparent 100%); }
.invitation p { margin-top: 4px; font-size: 14px; color: var(--muted); max-width: 30ch; }
.invitation .btn { margin-top: 12px; justify-content: space-between; }
.section-icon { color: var(--accent); margin-bottom: 7px; }

.guide { display: grid; grid-template-columns: 1.05fr 1fr; gap: 30px; align-items: center; }
.guide-text { padding-block: 6px; }
.control-picker { display: flex; gap: 6px; margin-top: 13px; }
.control-picker button { min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--surface); font-size: 13px; font-weight: 730; }
.control-picker button:hover { background: #2a3828; }
.control-picker button[aria-pressed="true"] { color: var(--accent); border-color: #778768; background: #253421; }
.keys { margin-top: 15px; width: min(100%, 410px); }
.keys > div { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 5px; min-height: 45px; border-bottom: 1px solid var(--line); }
.keys dt { display: flex; gap: 4px; font-size: 13px; font-weight: 700; }
.keys dd { font-size: 14px; color: var(--muted); }
kbd { display: inline-grid; place-items: center; min-width: 27px; min-height: 27px; padding: 0 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); font: 740 13px/1 ui-monospace, monospace; }
.screen { justify-self: center; width: min(100%, 420px); border: 1px solid var(--line); background: #080e0a; border-radius: 8px; padding: 11px 11px 0; }
.screen img { width: 100%; height: auto; image-rendering: pixelated; }
.screen-wide { width: 100%; }
.screen-wide img { image-rendering: auto; }
.screen figcaption { color: var(--muted); font-size: 12px; padding: 9px 0; }

dialog { width: min(calc(100% - 26px), 490px); max-height: calc(100% - 26px); color: var(--text); border: 1px solid #778768; border-radius: 10px; padding: 0; background: #1a261b; box-shadow: 0 14px 65px #000b; }
dialog::backdrop { background: #070d09d9; }
.dialog-card { position: relative; padding: 24px; }
.dialog-card h2 { font-size: clamp(25px, 3.7vw, 34px); margin: 8px 42px 8px 0; }
.dialog-card > p, .device-options p { color: var(--muted); font-size: 14px; }
.dialog-close { position: absolute; top: 12px; right: 12px; }
.dialog-card .btn { display: flex; width: 100%; justify-content: space-between; margin-top: 14px; }
.device-options { margin-block: 17px 13px; }
.device-options details { border-top: 1px solid var(--line); }
.device-options details:last-child { border-bottom: 1px solid var(--line); }
.device-options summary { position: relative; display: flex; justify-content: space-between; min-height: 46px; align-items: center; padding: 10px 23px 10px 0; gap: 8px; font-size: 15px; font-weight: 750; cursor: pointer; list-style: none; }
.device-options summary::-webkit-details-marker { display: none; }
.device-options summary span { color: var(--muted); font-size: 13px; font-weight: 550; }
.device-options summary::after { content: '+'; position: absolute; right: 4px; font-size: 20px; color: var(--accent); }
.device-options details[open] summary::after { content: '−'; }
.device-options p { padding-bottom: 13px; }
#invite-form { margin-top: 17px; }
#invite-form label { display: block; font-size: 14px; font-weight: 750; margin-bottom: 6px; }
#invite-code { width: 100%; min-height: 48px; border: 1px solid #778768; border-radius: 5px; padding: 9px 11px; background: #121a13; color: var(--text); }
#invite-error:not(:empty) { color: #ffc399; margin-top: 6px; font-size: 13px; }

@media (max-width: 960px) {
  :root { --gutter: 28px; }
  .header-inner { gap: 24px; }
  .desktop-nav { gap: 20px; }
  .footer-inner { min-height: 81px; }
  .hero { min-height: 558px; padding-block: 60px 44px; }
  .hero-art { left: 12%; }
  .hero::after { background: linear-gradient(90deg, var(--page) 11%, #111713dc 28%, #11171359 59%, #1117131c 78%, #11171364), linear-gradient(0deg, var(--page), #11171300 37%), linear-gradient(180deg, var(--chrome), #121a1500 14%); }
}
@media (max-width: 740px) {
  .desktop-nav { display: none; }
  .header-inner { height: 71px; gap: 10px; }
  .brand { font-size: 23px; }
  .locale > * { min-width: 34px; }
  .mobile-nav { display: block; }
  .mobile-nav summary { display: grid; place-items: center; list-style: none; cursor: pointer; width: 44px; height: 44px; border: 1px solid #ffffff25; border-radius: 6px; }
  .mobile-nav summary::-webkit-details-marker { display: none; }
  .mobile-nav nav { position: absolute; inset: 100% 0 auto; display: grid; padding: 8px var(--shell-gutter); background: var(--chrome); border-bottom: 1px solid #ffffff28; }
  .mobile-nav nav a { padding: 12px 0; min-height: 44px; }
  .mobile-nav nav a.current { color: var(--platform-accent); }
  .coop-layout { grid-template-columns: 1fr 1fr; }
  .content { padding-block: 30px; }
  .guide { gap: 22px; }
}
@media (max-width: 620px) {
  :root { --gutter: 20px; --shell-gutter: 20px; }
  .hero { min-height: 0; padding-top: clamp(158px, 50vw, 278px); padding-bottom: 28px; }
  .hero-art { inset: 0 0 auto; height: clamp(350px, 95vw, 500px); }
  .hero-art img { object-position: 50% 43%; }
  .hero::after {
    background: linear-gradient(180deg, #121a1580, #121a1500 8%, #11171300 18%, #111713a8 33%, var(--page) 55%);
  }
  .game-meta { font-size: 12px; }
  .title-block h1 { font-size: clamp(42px, 13vw, 72px); margin-block: 5px 9px; }
  .title-block > p:last-child { font-size: 17px; line-height: 1.4; }
  .launch { margin-top: 16px; width: 100%; }
  .launch-web { padding: 12px 11px; }
  .launch-heading { margin-bottom: 8px; }
  .launch-label { font-size: 14px; }
  .launch-actions .btn { padding-inline: 6px; min-height: 48px; font-size: clamp(12px, 3.5vw, 14px); gap: 5px; }
  .launch-actions .btn svg { width: 16px; height: 16px; }
  .install-action { padding: 9px 10px; grid-template-columns: 17px minmax(0, 1fr); gap: 7px; min-height: 61px; }
  .install-action > svg { width: 17px; height: 17px; }
  .install-action .tail { display: none; }
  .install-action b { font-size: 13px; }
  .install-action small { font-size: 11px; }
  .section-header { display: grid; margin-bottom: 14px; gap: 12px; }
  .section-header .btn { justify-self: start; }
  .coop-layout, .guide { grid-template-columns: 1fr; }
  .directory-result, .directory-result > p { min-height: 99px; }
  .invitation img { width: min(42%, 195px); }
  .guide .screen { justify-self: stretch; width: min(100%, 450px); }
  .footer-inner { min-height: 121px; align-items: start; justify-content: center; gap: 8px; flex-direction: column; padding-block: 16px; }
  .footer-inner nav { gap: 8px 20px; }
}
@media (max-width: 360px) {
  .install-action { grid-template-columns: 1fr; }
  .install-action > svg { display: none; }
  .room-row { padding-left: 12px; }
}

/* Present the existing room controller's panels in the selected landing style. */
.locale a[aria-current="true"] { background: #adf96f17; color: var(--platform-accent); }
.directory-result { display: grid; align-content: center; }
.directory-result > p { display: block; min-height: auto; }
#rooms-list { padding-inline: 18px; }
#rooms-list:not(:empty) { padding-bottom: 10px; }
.room-card { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 8px 0; }
.room-card h3 { font-size: 15px; overflow-wrap: anywhere; }
.room-card > p { font-size: 13px; color: var(--muted); }
.room-card .button, .room-dialogs .button {
  display: inline-flex; justify-content: center; align-items: center; min-height: 44px; border: 1px solid var(--line); border-radius: 5px;
  padding: 8px 12px; background: var(--surface-raised); color: var(--text); font-size: 14px; font-weight: 760; text-align: center;
}
.room-dialogs .button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.room-card .button:hover, .room-dialogs .button:hover { filter: brightness(1.12); }
.room-dialogs dialog { width: min(550px, calc(100% - 26px)); }
.room-dialogs .dialog-body { padding: 23px; display: grid; gap: 14px; }
.room-dialogs .dialog-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.room-dialogs .dialog-head h2 { font-size: clamp(25px, 4vw, 33px); }
.room-dialogs .close-modal { background: var(--surface-raised); border: 1px solid var(--line); border-radius: 5px; min-width: 44px; min-height: 44px; color: var(--text); font-size: 22px; }
.room-dialogs .dialog-brand, .room-dialogs .room-actions, .room-dialogs .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.room-dialogs .dialog-brand { color: var(--muted); font-size: 13px; justify-content: space-between; }
.room-dialogs .field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.room-dialogs label { display: grid; gap: 5px; font-size: 14px; font-weight: 660; }
.room-dialogs input, .room-dialogs select { width: 100%; min-width: 0; padding: 8px; min-height: 44px; color: var(--text); background: var(--page); border: 1px solid var(--line); border-radius: 5px; font: inherit; }
.room-dialogs .share-area, .room-dialogs .qr-box { display: grid; gap: 10px; }
.room-dialogs .qr-box img { background: #fff; width: min(180px, 100%); padding: 6px; height: auto; image-rendering: pixelated; }
.room-dialogs .hint { color: var(--muted); font-size: 14px; }
.room-dialogs .form-error:not(:empty) { color: #ffc399; font-size: 14px; }
@media (max-width: 620px) {
  .room-card { grid-template-columns: minmax(0, 1fr) auto; }
  .room-card > h3 { grid-column: 1 / -1; }
  .room-dialogs .field-row { grid-template-columns: 1fr; }
}
