*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --rv-bg: #071018;
  --rv-panel: rgba(12, 18, 28, 0.78);
  --rv-panel-strong: rgba(12, 18, 28, 0.92);
  --rv-ink: #f1e8db;
  --rv-muted: #b6a997;
  --rv-cyan: #6cdcfe;
  --rv-gold: #ffc26f;
  --rv-green: #87f0a5;
  --rv-red: #ff7869;
  --rv-stroke: rgba(255,255,255,0.13);
}

body.ls-vr-home,
body.ls-river-vr,
body.ls-social-vr {
  margin: 0;
  min-height: 100vh;
  color: var(--rv-ink);
  background: var(--rv-bg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body.ls-river-vr,
body.ls-social-vr {
  overflow: hidden;
  touch-action: none;
}

button,
a,
input { font: inherit; }

#vr-home-bg,
#river-vr-canvas,
#lsvr-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

.ls-vr-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: max(env(safe-area-inset-top), 16px) clamp(16px, 4vw, 42px) 14px;
  background: linear-gradient(180deg, rgba(7,16,24,0.86), rgba(7,16,24,0));
}

.ls-vr-brand,
.ls-vr-topbar a {
  color: var(--rv-ink);
  text-decoration: none;
  font-weight: 800;
}

.ls-vr-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ls-vr-brand span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--rv-stroke);
  color: var(--rv-cyan);
  background: rgba(255,255,255,0.06);
}

.ls-vr-topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ls-vr-topbar nav a {
  color: var(--rv-muted);
  border: 1px solid var(--rv-stroke);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.05);
}

.ls-vr-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: clamp(18px, 4vw, 46px);
  align-items: end;
  padding: 110px clamp(18px, 7vw, 96px) clamp(22px, 7vh, 72px);
}

.ls-vr-hero {
  max-width: 760px;
  align-self: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--rv-cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ls-vr-hero h1 {
  margin: 0;
  max-width: 10ch;
  font-size: clamp(54px, 9vw, 116px);
  line-height: 0.9;
  letter-spacing: 0;
}

.ls-vr-line {
  max-width: 600px;
  color: var(--rv-muted);
  font-size: clamp(17px, 2vw, 23px);
  line-height: 1.45;
  margin: 20px 0 24px;
}

.ls-vr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ls-vr-primary,
.ls-vr-secondary,
.rvxr-actions button,
.lsvr-actions button,
.lsvr-actions a,
#VRButton {
  min-height: 48px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 18px !important;
  border-radius: 12px !important;
  border: 1px solid var(--rv-stroke) !important;
  text-decoration: none !important;
  font-weight: 850 !important;
  letter-spacing: 0.02em !important;
}

.ls-vr-primary,
#VRButton {
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  width: auto !important;
  margin: 0 !important;
  color: #061018 !important;
  background: linear-gradient(180deg, #a9f0ff, var(--rv-cyan)) !important;
  border-color: rgba(190,245,255,0.9) !important;
}

.ls-vr-secondary,
.rvxr-actions button,
.lsvr-actions button,
.lsvr-actions a {
  color: var(--rv-ink) !important;
  background: rgba(255,255,255,0.08) !important;
}

.ls-vr-status {
  display: inline-flex;
  margin-top: 16px;
  padding: 8px 12px;
  border: 1px solid var(--rv-stroke);
  border-radius: 999px;
  color: var(--rv-muted);
  background: rgba(0,0,0,0.22);
  font-size: 13px;
}

.ls-vr-panels {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--rv-stroke);
  border-radius: 16px;
  background: var(--rv-panel);
  backdrop-filter: blur(16px);
}

.ls-vr-panels article {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.ls-vr-panels article:last-child { border-bottom: 0; }
.ls-vr-panels b { color: var(--rv-gold); text-transform: uppercase; font-size: 12px; letter-spacing: 0.08em; }
.ls-vr-panels span { color: var(--rv-muted); line-height: 1.4; }

.rvxr-hud,
.rvxr-chat,
.rvxr-start,
.lsvr-hud,
.lsvr-chat,
.lsvr-start,
.lsvr-toolbox {
  position: fixed;
  z-index: 8;
}

.rvxr-hud,
.lsvr-hud {
  top: 14px;
  left: 14px;
  width: min(340px, calc(100vw - 28px));
  padding: 12px 14px;
  border: 1px solid var(--rv-stroke);
  border-radius: 14px;
  background: var(--rv-panel);
  backdrop-filter: blur(14px);
}

.rvxr-hud header,
.lsvr-hud header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--rv-muted);
  font-size: 12px;
}

.rvxr-back,
.lsvr-hud a { color: var(--rv-cyan); text-decoration: none; font-weight: 800; }
.rvxr-hud h1,
.lsvr-hud h1 { margin: 8px 0 4px; font-size: 24px; line-height: 1; }
.rvxr-hud p,
.lsvr-hud p { margin: 0; color: var(--rv-muted); line-height: 1.35; }

.rvxr-stats,
.lsvr-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.rvxr-stats span,
.lsvr-pills span {
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  color: var(--rv-gold);
  background: rgba(0,0,0,0.24);
  font-size: 12px;
}

.rvxr-start,
.lsvr-start {
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: linear-gradient(90deg, rgba(7,16,24,0.92), rgba(7,16,24,0.48));
}

.rvxr-start.hidden,
.lsvr-start.hidden { display: none; }

.rvxr-start > div,
.lsvr-start > div {
  width: min(620px, 100%);
  justify-self: start;
  margin-left: min(8vw, 96px);
}

.rvxr-start h2,
.lsvr-start h2 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(46px, 8vw, 88px);
  line-height: 0.92;
}

.rvxr-start p,
.lsvr-start p {
  color: var(--rv-muted);
  font-size: 17px;
  line-height: 1.45;
}

.rvxr-actions,
.lsvr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rvxr-support,
.lsvr-support {
  width: fit-content;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--rv-stroke);
  background: rgba(0,0,0,0.25);
  font-size: 13px !important;
}

.rvxr-chat,
.lsvr-chat {
  right: 14px;
  bottom: 14px;
  width: min(390px, calc(100vw - 28px));
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--rv-stroke);
  border-radius: 14px;
  background: var(--rv-panel);
  backdrop-filter: blur(14px);
}

.rvxr-chat header,
.lsvr-chat header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rvxr-chat label,
.lsvr-chat label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--rv-muted);
  font-size: 12px;
}

#rvxr-chat-log {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  max-height: 142px;
  overflow: auto;
}

#lsvr-chat-log {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  max-height: 142px;
  overflow: auto;
}

#rvxr-chat-log li {
  padding: 7px 9px;
  border-radius: 10px;
  color: var(--rv-ink);
  background: rgba(255,255,255,0.07);
  font-size: 13px;
}

#lsvr-chat-log li {
  padding: 7px 9px;
  border-radius: 10px;
  color: var(--rv-ink);
  background: rgba(255,255,255,0.07);
  font-size: 13px;
}

#rvxr-chat-log b { color: var(--rv-cyan); margin-right: 5px; }
#lsvr-chat-log b { color: var(--rv-cyan); margin-right: 5px; }

#rvxr-chat-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
}

#lsvr-chat-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
}

#rvxr-chat-form input,
#rvxr-chat-form button,
#lsvr-chat-form input,
#lsvr-chat-form button {
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--rv-stroke);
  color: var(--rv-ink);
}

#rvxr-chat-form input {
  min-width: 0;
  padding: 0 10px;
  background: rgba(0,0,0,0.34);
}

#lsvr-chat-form input {
  min-width: 0;
  padding: 0 10px;
  background: rgba(0,0,0,0.34);
}

#rvxr-chat-form button {
  padding: 0 10px;
  background: rgba(255,255,255,0.08);
}

#lsvr-chat-form button {
  padding: 0 10px;
  background: rgba(255,255,255,0.08);
}

#rvxr-chat-form button:last-child {
  color: #061018;
  background: var(--rv-gold);
}

#lsvr-chat-form button:last-child {
  color: #061018;
  background: var(--rv-gold);
}

#rvxr-voice-status {
  margin: 0;
  color: var(--rv-muted);
  font-size: 12px;
}

#lsvr-voice-status {
  margin: 0;
  color: var(--rv-muted);
  font-size: 12px;
}

.lsvr-toolbox {
  top: 14px;
  right: 14px;
  width: min(320px, calc(100vw - 28px));
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--rv-stroke);
  border-radius: 14px;
  background: var(--rv-panel);
  backdrop-filter: blur(14px);
}

.lsvr-toolbox.collapsed .lsvr-tool-grid,
.lsvr-toolbox.collapsed p {
  display: none;
}

.lsvr-toolbox header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lsvr-toolbox header button,
.lsvr-tool-grid button {
  min-height: 36px;
  border: 1px solid var(--rv-stroke);
  border-radius: 10px;
  color: var(--rv-ink);
  background: rgba(255,255,255,0.08);
}

.lsvr-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.lsvr-toolbox p {
  margin: 0;
  color: var(--rv-muted);
  font-size: 12px;
  line-height: 1.35;
}

.rvxr-reticle,
.lsvr-reticle {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  z-index: 4;
  transform: translate(-50%, -50%);
  pointer-events: none;
  border: 1px solid rgba(108,220,254,0.75);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(108,220,254,0.3);
}

.rvxr-reticle::before,
.rvxr-reticle::after,
.lsvr-reticle::before,
.lsvr-reticle::after {
  content: "";
  position: absolute;
  background: rgba(108,220,254,0.8);
}

.rvxr-reticle::before,
.lsvr-reticle::before { left: 50%; top: 7px; bottom: 7px; width: 1px; }
.rvxr-reticle::after,
.lsvr-reticle::after { top: 50%; left: 7px; right: 7px; height: 1px; }

body.xr-active .rvxr-hud,
body.xr-active .rvxr-chat,
body.xr-active .rvxr-reticle,
body.xr-active .rvxr-start,
body.xr-active .lsvr-hud,
body.xr-active .lsvr-chat,
body.xr-active .lsvr-toolbox,
body.xr-active .lsvr-reticle,
body.xr-active .lsvr-start {
  display: none !important;
}

@media (max-width: 820px) {
  .ls-vr-shell {
    display: block;
    padding: 96px 18px 22px;
  }
  .ls-vr-hero h1 { max-width: 12ch; }
  .ls-vr-actions,
  .rvxr-actions,
  .lsvr-actions,
  #rvxr-chat-form,
  #lsvr-chat-form { grid-template-columns: 1fr; display: grid; }
  .ls-vr-primary,
  .ls-vr-secondary { width: 100%; }
  .ls-vr-panels { margin-top: 24px; }
  .ls-vr-panels article { grid-template-columns: 1fr; }
  .rvxr-start > div,
  .lsvr-start > div { margin-left: 0; align-self: end; padding-bottom: 88px; }
  .rvxr-chat,
  .lsvr-chat { position: fixed; left: 14px; right: 14px; width: auto; }
  .lsvr-toolbox { top: auto; bottom: 14px; left: 14px; right: 14px; width: auto; }
  .lsvr-tool-grid { grid-template-columns: repeat(2, 1fr); }
}
