:root {
  --bg-dark: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --border-color: #e2e8f0;
  --border-highlight: rgba(99, 102, 241, 0.3);
  
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.15);
  --accent: #06b6d4;
  --live-red: #dc2626;
  --live-red-glow: rgba(220, 38, 38, 0.2);
  --success: #059669;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  --font-family: 'Plus Jakarta Sans', 'Outfit', -apple-system, sans-serif;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-main: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(79, 70, 229, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(6, 182, 212, 0.04) 0%, transparent 40%);
}

/* NAVBAR */
.navbar {
  height: 70px;
  padding: 0 2rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  position: relative;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.logo-icon svg {
  width: 22px;
  height: 22px;
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.logo-text span {
  color: var(--primary);
}

/* STATUS BADGE */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.status-badge.offline {
  background: #f1f5f9;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.status-badge.offline .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--text-dim);
}

.status-badge.live {
  background: #fee2e2;
  color: var(--live-red);
  border: 1px solid #fca5a5;
  box-shadow: 0 0 15px var(--live-red-glow);
}

.status-badge.live .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--live-red);
  animation: pulse-red 1.5s infinite;
}

.tg-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.tg-badge.hidden {
  display: none !important;
}

.server-mode-selector {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  outline: none;
}

@keyframes pulse-red {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.viewer-count-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.85rem;
  color: var(--text-muted);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.viewer-count-pill svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.viewer-count-pill #viewerCount {
  color: var(--text-main);
  font-weight: 800;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--primary-glow);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-donate {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
  font-weight: 700;
}

.btn-donate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.4);
}

.channel-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.btn-reaction {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  font-size: 1.2rem;
  padding: 6px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-reaction:hover {
  transform: scale(1.15) translateY(-2px);
  background: #e0e7ff;
}

/* FLOATING ANIMATED EMOJIS LAYER OVER VIDEO */
.floating-reactions-layer {
  position: absolute;
  bottom: 15px;
  left: 0;
  width: 100%;
  height: 250px;
  pointer-events: none;
  overflow: hidden;
  z-index: 20;
}

.floating-emoji {
  position: absolute;
  bottom: 0;
  font-size: 2rem;
  opacity: 1;
  animation: floatUp 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes floatUp {
  0% { transform: translateY(0) scale(0.6); opacity: 1; }
  50% { transform: translateY(-120px) scale(1.2) rotate(15deg); opacity: 0.9; }
  100% { transform: translateY(-240px) scale(1) rotate(-15deg); opacity: 0; }
}

/* MODO TEATRO */
.main-layout.theater-mode {
  grid-template-columns: 1fr;
  max-width: 100%;
  padding: 10px;
}

.main-layout.theater-mode .chat-section {
  height: 400px;
  position: static;
}

/* DONATION MODAL STYLES */
.donation-card {
  max-width: 580px;
}

.donation-amount-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.amount-btn {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.amount-btn:hover, .amount-btn.active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
}

.paypal-action-box {
  margin-top: 16px;
}

.btn-paypal-direct {
  background: #0070ba;
  color: white;
  justify-content: center;
  padding: 14px;
  font-size: 0.95rem;
}

.btn-paypal-direct:hover {
  background: #005ea6;
}

/* SUPER CHAT ITEM */
.super-chat-item {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid #f59e0b;
  border-radius: 12px;
  padding: 12px;
  margin: 4px 0;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
  animation: bounceIn 0.4s ease;
}

@keyframes bounceIn {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.super-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.super-chat-user {
  font-weight: 800;
  color: #b45309;
  font-size: 0.9rem;
}

.super-chat-badge {
  background: #f59e0b;
  color: white;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 12px;
}

.super-chat-text {
  color: #78350f;
  font-weight: 600;
  font-size: 0.9rem;
}

/* MAIN LAYOUT */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  padding: 20px;
  max-width: 1750px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

/* STREAM SECTION */
.stream-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.video-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000000;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-main);
}

.artplayer-box {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* OVERLAY OFFLINE LIGHT */
.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #ffffff, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 10;
}

.video-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.radar-box {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #e0e7ff;
  border: 1px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  z-index: 2;
}

.radar-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--primary);
  opacity: 0;
  animation: radar-expand 3s infinite ease-out;
}

.radar-ring.r1 { animation-delay: 0s; }
.radar-ring.r2 { animation-delay: 1s; }
.radar-ring.r3 { animation-delay: 2s; }

@keyframes radar-expand {
  0% { width: 40px; height: 40px; opacity: 0.6; }
  100% { width: 130px; height: 130px; opacity: 0; }
}

.offline-content h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.offline-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
  max-width: 450px;
  line-height: 1.5;
}

.offline-content code {
  background: #e0e7ff;
  color: var(--primary);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}

.overlay-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* STREAM DETAILS */
.stream-details {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-main);
}

.channel-info {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.avatar {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--primary);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stream-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.3;
}

.channel-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.channel-name {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge.category {
  background: #e0e7ff;
  color: var(--primary);
  border: 1px solid #c7d2fe;
}

.badge.quality {
  background: #d1fae5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.stream-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.stat-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.stat-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.text-green { color: var(--success); }

/* CHAT SECTION LIGHT */
.chat-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 110px);
  max-height: 800px;
  position: sticky;
  top: 90px;
  box-shadow: var(--shadow-main);
}

.chat-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main);
}

.chat-title svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.chat-status {
  font-size: 0.75rem;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.pulse-online {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.user-config {
  padding: 10px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: relative;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.user-config-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.user-config input {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  outline: none;
  flex: 1;
  font-weight: 600;
  transition: all 0.2s ease;
}

.user-config input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-color-picker {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.btn-color-picker:hover {
  background: #f1f5f9;
  border-color: var(--primary);
}

.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
  display: inline-block;
}

.color-popover {
  position: absolute;
  top: 100%;
  left: 18px;
  right: 18px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.color-popover-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.color-swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.swatch-btn {
  height: 28px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.swatch-btn:hover {
  transform: scale(1.08);
}

.swatch-btn.active {
  border-color: #0f172a;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

.custom-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  padding-top: 4px;
  border-top: 1px solid var(--border-color);
}

.custom-color-row input[type="color"] {
  border: none;
  background: none;
  width: 28px;
  height: 28px;
  cursor: pointer;
  padding: 0;
}

/* TRIVIA BANNER CARD */
.trivia-banner-card {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  border-bottom: 1px solid #c4b5fd;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeIn 0.3s ease;
}

.trivia-banner-card.hidden {
  display: none !important;
}

.trivia-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trivia-badge {
  font-size: 0.7rem;
  font-weight: 800;
  color: #6d28d9;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.trivia-points {
  font-size: 0.75rem;
  font-weight: 800;
  background: #7c3aed;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
}

.trivia-question {
  font-size: 0.88rem;
  font-weight: 700;
  color: #4c1d95;
  line-height: 1.3;
}

.trivia-hint {
  font-size: 0.72rem;
  color: #6b21a8;
  font-weight: 500;
}

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  background: #ffffff;
}

.system-message {
  background: #e0e7ff;
  border: 1px dashed #c7d2fe;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--primary);
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.chat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: fadeInMsg 0.2s ease;
}

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

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

.msg-user {
  font-size: 0.82rem;
  font-weight: 800;
}

.msg-time {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.msg-text {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.4;
  word-break: break-word;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  padding: 6px 12px;
  border-radius: 10px;
}

.chat-input-box {
  padding: 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
  background: #ffffff;
}

.chat-input-box input {
  flex: 1;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
  font-weight: 500;
}

.chat-input-box input:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 10px var(--primary-glow);
}

.btn-send {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-send:hover {
  background: var(--primary-hover);
}

.btn-send svg {
  width: 18px;
  height: 18px;
}

/* MODAL OBS & DONATE LIGHT */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 650px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-backdrop.active .modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.modal-header h2 {
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.btn-close:hover { color: var(--text-main); }

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 75vh;
  overflow-y: auto;
  background: #ffffff;
}

.modal-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.step-item {
  display: flex;
  gap: 14px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 14px;
  border-radius: var(--radius-md);
}

.step-item.highlight {
  background: #e0e7ff;
  border-color: #c7d2fe;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--text-main);
}

.step-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.input-copy-group {
  margin-top: 10px;
}

.input-copy-group label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 700;
}

.field-box {
  display: flex;
  gap: 8px;
}

.field-box input {
  flex: 1;
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--primary);
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 700;
}

.btn-copy {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
}

.btn-copy:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.settings-list {
  list-style: none;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  background: #f8fafc;
}

.paypal-action-box {
  margin-top: 16px;
  width: 100%;
}

#paypal-button-container {
  width: 100%;
  min-height: 45px;
}

.justify-between {
  justify-content: space-between !important;
}

/* TOAST NOTIFICATION LIGHT */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease;
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sys-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--primary);
}

.header-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--primary);
}

.spin {
  animation: spin 1s linear infinite;
}

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

.text-amber { color: #d97706; }
.text-red { color: #dc2626; }
.text-primary { color: var(--primary); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .chat-section {
    height: 500px;
    position: static;
  }
}

/* SOCIAL MEDIA BUTTONS */
.social-links-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  color: #ffffff !important;
}

.social-btn svg {
  flex-shrink: 0;
}

.social-btn.instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  box-shadow: 0 2px 8px rgba(220, 39, 67, 0.25);
}

.social-btn.instagram:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 39, 67, 0.4);
  color: #ffffff !important;
}

.social-btn.facebook {
  background: #1877f2;
  box-shadow: 0 2px 8px rgba(24, 119, 242, 0.25);
}

.social-btn.facebook:hover {
  background: #166fe5;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.4);
  color: #ffffff !important;
}

/* CUSTOM GLASSMORPHISM LIVE PLAYER CONTROLS */
.unmute-banner {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  padding: 8px 20px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
  animation: pulse-bounce 2s infinite ease-in-out;
}

.unmute-banner:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 6px 25px rgba(245, 158, 11, 0.6);
}

.unmute-banner.hidden {
  display: none !important;
}

@keyframes pulse-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
}

.player-controls-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 14px;
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-container:hover .player-controls-layer,
.player-controls-layer.active {
  opacity: 1;
}

.controls-bar {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.controls-left, .controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ctrl-btn {
  background: transparent;
  border: none;
  color: #f8fafc;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.15s ease;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
  color: #ffffff;
}

.volume-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.volume-slider {
  width: 75px;
  height: 4px;
  accent-color: var(--primary);
  cursor: pointer;
  border-radius: 4px;
}

.player-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.live-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #ef4444;
  animation: live-dot-pulse 1.5s infinite;
}

@keyframes live-dot-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.latency-tag {
  font-size: 0.75rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

/* ============================================================= */
/* TELEGRAM MINI APP (TMA) & MOBILE ULTRA-RESPONSIVE SYSTEM */
/* ============================================================= */

body.in-telegram {
  min-height: var(--tg-vh, 100dvh);
  height: var(--tg-vh, 100dvh);
  overflow: hidden;
}

body.in-telegram .navbar {
  height: 52px;
  padding: 0 12px;
}

body.in-telegram .main-layout {
  height: calc(var(--tg-vh, 100dvh) - 52px);
  padding: 8px;
  gap: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 100%;
}

@media (max-width: 900px) {
  .navbar {
    height: 54px;
    padding: 0 12px;
  }

  .nav-brand {
    gap: 8px;
  }

  .logo-text {
    font-size: 1.15rem;
  }

  .server-mode-selector {
    display: none !important;
  }

  .nav-actions {
    gap: 6px;
  }

  .nav-actions .btn span {
    display: none;
  }

  .nav-actions .btn {
    padding: 7px 10px;
    border-radius: 10px;
  }

  .viewer-count-pill {
    padding: 4px 10px;
    font-size: 0.78rem;
  }

  .main-layout {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 10px;
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 54px);
    overflow: hidden;
  }

  .stream-section {
    flex-shrink: 0;
    gap: 8px;
  }

  .video-container {
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
  }

  .stream-details {
    padding: 10px 12px;
    gap: 10px;
  }

  .stream-title {
    font-size: 1rem;
    line-height: 1.25;
    margin-bottom: 2px;
  }

  .channel-info {
    gap: 10px;
  }

  .avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .stream-stats-bar {
    display: flex;
    gap: 8px;
    padding-top: 8px;
  }

  .stat-card {
    flex: 1;
    padding: 6px 8px;
  }

  .stat-label {
    font-size: 0.65rem;
  }

  .stat-value {
    font-size: 0.82rem;
  }

  .chat-section {
    flex: 1;
    height: 100%;
    min-height: 0;
    position: static;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 0;
  }

  .chat-header {
    padding: 10px 14px;
  }

  .user-config {
    padding: 8px 12px;
  }

  .chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .chat-input-area {
    padding: 8px 10px;
  }

  .toast-container {
    bottom: 12px;
    right: 12px;
    left: 12px;
  }

  .toast {
    font-size: 0.82rem;
    padding: 10px 14px;
  }

  .modal-card {
    max-width: 92vw;
    padding: 18px;
    border-radius: 16px;
  }
}


