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

/* ════════════════════════════════════════
   SCREEN SYSTEM  (4-screen routing)
════════════════════════════════════════ */
.screen--hidden { display: none !important; }

/* Auth & Config screens — centred card */
#screenConfig,
#screenAuth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px 16px;
  overflow-y: auto;
}

/* Join screen — centred, scrollable */
#screenJoin {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px 16px;
  overflow-y: auto;
}

/* Main app screen — two-column grid */
#mainApp {
  display: grid;
  grid-template-columns: 1fr var(--gift-panel-width);
  height: 100vh;
}

/* ════════════════════════════════════════
   AUTH CARD
════════════════════════════════════════ */
.auth-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  width: 440px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-card__logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--accent-pink);
}

.auth-card__title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-top: -6px;
}

.auth-card__subtitle {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  margin-top: -8px;
}

.auth-link { color: var(--accent); text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

.auth-card__footer {
  display: flex;
  justify-content: center;
  margin-top: -4px;
}

.auth-card__footer-note {
  font-size: 11px;
  color: var(--text-muted);
}

.auth-card__footer-note code {
  background: var(--bg-card);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  color: var(--accent);
}

/* ════════════════════════════════════════
   AUTH TABS  (Sign In / Create Account)
════════════════════════════════════════ */
.auth-tabs {
  display: flex;
  background: var(--bg-card);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 8px;
  cursor: pointer;
  transition: all 0.18s;
}

.auth-tab:hover { color: var(--text-secondary); }
.auth-tab.active {
  background: var(--bg-panel);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ════════════════════════════════════════
   AUTH FORMS
════════════════════════════════════════ */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form--hidden { display: none; }

.auth-error {
  font-size: 13px;
  color: var(--danger);
  min-height: 16px;
  text-align: center;
}

/* Password input + eye toggle */
.input-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-password-wrap .form-input { padding-right: 42px; }

.btn-eye {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.btn-eye:hover { opacity: 1; }

/* Textarea (Firebase config) */
.form-textarea {
  resize: vertical;
  min-height: 140px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  line-height: 1.5;
}

/* ════════════════════════════════════════
   AUTH BUTTONS
════════════════════════════════════════ */
.btn--auth-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-pink));
  color: #fff;
  padding: 12px;
  font-size: 15px;
  width: 100%;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.15s, transform 0.1s;
}

.btn--auth-primary:hover   { opacity: 0.88; }
.btn--auth-primary:active  { transform: scale(0.97); }
.btn--auth-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn--auth-ghost {
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: color 0.15s;
}

.btn--auth-ghost:hover { color: var(--text-secondary); }

.btn--auth-reset {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s;
}

.btn--auth-reset:hover { color: var(--text-secondary); }

/* ════════════════════════════════════════
   USER BADGE  (join screen)
════════════════════════════════════════ */
.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}

.user-badge__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-badge__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.user-badge__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-badge__email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn--signout {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}

.btn--signout:hover { background: rgba(239,68,68,0.22); }

/* ════════════════════════════════════════
   STREAM USER PILL  (stream header)
════════════════════════════════════════ */
.stream-user-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(0,0,0,0.5);
  border-radius: 20px;
  padding: 4px 12px 4px 4px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  max-width: 130px;
  overflow: hidden;
}

.stream-user-pill__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

#streamUserName {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

:root {
  --gift-panel-width: 360px;
  --bg-dark: #0d0d0d;
  --bg-panel: #161616;
  --bg-card: #1f1f1f;
  --bg-card-hover: #272727;
  --accent: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-gold: #f59e0b;
  --text-primary: #ffffff;
  --text-muted: #6b7280;
  --text-secondary: #9ca3af;
  --border: #262626;
  --danger: #ef4444;
  --green: #22c55e;
}

body {
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  height: 100vh;
  overflow: hidden;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  display: block;
}

/* ════════════════════
   PANEL TABS (Gifts / Chat)
════════════════════ */
.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: -1px;
}

.panel-tab:hover { color: var(--text-secondary); }
.panel-tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }

.chat-unread {
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ════════════════════
   PANEL PANES
════════════════════ */
.panel-pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.panel-pane--hidden { display: none; }

/* ════════════════════
   MODAL
════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(6px);
}

.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  width: 420px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal__logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--accent-pink);
}

.modal__title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.modal__subtitle {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-top: -8px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.required { color: var(--accent-pink); }
.optional  { color: var(--text-muted); font-weight: 400; text-transform: none; letter-spacing: 0; }

.form-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-muted); }


.modal__error {
  font-size: 13px;
  color: var(--danger);
  min-height: 18px;
  text-align: center;
}

/* ════════════════════
   APP SHELL
════════════════════ */
.app {
  display: grid;
  grid-template-columns: 1fr var(--gift-panel-width);
  height: 100vh;
}

/* ════════════════════
   LEFT — Stream
════════════════════ */
.stream-side {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

.stream-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, transparent 100%);
}

.stream-header__left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-badge {
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 4px;
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}

.viewer-count {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  background: rgba(0,0,0,0.5);
  padding: 4px 10px;
  border-radius: 20px;
}

/* Clickable variant */
.viewer-count--btn {
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.viewer-count--btn:hover {
  background: rgba(255,255,255,0.15);
}

/* ── Viewers List Modal ── */
.viewers-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.viewers-modal--hidden { display: none; }
.viewers-modal__card {
  background: var(--bg-card);
  border-radius: 20px;
  width: min(380px, 92vw);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.viewers-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.viewers-modal__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.viewers-modal__close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.viewers-modal__close:hover { color: var(--text-primary); }
.viewers-modal__list {
  overflow-y: auto;
  padding: 8px 0;
  flex: 1;
}
.viewers-modal__empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 24px;
}
.viewers-modal__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
}
.viewers-modal__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background-size: cover;
  background-position: center;
}
.viewers-modal__name {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.viewers-block-btn {
  background: none;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.viewers-block-btn:hover:not(:disabled) { border-color: #ef4444; color: #ef4444; }
.viewers-block-btn:disabled { opacity: 0.5; cursor: not-allowed; }


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

.icon-btn {
  background: rgba(0,0,0,0.5);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background 0.15s;
}

.icon-btn:hover { background: rgba(0,0,0,0.75); }

.icon-btn--muted {
  background: rgba(239, 68, 68, 0.7);
}

/* Video area */
.stream-video {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #0a0a0a;
}

.video-player-slot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Agora injects a <video> — make it fill */
.video-player-slot video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* Placeholder */
.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  background: #0a0a0a;
}

.video-placeholder__inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.video-placeholder__icon {
  font-size: 56px;
  opacity: 0.4;
}

.video-placeholder p {
  color: var(--text-muted);
  font-size: 15px;
}

/* Overlay gradient */
.stream-video__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.85) 0%,
    rgba(0,0,0,0.15) 40%,
    transparent 65%
  );
  pointer-events: none;
  z-index: 3;
}

/* Streamer info at bottom */
.stream-video__info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 4;
}

.streamer-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.streamer-profile__avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--accent-pink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

.streamer-profile__name {
  font-size: 15px;
  font-weight: 700;
}


.streamer-profile__followers {
  font-size: 12px;
  color: var(--accent-pink);
  font-weight: 600;
  margin-top: 1px;
  min-height: 16px;
}

.btn--follow--following {
  background: transparent !important;
  border: 1px solid rgba(255,255,255,0.35);
  color: rgba(255,255,255,0.75) !important;
  font-size: 12px;
}


/* Floating reactions */
.reactions {
  position: absolute;
  right: 18px;
  bottom: 160px;
  width: 40px;
  z-index: 5;
  pointer-events: none;
}

.reaction-float {
  position: absolute;
  bottom: 0;
  font-size: 24px;
  animation: floatUp var(--dur, 2s) ease-out forwards;
}

@keyframes floatUp {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  60%  { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-160px) scale(0.7); }
}

/* ════════════════════
   RIGHT — Gift Panel
════════════════════ */
.gift-panel {
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

.gift-panel::-webkit-scrollbar { width: 4px; }
.gift-panel::-webkit-scrollbar-track { background: transparent; }
.gift-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.gift-panel__header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gift-panel__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gift-panel__title {
  font-size: 16px;
  font-weight: 700;
}

.credits-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-gold);
}

.gift-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
}

.gift-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 10px 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}

.gift-tab:hover { color: var(--text-secondary); }

.gift-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 14px 16px 10px;
}

.gift-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px 8px;
  cursor: pointer;
  gap: 3px;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  position: relative;
}

.gift-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.gift-card.selected {
  border-color: var(--accent-pink);
  background: rgba(236, 72, 153, 0.1);
}

.gift-card.selected::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 9px;
  color: var(--accent-pink);
  font-weight: 700;
}

.gift-card--premium { border-color: rgba(245,158,11,0.3); }
.gift-card--premium:hover { border-color: var(--accent-gold); }

.gift-card__icon { font-size: 24px; line-height: 1; }
.gift-card__name { font-size: 10px; color: var(--text-secondary); }
.gift-card__price { font-size: 10px; font-weight: 700; color: var(--accent-gold); }

/* Send row */
.gift-send {
  margin: 0 16px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.gift-send__emoji { font-size: 20px; flex-shrink: 0; }

.gift-send__label {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

.gift-send__label strong { color: var(--text-primary); }

.gift-send__qty {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.qty-btn {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-primary);
  font-size: 15px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.1s;
}

.qty-btn:hover { background: var(--accent); border-color: var(--accent); }

.qty-value { font-size: 13px; font-weight: 600; min-width: 16px; text-align: center; }

/* Status bar */
.status-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 16px 10px;
  font-size: 11px;
  color: var(--text-muted);
}

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

.status-dot--connected    { background: var(--green); box-shadow: 0 0 5px var(--green); }
.status-dot--disconnected { background: var(--text-muted); }
.status-dot--error        { background: var(--danger); }

/* Leaderboard */
.leaderboard {
  padding: 4px 16px 20px;
  flex: 1;
}

.leaderboard__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.leaderboard__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.leaderboard__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.leaderboard__item--gold   { border-color: rgba(245,158,11,0.35); background: rgba(245,158,11,0.06); }
.leaderboard__item--silver { border-color: rgba(156,163,175,0.3); background: rgba(156,163,175,0.05); }
.leaderboard__item--bronze { border-color: rgba(180,100,60,0.3); background: rgba(180,100,60,0.05); }

.leaderboard__rank { font-size: 14px; min-width: 20px; text-align: center; }
.leaderboard__name { flex: 1; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.leaderboard__amount { font-size: 11px; font-weight: 700; color: var(--accent-gold); }

/* ════════════════════
   BUTTONS
════════════════════ */
.btn {
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  transition: opacity 0.15s, transform 0.1s;
}

.btn:hover   { opacity: 0.88; }
.btn:active  { transform: scale(0.97); }

.btn--join {
  background: linear-gradient(135deg, var(--accent), var(--accent-pink));
  color: #fff;
  padding: 12px;
  font-size: 15px;
  width: 100%;
  border-radius: 10px;
}

.btn--join:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--leave {
  position: absolute;
  bottom: 24px;
  right: 20px;
  z-index: 5;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.4);
  color: #fca5a5;
  font-size: 12px;
  padding: 6px 14px;
}

.btn--follow {
  background: var(--accent-pink);
  color: #fff;
  padding: 7px 18px;
  font-size: 12px;
}

.streamer-profile__avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.streamer-profile__avatar-wrap .btn--follow {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.btn--buy-credits {
  background: linear-gradient(135deg, var(--accent), var(--accent-pink));
  color: #fff;
  width: 100%;
  text-align: center;
  padding: 9px;
}

.btn--send {
  background: linear-gradient(135deg, var(--accent-pink), var(--accent));
  color: #fff;
  width: calc(100% - 32px);
  display: block;
  margin: 0 16px 10px;
  padding: 11px;
  font-size: 14px;
  border-radius: 10px;
  text-align: center;
  transition: background 0.3s, opacity 0.15s, transform 0.1s;
}

/* ════════════════════════════════════════
   LIVE CHAT PANE
════════════════════════════════════════ */
.chat-status-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 11px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-feed {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  padding: 12px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.chat-feed::-webkit-scrollbar { width: 3px; }
.chat-feed::-webkit-scrollbar-track { background: transparent; }
.chat-feed::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* System messages */
.chat-msg--system {
  display: flex;
  justify-content: center;
}

.chat-msg--system span {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-card);
  border-radius: 10px;
  padding: 3px 10px;
}

/* Regular messages */
.chat-msg--other,
.chat-msg--self {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  animation: msgIn 0.2s ease;
}

.chat-msg--self { flex-direction: row-reverse; }

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

.chat-msg__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.chat-msg__bubble {
  max-width: 75%;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-msg--self .chat-msg__bubble { align-items: flex-end; }

.chat-msg__name {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0 4px;
}

.chat-msg--self .chat-msg__name { color: var(--accent); }

.chat-msg__text {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px 14px 14px 4px;
  padding: 7px 11px;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
  color: var(--text-primary);
}

.chat-msg--self .chat-msg__text {
  background: var(--accent);
  border-color: var(--accent);
  border-radius: 14px 14px 4px 14px;
  color: #fff;
}

/* Chat input row */
.chat-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-username-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 13px;
  padding: 8px 14px;
  outline: none;
  transition: border-color 0.15s;
  min-width: 0;
}

.chat-input:focus { border-color: var(--accent); }
.chat-input::placeholder { color: var(--text-muted); }
.chat-input:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-send-btn {
  background: var(--accent);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  transition: background 0.15s;
}

.chat-send-btn:hover:not(:disabled) { background: var(--accent-pink); }
.chat-send-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ════════════════════════════════════════
   MOBILE DRAWER TOGGLE BUTTON
   (only visible on mobile)
════════════════════════════════════════ */
.gift-drawer-toggle {
  display: none; /* hidden on desktop */
}

/* ════════════════════════════════════════
   DRAWER HANDLE (mobile only)
════════════════════════════════════════ */
.drawer-handle {
  display: none;
  justify-content: center;
  padding: 10px 0 6px;
  cursor: pointer;
}

.drawer-handle__bar {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}

/* ════════════════════════════════════════
   RESPONSIVE — TABLET  (≤ 900px)
════════════════════════════════════════ */
@media (max-width: 900px) {
  :root {
    --gift-panel-width: 300px;
  }
}

/* ════════════════════════════════════════
   RESPONSIVE — MOBILE  (≤ 768px)
════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Mobile chat overlay — thin scrollable strip just above the avatar ── */
  .mobile-chat-overlay {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: absolute;
    bottom: 200px;          /* sits directly above the streamer-profile strip */
    left: 0;
    right: 0;
    height: 75px;
    overflow-y: scroll;
    overflow-x: hidden;
    list-style: none;
    padding: 0 12px;
    z-index: 50;
    pointer-events: auto;  /* allow scrolling */
    background: transparent;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-chat-overlay::-webkit-scrollbar { display: none; }

  .mob-chat-msg {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.38);
    border-radius: 10px;
    padding: 3px 10px;
    width: fit-content;
    max-width: 90%;
    flex-shrink: 0;
    height: 22px;
  }

  .mob-chat-name {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
  }

  .mob-chat-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.92);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Hide "Following" stat on mobile — row is too tight */
  #profileFollowingWrap,
  #profileFollowingDivider {
    display: none;
  }

  /* Allow page to scroll naturally */
  body {
    height: auto;
    overflow: auto;
  }

  /* Stack stream on top, gift panel as overlay sheet */
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
    min-height: 100dvh;
    position: relative;
  }

  /* ── Stream side: portrait video (9:16 feel) ── */
  .stream-side {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    position: relative;
  }

  .stream-header {
    padding: 10px 12px;
  }


  /* ── Stream header: horizontally scrollable on mobile ── */
  .stream-header {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 10px;
    justify-content: flex-start;
  }
  .stream-header::-webkit-scrollbar { display: none; }

  .stream-header__left,
  .stream-header__right {
    flex-shrink: 0;
  }

  /* Streamer info — tighter on mobile */
  .stream-video__info {
    padding: 14px 14px 80px; /* bottom padding for drawer toggle button */
    gap: 8px;
  }

  .streamer-profile__avatar-placeholder {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .streamer-profile__name {
    font-size: 14px;
  }


  .streamer-profile__avatar-wrap .btn--follow {
    padding: 3px 8px;
    font-size: 9px;
  }

  .btn--leave {
    position: fixed;
    bottom: 60px;
    right: 12px;
    z-index: 201;
  }


  /* ── Gift drawer toggle button (fixed at bottom of stream) ── */
  .gift-drawer-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: linear-gradient(135deg, var(--accent-pink), var(--accent));
    color: #fff;
    border: none;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 0;
    transition: opacity 0.15s;
  }

  .gift-drawer-toggle svg {
    transition: transform 0.3s ease;
  }

  /* ── Gift panel: slide-up bottom sheet on mobile ── */
  .gift-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40dvh;
    max-height: 40dvh;
    border-radius: 20px 20px 0 0;
    border-left: none;
    border-top: 1px solid var(--border);
    z-index: 300;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Hide from desktop flow on mobile */
    width: 100%;
  }

  /* Open state */
  .gift-panel--open {
    transform: translateY(0);
  }

  /* Show the drag handle on mobile */
  .drawer-handle {
    display: flex;
    position: sticky;
    top: 0;
    background: var(--bg-panel);
    z-index: 1;
    border-radius: 20px 20px 0 0;
  }

  /* Larger gift grid on mobile (3 cols fits better) */
  .gift-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 10px 12px;
  }

  .gift-card {
    padding: 8px 2px 6px;
  }

  .gift-card__icon {
    font-size: 22px;
  }

  /* Send row tweaks */
  .gift-send {
    margin: 0 12px 8px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .btn--send {
    width: calc(100% - 24px);
    margin: 0 12px 12px;
    padding: 13px;
    font-size: 15px;
  }

  /* Leaderboard — tighter */
  .leaderboard {
    padding: 4px 12px 100px; /* 100px bottom so content clears the toggle button */
  }

  .gift-panel__header {
    padding: 12px 12px 10px;
  }

  .gift-tabs {
    padding: 0 12px;
  }

  /* Status bar */
  .status-bar {
    padding: 4px 12px 8px;
  }

  /* Modal: full screen on mobile */
  .modal {
    border-radius: 0;
    width: 100vw;
    max-width: 100vw;
    min-height: 100dvh;
    padding: 40px 24px 32px;
    justify-content: center;
    border: none;
  }

  .modal-backdrop {
    align-items: flex-start;
  }

  /* Auth card: full screen on mobile */
  .auth-card {
    border-radius: 0;
    width: 100vw;
    max-width: 100vw;
    min-height: 100dvh;
    padding: 40px 24px 32px;
    border: none;
    border-radius: 0;
  }

  #screenConfig,
  #screenAuth,
  #screenJoin {
    align-items: flex-start;
    padding: 0;
  }

  /* Main app: single column on mobile */
  #mainApp {
    grid-template-columns: 1fr;
    height: auto;
  }

  /* Backdrop to close drawer when tapping outside */
  .gift-panel--open::before {
    content: '';
    position: fixed;
    inset: 0;
    bottom: 40dvh;
    z-index: -1;
  }

  /* Profile card: full screen on mobile */
  #screenProfile {
    align-items: flex-start;
    padding: 0 0 60px;
  }

  .profile-card {
    border-radius: 0;
    width: 100vw;
    max-width: 100vw;
    min-height: 100dvh;
    border: none;
    padding: 40px 24px 60px;
  }

  .profile-list {
    max-height: none;
    flex: 1;
  }
}

/* ════════════════════════════════════════
   PROFILE SCREEN
════════════════════════════════════════ */
#screenProfile {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 60px;
  overflow-y: auto;
}

.profile-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 28px 24px;
  width: 480px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Header ── */
.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Wrapper needed to position the camera overlay */
.profile-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  border: 3px solid var(--border);
}

/* Camera overlay — visible on hover */
.profile-avatar-change {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s;
}

.profile-avatar-wrap:hover .profile-avatar-change { opacity: 1; }

/* "Set as profile pic" star button on gallery thumbnails */
.gallery-set-avatar-btn {
  position: absolute;
  z-index: 2;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.65);
  border: none;
  border-radius: 50%;
  color: #fbbf24;
  font-size: 13px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  line-height: 1;
}

.gallery-item:hover .gallery-set-avatar-btn { opacity: 1; }
.gallery-set-avatar-btn:hover { background: rgba(251,191,36,0.35); }

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

.profile-name {
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-email {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-since {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Stats row ── */
.profile-stats {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.profile-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
  gap: 3px;
}

.profile-stat__count {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.profile-stat__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.profile-stat__divider {
  width: 1px;
  height: 44px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── Bio / Edit Profile section ── */
.profile-bio-section {
  padding: 4px 0 8px;
}
.profile-bio-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 4px;
  line-height: 1.4;
}
.profile-bio-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.profile-bio-edit-btn {
  background: none;
  border: none;
  color: var(--accent-pink);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.profile-bio-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-bio-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.profile-bio-input {
  background: var(--bg-input, var(--bg-card));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
}
.profile-bio-input:focus {
  border-color: var(--accent-pink);
}
.profile-bio-form-actions {
  display: flex;
  gap: 8px;
}

/* ── Host Profile Modal ── */
.host-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.host-modal--hidden {
  display: none;
}
.host-modal__card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 32px 24px;
  width: min(360px, 90vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  text-align: center;
}
.host-modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.host-modal__close:hover {
  color: var(--text-primary);
}
.host-modal__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--accent-pink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.host-modal__name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.host-modal__meta {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
.host-modal__bio {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  max-width: 280px;
  line-height: 1.5;
}
/* ── Host modal photo slider ─────────────────────────────── */
.host-modal__slider           { position: relative; width: 100%; margin-top: 10px;
                                 border-radius: 12px; overflow: hidden; background: #000; }
.host-modal__slider-track     { display: flex; transition: transform 0.3s ease; will-change: transform; }
.host-modal__slider-track img { width: 100%; flex-shrink: 0; height: 200px;
                                 object-fit: cover; display: block; }
.host-modal__slider-btn       { position: absolute; top: calc(50% - 16px);
                                 background: rgba(0,0,0,0.55); color: #fff; border: none;
                                 border-radius: 50%; width: 32px; height: 32px;
                                 font-size: 1.3rem; cursor: pointer;
                                 display: flex; align-items: center; justify-content: center;
                                 line-height: 1; z-index: 2; }
.host-modal__slider-btn--prev { left: 6px; }
.host-modal__slider-btn--next { right: 6px; }
.host-modal__slider-dots      { display: flex; justify-content: center; gap: 6px;
                                 padding: 6px 0; background: rgba(0,0,0,0.6); }
.host-modal__slider-dot       { width: 7px; height: 7px; border-radius: 50%;
                                 background: rgba(255,255,255,0.35); cursor: pointer;
                                 transition: background 0.2s; }
.host-modal__slider-dot.active{ background: #fff; }
.host-modal__slider-link      { display: block; flex-shrink: 0; width: 100%; }

/* ── Viewer Profile Modal ── */
.viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
}
.viewer-modal--hidden { display: none; }
.viewer-modal__card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 32px 24px 24px;
  width: 320px;
  max-width: calc(100vw - 32px);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.viewer-modal__close {
  position: absolute;
  top: 12px; right: 14px;
  background: none; border: none;
  color: var(--text-muted);
  font-size: 18px; cursor: pointer; line-height: 1;
}
.viewer-modal__close:hover { color: var(--text-primary); }
.viewer-modal__avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.viewer-modal__name { font-size: 20px; font-weight: 700; margin: 0; }
.viewer-modal__followers { font-size: 13px; color: var(--text-muted); margin: 0; }
.viewer-modal__meta { font-size: 13px; color: var(--text-muted); margin: 0; }
.viewer-modal__bio {
  font-size: 14px; color: var(--text-secondary);
  margin: 0; max-width: 280px; line-height: 1.5;
}
.viewer-modal__actions { display: flex; gap: 8px; margin-top: 8px; }
.viewer-modal__follow-btn { min-width: 100px; }
.viewer-modal__follow-btn--following {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.viewer-modal__block-btn {
  min-width: 80px;
  background: transparent;
  border: 1px solid #e74c3c;
  color: #e74c3c;
}
.viewer-modal__block-btn--hidden { display: none !important; }
.viewers-modal__row--clickable { cursor: pointer; }
.viewers-modal__row--clickable:hover {
  background: rgba(255,255,255,.06);
  border-radius: 8px;
}

/* ── Buy Credits Modal ── */
.buy-credits-modal {
  position: fixed; inset: 0; z-index: 950;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px);
}
.buy-credits-modal--hidden { display: none; }
.buy-credits-modal__card {
  background: var(--bg-card); border-radius: 20px;
  padding: 32px 28px 24px; width: 340px;
  max-width: calc(100vw - 32px); position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center;
}
.buy-credits-modal__close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: var(--text-muted);
  font-size: 18px; cursor: pointer; line-height: 1;
}
.buy-credits-modal__close:hover { color: var(--text-primary); }
.buy-credits-modal__title { font-size: 20px; font-weight: 700; margin: 0; }
.buy-credits-modal__sub { font-size: 13px; color: var(--text-muted); margin: 0; }
.buy-credits-modal__presets {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%;
}
.buy-credits-preset {
  padding: 10px 4px; border-radius: 10px; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600;
  background: var(--bg-panel); color: var(--text-primary);
  transition: background .15s;
}
.buy-credits-preset:hover { background: var(--accent); color: #fff; }
.buy-credits-preset--selected { background: var(--accent); color: #fff; }
.buy-credits-modal__custom { width: 100%; text-align: left; }
.buy-credits-modal__label {
  display: block; font-size: 12px; color: var(--text-muted);
  margin-bottom: 6px; font-weight: 500;
}
.buy-credits-modal__input {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-panel);
  color: var(--text-primary); font-size: 15px;
}
.buy-credits-modal__input:focus { outline: none; border-color: var(--accent); }
.buy-credits-modal__confirm { width: 100%; }
.buy-credits-modal__balance { font-size: 13px; color: var(--text-muted); margin: 0; }
.buy-credits-modal__alert {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  background: rgba(34,197,94,.15); border: 1px solid rgba(34,197,94,.4);
  color: #22c55e; font-size: 14px; font-weight: 500; text-align: center;
}
.buy-credits-modal__alert--hidden { display: none; }

/* ── Leaderboard ── */
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.leaderboard-item--me {
  border-color: var(--accent);
  background: rgba(139,92,246,.07);
}
.leaderboard-item__rank {
  font-size: 18px;
  min-width: 32px;
  text-align: center;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}
.leaderboard-item__avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.leaderboard-item__info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}
.leaderboard-item__name {
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.leaderboard-item__you {
  font-size: 10px; font-weight: 700;
  background: var(--accent); color: #fff;
  border-radius: 4px; padding: 1px 5px;
  margin-left: 4px; vertical-align: middle;
}
.leaderboard-item__total {
  font-size: 13px; font-weight: 700;
  color: #f59e0b;
  flex-shrink: 0;
}

/* ── Report Host Modal ── */
.report-modal {
  position: fixed; inset: 0; z-index: 950;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px);
}
.report-modal--hidden { display: none; }
.report-modal__card {
  background: var(--bg-card); border-radius: 20px;
  padding: 32px 28px 24px; width: 360px;
  max-width: calc(100vw - 32px); position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.report-modal__close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: var(--text-muted);
  font-size: 18px; cursor: pointer; line-height: 1;
}
.report-modal__close:hover { color: var(--text-primary); }
.report-modal__icon { font-size: 36px; line-height: 1; }
.report-modal__title { font-size: 18px; font-weight: 700; margin: 0; }
.report-modal__subtitle {
  font-size: 13px; color: var(--text-muted);
  text-align: center; margin: 0; line-height: 1.5;
}
.report-modal__textarea {
  width: 100%; background: var(--bg-panel);
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--text-primary); font-size: 14px;
  padding: 10px 12px; resize: none; font-family: inherit;
  transition: border-color .15s;
}
.report-modal__textarea:focus { outline: none; border-color: var(--accent); }
.report-modal__actions { display: flex; gap: 10px; width: 100%; }
.report-modal__cancel {
  flex: 1; padding: 10px; border-radius: 10px; cursor: pointer;
  background: var(--bg-panel); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 14px; font-weight: 600;
  transition: border-color .15s, color .15s;
}
.report-modal__cancel:hover { border-color: var(--accent); color: var(--text-primary); }
.report-modal__submit {
  flex: 1; padding: 10px; border-radius: 10px; cursor: pointer;
  background: var(--danger, #ef4444); border: none;
  color: #fff; font-size: 14px; font-weight: 700;
  transition: opacity .15s;
}
.report-modal__submit:hover { opacity: 0.88; }
.report-modal__submit:disabled { opacity: 0.5; cursor: not-allowed; }
.report-modal__feedback { font-size: 13px; color: #22c55e; margin: 0; text-align: center; }

/* ── Report icon button colour ── */
.report-btn { color: #f59e0b; }
.report-btn:hover { color: #ef4444; }

/* ── Gift Earnings Badge (host only) ── */
.gift-earnings-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #f59e0b;
}

/* ── Tabs ── */
.profile-tabs-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}

.profile-tabs-arrow {
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 20px;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity .15s;
  padding: 0;
  user-select: none;
}
.profile-tabs-arrow:hover  { opacity: 0.7; }
.profile-tabs-arrow:disabled { opacity: 0.25; cursor: default; }

.profile-tabs {
  display: flex;
  flex: 1;
  background: var(--bg-card);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.profile-tabs::-webkit-scrollbar { display: none; }

.profile-tab {
  flex: 0 0 auto;
  background: none;
  border: none;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 8px;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}

.profile-tab:hover { color: var(--text-secondary); }
.profile-tab.active {
  background: var(--bg-panel);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ── Lists ── */
.profile-list {
  min-height: 80px;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-list::-webkit-scrollbar { width: 3px; }
.profile-list::-webkit-scrollbar-track { background: transparent; }
.profile-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.profile-list--hidden { display: none; }

.profile-list__empty {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 24px 16px;
  line-height: 1.5;
}

.profile-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s;
}

.profile-user-item:hover { border-color: var(--accent); }

.profile-user-item__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.profile-user-item__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.profile-user-item__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-user-item__email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Actions ── */
.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.btn--auth-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 12px;
  font-size: 14px;
  width: 100%;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s;
}

.btn--auth-secondary:hover { border-color: var(--accent); color: var(--text-primary); }

/* ════════════════════════════════════════
   SEARCH SCREEN
════════════════════════════════════════ */
#screenSearch {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px 16px 40px;
  overflow-y: auto;
}

.search-page {
  width: 480px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header */
.search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}

.search-title {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.btn--back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn--back:hover { border-color: var(--accent); color: var(--text-primary); }

.btn--join-sm {
  background: linear-gradient(135deg, var(--accent), var(--accent-pink));
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.btn--join-sm:hover { opacity: 0.88; }

/* Search bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-panel);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 13px 16px;
  transition: border-color 0.15s;
}

.search-bar:focus-within { border-color: var(--accent); }

.search-bar__icon { color: var(--text-muted); flex-shrink: 0; }

.search-bar__input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
}

.search-bar__input::placeholder { color: var(--text-muted); }

/* Results */
.search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Status / empty states */
.search-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 16px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  line-height: 1.5;
}

.search-status__icon { font-size: 36px; opacity: 0.5; }
.search-status__hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Spinner */
.search-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* User cards */
.search-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.15s;
  animation: cardIn 0.18s ease;
}

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

.search-user-card:hover { border-color: rgba(139,92,246,0.4); }

.search-user-card__avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.search-user-card__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.search-user-card__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-user-card__followers {
  font-size: 12px;
  color: var(--text-muted);
}

/* Follow button on search cards */
.search-follow-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-pink));
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.search-follow-btn:hover:not(:disabled) { opacity: 0.85; }
.search-follow-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.search-follow-btn--following {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-muted);
}

/* Action button group on search cards (follow + block) */
.search-user-card__actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
  flex-shrink: 0;
}

/* Block button on search cards */
.search-block-btn {
  background: none;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
.search-block-btn:hover:not(:disabled) {
  border-color: #ef4444;
  color: #ef4444;
}
.search-block-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Block button on profile follower/following list items */
.block-user-btn {
  background: none;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.block-user-btn:hover:not(:disabled) {
  border-color: #ef4444;
  color: #ef4444;
}
.block-user-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Unblock button on Blocked tab */
.unblock-btn {
  background: none;
  border: 1px solid var(--accent-pink);
  color: var(--accent-pink);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.unblock-btn:hover:not(:disabled) { opacity: 0.7; }
.unblock-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Mobile */
@media (max-width: 768px) {
  #screenSearch {
    padding: 20px 16px 40px;
  }

  .search-page {
    width: 100%;
    max-width: 100%;
    min-height: calc(100dvh - 40px);
  }
}

/* ════════════════════════════════════════
   WHO'S LIVE SCREEN
════════════════════════════════════════ */
#screenLive {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 48px;
  overflow-y: auto;
}

.live-page {
  width: 480px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}


/* Header */
.live-page__header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-page__title {
  flex: 1;
  font-size: 20px;
  font-weight: 700;
}

.live-page__count {
  font-size: 12px;
  font-weight: 700;
  background: var(--danger, #ef4444);
  color: #fff;
  border-radius: 10px;
  padding: 3px 10px;
  white-space: nowrap;
}

.live-page__header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Go Live button in header */
.live-golive-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-pink));
  border: none;
  border-radius: 20px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.1s;
}
.live-golive-btn:hover  { opacity: 0.88; transform: scale(1.02); }
.live-golive-btn:active { transform: scale(0.97); }

/* Hamburger button */
.live-hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.15s;
}
.live-hamburger-btn:hover { background: rgba(255,255,255,0.08); }
.live-hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
}

/* Drawer overlay */
.live-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 900;
}
.live-drawer-overlay.open { display: block; }

/* Slide-in drawer */
.live-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 280px;
  max-width: 85vw;
  height: 100%;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  z-index: 901;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
}
.live-drawer.open { transform: translateX(0); }

/* Drawer header with avatar + user info */
.live-drawer__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}
.live-drawer__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}
.live-drawer__userinfo {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.live-drawer__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-drawer__email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-drawer__close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}
.live-drawer__close:hover { color: var(--text-primary); }

/* Drawer nav links */
.live-drawer__nav {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}
.live-drawer__item {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  padding: 13px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.12s;
}
.live-drawer__item:hover { background: rgba(255,255,255,0.06); }
.live-drawer__divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}
.live-drawer__item--signout { color: var(--danger); }
.drawer-msg-badge {
  margin-left: auto;
}

/* Tabs */
.live-tabs {
  display: flex;
  background: var(--bg-panel);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}
.live-tab {
  flex: 1;
  padding: 8px 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.live-tab--active {
  background: var(--bg-card);
  color: var(--text-primary);
}
.live-tab:hover:not(.live-tab--active) {
  color: var(--text-primary);
}

/* Loading */
.live-page__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* Empty state */
.live-page__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 60px 0;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

.live-page__empty-icon { font-size: 40px; opacity: 0.5; }
.live-page__empty-hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Stream card grid — Twitch style */
.live-page__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Individual card */
.live-card {
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  animation: cardIn 0.2s ease;
  transition: transform 0.15s;
}
.live-card:hover { transform: scale(1.02); }

/* Square full-bleed thumbnail */
.live-card__thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-panel);
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}

.live-card__thumb-initial {
  font-size: 4rem;
  font-weight: 800;
  color: rgba(255,255,255,0.7);
  user-select: none;
}

/* LIVE badge — top left */
.live-card__thumb-top {
  position: absolute;
  top: 8px;
  left: 8px;
}

/* Viewer count — bottom left */
.live-card__thumb-bottom {
  position: absolute;
  bottom: 8px;
  left: 8px;
}

.live-card__viewers {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: rgba(0,0,0,0.6);
  border-radius: 4px;
  padding: 2px 6px;
}

/* Pulsing LIVE pill */
.live-badge--pill {
  display: inline-flex;
  align-items: center;
  background: var(--danger, #ef4444);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  border-radius: 4px;
  padding: 2px 7px;
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

/* Info row below thumbnail */
.live-card__info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 2px 4px;
}

/* Small circular avatar */
.live-card__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  background-size: cover;
  background-position: center;
}

.live-card__details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.live-card__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-card__channel {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  #screenLive { padding: 16px 12px 40px; }
  .live-page  { width: 100%; max-width: 100%; }
  .live-page__list { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ════════════════════════════════════════
   LEADERBOARD SCREEN
════════════════════════════════════════ */
#screenLeaderboard {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 48px;
  overflow-y: auto;
}

#screenLeaderboard .live-page {
  width: 100%;
  max-width: 640px;
}

#screenLeaderboard .live-page__count {
  background: var(--accent, #8b5cf6);
}

/* Leaderboard item — responsive tweaks */
.leaderboard-item {
  padding: 12px 14px;
}

.leaderboard-item__rank {
  font-size: 20px;
  min-width: 36px;
}

.leaderboard-item__avatar {
  width: 42px;
  height: 42px;
  font-size: 17px;
}

.leaderboard-item__name {
  font-size: 14px;
}

.leaderboard-item__total {
  font-size: 14px;
}

@media (max-width: 600px) {
  #screenLeaderboard { padding: 14px 10px 40px; }
  #screenLeaderboard .live-page { max-width: 100%; }

  .leaderboard-item { padding: 10px 12px; gap: 8px; }
  .leaderboard-item__rank { font-size: 17px; min-width: 28px; }
  .leaderboard-item__avatar { width: 34px; height: 34px; font-size: 14px; }
  .leaderboard-item__name { font-size: 13px; }
  .leaderboard-item__total { font-size: 13px; }
}

@media (max-width: 380px) {
  .leaderboard-item { padding: 9px 10px; gap: 6px; }
  .leaderboard-item__rank { font-size: 15px; min-width: 24px; }
  .leaderboard-item__avatar { width: 30px; height: 30px; font-size: 12px; }
  .leaderboard-item__name { font-size: 12px; }
  .leaderboard-item__total { font-size: 12px; }
  .leaderboard-item__you { font-size: 9px; padding: 1px 4px; }
}

/* ════════════════════════════════════════
   COMMUNITY GALLERY SCREEN
════════════════════════════════════════ */
#screenGallery {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px 16px 48px;
  overflow-y: auto;
}

.gallery-page {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Header */
.gallery-page__header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gallery-page__title {
  flex: 1;
  font-size: 20px;
  font-weight: 700;
}

.gallery-page__count {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* Filter pill row */
.gallery-page__filters {
  display: flex;
  gap: 8px;
}

.gallery-filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.gallery-filter-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.gallery-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Loading state */
.gallery-page__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* Empty state */
.gallery-page__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 60px 0;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

/* Photo card grid — auto-fill columns, min 200px each */
.gallery-page__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

/* Individual card */
.gallery-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
  cursor: pointer;
}

.gallery-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Image + overlay */
.gallery-card__img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-card);
}

.gallery-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s;
}

.gallery-card:hover .gallery-card__img { transform: scale(1.05); }

/* Hover overlay with action buttons */
.gallery-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.18s;
}

.gallery-card:hover .gallery-card__overlay { opacity: 1; }

.gallery-card__view-btn,
.gallery-card__delete-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.gallery-card__view-btn {
  background: rgba(255,255,255,0.92);
  color: #111;
}

.gallery-card__delete-btn {
  background: rgba(220,38,38,0.85);
  color: #fff;
}

.gallery-card__view-btn:hover   { opacity: 0.88; }
.gallery-card__delete-btn:hover { opacity: 0.88; }
.gallery-card__delete-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Meta row: avatar + name + date */
.gallery-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

.gallery-card__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

.gallery-card__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.gallery-card__name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-card__date {
  font-size: 10px;
  color: var(--text-muted);
}

/* Mobile: 2-column grid */
@media (max-width: 600px) {
  #screenGallery { padding: 16px 12px 48px; }

  .gallery-page__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .gallery-card__view-btn span,
  .gallery-card__delete-btn span { display: none; }
}

/* ════════════════════════════════════════
   PHOTO GALLERY
════════════════════════════════════════ */

/* Photos tab badge (photo count) */
.profile-tab__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  margin-left: 5px;
  min-width: 18px;
  line-height: 1.6;
}

/* Photo grid inside the profile list panel */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px 0;
}

/* Individual photo thumbnail */
.gallery-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  cursor: pointer;
  border: 1px solid var(--border);
  transition: border-color 0.15s;
}

.gallery-item:hover { border-color: var(--accent); }

.gallery-item__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.gallery-item:hover .gallery-item__img { transform: scale(1.04); }

/* Delete button — top-right corner of each thumbnail */
.gallery-item__delete {
  position: absolute;
  z-index: 2;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.65);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  width: 22px;
  height: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  line-height: 1;
}

.gallery-item:hover .gallery-item__delete { opacity: 1; }
.gallery-item__delete:hover { background: rgba(220,38,38,0.85); }

/* "Add photo" upload tile (same size as a thumbnail) */
.gallery-upload-tile {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  border: 2px dashed var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.gallery-upload-tile:hover { border-color: var(--accent); color: var(--accent); }

/* Empty gallery state wrapper */
.gallery-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

/* ── Upload progress bar ── */
.upload-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upload-progress-track {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-pink));
  border-radius: 3px;
  transition: width 0.2s ease;
}

.upload-progress-label {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ════════════════════════════════════════
   PHOTO LIGHTBOX
════════════════════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: lbIn 0.2s ease;
}

@keyframes lbIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox--hidden { display: none !important; }

.lightbox__img {
  max-width: min(90vw, 900px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.7);
  animation: lbImgIn 0.2s ease;
}

@keyframes lbImgIn {
  from { transform: scale(0.94); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.lightbox__close:hover { background: rgba(255,255,255,0.22); }

/* ── Push Notifications ───────────────────────────────────────────────────── */

/* Red badge for unread alerts (overrides purple) */
.profile-tab__badge--unread {
  background: #ef4444;
}

/* Popover needs a positioned ancestor */
.stream-header__right {
  position: relative;
}

/* Bell button accent colour */
.notify-btn {
  color: var(--accent, #8b5cf6);
}

/* Notify popover card */
.notify-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--bg-panel, #1e1e2e);
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 14px;
  padding: 14px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notify-popover--hidden {
  display: none !important;
}

.notify-popover__label {
  font-size: .75rem;
  color: var(--text-muted, rgba(255,255,255,.5));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.notify-popover__caption {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 8px;
  color: var(--text, #e2e8f0);
  font-size: .88rem;
  padding: 8px 10px;
  resize: none;
  font-family: inherit;
  line-height: 1.4;
}

.notify-popover__caption:focus {
  outline: none;
  border-color: var(--accent, #8b5cf6);
}

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

.btn--notify-send {
  flex: 1;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}

.btn--notify-send:hover  { opacity: .9; }
.btn--notify-send:disabled { opacity: .55; cursor: default; }

.notify-popover__status {
  font-size: .8rem;
  color: var(--accent, #8b5cf6);
  min-height: 1.1em;
}

/* ── Notification list items ─────────────────────────────────────────────── */

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background .15s;
}

.notif-item--unread {
  background: rgba(139, 92, 246, .08);
}

.notif-item__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
  background-size: cover;
  background-position: center;
}

.notif-item__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.notif-item__name {
  font-weight: 600;
  font-size: .88rem;
  color: var(--text, #e2e8f0);
}

.notif-item__caption {
  font-size: .84rem;
  color: var(--text-muted, rgba(255,255,255,.6));
  word-break: break-word;
}

.notif-item__time {
  font-size: .74rem;
  color: var(--text-muted, rgba(255,255,255,.4));
}

/* ── Password Reset Screen ───────────────────────────────────────────────── */

.reset-subtitle {
  font-size: .88rem;
  color: var(--text-muted, rgba(255,255,255,.55));
  text-align: center;
  margin-bottom: 18px;
}

.reset-email-label {
  font-size: .84rem;
  color: var(--accent, #8b5cf6);
  text-align: center;
  margin-bottom: 16px;
  font-weight: 500;
  min-height: 1.2em;
}

/* ── Direct Messages ─────────────────────────────────────────────────────── */

/* Messages badge on the profile button */
.messages-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  vertical-align: middle;
}

/* DM button (💬) on user cards and list items */
.btn--dm {
  background: none;
  border: 1px solid var(--border, rgba(255,255,255,.15));
  color: var(--text-muted, rgba(255,255,255,.55));
  border-radius: 8px;
  padding: 4px 9px;
  font-size: .85rem;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  flex-shrink: 0;
}
.btn--dm:hover { border-color: var(--accent, #8b5cf6); color: var(--accent, #8b5cf6); }

/* ── Inbox screen ────────────────────────────────────────────────────────── */
.messages-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--bg, #0f0f17);
}

.messages-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
  flex-shrink: 0;
}

.messages-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text, #e2e8f0);
  flex: 1;
}

.messages-header__spacer { width: 64px; }

.conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Conversation row */
.conv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s;
  border: 1px solid transparent;
}
.conv-row:hover { background: var(--bg-panel, #1e1e2e); border-color: var(--border, rgba(255,255,255,.08)); }
.conv-row--unread { background: rgba(139,92,246,.07); border-color: rgba(139,92,246,.2); }

.conv-row__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background-size: cover;
  background-position: center;
}

.conv-row__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.conv-row__name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text, #e2e8f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-row__preview {
  font-size: .8rem;
  color: var(--text-muted, rgba(255,255,255,.5));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-row__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.conv-row__time {
  font-size: .72rem;
  color: var(--text-muted, rgba(255,255,255,.4));
}

.conv-row__unread {
  background: #ef4444;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ── Conversation thread screen ──────────────────────────────────────────── */
.conversation-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--bg, #0f0f17);
}

.conversation-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
  flex-shrink: 0;
}

.conv-header__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

.conv-header__name {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text, #e2e8f0);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Message bubbles area */
.conv-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.msg-row {
  display: flex;
}
.msg-row--sent     { justify-content: flex-end; }
.msg-row--received { justify-content: flex-start; }

.msg-bubble {
  max-width: 72%;
  padding: 9px 13px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  word-break: break-word;
}

.msg-bubble--sent {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-bubble--received {
  background: var(--bg-panel, #1e1e2e);
  border: 1px solid var(--border, rgba(255,255,255,.1));
  color: var(--text, #e2e8f0);
  border-bottom-left-radius: 4px;
}

.msg-text {
  font-size: .88rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.msg-time {
  font-size: .68rem;
  opacity: .65;
  align-self: flex-end;
}

/* Input bar */
.dm-input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border, rgba(255,255,255,.08));
  flex-shrink: 0;
  background: var(--bg, #0f0f17);
}

.dm-textarea {
  flex: 1;
  background: var(--bg-panel, #1e1e2e);
  border: 1px solid var(--border, rgba(255,255,255,.12));
  border-radius: 20px;
  color: var(--text, #e2e8f0);
  font-size: .9rem;
  padding: 10px 16px;
  resize: none;
  font-family: inherit;
  line-height: 1.4;
  max-height: 120px;
  overflow-y: auto;
}
.dm-textarea:focus { outline: none; border-color: var(--accent, #8b5cf6); }
.dm-textarea::placeholder { color: var(--text-muted, rgba(255,255,255,.35)); }

.btn--dm-send {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
.btn--dm-send:hover  { opacity: .88; }
.btn--dm-send:disabled { opacity: .45; cursor: default; }

/* ── Stream Summary Modal ──────────────────────────────────────────────────── */
.summary-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.summary-modal--hidden { display: none !important; }

.summary-modal__card {
  background: #1a1a2e;
  border: 1px solid rgba(139,92,246,.25);
  border-radius: 20px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.summary-modal__title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  text-align: center;
  margin: 0;
}

/* Stat pills */
.summary-stats {
  display: flex;
  gap: 12px;
}
.summary-stat {
  flex: 1;
  background: rgba(139,92,246,.15);
  border: 1px solid rgba(139,92,246,.3);
  border-radius: 14px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.summary-stat__value {
  font-size: 1.6rem;
  font-weight: 800;
  color: #c4b5fd;
  line-height: 1;
}
.summary-stat__label {
  font-size: .72rem;
  color: rgba(255,255,255,.55);
  text-align: center;
}

/* Section headers */
.summary-section-title {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  margin: 0;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* Viewer row */
.summary-viewer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 180px;
  overflow-y: auto;
}
.summary-viewer {
  display: flex;
  align-items: center;
  gap: 10px;
}
.summary-viewer__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
  background: #8b5cf6;
}
.summary-viewer__name {
  font-size: .9rem;
  color: rgba(255,255,255,.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Gifter row */
.summary-gifter-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 180px;
  overflow-y: auto;
}
.summary-gifter {
  display: flex;
  align-items: center;
  gap: 10px;
}
.summary-gifter__rank {
  font-size: 1.1rem;
  width: 26px;
  text-align: center;
  flex-shrink: 0;
}
.summary-gifter__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
  background: #8b5cf6;
}
.summary-gifter__name {
  flex: 1;
  font-size: .9rem;
  color: rgba(255,255,255,.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.summary-gifter__amount {
  font-size: .85rem;
  font-weight: 700;
  color: #c4b5fd;
  flex-shrink: 0;
}

/* Empty state */
.summary-empty {
  font-size: .85rem;
  color: rgba(255,255,255,.4);
  text-align: center;
  margin: 4px 0;
}

/* Done button */
.summary-done-btn {
  margin-top: 4px;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity .15s;
}
.summary-done-btn:hover { opacity: .88; }

/* ── Co-host Mode ─────────────────────────────────────────────────────────── */

/* PiP video overlay — top-right of stream-video, below the stream header */
.cohp-video {
  position: absolute;
  top: 72px;
  right: 8px;
  /* Fluid sizing: scales with viewport, capped at desktop max */
  width: clamp(115px, 26vw, 200px);
  height: clamp(140px, 32vw, 240px);
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #8b5cf6;
  z-index: 30;
  background: #000;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
}

/* Tablet */
@media (max-width: 768px) {
  .cohp-video {
    width: clamp(110px, 30vw, 160px);
    height: clamp(135px, 37vw, 195px);
    top: 64px;
    right: 6px;
    border-radius: 8px;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .cohp-video {
    width: clamp(100px, 32vw, 140px);
    height: clamp(122px, 39vw, 170px);
    top: 58px;
    right: 6px;
    border-radius: 6px;
  }
}

/* Co-host invite popover (anchored to coHostBtn) */
.cohp-popover {
  position: absolute;
  top: 48px;
  right: 0;
  width: 240px;
  background: #1a1a2e;
  border: 1px solid rgba(139,92,246,.3);
  border-radius: 14px;
  padding: 12px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.cohp--hidden { display: none !important; }

.cohp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .85rem;
  font-weight: 700;
  color: rgba(255,255,255,.8);
}
.cohp-close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
}

.cohp-active-label {
  font-size: .75rem;
  color: #a78bfa;
  font-weight: 600;
}
.cohp-remove-btn {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  background: rgba(239,68,68,.15);
  border: 1px solid rgba(239,68,68,.3);
  color: #fca5a5;
  font-size: .8rem;
  cursor: pointer;
}

.cohp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}
.cohp-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cohp-item__name {
  font-size: .85rem;
  color: rgba(255,255,255,.85);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cohp-invite-btn {
  padding: 5px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.cohp-empty {
  font-size: .82rem;
  color: rgba(255,255,255,.4);
  text-align: center;
  margin: 4px 0;
}

/* Invite banner — shown to invited viewer inside stream-video */
.cohp-banner {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26,26,46,.95);
  border: 1px solid #8b5cf6;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 40;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.cohp-banner--hidden { display: none !important; }

#coHostBannerText {
  font-size: .85rem;
  color: rgba(255,255,255,.9);
  max-width: 160px;
  white-space: normal;
}
.cohp-banner-btn {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.cohp-banner-btn--accept {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
}
.cohp-banner-btn--decline {
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.7);
}

/* Co-hosting status pill (stream-header__left) */
.cohp-indicator {
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
}

/* Leave co-host button — bottom-left of stream video */
.cohp-leave-btn {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(26,26,46,.9);
  border: 1px solid #8b5cf6;
  color: #c4b5fd;
  font-size: .78rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  z-index: 30;
}
.cohp-leave-btn--hidden { display: none !important; }

/* ── Last Stream Tab (profile page) ───────────────────────────────────────── */
.ls-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ls-date {
  font-size: .78rem;
  color: rgba(0,0,0,.45);
  margin: 0;
  text-align: center;
}
.ls-stats {
  display: flex;
  gap: 12px;
}
.ls-stat {
  flex: 1;
  background: linear-gradient(135deg, rgba(139,92,246,.1), rgba(124,58,237,.08));
  border: 1px solid rgba(139,92,246,.25);
  border-radius: 14px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ls-stat__value {
  font-size: 1.6rem;
  font-weight: 800;
  color: #7c3aed;
  line-height: 1;
}
.ls-stat__label {
  font-size: .72rem;
  color: rgba(0,0,0,.5);
  text-align: center;
}
.ls-section-title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(0,0,0,.4);
  margin: 0;
  padding-top: 4px;
  border-top: 1px solid rgba(0,0,0,.08);
}
.ls-viewer-list,
.ls-gifter-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 200px;
  overflow-y: auto;
}
.ls-viewer,
.ls-gifter {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ls-viewer__avatar,
.ls-gifter__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
  background: #8b5cf6;
}
.ls-viewer__name,
.ls-gifter__name {
  font-size: .9rem;
  color: rgba(0,0,0,.8);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ls-gifter__rank {
  font-size: 1.05rem;
  width: 26px;
  text-align: center;
  flex-shrink: 0;
}
.ls-gifter__amount {
  font-size: .85rem;
  font-weight: 700;
  color: #7c3aed;
  flex-shrink: 0;
}
.ls-empty {
  font-size: .85rem;
  color: rgba(0,0,0,.4);
  text-align: center;
  margin: 4px 0;
}

/* ── Last Stream Full-Screen Page ─────────────────────────────────────────── */
#screenLastStream .live-page__title {
  color: #7c3aed;
}

.last-stream-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-main, #f5f5f5);
}

.last-stream-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ls-full-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 32px;
}

.ls-full-date {
  text-align: center;
  font-size: .8rem;
  color: rgba(0,0,0,.45);
  margin: 0;
}

.ls-full-stats {
  display: flex;
  gap: 14px;
}

.ls-full-stat {
  flex: 1;
  background: #fff;
  border: 1px solid rgba(139,92,246,.2);
  border-radius: 18px;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 12px rgba(139,92,246,.08);
}

.ls-full-stat__value {
  font-size: 2.2rem;
  font-weight: 800;
  color: #7c3aed;
  line-height: 1;
}

.ls-full-stat__label {
  font-size: .78rem;
  color: rgba(0,0,0,.5);
  text-align: center;
}

.ls-full-section {
  background: #fff;
  border-radius: 18px;
  padding: 18px 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ls-full-section__title {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(0,0,0,.4);
  margin: 0;
}

.ls-full-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ls-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ls-row__rank {
  font-size: 1.2rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.ls-row__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
  background: #8b5cf6;
}

.ls-row__name {
  flex: 1;
  font-size: .95rem;
  font-weight: 500;
  color: rgba(0,0,0,.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ls-row__amount {
  font-size: .9rem;
  font-weight: 700;
  color: #7c3aed;
  flex-shrink: 0;
}

.ls-full-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 24px;
  text-align: center;
  color: rgba(0,0,0,.5);
  font-size: .95rem;
}

.ls-full-empty-hint {
  font-size: .85rem;
  color: rgba(0,0,0,.4);
  margin: 0;
  text-align: center;
}
