/* Voice Room v1 - lightweight Discord-style room */
.voice-room-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147482500;
  background:
    radial-gradient(circle at 15% 10%, rgba(168, 85, 255, .28), transparent 34%),
    radial-gradient(circle at 85% 18%, rgba(59, 130, 246, .18), transparent 32%),
    linear-gradient(145deg, rgba(7, 9, 20, .98), rgba(20, 13, 42, .98));
  color: #f7efff;
  display: none;
  overflow: hidden;
}

.voice-room-overlay.open { display: flex; }

.voice-room-shell {
  width: min(1220px, calc(100vw - 28px));
  height: min(780px, calc(100dvh - 28px));
  margin: auto;
  border: 1px solid rgba(221, 198, 255, .18);
  border-radius: 28px;
  background: rgba(12, 14, 31, .84);
  box-shadow: 0 26px 90px rgba(0, 0, 0, .56), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(22px);
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
}

.voice-room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.045);
}

.voice-room-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.voice-room-logo {
  width: 46px;
  height: 46px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(192, 132, 252, .95), rgba(99, 102, 241, .85));
  box-shadow: 0 12px 32px rgba(124, 58, 237, .40);
  font-size: 22px;
}

.voice-room-title strong {
  display: block;
  font-size: clamp(18px, 2.4vw, 24px);
  letter-spacing: -.02em;
}

.voice-room-title span {
  display: block;
  margin-top: 2px;
  color: rgba(245, 235, 255, .62);
  font-size: 13px;
}

.voice-room-close {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 15px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.voice-room-tabs {
  display: flex;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(9, 10, 24, .45);
}

.voice-tab {
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.74);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 850;
  cursor: pointer;
}

.voice-tab.active {
  color: #fff;
  border-color: rgba(196, 147, 255, .48);
  background: linear-gradient(135deg, rgba(168,85,247,.55), rgba(99,102,241,.34));
  box-shadow: 0 10px 26px rgba(124, 58, 237, .24);
}

.voice-room-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  padding: 14px;
}

.voice-room-main,
.voice-room-side {
  min-height: 0;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 24px;
  background: rgba(255,255,255,.055);
  overflow: hidden;
}

.voice-room-main {
  display: flex;
  flex-direction: column;
}

.voice-room-panel-head {
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}

.voice-room-panel-head strong { font-size: 15px; }
.voice-room-panel-head span { color: rgba(255,255,255,.58); font-size: 12px; }


.voice-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.voice-clear-chat-btn {
  border: 1px solid rgba(248, 113, 113, .45);
  background: rgba(127, 29, 29, .42);
  color: rgba(255,255,255,.92);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(127, 29, 29, .18);
}

.voice-clear-chat-btn:hover {
  background: rgba(185, 28, 28, .58);
}

.voice-clear-chat-btn:disabled {
  opacity: .65;
  cursor: wait;
}

.voice-room-chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

.voice-empty {
  margin: auto;
  text-align: center;
  color: rgba(255,255,255,.60);
  max-width: 340px;
  line-height: 1.5;
}

.voice-msg {
  display: flex;
  gap: 9px;
  align-items: flex-end;
  max-width: 88%;
}
.voice-msg.own {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.voice-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 950;
  color: #fff;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  border: 1px solid rgba(255,255,255,.20);
  box-shadow: 0 8px 22px rgba(0,0,0,.25);
}

.voice-bubble {
  border-radius: 18px;
  padding: 10px 12px;
  background: rgba(255,255,255,.085);
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 10px 24px rgba(0,0,0,.16);
}
.voice-msg.own .voice-bubble {
  background: linear-gradient(135deg, rgba(147, 51, 234, .72), rgba(79, 70, 229, .58));
  border-color: rgba(255,255,255,.17);
}

.voice-name {
  font-size: 12px;
  font-weight: 900;
  color: #e9d5ff;
  margin-bottom: 4px;
}
.voice-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.45;
}
.voice-time {
  margin-top: 5px;
  font-size: 11px;
  color: rgba(255,255,255,.54);
  text-align: right;
}

.voice-chat-link {
  color: #93c5fd;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.voice-chat-link:hover {
  color: #bfdbfe;
}

.voice-room-send {
  flex: 0 0 auto;
  padding: 11px;
  border-top: 1px solid rgba(255,255,255,.09);
  display: flex;
  gap: 9px;
  align-items: center;
  background: rgba(7, 9, 20, .45);
}
.voice-room-send input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #fff;
  padding: 0 14px;
  outline: none;
}
.voice-room-send button {
  height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 15px;
  color: #fff;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  font-weight: 900;
  cursor: pointer;
}
.voice-room-send .voice-image-soon {
  width: 44px;
  padding: 0;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.12);
}

.voice-room-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  overflow-y: auto;
}

.voice-card {
  border-radius: 21px;
  background: rgba(10, 12, 28, .62);
  border: 1px solid rgba(255,255,255,.10);
  padding: 13px;
}
.voice-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
}
.voice-card p {
  margin: 0 0 10px;
  color: rgba(255,255,255,.62);
  font-size: 12px;
  line-height: 1.45;
}

.voice-join-btn,
.voice-mute-btn,
.voice-leave-btn,
.voice-activity-toggle {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 15px;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  background: rgba(255,255,255,.08);
}
.voice-join-btn { background: linear-gradient(135deg, #a855f7, #6366f1); }
.voice-leave-btn { background: rgba(239, 68, 68, .16); color: #fecaca; }
.voice-mute-btn { margin-top: 8px; }
.voice-activity-toggle.on { background: rgba(34, 197, 94, .16); color: #bbf7d0; }

.voice-presence-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.voice-presence-actions .voice-join-btn { grid-column: 1 / -1; }

.voice-member-list { display: flex; flex-direction: column; gap: 9px; }
.voice-member {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.07);
}
.voice-member-info { min-width: 0; flex: 1; }
.voice-member-name { font-weight: 850; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-member-status { margin-top: 2px; font-size: 11px; color: rgba(255,255,255,.58); }
.voice-member-status.active { color: #86efac; }
.voice-member-status.idle { color: #fde68a; }
.voice-member-status.recent { color: #a7f3d0; }
.voice-member-status.offline { color: rgba(255,255,255,.48); }
.voice-member-status.hidden-status { color: #c4b5fd; }
.voice-member-status.voice-on { color: #93c5fd; }
.voice-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255,255,255,.30);
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
}
.voice-status-dot.active { background: #22c55e; }
.voice-status-dot.idle { background: #f59e0b; }
.voice-status-dot.voice { background: #60a5fa; }

.voice-room-voice-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}
.voice-big-voice-card {
  min-height: 100%;
  border-radius: 24px;
  border: 1px dashed rgba(196, 147, 255, .30);
  background: radial-gradient(circle at 50% 0%, rgba(168,85,247,.18), transparent 45%), rgba(255,255,255,.04);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}
.voice-big-voice-card h2 { margin: 0 0 8px; }
.voice-big-voice-card p { margin: 0 0 16px; color: rgba(255,255,255,.64); max-width: 560px; line-height: 1.55; }

.voice-toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 2147483005;
  background: rgba(20, 18, 34, .96);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: 0 14px 38px rgba(0,0,0,.35);
  display: none;
}
.voice-toast.show { display: block; }

@media (max-width: 860px) {
  .voice-room-shell {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .voice-room-head { padding: 12px; }
  .voice-room-logo { width: 40px; height: 40px; border-radius: 15px; }
  .voice-room-title span { display: none; }
  .voice-room-tabs { padding: 10px 12px; }
  .voice-tab { flex: 1; padding: 10px 8px; font-size: 13px; }
  .voice-room-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    padding: 10px;
    gap: 10px;
  }
  .voice-room-main { min-height: 0; }
  .voice-room-side {
    max-height: 38dvh;
    border-radius: 22px;
  }
  .voice-msg { max-width: 95%; }
  .voice-room-send { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}

@media (max-width: 520px) {
  .voice-room-chat { padding: 10px; }
  .voice-room-panel-head { padding: 11px; }
  .voice-room-send input { height: 42px; font-size: 14px; }
  .voice-room-send button { height: 42px; padding: 0 12px; }
  .voice-room-send .voice-image-soon { width: 42px; }
  .voice-card { padding: 11px; }
  .voice-member { padding: 7px; }
}

/* Voice Room v1.1 mobile/input optimization */
.voice-room-overlay {
  height: var(--voice-vh, 100dvh);
}

body.voice-room-open {
  overflow: hidden !important;
  touch-action: none;
}

.voice-room-open .voice-room-overlay,
.voice-room-open .voice-room-shell,
.voice-room-open .voice-room-chat,
.voice-room-open .voice-room-side {
  overscroll-behavior: contain;
}

.voice-room-send {
  position: relative;
  z-index: 3;
}

.voice-room-send input {
  font-size: 16px;
}

.voice-activity-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(520px, 100%);
  margin: 12px auto 16px;
  text-align: left;
}

.voice-empty.small {
  margin: 8px 0;
  font-size: 13px;
}

.voice-voice-card p,
.voice-activity-card p {
  margin-bottom: 10px;
}

@media (max-width: 860px) {
  .voice-room-overlay {
    align-items: stretch;
  }

  .voice-room-shell {
    height: var(--voice-vh, 100dvh);
    max-height: var(--voice-vh, 100dvh);
  }

  .voice-room-layout {
    grid-template-rows: minmax(0, 1fr) minmax(136px, 28dvh);
  }

  .voice-room-main {
    border-radius: 22px;
  }

  .voice-room-side {
    max-height: none;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px;
    overflow-y: auto;
  }

  .voice-activity-card {
    grid-column: 1 / -1;
  }

  .voice-card p {
    font-size: 11px;
  }

  .voice-room-send {
    gap: 8px;
    padding: 9px;
    padding-bottom: calc(9px + env(safe-area-inset-bottom));
  }

  .voice-room-send input {
    height: 46px;
    border-radius: 16px;
    padding: 0 13px;
  }

  .voice-room-send button[type="submit"] {
    min-width: 66px;
    height: 46px;
    border-radius: 16px;
  }
}

@media (max-width: 520px) {
  .voice-room-head {
    min-height: 58px;
  }

  .voice-room-tabs {
    gap: 8px;
  }

  .voice-tab {
    white-space: nowrap;
    font-size: 12px;
  }

  .voice-room-layout {
    padding: 8px;
    gap: 8px;
    grid-template-rows: minmax(0, 1fr) minmax(120px, 25dvh);
  }

  .voice-room-side {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .voice-activity-card {
    order: 0;
  }

  .voice-privacy-card {
    display: block;
    order: 1;
    padding: 10px;
  }

  .voice-privacy-card h3 {
    font-size: 13px;
    margin-bottom: 4px;
  }

  .voice-privacy-card p {
    font-size: 10.8px;
    line-height: 1.35;
    margin-bottom: 8px;
  }

  .voice-privacy-card .voice-activity-toggle {
    min-height: 36px;
    border-radius: 13px;
    font-size: 12px;
  }

  .voice-voice-card {
    display: none;
  }

  .voice-member-list {
    max-height: 118px;
    overflow-y: auto;
    padding-right: 2px;
  }

  .voice-member {
    min-height: 48px;
  }

  .voice-avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .voice-text {
    font-size: 13.5px;
  }

  .voice-room-send {
    background: rgba(7, 9, 20, .86);
    backdrop-filter: blur(12px);
  }
}

@media (max-height: 620px) and (max-width: 860px) {
  .voice-room-side {
    display: none;
  }
  .voice-room-layout {
    grid-template-rows: minmax(0, 1fr);
  }
}

/* Voice Room v1.2 Discord-like voice polish */
.voice-channel-member {
  border-color: rgba(96, 165, 250, .28);
  background: linear-gradient(135deg, rgba(96, 165, 250, .12), rgba(124, 58, 237, .08));
}
.voice-channel-member .voice-member-status {
  line-height: 1.35;
}
@media (max-width: 720px) {
  .voice-room-tabs .voice-tab {
    min-height: 42px;
  }
  .voice-big-voice-card h2 {
    font-size: 20px;
  }
}


/* Voice Room v1.3 typing bar + clean header patch */
.voice-room-panel-head #voiceMainSub,
#voiceMainSub:empty {
  display: none !important;
}

.voice-room-send {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
}

.voice-room-send input,
#voiceRoomInput {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  display: block !important;
}

.voice-room-send button[type="submit"] {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}

@media (max-width: 860px) {
  .voice-room-layout {
    min-height: 0 !important;
  }
  .voice-room-main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .voice-room-send {
    grid-template-columns: minmax(0, 1fr) 58px !important;
    gap: 8px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  .voice-room-send button[type="submit"] {
    min-width: 58px !important;
    padding: 0 10px !important;
  }
}

@media (max-width: 420px) {
  .voice-room-send {
    grid-template-columns: minmax(0, 1fr) 52px !important;
  }
  .voice-room-send button[type="submit"] {
    min-width: 52px !important;
    font-size: 13px !important;
  }
}

/* Voice Room v1.4 admin-controlled game activity + password join */
.voice-big-inner {
  width: min(640px, 100%);
  margin: 0 auto;
}
.voice-channel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  margin-bottom: 12px;
}
.voice-channel-top h2 { margin: 0 0 4px; }
.voice-clean-note {
  margin: 0 !important;
  font-size: 12px;
  color: rgba(255,255,255,.58) !important;
}
.voice-join-btn.compact {
  width: auto;
  min-width: 120px;
  padding: 0 16px;
}
.voice-recent-games {
  width: 100%;
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
  text-align: left;
}
.voice-recent-games h3 {
  margin: 0 0 2px;
  font-size: 14px;
  color: #ede9fe;
}
.voice-game-pill {
  border: 1px solid rgba(168, 85, 247, .25);
  background: linear-gradient(135deg, rgba(168,85,247,.12), rgba(99,102,241,.08));
  border-radius: 16px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.voice-game-pill span {
  font-weight: 850;
  font-size: 13px;
}
.voice-game-pill strong,
.voice-game-pill-status,
.voice-game-line {
  color: #c4b5fd;
  font-size: 11px;
  font-weight: 850;
}
.voice-game-line { margin-top: 2px; }
.voice-game-line-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  line-height: 1.25;
}
.voice-game-icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  box-shadow: 0 0 12px rgba(239, 68, 68, .25);
}
.voice-game-icon-fallback {
  display: inline-grid;
  place-items: center;
  background: rgba(168, 85, 247, .14);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: none;
}
.voice-game-pill-status .voice-game-line {
  margin-top: 0;
}
.voice-game-pill-status .voice-game-icon {
  width: 24px;
  height: 24px;
}
.voice-password-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: grid;
  place-items: center;
  background: rgba(3, 5, 16, .72);
  backdrop-filter: blur(10px);
  padding: 18px;
}
.voice-password-modal[hidden] { display: none !important; }
.voice-password-box {
  width: min(360px, 100%);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 24px;
  background: rgba(14, 16, 34, .96);
  box-shadow: 0 28px 80px rgba(0,0,0,.5);
  padding: 18px;
  color: #fff;
}
.voice-password-box h3 { margin: 0 0 6px; }
.voice-password-box p {
  margin: 0 0 14px;
  color: rgba(255,255,255,.64);
  font-size: 13px;
}
.voice-password-box input,
.voice-password-admin input,
.voice-admin-card select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  color: #fff;
  min-height: 42px;
  padding: 0 12px;
  outline: none;
}
.voice-admin-card select option { color: #111; }
.voice-password-actions,
.voice-admin-actions,
.voice-password-admin {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.voice-password-actions button,
.voice-admin-actions button,
.voice-password-admin button {
  min-height: 40px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}
.voice-password-actions button[type="submit"],
.voice-password-admin button,
.voice-admin-actions button:first-child {
  background: linear-gradient(135deg, #a855f7, #6366f1);
}
.voice-admin-card {
  margin-top: 14px;
  border: 1px solid rgba(250, 204, 21, .22);
  background: rgba(250, 204, 21, .06);
  border-radius: 20px;
  padding: 12px;
  text-align: left;
}
.voice-admin-card[hidden] { display: none !important; }
.voice-admin-card h3 { margin: 0 0 4px; font-size: 15px; }
.voice-admin-card p { margin: 0 0 10px; font-size: 12px; color: rgba(255,255,255,.62); }
.voice-admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.voice-admin-grid label {
  display: grid;
  gap: 5px;
  color: rgba(255,255,255,.64);
  font-size: 11px;
  font-weight: 850;
}
.voice-password-admin {
  grid-template-columns: minmax(0, 1fr) auto;
}
.voice-password-admin button { padding: 0 12px; }

@media (max-width: 620px) {
  .voice-channel-top {
    align-items: stretch;
    flex-direction: column;
  }
  .voice-join-btn.compact { width: 100%; }
  .voice-game-pill {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
  .voice-admin-grid,
  .voice-admin-actions,
  .voice-password-admin {
    grid-template-columns: 1fr;
  }
}

/* Voice Room v1.7 - admin-only testing profiles */
.voice-admin-test-card {
  margin-top: 12px;
  border: 1px solid rgba(34, 211, 238, .22);
  background: rgba(34, 211, 238, .06);
  border-radius: 18px;
  padding: 12px;
}
.voice-admin-test-card[hidden] { display: none !important; }
.voice-admin-test-card h3 { margin: 0 0 4px; font-size: 14px; }
.voice-admin-test-card p { margin: 0 0 10px; font-size: 12px; color: rgba(255,255,255,.62); }
.voice-admin-test-card input,
.voice-admin-test-card select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  color: #fff;
  min-height: 42px;
  padding: 0 12px;
  outline: none;
}
.voice-admin-test-card select option { color: #111; }
.voice-test-send-btn {
  width: 100%;
  margin-top: 10px;
  min-height: 40px;
  border: 1px solid rgba(34, 211, 238, .22);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(34,211,238,.75), rgba(99,102,241,.85));
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.voice-registered-games {
  margin: 10px 0 12px;
  padding: 10px;
  border: 1px solid rgba(168,85,247,.28);
  border-radius: 16px;
  background: rgba(168,85,247,.08);
}
.voice-registered-games strong {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: rgba(255,255,255,.78);
}
.voice-registered-games div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.voice-registered-games span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.09);
  color: rgba(255,255,255,.82);
  font-size: 11px;
}

/* Voice Room v1.11 - Discord-like mobile room panel */
.voice-panel-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.voice-mobile-activity-btn,
.voice-mobile-side-head,
.voice-mobile-panel-backdrop {
  display: none;
}
.voice-mobile-activity-btn {
  border: 1px solid rgba(196,147,255,.46);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(168,85,247,.92), rgba(99,102,241,.72));
  color: #fff;
  font-weight: 950;
  min-height: 36px;
  padding: 0 13px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(124,58,237,.32), inset 0 1px 0 rgba(255,255,255,.20);
  letter-spacing: -.01em;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  gap: 6px;
}
.voice-mobile-activity-btn:active {
  transform: scale(.97);
}
.voice-mobile-activity-icon {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 999px;
  background: rgba(255,255,255,.15);
  font-size: 12px;
}
body.voice-mobile-panel-open .voice-room-main {
  pointer-events: none;
}
body.voice-mobile-panel-open .voice-room-side,
body.voice-mobile-panel-open .voice-mobile-panel-backdrop {
  pointer-events: auto;
}

@media (max-width: 860px) {
  .voice-room-layout {
    display: block !important;
    padding: 8px !important;
    height: minmax(0, 1fr);
    position: relative;
  }
  .voice-room-main {
    height: 100% !important;
    min-height: 0 !important;
    border-radius: 22px !important;
  }
  .voice-room-chat,
  .voice-room-voice-panel {
    min-height: 0 !important;
  }
  .voice-mobile-activity-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .voice-room-panel-head {
    position: relative;
    z-index: 4;
  }
  .voice-room-panel-head #voiceRoomCount {
    font-size: 11px;
    color: rgba(255,255,255,.62);
    white-space: nowrap;
  }
  .voice-room-side {
    display: flex !important;
    position: fixed !important;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(84vw, 340px) !important;
    max-width: 340px !important;
    height: var(--voice-vh, 100dvh) !important;
    max-height: var(--voice-vh, 100dvh) !important;
    z-index: 2147482998;
    transform: translateX(105%);
    transition: transform .22s ease;
    border-radius: 24px 0 0 24px !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    border-right: 0 !important;
    background: rgba(12, 14, 31, .96) !important;
    backdrop-filter: blur(22px);
    padding: calc(12px + env(safe-area-inset-top)) 10px calc(12px + env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    box-shadow: -22px 0 60px rgba(0,0,0,.48);
  }
  .voice-room-side.open {
    transform: translateX(0);
  }
  .voice-mobile-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 4px 8px;
    color: #fff;
  }
  .voice-mobile-side-head strong {
    font-size: 15px;
  }
  .voice-mobile-side-head button {
    width: 36px;
    height: 36px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.08);
    color: #fff;
    font-size: 22px;
    line-height: 1;
  }
  .voice-mobile-panel-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2147482997;
    background: rgba(0,0,0,.42);
    border: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
  }
  .voice-mobile-panel-backdrop.open {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
  .voice-activity-card {
    order: 0 !important;
  }
  .voice-privacy-card {
    order: 1 !important;
    display: block !important;
  }
  .voice-voice-card {
    order: 2 !important;
    display: block !important;
  }
  .voice-member-list {
    max-height: none !important;
    overflow: visible !important;
  }
}

@media (max-width: 520px) {
  .voice-room-head {
    padding: 10px 11px !important;
  }
  .voice-room-tabs {
    padding: 9px 10px !important;
  }
  .voice-room-panel-head {
    padding: 10px !important;
  }
  .voice-panel-actions {
    gap: 6px;
  }
  .voice-mobile-activity-btn {
    min-height: 34px;
    padding: 0 11px;
    font-size: 12px;
  }
  .voice-room-panel-head #voiceRoomCount {
    display: none;
  }
  .voice-room-side {
    width: min(88vw, 330px) !important;
  }
}

@media (max-height: 620px) and (max-width: 860px) {
  .voice-room-side {
    display: flex !important;
  }
}

/* Voice Room v1.14 - smoother mobile activity drawer */
@media (max-width: 860px) {
  .voice-room-shell {
    width: 100vw !important;
    height: var(--voice-vh, 100dvh) !important;
    max-height: var(--voice-vh, 100dvh) !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
  .voice-room-side {
    will-change: transform;
    contain: layout paint;
  }
  .voice-mobile-panel-backdrop {
    touch-action: none;
  }
  .voice-room-side.open {
    transform: translate3d(0,0,0) !important;
  }
  .voice-room-side:not(.open) {
    transform: translate3d(105%,0,0) !important;
  }
}

/* Voice Room v1.15 - mobile activity button animation + softer drawer backdrop */
@keyframes voiceActivityGlowPulse {
  0%, 100% {
    box-shadow: 0 8px 22px rgba(124,58,237,.32), 0 0 0 0 rgba(168,85,247,.34), inset 0 1px 0 rgba(255,255,255,.24);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 12px 30px rgba(124,58,237,.50), 0 0 0 6px rgba(168,85,247,.08), inset 0 1px 0 rgba(255,255,255,.32);
    transform: translateY(-1px);
  }
}

@keyframes voiceActivityShine {
  0% { transform: translateX(-120%) skewX(-18deg); opacity: 0; }
  28% { opacity: .85; }
  55%, 100% { transform: translateX(150%) skewX(-18deg); opacity: 0; }
}

@keyframes voiceActivityIconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@media (max-width: 860px) {
  .voice-mobile-activity-btn {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid rgba(216,180,254,.72) !important;
    background:
      radial-gradient(circle at 18% 18%, rgba(255,255,255,.34), transparent 28%),
      linear-gradient(135deg, #a855f7 0%, #7c3aed 46%, #4f46e5 100%) !important;
    box-shadow: 0 8px 22px rgba(124,58,237,.36), inset 0 1px 0 rgba(255,255,255,.26) !important;
    animation: voiceActivityGlowPulse 2.4s ease-in-out infinite;
  }

  .voice-mobile-activity-btn::before {
    content: "";
    position: absolute;
    inset: -45% -35%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.34), transparent);
    transform: translateX(-120%) skewX(-18deg);
    animation: voiceActivityShine 3.4s ease-in-out infinite;
    z-index: -1;
  }

  .voice-mobile-activity-btn::after {
    content: "›";
    display: inline-grid;
    place-items: center;
    width: 17px;
    height: 17px;
    margin-left: 1px;
    border-radius: 999px;
    background: rgba(255,255,255,.16);
    color: rgba(255,255,255,.96);
    font-size: 16px;
    line-height: 1;
  }

  .voice-mobile-activity-btn:active {
    transform: scale(.96) translateY(1px) !important;
    animation-play-state: paused;
  }

  .voice-mobile-activity-icon {
    background: rgba(255,255,255,.20) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.24);
    animation: voiceActivityIconPulse 1.8s ease-in-out infinite;
  }

  .voice-mobile-panel-backdrop {
    background: rgba(10, 8, 28, .16) !important;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: opacity .16s ease, backdrop-filter .16s ease !important;
  }

  .voice-mobile-panel-backdrop.open {
    opacity: 1 !important;
  }

  .voice-room-side {
    box-shadow: -14px 0 42px rgba(0,0,0,.34), -1px 0 0 rgba(255,255,255,.08) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .voice-mobile-activity-btn,
  .voice-mobile-activity-btn::before,
  .voice-mobile-activity-icon {
    animation: none !important;
  }
}

/* Voice Room v1.16 - keep mobile activity drawer sharp, no blur */
@media (max-width: 860px) {
  .voice-mobile-panel-backdrop,
  .voice-mobile-panel-backdrop.open {
    background: rgba(10, 8, 28, .10) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transition: opacity .14s ease !important;
  }

  .voice-room-side,
  .voice-room-side.open {
    background: rgb(14, 15, 34) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    transform: translate3d(0,0,0);
  }

  .voice-room-side * {
    filter: none !important;
    text-shadow: none;
  }

  .voice-room-side:not(.open) {
    transform: translate3d(105%,0,0) !important;
  }
}

/* Voice Room v1.18 WhatsApp-style replies + delete menu */
.voice-room-chat,
.voice-bubble,
.voice-room-send {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.voice-msg {
  position: relative;
  cursor: pointer;
  animation: voiceMsgIn .18s ease-out;
}
@keyframes voiceMsgIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.voice-msg.reply-highlight .voice-bubble {
  outline: 2px solid rgba(216, 180, 254, .82);
  box-shadow: 0 0 0 6px rgba(168, 85, 247, .16), 0 12px 26px rgba(0,0,0,.22);
}

.voice-bubble {
  max-width: min(520px, 100%);
  border-radius: 18px 18px 18px 5px;
}
.voice-msg.own .voice-bubble {
  border-radius: 18px 18px 5px 18px;
}
.voice-msg.deleted .voice-bubble {
  opacity: .82;
}
.voice-deleted-text {
  font-style: italic;
  color: rgba(255,255,255,.64);
}

.voice-reply-chip {
  width: 100%;
  text-align: left;
  border: 0;
  border-left: 3px solid #d8b4fe;
  border-radius: 10px;
  padding: 7px 9px;
  margin: 0 0 7px;
  background: rgba(5, 7, 18, .32);
  color: #fff;
  cursor: pointer;
}
.voice-reply-chip span {
  display: block;
  color: #e9d5ff;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.1;
}
.voice-reply-chip em {
  display: block;
  margin-top: 2px;
  color: rgba(255,255,255,.68);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-room-send {
  display: flex !important;
  flex-direction: column;
  align-items: stretch !important;
  gap: 7px !important;
}
.voice-send-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  width: 100%;
}
.voice-send-row input {
  width: 100%;
}
.voice-reply-preview {
  width: 100%;
  box-sizing: border-box;
  border-left: 3px solid #c084fc;
  border-radius: 13px;
  padding: 8px 9px;
  background: rgba(168, 85, 247, .15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.voice-reply-preview[hidden] { display: none !important; }
.voice-reply-preview strong {
  display: block;
  font-size: 12px;
  color: #f3e8ff;
}
.voice-reply-preview span {
  display: block;
  margin-top: 2px;
  color: rgba(255,255,255,.72);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(520px, 66vw);
}
.voice-reply-preview button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.10);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.voice-message-menu {
  position: fixed;
  z-index: 2147483004;
  min-width: 160px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 17px;
  padding: 6px;
  background: rgba(15, 18, 38, .98);
  box-shadow: 0 18px 46px rgba(0,0,0,.44);
  backdrop-filter: blur(12px);
}
.voice-message-menu[hidden] { display: none !important; }
.voice-message-menu button {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  text-align: left;
  padding: 0 12px;
  font-weight: 850;
  cursor: pointer;
}
.voice-message-menu button:hover,
.voice-message-menu button:active {
  background: rgba(168, 85, 247, .18);
}
#voiceMenuDelete {
  color: #fecaca;
}

.voice-admin-deleted-view {
  margin-top: 7px;
  border-radius: 11px;
  background: rgba(239, 68, 68, .12);
  border: 1px solid rgba(248, 113, 113, .18);
  padding: 6px 8px;
  font-size: 12px;
}
.voice-admin-deleted-view summary {
  color: #fecaca;
  cursor: pointer;
  font-weight: 900;
}
.voice-admin-deleted-view div {
  margin-top: 5px;
  color: rgba(255,255,255,.82);
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 860px) {
  .voice-send-row {
    grid-template-columns: minmax(0, 1fr) 58px;
    gap: 8px;
  }
  .voice-reply-preview span {
    max-width: 68vw;
  }
  .voice-message-menu {
    min-width: 176px;
  }
}

@media (max-width: 420px) {
  .voice-send-row {
    grid-template-columns: minmax(0, 1fr) 52px;
  }
  .voice-bubble {
    max-width: 100%;
  }
  .voice-reply-preview span {
    max-width: 62vw;
  }
}

/* Voice Room v1.19 admin-only image/screenshot sharing */
.voice-send-row {
  grid-template-columns: auto minmax(0, 1fr) auto !important;
}
.voice-media-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 15px;
  border: 1px solid rgba(216, 180, 254, .34);
  background: linear-gradient(135deg, rgba(168,85,247,.35), rgba(79,70,229,.22));
  color: #fff;
  font-size: 22px;
  line-height: 1;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(124,58,237,.22), inset 0 1px 0 rgba(255,255,255,.14);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.voice-media-btn:hover,
.voice-media-btn:active {
  transform: translateY(-1px) scale(1.03);
  border-color: rgba(233, 213, 255, .65);
  box-shadow: 0 12px 28px rgba(124,58,237,.34), 0 0 0 4px rgba(168,85,247,.10);
}
.voice-media-btn[hidden] { display: none !important; }
.voice-image-message {
  display: block;
  width: min(320px, 68vw);
  max-width: 100%;
  padding: 0;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 15px;
  overflow: hidden;
  background: rgba(0,0,0,.18);
  cursor: pointer;
}
.voice-image-message img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}
.voice-image-meta {
  margin-top: 6px;
  color: rgba(255,255,255,.58);
  font-size: 11px;
  word-break: break-word;
}
.voice-msg.image .voice-bubble {
  padding-bottom: 8px;
}
.voice-image-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483005;
  background: rgba(2, 6, 23, .82);
  display: grid;
  place-items: center;
  padding: 16px;
}
.voice-image-preview-modal[hidden] { display: none !important; }
.voice-image-preview-box {
  width: min(920px, 96vw);
  max-height: 92vh;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 22px;
  background: rgb(12, 14, 30);
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
  overflow: hidden;
}
.voice-image-preview-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  color: #fff;
}
.voice-image-preview-head button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  background: rgba(255,255,255,.09);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}
.voice-image-preview-box img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 54px);
  margin: 0 auto;
  object-fit: contain;
  background: #050816;
}
@media (max-width: 860px) {
  .voice-media-btn { width: 42px; min-width: 42px; height: 42px; border-radius: 14px; }
  .voice-send-row { grid-template-columns: auto minmax(0, 1fr) 54px !important; }
  .voice-image-message { width: min(300px, 72vw); }
  .voice-image-message img { max-height: 220px; }
}

/* v1.19 correction: normal users keep simple input + send; admin gets media button column */
.voice-send-row {
  grid-template-columns: minmax(0, 1fr) auto !important;
}
.voice-room-send.media-enabled .voice-send-row {
  grid-template-columns: auto minmax(0, 1fr) auto !important;
}
@media (max-width: 860px) {
  .voice-send-row { grid-template-columns: minmax(0, 1fr) 54px !important; }
  .voice-room-send.media-enabled .voice-send-row { grid-template-columns: auto minmax(0, 1fr) 54px !important; }
}


/* Voice Room v1.20 - media input + PC/mobile layout cleanup
   Fixes native file input showing in the chat bar and makes the composer responsive. */
#voiceMediaInput,
.voice-room-send input[type="file"],
.voice-send-row input[type="file"] {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  left: -99999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.voice-room-shell {
  width: min(1080px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 36px));
}

.voice-room-layout {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 310px) !important;
  min-height: 0 !important;
}

.voice-room-main,
.voice-room-side {
  min-width: 0 !important;
}

.voice-room-chat {
  min-height: 240px;
  scrollbar-width: thin;
  scrollbar-color: rgba(168,85,247,.55) rgba(255,255,255,.06);
}

.voice-room-side {
  scrollbar-width: thin;
  scrollbar-color: rgba(168,85,247,.55) rgba(255,255,255,.06);
}

.voice-room-chat::-webkit-scrollbar,
.voice-room-side::-webkit-scrollbar { width: 8px; }
.voice-room-chat::-webkit-scrollbar-track,
.voice-room-side::-webkit-scrollbar-track { background: rgba(255,255,255,.06); border-radius: 999px; }
.voice-room-chat::-webkit-scrollbar-thumb,
.voice-room-side::-webkit-scrollbar-thumb { background: rgba(168,85,247,.55); border-radius: 999px; }

.voice-room-send {
  padding: 10px !important;
  background: linear-gradient(180deg, rgba(9,12,28,.94), rgba(7,9,22,.98)) !important;
  border-top: 1px solid rgba(216,180,254,.12) !important;
}

.voice-send-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 70px !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
}

.voice-room-send.media-enabled .voice-send-row {
  grid-template-columns: 46px minmax(0, 1fr) 70px !important;
}

#voiceRoomInput {
  height: 44px !important;
  min-height: 44px !important;
  width: 100% !important;
  min-width: 0 !important;
  display: block !important;
  border-radius: 999px !important;
  padding: 0 16px !important;
  background: rgba(255,255,255,.075) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04) !important;
}

#voiceRoomInput:focus {
  border-color: rgba(216,180,254,.55) !important;
  box-shadow: 0 0 0 3px rgba(168,85,247,.14), inset 0 1px 0 rgba(255,255,255,.05) !important;
}

.voice-room-send button[type="submit"] {
  height: 44px !important;
  min-width: 70px !important;
  border-radius: 999px !important;
  padding: 0 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.voice-media-btn {
  width: 46px !important;
  min-width: 46px !important;
  height: 44px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 18px !important;
  padding: 0 !important;
}
.voice-media-btn[hidden] { display: none !important; }

.voice-reply-preview {
  margin-bottom: 2px !important;
}

@media (min-width: 861px) {
  .voice-room-panel-head {
    min-height: 52px;
  }
  .voice-room-main {
    min-height: 500px;
  }
}

@media (max-width: 860px) {
  .voice-room-shell {
    width: min(390px, 100vw) !important;
    height: var(--voice-vh, 100dvh) !important;
    max-height: var(--voice-vh, 100dvh) !important;
    border-radius: 0 !important;
  }

  .voice-room-layout {
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(0, 1fr) !important;
  }

  .voice-room-main {
    min-height: 0 !important;
  }

  .voice-room-chat {
    min-height: 0 !important;
    padding: 12px 10px !important;
  }

  .voice-room-send {
    padding: 8px 9px calc(8px + env(safe-area-inset-bottom)) !important;
  }

  .voice-send-row {
    grid-template-columns: minmax(0, 1fr) 54px !important;
    gap: 8px !important;
  }

  .voice-room-send.media-enabled .voice-send-row {
    grid-template-columns: 44px minmax(0, 1fr) 54px !important;
  }

  .voice-media-btn {
    width: 44px !important;
    min-width: 44px !important;
    height: 42px !important;
    border-radius: 16px !important;
    font-size: 17px !important;
  }

  #voiceRoomInput {
    height: 42px !important;
    min-height: 42px !important;
    border-radius: 16px !important;
    padding: 0 12px !important;
    font-size: 14px !important;
  }

  .voice-room-send button[type="submit"] {
    min-width: 54px !important;
    width: 54px !important;
    height: 42px !important;
    border-radius: 16px !important;
    padding: 0 !important;
    font-size: 13px !important;
  }

  .voice-room-head h2 {
    max-width: 170px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .voice-room-panel-head {
    padding: 10px 11px !important;
  }

  .voice-panel-actions {
    gap: 7px !important;
  }
}

@media (max-width: 380px) {
  .voice-room-send.media-enabled .voice-send-row {
    grid-template-columns: 40px minmax(0, 1fr) 50px !important;
    gap: 7px !important;
  }
  .voice-media-btn {
    width: 40px !important;
    min-width: 40px !important;
  }
  .voice-room-send button[type="submit"] {
    width: 50px !important;
    min-width: 50px !important;
    font-size: 12px !important;
  }
  #voiceRoomInput { font-size: 13px !important; }
}

/* Voice Room v1.21 - DM integration and old floating chat removal */
.voice-room-tabs {
  gap: 10px;
  flex-wrap: wrap;
}
.voice-room-dm-panel {
  min-height: 0;
  height: 100%;
}
.voice-dm-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 12px;
  height: 100%;
  min-height: 0;
}
.voice-dm-list-card,
.voice-dm-chat-card {
  background: rgba(18, 19, 38, .82);
  border: 1px solid rgba(178, 132, 255, .18);
  border-radius: 18px;
  overflow: hidden;
  min-height: 0;
  box-shadow: 0 16px 44px rgba(0,0,0,.24);
}
.voice-dm-list-card {
  display: flex;
  flex-direction: column;
}
.voice-dm-head,
.voice-dm-chat-head {
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.voice-dm-head strong,
.voice-dm-chat-head strong {
  display: block;
  color: #fff;
  font-size: 15px;
}
.voice-dm-head span,
.voice-dm-chat-head span {
  display: block;
  color: rgba(236,226,255,.65);
  font-size: 12px;
  margin-top: 3px;
}
.voice-dm-list {
  padding: 10px;
  overflow: auto;
  display: grid;
  gap: 8px;
}
.voice-dm-user {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: #f8f1ff;
  border-radius: 14px;
  padding: 10px;
  cursor: pointer;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.voice-dm-user:hover,
.voice-dm-user.active {
  transform: translateY(-1px);
  border-color: rgba(168,85,247,.65);
  background: linear-gradient(135deg, rgba(124,58,237,.30), rgba(255,255,255,.06));
}
.voice-dm-user-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.voice-dm-user-text strong {
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voice-dm-user-text small {
  font-size: 11px;
  color: rgba(236,226,255,.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voice-dm-chat-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.voice-dm-messages {
  padding: 14px;
  overflow: auto;
  min-height: 0;
}
.voice-dm-msg {
  display: flex;
  margin: 8px 0;
}
.voice-dm-msg.own {
  justify-content: flex-end;
}
.voice-dm-bubble {
  max-width: min(72%, 560px);
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px 16px 16px 5px;
  padding: 9px 11px 7px;
}
.voice-dm-msg.own .voice-dm-bubble {
  background: linear-gradient(135deg, rgba(139,92,246,.88), rgba(109,40,217,.86));
  border-color: rgba(216,180,254,.32);
  border-radius: 16px 16px 5px 16px;
}
.voice-dm-send {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(7, 8, 18, .55);
}
.voice-dm-send input {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  color: #fff;
  padding: 12px 14px;
  outline: none;
}
.voice-dm-send button,
.voice-member-dm {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #a855f7, #6d5dfc);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(124,58,237,.25);
}
.voice-dm-send button {
  padding: 0 18px;
}
.voice-member-dm {
  padding: 6px 9px;
  font-size: 11px;
  margin-left: auto;
  margin-right: 6px;
  flex: 0 0 auto;
}
.voice-member-dm:active,
.voice-dm-send button:active,
.voice-dm-user:active {
  transform: scale(.97);
}

@media (max-width: 760px) {
  .voice-dm-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
  }
  .voice-dm-list-card {
    max-height: 165px;
  }
  .voice-dm-list {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    padding-bottom: 12px;
  }
  .voice-dm-user {
    min-width: 185px;
  }
  .voice-dm-bubble {
    max-width: 84%;
  }
  .voice-dm-send {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* Voice Room v1.22 - DM delete, profile popup, mobile DM polish, admin DM monitor */
.voice-profile-trigger {
  cursor: pointer;
}
button.voice-avatar.voice-profile-trigger,
button.voice-name.voice-profile-trigger {
  border: 0;
  font: inherit;
}
button.voice-avatar.voice-profile-trigger {
  color: #fff;
  flex: 0 0 auto;
}
button.voice-name.voice-profile-trigger {
  display: inline-block;
  background: transparent;
  color: #d8b4fe;
  padding: 0;
  margin: 0 0 4px;
  font-weight: 800;
  text-align: left;
}
.voice-profile-popup {
  position: fixed;
  inset: 0;
  z-index: 10030;
  display: grid;
  place-items: center;
  background: rgba(4, 5, 14, .58);
  padding: 18px;
}
.voice-profile-popup[hidden] { display: none !important; }
.voice-profile-card {
  width: min(320px, 92vw);
  position: relative;
  border: 1px solid rgba(190, 154, 255, .28);
  background: linear-gradient(180deg, rgba(25, 18, 45, .98), rgba(12, 13, 27, .98));
  box-shadow: 0 24px 70px rgba(0,0,0,.45), 0 0 36px rgba(124,58,237,.20);
  border-radius: 24px;
  padding: 22px;
  text-align: center;
  color: #fff;
}
.voice-profile-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: rgba(255,255,255,.08);
  color: #fff;
  border-radius: 999px;
  width: 30px;
  height: 30px;
  cursor: pointer;
}
.voice-profile-avatar {
  width: 72px;
  height: 72px;
  margin: 6px auto 12px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #a855f7, #6d5dfc);
  font-weight: 900;
  font-size: 26px;
  box-shadow: 0 18px 38px rgba(124,58,237,.32);
}
.voice-profile-card strong { display:block; font-size: 18px; margin-bottom: 4px; }
.voice-profile-card span { display:block; color: rgba(236,226,255,.68); font-size: 13px; margin-bottom: 16px; }
#voiceProfileMessageBtn {
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #a855f7, #6d5dfc);
  color: #fff;
  padding: 12px 16px;
  font-weight: 900;
  cursor: pointer;
}
#voiceProfileMessageBtn[hidden] { display:none !important; }
.voice-dm-back {
  display: none;
  border: 0;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  margin-right: 8px;
  background: rgba(255,255,255,.08);
  color: #fff;
  cursor: pointer;
}
.voice-dm-chat-head {
  display: flex;
  align-items: center;
  gap: 4px;
}
.voice-dm-privacy-note {
  padding: 8px 14px;
  font-size: 11px;
  color: rgba(236,226,255,.66);
  background: rgba(168,85,247,.08);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.voice-dm-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}
.voice-dm-delete {
  border: 0;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.88);
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10px;
  cursor: pointer;
}
.voice-dm-delete:hover { background: rgba(239,68,68,.30); }
.voice-admin-dm-monitor {
  margin-top: 12px;
  border-radius: 18px;
  border: 1px solid rgba(251, 191, 36, .22);
  background: rgba(33, 26, 10, .34);
  overflow: hidden;
}
.voice-admin-dm-monitor[hidden] { display: none !important; }
.voice-admin-dm-head {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.voice-admin-dm-head strong { display:block; color:#fff; font-size:14px; }
.voice-admin-dm-head span { display:block; color:rgba(255,255,255,.58); font-size:11px; margin-top:2px; }
.voice-admin-dm-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 210px;
}
.voice-admin-dm-threads,
.voice-admin-dm-messages {
  padding: 10px;
  overflow: auto;
  max-height: 320px;
}
.voice-admin-dm-threads { border-right: 1px solid rgba(255,255,255,.08); }
.voice-admin-dm-thread {
  width: 100%;
  display: grid;
  gap: 3px;
  text-align: left;
  margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.05);
  color: #fff;
  border-radius: 12px;
  padding: 9px;
  cursor: pointer;
}
.voice-admin-dm-thread.active,
.voice-admin-dm-thread:hover { border-color: rgba(251,191,36,.45); background: rgba(251,191,36,.10); }
.voice-admin-dm-thread strong { font-size: 12px; }
.voice-admin-dm-thread small { color: rgba(255,255,255,.58); white-space: nowrap; overflow:hidden; text-overflow:ellipsis; }
.voice-admin-dm-msg {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 8px 0;
}
.voice-admin-dm-msg strong { color: #fde68a; font-size: 11px; }
.voice-admin-dm-msg span { color: #fff; font-size: 13px; white-space: pre-wrap; }
.voice-admin-dm-msg small,
.voice-admin-dm-msg em { color: rgba(255,255,255,.56); font-size: 10px; }
.voice-admin-dm-msg.deleted span { opacity: .7; text-decoration: line-through; }

@media (max-width: 760px) {
  .voice-dm-shell {
    position: relative;
    display: block;
    height: 100%;
  }
  .voice-dm-list-card,
  .voice-dm-chat-card {
    height: 100%;
  }
  .voice-dm-list-card {
    max-height: none !important;
  }
  .voice-dm-list {
    display: grid !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    max-height: none !important;
  }
  .voice-dm-user {
    min-width: 0 !important;
  }
  .voice-dm-chat-card {
    display: none;
  }
  .voice-dm-shell.dm-chat-open .voice-dm-list-card {
    display: none;
  }
  .voice-dm-shell.dm-chat-open .voice-dm-chat-card {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }
  .voice-dm-back {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
  }
  .voice-dm-bubble { max-width: 88% !important; }
  .voice-admin-dm-grid { grid-template-columns: 1fr; }
  .voice-admin-dm-threads { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.08); max-height: 170px; }
  .voice-admin-dm-monitor { margin-top: 10px; }
}

/* Voice Room v1.23 - stronger activity privacy + password gate */
.voice-activity-notice {
  position: fixed;
  inset: 0;
  z-index: 2147483640;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 4, 18, .72);
}
.voice-activity-notice[hidden] { display: none !important; }
.voice-activity-notice-box {
  width: min(420px, 94vw);
  border-radius: 24px;
  border: 1px solid rgba(168, 85, 247, .36);
  background: linear-gradient(145deg, rgba(24, 16, 42, .98), rgba(12, 8, 24, .98));
  box-shadow: 0 30px 90px rgba(0,0,0,.62), 0 0 36px rgba(168,85,247,.28);
  padding: 18px;
  color: #fff;
}
.voice-activity-notice-box h3,
.voice-activity-pass-box h3 {
  margin: 0 0 8px;
}
.voice-activity-notice-box p {
  margin: 0 0 16px;
  color: rgba(255,255,255,.72);
  line-height: 1.5;
  font-size: 14px;
}
.voice-activity-pass-box .voice-pc-needed-note {
  border-color: rgba(34, 197, 94, .28);
  background: rgba(34, 197, 94, .08);
}
.voice-privacy-card p::after {
  content: " Hidden users will not appear in Room Activity or DM list.";
  color: rgba(216,180,254,.95);
}
.voice-dm-head span::after {
  content: " • Only Activity-ON users appear";
  color: rgba(216,180,254,.92);
}
@media (max-width: 720px) {
  .voice-activity-notice-box {
    border-radius: 20px;
    padding: 16px;
  }
}

/* Voice Room v1.24 custom profile + bubble styles */
.voice-style-purple { --voice-accent: #a855f7; --voice-accent-rgb: 168,85,247; }
.voice-style-blue { --voice-accent: #3b82f6; --voice-accent-rgb: 59,130,246; }
.voice-style-cyan { --voice-accent: #06b6d4; --voice-accent-rgb: 6,182,212; }
.voice-style-emerald { --voice-accent: #10b981; --voice-accent-rgb: 16,185,129; }
.voice-style-red { --voice-accent: #ef4444; --voice-accent-rgb: 239,68,68; }

.voice-msg .voice-avatar,
.voice-member .voice-avatar,
.voice-dm-user .voice-avatar,
.voice-profile-avatar {
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.22), transparent 32%), linear-gradient(135deg, var(--voice-accent, #a855f7), rgba(var(--voice-accent-rgb, 168,85,247), .55));
  border-color: rgba(var(--voice-accent-rgb, 168,85,247), .62);
  box-shadow: 0 0 0 2px rgba(var(--voice-accent-rgb,168,85,247), .18), 0 10px 24px rgba(var(--voice-accent-rgb,168,85,247), .18), 0 8px 22px rgba(0,0,0,.25);
}

.voice-msg.no-glow .voice-avatar,
.voice-member.no-glow .voice-avatar,
.voice-dm-user.no-glow .voice-avatar,
.voice-profile-avatar.no-glow {
  box-shadow: 0 8px 18px rgba(0,0,0,.24);
}

.voice-msg .voice-bubble,
.voice-dm-msg .voice-dm-bubble {
  border-color: rgba(var(--voice-accent-rgb,168,85,247), .34);
  box-shadow: inset 3px 0 0 rgba(var(--voice-accent-rgb,168,85,247), .85), 0 12px 26px rgba(0,0,0,.18), 0 0 18px rgba(var(--voice-accent-rgb,168,85,247), .08);
}

.voice-msg.own .voice-bubble,
.voice-dm-msg.own .voice-dm-bubble {
  background: linear-gradient(135deg, rgba(var(--voice-accent-rgb,168,85,247), .55), rgba(28, 18, 49, .88));
  border-color: rgba(var(--voice-accent-rgb,168,85,247), .55);
  box-shadow: inset -3px 0 0 rgba(var(--voice-accent-rgb,168,85,247), .96), 0 14px 28px rgba(0,0,0,.22), 0 0 22px rgba(var(--voice-accent-rgb,168,85,247), .16);
}

.voice-msg.no-glow .voice-bubble,
.voice-dm-msg.no-glow .voice-dm-bubble {
  box-shadow: inset 3px 0 0 rgba(var(--voice-accent-rgb,168,85,247), .75), 0 10px 20px rgba(0,0,0,.15);
}
.voice-msg.no-glow.own .voice-bubble,
.voice-dm-msg.no-glow.own .voice-dm-bubble {
  box-shadow: inset -3px 0 0 rgba(var(--voice-accent-rgb,168,85,247), .85), 0 10px 20px rgba(0,0,0,.15);
}

.voice-name,
.voice-member-name,
.voice-dm-user-text strong {
  color: color-mix(in srgb, var(--voice-accent, #a855f7) 76%, white 24%);
}

.voice-profile-style-card p {
  margin: 5px 0 10px;
  color: rgba(236,226,255,.68);
  font-size: 12px;
  line-height: 1.45;
}
.voice-style-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}
.voice-color-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
  background: linear-gradient(135deg, var(--voice-accent), rgba(var(--voice-accent-rgb), .45));
  box-shadow: 0 0 0 2px rgba(var(--voice-accent-rgb), .10), 0 8px 18px rgba(var(--voice-accent-rgb), .16);
  cursor: pointer;
  position: relative;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.voice-color-dot:hover,
.voice-color-dot.selected {
  transform: translateY(-2px) scale(1.05);
  border-color: rgba(255,255,255,.65);
  box-shadow: 0 0 0 3px rgba(var(--voice-accent-rgb), .22), 0 12px 26px rgba(var(--voice-accent-rgb), .28);
}
.voice-color-dot.selected::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 1000;
  text-shadow: 0 1px 5px rgba(0,0,0,.55);
}
.voice-color-dot.locked {
  opacity: .55;
}
.voice-color-dot.locked span {
  position: absolute;
  right: -4px;
  bottom: -6px;
  font-size: 12px;
}
.voice-glow-toggle {
  width: 100%;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 13px;
  padding: 9px 10px;
  background: rgba(255,255,255,.07);
  color: white;
  font-weight: 900;
  cursor: pointer;
}
.voice-glow-toggle.on {
  border-color: rgba(168,85,247,.45);
  background: linear-gradient(135deg, rgba(168,85,247,.22), rgba(59,130,246,.12));
}


/* VOICE ROOM V1.25 — Settings moved into Profile */
.voice-profile-settings-shortcut p{margin:5px 0 12px;color:rgba(236,226,255,.68);font-size:12px;line-height:1.45;}
.voice-open-profile-settings{width:100%;border:1px solid rgba(168,85,247,.42);border-radius:14px;padding:10px 12px;background:linear-gradient(135deg,rgba(168,85,247,.26),rgba(59,130,246,.16));color:white;font-weight:950;cursor:pointer;box-shadow:0 0 22px rgba(168,85,247,.20),inset 0 1px 0 rgba(255,255,255,.12);}
.voice-open-profile-settings:hover{transform:translateY(-1px);}


/* VOICE ROOM V1.26 — clearly visible profile color picker */
.voice-style-colors {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 9px !important;
  margin: 10px 0 12px !important;
}
.voice-color-dot.voice-color-choice {
  width: auto !important;
  height: 44px !important;
  min-height: 44px !important;
  border-radius: 14px !important;
  padding: 7px 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 9px !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  text-align: left !important;
  background: linear-gradient(135deg, rgba(var(--voice-accent-rgb,168,85,247), .42), rgba(var(--voice-accent-rgb,168,85,247), .12) 58%, rgba(10, 8, 22, .86)) !important;
  border: 1px solid rgba(var(--voice-accent-rgb,168,85,247), .58) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 8px 18px rgba(var(--voice-accent-rgb,168,85,247), .14) !important;
}
.voice-color-dot.voice-color-choice .voice-color-sample {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  border-radius: 999px !important;
  display: inline-block !important;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.62), transparent 22%), linear-gradient(135deg, var(--voice-accent, #a855f7), rgba(var(--voice-accent-rgb,168,85,247), .58)) !important;
  border: 1px solid rgba(255,255,255,.45) !important;
  box-shadow: 0 0 0 3px rgba(var(--voice-accent-rgb,168,85,247), .18), 0 0 18px rgba(var(--voice-accent-rgb,168,85,247), .30) !important;
}
.voice-color-dot.voice-color-choice b {
  display: inline-block !important;
  color: #fff !important;
  text-shadow: 0 1px 6px rgba(0,0,0,.45) !important;
}
.voice-color-dot.voice-color-choice em {
  margin-left: auto !important;
  font-style: normal !important;
  font-size: 12px !important;
}
.voice-color-dot.voice-color-choice.selected {
  transform: translateY(-1px) !important;
  border-color: rgba(255,255,255,.85) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 0 2px rgba(var(--voice-accent-rgb,168,85,247), .32), 0 12px 26px rgba(var(--voice-accent-rgb,168,85,247), .28) !important;
}
.voice-color-dot.voice-color-choice.selected::after {
  content: "✓" !important;
  position: static !important;
  width: 22px !important;
  height: 22px !important;
  margin-left: auto !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.18) !important;
  border: 1px solid rgba(255,255,255,.35) !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 1000 !important;
}
.voice-color-dot.voice-color-choice.locked {
  opacity: .72 !important;
  filter: grayscale(.15) !important;
}
.study-theme-preview {
  border: 1px solid rgba(var(--voice-accent-rgb,168,85,247), .74) !important;
  box-shadow: inset 4px 0 0 rgba(var(--voice-accent-rgb,168,85,247), .95), 0 0 22px rgba(var(--voice-accent-rgb,168,85,247), .18) !important;
  background: linear-gradient(135deg, rgba(var(--voice-accent-rgb,168,85,247), .18), rgba(8, 7, 22, .92)) !important;
}
@media (max-width: 420px) {
  .voice-style-colors { grid-template-columns: 1fr !important; }
}

/* Voice Room v1.28 deep animated red premium style */
.voice-style-red {
  --voice-accent: #ff1f3d;
  --voice-accent-rgb: 255,31,61;
  --voice-accent-deep: #7f0617;
}

@keyframes voiceRedEdgeSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes voiceRedPulseGlow {
  0%, 100% {
    box-shadow:
      inset 3px 0 0 rgba(255,31,61,.98),
      0 14px 32px rgba(0,0,0,.25),
      0 0 18px rgba(255,31,61,.32),
      0 0 34px rgba(127,6,23,.18);
  }
  50% {
    box-shadow:
      inset 3px 0 0 rgba(255,83,112,1),
      0 16px 38px rgba(0,0,0,.28),
      0 0 30px rgba(255,31,61,.55),
      0 0 54px rgba(127,6,23,.32);
  }
}

.voice-style-red .voice-avatar,
.voice-profile-avatar.voice-style-red,
.voice-style-red.voice-profile-avatar {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.26), transparent 30%),
    linear-gradient(135deg, #ff2948, #8b0618 58%, #21020a);
  border-color: rgba(255,74,104,.72) !important;
  box-shadow:
    0 0 0 2px rgba(255,31,61,.22),
    0 0 24px rgba(255,31,61,.48),
    0 0 48px rgba(127,6,23,.28),
    0 10px 26px rgba(0,0,0,.34) !important;
}
.voice-style-red .voice-avatar::before,
.voice-profile-avatar.voice-style-red::before,
.voice-style-red.voice-profile-avatar::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  padding: 2px;
  background: conic-gradient(from 0deg, transparent 0 18%, #ffedf0 26%, #ff1f3d 36%, #7f0617 52%, transparent 66% 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: voiceRedEdgeSpin 2.6s linear infinite;
  pointer-events: none;
  z-index: 2;
}
.voice-style-red.no-glow .voice-avatar::before,
.voice-profile-avatar.voice-style-red.no-glow::before,
.voice-style-red.voice-profile-avatar.no-glow::before {
  animation: none;
  opacity: .35;
}

.voice-style-red .voice-bubble,
.voice-style-red .voice-dm-bubble,
.study-theme-preview.voice-style-red {
  position: relative !important;
  isolation: isolate;
  overflow: hidden;
  border-color: rgba(255,31,61,.78) !important;
  background:
    linear-gradient(135deg, rgba(255,31,61,.22), rgba(18,4,12,.94) 54%, rgba(8,7,20,.96)) !important;
  box-shadow:
    inset 3px 0 0 rgba(255,31,61,.98),
    0 14px 32px rgba(0,0,0,.25),
    0 0 22px rgba(255,31,61,.38),
    0 0 45px rgba(127,6,23,.20) !important;
  animation: voiceRedPulseGlow 2.8s ease-in-out infinite;
}
.voice-style-red.own .voice-bubble,
.voice-dm-msg.voice-style-red.own .voice-dm-bubble {
  background:
    linear-gradient(135deg, rgba(255,31,61,.70), rgba(127,6,23,.62) 58%, rgba(19,4,12,.92)) !important;
  box-shadow:
    inset -3px 0 0 rgba(255,215,222,.86),
    0 14px 32px rgba(0,0,0,.28),
    0 0 26px rgba(255,31,61,.45),
    0 0 54px rgba(127,6,23,.27) !important;
}
.voice-style-red .voice-bubble::after,
.voice-style-red .voice-dm-bubble::after,
.study-theme-preview.voice-style-red::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(from 0deg, transparent 0 12%, #ffeff2 22%, #ff1f3d 35%, #7f0617 52%, transparent 66% 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: voiceRedEdgeSpin 2.6s linear infinite;
  pointer-events: none;
  z-index: 3;
}
.voice-style-red.no-glow .voice-bubble,
.voice-style-red.no-glow .voice-dm-bubble {
  animation: none;
  box-shadow: inset 3px 0 0 rgba(255,31,61,.88), 0 10px 22px rgba(0,0,0,.18) !important;
}
.voice-style-red.no-glow .voice-bubble::after,
.voice-style-red.no-glow .voice-dm-bubble::after,
.study-theme-preview.voice-style-red.no-glow::after {
  animation: none;
  opacity: .32;
}

.voice-color-dot.voice-style-red,
.voice-color-dot.voice-color-choice.voice-style-red {
  background: linear-gradient(135deg, #ff2948, #8b0618 60%, #21020a) !important;
  border-color: rgba(255,120,140,.7) !important;
  box-shadow: 0 0 0 2px rgba(255,31,61,.20), 0 0 22px rgba(255,31,61,.45), 0 10px 24px rgba(0,0,0,.28) !important;
}
.voice-color-dot.voice-style-red::before,
.voice-color-dot.voice-color-choice.voice-style-red::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(from 0deg, transparent 0 18%, #fff 25%, #ff1f3d 40%, #7f0617 58%, transparent 72% 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: voiceRedEdgeSpin 2.6s linear infinite;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .voice-style-red .voice-avatar::before,
  .voice-profile-avatar.voice-style-red::before,
  .voice-style-red.voice-profile-avatar::before,
  .voice-style-red .voice-bubble,
  .voice-style-red .voice-dm-bubble,
  .voice-style-red .voice-bubble::after,
  .voice-style-red .voice-dm-bubble::after,
  .study-theme-preview.voice-style-red,
  .study-theme-preview.voice-style-red::after,
  .voice-color-dot.voice-style-red::before,
  .voice-color-dot.voice-color-choice.voice-style-red::before {
    animation: none !important;
  }
}

/* Voice Room v1.29 — special red effect test pack */
/* Voice Room v1.30 — rose fall slowed and spread across bubble */
.voice-style-red_bloodmoon {
  --voice-accent: #b11226;
  --voice-accent-rgb: 177,18,38;
  --voice-accent-deep: #22030a;
}
.voice-style-red_heart {
  --voice-accent: #ff2e4f;
  --voice-accent-rgb: 255,46,79;
  --voice-accent-deep: #6e0718;
}
.voice-style-red_rose {
  --voice-accent: #e11d48;
  --voice-accent-rgb: 225,29,72;
  --voice-accent-deep: #4a0615;
}

@keyframes voiceBloodMoonPulse {
  0%, 100% { filter: saturate(1.05); box-shadow: inset 3px 0 0 rgba(177,18,38,.96), 0 14px 34px rgba(0,0,0,.32), 0 0 18px rgba(177,18,38,.30), 0 0 44px rgba(20,0,8,.28) !important; }
  50% { filter: saturate(1.35); box-shadow: inset 3px 0 0 rgba(255,55,82,.98), 0 16px 42px rgba(0,0,0,.38), 0 0 30px rgba(177,18,38,.56), 0 0 70px rgba(20,0,8,.44) !important; }
}
@keyframes voiceHeartBeat {
  0%, 100% { transform: scale(1); opacity: .70; }
  10% { transform: scale(1.035); opacity: 1; }
  20% { transform: scale(1); opacity: .76; }
  32% { transform: scale(1.025); opacity: .95; }
  45% { transform: scale(1); opacity: .72; }
}
@keyframes voiceRoseFall {
  0% { transform: translate3d(-10px, -24px, 0) rotate(0deg); opacity: 0; }
  16% { opacity: .80; }
  48% { transform: translate3d(10px, 44%, 0) rotate(120deg); opacity: .72; }
  78% { opacity: .54; }
  100% { transform: translate3d(-6px, 132%, 0) rotate(260deg); opacity: 0; }
}
@keyframes voiceRoseShimmer {
  0%, 100% { box-shadow: inset 3px 0 0 rgba(225,29,72,.92), 0 14px 30px rgba(0,0,0,.26), 0 0 22px rgba(225,29,72,.30) !important; }
  50% { box-shadow: inset 3px 0 0 rgba(255,160,175,.95), 0 16px 36px rgba(0,0,0,.30), 0 0 34px rgba(225,29,72,.48) !important; }
}

.voice-style-red_bloodmoon .voice-avatar,
.voice-profile-avatar.voice-style-red_bloodmoon,
.voice-style-red_bloodmoon.voice-profile-avatar {
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.17), transparent 28%), linear-gradient(135deg, #ff314f, #5b0512 50%, #060107) !important;
  border-color: rgba(255,70,98,.65) !important;
  box-shadow: 0 0 0 2px rgba(177,18,38,.18), 0 0 24px rgba(177,18,38,.44), 0 0 54px rgba(6,1,7,.55), 0 10px 26px rgba(0,0,0,.38) !important;
}
.voice-style-red_bloodmoon .voice-bubble,
.voice-style-red_bloodmoon .voice-dm-bubble,
.study-theme-preview.voice-style-red_bloodmoon {
  background: linear-gradient(135deg, rgba(177,18,38,.30), rgba(12,2,8,.96) 56%, rgba(2,1,6,.98)) !important;
  border-color: rgba(255,50,82,.70) !important;
  animation: voiceBloodMoonPulse 3s ease-in-out infinite;
}
.voice-style-red_bloodmoon .voice-bubble::after,
.voice-style-red_bloodmoon .voice-dm-bubble::after,
.study-theme-preview.voice-style-red_bloodmoon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(from 0deg, transparent 0 16%, #ff94a6 28%, #b11226 42%, #120107 64%, transparent 78% 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: voiceRedEdgeSpin 3s linear infinite;
  pointer-events: none;
}

.voice-style-red_heart .voice-bubble,
.voice-style-red_heart .voice-dm-bubble,
.study-theme-preview.voice-style-red_heart {
  position: relative !important;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255,46,79,.32), rgba(27,5,14,.94) 58%, rgba(8,7,20,.96)) !important;
  border-color: rgba(255,91,118,.76) !important;
  box-shadow: inset 3px 0 0 rgba(255,46,79,.98), 0 14px 32px rgba(0,0,0,.25), 0 0 28px rgba(255,46,79,.34) !important;
}
.voice-style-red_heart .voice-bubble::before,
.voice-style-red_heart .voice-dm-bubble::before,
.study-theme-preview.voice-style-red_heart::before {
  content: "♥";
  position: absolute;
  right: 10px;
  top: 7px;
  font-size: 18px;
  line-height: 1;
  color: rgba(255,210,218,.9);
  text-shadow: 0 0 10px rgba(255,46,79,.75), 0 0 22px rgba(255,46,79,.45);
  animation: voiceHeartBeat 2.4s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}
.voice-style-red_heart .voice-avatar,
.voice-profile-avatar.voice-style-red_heart,
.voice-style-red_heart.voice-profile-avatar {
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.24), transparent 30%), linear-gradient(135deg, #ff4663, #8b071e 62%, #21020a) !important;
  border-color: rgba(255,96,124,.74) !important;
  animation: voiceHeartBeat 2.4s ease-in-out infinite;
}

.voice-style-red_rose .voice-bubble,
.voice-style-red_rose .voice-dm-bubble,
.study-theme-preview.voice-style-red_rose {
  position: relative !important;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(225,29,72,.26), rgba(24,5,13,.94) 55%, rgba(8,7,20,.96)) !important;
  border-color: rgba(244,63,94,.72) !important;
  animation: voiceRoseShimmer 3.2s ease-in-out infinite;
}
.voice-style-red_rose .voice-bubble::before,
.voice-style-red_rose .voice-dm-bubble::before,
.study-theme-preview.voice-style-red_rose::before {
  content: "❦   ✦   ❦   ✦";
  position: absolute;
  left: 0;
  right: 0;
  top: -26px;
  height: 115%;
  width: 100%;
  text-align: center;
  color: rgba(255,190,202,.78);
  font-size: clamp(12px, 3.8vw, 15px);
  letter-spacing: clamp(14px, 6vw, 42px);
  text-shadow: 0 0 10px rgba(225,29,72,.72);
  animation: voiceRoseFall 8.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}
.voice-style-red_rose .voice-bubble::after,
.voice-style-red_rose .voice-dm-bubble::after,
.study-theme-preview.voice-style-red_rose::after {
  content: "✦   ❦   ✦   ❦";
  position: absolute;
  left: 0;
  right: 0;
  top: -30px;
  height: 115%;
  width: 100%;
  text-align: center;
  color: rgba(255,125,148,.66);
  font-size: clamp(11px, 3.3vw, 13px);
  letter-spacing: clamp(18px, 7vw, 48px);
  text-shadow: 0 0 12px rgba(225,29,72,.60);
  animation: voiceRoseFall 10.5s ease-in-out infinite 2.1s;
  pointer-events: none;
  z-index: 2;
}
.voice-style-red_rose .voice-avatar,
.voice-profile-avatar.voice-style-red_rose,
.voice-style-red_rose.voice-profile-avatar {
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.24), transparent 30%), linear-gradient(135deg, #fb7185, #9f1239 56%, #24020c) !important;
  border-color: rgba(251,113,133,.70) !important;
  box-shadow: 0 0 0 2px rgba(225,29,72,.20), 0 0 24px rgba(225,29,72,.40), 0 10px 26px rgba(0,0,0,.32) !important;
}

.voice-style-red_bloodmoon.no-glow .voice-bubble,
.voice-style-red_heart.no-glow .voice-bubble,
.voice-style-red_rose.no-glow .voice-bubble,
.voice-style-red_bloodmoon.no-glow .voice-dm-bubble,
.voice-style-red_heart.no-glow .voice-dm-bubble,
.voice-style-red_rose.no-glow .voice-dm-bubble,
.study-theme-preview.voice-style-red_bloodmoon.no-glow,
.study-theme-preview.voice-style-red_heart.no-glow,
.study-theme-preview.voice-style-red_rose.no-glow {
  animation: none !important;
}
.voice-style-red_heart.no-glow .voice-bubble::before,
.voice-style-red_heart.no-glow .voice-dm-bubble::before,
.voice-style-red_rose.no-glow .voice-bubble::before,
.voice-style-red_rose.no-glow .voice-dm-bubble::before,
.voice-style-red_rose.no-glow .voice-bubble::after,
.voice-style-red_rose.no-glow .voice-dm-bubble::after,
.study-theme-preview.voice-style-red_heart.no-glow::before,
.study-theme-preview.voice-style-red_rose.no-glow::before,
.study-theme-preview.voice-style-red_rose.no-glow::after {
  display: none !important;
}

.voice-color-dot.voice-style-red_bloodmoon,
.voice-color-dot.voice-color-choice.voice-style-red_bloodmoon {
  background: linear-gradient(135deg, #ff314f, #5b0512 52%, #060107) !important;
  border-color: rgba(255,70,98,.72) !important;
}
.voice-color-dot.voice-style-red_heart,
.voice-color-dot.voice-color-choice.voice-style-red_heart {
  background: linear-gradient(135deg, #ff4663, #8b071e 62%, #21020a) !important;
  border-color: rgba(255,96,124,.72) !important;
}
.voice-color-dot.voice-style-red_rose,
.voice-color-dot.voice-color-choice.voice-style-red_rose {
  background: linear-gradient(135deg, #fb7185, #9f1239 56%, #24020c) !important;
  border-color: rgba(251,113,133,.72) !important;
}

@media (prefers-reduced-motion: reduce) {
  .voice-style-red_bloodmoon .voice-bubble,
  .voice-style-red_bloodmoon .voice-dm-bubble,
  .voice-style-red_bloodmoon .voice-bubble::after,
  .voice-style-red_bloodmoon .voice-dm-bubble::after,
  .voice-style-red_heart .voice-bubble::before,
  .voice-style-red_heart .voice-dm-bubble::before,
  .voice-style-red_heart .voice-avatar,
  .voice-style-red_rose .voice-bubble,
  .voice-style-red_rose .voice-dm-bubble,
  .voice-style-red_rose .voice-bubble::before,
  .voice-style-red_rose .voice-dm-bubble::before,
  .voice-style-red_rose .voice-bubble::after,
  .voice-style-red_rose .voice-dm-bubble::after,
  .study-theme-preview.voice-style-red_bloodmoon,
  .study-theme-preview.voice-style-red_bloodmoon::after,
  .study-theme-preview.voice-style-red_heart::before,
  .study-theme-preview.voice-style-red_rose,
  .study-theme-preview.voice-style-red_rose::before,
  .study-theme-preview.voice-style-red_rose::after {
    animation: none !important;
  }
}

/* Voice Room v1.31 — travelling edge glow for every chat color
   A bright point travels clockwise around the message bubble border. */
@property --voice-edge-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

@keyframes voiceTravelEdgePoint {
  from { --voice-edge-angle: 0deg; }
  to { --voice-edge-angle: 360deg; }
}

@keyframes voiceTravelEdgePulse {
  0%, 100% { filter: saturate(1.05); }
  50% { filter: saturate(1.25); }
}

@supports (background: conic-gradient(from 0deg, red, transparent)) {
  .voice-msg:not(.deleted):not(.no-glow) .voice-bubble,
  .voice-dm-msg:not(.deleted):not(.no-glow) .voice-dm-bubble,
  .study-theme-preview:not(.no-glow) {
    position: relative !important;
    border: 1.4px solid transparent !important;
    background:
      linear-gradient(135deg, rgba(22, 17, 40, .96), rgba(9, 7, 22, .98)) padding-box,
      conic-gradient(
        from var(--voice-edge-angle),
        transparent 0deg,
        transparent 246deg,
        rgba(var(--voice-accent-rgb,168,85,247), .12) 266deg,
        rgba(var(--voice-accent-rgb,168,85,247), .65) 286deg,
        rgba(255,255,255,.98) 302deg,
        rgba(var(--voice-accent-rgb,168,85,247), 1) 318deg,
        rgba(var(--voice-accent-rgb,168,85,247), .38) 336deg,
        transparent 360deg
      ) border-box !important;
    box-shadow:
      inset 3px 0 0 rgba(var(--voice-accent-rgb,168,85,247), .72),
      0 12px 26px rgba(0,0,0,.20),
      0 0 18px rgba(var(--voice-accent-rgb,168,85,247), .16) !important;
    animation: voiceTravelEdgePoint 4.2s linear infinite, voiceTravelEdgePulse 4.2s ease-in-out infinite !important;
  }

  .voice-msg.own:not(.deleted):not(.no-glow) .voice-bubble,
  .voice-dm-msg.own:not(.deleted):not(.no-glow) .voice-dm-bubble {
    background:
      linear-gradient(135deg, rgba(var(--voice-accent-rgb,168,85,247), .48), rgba(28,18,49,.91) 58%, rgba(9,7,22,.96)) padding-box,
      conic-gradient(
        from var(--voice-edge-angle),
        transparent 0deg,
        transparent 246deg,
        rgba(var(--voice-accent-rgb,168,85,247), .12) 266deg,
        rgba(var(--voice-accent-rgb,168,85,247), .70) 286deg,
        rgba(255,255,255,.98) 302deg,
        rgba(var(--voice-accent-rgb,168,85,247), 1) 318deg,
        rgba(var(--voice-accent-rgb,168,85,247), .40) 336deg,
        transparent 360deg
      ) border-box !important;
    box-shadow:
      inset -3px 0 0 rgba(var(--voice-accent-rgb,168,85,247), .84),
      0 14px 30px rgba(0,0,0,.24),
      0 0 24px rgba(var(--voice-accent-rgb,168,85,247), .20) !important;
  }

  .voice-style-red:not(.no-glow) .voice-bubble,
  .voice-style-red:not(.no-glow) .voice-dm-bubble,
  .study-theme-preview.voice-style-red:not(.no-glow) {
    background:
      linear-gradient(135deg, rgba(255,31,61,.30), rgba(31,4,14,.96) 58%, rgba(7,2,9,.98)) padding-box,
      conic-gradient(from var(--voice-edge-angle), transparent 0deg, transparent 238deg, rgba(255,31,61,.20) 260deg, #ffedf0 292deg, #ff1f3d 315deg, rgba(127,6,23,.48) 340deg, transparent 360deg) border-box !important;
    animation: voiceTravelEdgePoint 3.6s linear infinite, voiceRedPulseGlow 3.6s ease-in-out infinite !important;
  }

  .voice-style-red_bloodmoon:not(.no-glow) .voice-bubble,
  .voice-style-red_bloodmoon:not(.no-glow) .voice-dm-bubble,
  .study-theme-preview.voice-style-red_bloodmoon:not(.no-glow) {
    background:
      linear-gradient(135deg, rgba(177,18,38,.32), rgba(12,2,8,.97) 56%, rgba(2,1,6,.99)) padding-box,
      conic-gradient(from var(--voice-edge-angle), transparent 0deg, transparent 238deg, rgba(177,18,38,.22) 260deg, #ff9bad 292deg, #b11226 316deg, rgba(18,1,7,.70) 342deg, transparent 360deg) border-box !important;
    animation: voiceTravelEdgePoint 4s linear infinite, voiceBloodMoonPulse 4s ease-in-out infinite !important;
  }

  .voice-style-red_heart:not(.no-glow) .voice-bubble,
  .voice-style-red_heart:not(.no-glow) .voice-dm-bubble,
  .study-theme-preview.voice-style-red_heart:not(.no-glow) {
    background:
      linear-gradient(135deg, rgba(255,46,79,.30), rgba(27,5,14,.95) 58%, rgba(8,7,20,.97)) padding-box,
      conic-gradient(from var(--voice-edge-angle), transparent 0deg, transparent 240deg, rgba(255,46,79,.20) 260deg, #ffe0e7 292deg, #ff2e4f 316deg, rgba(110,7,24,.48) 342deg, transparent 360deg) border-box !important;
    animation: voiceTravelEdgePoint 4.2s linear infinite !important;
  }

  .voice-style-red_rose:not(.no-glow) .voice-bubble,
  .voice-style-red_rose:not(.no-glow) .voice-dm-bubble,
  .study-theme-preview.voice-style-red_rose:not(.no-glow) {
    background:
      linear-gradient(135deg, rgba(225,29,72,.26), rgba(24,5,13,.95) 55%, rgba(8,7,20,.97)) padding-box,
      conic-gradient(from var(--voice-edge-angle), transparent 0deg, transparent 240deg, rgba(225,29,72,.18) 260deg, #ffd7df 292deg, #e11d48 316deg, rgba(74,6,21,.48) 342deg, transparent 360deg) border-box !important;
    animation: voiceTravelEdgePoint 4.5s linear infinite, voiceRoseShimmer 4.5s ease-in-out infinite !important;
  }
}

.voice-edge-note {
  font-size: 11px;
  color: rgba(236,226,255,.62);
  margin-top: 6px;
}

@media (max-width: 520px) {
  @supports (background: conic-gradient(from 0deg, red, transparent)) {
    .voice-msg:not(.deleted):not(.no-glow) .voice-bubble,
    .voice-dm-msg:not(.deleted):not(.no-glow) .voice-dm-bubble {
      animation-duration: 5.2s, 5.2s !important;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .voice-msg .voice-bubble,
  .voice-dm-msg .voice-dm-bubble,
  .study-theme-preview {
    animation: none !important;
  }
}

/* =====================================================
   Voice Room v1.32 final check / UI polish
   - keeps current scope locked
   - improves mobile drawer, DM, admin cards, and safe-area handling
===================================================== */
.media-disabled { display: none !important; }

.voice-room-overlay,
.voice-mobile-drawer,
.voice-profile-popup,
.voice-password-modal,
.voice-image-modal {
  -webkit-tap-highlight-color: transparent;
}

.voice-panel,
.voice-card,
.voice-admin-card,
.voice-admin-test-card,
.voice-admin-dm-monitor,
.voice-dm-list-card,
.voice-dm-chat-card {
  box-shadow: 0 18px 55px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.06);
}

.voice-admin-card,
.voice-admin-test-card,
.voice-admin-dm-monitor {
  border-color: rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(28,20,49,.96), rgba(14,12,24,.96));
}

.voice-admin-grid label,
.voice-password-admin,
.voice-admin-actions {
  min-width: 0;
}

.voice-admin-grid input,
.voice-admin-grid select,
.voice-password-admin input,
.voice-dm-send input,
.voice-message-input,
.voice-chat-input input {
  min-width: 0;
}

.voice-chat-input,
.voice-dm-send {
  align-items: center;
  gap: 8px;
}

.voice-chat-input input,
.voice-dm-send input {
  width: 100%;
  flex: 1 1 auto;
}

.voice-chat-input button,
.voice-dm-send button,
.voice-media-button,
.voice-send-button {
  flex: 0 0 auto;
}

.voice-message-bubble,
.voice-dm-bubble {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.voice-message-image {
  cursor: zoom-in;
  transition: transform .18s ease, filter .18s ease;
}
.voice-message-image:active { transform: scale(.985); filter: brightness(.92); }

.voice-dm-back,
.voice-mobile-activity-btn,
.voice-profile-close,
.voice-password-actions button,
.voice-admin-actions button,
.voice-password-admin button {
  touch-action: manipulation;
}

.voice-mobile-activity-btn {
  isolation: isolate;
  box-shadow: 0 10px 28px rgba(124,58,237,.32), inset 0 1px 0 rgba(255,255,255,.22);
}
.voice-mobile-activity-btn:focus-visible,
.voice-chat-input button:focus-visible,
.voice-dm-send button:focus-visible,
.voice-admin-actions button:focus-visible,
.voice-password-admin button:focus-visible,
.voice-profile-close:focus-visible {
  outline: 2px solid rgba(167,139,250,.9);
  outline-offset: 3px;
}

.study-theme-preview,
.voice-color-choice,
.voice-message-bubble,
.voice-dm-bubble,
.voice-profile-avatar,
.voice-avatar {
  will-change: transform, box-shadow;
}

@media (max-width: 760px) {
  .voice-room-shell,
  .voice-room-main,
  .voice-chat-panel,
  .voice-dm-shell {
    min-height: 0;
  }

  .voice-room-overlay.open {
    overflow: hidden;
  }

  .voice-chat-panel,
  .voice-dm-chat-card {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .voice-chat-input,
  .voice-dm-send {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(15,12,25,.78), rgba(15,12,25,.98));
    backdrop-filter: none;
  }

  .voice-chat-input input,
  .voice-dm-send input {
    font-size: 16px; /* prevents iOS zoom */
  }

  .voice-mobile-drawer {
    width: min(88vw, 360px);
    max-width: 360px;
    border-left: 1px solid rgba(167,139,250,.22);
  }

  .voice-mobile-drawer .voice-panel,
  .voice-mobile-drawer .voice-card,
  .voice-mobile-drawer .voice-admin-card {
    border-radius: 18px;
  }

  .voice-admin-grid,
  .voice-admin-actions,
  .voice-password-admin {
    grid-template-columns: 1fr !important;
    flex-direction: column;
    align-items: stretch;
  }

  .voice-admin-actions button,
  .voice-password-admin button {
    width: 100%;
  }

  .voice-dm-shell.dm-chat-open .voice-dm-chat-card {
    min-height: calc(100dvh - 190px);
  }

  .voice-profile-card {
    width: min(92vw, 360px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .voice-message-bubble::before,
  .voice-dm-bubble::before,
  .study-theme-preview::before,
  .voice-avatar::before,
  .voice-profile-avatar::before,
  .voice-mobile-activity-btn::before,
  .voice-mobile-activity-btn span,
  .voice-red-rose .voice-message-bubble::after,
  .voice-red-rose.voice-dm-bubble::after {
    animation: none !important;
  }
}

/* v1.34: DM cleanup - keep DM focused, remove room activity from the DM view */
.voice-room-overlay.voice-tab-state-dm .voice-mobile-activity-btn {
  display: none !important;
}

.voice-room-overlay.voice-tab-state-dm .voice-activity-card {
  display: none !important;
}

.voice-room-overlay.voice-tab-state-dm .voice-room-side {
  align-self: start;
}

@media (max-width: 720px) {
  .voice-room-overlay.voice-tab-state-dm .voice-room-side {
    display: none !important;
  }
  body.voice-mobile-panel-open .voice-room-overlay.voice-tab-state-dm .voice-room-side {
    display: none !important;
  }
}


/* Voice Room v1.36 - activity turn-on modal visibility fix */
#voiceActivityPasswordModal {
  z-index: 2147483646 !important;
}
#voiceActivityPasswordModal .voice-password-box {
  border-color: rgba(34, 197, 94, .36);
  box-shadow: 0 30px 90px rgba(0,0,0,.68), 0 0 32px rgba(34,197,94,.18);
}
#voiceActivityPasswordModal input {
  width: 100%;
  box-sizing: border-box;
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.09);
  color: #fff;
  padding: 0 12px;
  font-size: 16px;
  outline: none;
}
#voiceActivityPasswordModal input:focus {
  border-color: rgba(34,197,94,.55);
  box-shadow: 0 0 0 3px rgba(34,197,94,.12);
}
.voice-activity-notice-actions button#voiceActivityNoticeTurnOn {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  box-shadow: 0 10px 28px rgba(34,197,94,.25);
}

/* v1.37 lightweight emoji tray */
.voice-send-row {
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  position: relative;
}
.voice-room-send.media-enabled .voice-send-row {
  grid-template-columns: auto auto minmax(0, 1fr) auto !important;
}
.voice-dm-send {
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  position: relative;
}
.voice-emoji-wrap {
  position: relative;
  flex: 0 0 auto;
  z-index: 20;
}
.voice-emoji-btn {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,.11), rgba(168,85,247,.16));
  color: #fff;
  font-size: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.12);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.voice-emoji-btn:hover,
.voice-emoji-btn:focus-visible {
  border-color: rgba(216,180,254,.55);
  background: linear-gradient(135deg, rgba(168,85,247,.30), rgba(59,130,246,.18));
  box-shadow: 0 0 0 3px rgba(168,85,247,.16), 0 14px 28px rgba(124,58,237,.22);
  outline: none;
}
.voice-emoji-btn:active { transform: scale(.94); }
.voice-emoji-tray {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  width: min(292px, calc(100vw - 28px));
  padding: 10px;
  border: 1px solid rgba(216,180,254,.22);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(18,14,34,.98), rgba(35,22,58,.98));
  box-shadow: 0 20px 50px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.04) inset;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  z-index: 2147482800;
}
.voice-emoji-tray[hidden] { display: none !important; }
.voice-emoji-choice {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 11px;
  background: rgba(255,255,255,.07);
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .14s ease, background .14s ease, border-color .14s ease;
}
.voice-emoji-choice:hover,
.voice-emoji-choice:focus-visible {
  background: rgba(168,85,247,.22);
  border-color: rgba(216,180,254,.35);
  outline: none;
}
.voice-emoji-choice:active { transform: scale(.90); }
.voice-dm-send .voice-emoji-tray {
  left: 0;
  bottom: calc(100% + 10px);
}
@media (max-width: 720px) {
  .voice-send-row {
    grid-template-columns: 42px minmax(0, 1fr) 54px !important;
    gap: 7px !important;
  }
  .voice-room-send.media-enabled .voice-send-row {
    grid-template-columns: 42px 42px minmax(0, 1fr) 54px !important;
  }
  .voice-dm-send {
    grid-template-columns: 42px minmax(0, 1fr) 54px !important;
    gap: 7px !important;
  }
  .voice-emoji-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .voice-emoji-tray {
    width: min(286px, calc(100vw - 22px));
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    padding: 9px;
  }
  .voice-emoji-choice {
    width: 32px;
    height: 32px;
    font-size: 17px;
  }
}

/* v1.38 custom sticker pack */
.voice-send-row {
  grid-template-columns: auto auto minmax(0, 1fr) auto !important;
}
.voice-room-send.media-enabled .voice-send-row {
  grid-template-columns: auto auto auto minmax(0, 1fr) auto !important;
}
.voice-dm-send {
  grid-template-columns: auto auto minmax(0, 1fr) auto !important;
}
.voice-sticker-wrap {
  position: relative;
  flex: 0 0 auto;
  z-index: 20;
}
.voice-sticker-btn {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(34,197,94,.16), rgba(168,85,247,.16));
  color: #fff;
  font-size: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.12);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.voice-sticker-btn:hover,
.voice-sticker-btn:focus-visible {
  border-color: rgba(134,239,172,.55);
  background: linear-gradient(135deg, rgba(34,197,94,.28), rgba(168,85,247,.22));
  box-shadow: 0 0 0 3px rgba(34,197,94,.14), 0 14px 28px rgba(34,197,94,.18);
  outline: none;
}
.voice-sticker-btn:active { transform: scale(.94); }
.voice-sticker-tray {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  width: min(304px, calc(100vw - 28px));
  padding: 10px;
  border: 1px solid rgba(134,239,172,.22);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(12,18,26,.98), rgba(30,22,48,.98));
  box-shadow: 0 20px 50px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.04) inset;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  z-index: 2147482800;
}
.voice-sticker-tray[hidden] { display: none !important; }
.voice-sticker-choice {
  width: 62px;
  height: 62px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  background: rgba(255,255,255,.07);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .14s ease, background .14s ease, border-color .14s ease;
  overflow: hidden;
}
.voice-sticker-choice img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  display: block;
}
.voice-sticker-choice:hover,
.voice-sticker-choice:focus-visible {
  background: rgba(34,197,94,.18);
  border-color: rgba(134,239,172,.38);
  outline: none;
}
.voice-sticker-choice:active { transform: scale(.94); }
.voice-dm-send .voice-sticker-tray {
  left: 0;
  bottom: calc(100% + 10px);
}
.voice-sticker-message {
  width: 152px;
  max-width: min(44vw, 170px);
  padding: 8px;
  border-radius: 18px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.voice-sticker-message img {
  width: 132px;
  height: 132px;
  max-width: 100%;
  object-fit: contain;
  display: block;
}
.voice-msg.sticker .voice-bubble,
.voice-dm-msg.sticker .voice-dm-bubble {
  padding: 10px 10px 8px;
}
.voice-dm-sticker-message {
  width: 142px;
}
.voice-dm-sticker-message img {
  width: 122px;
  height: 122px;
}
@media (max-width: 720px) {
  .voice-send-row {
    grid-template-columns: 40px 40px minmax(0, 1fr) 54px !important;
    gap: 7px !important;
  }
  .voice-room-send.media-enabled .voice-send-row {
    grid-template-columns: 40px 40px 40px minmax(0, 1fr) 54px !important;
  }
  .voice-dm-send {
    grid-template-columns: 40px 40px minmax(0, 1fr) 54px !important;
    gap: 7px !important;
  }
  .voice-sticker-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .voice-sticker-tray {
    width: min(286px, calc(100vw - 22px));
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
    padding: 9px;
  }
  .voice-sticker-choice {
    width: 58px;
    height: 58px;
    border-radius: 15px;
  }
  .voice-sticker-choice img {
    width: 50px;
    height: 50px;
  }
  .voice-sticker-message {
    width: 132px;
    max-width: min(48vw, 150px);
  }
  .voice-sticker-message img {
    width: 116px;
    height: 116px;
  }
}

/* Voice Room v1.39 — stronger Rose Fall + Heart Pulse visibility */
@keyframes voiceHeartPopStrong {
  0%, 100% { transform: translateY(0) scale(.96) rotate(-6deg); opacity: .72; }
  12% { transform: translateY(-1px) scale(1.18) rotate(-3deg); opacity: 1; }
  24% { transform: translateY(0) scale(.98) rotate(-6deg); opacity: .78; }
  42% { transform: translateY(-1px) scale(1.12) rotate(2deg); opacity: .96; }
  60% { transform: translateY(0) scale(.98) rotate(-4deg); opacity: .78; }
}

@keyframes voiceHeartHaloStrong {
  0%, 100% { box-shadow: inset 3px 0 0 rgba(255,46,79,.95), 0 14px 32px rgba(0,0,0,.25), 0 0 26px rgba(255,46,79,.38), 0 0 0 rgba(255,46,79,0); filter: saturate(1.05); }
  18% { box-shadow: inset 3px 0 0 rgba(255,104,132,1), 0 16px 40px rgba(0,0,0,.28), 0 0 38px rgba(255,46,79,.62), 0 0 76px rgba(255,46,79,.26); filter: saturate(1.35); }
  38% { box-shadow: inset 3px 0 0 rgba(255,46,79,.96), 0 14px 32px rgba(0,0,0,.25), 0 0 28px rgba(255,46,79,.42), 0 0 0 rgba(255,46,79,0); filter: saturate(1.08); }
  56% { box-shadow: inset 3px 0 0 rgba(255,120,145,1), 0 16px 42px rgba(0,0,0,.30), 0 0 44px rgba(255,46,79,.68), 0 0 92px rgba(255,46,79,.28); filter: saturate(1.45); }
}

@keyframes voiceRoseFallStrongA {
  0% { transform: translate3d(-46%, -36px, 0) rotate(-18deg); opacity: 0; }
  14% { opacity: .95; }
  38% { transform: translate3d(22%, 34%, 0) rotate(92deg); opacity: .86; }
  68% { transform: translate3d(-18%, 80%, 0) rotate(190deg); opacity: .70; }
  100% { transform: translate3d(44%, 142%, 0) rotate(310deg); opacity: 0; }
}

@keyframes voiceRoseFallStrongB {
  0% { transform: translate3d(44%, -44px, 0) rotate(22deg); opacity: 0; }
  16% { opacity: .90; }
  42% { transform: translate3d(-24%, 42%, 0) rotate(-120deg); opacity: .82; }
  72% { transform: translate3d(18%, 88%, 0) rotate(-235deg); opacity: .62; }
  100% { transform: translate3d(-42%, 148%, 0) rotate(-360deg); opacity: 0; }
}

.voice-style-red_heart .voice-bubble,
.voice-style-red_heart .voice-dm-bubble,
.study-theme-preview.voice-style-red_heart {
  overflow: hidden;
  box-shadow: inset 3px 0 0 rgba(255,46,79,.98), 0 14px 32px rgba(0,0,0,.26), 0 0 34px rgba(255,46,79,.46), 0 0 72px rgba(255,46,79,.16) !important;
  animation: voiceHeartHaloStrong 3.1s ease-in-out infinite !important;
}

.voice-style-red_heart .voice-bubble::before,
.voice-style-red_heart .voice-dm-bubble::before,
.study-theme-preview.voice-style-red_heart::before {
  content: "♥" !important;
  right: 10px !important;
  top: 7px !important;
  font-size: 24px !important;
  color: rgba(255,232,238,.98) !important;
  text-shadow: 0 0 10px rgba(255,46,79,.95), 0 0 26px rgba(255,46,79,.75), 0 0 48px rgba(255,46,79,.42) !important;
  animation: voiceHeartPopStrong 3.1s ease-in-out infinite !important;
}

.voice-style-red_heart .voice-bubble::after,
.voice-style-red_heart .voice-dm-bubble::after,
.study-theme-preview.voice-style-red_heart::after {
  content: "♡  ♥  ♡";
  position: absolute;
  left: 14px;
  right: 48px;
  bottom: 6px;
  display: flex;
  justify-content: space-around;
  font-size: 13px;
  color: rgba(255,170,190,.42);
  text-shadow: 0 0 12px rgba(255,46,79,.45);
  animation: voiceHeartPopStrong 3.1s ease-in-out infinite .45s;
  pointer-events: none;
  z-index: 2;
}

.voice-style-red_rose .voice-bubble,
.voice-style-red_rose .voice-dm-bubble,
.study-theme-preview.voice-style-red_rose {
  overflow: hidden;
  box-shadow: inset 3px 0 0 rgba(225,29,72,.95), 0 14px 34px rgba(0,0,0,.26), 0 0 34px rgba(225,29,72,.42), 0 0 74px rgba(225,29,72,.14) !important;
}

.voice-style-red_rose .voice-bubble::before,
.voice-style-red_rose .voice-dm-bubble::before,
.study-theme-preview.voice-style-red_rose::before {
  content: "❦     ✦     ❦     ✦     ❦" !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  text-align: center !important;
  font-size: clamp(15px, 4.4vw, 19px) !important;
  letter-spacing: clamp(10px, 5.5vw, 44px) !important;
  color: rgba(255,214,222,.92) !important;
  text-shadow: 0 0 10px rgba(225,29,72,.94), 0 0 26px rgba(225,29,72,.64), 0 0 46px rgba(225,29,72,.34) !important;
  animation: voiceRoseFallStrongA 12.5s ease-in-out infinite !important;
}

.voice-style-red_rose .voice-bubble::after,
.voice-style-red_rose .voice-dm-bubble::after,
.study-theme-preview.voice-style-red_rose::after {
  content: "✦     ❦     ✦     ❦     ✦" !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  text-align: center !important;
  font-size: clamp(13px, 3.8vw, 16px) !important;
  letter-spacing: clamp(12px, 6vw, 50px) !important;
  color: rgba(255,135,158,.78) !important;
  text-shadow: 0 0 12px rgba(225,29,72,.76), 0 0 30px rgba(225,29,72,.44) !important;
  animation: voiceRoseFallStrongB 14s ease-in-out infinite 2.8s !important;
}

/* Keep the travelling edge on top of the stronger effects without hiding the petals/hearts. */
@supports (background: conic-gradient(from 0deg, red, transparent)) {
  .voice-style-red_heart:not(.no-glow) .voice-bubble,
  .voice-style-red_heart:not(.no-glow) .voice-dm-bubble,
  .study-theme-preview.voice-style-red_heart:not(.no-glow) {
    animation: voiceTravelEdgePoint 4.4s linear infinite, voiceHeartHaloStrong 3.1s ease-in-out infinite !important;
  }

  .voice-style-red_rose:not(.no-glow) .voice-bubble,
  .voice-style-red_rose:not(.no-glow) .voice-dm-bubble,
  .study-theme-preview.voice-style-red_rose:not(.no-glow) {
    animation: voiceTravelEdgePoint 5s linear infinite, voiceRoseShimmer 5.6s ease-in-out infinite !important;
  }
}

@media (max-width: 520px) {
  .voice-style-red_heart .voice-bubble::before,
  .voice-style-red_heart .voice-dm-bubble::before {
    font-size: 21px !important;
    right: 8px !important;
  }

  .voice-style-red_heart .voice-bubble::after,
  .voice-style-red_heart .voice-dm-bubble::after {
    font-size: 11px !important;
    right: 42px;
  }

  .voice-style-red_rose .voice-bubble::before,
  .voice-style-red_rose .voice-dm-bubble::before,
  .voice-style-red_rose .voice-bubble::after,
  .voice-style-red_rose .voice-dm-bubble::after {
    letter-spacing: clamp(8px, 4.2vw, 26px) !important;
  }
}

/* Voice Room v1.40 — remove center shine/beam from red heart + rose effects
   Keeps the travelling edge glow, but makes the bubble/preview fill fully opaque
   so the conic edge animation no longer bleeds through the middle. */
@supports (background: conic-gradient(from 0deg, red, transparent)) {
  .voice-style-red_heart:not(.no-glow) .voice-bubble,
  .voice-style-red_heart:not(.no-glow) .voice-dm-bubble,
  .study-theme-preview.voice-style-red_heart:not(.no-glow) {
    background:
      linear-gradient(135deg, rgb(72, 8, 23), rgb(27, 5, 14) 58%, rgb(8, 7, 20)) padding-box,
      conic-gradient(from var(--voice-edge-angle), transparent 0deg, transparent 240deg, rgba(255,46,79,.20) 260deg, #ffe0e7 292deg, #ff2e4f 316deg, rgba(110,7,24,.48) 342deg, transparent 360deg) border-box !important;
  }

  .voice-style-red_rose:not(.no-glow) .voice-bubble,
  .voice-style-red_rose:not(.no-glow) .voice-dm-bubble,
  .study-theme-preview.voice-style-red_rose:not(.no-glow) {
    background:
      linear-gradient(135deg, rgb(64, 8, 22), rgb(24, 5, 13) 55%, rgb(8, 7, 20)) padding-box,
      conic-gradient(from var(--voice-edge-angle), transparent 0deg, transparent 240deg, rgba(225,29,72,.18) 260deg, #ffd7df 292deg, #e11d48 316deg, rgba(74,6,21,.48) 342deg, transparent 360deg) border-box !important;
  }
}


/* Voice Room v1.42 — Red cleanup
   - Blood Moon removed from picker/rules
   - Deep Red Spin renamed to Red (Admin Only)
   - Red keeps the normal travelling border only; no extra spinning overlay. */
.voice-style-red .voice-avatar::before,
.voice-profile-avatar.voice-style-red::before,
.voice-style-red.voice-profile-avatar::before,
.voice-color-dot.voice-style-red::before,
.voice-color-dot.voice-color-choice.voice-style-red::before {
  animation: none !important;
  opacity: .42 !important;
}

.voice-style-red .voice-bubble::after,
.voice-style-red .voice-dm-bubble::after,
.study-theme-preview.voice-style-red::after {
  content: none !important;
  animation: none !important;
}

@supports (background: conic-gradient(from 0deg, red, transparent)) {
  .voice-style-red:not(.no-glow) .voice-bubble,
  .voice-style-red:not(.no-glow) .voice-dm-bubble,
  .study-theme-preview.voice-style-red:not(.no-glow) {
    animation: voiceTravelEdgePoint 4.2s linear infinite, voiceTravelEdgePulse 4.2s ease-in-out infinite !important;
  }
}

/* If an old Blood Moon value exists in Firestore, render it as locked normal red instead of showing a separate theme. */
.voice-style-red_bloodmoon .voice-bubble,
.voice-style-red_bloodmoon .voice-dm-bubble,
.study-theme-preview.voice-style-red_bloodmoon {
  --voice-accent: #ff1f3d;
  --voice-accent-rgb: 255,31,61;
}

/* v1.44 DM admin-first polish */
.voice-dm-user.admin-first {
  border-color: rgba(255, 31, 61, .55);
  background: linear-gradient(135deg, rgba(255,31,61,.18), rgba(124,58,237,.10), rgba(255,255,255,.045));
  box-shadow: 0 10px 30px rgba(255,31,61,.10);
}
.voice-dm-user.admin-first .voice-avatar {
  border-color: rgba(255,31,61,.9);
  box-shadow: 0 0 0 1px rgba(255,31,61,.35), 0 0 20px rgba(255,31,61,.35);
}
.voice-dm-admin-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 7px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,31,61,.45);
  background: rgba(255,31,61,.14);
  color: #ffd7df;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .02em;
  vertical-align: middle;
}

/* Voice Room v1.45 — mobile performance + DM delete/menu polish */
.voice-dm-message-menu {
  z-index: 10080;
  min-width: 142px;
}
.voice-dm-msg .voice-dm-delete {
  display: none !important;
}
.voice-dm-msg.own .voice-dm-bubble {
  cursor: context-menu;
}
.voice-dm-msg.own .voice-dm-bubble:active {
  transform: scale(.985);
}

@media (max-width: 700px) {
  /* Keep the premium look, but reduce heavy animation cost on mobile. */
  .voice-room-overlay .voice-bubble,
  .voice-room-overlay .voice-dm-bubble,
  .study-theme-preview {
    will-change: auto;
  }
  .voice-style-purple:not(.no-glow) .voice-bubble,
  .voice-style-blue:not(.no-glow) .voice-bubble,
  .voice-style-cyan:not(.no-glow) .voice-bubble,
  .voice-style-emerald:not(.no-glow) .voice-bubble,
  .voice-style-red:not(.no-glow) .voice-bubble,
  .voice-style-red_heart:not(.no-glow) .voice-bubble,
  .voice-style-red_rose:not(.no-glow) .voice-bubble,
  .voice-style-purple:not(.no-glow) .voice-dm-bubble,
  .voice-style-blue:not(.no-glow) .voice-dm-bubble,
  .voice-style-cyan:not(.no-glow) .voice-dm-bubble,
  .voice-style-emerald:not(.no-glow) .voice-dm-bubble,
  .voice-style-red:not(.no-glow) .voice-dm-bubble,
  .voice-style-red_heart:not(.no-glow) .voice-dm-bubble,
  .voice-style-red_rose:not(.no-glow) .voice-dm-bubble {
    animation-duration: 7.5s !important;
    filter: none !important;
  }
  .voice-style-red_heart .voice-bubble::before,
  .voice-style-red_heart .voice-dm-bubble::before,
  .voice-style-red_heart .voice-bubble::after,
  .voice-style-red_heart .voice-dm-bubble::after,
  .voice-style-red_rose .voice-bubble::before,
  .voice-style-red_rose .voice-dm-bubble::before,
  .voice-style-red_rose .voice-bubble::after,
  .voice-style-red_rose .voice-dm-bubble::after {
    animation-duration: 6.5s !important;
    opacity: .55 !important;
  }
  .voice-message-menu {
    transform: translateZ(0);
  }
}


/* v1.46: compact activity DM button + full-screen mobile DM experience */
.voice-member-dm {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0 !important;
  display: inline-grid;
  place-items: center;
  font-size: 14px !important;
  line-height: 1;
  border-radius: 12px !important;
  margin-left: 6px !important;
  margin-right: 2px !important;
  box-shadow: 0 8px 18px rgba(124,58,237,.22) !important;
}
.voice-member-dm:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(124,58,237,.34) !important;
}

@media (max-width: 760px) {
  .voice-member {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 8px;
  }
  .voice-member-dm {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 11px !important;
    font-size: 13px !important;
  }

  /* DM should feel like a full screen section, not a small 2/3 panel */
  .voice-room-overlay.voice-tab-state-dm .voice-room-shell {
    width: 100vw !important;
    height: var(--voice-vh, 100dvh) !important;
    max-height: var(--voice-vh, 100dvh) !important;
    border-radius: 0 !important;
    border: 0 !important;
    margin: 0 !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-room-head {
    padding: 10px 12px !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-room-title strong {
    font-size: 18px !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-room-logo {
    width: 36px !important;
    height: 36px !important;
    border-radius: 14px !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-room-tabs {
    padding: 9px 10px !important;
    gap: 8px !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-room-layout {
    padding: 0 !important;
    gap: 0 !important;
    grid-template-rows: minmax(0, 1fr) !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-room-main {
    border-radius: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    background: rgba(8,9,22,.98) !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-room-panel-head {
    display: none !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-room-dm-panel {
    height: 100% !important;
    min-height: 0 !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-shell {
    height: 100% !important;
    min-height: 0 !important;
    display: block !important;
    position: relative !important;
    overflow: hidden !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-list-card,
  .voice-room-overlay.voice-tab-state-dm .voice-dm-chat-card {
    height: 100% !important;
    min-height: 0 !important;
    border-radius: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-list-card {
    display: flex !important;
    flex-direction: column !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-list {
    flex: 1 1 auto !important;
    display: grid !important;
    align-content: start !important;
    overflow-y: auto !important;
    padding: 12px !important;
    gap: 10px !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-user {
    min-height: 58px !important;
    border-radius: 18px !important;
    padding: 11px 12px !important;
    background: rgba(255,255,255,.055) !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-chat-card {
    display: none !important;
    grid-template-rows: auto auto minmax(0, 1fr) auto !important;
    background: rgba(8,9,22,.98) !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-shell.dm-chat-open .voice-dm-list-card {
    display: none !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-shell.dm-chat-open .voice-dm-chat-card {
    display: grid !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-chat-head {
    padding: 12px 12px 10px !important;
    background: linear-gradient(180deg, rgba(24,19,48,.98), rgba(13,13,30,.94));
    position: sticky;
    top: 0;
    z-index: 4;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-privacy-note {
    font-size: 10.5px !important;
    padding: 7px 12px !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-messages {
    padding: 12px 12px 8px !important;
    overflow-y: auto !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-send {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 6 !important;
    display: grid !important;
    grid-template-columns: auto auto minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 10px 10px max(10px, env(safe-area-inset-bottom)) !important;
    border-top: 1px solid rgba(255,255,255,.10) !important;
    background: linear-gradient(180deg, rgba(8,9,22,.90), rgba(8,9,22,1)) !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-send input {
    height: 42px !important;
    font-size: 16px !important;
    padding: 0 12px !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-send button[type="submit"] {
    height: 42px !important;
    min-width: 54px !important;
    padding: 0 12px !important;
    border-radius: 14px !important;
  }
}


/* v1.48 strict hidden-state fix: class display rules must not override the hidden attribute. */
.voice-room-chat[hidden],
.voice-room-send[hidden],
.voice-room-voice-panel[hidden],
.voice-room-dm-panel[hidden],
.voice-dm-send[hidden],
.voice-admin-dm-monitor[hidden] {
  display: none !important;
}

/* v1.48 cleaner mobile DM: avoid duplicate/stacked input rows and keep the chat full-screen inside Voice Room. */
@media (max-width: 760px) {
  .voice-tab-state-dm .voice-room-main {
    min-height: min(100dvh, calc(var(--voice-vh, 1vh) * 100));
  }
  .voice-tab-state-dm .voice-room-send {
    display: none !important;
  }
  .voice-tab-state-dm .voice-room-dm-panel:not([hidden]) {
    display: flex !important;
    min-height: 0;
    flex: 1 1 auto;
  }
  .voice-tab-state-dm .voice-dm-chat-card {
    min-height: 0;
  }
}

/* v1.49: DM as a true full-page section, not a 2/3 modal panel */
.voice-room-overlay.voice-tab-state-dm.open {
  align-items: stretch !important;
  justify-content: stretch !important;
  padding: 0 !important;
}
.voice-room-overlay.voice-tab-state-dm .voice-room-shell {
  width: 100vw !important;
  height: var(--voice-vh, 100dvh) !important;
  max-width: none !important;
  max-height: var(--voice-vh, 100dvh) !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: 0 !important;
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
}
.voice-room-overlay.voice-tab-state-dm .voice-room-layout {
  height: 100% !important;
  min-height: 0 !important;
  padding: 0 !important;
  gap: 0 !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: minmax(0, 1fr) !important;
}
.voice-room-overlay.voice-tab-state-dm .voice-room-side {
  display: none !important;
}
.voice-room-overlay.voice-tab-state-dm .voice-room-main {
  height: 100% !important;
  min-height: 0 !important;
  border-radius: 0 !important;
  border: 0 !important;
  background: rgba(8, 9, 22, .98) !important;
}
.voice-room-overlay.voice-tab-state-dm .voice-room-panel-head {
  display: none !important;
}
.voice-room-overlay.voice-tab-state-dm .voice-room-dm-panel:not([hidden]) {
  display: block !important;
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
}
.voice-room-overlay.voice-tab-state-dm .voice-dm-shell {
  height: 100% !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(280px, 34vw) minmax(0, 1fr) !important;
  gap: 0 !important;
  overflow: hidden !important;
  background: radial-gradient(circle at 85% 8%, rgba(168,85,247,.16), transparent 34%), rgba(7,8,20,.98) !important;
}
.voice-room-overlay.voice-tab-state-dm .voice-dm-list-card,
.voice-room-overlay.voice-tab-state-dm .voice-dm-chat-card {
  height: 100% !important;
  min-height: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-top: 0 !important;
  border-bottom: 0 !important;
}
.voice-room-overlay.voice-tab-state-dm .voice-dm-list-card {
  border-left: 0 !important;
  border-right: 1px solid rgba(255,255,255,.10) !important;
  display: flex !important;
  flex-direction: column !important;
}
.voice-room-overlay.voice-tab-state-dm .voice-dm-chat-card {
  border-left: 0 !important;
  border-right: 0 !important;
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) auto !important;
}
.voice-room-overlay.voice-tab-state-dm .voice-dm-list {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
}
.voice-room-overlay.voice-tab-state-dm .voice-dm-messages {
  min-height: 0 !important;
  overflow-y: auto !important;
}
.voice-room-overlay.voice-tab-state-dm .voice-dm-send {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 7 !important;
}

@media (max-width: 760px) {
  .voice-room-overlay.voice-tab-state-dm .voice-room-head {
    padding: 10px 12px !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-room-tabs {
    padding: 9px 10px !important;
    flex-shrink: 0 !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-shell {
    display: block !important;
    grid-template-columns: none !important;
    position: relative !important;
    height: 100% !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-list-card {
    display: flex !important;
    border-right: 0 !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-chat-card {
    display: none !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-shell.dm-chat-open .voice-dm-list-card {
    display: none !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-shell.dm-chat-open .voice-dm-chat-card {
    display: grid !important;
    height: 100% !important;
    grid-template-rows: auto auto minmax(0, 1fr) auto !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-head,
  .voice-room-overlay.voice-tab-state-dm .voice-dm-chat-head {
    padding: 12px !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-list {
    display: grid !important;
    gap: 10px !important;
    padding: 12px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-user {
    min-width: 0 !important;
    width: 100% !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-send {
    grid-template-columns: auto auto minmax(0, 1fr) auto !important;
    gap: 7px !important;
    padding: 10px 10px max(10px, env(safe-area-inset-bottom)) !important;
    background: linear-gradient(180deg, rgba(8,9,22,.90), rgba(8,9,22,1)) !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-send input {
    font-size: 16px !important;
    min-width: 0 !important;
  }
}

/* v1.50: DM is now a standalone screen, not inside Voice Room tabs */
.voice-room-overlay.voice-tab-state-dm .voice-room-head,
.voice-room-overlay.voice-tab-state-dm .voice-room-tabs,
.voice-room-overlay.voice-tab-state-dm .voice-room-panel-head {
  display: none !important;
}
.voice-room-overlay.voice-tab-state-dm .voice-room-shell {
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) !important;
  background: radial-gradient(circle at 82% 0%, rgba(168,85,247,.16), transparent 34%), rgba(7,8,20,.985) !important;
}
.voice-room-overlay.voice-tab-state-dm .voice-room-layout {
  min-height: 0 !important;
  height: 100% !important;
}
.voice-room-overlay.voice-tab-state-dm .voice-room-main {
  display: block !important;
  min-height: 0 !important;
}
.voice-dm-topbar {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
}
.voice-dm-chat-head.voice-dm-topbar {
  grid-template-columns: auto minmax(0,1fr) auto !important;
}
.voice-dm-close {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0,0,0,.22);
}
.voice-dm-close:hover,
.voice-dm-close:active {
  background: rgba(168,85,247,.22);
  transform: translateY(-1px);
}
.voice-room-overlay.voice-tab-state-dm .voice-dm-head strong,
.voice-room-overlay.voice-tab-state-dm .voice-dm-chat-head strong {
  font-size: 18px;
}
.voice-room-overlay.voice-tab-state-dm .voice-dm-head span,
.voice-room-overlay.voice-tab-state-dm .voice-dm-chat-head span {
  display: block;
  margin-top: 3px;
}
@media (max-width: 760px) {
  .voice-room-overlay.voice-tab-state-dm .voice-room-shell {
    width: 100vw !important;
    height: var(--voice-vh, 100dvh) !important;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-room-layout,
  .voice-room-overlay.voice-tab-state-dm .voice-room-main,
  .voice-room-overlay.voice-tab-state-dm .voice-room-dm-panel:not([hidden]),
  .voice-room-overlay.voice-tab-state-dm .voice-dm-shell {
    height: 100% !important;
    min-height: 0 !important;
  }
  .voice-dm-close {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    font-size: 20px;
  }
  .voice-room-overlay.voice-tab-state-dm .voice-dm-head,
  .voice-room-overlay.voice-tab-state-dm .voice-dm-chat-head {
    min-height: 58px;
    background: linear-gradient(180deg, rgba(20,18,42,.98), rgba(12,13,30,.96)) !important;
    border-bottom: 1px solid rgba(255,255,255,.10);
  }
}

/* v1.53 — compact Voice Room header/tabs + username shortcut */
.voice-room-head-actions{
  display:flex;
  align-items:center;
  gap:8px;
  margin-left:auto;
}
.voice-username-shortcut{
  border:1px solid rgba(196,147,255,.35);
  border-radius:999px;
  padding:8px 12px;
  background:linear-gradient(135deg,rgba(168,85,247,.72),rgba(59,130,246,.34));
  color:#fff;
  font-weight:950;
  font-size:12px;
  box-shadow:0 0 20px rgba(168,85,247,.28);
  cursor:pointer;
  white-space:nowrap;
}
.voice-username-shortcut[hidden]{display:none!important;}
@media (max-width:860px){
  .voice-room-head{
    padding:7px 10px!important;
    min-height:46px!important;
    gap:8px!important;
  }
  .voice-room-logo{
    width:30px!important;
    height:30px!important;
    border-radius:11px!important;
    font-size:15px!important;
  }
  .voice-room-title{gap:8px!important;}
  .voice-room-title strong{font-size:16px!important;line-height:1!important;}
  .voice-room-title span{display:none!important;}
  .voice-room-close{
    width:34px!important;
    height:34px!important;
    border-radius:13px!important;
    font-size:21px!important;
  }
  .voice-username-shortcut{
    padding:7px 10px!important;
    font-size:11px!important;
    max-width:112px;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .voice-room-tabs{
    padding:7px 9px!important;
    gap:7px!important;
    justify-content:center!important;
  }
  .voice-tab{
    flex:0 0 auto!important;
    min-width:54px!important;
    padding:8px 10px!important;
    border-radius:16px!important;
    font-size:0!important;
    line-height:1!important;
  }
  .voice-tab::first-letter{font-size:14px!important;}
  .voice-tab.active{transform:translateY(-1px);}
  .voice-tab[data-voice-tab="general"]::after{content:"Chat";font-size:11px;margin-left:4px;}
  .voice-tab[data-voice-tab="voice"]::after{content:"Voice";font-size:11px;margin-left:4px;}
  .voice-tab[data-voice-tab="dm"]::after{content:"DM";font-size:11px;margin-left:4px;}
  .voice-room-layout{padding-top:8px!important;}
}


/* Voice Room v1.54 — icon-only stacked tab buttons on mobile */
@media (max-width: 680px) {
  .voice-room-tabs{
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    justify-content:flex-start !important;
    gap:8px !important;
    padding:8px 10px !important;
  }

  .voice-tab{
    width:100% !important;
    min-width:0 !important;
    min-height:36px !important;
    padding:8px 12px !important;
    border-radius:15px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    font-size:0 !important;
    line-height:1 !important;
  }

  .voice-tab > span{
    font-size:16px !important;
    line-height:1 !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
  }

  .voice-tab[data-voice-tab="general"]::after,
  .voice-tab[data-voice-tab="voice"]::after,
  .voice-tab[data-voice-tab="dm"]::after{
    content:"" !important;
    display:none !important;
  }
}

/* Voice Room v1.55 — icon-only tabs in one left-to-right row on mobile */
@media (max-width: 680px) {
  .voice-room-tabs{
    display:grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    flex-direction: initial !important;
    align-items:center !important;
    justify-content:stretch !important;
    gap:8px !important;
    padding:8px 10px !important;
  }

  .voice-tab{
    width:100% !important;
    min-width:0 !important;
    min-height:38px !important;
    padding:8px 10px !important;
    border-radius:15px !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    font-size:0 !important;
    line-height:1 !important;
  }

  .voice-tab > span{
    font-size:17px !important;
    line-height:1 !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
  }

  .voice-tab[data-voice-tab="general"]::after,
  .voice-tab[data-voice-tab="voice"]::after,
  .voice-tab[data-voice-tab="dm"]::after{
    content:"" !important;
    display:none !important;
  }
}

/* Voice Room v1.56 - username required prompt */
.voice-username-required-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483642;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 4, 18, .68);
}
.voice-username-required-modal[hidden] { display: none !important; }
.voice-username-required-box {
  width: min(430px, 94vw);
  border-radius: 24px;
  border: 1px solid rgba(168, 85, 247, .42);
  background: linear-gradient(145deg, rgba(24, 16, 42, .98), rgba(12, 8, 24, .98));
  box-shadow: 0 28px 86px rgba(0,0,0,.62), 0 0 36px rgba(168,85,247,.26);
  padding: 18px;
  color: #fff;
}
.voice-username-required-box h3 {
  margin: 0 0 8px;
  font-size: 20px;
}
.voice-username-required-box p {
  margin: 0 0 16px;
  color: rgba(255,255,255,.76);
  line-height: 1.48;
  font-size: 14px;
}
.voice-username-required-box #voiceUsernameRequiredOpen {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: #fff;
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 12px 30px rgba(168,85,247,.25);
}
@media (max-width: 520px) {
  .voice-username-required-box { width: min(350px, 94vw); padding: 16px; }
  .voice-username-required-box h3 { font-size: 18px; }
  .voice-username-required-box p { font-size: 13px; }
}

/* Voice Room v1.60 - avatar + close centering polish */
.voice-avatar,
.voice-profile-avatar,
.room-user-avatar,
.voice-avatar-choice,
.study-avatar-choice,
.study-avatar-preview {
  display: inline-grid !important;
  place-items: center !important;
  text-align: center !important;
  line-height: 1 !important;
  vertical-align: middle !important;
  overflow: hidden !important;
}

.voice-avatar,
.voice-member .voice-avatar,
.voice-dm-user .voice-avatar {
  font-size: 14px !important;
  line-height: 1 !important;
}

.voice-profile-avatar {
  font-size: 26px !important;
  line-height: 1 !important;
}

.voice-mobile-side-head button,
#voiceMobileActivityClose,
.voice-room-close,
.voice-dm-close,
.voice-profile-close {
  display: inline-grid !important;
  place-items: center !important;
  text-align: center !important;
  line-height: 1 !important;
  padding: 0 !important;
}

#voiceMobileActivityClose {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  border-radius: 16px !important;
  font-size: 26px !important;
  font-weight: 800 !important;
}

.voice-mobile-side-head {
  align-items: center !important;
}

.voice-member .voice-avatar {
  margin: 0 !important;
}

/* Keep emoji/image avatars visually centered inside circular slots */
.voice-avatar img,
.voice-profile-avatar img,
.voice-avatar-choice img,
.study-avatar-choice img,
.study-avatar-preview img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
}

/* Voice Room v1.62 - restore mobile room panel centering + strict avatar/X centering */
@media (max-width: 860px) {
  .voice-room-side {
    left: 50% !important;
    right: auto !important;
    width: min(92vw, 340px) !important;
    max-width: 340px !important;
    border-radius: 26px !important;
    border: 1px solid rgba(255,255,255,.13) !important;
    transform: translate3d(120%,0,0) !important;
    box-shadow: 0 24px 70px rgba(0,0,0,.52), 0 0 0 1px rgba(168,85,247,.16) !important;
  }
  .voice-room-side.open,
  body.voice-mobile-panel-open .voice-room-side.open {
    transform: translate3d(-50%,0,0) !important;
  }
  .voice-room-side:not(.open) {
    transform: translate3d(120%,0,0) !important;
  }
  .voice-mobile-side-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 6px 6px 12px !important;
    order: 0 !important;
  }
}

.voice-room-close,
.voice-dm-close,
.voice-profile-close,
#voiceMobileActivityClose {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  text-align: center !important;
  line-height: 1 !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

.voice-avatar,
.voice-profile-avatar,
.voice-avatar-choice,
.study-avatar-choice,
.study-avatar-preview {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1 !important;
  padding: 0 !important;
}

.voice-member .voice-avatar,
.voice-dm-user .voice-avatar,
.voice-msg .voice-avatar {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}


/* v1.63 - DM about line */
.voice-dm-chat-head span.has-dm-about{
  color:rgba(226,232,255,.88)!important;
  font-weight:800;
  line-height:1.35;
  max-width:100%;
  white-space:normal;
}

/* Voice Room v1.66 - mobile tap/button reliability fixes */
.voice-room-side button,
.voice-room-side input,
.voice-room-side select,
.voice-room-side label,
.voice-profile-popup button,
.voice-profile-popup input {
  pointer-events: auto !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(168,85,247,.25);
}
@media (max-width: 860px) {
  .voice-room-side.open {
    z-index: 2147483100 !important;
  }
  .voice-mobile-panel-backdrop.open {
    z-index: 2147483090 !important;
  }
  .voice-profile-popup {
    z-index: 2147483200 !important;
  }
}


/* Voice Room v1.69 - make mobile Room Panel buttons truly tappable */
.voice-room-side,
.voice-room-side.open,
body.voice-mobile-panel-open .voice-room-side.open {
  pointer-events: auto !important;
}
.voice-room-side .voice-card,
.voice-room-side .voice-member,
.voice-room-side button,
.voice-room-side [data-dm-uid],
.voice-room-side [data-profile-uid] {
  pointer-events: auto !important;
  position: relative;
  z-index: 2;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: rgba(168,85,247,.25) !important;
}
.voice-mobile-panel-backdrop.open {
  pointer-events: auto !important;
}
@media (max-width: 860px) {
  .voice-room-side.open,
  body.voice-mobile-panel-open .voice-room-side.open {
    z-index: 2147483200 !important;
  }
  .voice-mobile-panel-backdrop.open {
    z-index: 2147483000 !important;
  }
}


/* Voice Room v1.70 - Room Panel clean action rebuild */
.voice-mobile-panel-backdrop,
.voice-mobile-panel-backdrop.open {
  pointer-events: none !important;
}
.voice-room-side,
.voice-room-side.open,
body.voice-mobile-panel-open .voice-room-side.open {
  pointer-events: auto !important;
  isolation: isolate;
}
.voice-room-side [data-room-action],
.voice-room-side button,
.voice-room-side .voice-member,
.voice-room-side .voice-member * {
  pointer-events: auto !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: rgba(168,85,247,.28) !important;
}
.voice-room-side [data-room-action] {
  cursor: pointer;
}
@media (max-width: 860px) {
  .voice-room-side.open,
  body.voice-mobile-panel-open .voice-room-side.open {
    z-index: 2147483300 !important;
  }
  .voice-mobile-panel-backdrop.open {
    z-index: 2147482500 !important;
  }
}

/* v1.72 - unread red dot indicators */
.voice-tab,
.voice-member-dm,
.voice-dm-user {
  position: relative;
}

.voice-unread-dot {
  display: none;
  position: absolute;
  top: 5px;
  right: 6px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #ff1744;
  border: 2px solid rgba(15, 8, 28, 0.95);
  box-shadow: 0 0 0 3px rgba(255, 23, 68, 0.16), 0 0 14px rgba(255, 23, 68, 0.8);
  pointer-events: none;
  z-index: 5;
}

.voice-tab.has-unread .voice-unread-dot,
.voice-member-dm.has-unread .voice-unread-dot,
.voice-dm-user.has-unread .voice-dm-list-dot {
  display: block;
}

.voice-member-dm .voice-unread-dot {
  top: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
}

.voice-dm-user .voice-dm-list-dot {
  top: 12px;
  right: 12px;
}

.voice-dm-user.has-unread {
  border-color: rgba(255, 23, 68, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(255, 23, 68, 0.15), 0 14px 30px rgba(255, 23, 68, 0.12);
}

@media (max-width: 560px) {
  .voice-unread-dot {
    top: 4px;
    right: 5px;
    width: 8px;
    height: 8px;
  }
}


/* Voice Room v1.80 - custom local avatars without D/S letter avatars */
.voice-avatar,
.voice-profile-avatar,
.study-avatar-preview,
.study-avatar-choice {
  overflow: hidden;
}
.voice-avatar-inner {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  overflow: hidden;
  line-height: 1;
}
.voice-avatar-image img,
.voice-profile-avatar .voice-avatar-image img,
.study-avatar-preview .voice-avatar-image img,
.study-avatar-choice .voice-avatar-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
  border-radius: inherit;
}
.voice-avatar-initials {
  font-weight: 900;
}

.study-avatar-choice {
  width: 72px !important;
  min-height: 92px !important;
  height: auto !important;
  border-radius: 20px !important;
  padding: 7px 6px !important;
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 5px !important;
}
.study-avatar-choice .voice-avatar-inner {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  min-height: 52px !important;
  border-radius: 999px !important;
}
.study-avatar-choice small {
  display: block;
  width: 100%;
  font-size: 10px;
  line-height: 1.1;
  opacity: .88;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.study-avatar-preview .voice-avatar-inner {
  width: 100% !important;
  height: 100% !important;
}


/* v1.98 - larger unread DM indicators + home DM alert */
.voice-unread-dot {
  width: 14px !important;
  height: 14px !important;
  top: 2px !important;
  right: 3px !important;
  border: 2px solid rgba(15, 8, 28, 0.98) !important;
  box-shadow: 0 0 0 4px rgba(255, 23, 68, 0.20), 0 0 20px rgba(255, 23, 68, 0.95) !important;
}
.voice-member-dm .voice-unread-dot {
  width: 13px !important;
  height: 13px !important;
  top: -5px !important;
  right: -5px !important;
}
.voice-dm-user .voice-dm-list-dot {
  width: 15px !important;
  height: 15px !important;
  top: 10px !important;
  right: 10px !important;
}
.study-bottom-nav button[data-k-nav="dm"],
.study-bottom-nav button.study-has-unread-dm {
  position: relative;
}
.study-bottom-nav button[data-k-nav="dm"].has-unread::after,
.study-bottom-nav button.study-has-unread-dm::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 14px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #ff1744;
  border: 2px solid rgba(12, 15, 32, .96);
  box-shadow: 0 0 0 5px rgba(255, 23, 68, .18), 0 0 22px rgba(255, 23, 68, .95);
  z-index: 6;
}
.study-bottom-nav button[data-k-nav="dm"].has-unread::before,
.study-bottom-nav button.study-has-unread-dm::before {
  content: "NEW";
  position: absolute;
  top: -8px;
  right: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff1744, #fb7185);
  color: #fff;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .04em;
  box-shadow: 0 8px 22px rgba(255, 23, 68, .35);
  z-index: 7;
}
#voiceProfileStatus:empty,
#voiceProfileStatus[hidden] {
  display: none !important;
}
@media (max-width: 560px) {
  .voice-unread-dot {
    width: 13px !important;
    height: 13px !important;
    top: 1px !important;
    right: 2px !important;
  }
  .study-bottom-nav button[data-k-nav="dm"].has-unread::after,
  .study-bottom-nav button.study-has-unread-dm::after {
    width: 15px;
    height: 15px;
    top: 3px;
    right: 12px;
  }
}


/* v2.03 - home Voice/Room unread alert for General Chat messages */
.study-bottom-nav button[data-k-nav="voice"],
.study-bottom-nav button.study-has-unread-room {
  position: relative;
}
.study-bottom-nav button[data-k-nav="voice"].has-unread::after,
.study-bottom-nav button.study-has-unread-room::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 14px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #ff1744;
  border: 2px solid rgba(12, 15, 32, .96);
  box-shadow: 0 0 0 5px rgba(255, 23, 68, .18), 0 0 22px rgba(255, 23, 68, .95);
  z-index: 6;
}
.study-bottom-nav button[data-k-nav="voice"].has-unread::before,
.study-bottom-nav button.study-has-unread-room::before {
  content: "NEW";
  position: absolute;
  top: -8px;
  right: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff1744, #fb7185);
  color: #fff;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .04em;
  box-shadow: 0 8px 22px rgba(255, 23, 68, .35);
  z-index: 7;
}
@media (max-width: 560px) {
  .study-bottom-nav button[data-k-nav="voice"].has-unread::after,
  .study-bottom-nav button.study-has-unread-room::after {
    width: 15px;
    height: 15px;
    top: 3px;
    right: 12px;
  }
}

/* v2.09: stronger automatic special DM avatar background for admin/personal DM.
   The image is fixed behind the whole DM chat card, so mobile scrolling no longer
   pushes the image upward or leaves a plain black lower area. */
.voice-dm-chat-card.voice-dm-special-bg {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 46, 79, .28), transparent 42%),
    linear-gradient(180deg, rgba(4, 2, 14, .90), rgba(5, 3, 18, .96));
}
.voice-dm-chat-card.voice-dm-special-bg::before {
  content: "";
  position: absolute;
  inset: -10px;
  z-index: 0;
  background-image: var(--voice-dm-special-bg);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(5px) saturate(1.22) contrast(1.05);
  transform: scale(1.03);
  opacity: .72;
  pointer-events: none;
}
.voice-dm-chat-card.voice-dm-special-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 72% 20%, rgba(255, 31, 61, .24), transparent 36%),
    radial-gradient(circle at 20% 76%, rgba(168, 85, 247, .22), transparent 44%),
    linear-gradient(180deg, rgba(0,0,0,.36), rgba(0,0,0,.52));
  pointer-events: none;
}
.voice-dm-chat-card.voice-dm-special-bg .voice-dm-chat-head,
.voice-dm-chat-card.voice-dm-special-bg .voice-dm-messages,
.voice-dm-chat-card.voice-dm-special-bg .voice-dm-send {
  position: relative;
  z-index: 1;
}
.voice-dm-chat-card.voice-dm-special-bg .voice-dm-chat-head {
  background: rgba(5, 6, 16, .52);
  backdrop-filter: blur(10px);
}
.voice-dm-chat-card.voice-dm-special-bg .voice-dm-messages {
  background: transparent !important;
}
.voice-dm-chat-card.voice-dm-special-bg .voice-dm-send {
  background: rgba(7, 8, 18, .76);
  backdrop-filter: blur(10px);
}
@media (max-width: 760px) {
  .voice-dm-chat-card.voice-dm-special-bg::before {
    inset: 0;
    filter: blur(3px) saturate(1.26) contrast(1.08);
    transform: scale(1.01);
    opacity: .78;
  }
  .voice-dm-chat-card.voice-dm-special-bg::after {
    background:
      radial-gradient(circle at 72% 20%, rgba(255, 31, 61, .24), transparent 36%),
      linear-gradient(180deg, rgba(0,0,0,.34), rgba(0,0,0,.56));
  }
}
