/* PartyFM Chat – modern IRC-ish layout (ChatGPT-ish gray theme) */

/* ========= Theme variables ========= */
:root{
  /* Light (default) */
  --bg: #f7f7f8;
  --panel: #ffffff;
  --panel2: #ffffff;
  --panel3: #f3f4f6;

  --text: #111827;
  --muted: #6b7280;

  --border: #e5e7eb;
  --border2: #d1d5db;

  --accent: #10a37f;      /* subtle ChatGPT-ish green */
  --danger: #ef4444;

  --shadow: 0 10px 30px rgba(0,0,0,.08);

  --msgHover: rgba(0,0,0,.03);
  /* Mention highlight should be a soft gray (not green) */
  --mentionBg: rgba(0,0,0,.05);

  /* Name colors */
  --nameMale: #60a5fa;   /* light blue */
  --nameFemale: #f472b6; /* pink */
  --nameUnknown: var(--text);

  /* Announcements */
  --announceBg: rgba(0,0,0,.03);

  --chipBg: rgba(0,0,0,.04);
  --chipBorder: rgba(0,0,0,.08);

  --avatarBorder: rgba(0,0,0,.10);
}

@media (prefers-color-scheme: dark){
  :root{
    --bg: #0f0f10;
    --panel: #141415;
    --panel2: #121213;
    --panel3: #1a1a1b;

    --text: #e5e7eb;
    --muted: #9ca3af;

    --border: #2a2a2b;
    --border2: #3a3a3b;

    --shadow: 0 12px 30px rgba(0,0,0,.35);

    --msgHover: rgba(255,255,255,.04);
    --mentionBg: rgba(255,255,255,.07);

    --announceBg: rgba(255,255,255,.06);

    --chipBg: rgba(255,255,255,.06);
    --chipBorder: rgba(255,255,255,.10);

    --avatarBorder: rgba(255,255,255,.10);

    --announceBg: rgba(255,255,255,.06);
  }
}

/* Optional: later we can allow user-selected themes via body[data-theme="dark|light"] */
body[data-theme="light"]{
  color-scheme: light;
  --bg: #f7f7f8;
--panel: #ffffff;
--panel2: #ffffff;
--panel3: #f3f4f6;
--text: #111827;
--muted: #6b7280;
--border: #e5e7eb;
--border2: #d1d5db;
--accent: #10a37f;      /* subtle ChatGPT-ish green */
--danger: #ef4444;
--shadow: 0 10px 30px rgba(0,0,0,.08);
--msgHover: rgba(0,0,0,.03);
--mentionBg: rgba(0,0,0,.05);
--nameMale: #60a5fa;   /* light blue */
--nameFemale: #f472b6; /* pink */
--nameUnknown: var(--text);
--announceBg: rgba(0,0,0,.03);
--chipBg: rgba(0,0,0,.04);
--chipBorder: rgba(0,0,0,.08);
--avatarBorder: rgba(0,0,0,.10);
}
body[data-theme="dark"]{
  color-scheme: dark;
  --bg: #0f0f10;
--panel: #141415;
--panel2: #121213;
--panel3: #1a1a1b;
--text: #e5e7eb;
--muted: #9ca3af;
--border: #2a2a2b;
--border2: #3a3a3b;
--shadow: 0 12px 30px rgba(0,0,0,.35);
--msgHover: rgba(255,255,255,.04);
--mentionBg: rgba(255,255,255,.07);
--announceBg: rgba(255,255,255,.06);
--chipBg: rgba(255,255,255,.06);
--chipBorder: rgba(255,255,255,.10);
--avatarBorder: rgba(255,255,255,.10);
--announceBg: rgba(255,255,255,.06);
}

/* ========= Base ========= */
*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  overflow: hidden;
}

.hidden{ display:none !important; }

/* ========= Layout ========= */
.app{
  height: 100vh;
  display: flex;
  background: var(--bg);
  padding: 10px;
  gap: 10px;
}

.chatPane{
  flex: 1;
  min-width: 0;
  display:flex;
  flex-direction:column;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
}

/* Header is hidden by request */
.chatHeader{ display:none !important; }

.messages{
  flex:1;
  overflow:auto;
  padding: 10px 12px;
}

/* Floating "new messages" button (only shows when you're scrolled up) */
.newMsgsBtn{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 78px; /* above composer */
  z-index: 6500;
  border: 1px solid var(--border2);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.newMsgsBtn:hover{ background: var(--panel3); }
.newMsgsBtn:active{ transform: translateX(-50%) translateY(1px); }


/* ========= Messages ========= */
.msg{
  display:flex;
  align-items:center;          /* avatar vertically centered vs text */
  gap: 10px;
  padding: 6px 8px;
  margin: 0 0 4px 0;           /* tighter spacing */
  border-radius: 12px;
}

.msg:hover{ background: var(--msgHover); }

.msg.mentionMe{
  background: var(--mentionBg);
  border: 1px solid var(--border);
}

.msg.announce{
  display:block;
  padding: 0;
  margin: 12px 0;
}

.msg.announce .announceCenter{
  max-width: 720px;
  margin: 0 auto;
  text-align:center;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--announceBg);
  border: 1px solid var(--border);
}

.msg.announce .announceText{
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .2px;
  line-height: 1.35;
}

.msg.announce .announceTime{
  margin-top: 6px;
  font-size: 11px;
  opacity: .65;
}

.avatarCell{
  flex: 0 0 auto;
  display:flex;
  align-items:center;
}

.avatar,
.avatarImg{
  width: 34px;
  height: 34px;
  border-radius: 12px;
}

.avatar{
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  background: hsl(var(--h, 210) 60% 44%);
  border: 1px solid var(--avatarBorder);
  user-select:none;
}

.avatarImg{
  display:block;
  object-fit:cover;
  border: 1px solid var(--avatarBorder);
}

.msgBody{
  flex: 1;
  min-width: 0;
}

.ircLine{
  display:flex;
  align-items:baseline;
  gap: 10px;
  min-width:0;
}

.ircPrefix{
  flex: 0 0 auto;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.ts{ opacity:.95; }
.sep{ opacity:.75; }

.nameTag{
  font-weight: 700;
  color: var(--nameUnknown);
}

.nameTag.name-male{ color: var(--nameMale); }
.nameTag.name-female{ color: var(--nameFemale); }
.nameTag.name-unknown{ color: var(--nameUnknown); }

.meTag{
  margin-left: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.lockTag{
  margin-left: 6px;
  font-size: 12px;
  opacity: .9;
}

.msgText{
  flex: 1 1 auto;
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.actionLine .actionStar{
  color: var(--accent);
  font-weight: 900;
}

.mentionTag{
  display:inline-block;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--chipBg);
  border: 1px solid var(--chipBorder);
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
}

/* ========= Composer ========= */
.composer{
  position: relative;
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.composerInputWrap{
  position:relative;
  flex:1;
  min-width:0;
}

.msgInput{
  width:100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border2);
  background: var(--panel2);
  color: var(--text);
  outline: none;
}

.msgInput:focus{
  border-color: rgba(16,163,127,.55);
  box-shadow: 0 0 0 3px rgba(16,163,127,.12);
}

.btn{
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border2);
  background: var(--panel3);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  cursor:pointer;
}

.btn:hover{ filter: brightness(1.03); }
.btn:disabled{ opacity:.55; cursor:not-allowed; }

.btn.primary{
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.small{
  height: 34px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 10px;
}

/* icon buttons */
.iconBtn{
  width: 40px;
  padding: 0;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* Drawer buttons only on mobile */
.drawerBtn{ display:none; }
@media (max-width: 720px){
  .drawerBtn{ display:flex; }
}

/* ========= Emoji popup ========= */
.emojiPopup{
  position: fixed;
  width: 280px;
  max-height: 240px;
  overflow:auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 10px;
  z-index: 80;
}

.emojiPopup::-webkit-scrollbar{ width:0; height:0; }
.emojiPopup{ scrollbar-width: none; }

.emojiGrid{
  display:grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.emojiCell{
  width: 100%;
  height: 30px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  cursor:pointer;
  font-size: 18px;
}

.emojiCell:hover{
  background: var(--panel3);
  border-color: var(--border);
}

/* ========= Mention dropdown ========= */
.mentionBox{
  position:absolute;
  left:0;
  right:0;
  bottom: 46px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow:hidden;
  max-height: 210px;
}

.mentionItem{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 8px 10px;
  cursor:pointer;
}

.mentionItem:hover,
.mentionItem.active{
  background: var(--panel3);
}

/* ========= Side panel / drawer ========= */
.sidePane{
  width: 340px;
  height: 100%;
  max-width: 90vw;
  background: var(--panel);
  display:flex;
  flex-direction:column;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}

.sideTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--border);
}

.sideTopTitle{
  font-weight: 800;
  color: var(--muted);
  letter-spacing:.2px;
}

.panel{
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.panelTitle{
  font-weight: 800;
  margin-bottom: 8px;
}

.camRow{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  flex-wrap:wrap;
}

.myPreview{
  margin-top: 10px;
  border-radius: 16px;
  overflow:hidden;
  border: 1px solid var(--border);
  background: #000;
  position: relative;
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
}
.myPreview video{
  width:100%;
  display:block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
/* Hover overlay for hiding local preview */
.previewToggle{
  position:absolute;
  left:50%;
  top:50%;
  transform: translate(-50%, -50%);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: rgba(0,0,0,.55);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease;
}
.myPreview:hover .previewToggle{ opacity: 1; }
.previewHiddenHint{
  position:absolute;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 800;
  color: rgba(255,255,255,.92);
  background: rgba(0,0,0,.55);
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}

.camDetails summary{
  cursor:pointer;
  color: var(--muted);
  font-weight: 700;
}

.label{ display:block; font-size: 12px; color: var(--muted); margin: 10px 0 6px; }
.select{
  width:100%;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border2);
  background: var(--panel2);
  color: var(--text);
  padding: 0 10px;
}

.toolbarRow{
  display:flex;
  gap: 8px;
  flex-wrap:wrap;
  margin-bottom: 10px;
}

/* Users list should fill down to the radio player (no empty gap) */
#usersPanel{
  flex: 1;
  display:flex;
  flex-direction: column;
  min-height: 0;
}
.users{
  flex: 1;
  min-height: 0;
  overflow:auto;
  padding: 6px;
}


/* ========= Minimal radio player ========= */
.musicPanel{
  margin-top: 0; /* sits at the bottom as last flex item */
  border-top: 1px solid var(--border);
  border-bottom: none;
  padding: 8px 10px 10px;
}

.musicRow{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
}

.musicBtn{
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 16px;
  position: relative;
}

.musicInfo{
  flex: 1;
  min-width: 0;
  display:flex;
  flex-direction: column;
  line-height: 1.1;
}

.musicTitle{
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.musicSub{
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.musicMarquee{
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.musicMarquee .marqueeInner{
  display: inline-flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
  will-change: transform;
}

.musicMarquee .marqueeGap{ opacity: 0.55; }

.musicMarquee.marquee .marqueeInner{
  animation: musicMarquee 16s linear infinite;
}

@keyframes musicMarquee{
  0%{ transform: translateX(0); }
  100%{ transform: translateX(-50%); }
}

.musicPanel.playing .musicBtn::after{
  content:"";
  position:absolute;
  right: -2px;
  top: -2px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.25);
  animation: musicPulse 1.2s ease-in-out infinite;
}

@keyframes musicPulse{
  0%{ transform: scale(0.9); opacity: 0.6; }
  50%{ transform: scale(1.15); opacity: 1; }
  100%{ transform: scale(0.9); opacity: 0.6; }
}

.musicVol{
  width: 92px;
  accent-color: var(--accent);
}


.userGroup{ margin-bottom: 8px; }
.userGroupTitle{
  margin: 10px 8px 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}
.userGroupList{ display:flex; flex-direction:column; gap: 6px; }

.userRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel2);
  margin-bottom: 8px;
}

.userRow:hover{ background: var(--panel3); }

.userLeft{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width:0;
}

.userAvatar{ flex: 0 0 auto; }
.userAvatar .avatar,
.userAvatar .avatarImg{ width: 28px; height: 28px; border-radius: 10px; }

.userInfo{ min-width:0; }
.userNameLine{
  display:flex;
  align-items:center;
  gap: 8px;
  min-width:0;
  font-size: 13px;
}

.roleIcon{ width:16px; height:16px; display:inline-block; }

.userRight{
  display:flex;
  align-items:center;
  gap: 8px;
  flex: 0 0 auto;
}

.watchEye{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size: 14px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.45);
  user-select:none;
}

.watchEye.inactive{ opacity: .65; }
.watchEye.active{ color: var(--success); border-color: rgba(0,255,150,.35); background: rgba(0,255,150,.10); opacity: 1; }
.watchEye.clickable{ cursor: pointer; }
.watchEye.disabled{ opacity: .35; cursor: not-allowed; }

@keyframes eyePulse{
  0%{ transform: scale(1); }
  50%{ transform: scale(1.08); }
  100%{ transform: scale(1); }
}
.watchEye.active{ animation: eyePulse 1.4s ease-in-out infinite; }

.userRow.blocked{ opacity: .55; }
.userRow.blocked .userName{ text-decoration: line-through; }


/* ========= Drawer behavior on mobile ========= */
.drawerBackdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
  z-index: 9998;
}

@media (max-width: 720px){
  .sidePane{
    position: fixed;
    top: 0;
    bottom: 0;
    right: -100%;
    z-index: 9999;
    width: min(420px, 92vw);
    transition: right .18s ease;
    box-shadow: var(--shadow);
  }
  .sidePane.drawerOpen{ right: 0; }

  /* When drawer is open we still need content to scroll */
  .users{ max-height: none; height: 100%; }
}

/* ========= Floating webcam windows ========= */
.windows{
  position: fixed;
  inset: 0;
  pointer-events:none;
  z-index: 9000;
}

.win{
  position:absolute;
  width: 360px;
  height: 240px;
  background: #000;
  border-radius: 14px;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  pointer-events:auto;
  resize: both;         /* resize handles */
}

.winHeader{
  height: 34px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 0 10px;
  background: rgba(0,0,0,.55);
  color: #fff;
  user-select:none;
}

.winTitle{ font-weight: 800; font-size: 12px; opacity:.95; }
.winActions{ display:flex; gap: 6px; }

.xbtn{
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.10);
  color:#fff;
  border-radius: 10px;
  height: 26px;
  width: 34px;
  cursor:pointer;
}

.win video{
  width:100%;
  height: calc(100% - 34px);
  object-fit: cover;
  display:block;
  background:#000;
}

/* ========= Scrollbars (subtle) ========= */
.messages::-webkit-scrollbar,
.users::-webkit-scrollbar{
  width: 10px;
}
.messages::-webkit-scrollbar-thumb,
.users::-webkit-scrollbar-thumb{
  background: rgba(0,0,0,.15);
  border-radius: 999px;
}
@media (prefers-color-scheme: dark){
  .messages::-webkit-scrollbar-thumb,
  .users::-webkit-scrollbar-thumb{
    background: rgba(255,255,255,.12);
  }
}

/* ========= Settings popup ========= */
.settingsBtn{ margin-left: 2px; }

.settingsPopup{
  position: fixed;
  width: 760px;
  max-width: calc(100vw - 24px);
  max-height: min(80vh, 620px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px;
  z-index: 90;
}

.settingsHeader{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.settingsHeaderTitle{
  font-weight: 800;
  font-size: 14px;
}

.settingsGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 720px){
  .settingsGrid{ grid-template-columns: 1fr; }
}

.settingsSection{
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 12px;
  padding: 10px;
}

.settingsSectionTitle{
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .2px;
  margin-bottom: 10px;
  opacity: .95;
}

.settingsSectionWide{
  grid-column: 1 / -1;
}

.settingsRow{
  margin: 10px 0;
}

.settingsLabel{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 13px;
}

.settingsLabel input[type="checkbox"]{
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.settingsLabel input[type="range"]{
  width: 160px;
}

.settingsSelect{
  background: var(--panel3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
  color: var(--text);
}

.settingsActions{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.settingsHint{
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.settingsDivider{height:1px;background: var(--border);margin:12px 0;}
.settingsSelect:disabled{opacity:.55;cursor:not-allowed;}
/* VIP custom colors */
.settingsColorGrid{
  display:grid;
  grid-template-columns: 1fr auto;
  gap: 10px 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel3);
  margin: 6px 0 8px 0;
}
.settingsColorGrid.disabled{
  opacity: .55;
}
.settingsColorLabel{
  font-size: 13px;
  color: var(--muted);
  align-self: center;
}
.settingsColorInput{
  width: 48px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid var(--border2);
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.settingsColorInput:disabled{
  cursor: not-allowed;
  opacity: .65;
}

/* --- VIP custom colors (palette + hex, no OS popup picker) --- */
/* ========= VIP farver (løsning 3: én delt farvevælger) ========= */
.vipStudio{
  display:grid;
  grid-template-columns: 240px 1fr;
  gap: 12px;
  margin: 8px 0 2px 0;
}
@media (max-width: 720px){
  .vipStudio{ grid-template-columns: 1fr; }
}

.vipStudioList{
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.vipStudioItem{
  width: 100%;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel3);
  color: var(--text);
  cursor:pointer;
  user-select:none;
}
.vipStudioItem:hover{ filter: brightness(1.03); }
.vipStudioItem:disabled{ opacity:.45; cursor:not-allowed; }

.vipStudioItem.active{
  border-color: rgba(16,163,127,.55);
  box-shadow: 0 0 0 3px rgba(16,163,127,.10);
}

.vipStudioItemLabel{
  font-weight: 900;
  font-size: 12px;
  opacity: .95;
}

.vipStudioChip{
  width: 22px;
  height: 22px;
  border-radius: 9px;
  border: 1px solid var(--border2);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.10);
}

.vipStudioPicker{
  border: 1px solid var(--border);
  background: var(--panel3);
  border-radius: 14px;
  padding: 10px;
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.vipPickerTop{
  display:grid;
  grid-template-columns: 1fr 28px 140px auto;
  align-items:center;
  gap: 10px;
}

.vipPickerTitle{
  font-weight: 900;
  font-size: 13px;
}

.vipPickerPreview{
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid var(--border2);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.10);
}

.vipPickerHex{
  width: 140px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
  color: var(--text);
  font-weight: 900;
  font-size: 12px;
  font-family: ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.vipPickerSwatches{
  display:grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 6px;
}

@media (max-width: 720px){
  .vipPickerSwatches{ grid-template-columns: repeat(10, minmax(0, 1fr)); }
}

.vipPickerSwatch{
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 9px;
  border: 1px solid var(--border2);
  cursor:pointer;
  padding: 0;
}
.vipPickerSwatch.active{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.vipPickerSwatch:disabled{
  opacity:.45;
  cursor:not-allowed;
}

.vipPickerHint{
  font-size: 12px;
  color: var(--muted);
}

.vipStudio .vipColorActions{
  display:flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.vipColorGrid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 6px 0 2px 0;
}
@media (max-width: 720px){
  .vipColorGrid{ grid-template-columns: 1fr; }
}

.vipColorField{
  border: 1px solid var(--border);
  background: var(--panel3);
  border-radius: 14px;
  padding: 10px;
}

.vipColorTop{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.vipColorName{
  font-weight: 800;
  font-size: 12px;
  opacity: .95;
}

.vipColorPreview{
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid var(--border2);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.10);
}

.vipSwatchRow{
  display:flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.vipSwatch{
  width: 22px;
  height: 22px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  cursor: pointer;
  padding: 0;
}

.vipSwatch.active{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.vipSwatch:disabled{
  opacity: .45;
  cursor: not-allowed;
}

.vipHexRow{
  display:flex;
  align-items:center;
  gap: 8px;
}

.vipHexInput{
  flex: 1;
  min-width: 92px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
  color: var(--text);
  font-weight: 800;
  font-size: 12px;
  font-family: ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.vipHexInput:disabled{
  opacity: .6;
  cursor: not-allowed;
}

.vipColorActions{
  grid-column: 1 / -1;
  display:flex;
  justify-content: flex-end;
}

/* Hide system messages */
body.hideJoinLeaves .msg.announce.ann-joinleave{ display:none !important; }
body.hideWebcamMsgs .msg.announce.ann-webcam{ display:none !important; }

/* Compact mode */
body.compact .msg{
  padding: 5px 8px;
  margin-bottom: 2px;
}
body.compact .messages{ padding-bottom: 8px; }

/* Reduce motion */
body.reduceMotion *, body.reduceMotion *::before, body.reduceMotion *::after{
  transition: none !important;
  animation: none !important;
}


/* ========= Private Messages ========= */
.pmBar{
  padding: 6px 10px 8px;
  border-top: 1px solid var(--border);
  background: var(--panel2);
  display:flex;
  gap: 8px;
  overflow:auto;
  scrollbar-width: none;
}
.pmBar::-webkit-scrollbar{ display:none; }
.pmBar.hidden{ display:none; }

.pmTab{
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  cursor:pointer;
  white-space: nowrap;
}
.pmTab:hover{ background: var(--msgHover); }
.pmTab .pmBadge{
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  padding: 0 5px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size: 11px;
  font-weight: 900;
  background: var(--border);
  color: var(--text);
}
.pmTab.unread{
  animation: pmBlink 1.1s infinite;
}
@keyframes pmBlink{
  0%, 50% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
  51%, 100% { box-shadow: 0 0 0 2px rgba(255,255,255,0.08); }
}

.pmDock{
  position: absolute;
  right: 12px;
  bottom: 68px; /* above composer */
  display:flex;
  gap: 10px;
  align-items:flex-end;
  justify-content:flex-end;
  z-index: 7000;
  pointer-events:none;
}

.pmWin{
  width: 320px;
  max-height: 420px;
  display:flex;
  flex-direction:column;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 16px;
  overflow:hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  pointer-events:auto;
}
.pmWin.minimized .pmBody{ display:none; }
.pmWin.minimized{ width: 260px; }

.pmHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--panel2);
}
.pmHeaderLeft{
  display:flex;
  align-items:center;
  gap: 8px;
  min-width: 0;
}
.pmHeader .pmTitle{
  font-weight: 900;
  font-size: 13px;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pmHeaderActions{
  display:flex;
  gap: 6px;
}
.pmHeaderActions .btn{
  padding: 4px 8px;
}

.pmBody{
  display:flex;
  flex-direction:column;
  min-height: 0;
}
.pmMsgs{
  flex:1;
  overflow:auto;
  padding: 8px 10px;
  display:flex;
  flex-direction:column;
  gap: 6px;
}
.pmMsg{
  max-width: 90%;
  padding: 7px 9px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel2);
  font-size: 13px;
  line-height: 1.3;
  word-break: break-word;
}
.pmMsg.mine{
  margin-left:auto;
  background: var(--msgHover);
}
.pmComposer{
  display:flex;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: var(--panel2);
}
.pmComposer input{
  flex:1;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  color: var(--text);
}
.pmComposer input:focus{ outline: none; box-shadow: 0 0 0 2px rgba(255,255,255,0.08); }

.userRight .pmBtn{
  margin-left: 6px;
}

/* Mobile: PM windows become a drawer */
@media (max-width: 720px){
  .pmDock{
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 78px;
    justify-content:center;
  }
  .pmWin{
    width: 100%;
    max-height: 60vh;
  }
}

.pmTab .avatar, .pmTab .avatarImg{ width: 20px; height: 20px; border-radius: 8px; }
.pmHeader .avatar, .pmHeader .avatarImg{ width: 26px; height: 26px; border-radius: 10px; }


/* ===== Toast (warnings/OK) ===== */
.pfmToast{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 112px;
  z-index: 8000;
  max-width: min(560px, calc(100vw - 24px));
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border2);
  box-shadow: var(--shadow);
  font-weight: 900;
  font-size: 13px;
  user-select: none;
  text-align: center;
}
.pfmToast.warn{
  border-color: rgba(239,68,68,.55);
  background: rgba(239,68,68,.10);
}
.pfmToast.ok{
  border-color: rgba(16,163,127,.55);
  background: rgba(16,163,127,.10);
}


/* ===== VIP Themes (applied via body[data-vip-theme]) ===== */
body[data-vip-theme="emerald"]{ --accent: #10b981; }
body[data-vip-theme="purple"]{ --accent: #a855f7; }
body[data-vip-theme="rose"]{ --accent: #f43f5e; }
body[data-vip-theme="amber"]{ --accent: #f59e0b; }
body[data-vip-theme="ice"]{ --accent: #38bdf8; }
body[data-vip-theme="neon"]{ --accent: #22c55e; --mentionBg: rgba(34,197,94,.12); }


/* ===== Crew role switcher ===== */
.roleSwitchWrap{ display:flex; align-items:center; gap:8px; margin: 8px 0 10px; }
.roleSwitchLabel{ font-size:12px; opacity:.85; font-weight:900; }
.roleSwitchSelect{ height:32px; padding:6px 10px; border-radius: 12px; }

/* ===== LIVE tag (crew DJ) ===== */
.liveTag{ display:inline-flex; align-items:center; gap:6px; margin-left:8px; font-size:11px; font-weight:900; padding:2px 8px; border-radius:999px; border:1px solid rgba(34,197,94,.35); background: rgba(34,197,94,.10); }
.liveDot{ width:8px; height:8px; border-radius:50%; background: currentColor; animation: livePulse 1.2s infinite; }
@keyframes livePulse{ 0%{ transform: scale(0.8); opacity:.6;} 50%{ transform: scale(1.3); opacity:1;} 100%{ transform: scale(0.8); opacity:.6;} }


/* Camera preview toggle */
.previewToggle{
  position:absolute;
  left:50%;
  top:50%;
  transform: translate(-50%, -50%);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-weight: 800;
  cursor:pointer;
  opacity: 0;
  transition: opacity .15s ease;
}
.myPreview:hover .previewToggle{ opacity: 1; }

.previewHiddenHint{
  position:absolute;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  color: rgba(255,255,255,0.85);
  font-weight: 800;
  letter-spacing: 0.2px;
  background: linear-gradient(180deg, rgba(0,0,0,0.40), rgba(0,0,0,0.70));
  pointer-events:none;
}

.myPreview.collapsed{
  background: var(--panel2);
  border-color: var(--border);
  min-height: 44px;
}
.myPreview.collapsed video{
  display:none;
}

/* Camera settings */
.hintText{
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* Userlist fills remaining height down to player */
#usersPanel{
  flex: 1;
  display:flex;
  flex-direction:column;
  min-height: 0;
}
#users{
  flex: 1;
  overflow:auto;
  max-height: none;
}

/* Compact users list but keep style */
.users{
  padding: 4px;
}
.userRow{
  padding: 6px 9px;
  border-radius: 14px;
  margin-bottom: 6px;
  gap: 8px;
}


/* ===== Side stats (Online / Tilskuere) ===== */
.sideStats{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:8px 10px 6px;
  border-bottom:1px solid var(--border);
}

.sideStat{
  flex:1;
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:8px;
  padding:6px 8px;
  border-radius:12px;
  background:rgba(255,255,255,0.03);
}

.sideStatLabel{
  font-size:12px;
  opacity:0.8;
}

.sideStatValue{
  font-size:13px;
  font-weight:700;
}

.sideStatHover{
  position:relative;
  cursor:default;
}

.viewerTooltip{
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  min-width:220px;
  max-width:320px;
  padding:10px;
  border-radius:14px;
  background:rgba(20,20,24,0.96);
  border:1px solid var(--border);
  box-shadow:0 12px 30px rgba(0,0,0,0.35);
  z-index:9999;
}

.viewerTooltipTitle{
  font-size:12px;
  font-weight:700;
  opacity:0.9;
  margin-bottom:6px;
}

.viewerTooltipItem{
  font-size:13px;
  line-height:1.35;
  padding:4px 0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.viewerTooltipItem + .viewerTooltipItem{
  border-top:1px solid rgba(255,255,255,0.06);
}

