body.desktop {
  background: #008080;
  min-height: 100vh;
  font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
  font-size: 13px;
}

.status-msg { margin-top: 8px; min-height: 18px; }

.tab-btn { cursor: pointer; }
.tab-btn.active { font-weight: bold; box-shadow: inset 1px 1px 0 #fff; }

/* Room layout */
.room-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  grid-template-rows: 1fr;
  gap: 6px;
  height: 100vh;
  padding: 6px;
  box-sizing: border-box;
}

.room-layout > div {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.video-wrap {
  position: relative;
  background: #000;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-wrap video {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.pointer-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
}

/* Viewer list */
.viewer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px;
  border-bottom: 1px solid #ccc;
}
.viewer-item:last-child { border-bottom: none; }
.viewer-name { font-weight: bold; }
.viewer-badges span {
  background: #000080;
  color: #fff;
  font-size: 10px;
  padding: 1px 4px;
  margin-left: 2px;
}
.viewer-controls button {
  font-size: 11px;
  padding: 1px 4px;
  margin-left: 2px;
}

/* Pending list */
.pending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px;
  background: #ffffcc;
  margin-bottom: 4px;
}

/* Chat */
.chat-messages {
  /* NO fixed height — flex:1 + min-height:0 lets it fill and shrink properly */
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #fff;
  border: 1px inset #808080;
  padding: 4px;
  font-size: 12px;
  word-break: break-word;
}

.chat-msg { margin-bottom: 4px; border-bottom: 1px solid #eee; padding-bottom: 2px; }
.chat-msg.private { background: #fff0f0; }
.chat-from { font-weight: bold; color: #000080; }
.chat-time { color: #888; font-size: 10px; margin-left: 4px; }
.chat-private-label { color: #800000; font-size: 10px; }

.chat-input-row {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.chat-input-row input  { flex: 1; min-width: 0; display: block; }
.chat-input-row select { width: 80px; flex-shrink: 0; display: block; }
.chat-input-row button { flex-shrink: 0; display: block; }

/* Status bar */
.room-status {
  background: #c0c0c0;
  border-top: 1px solid #808080;
  padding: 2px 8px;
  font-size: 11px;
  display: flex;
  gap: 12px;
}
.room-status span { display: inline-block; }

/* Scrollable list */
.scroll-list {
  max-height: 160px;
  overflow-y: auto;
  border: 1px inset #808080;
  background: #fff;
}

/* Pointer cursor in SVG */
.pointer-cursor circle { opacity: 0.85; }
.pointer-cursor text { font-size: 11px; font-family: Arial, sans-serif; }

/* Info badge */
.badge-mod { background: #000080; color: #fff; font-size: 10px; padding: 1px 3px; }
.badge-ptr { background: #800000; color: #fff; font-size: 10px; padding: 1px 3px; }

/* Misc */
.window { overflow: visible; }
.no-share-msg { color: #888; text-align: center; padding: 20px; }

/* Fullscreen button — shown as overlay on top-right of video-wrap */
.fullscreen-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 20;
  padding: 3px 8px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  border-radius: 2px;
  transition: background 0.15s;
}
.fullscreen-btn:hover { background: rgba(0,0,0,0.85); }

/* Fullscreen: video fills screen, pointer overlay stays on top */
.video-wrap:fullscreen,
.video-wrap:-webkit-full-screen {
  background: #000;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-wrap:fullscreen video,
.video-wrap:-webkit-full-screen video {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
}

/* ICE error banner */
.ice-error {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(180,0,0,0.85);
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 20;
}

/* Responsive tweaks */
@media (max-width: 700px) {
  .room-layout {
    grid-template-columns: 1fr;
  }
}
