:root {
  --bg: #0b0d12;
  --bg-elev: #141821;
  --bg-card: #191f2b;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f3f5f8;
  --muted: #8e98a8;
  --accent: #ff4d5a;
  --accent-soft: rgba(255, 77, 90, 0.16);
  --green: #30c474;
  --blue: #4c9aff;
  --orange: #f59e0b;
  --radius: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 62px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
  overscroll-behavior-y: contain;
  min-height: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

/* ---------------- Cabecera ---------------- */
.top-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 13, 18, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: calc(10px + var(--safe-top)) 14px 10px;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
}

.header-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-sub {
  margin-top: 10px;
}

/* ---------------- Banners ---------------- */
.bridge-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(48, 196, 116, 0.12);
  border-bottom: 1px solid rgba(48, 196, 116, 0.25);
  font-size: 12.5px;
}

.bridge-banner.local {
  background: rgba(245, 158, 11, 0.12);
  border-bottom-color: rgba(245, 158, 11, 0.25);
}

.bridge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.bridge-banner.local .bridge-dot {
  background: var(--orange);
}

.bridge-banner-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.mini-pill-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.install-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 14px 0;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(255, 77, 90, 0.16), rgba(25, 31, 43, 0.95));
  border: 1px solid rgba(255, 77, 90, 0.3);
  border-radius: var(--radius);
}

.install-banner-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
}

.install-banner-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--muted);
}

.install-banner-text strong {
  color: var(--text);
  font-size: 13px;
}

.install-banner-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.install-banner-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
}

.ptr-indicator {
  text-align: center;
  padding: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------------- Contenido principal ---------------- */
.main-content {
  padding: 12px 14px calc(var(--nav-h) + var(--safe-bottom) + 22px);
  max-width: 1120px;
  margin: 0 auto;
}

/* ---------------- Barra inferior ---------------- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(11, 13, 18, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.nav-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.nav-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.nav-btn.active {
  color: var(--accent);
}

/* ---------------- Botones, inputs y chips ---------------- */
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.icon-btn.accent-on {
  background: var(--accent-soft);
  border-color: rgba(255, 77, 90, 0.5);
  color: var(--accent);
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.primary-btn:active { opacity: 0.85; }

.secondary-btn {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.danger-btn {
  background: rgba(255, 77, 90, 0.14);
  color: #ff7480;
  border: 1px solid rgba(255, 77, 90, 0.35);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-input, .text-input, .select-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text);
  outline: none;
}

.search-input:focus, .text-input:focus {
  border-color: var(--accent);
}

.chips-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: none;
}

.chips-row::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------------- Tarjeta Seguir viendo ---------------- */
.continue-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 77, 90, 0.14), rgba(25, 31, 43, 0.96));
  border: 1px solid rgba(255, 77, 90, 0.3);
  cursor: pointer;
}

.continue-poster {
  width: 66px;
  height: 96px;
  border-radius: 9px;
  object-fit: cover;
  background: #10141c;
  flex-shrink: 0;
}

.continue-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.continue-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
}

.continue-title {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.continue-sub {
  font-size: 12.5px;
  color: var(--muted);
}

.progress-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

/* ---------------- Rejilla de portadas ---------------- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.media-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.media-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.media-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 720px) {
  .media-grid.cols-2 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .media-grid.cols-3 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .media-grid.cols-4 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.media-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.media-poster-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #10141c;
  overflow: hidden;
}

.media-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(11, 13, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
}

.media-badge.anime { background: rgba(147, 51, 234, 0.88); border-color: transparent; }
.media-badge.series { background: rgba(37, 99, 235, 0.88); border-color: transparent; }
.media-badge.movie { background: rgba(255, 77, 90, 0.88); border-color: transparent; }

.media-rating {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(11, 13, 18, 0.85);
  color: #fbbf24;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}

.media-lib-dot {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: var(--green);
  color: #06140c;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
}

.media-card-prog {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.55);
}

.media-card-prog > span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.media-meta {
  padding: 7px 8px 8px;
}

.media-title {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.media-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------- Secciones horizontales (Estrenos) ---------------- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 8px;
}

.section-head:first-child { margin-top: 2px; }

.section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.section-link {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.h-rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.h-rail::-webkit-scrollbar { display: none; }

.h-rail .media-card {
  width: 122px;
  flex-shrink: 0;
}

/* ---------------- Listas, tarjetas de historial y ajustes ---------------- */
.list-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.list-row:last-child { border-bottom: none; }

.list-row.clickable { cursor: pointer; }
.list-row.clickable:active { background: rgba(255, 255, 255, 0.04); }

.list-thumb {
  width: 48px;
  height: 70px;
  border-radius: 8px;
  object-fit: cover;
  background: #10141c;
  flex-shrink: 0;
}

.list-body {
  flex: 1;
  min-width: 0;
}

.list-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.settings-group-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 16px 4px 8px;
}

.switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.switch-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  cursor: pointer;
  transition: 0.18s;
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.18s;
}

.switch input:checked + .switch-slider { background: var(--accent); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

/* ---------------- Vista Detalle y Bóveda ---------------- */
.overlay-view {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  overflow-y: auto;
  padding-bottom: calc(28px + var(--safe-bottom));
}

.detail-hero {
  position: relative;
  padding: calc(12px + var(--safe-top)) 14px 16px;
  background: linear-gradient(180deg, rgba(25, 31, 43, 0.9), var(--bg));
  overflow: hidden;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.24;
  filter: blur(8px);
  transform: scale(1.06);
  pointer-events: none;
}

.detail-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.detail-header-grid {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 14px;
}

.detail-poster {
  width: 112px;
  height: 164px;
  border-radius: 12px;
  object-fit: cover;
  background: #10141c;
  border: 1px solid rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

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

.detail-title {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
}

.detail-meta-line {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 8px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  cursor: pointer;
}

.detail-body {
  padding: 0 14px;
  max-width: 960px;
  margin: 0 auto;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0 12px;
}

.detail-actions .full { grid-column: 1 / -1; }

.detail-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: #cfd6e3;
  margin: 8px 0 14px;
}

.episode-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.episode-row:last-child { border-bottom: none; }
.episode-row.watched { opacity: 0.62; }

.ep-thumb {
  width: 96px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: #10141c;
  flex-shrink: 0;
}

.ep-num-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 800;
  flex-shrink: 0;
}

.ep-body { flex: 1; min-width: 0; }
.ep-name { font-size: 13.5px; font-weight: 600; }
.ep-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------------- Bottom Sheet ---------------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.65);
}

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  max-height: 82vh;
  overflow-y: auto;
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  padding: 14px 16px calc(20px + var(--safe-bottom));
}

.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  margin: 0 auto 12px;
}

.sheet-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
}

.stream-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
}

.stream-card:active { border-color: var(--accent); }

.stream-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stream-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(48, 196, 116, 0.16);
  color: var(--green);
}

.stream-badge.ext {
  background: rgba(245, 158, 11, 0.16);
  color: var(--orange);
}

/* ---------------- Reproductor de vídeo a pantalla completa ---------------- */
.player-view {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}

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

.player-video::cue {
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  text-shadow: 0 1px 4px #000;
}

.player-warm-overlay, .player-dimmer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.player-warm-overlay {
  background: rgba(255, 160, 60, 0);
  mix-blend-mode: multiply;
}

.player-dimmer {
  background: rgba(0, 0, 0, 0);
}

.player-touch-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.player-hud {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 12;
  background: rgba(11, 13, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  pointer-events: none;
}

.player-spinner {
  position: absolute;
  inset: 0;
  z-index: 11;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.spinner-ring {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.spinner-text { font-size: 13px; color: #fff; }

.player-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(10px + var(--safe-top)) 12px 18px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.86), transparent);
  transition: opacity 0.2s;
}

.player-titles { flex: 1; min-width: 0; }
.player-media-title { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-ep-title { font-size: 12px; color: #cfd6e3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.player-center-controls {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 22px;
  transition: opacity 0.2s;
}

.center-play-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 77, 90, 0.9);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.center-ctrl-btn {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(11, 13, 18, 0.72);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.player-bottom-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 18px 12px calc(12px + var(--safe-bottom));
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.9), transparent);
  transition: opacity 0.2s;
}

.player-view.controls-hidden .player-top-bar,
.player-view.controls-hidden .player-center-controls,
.player-view.controls-hidden .player-bottom-bar {
  opacity: 0;
  pointer-events: none;
}

.player-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.player-time {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 44px;
  text-align: center;
}

.player-slider {
  flex: 1;
  accent-color: var(--accent);
  height: 5px;
}

.player-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.player-pill-btn {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 999px;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.player-pill-btn.accent {
  background: var(--accent);
  border-color: var(--accent);
}

.player-skip-pill {
  position: absolute;
  right: 16px;
  bottom: calc(108px + var(--safe-bottom));
  z-index: 12;
  background: rgba(11, 13, 18, 0.88);
  border: 1px solid var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.player-next-overlay {
  position: absolute;
  right: 16px;
  bottom: calc(112px + var(--safe-bottom));
  z-index: 15;
  width: min(300px, calc(100vw - 32px));
  background: rgba(20, 24, 33, 0.96);
  border: 1px solid rgba(255, 77, 90, 0.45);
  border-radius: 14px;
  padding: 14px;
}

.player-next-title { font-size: 14px; font-weight: 700; }
.player-next-sub { font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
.player-next-btns { display: flex; gap: 8px; }
.player-next-btns button { flex: 1; padding: 8px 10px; font-size: 12.5px; }

/* ---------------- PIN Lock ---------------- */
.pin-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(11, 13, 18, 0.98);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pin-box {
  width: 100%;
  max-width: 300px;
  text-align: center;
}

.pin-icon { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 10px; }

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 14px 0 8px;
}

.pin-dots span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--muted);
}

.pin-dots span.filled {
  background: var(--accent);
  border-color: var(--accent);
}

.pin-err {
  min-height: 20px;
  font-size: 12.5px;
  color: #ff7480;
  margin-bottom: 10px;
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pin-pad button {
  height: 54px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.pin-pad button:active { background: var(--accent-soft); }

/* ---------------- Empty & Toast ---------------- */
.empty-state {
  text-align: center;
  padding: 40px 18px;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  margin-bottom: 6px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 14px);
  transform: translateX(-50%);
  z-index: 250;
  background: rgba(25, 31, 43, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  max-width: calc(100vw - 32px);
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.code-box {
  width: 100%;
  min-height: 76px;
  background: #0a0c10;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font-family: Consolas, monospace;
  font-size: 11.5px;
  color: #9ae6b4;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}

.stat-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
}

.stat-lbl {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
