.w2g {
  --bg: #1f1f26; --panel: #181824; --panel2: #1d1c2b; --tile: #34343d;
  --purple: #8a2be2; --text: #e6e6ee; --muted: #a9a9b6; --red: #ff3b30;
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 .875rem/1.5 "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.w2g *, .w2g *::before, .w2g *::after { box-sizing: border-box; }
.w2g [hidden] { display: none !important; }

/* top bar */
.w2g-top {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .8rem 1.25rem; background: #15151f; border-bottom: 1px solid #2a2a38;
}
.w2g-back { color: #d7d7e2; text-decoration: none; font-size: .8rem; white-space: nowrap; }
.w2g-back:hover { color: #fff; }
.w2g-title { flex: 1; min-width: 0; }
.w2g-title h1 { margin: 0; font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w2g-title span { font-size: .75rem; color: var(--muted); }
.w2g-room { display: flex; align-items: center; gap: .6rem; }
.w2g-code {
  font: 600 .8rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em;
  padding: .5rem .7rem; border: 1px dashed #5b3fa8; border-radius: 4px; color: #cdb4f5;
}

/* buttons */
.w2g-btn {
  background: #3a3a45; color: #e6e6ee; border: 0; border-radius: 4px;
  padding: .5rem .95rem; font: 500 .78rem/1.1 inherit; font-family: inherit; cursor: pointer;
  transition: background-color .15s;
}
.w2g-btn:hover:not(:disabled) { background: #4a4a57; }
.w2g-btn.is-primary { background: var(--purple); color: #fff; }
.w2g-btn.is-primary:hover { background: #9a44ee; }
.w2g-btn:disabled { opacity: .4; cursor: not-allowed; }
.w2g :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* layout */
.w2g-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem;
  max-width: 1500px; margin: 1.25rem auto; padding: 0 1.25rem; align-items: start;
}
.w2g-stage { min-width: 0; }
.w2g-player { position: relative; background: #000; aspect-ratio: 16 / 9; max-height: min(620px, 72vh); width: 100%; }
.w2g-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.w2g-wait { position: absolute; inset: 0; display: grid; place-items: center; background: #000; color: var(--muted); }

.w2g-sync {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: #15151f; padding: .65rem .9rem; font-size: .78rem; color: #d9d9e3;
}
.w2g-controls {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 1rem;
  background: var(--panel2); padding: .7rem .9rem; margin-top: .5rem; border-radius: 4px;
}
.w2g-group { display: flex; align-items: center; gap: .5rem; }
.w2g-ep { display: inline-flex; align-items: center; gap: .5rem; font-size: .78rem; color: var(--muted); }
.w2g-ep input {
  width: 4.5rem; background: #0f0f18; border: 0; border-radius: 4px; color: #fff;
  padding: .5rem .6rem; font: 500 .8rem/1 inherit; font-family: inherit;
}
.w2g-servers { background: var(--panel2); margin-top: .5rem; padding: .8rem .9rem; border-radius: 4px; display: flex; flex-direction: column; gap: .6rem; }
.w2g-servers:empty { display: none; }
.w2g-srow { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.w2g-srow > span { min-width: 3rem; font-size: .75rem; font-weight: 700; color: #cfcfdb; }
.w2g-srv {
  background: #3a3a45; color: #e6e6ee; border: 0; border-radius: 4px;
  padding: .5rem 1rem; font: 500 .78rem/1 inherit; font-family: inherit; cursor: pointer;
}
.w2g-srv:disabled { cursor: default; }
.w2g-srv:hover:not(:disabled) { background: #4a4a57; }
.w2g-srv.is-active { background: var(--purple); color: #fff; }
.w2g-note { margin: .7rem 0 0; font-size: .75rem; color: var(--muted); }

/* side panel */
.w2g-side { background: var(--panel); border-radius: 4px; display: flex; flex-direction: column; height: min(620px, 72vh); overflow: hidden; }
.w2g-tabs { display: grid; grid-template-columns: 1fr 1fr; background: #15151f; }
.w2g-tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted);
  padding: .8rem; font: 600 .8rem/1 inherit; font-family: inherit; cursor: pointer;
}
.w2g-tabs button.is-active { color: #fff; border-bottom-color: var(--purple); }
.w2g-tabs b { margin-left: .3rem; font-weight: 600; color: #cdb4f5; }
.w2g-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.w2g-log { flex: 1; overflow-y: auto; padding: .9rem; display: flex; flex-direction: column; gap: .5rem; scrollbar-width: thin; scrollbar-color: #4a4a5e transparent; }
.w2g-msg { font-size: .8rem; word-break: break-word; }
.w2g-msg b { color: #cdb4f5; font-weight: 600; }
.w2g-msg.is-sys { color: var(--muted); font-size: .75rem; }
.w2g-msg.is-sys b { color: #b8b8c6; }
.w2g-compose { display: flex; gap: .5rem; padding: .7rem; background: #15151f; }
.w2g-compose input {
  flex: 1; min-width: 0; background: #0f0f18; border: 0; border-radius: 4px; color: #fff;
  padding: .65rem .75rem; font: 400 .8rem/1 inherit; font-family: inherit;
}
.w2g-compose input::placeholder { color: #8e8e9c; }
.w2g-people { list-style: none; margin: 0; padding: .6rem .9rem; flex: 1; overflow-y: auto; }
.w2g-people li { display: flex; align-items: center; justify-content: space-between; padding: .55rem 0; border-bottom: 1px solid #25253a; font-size: .82rem; }
.w2g-people i { font-style: normal; font-size: .68rem; font-weight: 600; background: var(--purple); color: #fff; border-radius: 999px; padding: .1rem .5rem; }

/* closed room */
.w2g-empty { max-width: 420px; margin: 18vh auto 0; padding: 0 1.25rem; text-align: center; }
.w2g-empty h1 { font-size: 1.3rem; margin: 0 0 .5rem; }
.w2g-empty p { color: var(--muted); margin: 0 0 1.2rem; }
.w2g-empty .w2g-btn { display: inline-block; text-decoration: none; }

@media (max-width: 960px) {
  .w2g-grid { grid-template-columns: 1fr; padding: 0; margin-top: 0; gap: .75rem; }
  .w2g-player { max-height: none; }
  .w2g-stage > :not(.w2g-player) { margin-left: .75rem; margin-right: .75rem; }
  .w2g-sync { margin: 0 !important; }
  .w2g-side { height: 440px; border-radius: 0; }
  .w2g-top { padding: .7rem .9rem; }
  .w2g-title { order: 3; flex-basis: 100%; }
  .w2g-room { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { .w2g * { transition: none !important; } }
