/* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #0a0a0a;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
}

/* ===== PAGE LAYOUT ===== */
.library-page {
  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ===== TOP BAR ===== */
.lib-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 30px;
  border-bottom: 1px solid rgba(176, 141, 87, 0.15);
  background-color: #0d0d0d;
  position: relative;
  z-index: 5;
}

.lib-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  letter-spacing: 0.2em;
  color: #e8ddc4;
}

.logo-img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(212, 175, 130, 0.5));
}

.lib-session-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.session-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: #e8ddc4;
  font-weight: 500;
}

.deco-line {
  width: 32px;
  height: 1px;
  background: linear-gradient(to right, transparent, #b08d57, transparent);
  box-shadow: 0 0 6px rgba(176, 141, 87, 0.7);
}

.deco-diamond {
  width: 5px;
  height: 5px;
  background-color: #b08d57;
  transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(176, 141, 87, 0.9);
}

.session-sub {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: #a89d84;
  margin-top: 4px;
}

.lib-status {
  display: flex;
  align-items: center;
  gap: 22px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #b8ae98;
  letter-spacing: 0.05em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #6fae7a;
  box-shadow: 0 0 8px rgba(111, 174, 122, 0.7);
}

.timer {
  font-family: 'Inter', monospace;
  color: #b08d57;
  letter-spacing: 0.1em;
}

/* ===== MAIN AREA ===== */
.lib-main {
  flex: 1;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* ===== LIBRARY BACKGROUND WORDS ===== */
.lib-bg-words {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.lib-bg-words span {
  position: absolute;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  color: rgba(200, 165, 110, 0.16);
  white-space: nowrap;
  bottom: 0;
  animation-name: libFloatUp;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.lib-bg-words span:nth-child(1)  { left: 5%;  font-size: 2.2rem; animation-duration: 22s; animation-delay: -2s; }
.lib-bg-words span:nth-child(2)  { left: 15%; font-size: 1.6rem; animation-duration: 26s; animation-delay: -8s; }
.lib-bg-words span:nth-child(3)  { left: 25%; font-size: 2.4rem; animation-duration: 20s; animation-delay: -14s; }
.lib-bg-words span:nth-child(4)  { left: 35%; font-size: 1.5rem; animation-duration: 24s; animation-delay: -5s; }
.lib-bg-words span:nth-child(5)  { left: 45%; font-size: 2rem;   animation-duration: 21s; animation-delay: -18s; }
.lib-bg-words span:nth-child(6)  { left: 55%; font-size: 1.7rem; animation-duration: 25s; animation-delay: -11s; }
.lib-bg-words span:nth-child(7)  { left: 63%; font-size: 1.4rem; animation-duration: 23s; animation-delay: -20s; }
.lib-bg-words span:nth-child(8)  { left: 70%; font-size: 2.1rem; animation-duration: 20s; animation-delay: -6s; }
.lib-bg-words span:nth-child(9)  { left: 78%; font-size: 1.6rem; animation-duration: 27s; animation-delay: -22s; }
.lib-bg-words span:nth-child(10) { left: 85%; font-size: 1.9rem; animation-duration: 22s; animation-delay: -9s; }
.lib-bg-words span:nth-child(11) { left: 90%; font-size: 1.4rem; animation-duration: 28s; animation-delay: -25s; }
.lib-bg-words span:nth-child(12) { left: 10%; font-size: 1.5rem; animation-duration: 24s; animation-delay: -16s; }
.lib-bg-words span:nth-child(13) { left: 50%; font-size: 1.7rem; animation-duration: 22s; animation-delay: -3s; }
.lib-bg-words span:nth-child(14) { left: 30%; font-size: 1.5rem; animation-duration: 29s; animation-delay: -19s; }
.lib-bg-words span:nth-child(15) { left: 92%; font-size: 1.6rem; animation-duration: 26s; animation-delay: -12s; }

@keyframes libFloatUp {
  0%   { transform: translateY(20vh); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-70vh); opacity: 0; }
}

/* ===== LIBRARY BACKGROUND DOODLES ===== */
.lib-bg-doodles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.lib-doodle {
  position: absolute;
  bottom: 0;
  color: rgba(200, 165, 110, 0.2);
  animation-name: libDoodleFloat;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.lib-doodle:nth-child(1) { width: 55px; left: 18%; animation-duration: 26s; animation-delay: -4s; }
.lib-doodle:nth-child(2) { width: 48px; left: 42%; animation-duration: 30s; animation-delay: -15s; }
.lib-doodle:nth-child(3) { width: 60px; left: 60%; animation-duration: 24s; animation-delay: -10s; }
.lib-doodle:nth-child(4) { width: 50px; left: 75%; animation-duration: 32s; animation-delay: -20s; }
.lib-doodle:nth-child(5) { width: 58px; left: 88%; animation-duration: 28s; animation-delay: -16s; }
.lib-doodle:nth-child(6) { width: 52px; left: 30%; animation-duration: 27s; animation-delay: -6s; }

@keyframes libDoodleFloat {
  0%   { transform: translateY(15vh) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-75vh) rotate(12deg); opacity: 0; }
}

/* ===== WAITING TEXT ===== */
.waiting-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.15rem;
  color: rgba(210, 198, 170, 0.5);
  letter-spacing: 0.05em;
  z-index: 0;
  pointer-events: none;
  animation: waitingPulse 3.5s ease-in-out infinite;
}

@keyframes waitingPulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.6; }
}

/* ===== VIDEO GRID ===== */
.video-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--tile-min, 240px), var(--tile-max, 320px)));
  gap: 18px;
  width: 100%;
  max-width: 1400px;
  justify-content: center;
}

.video-card {
  position: relative;
  aspect-ratio: 16 / 10;
  background-color: #111110;
  border: 1px solid rgba(176, 141, 87, 0.15);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
}

.video-card:hover {
  border-color: rgba(212, 172, 110, 0.5);
  box-shadow: 0 0 24px rgba(212, 172, 110, 0.15), 0 8px 24px rgba(0, 0, 0, 0.3);
  transform: translateY(-3px);
}

.local-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.local-video.hidden {
  display: none;
}

.video-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(176, 141, 87, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-initial {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  color: #b08d57;
}

.video-info {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 3;
}

.participant-name {
  font-size: 0.78rem;
  color: #d8cdb4;
  background: rgba(0, 0, 0, 0.45);
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 0.03em;
}

.mic-status {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b08d57;
}

.mic-status svg {
  width: 14px;
  height: 14px;
}

.mic-status.speaking {
  background: rgba(111, 174, 122, 0.5) !important;
  box-shadow: 0 0 14px rgba(111, 174, 122, 0.8);
  animation: micPulse 0.6s ease-in-out infinite alternate;
}

@keyframes micPulse {
  from { transform: scale(1); }
  to   { transform: scale(1.15); }
}

/* ===== BOTTOM CONTROLS ===== */
.lib-controls {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-top: 1px solid rgba(176, 141, 87, 0.15);
  background-color: #0d0d0d;
  position: relative;
  z-index: 5;
}

.control-wrapper {
  position: relative;
  display: flex;
}

.control-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: 1px solid rgba(200, 165, 110, 0.3);
  color: #cfc4a8;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.control-btn svg {
  width: 19px;
  height: 19px;
}

.btn-label {
  font-size: 0.65rem;
  letter-spacing: 0.05em;
}

.control-btn:hover {
  border-color: rgba(176, 141, 87, 0.6);
  color: #e8ddc4;
  background-color: rgba(176, 141, 87, 0.08);
}

.control-btn.active {
  background-color: rgba(176, 141, 87, 0.15);
  border-color: #b08d57;
  color: #e8ddc4;
}

.control-btn.hand-active {
  background-color: rgba(176, 141, 87, 0.2);
  border-color: #b08d57;
  color: #f3e0b8;
  animation: handPulse 1s ease-in-out infinite alternate;
}

@keyframes handPulse {
  from { box-shadow: 0 0 8px rgba(176, 141, 87, 0.4); }
  to   { box-shadow: 0 0 18px rgba(176, 141, 87, 0.85); }
}

.control-btn.pressed {
  animation: btnPress 0.35s ease;
}

@keyframes btnPress {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.86); box-shadow: 0 0 22px rgba(176, 141, 87, 0.75); }
  100% { transform: scale(1); }
}

/* Leave button */
.leave-btn {
  background-color: #c0392b;
  border-color: #ff5c42;
  color: #ffffff;
  animation: leaveGlow 1.6s ease-in-out infinite alternate;
}

@keyframes leaveGlow {
  from {
    box-shadow: 0 0 14px rgba(255, 60, 40, 0.6), 0 0 26px rgba(255, 60, 40, 0.35);
    background-color: #c0392b;
  }
  to {
    box-shadow: 0 0 26px rgba(255, 70, 45, 1), 0 0 50px rgba(255, 70, 45, 0.6);
    background-color: #e0422e;
  }
}

.leave-btn:hover {
  background-color: #ff4d34;
  border-color: #ff8066;
}

/* ===== POPUP ANIMATION ===== */
.btn-popup {
  position: absolute;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%) translateY(10px) scale(0.5);
  font-size: 1.9rem;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 14px rgba(224, 190, 130, 0.9));
  z-index: 10;
}

.btn-popup.show {
  animation: popupPlay 1.4s ease forwards;
}

@keyframes popupPlay {
  0%   { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.5); }
  20%  { opacity: 1; transform: translateX(-50%) translateY(-8px) scale(1.2); }
  35%  { transform: translateX(-50%) translateY(0px) scale(1); }
  80%  { opacity: 1; transform: translateX(-50%) translateY(-4px) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-26px) scale(0.85); }
}

/* ===== VIRTUAL BACKGROUND MENU ===== */
.bg-menu {
  position: absolute;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #141310;
  border: 1px solid rgba(176, 141, 87, 0.3);
  border-radius: 10px;
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
  z-index: 20;
}

.bg-menu.show {
  display: flex;
}

.bg-option {
  padding: 8px 12px;
  font-size: 0.78rem;
  color: #b8ae98;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  letter-spacing: 0.02em;
  transition: all 0.25s ease;
}

.bg-option:hover {
  background-color: rgba(176, 141, 87, 0.15);
  color: #e8ddc4;
}

.bg-option.selected {
  color: #b08d57;
  font-weight: 500;
}

.hidden-input {
  display: none;
}

.bg-upload-label {
  display: block;
  border-top: 1px solid rgba(176, 141, 87, 0.2);
  margin-top: 4px;
  padding-top: 10px;
}

/* ===== CHAT PANEL (Glassmorphism, floating rounded) ===== */
.chat-panel {
  position: fixed;
  top: 20px;
  bottom: 20px;
  right: -420px;
  width: 370px;
  max-width: 88vw;
  background: rgba(18, 16, 13, 0.4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(212, 172, 110, 0.45);
  border-radius: 26px;
  box-shadow:
    0 0 0 1px rgba(212, 172, 110, 0.12),
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(176, 141, 87, 0.12),
    inset 0 0 30px rgba(212, 172, 110, 0.04);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: right 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-panel::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(212, 172, 110, 0.18);
  border-radius: 20px;
  pointer-events: none;
}

.chat-panel.open {
  right: 24px;
}

.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid rgba(212, 172, 110, 0.2);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  color: #d4ac6e;
}

.chat-close-btn {
  background: transparent;
  border: none;
  color: #b8ae98;
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.chat-close-btn:hover {
  color: #e8ddc4;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-empty-state {
  margin: auto;
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.95rem;
  color: rgba(200, 190, 165, 0.4);
  padding: 0 20px;
}

.chat-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  line-height: 1.5;
  animation: chatMsgIn 0.4s ease;
}

@keyframes chatMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-message.own {
  align-self: flex-end;
  background: rgba(212, 172, 110, 0.12);
  border: 1px solid rgba(212, 172, 110, 0.4);
}

.chat-message.other {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-message .sender-name {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  opacity: 0.6;
}

.chat-message .msg-text {
  color: #f3e9d2;
  text-shadow: 0 0 10px rgba(224, 190, 130, 0.55), 0 0 20px rgba(212, 175, 130, 0.3);
}

.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 16px 18px;
  border-top: 1px solid rgba(212, 172, 110, 0.2);
  border-bottom-left-radius: 25px;
  border-bottom-right-radius: 25px;
  background: rgba(18, 16, 13, 0.3);
}

.chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 172, 110, 0.25);
  border-radius: 20px;
  padding: 10px 16px;
  color: #e8ddc4;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.3s ease;
}

.chat-input:focus {
  border-color: #d4ac6e;
}

.chat-input::placeholder {
  color: rgba(184, 174, 152, 0.4);
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(212, 172, 110, 0.15);
  border: 1px solid rgba(212, 172, 110, 0.4);
  color: #d4ac6e;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.chat-send-btn:hover {
  background-color: #d4ac6e;
  color: #0a0a0a;
  box-shadow: 0 0 16px rgba(212, 172, 110, 0.6);
}

/* ===== FLOATING CHAT NOTIFICATION BUBBLE ===== */
.chat-bubble-notification {
  position: fixed;
  top: 90px;
  right: 30px;
  max-width: 260px;
  background: rgba(15, 14, 12, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 172, 110, 0.4);
  border-radius: 14px;
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: #f3e9d2;
  text-shadow: 0 0 10px rgba(224, 190, 130, 0.5);
  z-index: 60;
  opacity: 0;
  transform: translateY(-10px) scale(0.9);
  pointer-events: none;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.chat-bubble-notification.show {
  animation: bubblePop 2.2s ease forwards;
}

@keyframes bubblePop {
  0%   { opacity: 0; transform: translateY(-10px) scale(0.9); }
  15%  { opacity: 1; transform: translateY(0) scale(1); }
  80%  { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-6px) scale(0.95); }
}

/* ===== NAME NOTIFICATION BANNER ===== */
.name-notification {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(18, 16, 13, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(212, 172, 110, 0.5);
  border-radius: 30px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(212, 172, 110, 0.2);
}

.name-notification.show {
  animation: notifSlide 3s ease forwards;
}

@keyframes notifSlide {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  12%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  85%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-14px); }
}

.notif-name {
  color: #f3e9d2;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(224, 190, 130, 0.6);
}

.notif-action {
  color: #b8ae98;
}

/* ===== PEOPLE MODAL (Center, Glass, Butter-smooth) ===== */
.people-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.people-modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.people-modal {
  width: 420px;
  max-width: 88vw;
  max-height: 72vh;
  background: rgba(20, 18, 14, 0.45);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(212, 172, 110, 0.4);
  border-radius: 28px;
  box-shadow:
    0 0 0 1px rgba(212, 172, 110, 0.12),
    0 30px 80px rgba(0, 0, 0, 0.65),
    0 0 50px rgba(176, 141, 87, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

.people-modal-overlay.show .people-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.people-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(212, 172, 110, 0.2);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  color: #d4ac6e;
}

.people-modal-close {
  background: transparent;
  border: none;
  color: #b8ae98;
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.people-modal-close:hover {
  color: #e8ddc4;
}

.people-modal-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.people-modal-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(212, 172, 110, 0.14);
  transition: all 0.3s ease;
}

.people-modal-item:hover {
  background: rgba(212, 172, 110, 0.07);
  border-color: rgba(212, 172, 110, 0.35);
}

.people-modal-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(212, 172, 110, 0.15);
  border: 1px solid rgba(212, 172, 110, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  color: #d4ac6e;
  flex-shrink: 0;
  overflow: hidden;
}

.people-modal-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.people-modal-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.people-modal-name {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #e8ddc4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.people-modal-status {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  color: #6fae7a;
  margin-top: 2px;
}

.people-modal-icons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.people-modal-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  color: #6b6354;
}

.people-modal-icon.on {
  background: rgba(212, 172, 110, 0.18);
  color: #d4ac6e;
}

.people-modal-icon svg {
  width: 13px;
  height: 13px;
}

.people-modal-hint {
  padding: 16px 22px 22px;
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.8rem;
  color: rgba(200, 190, 165, 0.4);
  border-top: 1px solid rgba(212, 172, 110, 0.12);
}

/* ===== STUDY MATERIAL MODAL ===== */
.study-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.study-modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.study-modal {
  width: 440px;
  max-width: 90vw;
  max-height: 74vh;
  background: rgba(20, 18, 14, 0.45);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(212, 172, 110, 0.4);
  border-radius: 28px;
  box-shadow:
    0 0 0 1px rgba(212, 172, 110, 0.12),
    0 30px 80px rgba(0, 0, 0, 0.65),
    0 0 50px rgba(176, 141, 87, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

.study-modal-overlay.show .study-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.study-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid rgba(212, 172, 110, 0.2);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: #d4ac6e;
}

.study-back-btn,
.study-modal-close {
  background: transparent;
  border: none;
  color: #b8ae98;
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.study-back-btn:hover,
.study-modal-close:hover {
  color: #e8ddc4;
}

.study-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.study-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(212, 172, 110, 0.16);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  color: #e8ddc4;
}

.study-option:hover {
  background: rgba(212, 172, 110, 0.09);
  border-color: rgba(212, 172, 110, 0.4);
  transform: translateX(4px);
}

.study-option .arrow {
  color: #d4ac6e;
  font-size: 0.9rem;
}

.study-coming-soon {
  text-align: center;
  padding: 50px 20px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.15rem;
  color: rgba(212, 172, 110, 0.7);
}

.study-coming-soon .sub {
  display: block;
  margin-top: 10px;
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: #8f846f;
}

/* ===== AMBIENT SOUNDS MODAL ===== */
.ambient-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.ambient-modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.ambient-modal {
  width: 400px;
  max-width: 90vw;
  max-height: 78vh;
  background: rgba(20, 18, 14, 0.45);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(212, 172, 110, 0.4);
  border-radius: 28px;
  box-shadow:
    0 0 0 1px rgba(212, 172, 110, 0.12),
    0 30px 80px rgba(0, 0, 0, 0.65),
    0 0 50px rgba(176, 141, 87, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

.ambient-modal-overlay.show .ambient-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.ambient-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid rgba(212, 172, 110, 0.2);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: #d4ac6e;
}

.ambient-modal-close {
  background: transparent;
  border: none;
  color: #b8ae98;
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.ambient-modal-close:hover {
  color: #e8ddc4;
}

.ambient-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.ambient-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(212, 172, 110, 0.14);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.ambient-option:hover {
  background: rgba(212, 172, 110, 0.07);
  border-color: rgba(212, 172, 110, 0.35);
}

.ambient-option.active {
  background: rgba(212, 172, 110, 0.14);
  border-color: #d4ac6e;
  box-shadow: 0 0 16px rgba(212, 172, 110, 0.2);
}

.ambient-icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  color: #d4ac6e;
}

.ambient-name {
  flex: 1;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: #e8ddc4;
}

.ambient-check {
  font-size: 0.85rem;
  color: #d4ac6e;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ambient-option.active .ambient-check {
  opacity: 1;
}

.ambient-check.external {
  opacity: 0.5;
}

.ambient-divider {
  height: 1px;
  background: rgba(212, 172, 110, 0.15);
  margin: 6px 4px;
}

.ambient-spotify .ambient-icon {
  color: #1db954;
}

/* ===== RESPONSIVE (tablet) ===== */
@media (max-width: 768px) {
  .lib-topbar {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .session-name {
    font-size: 0.7rem;
  }

  .deco-line {
    width: 18px;
  }

  .lib-status {
    gap: 14px;
  }

  .status-item {
    font-size: 0.68rem;
  }

  .btn-popup {
    bottom: 60px;
    font-size: 1.5rem;
  }
}

/* ============================================
   MOBILE RESPONSIVE FIX (360px - 430px)
   Desktop untouched — only applies below 480px
   ============================================ */
@media (max-width: 480px) {

  html, body {
    overflow-x: hidden;
    width: 100%;
  }

  .library-page {
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .lib-topbar {
    padding: 10px 12px;
    gap: 6px;
  }

  .lib-brand span {
    font-size: 0.85rem;
  }

  .logo-img {
    width: 24px;
    height: 24px;
  }

  .session-name {
    font-size: 0.6rem;
    gap: 5px;
  }

  .deco-line {
    display: none;
  }

  .session-sub {
    font-size: 0.52rem;
    letter-spacing: 0.12em;
  }

  .lib-status {
    gap: 8px;
  }

  .status-item {
    font-size: 0.6rem;
    gap: 4px;
  }

  .lib-bg-words span {
    font-size: 1.1rem !important;
  }

  .lib-doodle {
    width: 34px !important;
  }

  .waiting-text {
    font-size: 0.85rem;
    padding: 0 20px;
    text-align: center;
  }

  .lib-main {
    padding: 14px;
  }

  .video-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .video-card {
    max-width: 100%;
  }

  .lib-controls {
    padding: 12px 8px;
    gap: 6px;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .control-btn {
    padding: 9px 11px;
    border-radius: 10px;
    gap: 3px;
  }

  .control-btn svg {
    width: 16px;
    height: 16px;
  }

  .btn-label {
    display: none;
  }

  .leave-btn {
    padding: 9px 12px;
  }

  .btn-popup {
    bottom: 56px;
    font-size: 1.3rem;
  }

  .chat-panel,
  .people-modal,
  .study-modal,
  .ambient-modal {
    max-height: 80vh;
  }

  .bg-menu {
    bottom: 60px;
  }
}

@media (max-width: 375px) {
  .control-btn {
    padding: 8px 9px;
  }

  .lib-controls {
    gap: 5px;
  }

  .session-name {
    font-size: 0.55rem;
  }
}
/* ===== SESSION STATS MINI-BAR ===== */
.session-stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 20px;
  background: rgba(212, 172, 110, 0.05);
  border-bottom: 1px solid rgba(176, 141, 87, 0.1);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  color: #a89d84;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 4;
}

.session-stats-bar strong {
  color: #d4ac6e;
  font-weight: 600;
}

.stats-icon {
  font-size: 0.8rem;
}

.stats-divider {
  color: #4a4438;
}

@media (max-width: 480px) {
  .session-stats-bar {
    font-size: 0.62rem;
    padding: 6px 14px;
    gap: 7px;
  }
}
/* ===== ENTRANCE ANIMATION ===== */
.lib-fade-item {
  opacity: 0;
  transform: translateY(18px);
  animation: libFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.lib-topbar.lib-fade-item { animation-delay: 0.1s; }
.session-stats-bar.lib-fade-item { animation-delay: 0.25s; }
.video-grid.lib-fade-item { animation-delay: 0.4s; }
.lib-controls.lib-fade-item { animation-delay: 0.55s; }

@keyframes libFadeIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* ===== EMPTY SEATS (waiting for others) ===== */
.empty-seat {
  aspect-ratio: 16 / 10;
  border: 1.5px dashed rgba(176, 141, 87, 0.18);
  border-radius: 10px;
  position: relative;
}

.empty-seat::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px dashed rgba(176, 141, 87, 0.15);
}

@media (max-width: 700px) {
  .empty-seat {
    display: none;
  }
}
/* ===== MILESTONE / BREAK REMINDER POPUP ===== */
.milestone-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  background: rgba(20, 18, 14, 0.6);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  border: 1px solid rgba(212, 172, 110, 0.5);
  border-radius: 24px;
  padding: 28px 40px;
  display: flex;
  align-items: center;
  gap: 18px;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6), 0 0 45px rgba(176, 141, 87, 0.25);
  max-width: 90vw;
}

.milestone-popup.show {
  animation: milestonePop 4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes milestonePop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
  12%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  88%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
}

.milestone-icon {
  font-size: 2.4rem;
  flex-shrink: 0;
  filter: drop-shadow(0 0 14px rgba(224, 190, 130, 0.6));
}

.milestone-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.milestone-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  color: #f3e9d2;
  text-shadow: 0 0 14px rgba(224, 190, 130, 0.5);
}

.milestone-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: #a89d84;
}

@media (max-width: 480px) {
  .milestone-popup {
    padding: 20px 26px;
    gap: 12px;
  }

  .milestone-icon {
    font-size: 1.8rem;
  }

  .milestone-title {
    font-size: 1.05rem;
  }

  .milestone-sub {
    font-size: 0.7rem;
  }
}
/* ===== CUSTOM SESSION NAME (editable) ===== */
.session-name {
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.session-name:hover {
  opacity: 0.75;
}

#session-name-text {
  min-width: 60px;
  display: inline-block;
}
/* ===== FOCUS MODE (DND) ===== */
.control-btn.focus-active {
  background-color: rgba(212, 172, 110, 0.25);
  border-color: #d4ac6e;
  color: #f3e0b8;
  animation: focusPulse 2s ease-in-out infinite alternate;
}

@keyframes focusPulse {
  from { box-shadow: 0 0 10px rgba(212, 172, 110, 0.4); }
  to   { box-shadow: 0 0 22px rgba(212, 172, 110, 0.8); }
}

.focus-mode-banner {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(20, 18, 14, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 172, 110, 0.5);
  border-radius: 20px;
  padding: 8px 22px;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #f3e0b8;
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 172, 110, 0.2);
}

.focus-mode-banner.show {
  animation: focusBannerPop 6s ease forwards;
}

@keyframes focusBannerPop {
  0%   { opacity: 0; transform: translateX(-50%) translateY(10px); }
  10%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  85%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}

/* Dim disabled controls in focus mode */
.control-btn.focus-disabled {
  opacity: 0.3;
  pointer-events: none;
}
/* ===== REDUCE MOTION MODE ===== */
body.reduce-motion * {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
/* ===== SIDE TAB BUBBLES (half-circle, docked to edge) ===== */
.side-bubble {
  position: fixed;
  right: -34px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(18, 16, 13, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 172, 110, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 42;
  transition: right 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.side-bubble.touched {
  right: 6px;
  box-shadow: 0 0 30px rgba(212, 172, 110, 0.7), 0 0 60px rgba(212, 172, 110, 0.3);
}

.side-bubble:hover {
  right: 6px;
  box-shadow: 0 0 30px rgba(212, 172, 110, 0.7);
}

.report-bubble {
  top: 42%;
}

.leaderboard-bubble {
  top: calc(42% + 82px);
}

/* Curved text around the left half of the circle (ADMIN) */
.bubble-curve-text {
  position: absolute;
  width: 100%;
  height: 100%;
}

.bubble-curve-text svg {
  width: 100%;
  height: 100%;
}

.bubble-curve-text text {
  font-family: 'Inter', sans-serif;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 1.5px;
  fill: #d4ac6e;
}

.leaderboard-bubble .bubble-emoji {
  font-size: 1.5rem;
  margin-left: -10px;
}

@media (max-width: 480px) {
  .side-bubble {
    width: 54px;
    height: 54px;
    right: -26px;
  }

  .side-bubble.touched,
  .side-bubble:hover {
    right: 4px;
  }

  .bubble-curve-text text {
    font-size: 6.5px;
  }

  .leaderboard-bubble .bubble-emoji {
    font-size: 1.2rem;
  }
}
/* ===== REPORT MODAL ===== */
.report-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  padding: 20px;
}

.report-modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.report-modal {
  position: relative;
  width: 400px;
  max-width: 100%;
  background: rgba(20, 18, 14, 0.55);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  border: 1px solid rgba(212, 172, 110, 0.4);
  border-radius: 24px;
  padding: 34px 30px;
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
}

.report-modal-overlay.show .report-modal {
  transform: scale(1);
}

.report-modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: transparent;
  border: none;
  color: #b8ae98;
  font-size: 1rem;
  cursor: pointer;
}

.report-modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  color: #e8ddc4;
  margin-bottom: 8px;
}

.report-modal-sub {
  font-size: 0.78rem;
  color: #8f846f;
  margin-bottom: 18px;
  line-height: 1.5;
}

.report-textarea {
  width: 100%;
  min-height: 110px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 172, 110, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  color: #e8ddc4;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  resize: vertical;
  outline: none;
  margin-bottom: 16px;
}

.report-textarea:focus {
  border-color: #d4ac6e;
}

.report-send-btn {
  display: block;
  text-align: center;
  background: transparent;
  border: 1px solid #b08d57;
  color: #e8ddc4;
  padding: 11px;
  border-radius: 10px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
}

.report-send-btn:hover {
  background-color: #b08d57;
  color: #0a0a0a;
}

/* ===== LEADERBOARD MODAL ===== */
.leaderboard-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  padding: 20px;
}

.leaderboard-modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.leaderboard-modal {
  position: relative;
  width: 420px;
  max-width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  background: rgba(20, 18, 14, 0.55);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  border: 1px solid rgba(212, 172, 110, 0.4);
  border-radius: 24px;
  padding: 30px 26px;
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
}

.leaderboard-modal-overlay.show .leaderboard-modal {
  transform: scale(1);
}

.leaderboard-modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: transparent;
  border: none;
  color: #b8ae98;
  font-size: 1rem;
  cursor: pointer;
}

.leaderboard-modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  color: #e8ddc4;
  text-align: center;
  margin-bottom: 20px;
}

.leaderboard-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: 12px;
}

.lb-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: #8f846f;
  padding: 8px;
  border-radius: 9px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lb-tab.active {
  background: rgba(212, 172, 110, 0.2);
  color: #f3e0b8;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.lb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(212, 172, 110, 0.12);
}

.lb-item.you {
  background: rgba(212, 172, 110, 0.15);
  border-color: #d4ac6e;
  box-shadow: 0 0 16px rgba(212, 172, 110, 0.2);
}

.lb-rank {
  width: 24px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  color: #d4ac6e;
  text-align: center;
  flex-shrink: 0;
}

.lb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(212, 172, 110, 0.15);
  border: 1px solid rgba(212, 172, 110, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.9rem;
  color: #d4ac6e;
  flex-shrink: 0;
  overflow: hidden;
}

.lb-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lb-name {
  flex: 1;
  font-size: 0.82rem;
  color: #e8ddc4;
}

.lb-hours {
  font-size: 0.78rem;
  color: #d4ac6e;
  font-weight: 500;
}

.leaderboard-quote {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.85rem;
  color: rgba(200, 190, 165, 0.6);
  padding-top: 14px;
  border-top: 1px solid rgba(212, 172, 110, 0.15);
}
/* ===== HIDE SCROLLBARS ===== */
.library-page,
.chat-messages,
.people-modal-list,
.study-modal-body,
.ambient-modal-body,
.leaderboard-modal {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.library-page::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.people-modal-list::-webkit-scrollbar,
.study-modal-body::-webkit-scrollbar,
.ambient-modal-body::-webkit-scrollbar,
.leaderboard-modal::-webkit-scrollbar {
  display: none;
}
/* ===== NETWORK SPEED SIGNAL INDICATOR ===== */
.net-signal {
  width: 16px;
  height: 12px;
  flex-shrink: 0;
}

.net-bar {
  fill: rgba(255, 255, 255, 0.15);
  transition: fill 0.4s ease;
}

/* GREEN — good connection */
.net-signal.net-good .net-bar {
  fill: #6fae7a;
  filter: drop-shadow(0 0 3px rgba(111, 174, 122, 0.8));
}

/* YELLOW — medium connection */
.net-signal.net-medium .net-bar-1,
.net-signal.net-medium .net-bar-2 {
  fill: #e0b34d;
  filter: drop-shadow(0 0 3px rgba(224, 179, 77, 0.8));
}

/* RED — poor connection */
.net-signal.net-poor .net-bar-1 {
  fill: #e05a48;
  filter: drop-shadow(0 0 3px rgba(224, 90, 72, 0.8));
}

.tile-net-signal {
  margin-right: 4px;
}
/* =====================================================
   STUDY TIMER
   ===================================================== */

/* ---- Topbar capsule button ---- */
.timer-open-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 18px;
  background: rgba(212, 172, 110, 0.06);
  border: 1px solid rgba(212, 172, 110, 0.6);
  border-radius: 999px;
  color: #e8ddc4;
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(212, 172, 110, 0.18), inset 0 0 8px rgba(212, 172, 110, 0.06);
  transition: all 0.35s ease;
}

/* outer second border line */
.timer-open-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 1px solid rgba(212, 172, 110, 0.22);
  pointer-events: none;
  transition: all 0.35s ease;
}

.timer-open-btn svg {
  width: 14px;
  height: 14px;
  color: #d4ac6e;
}

.timer-btn-diamond {
  width: 4px;
  height: 4px;
  background: #b08d57;
  transform: rotate(45deg);
  box-shadow: 0 0 6px rgba(176, 141, 87, 0.9);
  flex-shrink: 0;
}

.timer-open-btn:hover,
.timer-open-btn.active {
  border-color: #d4ac6e;
  background: rgba(212, 172, 110, 0.14);
  color: #f3e0b8;
  box-shadow: 0 0 20px rgba(212, 172, 110, 0.55), 0 0 40px rgba(212, 172, 110, 0.22), inset 0 0 12px rgba(212, 172, 110, 0.12);
}

.timer-open-btn:hover::before,
.timer-open-btn.active::before {
  inset: -6px;
  border-color: rgba(212, 172, 110, 0.5);
}

/* jab timer chal raha ho to button halka glow karta rahe */
.timer-open-btn.has-timer {
  animation: timerBtnPulse 2.2s ease-in-out infinite alternate;
}

@keyframes timerBtnPulse {
  from { box-shadow: 0 0 10px rgba(212, 172, 110, 0.35), inset 0 0 8px rgba(212, 172, 110, 0.08); }
  to   { box-shadow: 0 0 22px rgba(212, 172, 110, 0.75), inset 0 0 12px rgba(212, 172, 110, 0.15); }
}

/* ---- Modal ---- */
.timer-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.timer-modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.timer-modal {
  position: relative;
  width: 400px;
  max-width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(20, 18, 14, 0.5);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(212, 172, 110, 0.6);
  border-radius: 28px;
  box-shadow: 0 0 0 1px rgba(212, 172, 110, 0.15), 0 30px 80px rgba(0, 0, 0, 0.65), 0 0 30px rgba(212, 172, 110, 0.3);
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

/* inner thin border line */
.timer-modal::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(212, 172, 110, 0.18);
  border-radius: 22px;
  pointer-events: none;
}

.timer-modal-overlay.show .timer-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
  animation: timerBorderGlow 2.6s ease-in-out infinite alternate;
}

@keyframes timerBorderGlow {
  from { box-shadow: 0 0 0 1px rgba(212, 172, 110, 0.15), 0 30px 80px rgba(0, 0, 0, 0.65), 0 0 22px rgba(212, 172, 110, 0.25); }
  to   { box-shadow: 0 0 0 1px rgba(212, 172, 110, 0.35), 0 30px 80px rgba(0, 0, 0, 0.65), 0 0 55px rgba(212, 172, 110, 0.6); }
}

.timer-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(212, 172, 110, 0.2);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  color: #d4ac6e;
}

.timer-back-btn,
.timer-modal-close {
  background: transparent;
  border: none;
  color: #b8ae98;
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.timer-back-btn:hover,
.timer-modal-close:hover {
  color: #e8ddc4;
}

.timer-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.timer-modal-body::-webkit-scrollbar {
  display: none;
}

.timer-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---- View 1: choose ---- */
.timer-choose-sub {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1rem;
  color: rgba(200, 190, 165, 0.6);
  margin-bottom: 4px;
}

.timer-role-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(212, 172, 110, 0.2);
  color: #e8ddc4;
  font-family: 'Inter', sans-serif;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
}

.timer-role-btn:hover {
  background: rgba(212, 172, 110, 0.09);
  border-color: rgba(212, 172, 110, 0.55);
  transform: translateX(4px);
  box-shadow: 0 0 18px rgba(212, 172, 110, 0.15);
}

.timer-role-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(212, 172, 110, 0.4);
  background: rgba(212, 172, 110, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d4ac6e;
  flex-shrink: 0;
}

.timer-role-icon svg {
  width: 20px;
  height: 20px;
}

.timer-role-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.timer-role-text strong {
  font-size: 0.9rem;
  font-weight: 500;
}

.timer-role-text small {
  font-size: 0.7rem;
  color: #8f846f;
}

.timer-admin-msg {
  display: none;
  text-align: center;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(224, 90, 70, 0.08);
  border: 1px solid rgba(224, 90, 70, 0.4);
  color: #ffb4a4;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  line-height: 1.6;
}

.timer-admin-msg.show {
  display: block;
  animation: timerShake 0.5s ease;
}

@keyframes timerShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ---- View 2: clock dial ---- */
.timer-dial {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 4px auto 6px;
}

.timer-dial svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.timer-ring-outer {
  fill: rgba(212, 172, 110, 0.03);
  stroke: rgba(212, 172, 110, 0.55);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 6px rgba(212, 172, 110, 0.35));
}

.timer-ring-inner {
  fill: none;
  stroke: rgba(212, 172, 110, 0.2);
  stroke-width: 1;
  stroke-dasharray: 2 5;
}

.timer-tick {
  stroke: rgba(212, 172, 110, 0.35);
  stroke-width: 1;
}

.timer-tick.major {
  stroke: #d4ac6e;
  stroke-width: 1.6;
}

.timer-orbit {
  transform-box: view-box;
  transform-origin: 110px 110px;
  animation: timerOrbit 12s linear infinite;
}

.timer-orbit-dot {
  fill: #f3e0b8;
  filter: drop-shadow(0 0 5px rgba(243, 224, 184, 0.95));
}

@keyframes timerOrbit {
  to { transform: rotate(360deg); }
}

.timer-dial-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.timer-inputs-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.timer-input {
  width: 46px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(212, 172, 110, 0.3);
  text-align: center;
  color: #f3e9d2;
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 500;
  padding: 0 0 2px;
  outline: none;
  text-shadow: 0 0 12px rgba(224, 190, 130, 0.5);
  transition: border-color 0.3s ease;
}

.timer-input:focus {
  border-bottom-color: #d4ac6e;
}

.timer-colon {
  width: 10px;
  text-align: center;
  color: #d4ac6e;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  padding-bottom: 4px;
}

.timer-input-labels {
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: 'Inter', sans-serif;
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  color: #8f846f;
}

.timer-input-labels span { width: 46px; text-align: center; }
.timer-input-labels i { width: 10px; }

.timer-presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.timer-preset {
  background: transparent;
  border: 1px solid rgba(212, 172, 110, 0.3);
  color: #cfc4a8;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.timer-preset:hover {
  border-color: #d4ac6e;
  background: rgba(212, 172, 110, 0.12);
  color: #f3e0b8;
  box-shadow: 0 0 14px rgba(212, 172, 110, 0.25);
}

.timer-set-error {
  min-height: 14px;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  color: #ff8066;
}

.timer-set-btn {
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  background: rgba(212, 172, 110, 0.14);
  border: 1px solid #b08d57;
  color: #f3e0b8;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.timer-set-btn:hover {
  background: #b08d57;
  color: #0a0a0a;
  box-shadow: 0 0 24px rgba(176, 141, 87, 0.55);
}

/* ---- Running timer capsule (below Today/Streak bar) ---- */
.timer-run-row {
  display: none;
  justify-content: center;
  padding: 12px 0 4px;
  position: relative;
  z-index: 4;
}

.timer-run-row.show {
  display: flex;
  animation: timerRowIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes timerRowIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.timer-run-capsule {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 10px 7px 20px;
  border-radius: 999px;
  background: rgba(20, 18, 14, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 172, 110, 0.55);
  box-shadow: 0 0 18px rgba(212, 172, 110, 0.25), inset 0 0 12px rgba(212, 172, 110, 0.06);
}

/* dashed outer "cloud" ring */
.timer-run-capsule::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 999px;
  border: 1px dashed rgba(212, 172, 110, 0.28);
  pointer-events: none;
}

.timer-run-icon {
  width: 16px;
  height: 16px;
  color: #d4ac6e;
}

.timer-run-diamond {
  width: 4px;
  height: 4px;
  background: #b08d57;
  transform: rotate(45deg);
  box-shadow: 0 0 6px rgba(176, 141, 87, 0.9);
  flex-shrink: 0;
}

.timer-run-time {
  min-width: 92px;
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #f3e9d2;
  text-shadow: 0 0 14px rgba(224, 190, 130, 0.55);
  font-variant-numeric: tabular-nums;
}

.timer-stop-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #c0392b;
  border: 1px solid #ff5c42;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 60, 40, 0.55);
  transition: all 0.3s ease;
  padding: 0;
}

.timer-stop-btn:hover {
  background: #ff4d34;
  box-shadow: 0 0 18px rgba(255, 70, 45, 0.95);
}

.timer-stop-square {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: #fff;
}

/* alarm baj raha hai */
.timer-run-capsule.ringing {
  border-color: #ff5c42;
  animation: timerRingPulse 0.7s ease-in-out infinite alternate;
}

.timer-run-capsule.ringing .timer-run-time {
  color: #ffb4a4;
  text-shadow: 0 0 14px rgba(255, 90, 60, 0.7);
  animation: timerBlink 1s steps(2) infinite;
}

.timer-run-capsule.ringing .timer-stop-btn {
  animation: timerStopPulse 0.6s ease-in-out infinite alternate;
}

@keyframes timerRingPulse {
  from { box-shadow: 0 0 12px rgba(255, 80, 50, 0.4); }
  to   { box-shadow: 0 0 30px rgba(255, 80, 50, 0.9); }
}

@keyframes timerBlink {
  50% { opacity: 0.35; }
}

@keyframes timerStopPulse {
  from { transform: scale(1); }
  to   { transform: scale(1.18); }
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
  .timer-open-btn {
    padding: 5px 12px;
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    gap: 6px;
  }
  .timer-open-btn::before { inset: -3px; }
  .timer-btn-diamond { display: none; }
  .timer-run-time { font-size: 1.1rem; min-width: 80px; }
  .timer-modal-body { padding: 18px; }
}
/* =====================================================
   TIMER UPDATE v2
   (paste at the very bottom of library.css)
   ===================================================== */

/* ---- 1) Topbar: title hamesha true center mein ---- */
.lib-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
}
.lib-brand        { justify-self: start; }
.lib-session-info { justify-self: center; }
.lib-status       { justify-self: end; }

/* ---- 2) TIMER button thoda chhota ---- */
.timer-open-btn {
  padding: 5px 14px;
  gap: 7px;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
}
.timer-open-btn svg { width: 13px; height: 13px; }
.timer-open-btn::before { inset: -3px; }
.timer-open-btn:hover::before,
.timer-open-btn.active::before { inset: -5px; }

/* ---- 3) Running timer capsule: MAGADH ki jagah ---- */
.lib-brand .timer-run-row {
  display: none;
  padding: 0;
  margin-left: 4px;
}
.lib-brand .timer-run-row.show { display: flex; }

/* timer chalte waqt "MAGADH" word chhup jaye (logo rahega) */
.lib-brand:has(.timer-run-row.show) > span { display: none; }

/* compact capsule: topbar ki height nahi badhegi */
.lib-brand .timer-run-capsule {
  height: 28px;
  gap: 8px;
  padding: 0 4px 0 12px;
}
.lib-brand .timer-run-capsule::before { inset: -3px; }
.lib-brand .timer-run-icon { width: 13px; height: 13px; }
.lib-brand .timer-run-time {
  min-width: 74px;
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.lib-brand .timer-stop-btn { width: 20px; height: 20px; }
.lib-brand .timer-stop-square { width: 7px; height: 7px; }

/* ---- 4) Real-time clock hands ---- */
.timer-hand {
  transform-box: view-box;
  transform-origin: 110px 110px;
  stroke-linecap: round;
}
.timer-hand-hour {
  stroke: #d4ac6e;
  stroke-width: 3;
  filter: drop-shadow(0 0 3px rgba(212, 172, 110, 0.6));
}
.timer-hand-min {
  stroke: #f3e0b8;
  stroke-width: 2;
  filter: drop-shadow(0 0 3px rgba(243, 224, 184, 0.55));
}
.timer-hand-sec {
  stroke: #ff7a5c;
  stroke-width: 1.2;
  filter: drop-shadow(0 0 3px rgba(255, 122, 92, 0.75));
  transition: transform 0.28s cubic-bezier(0.34, 1.8, 0.5, 1);
}

/* digits suiyon ke upar saaf padhe jaayein */
.timer-input {
  text-shadow: 0 0 12px rgba(224, 190, 130, 0.5), 0 0 6px rgba(0, 0, 0, 0.9);
}

/* ---- 5) Custom button + row ---- */
.timer-action-row {
  display: flex;
  gap: 10px;
}
.timer-action-row .timer-set-btn {
  flex: 1;
  width: auto;
}
.timer-custom-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  border-radius: 14px;
  background: transparent;
  border: 1px solid rgba(212, 172, 110, 0.4);
  color: #d4ac6e;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: all 0.3s ease;
}
.timer-custom-btn svg { width: 14px; height: 14px; }
.timer-custom-btn:hover,
.timer-custom-btn.active {
  border-color: #d4ac6e;
  background: rgba(212, 172, 110, 0.14);
  color: #f3e0b8;
  box-shadow: 0 0 16px rgba(212, 172, 110, 0.35);
}

/* custom mode mein digits ke neeche ki line glow karti hai */
.timer-dial.custom-mode .timer-input {
  animation: timerInputPulse 1s ease-in-out infinite alternate;
}
@keyframes timerInputPulse {
  from { border-bottom-color: rgba(212, 172, 110, 0.35); }
  to   { border-bottom-color: #f3e0b8; }
}

/* ---- Tablet / Mobile ---- */
@media (max-width: 768px) {
  .lib-topbar { display: flex; }
}
@media (max-width: 480px) {
  .timer-open-btn {
    padding: 4px 11px;
    font-size: 0.56rem;
    letter-spacing: 0.1em;
    gap: 5px;
  }
  .timer-open-btn::before { inset: -3px; }
  .lib-brand .timer-run-diamond { display: none; }
  .lib-brand .timer-run-time { font-size: 0.95rem; min-width: 68px; }
}
/* =====================================================
   TIMER UPDATE v3
   (paste at the very bottom of library.css)
   ===================================================== */

/* ---- 1) Running capsule: Today/Streak patti ke andar, MAGADH ke neeche ---- */
.session-stats-bar .timer-run-row {
  display: none;
  position: absolute;
  left: 30px;
  top: 50%;
  margin: -14px 0 0;
  padding: 0;
  z-index: 5;
}
.session-stats-bar .timer-run-row.show { display: flex; }

.session-stats-bar .timer-run-capsule {
  height: 28px;
  gap: 8px;
  padding: 0 4px 0 12px;
}
.session-stats-bar .timer-run-capsule::before { inset: -3px; }
.session-stats-bar .timer-run-icon { width: 13px; height: 13px; }
.session-stats-bar .timer-run-time {
  min-width: 74px;
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.session-stats-bar .timer-stop-btn { width: 20px; height: 20px; }
.session-stats-bar .timer-stop-square { width: 7px; height: 7px; }

/* ---- 2) Dial: ab sirf saaf clock, digits neeche capsule mein ---- */
.timer-dial {
  width: 100%;
  height: auto;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.timer-dial svg {
  position: static;
  inset: auto;
  width: 190px;
  height: 190px;
}

/* digits ka glowing capsule */
.timer-dial-center {
  position: static;
  inset: auto;
  gap: 4px;
  padding: 8px 16px 6px;
  border-radius: 18px;
  border: 1px solid rgba(212, 172, 110, 0.4);
  background: rgba(212, 172, 110, 0.05);
  box-shadow: 0 0 18px rgba(212, 172, 110, 0.18), inset 0 0 10px rgba(212, 172, 110, 0.06);
  transition: all 0.3s ease;
}
.timer-dial.custom-mode .timer-dial-center {
  border-color: #d4ac6e;
  box-shadow: 0 0 24px rgba(212, 172, 110, 0.5), inset 0 0 12px rgba(212, 172, 110, 0.1);
}
.timer-input { width: 50px; font-size: 2rem; }
.timer-input-labels span { width: 50px; }

/* ---- 3) Numbers 1-12 ---- */
.timer-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 11.5px;
  font-weight: 600;
  fill: rgba(200, 170, 120, 0.85);
  text-anchor: middle;
}
.timer-num.big {
  font-size: 15px;
  font-weight: 700;
  fill: #f3e0b8;
  filter: drop-shadow(0 0 4px rgba(224, 190, 130, 0.6));
}

/* ---- 4) Hands (poori, hub se jude hue) ---- */
.timer-hand-hour { stroke-width: 3.6; }
.timer-hand-min  { stroke-width: 2.4; }
.timer-hand-sec  { stroke-width: 1.2; }

.timer-hub {
  fill: #d4ac6e;
  filter: drop-shadow(0 0 4px rgba(212, 172, 110, 0.8));
}
.timer-hub-dot { fill: #ff7a5c; }

/* ---- 5) Mobile: patti mein timer chalte waqt sirf capsule dikhe ---- */
@media (max-width: 700px) {
  .session-stats-bar { min-height: 42px; }
  .session-stats-bar .timer-run-row {
    position: static;
    margin: 0;
  }
  .session-stats-bar:has(.timer-run-row.show) > :not(.timer-run-row) {
    display: none;
  }
}
/* ===== ADMIN PANEL BUTTON ===== */
.admin-panel-open-btn {
  display: none;
  position: fixed;
  bottom: 100px;
  left: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(212, 172, 110, 0.15);
  border: 1px solid rgba(212, 172, 110, 0.6);
  color: #f3e0b8;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 42;
  box-shadow: 0 0 18px rgba(212, 172, 110, 0.3);
  transition: all 0.3s ease;
}
body.is-admin .admin-panel-open-btn { display: flex; }
.admin-panel-open-btn:hover {
  box-shadow: 0 0 26px rgba(212, 172, 110, 0.6);
  transform: scale(1.08);
}
.admin-panel-open-btn svg { width: 24px; height: 24px; }

/* ===== ADMIN PANEL MODAL ===== */
.admin-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 96;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  padding: 20px;
}
.admin-panel-overlay.show { opacity: 1; pointer-events: auto; }

.admin-panel {
  width: 440px;
  max-width: 100%;
  max-height: 78vh;
  overflow-y: auto;
  background: rgba(20, 18, 14, 0.55);
  backdrop-filter: blur(26px);
  border: 1px solid rgba(212, 172, 110, 0.4);
  border-radius: 24px;
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
}
.admin-panel-overlay.show .admin-panel { transform: scale(1); }

.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid rgba(212, 172, 110, 0.2);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: #d4ac6e;
  position: sticky;
  top: 0;
  background: rgba(20, 18, 14, 0.85);
  z-index: 2;
}
.admin-panel-close { background: transparent; border: none; color: #b8ae98; font-size: 1rem; cursor: pointer; }
.admin-panel-close:hover { color: #e8ddc4; }

.admin-panel-list { padding: 16px; display: flex; flex-direction: column; gap: 10px; }

.admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(212, 172, 110, 0.14);
}
.admin-row-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(212, 172, 110, 0.15);
  border: 1px solid rgba(212, 172, 110, 0.4);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif; color: #d4ac6e; flex-shrink: 0; overflow: hidden;
}
.admin-row-avatar img { width: 100%; height: 100%; object-fit: cover; }
.admin-row-info { flex: 1; min-width: 0; }
.admin-row-name { font-size: 0.85rem; color: #e8ddc4; font-weight: 500; }
.admin-row-hand { color: #ffb4a4; font-size: 0.68rem; }
.admin-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.admin-action-btn {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(212, 172, 110, 0.25);
  color: #cfc4a8; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s ease;
}
.admin-action-btn svg { width: 14px; height: 14px; }
.admin-action-btn:hover { border-color: #d4ac6e; color: #f3e0b8; background: rgba(212, 172, 110, 0.12); }
.admin-action-btn.danger:hover { border-color: #ff5c42; color: #ffb4a4; background: rgba(224, 90, 70, 0.12); }

/* ===== OTHER PARTICIPANT TILES ===== */
.other-tile {
  position: relative;
  aspect-ratio: 16 / 10;
  background-color: #111110;
  border: 1px solid rgba(176, 141, 87, 0.15);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
}
.other-tile .video-placeholder { position: static; }
.other-tile.paired {
  border-color: rgba(212, 172, 110, 0.5);
}
.pair-btn {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(212, 172, 110, 0.9);
  color: #0a0a0a;
  border: none;
  padding: 8px 18px;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 4;
}
.other-tile:hover .pair-btn { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ===== PAIRING REQUEST POPUP ===== */
.pair-request-popup {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 18, 14, 0.75);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 172, 110, 0.5);
  border-radius: 20px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 97;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 15px 40px rgba(0,0,0,0.5), 0 0 30px rgba(212, 172, 110, 0.25);
}
.pair-request-popup.show { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.pair-request-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(212, 172, 110, 0.4); }
.pair-request-name { display: block; color: #f3e9d2; font-weight: 600; font-size: 0.85rem; }
.pair-request-sub { color: #a89d84; font-size: 0.72rem; }
.pair-request-actions { display: flex; gap: 8px; margin-left: 8px; }
.pair-accept-btn, .pair-decline-btn {
  padding: 8px 14px; border-radius: 10px; font-size: 0.72rem; cursor: pointer; border: 1px solid;
  font-family: 'Inter', sans-serif;
}
.pair-accept-btn { background: #b08d57; border-color: #b08d57; color: #0a0a0a; }
.pair-decline-btn { background: transparent; border-color: rgba(212, 172, 110, 0.3); color: #cfc4a8; }


/* ===== PAIRED TILE — subtle badge + hover unpair (Google Meet style) ===== */
.other-tile.paired,
.video-card.paired {
  border-color: rgba(212, 172, 110, 0.5);
}



.unpair-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(20, 18, 14, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(224, 90, 70, 0.4);
  color: #ffb4a4;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.other-tile.paired:hover .unpair-btn,
.video-card.paired:hover .unpair-btn {
  opacity: 1;
}

.unpair-btn:hover {
  background-color: rgba(224, 90, 70, 0.85);
  color: #fff;
}
/* ===== PAIRED-WITH LABEL (text only, always visible, light-weight) ===== */
.paired-with-label {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(20, 18, 14, 0.7);
  border: 1px solid rgba(212, 172, 110, 0.4);
  font-family: 'Inter', sans-serif;
  font-size: 0.66rem;
  color: #f3e0b8;
  z-index: 5;
  white-space: nowrap;
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
}
/* ===== PAUSE DECORATIVE ANIMATIONS JAB TAB BACKGROUND MEIN HO ===== */
body.tab-hidden .lib-bg-words span,
body.tab-hidden .lib-doodle,
body.tab-hidden .timer-modal-overlay.show .timer-modal,
body.tab-hidden .leave-btn,
body.tab-hidden .timer-open-btn.has-timer {
  animation-play-state: paused !important;
}
/* ===== CHAT UNREAD BADGE (on chat button) ===== */
.chat-unread-badge {
  position: absolute;
  top: 2px;
  right: 8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #d4ac6e;
  color: #0a0a0a;
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(212, 172, 110, 0.7);
  animation: chatBadgePulse 1.3s ease-in-out infinite;
  z-index: 6;
  pointer-events: none;
}
.chat-unread-badge.show { display: flex; }

@keyframes chatBadgePulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}
/* ===== ADAPTIVE VIDEO GRID (Google-Meet style) ===== */
.lib-main { overflow: hidden; }

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--tile-min, 240px), var(--tile-max, 320px)));
  gap: 18px;
  width: 100%;
  max-width: 1400px;
  max-height: 100%;
  overflow-y: auto;
  align-content: flex-start;
  justify-content: center;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.video-grid::-webkit-scrollbar { display: none; }
.video-grid.no-scroll { overflow-y: hidden; }

/* ===== OVERFLOW "+N MORE" TILE ===== */
.overflow-tile {
  position: relative;
  aspect-ratio: 16 / 10;
  background: rgba(212, 172, 110, 0.06);
  border: 1.5px dashed rgba(212, 172, 110, 0.4);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.overflow-tile:hover {
  border-color: #d4ac6e;
  background: rgba(212, 172, 110, 0.12);
  transform: translateY(-2px);
}
.overflow-stack { display: flex; }
.overflow-stack .mini-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid #111110;
  background: rgba(212, 172, 110, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.8rem;
  color: #d4ac6e;
  margin-left: -10px;
  overflow: hidden;
}
.overflow-stack .mini-avatar:first-child { margin-left: 0; }
.overflow-stack .mini-avatar img { width: 100%; height: 100%; object-fit: cover; }
.overflow-count {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: #e8ddc4;
  letter-spacing: 0.05em;
}

/* ===== OVERFLOW LIST MODAL ===== */
.overflow-list-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 92;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  padding: 20px;
}
.overflow-list-overlay.show { opacity: 1; pointer-events: auto; }

.overflow-list-panel {
  width: 480px;
  max-width: 100%;
  max-height: 78vh;
  background: rgba(20, 18, 14, 0.55);
  backdrop-filter: blur(26px);
  border: 1px solid rgba(212, 172, 110, 0.4);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.overflow-list-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(212, 172, 110, 0.2);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: #d4ac6e;
}
.overflow-back-btn {
  background: transparent; border: none; color: #b8ae98; font-size: 1rem; cursor: pointer;
}
.overflow-back-btn:hover { color: #e8ddc4; }
.overflow-list-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  overflow-y: auto;
  scrollbar-width: none;
}
.overflow-list-grid::-webkit-scrollbar { display: none; }
/* ===== AMBIENT VIDEO BACKGROUND (personalized, per-user) ===== */
.ambient-video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  filter: brightness(0.55) saturate(1.1);
  transition: opacity 0.8s ease;
}

.ambient-video-bg.show {
  opacity: 1;
}
/* ===== CHAT TOKEN BAR ===== */
.chat-token-bar {
  padding: 8px 22px;
  border-bottom: 1px solid rgba(212, 172, 110, 0.15);
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: #d4ac6e;
  text-align: center;
  background: rgba(212, 172, 110, 0.04);
}
.chat-token-bar.low { color: #ffb4a4; }

/* ===== CHAT LIMIT REACHED POPUP (red glass) ===== */
.chat-limit-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  background: rgba(40, 12, 10, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 90, 70, 0.55);
  border-radius: 22px;
  padding: 30px 36px;
  text-align: center;
  max-width: 320px;
  z-index: 95;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6), 0 0 45px rgba(255, 70, 50, 0.25);
}
.chat-limit-popup.show {
  animation: chatLimitPop 3.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes chatLimitPop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
  12%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  88%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
}
.chat-limit-emoji { display: block; font-size: 2.2rem; margin-bottom: 12px; }
.chat-limit-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  color: #ffcabb;
  line-height: 1.5;
  margin-bottom: 8px;
}
.chat-limit-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: #ff8066;
}
.admin-panel-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 16px 0;
}
.admin-tab {
  flex: 1;
  background: transparent;
  border: 1px solid rgba(212, 172, 110, 0.25);
  color: #b8ae98;
  padding: 8px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.3s ease;
}
.admin-tab.active {
  background: rgba(212, 172, 110, 0.18);
  border-color: #d4ac6e;
  color: #f3e0b8;
}
.admin-report-row {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(212, 172, 110, 0.14);
  margin-bottom: 10px;
}
.admin-report-row .rep-meta {
  font-size: 0.68rem;
  color: #8f846f;
  margin-bottom: 6px;
}
.admin-report-row .rep-text {
  font-size: 0.8rem;
  color: #e8ddc4;
  line-height: 1.5;
}
/* =====================================================
   MOBILE & TABLET RESPONSIVE PATCH — new features
   ===================================================== */

/* Chat token bar */
@media (max-width: 480px) {
  .chat-token-bar {
    font-size: 0.6rem;
    padding: 6px 14px;
  }
}

/* Chat limit popup (red glass) */
@media (max-width: 480px) {
  .chat-limit-popup {
    padding: 22px 24px;
    max-width: 82vw;
  }
  .chat-limit-emoji { font-size: 1.8rem; }
  .chat-limit-text { font-size: 0.92rem; }
  .chat-limit-sub { font-size: 0.66rem; }
}

/* Ambient video background — cover properly on all screens */
@media (max-width: 900px) {
  .ambient-video-bg {
    object-position: center;
  }
}

/* Admin panel tabs (Students / Reports) */
@media (max-width: 480px) {
  .admin-panel-tabs {
    padding: 10px 12px 0;
    gap: 5px;
  }
  .admin-tab {
    font-size: 0.64rem;
    padding: 7px;
  }
  .admin-report-row {
    padding: 10px 12px;
  }
  .admin-report-row .rep-meta {
    font-size: 0.6rem;
  }
  .admin-report-row .rep-text {
    font-size: 0.74rem;
  }
  .admin-panel {
    width: 94vw;
    max-height: 82vh;
  }
}

/* Tablet: admin panel + reports readable at medium sizes */
@media (min-width: 481px) and (max-width: 768px) {
  .admin-panel { width: 88vw; }
  .admin-tab { font-size: 0.68rem; }
}

/* Overflow list modal on small screens */
@media (max-width: 480px) {
  .overflow-list-panel {
    width: 94vw;
  }
  .overflow-list-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
  }
}

/* Pair request popup — keep readable on small phones */
@media (max-width: 480px) {
  .pair-request-popup {
    bottom: 90px;
    padding: 10px 14px;
    gap: 10px;
    max-width: 90vw;
  }
  .pair-request-avatar { width: 34px; height: 34px; }
  .pair-request-name { font-size: 0.76rem; }
  .pair-request-sub { font-size: 0.64rem; }
  .pair-accept-btn, .pair-decline-btn {
    padding: 6px 10px;
    font-size: 0.64rem;
  }
}

/* Tablet: study/ambient/people/leaderboard modals — slightly narrower than desktop */
@media (min-width: 481px) and (max-width: 900px) {
  .study-modal, .ambient-modal, .people-modal,
  .leaderboard-modal, .report-modal, .timer-modal {
    width: 86vw;
  }
}

/* Video tiles: ensure paired-label / unpair-btn don't overflow on small tiles */
@media (max-width: 480px) {
  .paired-with-label {
    font-size: 0.58rem;
    padding: 3px 8px;
  }
  .unpair-btn {
    font-size: 0.58rem;
    padding: 4px 9px;
  }
}