:root {
  --bg: #141414;
  --surface: #181818;
  --surface-hover: #252525;
  --border: #333333;
  --accent: #2d9b7a;
  --accent-glow: rgba(45, 155, 122, 0.2);
  --text: #ffffff;
  --text-muted: #b3b3b3;
  --text-dim: #6d6d6d;
  --error: #e87c03;
  --font-display: 'Anek Latin', sans-serif;
  --font-body: 'Anek Latin', sans-serif;
}

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

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

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-2%, -1%); }
  30% { transform: translate(2%, -2%); }
  50% { transform: translate(-1%, 2%); }
  70% { transform: translate(2%, 1%); }
  90% { transform: translate(-2%, -2%); }
}

html {
  overscroll-behavior-y: auto;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overscroll-behavior-y: auto;
}

.toast {
  display: inline-block;
  background: var(--accent);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  margin-top: 8px;
  animation: fadeUp 0.3s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container {
  max-width: 460px;
  margin: 120px auto 0;
  padding: 0 24px;
  animation: fadeUp 0.8s ease-out;
}

h1 {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

h1::after {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  background: var(--accent);
  margin: 16px auto 0;
  border-radius: 1px;
}

.subtitle {
  text-align: center;
  color: var(--text-muted);
  margin: 20px 0 36px;
  font-size: 0.95rem;
}

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  background: var(--surface);
  border-radius: 10px;
  padding: 4px;
  border: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-family: var(--font-body);
  cursor: pointer;
  border-radius: 7px;
  transition: all 0.3s ease;
  letter-spacing: 0.02em;
}

.tab.active {
  background: var(--surface-hover);
  color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.panel { display: none; }
.panel.active { display: block; animation: fadeUp 0.5s ease-out; }

.hidden { display: none !important; }

.field { margin-bottom: 18px; }

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

input[type="text"],
input[type="url"],
input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-upper { text-transform: uppercase; letter-spacing: 0.25em; }

.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: #35b08a;
  box-shadow: 0 4px 20px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

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

.btn-sm {
  width: auto;
  padding: 10px 20px;
  font-size: 0.85rem;
}

.result {
  text-align: center;
  padding: 28px 0;
  animation: fadeUp 0.4s ease-out;
}

.result p {
  margin-bottom: 14px;
  color: var(--text-muted);
  font-style: italic;
}

.code-box {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: 8px;
  color: var(--accent);
  background: var(--surface);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 16px;
  user-select: all;
  border: 1px solid var(--border);
}

.error {
  color: var(--error);
  margin-top: 10px;
  font-size: 0.85rem;
}

/* Session Page */
.session-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  overflow: clip; /* clip without becoming a scroll container — preserves pull-to-refresh */
}

.send-icon {
  display: none;
}

.header-label {
  display: inline;
}

.users-badge {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 0 10px var(--accent-glow);
}

.session-page .grain { opacity: 0.02; }

.session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}

.session-header h1 {
  font-size: 1.1rem;
  margin: 0;
  letter-spacing: 0.04em;
}

.session-header h1::after { display: none; }

.session-info {
  display: flex;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  align-items: center;
}

.session-info strong {
  color: var(--accent);
  letter-spacing: 3px;
  font-family: var(--font-display);
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.btn-icon:hover {
  background: var(--surface-hover);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.session-layout {
  display: flex;
  flex: 1;
  overflow: clip;
}

.video-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  min-width: 0;
}

.video-container {
  width: 100%;
  height: 100%;
  position: relative;
  background: #000;
  overflow: clip;
}

#video-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.chat-section {
  width: 340px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-section h3 {
  padding: 14px 18px;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-body);
}

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

.comment {
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.5;
  border: 1px solid var(--border);
  transition: border-color 0.2s ease;
}

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

.comment-user {
  font-weight: 600;
  color: var(--accent);
  margin-right: 8px;
}

.comment-text { color: var(--text); }

.comment-time {
  display: block;
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 4px;
  font-style: italic;
}

.comment-form {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.comment-form input { flex: 1; min-width: 0; }
.comment-form .btn-sm { flex-shrink: 0; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeUp 0.25s ease-out;
  /* Prevent scroll chaining to the page behind the overlay */
  overscroll-behavior: none;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  width: 520px;
  max-width: 92vw;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  /* 'clip' clips visually (for border-radius) without creating a scroll container
     that would compete with the inner .modal-view scroll */
  overflow: clip;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-shrink: 0;
}

.modal-header h3 {
  flex: 1;
  font-size: 1rem;
  color: var(--text);
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  transition: color 0.2s;
}

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

.modal-back {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  transition: color 0.2s;
}

.modal-back:hover { color: var(--accent); }

.modal-view {
  /* 'scroll' (not 'auto') reliably activates touch scrolling on all mobile browsers */
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch; /* iOS momentum scroll */
  overscroll-behavior: contain;      /* stop scroll chaining when list ends */
  /* Re-enable vertical pan on this element specifically;
     the overlay has touch-action:none but this element overrides it
     for its own region because it is a scroll container */
  touch-action: pan-y;
  flex: 1;
  min-height: 0; /* critical — lets flex item shrink below its content size */
}

/* Pinned search bar — never scrolls away */
.modal-search-bar {
  flex-shrink: 0;
  padding-bottom: 10px;
}

.search-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font-body);
  outline: none;
  margin-bottom: 14px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

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

.empty-state {
  padding: 28px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-style: italic;
}

.poster-placeholder {
  width: 100%;
  height: 100%;
  background: var(--surface-hover);
  border-radius: 6px;
}

/* TMDB poster grid */
.search-results-grid,
.seasons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 10px;
}

.poster-card,
.season-card {
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.poster-card:hover,
.season-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.poster-card-img,
.season-card-img {
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}

.poster-card-img img,
.season-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.poster-card:hover img,
.season-card:hover img { transform: scale(1.05); }

.poster-card-info,
.season-card-info { padding: 6px 6px 10px; }

.poster-card-name,
.season-card-name {
  font-size: 0.78rem;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.poster-card-year,
.season-card-meta {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Episodes */
.episodes-list { display: flex; flex-direction: column; gap: 6px; }

.episode-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
}

.episode-card:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

.episode-still {
  width: 112px;
  height: 63px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg);
}

.episode-still img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.episode-num {
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.episode-name { font-size: 0.85rem; color: var(--text); display: block; margin-bottom: 3px; }

.episode-overview {
  font-size: 0.72rem;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-style: italic;
}

/* Torrents */
.torrents-list { display: flex; flex-direction: column; gap: 4px; }

.torrent-card {
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.torrent-card:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.torrent-name {
  font-size: 0.83rem;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.torrent-meta {
  font-size: 0.7rem;
  color: var(--text-dim);
  display: block;
  margin-top: 3px;
}

/* Modal footer */
.modal .field { margin-bottom: 14px; }

.modal .field input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

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

.modal-actions { display: flex; gap: 10px; flex-shrink: 0; }
.modal-actions .btn { flex: 1; }

.modal-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.modal-divider::before,
.modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Progress & no-video */
.no-video {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-dim);
  font-size: 1rem;
  font-style: italic;
  background: #000;
}

.progress-overlay {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

.progress-bar {
  width: 280px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s ease;
  width: 0%;
}

.progress-text {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-body);
}

/* Mobile */
@media (max-width: 768px) {
  .session-layout {
    flex-direction: column;
  }

  .video-section {
    width: 100%;
    aspect-ratio: 16 / 9;
    flex: 0 0 auto;
    max-height: none;
  }

  .chat-section {
    width: 100%;
    flex: 1 1 0%;
    min-height: 0;
    max-height: none;
  }

  .session-header {
    padding: 10px 16px;
    gap: 8px;
  }

  .session-header h1 {
    font-size: 0.95rem;
  }

  .session-info {
    gap: 10px;
    font-size: 0.8rem;
  }

  .header-label {
    display: none !important;
  }

  .btn-send {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0;
    flex-shrink: 0;
  }

  .btn-send .btn-text {
    display: none !important;
  }

  .btn-send .send-icon {
    display: block !important;
    margin: 0;
  }

  .container {
    margin-top: 40px;
    padding: 0 16px;
  }

  h1 {
    font-size: 1.6rem;
  }

  .modal-overlay {
    align-items: flex-end;
  }

  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 80dvh;
    border-radius: 20px 20px 0 0;
    padding: 16px;
    border-bottom: none;
    margin: 0;
    animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .search-results-grid,
  .seasons-grid {
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 8px;
  }

  .episode-still {
    width: 80px;
    height: 45px;
  }

  .progress-bar {
    width: 200px;
  }

  .comment-form input {
    font-size: 16px;
  }

  input[type="text"],
  input[type="url"],
  input[type="password"] {
    font-size: 16px;
  }

  .search-input {
    font-size: 16px;
  }

  .btn {
    padding: 12px 14px;
    font-size: 0.95rem;
  }
}

/* ── Session toast (non-blocking error messages) ─────────────────── */
.session-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 10px 20px;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 9000;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}
.session-toast--in {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Custom Video Player ──────────────────────────────────────────── */

@keyframes vpFlash {
  0%   { opacity: 1; transform: scale(0.65); }
  20%  { opacity: 1; transform: scale(1.1);  }
  100% { opacity: 0; transform: scale(1.55); }
}

.video-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.video-close-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  color: var(--text);
}

.vp-controls {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.vp-controls.vp-visible,
.vp-controls.vp-paused {
  opacity: 1;
  pointer-events: auto;
}

/* Cinematic gradient — top fade + heavy bottom shadow */
.vp-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.28) 0%, transparent 18%),
    linear-gradient(to top,    rgba(0,0,0,0.88) 0%, transparent 44%);
  pointer-events: none;
}

/* Center flash on click */
.vp-flash-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.vp-flash-icon {
  width: 68px;
  height: 68px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  color: #fff;
}

.vp-flash-icon.vp-flashing {
  animation: vpFlash 0.48s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Bottom control bar */
.vp-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 18px 14px;
}

/* ── Seek bar ── */
.vp-seek {
  position: relative;
  height: 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-bottom: 6px;
}

.vp-seek-track {
  position: relative;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  overflow: visible;
  transition: height 0.18s ease;
}

.vp-seek:hover .vp-seek-track,
.vp-seek.vp-seeking .vp-seek-track {
  height: 5px;
}

.vp-seek-buf {
  position: absolute;
  left: 0; top: 0; height: 100%;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 3px;
  transition: width 0.6s linear;
}

.vp-seek-prog {
  position: absolute;
  left: 0; top: 0; height: 100%;
  background: var(--accent);
  border-radius: 3px;
  box-shadow: 0 0 8px var(--accent-glow);
}

.vp-seek-thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transform: translateY(-50%) translateX(-50%) scale(0);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  pointer-events: none;
  box-shadow: 0 1px 6px rgba(0,0,0,0.5);
  z-index: 1;
}

.vp-seek:hover .vp-seek-thumb,
.vp-seek.vp-seeking .vp-seek-thumb {
  transform: translateY(-50%) translateX(-50%) scale(1);
}

.vp-seek.vp-seeking .vp-seek-thumb {
  box-shadow: 0 0 0 6px var(--accent-glow), 0 1px 6px rgba(0,0,0,0.5);
}

.vp-seek-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  background: rgba(16, 16, 16, 0.92);
  border: 1px solid var(--border);
  color: #fff;
  font-size: 0.7rem;
  font-family: var(--font-body);
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 5px;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 0.15s ease;
  white-space: nowrap;
}

.vp-seek:hover .vp-seek-tooltip {
  opacity: 1;
}

/* ── Controls row ── */
.vp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

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

/* ── Buttons ── */
.vp-btn {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  transition: color 0.18s ease, background 0.18s ease, transform 0.14s ease;
  flex-shrink: 0;
  padding: 0;
}

.vp-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.vp-btn:active { transform: scale(0.93); }

.vp-btn--active { color: var(--accent) !important; }

/* ── Volume ── */
.vp-vol-group {
  display: flex;
  align-items: center;
}

.vp-vol-track {
  width: 0;
  overflow: hidden;
  transition: width 0.22s ease;
}

.vp-vol-group:hover .vp-vol-track,
.vp-vol-track:focus-within {
  width: 70px;
}

#vp-volume {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 66px;
  height: 3px;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  margin: 0 4px;
  background: linear-gradient(to right, rgba(255,255,255,0.85) var(--vol, 100%), rgba(255,255,255,0.2) var(--vol, 100%));
}

#vp-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

#vp-volume::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ── Time display ── */
.vp-time {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--font-body);
  letter-spacing: 0.03em;
  padding: 0 6px;
  white-space: nowrap;
  user-select: none;
}

.vp-sep { color: rgba(255,255,255,0.3); }

/* ── Mobile overrides ── */
@media (max-width: 768px) {
  .vp-bar { padding: 0 12px 10px; }

  .vp-btn { width: 40px; height: 40px; }

  .vp-vol-track { display: none; }

  .vp-time { font-size: 0.7rem; padding: 0 4px; }

  .vp-seek { height: 28px; }
  .vp-seek-thumb { width: 16px; height: 16px; }
}
