:root {
  --bg: #f4f8ff;
  --s1: #ffffff;
  --s2: #ecf5ff;
  --s3: #dfefff;
  --border: rgba(21, 61, 115, 0.12);
  --border2: rgba(21, 61, 115, 0.24);
  --acc: #1f7bff;
  --acc2: #27b0ff;
  --acc3: #22c788;
  --green: #159f68;
  --gold: #b47a17;
  --danger: #e95a58;
  --text: #152841;
  --text2: #4f6785;
  --muted: #7288a5;
  --canvas-idle-1: #e6f3ff;
  --canvas-idle-2: #c9e7ff;
  --r: 14px;
  --rsm: 10px;
  --tb: 54px;
  --bb: 66px;
  --panel: 300px;
  --fd: 'Syne', sans-serif;
  --fb: 'DM Sans', sans-serif;
}

html[data-theme='dark'] {
  --bg: #101826;
  --s1: #172336;
  --s2: #1c2c42;
  --s3: #22334d;
  --border: rgba(162, 195, 238, 0.16);
  --border2: rgba(162, 195, 238, 0.32);
  --acc: #73a9ff;
  --acc2: #59d3ff;
  --acc3: #4ce5a8;
  --green: #39cd8f;
  --gold: #f0be57;
  --danger: #ff8a86;
  --text: #eff4ff;
  --text2: #c6d3e8;
  --muted: #9eb1cc;
  --canvas-idle-1: #132238;
  --canvas-idle-2: #223653;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--fb);
}

body {
  transition: background 0.25s ease, color 0.25s ease;
}

button {
  cursor: pointer;
  border: none;
  font-family: var(--fb);
  background: none;
  color: inherit;
}

input {
  font-family: var(--fb);
  color: inherit;
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 4px;
}

a {
  color: var(--acc2);
}

.hidden {
  display: none !important;
}

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* Lobby */
#lobby {
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  padding: 28px 16px 48px;
}

.lb-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.lb-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.2;
}

.orb1 {
  width: 560px;
  height: 560px;
  background: var(--acc);
  top: -230px;
  left: -170px;
  animation: drift1 20s infinite alternate ease-in-out;
}

.orb2 {
  width: 420px;
  height: 420px;
  background: var(--acc2);
  bottom: -170px;
  right: -130px;
  animation: drift2 25s infinite alternate ease-in-out;
}

.orb3 {
  width: 320px;
  height: 320px;
  background: var(--acc3);
  top: 44%;
  left: 43%;
  animation: drift3 17s infinite alternate ease-in-out;
}

@keyframes drift1 {
  from { transform: translate(0, 0); }
  to { transform: translate(70px, 50px); }
}

@keyframes drift2 {
  from { transform: translate(0, 0); }
  to { transform: translate(-50px, -70px); }
}

@keyframes drift3 {
  from { transform: translate(0, 0); }
  to { transform: translate(35px, -35px); }
}

.lb-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 54px 54px;
  opacity: 0.45;
}

.lb-center {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

.lb-header {
  text-align: center;
  margin-bottom: 40px;
  animation: fadeUp 0.55s ease;
}

.lb-icon {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 6px;
}

.lb-title {
  font-family: var(--fd);
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -2px;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lb-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 8px;
}

.lb-cards {
  display: flex;
  gap: 18px;
  align-items: stretch;
  flex-wrap: wrap;
}

.lc {
  flex: 1;
  min-width: 260px;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 30px 24px;
  animation: fadeUp 0.6s ease;
  transition: border-color 0.2s ease, transform 0.2s ease;
  box-shadow: 0 10px 30px rgba(30, 86, 154, 0.08);
}

html[data-theme='dark'] .lc {
  box-shadow: 0 10px 30px rgba(5, 12, 25, 0.45);
}

.lc:hover {
  border-color: var(--border2);
  transform: translateY(-1px);
}

.lc-badge {
  display: inline-block;
  background: var(--s3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-family: var(--fd);
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.lc h2 {
  font-family: var(--fd);
  font-size: 1.26rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.lc > p {
  color: var(--text2);
  font-size: 0.83rem;
  margin-bottom: 20px;
  line-height: 1.55;
}

.lc-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  align-self: center;
}

.lc-sep span {
  width: 30px;
  height: 30px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.fg {
  margin-bottom: 13px;
}

.fg label {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 7px;
}

.fg input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--rsm);
  padding: 13px 15px;
  color: var(--text);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
}

.fg input:focus {
  border-color: var(--acc);
}

.fg input::placeholder {
  color: var(--muted);
}

.code-input {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
  font-family: var(--fd);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px;
  border-radius: var(--rsm);
  font-family: var(--fd);
  font-weight: 700;
  font-size: 0.9rem;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.2s ease, color 0.2s ease;
  margin-top: 4px;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: scale(0.98);
}

.btn.sm {
  padding: 8px 16px;
  width: auto;
  font-size: 0.8rem;
}

.bp {
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  color: #fff;
}

.bs {
  background: var(--s2);
  border: 1px solid var(--border2);
  color: var(--text);
}

.bd {
  background: color-mix(in oklab, var(--danger) 18%, transparent);
  border: 1px solid color-mix(in oklab, var(--danger) 46%, transparent);
  color: var(--danger);
}

.bd:hover {
  background: var(--danger);
  color: #fff;
  transform: none;
}

.lb-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 20px;
}

/* Room */
#room {
  height: 100dvh;
}

.room-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Topbar */
.topbar {
  height: var(--tb);
  background: var(--s1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  z-index: 50;
  flex-shrink: 0;
}

.tb-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.tb-brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.tb-brand-text {
  display: none;
}

.tb-center {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.room-chip {
  display: flex;
  align-items: center;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  max-width: 260px;
}

.rn-name {
  padding: 5px 11px;
  font-size: 0.8rem;
  font-family: var(--fd);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.rn-code {
  padding: 5px 11px;
  background: var(--s3);
  font-family: var(--fd);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--acc);
  border-left: 1px solid var(--border);
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.rn-code:hover {
  background: var(--acc);
  color: #fff;
}

.tb-right {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.tb-btn {
  height: 34px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  color: var(--text2);
}

.tb-btn:hover {
  background: var(--acc);
  border-color: var(--acc);
  color: #fff;
}

.tb-btn-text {
  padding: 0 11px;
  font-size: 0.75rem;
  font-family: var(--fd);
  font-weight: 700;
}

.mobile-only {
  display: none;
}

/* Stage */
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.stage-tabs {
  display: flex;
  background: var(--s1);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.stab {
  flex: 1;
  padding: 9px;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 0.79rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.stab.active {
  color: var(--acc);
  border-bottom-color: var(--acc);
}

.stage-panel {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.stage-panel.active {
  display: flex;
}

/* URL bar */
.url-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  background: var(--s2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.url-btn {
  width: 34px;
  height: 30px;
  background: var(--s3);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
  font-family: var(--fd);
  font-weight: 700;
}

.url-btn:hover {
  background: var(--acc);
  border-color: var(--acc);
  color: #fff;
}

.url-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  color: var(--text);
  font-size: 0.83rem;
  outline: none;
  transition: border-color 0.2s ease;
  min-width: 0;
}

.url-input:focus {
  border-color: var(--acc);
}

.url-go {
  padding: 7px 14px;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  color: #fff;
  border-radius: 8px;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 0.78rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.ctrl-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--s3);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.7rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.ctrl-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

.ctrl-dot.active {
  background: var(--green);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--green) 32%, transparent);
}

.ctrl-label {
  color: var(--text2);
  font-family: var(--fd);
  font-weight: 600;
}

.ctrl-btn {
  background: var(--s3) !important;
}

/* Browser viewport */
.browser-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--canvas-idle-1), var(--canvas-idle-2));
  cursor: default;
}

#browserCanvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
}

.bv-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
  background: color-mix(in oklab, var(--s1) 46%, transparent);
  backdrop-filter: blur(2px);
}

html[data-theme='dark'] .bv-placeholder {
  background: color-mix(in oklab, #000 28%, transparent);
}

.bvp-icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  color: #fff;
  font-family: var(--fd);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.05em;
}

.bvp-title {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 1.08rem;
}

.bvp-sub {
  font-size: 0.82rem;
  color: var(--text2);
}

.no-control-overlay {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: color-mix(in oklab, var(--s1) 92%, transparent);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

/* Movie mode floating exit */
.movie-exit {
  position: absolute;
  right: 14px;
  top: 14px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  background: rgba(9, 18, 31, 0.78);
  color: #fff;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 0.76rem;
  border: 1px solid rgba(255, 255, 255, 0.26);
  z-index: 20;
  backdrop-filter: blur(6px);
}

/* Remote cursors */
.remote-cursors {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.r-cursor {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  transition: left 0.05s, top 0.05s;
  pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.r-cursor-name {
  position: absolute;
  top: -18px;
  left: 6px;
  transform: rotate(45deg);
  font-size: 0.6rem;
  font-family: var(--fd);
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  background: inherit;
  padding: 1px 5px;
  border-radius: 8px;
}

/* Note */
.netflix-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: color-mix(in oklab, var(--acc2) 10%, transparent);
  border-top: 1px solid color-mix(in oklab, var(--acc2) 26%, transparent);
  font-size: 0.75rem;
  color: var(--text2);
  flex-shrink: 0;
}

.nn-pill {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--s3);
  border: 1px solid var(--border);
  font-family: var(--fd);
  font-size: 0.66rem;
  font-weight: 700;
}

.nn-tip {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

/* Cams grid */
.cams-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
  align-content: start;
}

.cam-tile {
  aspect-ratio: 4 / 3;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cam-tile.speaking {
  border-color: var(--green);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--green) 24%, transparent);
}

.cam-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cam-tile-info {
  position: absolute;
  bottom: 6px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.cam-tile-name {
  font-size: 0.7rem;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  font-family: var(--fd);
  font-weight: 700;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cam-tile-avatar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 2.5rem;
  position: absolute;
}

/* Mini strip */
.mini-strip {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  max-width: 240px;
}

.ms-tile {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  border: 2px solid var(--border);
  position: relative;
}

.ms-tile.speaking {
  border-color: var(--green);
}

.ms-muted {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 0.55rem;
  background: var(--bg);
  border-radius: 50%;
  padding: 1px;
}

/* Side panel */
.side-panel {
  width: var(--panel);
  background: var(--s1);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.sp-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sp-tab {
  flex: 1;
  padding: 11px 4px;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.sp-tab.active {
  color: var(--acc);
  border-bottom-color: var(--acc);
}

.tab-c {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.tab-c.active {
  display: flex;
}

/* Chat */
.chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.msg {
  display: flex;
  gap: 7px;
}

.msg-av {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 0.65rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.msg-body {
  flex: 1;
  min-width: 0;
}

.msg-head {
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.msg-host {
  color: var(--gold);
  font-size: 0.6rem;
}

.msg-time {
  margin-left: auto;
}

.msg-text {
  background: var(--s2);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 0.81rem;
  line-height: 1.45;
  word-break: break-word;
}

.msg-text.own {
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--acc) 16%, transparent),
    color-mix(in oklab, var(--acc2) 16%, transparent)
  );
  border: 1px solid color-mix(in oklab, var(--acc2) 26%, transparent);
}

.msg-sys {
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted);
  padding: 3px 0;
}

.chat-footer {
  padding: 9px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 7px;
}

.chat-in {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 0.83rem;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.chat-in:focus {
  border-color: var(--acc);
}

.chat-send {
  height: 36px;
  padding: 0 12px;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-family: var(--fd);
  font-weight: 700;
  color: #fff;
  transition: transform 0.15s ease;
}

.chat-send:hover {
  transform: scale(1.05);
}

/* People */
.people-list {
  flex: 1;
  overflow-y: auto;
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pi {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.pi-av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.pi-info {
  flex: 1;
  min-width: 0;
}

.pi-name {
  font-size: 0.83rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pi-role {
  font-size: 0.65rem;
  color: var(--gold);
  font-family: var(--fd);
  font-weight: 700;
}

.pi-icons {
  font-size: 0.75rem;
  opacity: 0.65;
  display: flex;
  gap: 3px;
}

/* Whiteboard */
#tc-whiteboard {
  overflow: hidden;
}

.wb-bar {
  padding: 7px 9px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.wb-tools,
.wb-cols,
.wb-szs {
  display: flex;
  gap: 3px;
}

.wbt {
  min-width: 46px;
  height: 28px;
  padding: 0 8px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.68rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  color: var(--text);
  font-family: var(--fd);
  font-weight: 700;
}

.wbt:hover {
  background: var(--s3);
}

.wbt.active {
  background: var(--acc);
  border-color: var(--acc);
  color: #fff;
}

.wbc {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid transparent;
  transition: transform 0.15s ease;
}

.wbc:hover {
  transform: scale(1.18);
}

.wbc.sel {
  border-color: #fff;
}

.wbs {
  padding: 2px 6px;
  height: 24px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.68rem;
  font-family: var(--fd);
  font-weight: 700;
  color: var(--muted);
}

.wbs.active {
  background: var(--acc2);
  border-color: var(--acc2);
  color: #fff;
}

.wb-clr {
  margin-left: auto;
  height: 28px;
  padding: 0 10px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.68rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fd);
  font-weight: 700;
}

.wb-clr:hover {
  background: color-mix(in oklab, var(--danger) 20%, transparent);
  border-color: color-mix(in oklab, var(--danger) 40%, transparent);
}

#wbCanvas {
  flex: 1;
  background: #fff;
  display: block;
  touch-action: none;
}

/* Controls panel */
.ctrl-panel {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ctrl-panel h3 {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 0.9rem;
}

.cp-desc {
  font-size: 0.78rem;
  color: var(--text2);
  line-height: 1.5;
}

.cp-section {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cp-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cp-radios {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cpr {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.83rem;
  transition: border-color 0.15s ease;
}

.cpr:hover {
  border-color: var(--border2);
}

.cpr input {
  accent-color: var(--acc);
  flex-shrink: 0;
}

.cp-users {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cpu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
}

.cpu-chk {
  accent-color: var(--acc);
}

.cp-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.cp-sm {
  font-size: 0.8rem;
  color: var(--text2);
}

/* Bottom bar */
.bottombar {
  height: var(--bb);
  background: var(--s1);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 8px;
  flex-shrink: 0;
}

.bb-left,
.bb-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

.bb-center {
  flex: 1;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.bbb {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.2s ease;
  position: relative;
  min-width: 62px;
}

.bbb:hover {
  background: var(--s3);
}

.bbb.off {
  opacity: 0.42;
}

.bbi {
  font-size: 0.64rem;
  font-family: var(--fd);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bbl {
  font-size: 0.66rem;
  color: var(--text2);
  white-space: nowrap;
}

.bb-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  background: var(--acc);
  color: #fff;
  font-size: 0.52rem;
  font-family: var(--fd);
  font-weight: 700;
  min-width: 13px;
  height: 13px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
}

.bb-leave {
  background: color-mix(in oklab, var(--danger) 18%, transparent);
  border: 1px solid color-mix(in oklab, var(--danger) 38%, transparent);
  color: var(--danger);
  padding: 8px 13px;
  border-radius: 9px;
  font-family: var(--fd);
  font-weight: 700;
  font-size: 0.78rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.bb-leave:hover {
  background: var(--danger);
  color: #fff;
}

/* Toast */
.toast-wrap {
  position: fixed;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 200;
  pointer-events: none;
  align-items: center;
}

.toast {
  background: var(--s2);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 0.8rem;
  white-space: nowrap;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
  }
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(13, 29, 51, 0.34);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
}

.modal-box {
  background: var(--s1);
  border: 1px solid var(--border2);
  border-radius: 18px;
  padding: 30px 26px;
  max-width: 420px;
  width: 100%;
  animation: fadeUp 0.3s ease;
}

.modal-mark {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 12px;
  color: var(--acc);
  font-family: var(--fd);
  font-weight: 800;
}

.modal-box h3 {
  font-family: var(--fd);
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.modal-box p {
  color: var(--text2);
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

/* Drawer backdrop */
.drawer-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 40;
  backdrop-filter: blur(2px);
}

/* Local cam preview */
.local-preview {
  position: fixed;
  bottom: 76px;
  right: 12px;
  width: 110px;
  height: 74px;
  border-radius: 9px;
  overflow: hidden;
  border: 2px solid var(--border2);
  z-index: 30;
  background: var(--s2);
  cursor: move;
}

.local-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Movie mode */
#room.movie-mode .topbar,
#room.movie-mode .side-panel,
#room.movie-mode .bottombar,
#room.movie-mode .stage-tabs,
#room.movie-mode .url-bar,
#room.movie-mode .netflix-note {
  display: none !important;
}

#room.movie-mode .room-body {
  height: 100%;
}

#room.movie-mode .stage {
  width: 100%;
}

#room.movie-mode .stage-panel {
  display: none;
}

#room.movie-mode #sp-browser {
  display: flex;
}

#room.movie-mode .browser-viewport {
  border-radius: 0;
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (min-width: 1024px) {
  .tb-brand-text {
    display: inline;
  }

  .topbar {
    padding: 0 20px;
  }
}

@media (max-width: 768px) {
  :root {
    --panel: 0px;
    --bb: 62px;
  }

  .side-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 290px;
    z-index: 45;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .side-panel.open {
    transform: translateX(0);
  }

  .mobile-only {
    display: flex !important;
  }

  .tb-btn.mobile-only {
    width: auto;
    padding: 0 10px;
    font-size: 0.72rem;
    font-family: var(--fd);
    font-weight: 700;
  }

  .tb-btn-text {
    padding: 0 8px;
    font-size: 0.66rem;
  }

  .bbl {
    display: none;
  }

  .bbb {
    padding: 9px;
    min-width: 42px;
  }

  .bbi {
    font-size: 0.62rem;
  }

  .lb-cards {
    flex-direction: column;
  }

  .lc-sep {
    width: auto;
    height: 22px;
    flex-direction: row;
  }

  .mini-strip {
    max-width: 160px;
  }

  .nn-tip {
    display: none;
  }

  .cams-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 480px) {
  :root {
    --tb: 48px;
    --bb: 58px;
  }

  #lobby {
    padding: 16px 12px 32px;
  }

  .lb-header {
    margin-bottom: 26px;
  }

  .lc {
    padding: 22px 18px;
  }

  .url-bar {
    padding: 5px 7px;
  }

  .ctrl-indicator {
    display: none;
  }

  .mini-strip {
    max-width: 100px;
  }

  .bbb {
    padding: 8px;
    min-width: 38px;
  }
}
