:root {
  color-scheme: dark;
  --ink: #f7f2e7;
  --muted: #bdb6a7;
  --panel: rgba(12, 13, 15, 0.88);
  --panel-strong: rgba(9, 10, 12, 0.96);
  --line: rgba(255, 255, 255, 0.13);
  --accent: #30d293;
  --accent-2: #f0b765;
  --danger: #ef6767;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #090b0d;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.lobby-page {
  overflow: auto;
  min-height: 100%;
  background:
    radial-gradient(circle at 70% 20%, rgba(48, 210, 147, 0.16), transparent 32%),
    radial-gradient(circle at 20% 70%, rgba(240, 183, 101, 0.12), transparent 28%),
    linear-gradient(145deg, #080a0b 0%, #13181b 55%, #0a0c0e 100%);
}

.lobby-shell {
  width: min(1100px, calc(100% - 36px));
  min-height: 100%;
  margin: 0 auto;
  padding: 42px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 42px;
  align-items: center;
}

/* CR-287: grid items default to min-width:auto, which floors them at
   their content min-content width and blows the track out on a phone. */
.lobby-shell > * { min-width: 0; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
}

.brand-mark::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 24px rgba(48, 210, 147, 0.8);
}

.lobby-copy h1 {
  margin: 22px 0 18px;
  max-width: 780px;
  font-size: clamp(46px, 7vw, 92px);
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.lobby-copy p {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.55;
}

.feature-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.feature-strip span,
.status-pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  border-radius: 999px;
  padding: 8px 12px;
  color: #dfdbd2;
  font-size: 13px;
}

.lobby-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.lobby-card h2 {
  margin: 0 0 5px;
  font-size: 25px;
}

.lobby-card .subtle {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.45;
}

.field {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.field label {
  color: #ded8ca;
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink);
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: rgba(48, 210, 147, 0.7);
  box-shadow: 0 0 0 3px rgba(48, 210, 147, 0.12);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.avatar-option {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 6px 8px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  text-align: center;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.avatar-option:hover {
  transform: translateY(-2px);
}

.avatar-option[aria-pressed="true"] {
  border-color: var(--accent);
  background: rgba(48, 210, 147, 0.11);
}

.avatar-swatch {
  width: 40px;
  height: 40px;
  margin: 0 auto 7px;
  border-radius: 50% 50% 44% 44%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.14);
}

.avatar-option span:last-child {
  display: block;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
}

.avatar-option[data-look="emerald"] .avatar-swatch { background: #3aa27a; }
.avatar-option[data-look="copper"] .avatar-swatch { background: #b56d4c; }
.avatar-option[data-look="navy"] .avatar-swatch { background: #405b86; }
.avatar-option[data-look="rose"] .avatar-swatch { background: #a85d75; }
.avatar-option[data-look="slate"] .avatar-swatch { background: #68727a; }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  color: var(--muted);
  font-size: 14px;
}

.toggle-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.primary-button,
.control-button,
.secondary-button {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  min-height: 52px;
  margin-top: 10px;
  padding: 0 18px;
  background: linear-gradient(135deg, #2bd28f, #1ca776);
  color: #07130e;
  box-shadow: 0 12px 32px rgba(48, 210, 147, 0.2);
}

.primary-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

/* email step (CR-204): a quiet way past the first screen, so skipping
   never reads as the wrong choice */
.link-button {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: 0;
  background: none;
  color: rgba(226, 240, 235, 0.62);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.link-button:hover {
  color: rgba(226, 240, 235, 0.92);
}

.welcome-back {
  margin: 0 0 12px;
  border-left: 3px solid #2bd28f;
  padding: 8px 0 8px 12px;
  color: #cfe9df;
}

.error-box {
  display: none;
  margin-top: 12px;
  border: 1px solid rgba(239, 103, 103, 0.5);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(239, 103, 103, 0.12);
  color: #ffd0d0;
  font-size: 13px;
}

.error-box.visible {
  display: block;
}

.world-page,
.world-page a-scene {
  position: fixed;
  inset: 0;
}

.world-page canvas {
  display: block;
}

.hud {
  position: fixed;
  z-index: 20;
  pointer-events: none;
}

.hud-top {
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.room-card,
.action-card,
.chat-card,
.entry-card,
.toast {
  pointer-events: auto;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.room-card {
  min-width: 230px;
  border-radius: 16px;
  padding: 12px 14px;
}

.room-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.room-title::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 18px rgba(240, 183, 101, 0.8);
}

.room-meta {
  margin-top: 6px;
  display: flex;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.action-card {
  display: flex;
  gap: 8px;
  border-radius: 16px;
  padding: 7px;
}

.control-button,
.secondary-button {
  min-height: 40px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--ink);
}

.control-button:hover,
.secondary-button:hover {
  background: rgba(255, 255, 255, 0.13);
}

.control-button.active {
  color: #07130e;
  background: var(--accent);
}

.hud-bottom {
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.chat-card {
  width: min(440px, calc(100vw - 28px));
  border-radius: 16px;
  padding: 12px;
}

.chat-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 800;
}

.ai-badge {
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(48, 210, 147, 0.13);
  color: #81efc2;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chat-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.chat-row input {
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink);
  outline: none;
}

.chat-row button {
  min-width: 74px;
}

.help-card {
  pointer-events: auto;
  max-width: 330px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  text-shadow: 0 2px 10px #000;
}

.entry-overlay {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: radial-gradient(circle at center, rgba(22, 32, 30, 0.68), rgba(3, 4, 5, 0.94));
  transition: opacity 240ms ease;
}

.entry-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.entry-card {
  width: min(520px, 100%);
  border-radius: 22px;
  padding: 25px;
  text-align: center;
}

.entry-card h1 {
  margin: 5px 0 10px;
  font-size: clamp(34px, 8vw, 56px);
  line-height: 1;
}

.entry-card p {
  margin: 0 auto 20px;
  max-width: 420px;
  color: var(--muted);
  line-height: 1.55;
}

.entry-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.entry-actions .primary-button {
  margin: 0;
}

.toast {
  position: fixed;
  z-index: 70;
  left: 50%;
  top: 82px;
  transform: translate(-50%, -16px);
  max-width: min(540px, calc(100vw - 30px));
  border-radius: 12px;
  padding: 10px 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  color: #e8e3d8;
  font-size: 13px;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mobile-pad {
  position: fixed;
  z-index: 25;
  left: 18px;
  bottom: 118px;
  width: 112px;
  height: 112px;
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  background: rgba(10, 12, 14, 0.35);
  backdrop-filter: blur(8px);
  touch-action: none;
}

.mobile-pad-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: translate(-50%, -50%);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

body.mobile-input .mobile-pad {
  display: block;
}

body.vr-mode .hud,
body.vr-mode .mobile-pad,
body.vr-mode .toast {
  display: none !important;
}

.a-enter-ar {
  display: none !important;
}

/* A-Frame's floating VR button sat bottom-right ON TOP of the chat Send
   button on phones (Brett, Samsung) - park the wrapper top right and
   let the button flow inside it */
.a-enter-vr {
  position: fixed !important;
  top: 12px !important;
  right: 12px !important;
  bottom: auto !important;
  left: auto !important;
  width: auto !important;
  height: auto !important;
}

.a-enter-vr-button {
  position: static !important;
  top: auto !important;
}

@media (max-width: 820px) {
  .lobby-shell {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 30px 0;
  }

  .lobby-copy h1 {
    font-size: clamp(48px, 16vw, 78px);
  }

  .hud-top {
    align-items: stretch;
  }

  .action-card {
    max-width: 55vw;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .control-button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }

  .help-card {
    display: none;
  }

  .chat-card {
    width: min(400px, calc(100vw - 150px));
  }
}

@media (max-width: 560px) {
  .avatar-grid {
    grid-template-columns: repeat(5, minmax(52px, 1fr));
  }

  .lobby-card {
    padding: 19px;
  }

  .room-card {
    min-width: 0;
  }

  .room-meta .quality-label {
    display: none;
  }

  .action-card {
    max-width: 62vw;
  }

  .hud-bottom {
    left: 136px;
  }

  .chat-card {
    width: calc(100vw - 150px);
    min-width: 210px;
  }

  .entry-actions {
    grid-template-columns: 1fr;
  }
}

/* first-visit download note (CR-258, Brett: maybe a warning for people
   the project size somewhere too, first load is hefty, once off).
   Boxed rather than another grey line, because a line of small print
   above the button is exactly what nobody reads. */
.lobby-card .first-load-note {
  border: 1px solid rgba(255, 200, 120, .30);
  background: rgba(255, 190, 100, .07);
  border-radius: 10px;
  padding: 10px 13px;
  margin: 14px 0 4px;
  line-height: 1.5;
}
.lobby-card .first-load-note strong { color: #f0c88a; }
/* teaser carousel (CR-269). The stage holds a 16:9 box whatever is in it,
   so switching between a photo and a video never jumps the page. */
/* CR-287 (Brett: whole website is not mobile friendly either). `width`
   is not decoration here - it is the fix. These sections are grid items
   with AUTO side margins, and an auto margin cancels a grid item's
   stretch, so the item falls back to shrink-to-fit sizing. Shrink-to-fit
   never goes below the content's min-content width, and .promo-strip's
   min-content is the full thumbnail row - so on a 375px phone this
   section sized itself to 826px and html{overflow-x:hidden} quietly
   cropped the page instead of scrolling it. An explicit width takes the
   sizing decision away from the content; the auto margins still centre
   it under max-width on a wide screen. */
.promo-section { width: 100%; max-width: 980px; margin: 34px auto 10px; padding: 0 22px; }
.promo-section h2 { margin: 0 0 4px; font-size: 20px; }
.promo-lede { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }
.promo-stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: 14px; overflow: hidden; background: #0b1116;
  border: 1px solid rgba(255,255,255,.12);
}
.promo-stage img, .promo-stage video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.promo-caption { padding: 11px 2px 0; font-size: 13.5px; line-height: 1.5; }
.promo-caption strong { display: block; }
.promo-caption span { color: var(--muted); }
.promo-strip {
  display: flex; gap: 9px; margin-top: 13px;
  overflow-x: auto; scroll-snap-type: x proximity;
  padding-bottom: 6px; -webkit-overflow-scrolling: touch;
}
.promo-thumb {
  position: relative; flex: 0 0 128px; height: 74px; padding: 0;
  border-radius: 9px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; background: #0b1116;
  scroll-snap-align: start; transition: border-color .15s, opacity .15s;
  opacity: .68;
}
.promo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.promo-thumb:hover { opacity: 1; }
.promo-thumb[aria-selected="true"] { opacity: 1; border-color: #8fe0c0; }
.promo-thumb:focus-visible { outline: 2px solid #8fe0c0; outline-offset: 2px; }
/* play badge, so a video reads as a video before you click it */
.promo-play {
  position: absolute; inset: 0; margin: auto; width: 26px; height: 26px;
  border-radius: 50%; background: rgba(10,16,20,.72);
  border: 1px solid rgba(255,255,255,.55);
}
.promo-play::after {
  content: ''; position: absolute; top: 50%; left: 54%;
  transform: translate(-50%, -50%);
  border-left: 8px solid #fff; border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
@media (max-width: 560px) {
  .promo-thumb { flex-basis: 104px; height: 60px; }
}
/* the YRNA mark on the lobby (CR-272). Square, transparent, and it
   contains the wordmark - so it needs room to breathe rather than a
   border and a tile. */
.brand-logo {
  display: block;
  width: min(272px, 58%);
  height: auto;
  margin: -12px 0 4px -14px;   /* the artwork carries its own glow padding */
}
@media (max-width: 720px) {
  .brand-logo { width: min(212px, 48%); margin-left: -10px; }
}
/* the commercial pitch (CR-275). Two panels rather than one wall of copy:
   running an event here and sponsoring the beta are different asks aimed
   at different readers. */
.pitch {
  width: 100%;
  max-width: 980px;
  margin: 30px auto 0;
  padding: 22px 24px 24px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
}
.pitch h2 { margin: 0 0 6px; font-size: 21px; }
.pitch-lede { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.pitch-list { margin: 0; padding-left: 20px; line-height: 1.65; font-size: 14.5px; }
.pitch-list li { margin-bottom: 7px; }
.pitch-list a { color: #8fe0c0; }
.pitch-body { margin: 0 0 16px; font-size: 14.5px; line-height: 1.65; }
.pitch.sponsor {
  border-color: rgba(143,224,192,.34);
  background: rgba(90,200,160,.06);
  margin-bottom: 34px;
}
.pitch.sponsor strong { color: #8fe0c0; }
.pitch-cta { margin: 0; }
.pitch-button {
  display: inline-block; text-decoration: none;
  background: #1f8a6a; color: #fff;
  border: 1px solid #2fbb90; border-radius: 10px;
  padding: 11px 20px; font-weight: 600; font-size: 14.5px;
}
.pitch-button:hover { background: #24a17c; }
@media (max-width: 560px) {
  .pitch { padding: 18px 17px 20px; }
}