.legal-page {
  min-height: 100vh;
  padding: 42px 24px 72px;
  color: #2f261f;
  background:
    radial-gradient(circle at 50% 0, rgba(126, 77, 28, 0.22), transparent 45%),
    #050403;
}

.legal-page__shell {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.legal-page--document .legal-page__shell {
  width: min(1000px, 100%);
}

/* Scoped above legacy shared surfaces; other public pages keep their UI. */
#root .legal-page--document {
  padding: max(16px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  color: var(--app-text);
  background: transparent;
}

.legal-page__hero {
  padding: 32px 0;
}

.legal-page__hero h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 800;
  line-height: 1.5;
  text-wrap: balance;
}

.legal-page__hero p {
  max-width: 68ch;
  margin: 8px 0 0;
  color: #53627a;
  font-size: 0.94rem;
  line-height: 1.9;
}

#root .legal-page--document .legal-page__document {
  padding: 28px 32px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 28px rgba(42, 74, 119, 0.04);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#root .legal-page--document .legal-page__version {
  margin: 0 0 24px;
  color: #53627a;
  font-size: 0.8rem;
  line-height: 1.9;
}

.legal-page__document section + section {
  margin-top: 28px;
}

.legal-page__document h2 {
  margin: 0 0 10px;
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  line-height: 1.7;
}

#root .legal-page--document .legal-page__document li {
  color: #3d4c64;
  line-height: 2;
}

.legal-page__document ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-inline-start: 22px;
}

.legal-page__notice {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--app-border);
  color: #53627a;
  font-size: 0.85rem;
  line-height: 1.9;
}

.legal-page__acceptance {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 14px;
  border-radius: 10px;
  background: #1d1c1c;
  color: #fff;
}
.legal-page__acceptance p { margin: 0; }
.legal-page__acceptance label { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.legal-page__acceptance input { width: 20px; height: 20px; flex: none; }
.legal-page__acceptance button { min-height: 44px; padding: 6px 16px; border: 0; border-radius: 8px; font: inherit; background: #ffd400; color: #1d1c1c; }
.legal-page__acceptance button:disabled { opacity: .55; }

.legal-page__notice a,
.legal-page__back,
.legal-page__footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  color: inherit;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}

.legal-page__back {
  gap: 8px;
  margin-top: 12px;
  padding: 0 4px;
  color: #405573;
  font-size: 0.875rem;
  text-decoration: none;
}

.legal-page__back:hover,
.legal-page__footer a:hover {
  text-decoration: underline;
}

.legal-page__footer {
  width: min(1000px, 100%);
  margin: 20px auto 0;
  padding: 16px 20px;
  border-top: 1px solid var(--app-border);
  border-radius: 8px;
  color: #53627a;
  background: rgba(255, 255, 255, 0.9);
}

.legal-page__footer-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0 24px;
}

.legal-page__footer .legal-page__brand {
  color: var(--app-text);
  font-size: 1.1rem;
  font-weight: 800;
  text-decoration: none;
}

.legal-page__footer small {
  font-size: 0.75rem;
}

.legal-page__footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
}

.legal-page__footer-links a {
  font-size: 0.8rem;
  text-decoration: none;
}

.legal-page__footer-links a[aria-current='page'] {
  color: var(--app-text);
  font-weight: 700;
}

@media (max-width: 760px) {
  .legal-page {
    padding: 20px 12px 48px;
  }

  #root .legal-page--document {
    padding-inline: max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-left));
  }

  .legal-page__hero {
    padding: 24px 0;
  }

  #root .legal-page--document .legal-page__document {
    padding: 22px 18px;
  }

  .legal-page__footer-brand {
    gap: 0 12px;
  }

  .legal-page__footer-links {
    column-gap: 16px;
  }
}

.room-voice-panel {
  padding: 22px;
  border: 1px solid rgba(255, 211, 110, 0.22);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(18, 17, 15, 0.98), rgba(10, 10, 9, 0.97));
}

.room-voice-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.room-voice-panel header div { display: grid; gap: 4px; }
.room-voice-panel header span { color: #c99d42; font-size: 0.72rem; }
.room-voice-panel header strong { color: #fff2c8; font-size: 1.1rem; }

.room-voice-panel button {
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid rgba(66, 219, 135, 0.55);
  border-radius: 10px;
  color: #f3fff7;
  background: rgba(47, 143, 70, 0.72);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.room-voice-panel button:disabled { opacity: 0.48; cursor: default; }
.room-voice-panel__state { margin: 18px 0 0; color: rgba(245, 240, 230, 0.64); }

.room-voice-panel__controls {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px !important;
}

.room-voice-panel .room-voice-panel__secondary-button {
  border-color: rgba(255, 211, 110, 0.32);
  color: #f5dfb0;
  background: rgba(92, 60, 25, 0.42);
}

.room-voice-panel__participants {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.room-voice-participant {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2px 10px;
  padding: 10px;
  border: 1px solid rgba(255, 211, 110, 0.13);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.room-voice-participant[data-speaking='true'] { border-color: rgba(66, 219, 135, 0.8); }
.room-voice-participant .player-avatar { grid-row: 1 / 3; }
.room-voice-participant span { color: #fff2c8; font-weight: 800; }
.room-voice-participant small { color: rgba(245, 240, 230, 0.58); }

.room-voice-panel__media-state {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(66, 219, 135, 0.28);
  border-radius: 10px;
  color: #cff4d9;
  background: rgba(40, 117, 58, 0.18);
  font-size: 0.86rem;
}

.room-voice-panel__live-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #54dc88;
  box-shadow: 0 0 0 5px rgba(84, 220, 136, 0.12);
}

.room-voice-panel__peer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.room-voice-panel__peer-grid > div {
  display: grid;
  gap: 2px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 211, 110, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.room-voice-panel__peer-grid > div[data-status='connected'] {
  border-color: rgba(66, 219, 135, 0.42);
}

.room-voice-panel__peer-grid small,
.room-voice-panel__privacy-note {
  color: rgba(245, 240, 230, 0.55);
  font-size: 0.75rem;
}

.room-voice-panel__peer-grid audio {
  width: 1px;
  height: 1px;
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.room-voice-panel__privacy-note {
  margin: 13px 0 0;
  line-height: 1.75;
}

.room-voice-panel__error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(179, 58, 58, 0.48);
  border-radius: 10px;
  color: #ffd0d0;
  background: rgba(128, 31, 31, 0.1);
}

@media (max-width: 560px) {
  .room-voice-panel header { align-items: stretch; flex-direction: column; }
  .room-voice-panel button { width: 100%; }
  .room-voice-panel__controls { display: grid !important; }
}
#root .game-communication-dock__mic:disabled { background: #4b5563; border-color: #9ca3af; color: #e5e7eb; box-shadow: none; filter: grayscale(1); opacity: 1; cursor: not-allowed; }
#root .room-voice-panel__controls > button:disabled { background: #4b5563; border-color: #9ca3af; color: #e5e7eb; box-shadow: none; filter: grayscale(1); opacity: 1; }
.room-voice-archive-status { display:block; padding:5px 8px; border-radius:8px; background:#1D1C1C; color:#ff6e7e; font-size:.75rem; line-height:1.8; font-weight:800; }
.room-voice-panel--dock .room-voice-archive-status { flex-basis:100%; }

