/* =====================================================
   TikTok Live Player – Premium Glassmorphic Theme
   ===================================================== */

:root {
  /* Dynamic Background and Overlays */
  --bg-dark: #09090e;
  --bg-gradient-start: #110e1e;
  --bg-gradient-end: #07070a;

  /* Glass Surfaces */
  --glass-bg: rgba(22, 22, 35, 0.45);
  --glass-bg-hover: rgba(35, 35, 55, 0.55);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-highlight: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

  /* Accents */
  --accent: #8b5cf6;
  --accent-light: #c4b5fd;
  --accent-glow: rgba(139, 92, 246, 0.4);
  --accent2: #06b6d4;

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Utilities */
  --live-red: #ff3366;
  --live-red-glow: rgba(255, 51, 102, 0.6);
  --sidebar-width: 260px;
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 8px;

  /* Fonts */
  --font-body: 'Inter', system-ui, sans-serif;
  --font-heading: 'Outfit', 'Inter', system-ui, sans-serif;
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

html,
body {
  height: 100%;
  font-family: var(--font-body);
  color: var(--text-primary);
  overflow: hidden;
  background: var(--bg-dark);
}

/* Animated Ambient Background */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 60%);
  animation: rotateBG 40s linear infinite;
  z-index: -2;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15), transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(6, 182, 212, 0.1), transparent 40%);
  z-index: -1;
  pointer-events: none;
}

@keyframes rotateBG {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

body {
  display: flex;
}

/* ─── Sidebar ──────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), min-width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
  z-index: 10;
}

.sidebar.collapsed {
  width: 0;
  min-width: 0;
  border-right: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.logo-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.logo-accent {
  background: linear-gradient(135deg, var(--accent-light), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: scale(1.05);
}

.search-box {
  position: relative;
  padding: 16px 20px;
}

.search-box input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  padding: 10px 36px 10px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-box input:focus {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.search-icon {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
  pointer-events: none;
}

.streamer-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 20px;
}

.streamer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 4px;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.streamer-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  transform: translateX(2px);
}

.streamer-item.active {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05));
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--text-primary);
  font-weight: 600;
}

.streamer-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-family: var(--font-heading);
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ─── Main Content ─────────────────────────────────── */
.main {
  flex: 1;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.view {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  padding: 32px 40px;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view.hidden {
  display: none !important;
}

/* ─── Library View ─────────────────────────────────── */
.view-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.view-title {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  flex: 1;
  background: linear-gradient(to right, #fff, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-back {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  color: var(--text-primary);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(-2px);
  border-color: var(--glass-border-highlight);
}

.btn-back.hidden {
  display: none;
}

.content-search {
  position: relative;
  flex: 1 1 260px;
  max-width: 420px;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.content-search.hidden {
  display: none;
}

.content-search-row {
  position: relative;
}

.content-search input[type="search"] {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-primary);
  padding: 9px 36px 9px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.content-search input[type="search"]:focus {
  border-color: var(--glass-border-highlight);
  background: rgba(0, 0, 0, 0.45);
}

.content-search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 16px;
}

.content-search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.content-search-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.content-search-filter input {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
}

/* Search results live inside #videoGrid — override card grid so rows use full width */
.video-grid:has(.search-results),
.video-grid.search-mode {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 920px;
}

.search-result {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: start;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.search-result:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--glass-border-highlight);
}

.search-result-time {
  grid-row: 1 / span 2;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--accent, #a5b4fc);
  font-size: 13px;
  padding-top: 2px;
  white-space: nowrap;
}

.search-result-body {
  min-width: 0;
  grid-column: 2;
}

.search-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.search-result-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.search-result-badge.comment {
  background: rgba(96, 165, 250, 0.15);
  color: #93c5fd;
}

.search-result-badge.transcript {
  background: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
}

.search-result-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  overflow-wrap: anywhere;
  word-break: normal;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-text mark {
  background: rgba(250, 204, 21, 0.25);
  color: inherit;
  border-radius: 2px;
  padding: 0 2px;
}

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

.sort-controls select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  color: var(--text-primary);
  padding: 8px 16px 8px 12px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

.sort-controls select:hover {
  border-color: var(--accent);
}

/* ─── Video Grid & Cards ───────────────────────────── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.video-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.video-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(139, 92, 246, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.video-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
  pointer-events: none;
  z-index: 2;
}

.video-thumb {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  display: block;
  background: #000;
  transition: transform 0.5s ease;
}

.video-card:hover .video-thumb {
  transform: scale(1.05);
}

.video-thumb-placeholder {
  width: 100%;
  aspect-ratio: 9 / 16;
  background: linear-gradient(160deg, #1e1b4b, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--text-muted);
}

.video-card-info {
  padding: 16px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 60%, transparent 100%);
  z-index: 3;
}

.video-card-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.video-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.video-card-size {
  font-size: 12px;
  color: var(--text-secondary);
}

.comments-badge {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  color: #fff;
  border-radius: 12px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 4px;
}

.live-overlay-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--live-red);
  color: white;
  font-size: 11px;
  font-family: var(--font-heading);
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  z-index: 4;
  box-shadow: 0 2px 10px var(--live-red-glow);
  animation: pulse-live 2s infinite;
  text-transform: uppercase;
}

@keyframes pulse-live {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 51, 102, 0.7);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(255, 51, 102, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 51, 102, 0);
  }
}

.empty-state,
.loading-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 500;
}

.empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* ─── Recent Section ───────────────────────────────── */
.recent-section {
  margin-bottom: 8px;
}

.recent-section.hidden {
  display: none;
}

.recent-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.recent-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.recent-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(139, 92, 246, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.recent-card .video-thumb,
.recent-card .video-thumb-placeholder {
  width: 100%;
  aspect-ratio: 9 / 16;
  height: auto;
  object-fit: cover;
  display: block;
}

.recent-card:hover .video-thumb {
  transform: scale(1.05);
}

.recent-card-info {
  padding: 14px 14px 16px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 60%, transparent 100%);
  z-index: 3;
}

.recent-card-streamer {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.recent-card-date {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Player View ──────────────────────────────────── */
.player-layout {
  display: flex;
  gap: 20px;
  height: calc(100dvh - 48px);
  min-height: 0;
  align-items: stretch;
}

.player-col {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.player-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-shrink: 0;
}

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

.player-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, #e11d48, #f43f5e);
  color: white;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 12px 20px;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(244, 63, 94, 0.4);
  flex-shrink: 0;
  text-transform: uppercase;
}

.player-info-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-download {
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text, #e8e8e8);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-download:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-download:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-download.hidden {
  display: none;
}

.video-dl-btns {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}

.btn-card-dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  font-size: 14px;
  line-height: 1;
}

.btn-card-dl:hover {
  background: rgba(255, 255, 255, 0.2);
}

.search-result-dl {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  align-items: flex-start;
  padding-top: 2px;
}

.btn-live-edge {
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: linear-gradient(90deg, #e11d48, #f43f5e);
  color: #fff;
  box-shadow: 0 2px 12px rgba(244, 63, 94, 0.35);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-live-edge:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: scale(1.02);
}

.btn-live-edge:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-live-edge.hidden {
  display: none;
}

.live-bar.hidden {
  display: none;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 8px #fff;
  animation: blink-dot 1s infinite alternate;
}

@keyframes blink-dot {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0.4;
    transform: scale(0.8);
  }
}

.video-wrap {
  position: relative;
  flex: 1 1 auto;
  align-self: center;
  width: auto;
  max-width: 100%;
  height: 100%;
  max-height: calc(100dvh - 180px);
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
}

#videoEl {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.guest-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}

.guest-hud.hidden {
  display: none !important;
}

.guest-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  max-width: 100%;
}

.guest-pill-label {
  opacity: 0.7;
  font-weight: 500;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.timeline-intel {
  position: relative;
  flex-shrink: 0;
  margin-top: 10px;
  padding: 0 2px 2px;
}

.timeline-intel.hidden {
  display: none !important;
}

.viewer-curve {
  display: block;
  width: 100%;
  height: 28px;
  opacity: 0.85;
}

.viewer-curve path {
  fill: rgba(139, 92, 246, 0.35);
  stroke: rgba(167, 139, 250, 0.9);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.timeline-track {
  position: relative;
  height: 14px;
  margin-top: 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  touch-action: none;
}

.timeline-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.7), rgba(6, 182, 212, 0.65));
  pointer-events: none;
}

.timeline-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gift-marker {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border: none;
  background: transparent;
  color: #fbbf24;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  padding: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.gift-marker:hover {
  transform: translate(-50%, -50%) scale(1.2);
}

.player-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 4px 0;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.speed-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.speed-control select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: #fff;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.speed-label {
  display: none;
}

@media (min-width: 1100px) {
  .speed-label {
    display: inline;
  }
}

/* ─── Comments Column ──────────────────────────────── */
.comments-col {
  width: min(440px, 38vw);
  min-width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: var(--glass-shadow);
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.side-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 3px;
}

.side-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.side-tab:hover {
  color: #fff;
}

.side-tab.active {
  background: rgba(139, 92, 246, 0.35);
  color: #fff;
}

.side-filter-wrap {
  padding: 10px 12px 0;
  flex-shrink: 0;
}

.side-filter-wrap input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 13px;
  outline: none;
}

.side-filter-wrap input:focus {
  border-color: rgba(139, 92, 246, 0.55);
}

.comments-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comments-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.comment-count {
  font-size: 12px;
  font-weight: 600;
  background: rgba(139, 92, 246, 0.2);
  color: var(--accent-light);
  border-radius: 12px;
  padding: 4px 10px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: var(--glass-border);
}

.comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.comment-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.02);
  transition: all 0.3s ease;
  animation: fadeSlide 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: pointer;
}

.comment-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.comment-time {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.transcript-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.transcript-list.hidden,
.comments-list.hidden {
  display: none !important;
}

.transcript-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.transcript-row:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.transcript-row.active {
  background: rgba(139, 92, 246, 0.22);
  color: #fff;
}

.transcript-time {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 11px;
  color: var(--accent-light);
  min-width: 3.2em;
}

.transcript-text {
  flex: 1;
  min-width: 0;
}

.comment-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.05));
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: scale(1.01);
}

.comment-item.past {
  opacity: 0.6;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.comment-avatar {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  color: white;
  text-transform: uppercase;
}

.comment-nick {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  opacity: 0.9;
}

.comment-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.comments-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

/* Helper Class */
.hidden {
  display: none !important;
}

/* ─── Sidebar Expand Toggle ───────────────────────── */
.sidebar-expand {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-left: none;
  border-radius: 0 12px 12px 0;
  color: var(--text-primary);
  padding: 16px 10px;
  cursor: pointer;
  z-index: 20;
  transition: all 0.2s;
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.2);
}

.sidebar-expand:hover {
  background: rgba(255, 255, 255, 0.1);
  padding-left: 14px;
}

/* ─── Sidebar Backdrop (mobile overlay) ───────────── */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.sidebar-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Comments Drag Handle ─────────────────────────── */
.comments-drag-handle {
  display: none;
  width: 100%;
  padding: 10px 0 6px;
  cursor: grab;
  touch-action: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.comments-drag-handle::after {
  content: '';
  display: block;
  width: 40px;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

/* ─── Comments Fullscreen Mode ─────────────────────── */
.comments-col.fullscreen {
  position: fixed;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  z-index: 200;
  border-radius: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

body.player-open {
  overflow: hidden;
}

body.player-open .sidebar-expand {
  display: none !important;
}

/* P2 mobile-only chrome — hidden on desktop */
.mobile-chat-overlay,
.mobile-top-gradient,
.mobile-bottom-gradient,
.mobile-action-rail,
.mobile-sheet-backdrop {
  display: none;
}

#btnCloseMobileSheet {
  display: none;
}

/* ─── Responsive Adjustments ───────────────────────── */
@media (max-width: 900px) {
  .player-layout {
    flex-direction: column;
    height: auto;
    gap: 16px;
  }

  .player-col {
    padding: 12px;
  }

  .video-wrap {
    aspect-ratio: 9/16;
    max-height: 48vh;
  }

  .comments-col {
    width: 100%;
    flex: 1;
    min-height: 280px;
    max-height: none;
    background: #0f0f17;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 -10px 32px rgba(0, 0, 0, 0.45);
  }

  .comments-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #0f0f17;
  }

  .comments-list {
    padding: 10px 14px 16px;
  }

  .comment-text {
    font-size: 15px;
    color: #e2e8f0;
  }

  .comment-item.past {
    opacity: 0.8;
  }

  .comment-item.active {
    background: rgba(139, 92, 246, 0.28);
    border-color: rgba(167, 139, 250, 0.5);
    opacity: 1;
  }

  .comment-item.active .comment-text {
    color: #fff;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .recent-strip {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }

  .view {
    padding: 24px;
  }
}

@media (max-width: 600px) {

  /* ── Body / global ── */
  html,
  body {
    overflow: hidden;
    /* Reserve space for notched phones */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  /* ── Sidebar ── */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 100;
    transform: translateX(-100%);
    box-shadow: var(--glass-shadow);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-expand {
    top: 50%;
    transform: translateY(-50%);
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-left: none;
    border-radius: 0 14px 14px 0;
    padding: 24px 12px;
    min-width: 44px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 0 16px rgba(139, 92, 246, 0.25);
    z-index: 101;
    /* Ensure it stays above other elements like video player */
  }

  .sidebar-expand i {
    font-size: 24px;
    color: #fff;
  }

  .sidebar-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  /* ── Library view ── */
  .view {
    padding: 16px;
  }

  .view-header {
    gap: 10px;
    margin-bottom: 20px;
  }

  .view-title {
    font-size: 22px;
  }

  .btn-back {
    padding: 10px 14px;
    min-height: 44px;
    font-size: 14px;
  }

  .sort-controls select {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 14px;
  }

  /* ── Video grid ── */
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* ── Recent grid ── */
  .recent-section {
    margin-bottom: 16px;
  }

  .recent-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .recent-card-info {
    padding: 10px 10px 12px;
  }

  .recent-card-streamer {
    font-size: 13px;
  }

  .recent-card-date {
    font-size: 11px;
  }

  /* ── Player: P2 full-bleed TikTok overlay ── */
  .view#viewPlayer {
    position: fixed;
    inset: 0;
    z-index: 20;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #000;
  }

  .player-layout {
    flex: 1;
    min-height: 0;
    display: block;
    position: relative;
    height: 100%;
    gap: 0;
  }

  .player-col {
    position: absolute;
    inset: 0;
    z-index: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    border: none;
    border-radius: 0;
    background: #000;
  }

  .player-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 6;
    margin: 0;
    padding: max(10px, env(safe-area-inset-top)) 12px 10px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent);
    flex-shrink: 0;
  }

  .player-title {
    font-size: 14px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  }

  .btn-back,
  #btnBackFromPlayer {
    min-height: 44px;
    min-width: 44px;
    padding: 8px 12px;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
  }

  .live-bar {
    position: absolute;
    top: calc(env(safe-area-inset-top, 12px) + 52px);
    left: 12px;
    z-index: 6;
    margin: 0;
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.85);
  }

  .video-wrap {
    position: absolute;
    inset: 0;
    flex: none;
    min-height: 0;
    max-height: none;
    aspect-ratio: unset;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  #videoEl {
    object-fit: cover;
    width: 100%;
    height: 100%;
  }

  .mobile-top-gradient,
  .mobile-bottom-gradient {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 2;
  }

  .mobile-top-gradient {
    top: 0;
    height: 120px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent);
  }

  .mobile-bottom-gradient {
    bottom: 0;
    height: 240px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
  }

  .mobile-chat-overlay {
    display: flex;
    position: absolute;
    left: 12px;
    right: 72px;
    bottom: max(56px, calc(env(safe-area-inset-bottom, 12px) + 44px));
    max-height: 38dvh;
    z-index: 4;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
    overflow: hidden;
    mask-image: linear-gradient(to top, black 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, black 70%, transparent 100%);
    pointer-events: none;
  }

  .mobile-chat-bubble {
    align-self: flex-start;
    max-width: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 6px 10px;
    font-size: 0.8rem;
    line-height: 1.3;
    color: #fff;
    word-break: break-word;
    pointer-events: auto;
    cursor: pointer;
  }

  .mobile-chat-bubble .user {
    font-weight: 700;
    color: #c4b5fd;
    margin-right: 4px;
  }

  .mobile-action-rail {
    display: flex;
    position: absolute;
    right: 12px;
    bottom: max(64px, calc(env(safe-area-inset-bottom, 12px) + 52px));
    z-index: 5;
    flex-direction: column;
    gap: 14px;
  }

  .mobile-action-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
  }

  .mobile-sheet-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 25;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .mobile-sheet-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
  }

  .player-info-bar {
    display: none;
  }

  .timeline-intel {
    position: absolute;
    left: 12px;
    right: 72px;
    bottom: max(12px, env(safe-area-inset-bottom, 8px));
    z-index: 5;
    margin: 0;
    padding: 0;
  }

  .guest-hud {
    top: max(56px, calc(env(safe-area-inset-top, 8px) + 48px));
    left: 12px;
    right: 72px;
  }

  /* ── Comments as bottom sheet ── */
  .comments-col {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(68dvh, 560px);
    max-height: 68dvh;
    z-index: 30;
    border-radius: 18px 18px 0 0;
    background: #0f0f17;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.65);
    transform: translateY(110%);
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .comments-col.sheet-open {
    transform: translateY(0);
  }

  .comments-col.fullscreen {
    height: 100% !important;
    max-height: none !important;
    border-radius: 0;
  }

  #btnCloseMobileSheet {
    display: flex;
  }

  #btnFullscreenComments {
    display: none;
  }

  .comments-drag-handle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 0 4px;
  }

  .comments-drag-handle::before {
    content: 'Dra upp för chatt / sök';
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .comments-drag-handle::after {
    width: 48px;
    height: 6px;
    background: rgba(255, 255, 255, 0.35);
  }

  .comments-header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px 14px;
    background: #0f0f17;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .comments-title {
    font-size: 15px;
  }

  .comments-list {
    padding: 8px 12px max(16px, env(safe-area-inset-bottom));
    gap: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .comment-item {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .comment-item.past {
    opacity: 0.82;
  }

  .comment-nick {
    font-size: 14px;
    color: #fff;
  }

  .comment-text {
    font-size: 15px;
    line-height: 1.45;
    color: #f1f5f9;
  }

  .comment-item.active {
    background: rgba(139, 92, 246, 0.32);
    border-color: rgba(167, 139, 250, 0.55);
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.25);
    opacity: 1;
    transform: none;
  }

  .comment-item.active .comment-text {
    color: #fff;
    font-weight: 500;
  }

  .comment-avatar {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .btn-icon {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
  }

  .comments-col.fullscreen .comments-list {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}

/* ─── Ultra-small screens (old/small phones ≤380px) ── */
@media (max-width: 380px) {
  .video-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .recent-strip {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .view-title {
    font-size: 18px;
  }
}

/* ─── Performance: reduce motion & battery ─────────── */
@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Disable heavy background animation on mobile by default */
@media (max-width: 600px) {
  body::before {
    animation: none;
    /* Replace with a simpler static gradient */
    background: radial-gradient(circle at 50% 50%, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 60%);
  }
}

/* ─── Login overlay ─────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(9, 9, 14, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.login-overlay.hidden {
  display: none;
}

.login-card {
  width: min(100%, 380px);
  margin: 20px;
  padding: 32px 28px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
}

.login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 4px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.login-field input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font: inherit;
}

.login-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-error {
  color: var(--live-red);
  font-size: 13px;
  text-align: center;
}

.login-submit {
  margin-top: 4px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.login-submit:hover {
  opacity: 0.92;
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 16px 16px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.btn-logout.hidden {
  display: none;
}

/* ─── P4 VIP soft gate + BMC CTA ───────────────────── */
.vip-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 5, 10, 0.92);
  backdrop-filter: blur(16px);
}

.vip-overlay.hidden {
  display: none;
}

.vip-card {
  width: min(400px, 100%);
  padding: 32px 28px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.vip-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

.bmc-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffdd00, #ffbb00);
  color: #1a1a1a;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(255, 187, 0, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.bmc-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255, 187, 0, 0.45);
}

.bmc-fab.hidden {
  display: none;
}

.bmc-fab i {
  font-size: 18px;
}

body.player-open .bmc-fab {
  bottom: max(72px, calc(env(safe-area-inset-bottom) + 56px));
}

@media (max-width: 600px) {
  .bmc-fab span {
    display: none;
  }

  .bmc-fab {
    padding: 14px;
    border-radius: 50%;
  }
}
