/* ═══════════════════════════════════════════════════════════
   JasMovies — TV-first stylesheet
   - No hover states; focus is driven by JS adding .focused
   - White border = "you are here" for the remote
   - Designed for 1280×720 / 1920×1080 Firestick output
═══════════════════════════════════════════════════════════ */

:root {
  --bg:       #141414;
  --bg2:      #1c1c1c;
  --bg3:      #252525;
  --accent:   #e50914;
  --accent2:  #b0060f;
  --text:     #ffffff;
  --muted:    #999999;
  --radius:   6px;
  --ease:     0.12s ease;
}

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

html, body {
  width: 100%; height: 100%;
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 18px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* hide scrollbars but keep scroll functionality */
::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }

/* ── Views ─────────────────────────────────────────────── */
.view {
  display: none;
  position: fixed; inset: 0;
  overflow: hidden;
}
.view.active { display: flex; flex-direction: column; }

/* ── Utility ───────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Focus system ──────────────────────────────────────── */
.focusable {
  outline: none;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color var(--ease), transform var(--ease),
              background-color var(--ease);
  user-select: none;
  -webkit-user-select: none;
}
.focusable.focused     { border-color: #fff !important; }
.card.focused          { transform: scale(1.1); z-index: 20; }
.btn-white.focused,
.btn-ghost.focused,
.btn-play.focused,
.btn-resume.focused,
.btn-back.focused,
.nav-btn.focused,
.p-btn.focused,
.s-btn.focused,
.ep-btn.focused        { transform: scale(1.04); }


/* ═══════════════════════════════════════════════════════════
   HOME
═══════════════════════════════════════════════════════════ */
#view-home { background: var(--bg); }

#navbar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 64px; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 52px;
  background: linear-gradient(to bottom, rgba(20,20,20,.97), transparent);
  pointer-events: none;
}
#navbar > * { pointer-events: auto; }

#nav-right {
  display: flex; align-items: center; gap: 12px;
}

#logo {
  color: var(--accent);
  font-size: 26px; font-weight: 900; letter-spacing: -.5px;
}
.nav-btn {
  background: rgba(255,255,255,.1); color: var(--text);
  font-size: 15px; font-weight: 700;
  padding: 8px 20px; border-radius: var(--radius);
  border: 3px solid transparent;
}
.nav-btn.focused { background: rgba(255,255,255,.22); }

/* Avatar button */
.avatar-btn {
  width: 42px; height: 42px;
  padding: 0; border-radius: 50% !important;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.14);
}
.avatar-btn.focused { background: rgba(255,255,255,.28); }

/* User dropdown */
#user-menu-wrap { pointer-events: auto; align-items: center; }
#user-dropdown {
  position: absolute; top: 52px; right: 0;
  background: rgba(22,22,22,.98);
  border: 1.5px solid rgba(255,255,255,.12);
  border-radius: 10px;
  min-width: 200px;
  padding: 10px 0;
  box-shadow: 0 8px 32px rgba(0,0,0,.7);
  z-index: 100;
  animation: fadeDown .14s ease;
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
#dropdown-username {
  font-size: 13px; font-weight: 800;
  color: var(--muted); padding: 6px 18px 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dropdown-hr {
  border: none; border-top: 1px solid rgba(255,255,255,.1);
  margin: 0 0 6px;
}
.dropdown-item {
  display: block; width: 100%;
  background: none; color: var(--text);
  font-size: 15px; font-weight: 600;
  padding: 10px 18px; text-align: left;
  border: 3px solid transparent; border-radius: 0;
  transition: background var(--ease);
}
.dropdown-item:hover,
.dropdown-item.focused { background: rgba(255,255,255,.1); }

#home-scroll {
  flex: 1;
  overflow-y: scroll;
  scroll-behavior: smooth;
}

/* ── Hero ──────────────────────────────────────────────── */
#hero {
  position: relative; height: 540px;
  background: #111; overflow: hidden;
}
#hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; opacity: .45;
}
#hero-grad {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(20,20,20,.97) 35%, transparent 72%),
    linear-gradient(to top,   rgba(20,20,20,1)   0%,  transparent 44%);
}
#hero-info {
  position: absolute; bottom: 64px; left: 52px; max-width: 520px;
}
#hero-title    { font-size: 50px; font-weight: 900; line-height: 1.1; margin-bottom: 10px; text-shadow: 1px 2px 8px rgba(0,0,0,.7); }
#hero-meta     { color: var(--muted); font-size: 15px; margin-bottom: 10px; }
#hero-desc     { font-size: 15px; color: #ccc; line-height: 1.55; margin-bottom: 22px;
                 display: -webkit-box; -webkit-line-clamp: 3;
                 -webkit-box-orient: vertical; overflow: hidden; }
#hero-btns     { display: flex; gap: 12px; }

.btn-white {
  background: var(--text); color: #000;
  padding: 13px 30px; border-radius: var(--radius);
  font-size: 18px; font-weight: 800;
  border: 3px solid transparent;
}
.btn-white.focused { background: #ddd; border-color: var(--accent); }

.btn-ghost {
  background: rgba(255,255,255,.14); color: var(--text);
  padding: 13px 30px; border-radius: var(--radius);
  font-size: 18px; font-weight: 700;
  border: 3px solid transparent;
}
.btn-ghost.focused { background: rgba(255,255,255,.28); }

/* ── Category rows ─────────────────────────────────────── */
.cat-row   { margin-bottom: 28px; }
.cat-title { font-size: 19px; font-weight: 700; padding: 0 52px; margin-bottom: 10px; }
.row-strip {
  display: flex;
  gap: 10px;
  padding: 6px 0 12px 52px;
  overflow-x: scroll;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scroll-padding-left: 52px;
  cursor: grab;
  /* Momentum feel */
  will-change: scroll-position;
}
/* Trailing spacer so the last card isn't flush against the viewport edge */
.row-strip::after {
  content: '';
  display: block;
  flex-shrink: 0;
  width: 40px;
}
.row-strip:active { cursor: grabbing; }
.row-strip.is-dragging {
  cursor: grabbing;
  user-select: none;
  scroll-behavior: auto; /* disable smooth during drag so it tracks finger exactly */
}
.row-strip .card { scroll-snap-align: start; }

/* ── Section dividers (Around the World, etc.) ─────────── */
.section-divider {
  display: flex; align-items: center;
  padding: 12px 52px 4px;
  margin-top: 12px;
}
.section-divider-label {
  font-size: 13px; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--accent);
  padding-right: 16px; white-space: nowrap;
}
.section-divider::after {
  content: ''; flex: 1;
  height: 1px; background: rgba(255,255,255,.1);
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
  flex-shrink: 0;
  width: 155px; height: 232px;
  border-radius: var(--radius); background: var(--bg2);
  overflow: hidden; position: relative;
  border: 3px solid transparent;
  transition: border-color var(--ease), transform var(--ease);
}
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.88); padding: 6px 8px;
  opacity: 0; transition: opacity var(--ease);
}
.card.focused .card-label { opacity: 1; }
.card-name   { font-size: 11px; font-weight: 700; line-height: 1.3; }
.card-sub    { font-size: 10px; color: #ffd700; margin-top: 2px; }


/* ═══════════════════════════════════════════════════════════
   AUTH VIEW  (Netflix-style)
═══════════════════════════════════════════════════════════ */
#view-auth {
  background: radial-gradient(ellipse at 50% 0%, rgba(229,9,20,.18) 0%, transparent 70%),
              linear-gradient(180deg, #0a0a0a 0%, #141414 100%);
  align-items: center; justify-content: center;
}
#auth-wrap {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow-y: auto; padding: 40px 20px;
}
#auth-card {
  width: 100%; max-width: 440px;
  background: rgba(0,0,0,.78);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
  padding: 44px 48px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,.7);
}
#auth-logo {
  color: var(--accent); font-size: 28px; font-weight: 900;
  letter-spacing: -.5px; text-align: center;
  margin-bottom: 28px;
}

/* Tabs */
#auth-tabs {
  display: flex; background: rgba(255,255,255,.06);
  border-radius: 8px; padding: 4px; margin-bottom: 28px;
  gap: 4px;
}
.auth-tab {
  flex: 1; padding: 10px; border-radius: 6px;
  font-size: 14px; font-weight: 700;
  background: none; color: var(--muted);
  border: 3px solid transparent;
  transition: background var(--ease), color var(--ease);
}
.auth-tab.active { background: var(--accent); color: #fff; }
.auth-tab.focused { background: rgba(255,255,255,.1); color: #fff; }
.auth-tab.active.focused { background: var(--accent2); }

/* Mode sub-tabs (Password / OTP) */
#login-mode-tabs {
  display: flex; gap: 8px; margin-bottom: 22px;
}
.mode-tab {
  padding: 7px 18px; border-radius: 6px;
  font-size: 13px; font-weight: 700;
  background: rgba(255,255,255,.07); color: var(--muted);
  border: 3px solid transparent;
}
.mode-tab.active { background: rgba(255,255,255,.18); color: #fff; }
.mode-tab.focused { background: rgba(255,255,255,.14); color: #fff; }

/* Fields */
.auth-field-wrap { margin-bottom: 18px; }
.auth-label {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--muted); margin-bottom: 6px; letter-spacing: .4px;
  text-transform: uppercase;
}
.auth-hint-inline { font-weight: 400; text-transform: none; font-size: 11px; }
.auth-input {
  width: 100%; background: rgba(255,255,255,.08);
  border: 2px solid rgba(255,255,255,.14); border-radius: 8px;
  color: var(--text); padding: 13px 16px;
  font-size: 16px; outline: none;
  transition: border-color var(--ease), background var(--ease);
}
.auth-input:focus, .auth-input.focused {
  border-color: #fff; background: rgba(255,255,255,.13);
}

/* Submit button */
.auth-submit {
  width: 100%; padding: 14px;
  background: var(--accent); color: #fff;
  font-size: 16px; font-weight: 800;
  border: 3px solid transparent; border-radius: 8px;
  margin-top: 6px;
  transition: background var(--ease);
}
.auth-submit:disabled { opacity: .5; cursor: not-allowed; }
.auth-submit.focused  { background: var(--accent2); }

/* Errors / hints */
.auth-error {
  color: #ff6b6b; font-size: 13px;
  margin-top: 14px; text-align: center; line-height: 1.5;
}
.auth-hint {
  font-size: 13px; color: var(--muted);
  margin-bottom: 18px; line-height: 1.5;
}
.auth-link {
  display: block; width: 100%; text-align: center;
  background: none; color: var(--muted);
  font-size: 14px; font-weight: 600;
  padding: 12px; margin-top: 16px;
  border: 3px solid transparent; border-radius: 6px;
  transition: color var(--ease);
}
.auth-link.focused { color: #fff; background: rgba(255,255,255,.06); }

/* Loading spinner inside auth buttons */
.auth-submit .spin-inline {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .65s linear infinite;
  vertical-align: middle; margin-right: 8px;
}


/* ═══════════════════════════════════════════════════════════
   SETTINGS VIEW
═══════════════════════════════════════════════════════════ */
#view-settings {
  background: var(--bg);
  align-items: center; justify-content: center;
}
#settings-wrap {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow-y: auto; padding: 40px 20px;
}
#settings-card {
  width: 100%; max-width: 640px;
  background: rgba(20,20,20,.98);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
  padding: 38px 48px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,.7);
}
#settings-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
#settings-title {
  font-size: 22px; font-weight: 900;
}

.settings-section {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.settings-section:last-of-type { border-bottom: none; }
.settings-section-title {
  font-size: 12px; font-weight: 800;
  color: var(--muted); text-transform: uppercase;
  letter-spacing: .8px; margin-bottom: 16px;
}
.danger-title { color: #e55; }

.settings-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 10px 0; gap: 16px;
}
.settings-row-btn { flex-wrap: wrap; }
.settings-label {
  font-size: 15px; font-weight: 600; color: #ddd;
  flex: 1;
}
.settings-value {
  font-size: 15px; color: var(--muted); flex-shrink: 0;
}
.settings-select {
  background: rgba(255,255,255,.09);
  border: 2px solid rgba(255,255,255,.15);
  border-radius: 6px; color: var(--text);
  padding: 7px 12px; font-size: 14px; font-weight: 600;
  outline: none;
}
.settings-select.focused { border-color: #fff; }

/* Toggle */
.toggle-wrap { position: relative; display: inline-block; }
.toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  display: inline-flex; width: 48px; height: 26px;
  background: rgba(255,255,255,.15); border-radius: 13px;
  position: relative; transition: background .2s;
  border: 3px solid transparent;
}
.toggle-track::after {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 1px; left: 1px;
  transition: transform .2s;
}
.toggle-input:checked + .toggle-track { background: var(--accent); }
.toggle-input:checked + .toggle-track::after { transform: translateX(22px); }

/* Settings buttons */
.settings-btn {
  padding: 9px 20px; border-radius: 6px;
  font-size: 14px; font-weight: 700;
  background: rgba(255,255,255,.1); color: #fff;
  border: 3px solid transparent; white-space: nowrap;
}
.settings-btn.focused { background: rgba(255,255,255,.2); }
.settings-btn-warn { background: rgba(255,165,0,.2); color: #ffa500; }
.settings-btn-warn.focused { background: rgba(255,165,0,.35); }
.settings-btn-danger { background: rgba(229,9,20,.2); color: #e50914; }
.settings-btn-danger.focused { background: rgba(229,9,20,.38); }

.settings-msg {
  margin-top: 16px; font-size: 14px; text-align: center;
  padding: 10px; border-radius: 6px; font-weight: 600;
}
.settings-msg.ok   { background: rgba(39,174,96,.18); color: #2ecc71; }
.settings-msg.err  { background: rgba(229,9,20,.18);  color: #ff6b6b; }

/* Confirm overlay */
#confirm-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center;
}
#confirm-box {
  background: #1e1e1e; border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px; padding: 36px 40px;
  max-width: 420px; width: 90%; text-align: center;
  box-shadow: 0 12px 48px rgba(0,0,0,.8);
}
#confirm-msg { font-size: 16px; font-weight: 600; line-height: 1.6; margin-bottom: 24px; }
#confirm-btns { display: flex; gap: 12px; justify-content: center; }


/* ═══════════════════════════════════════════════════════════
   DETAIL
═══════════════════════════════════════════════════════════ */
#view-detail { background: var(--bg); }

#detail-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: .15; filter: blur(3px); pointer-events: none;
}
#detail-grad {
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(20,20,20,.98) 48%, rgba(20,20,20,.55));
  pointer-events: none;
}
#detail-scroll {
  position: relative; z-index: 1;
  flex: 1; overflow-y: scroll;
  padding: 52px;
}
#detail-body    { display: flex; gap: 44px; align-items: flex-start; }
#detail-poster  { width: 210px; height: 315px; object-fit: cover; border-radius: var(--radius); box-shadow: 0 8px 40px rgba(0,0,0,.9); flex-shrink: 0; }
#detail-info    { flex: 1; }
#detail-title   { font-size: 40px; font-weight: 900; margin-bottom: 10px; }
#detail-meta    { color: var(--muted); font-size: 15px; margin-bottom: 14px; line-height: 1.9; }
#detail-overview{ font-size: 15px; color: #ccc; line-height: 1.65; margin-bottom: 26px; max-width: 680px; }
#detail-btns    { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 32px; }

.btn-play   { background: var(--text);         color: #000;        padding: 12px 28px; border-radius: var(--radius); font-size: 17px; font-weight: 800; border: 3px solid transparent; }
.btn-resume { background: #1a6b3a;             color: var(--text); padding: 12px 28px; border-radius: var(--radius); font-size: 17px; font-weight: 700; border: 3px solid transparent; }
.btn-back   { background: rgba(255,255,255,.1);color: var(--text); padding: 12px 28px; border-radius: var(--radius); font-size: 17px; font-weight: 700; border: 3px solid transparent; }
.btn-play.focused   { background: #ddd;                  border-color: var(--accent); }
.btn-resume.focused { background: #23934f;               }
.btn-back.focused   { background: rgba(255,255,255,.22); }

/* ── TV episode section ─────────────────────────────────── */
#ep-section   { margin-top: 4px; }
.ep-hdr       { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
#season-row   { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.s-btn {
  padding: 7px 18px; border-radius: var(--radius);
  background: rgba(255,255,255,.1); font-size: 14px; font-weight: 700;
  border: 3px solid transparent; color: var(--text);
}
.s-btn.active  { background: var(--accent); }
.s-btn.focused { }

#ep-grid  { display: flex; flex-wrap: wrap; gap: 8px; max-height: 210px; overflow-y: scroll; }
.ep-btn {
  padding: 7px 14px; border-radius: var(--radius);
  background: rgba(255,255,255,.08); font-size: 13px;
  border: 3px solid transparent; color: var(--text); white-space: nowrap;
}
.ep-btn.focused { background: rgba(255,255,255,.2); }


/* ═══════════════════════════════════════════════════════════
   PLAYER
═══════════════════════════════════════════════════════════ */
#view-player { background: #000; }

#player-bar {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 22px;
  background: rgba(0,0,0,.92);
}
.p-btn {
  background: rgba(255,255,255,.1); color: var(--text);
  padding: 7px 16px; border-radius: var(--radius);
  font-size: 14px; font-weight: 700;
  border: 3px solid transparent; white-space: nowrap;
}
.p-btn.focused { background: rgba(255,255,255,.24); }

#player-title   { flex: 1; text-align: center; font-size: 14px; font-weight: 600; color: rgba(255,255,255,.82); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#src-label      { font-size: 12px; font-weight: 700; color: #bbb; min-width: 90px; text-align: center; }

#frame-wrap {
  flex: 1; position: relative; background: #000;
  display: flex; flex-direction: column;
}
#no-stream-overlay {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 10px;
  background: rgba(10,10,10,.97);
  color: var(--text); padding: 40px;
  animation: fadein .4s ease;
}
@keyframes fadein { from { opacity: 0 } to { opacity: 1 } }

#player-overlay {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 10px;
  background: #141414;
  color: var(--text); text-align: center; padding: 40px;
}
#player-frame {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: none;
  z-index: 1; background: transparent;
}


/* ═══════════════════════════════════════════════════════════
   SEARCH
═══════════════════════════════════════════════════════════ */
#view-search  { background: var(--bg); }
#search-header{
  flex-shrink: 0; display: flex; align-items: center; gap: 14px;
  padding: 20px 52px; background: rgba(20,20,20,.98);
}
#search-box {
  flex: 1;
  background: rgba(255,255,255,.1);
  border: 3px solid rgba(255,255,255,.18);
  border-radius: var(--radius); color: var(--text);
  padding: 11px 18px; font-size: 18px; outline: none;
  transition: border-color var(--ease), background var(--ease);
}
#search-box:focus, #search-box.focused {
  border-color: #fff; background: rgba(255,255,255,.15);
}
#search-scroll  { flex: 1; overflow-y: scroll; padding: 22px 52px; }
#search-results { display: flex; flex-wrap: wrap; gap: 14px; }
.placeholder    { color: var(--muted); font-size: 18px; padding: 60px 0; width: 100%; text-align: center; }


/* ═══════════════════════════════════════════════════════════
   GLOBAL TOAST  (sign-in success, sign-out, etc.)
═══════════════════════════════════════════════════════════ */
#jm-toast {
  position: fixed; top: 76px; right: 24px; z-index: 9998;
  padding: 11px 22px; border-radius: 8px;
  font-size: 15px; font-weight: 700;
  pointer-events: none;
  opacity: 0; transform: translateY(-10px);
  transition: opacity .22s ease, transform .22s ease;
}
.jm-toast-visible {
  opacity: 1 !important; transform: translateY(0) !important;
}
.jm-toast-ok {
  background: rgba(14,14,14,.96); border: 2px solid #27ae60; color: #fff;
}
.jm-toast-neutral {
  background: rgba(14,14,14,.96); border: 2px solid rgba(255,255,255,.25); color: #ccc;
}
.jm-toast-err {
  background: rgba(14,14,14,.96); border: 2px solid #e50914; color: #fff;
}

/* ═══════════════════════════════════════════════════════════
   RESUME TOAST
═══════════════════════════════════════════════════════════ */
#resume-toast {
  position: absolute; bottom: 28px; left: 50%; z-index: 30;
  transform: translateX(-50%) translateY(16px);
  background: rgba(14,14,14,.93);
  border: 2px solid #1a6b3a;
  color: #fff; padding: 10px 26px;
  border-radius: 8px; font-size: 15px; font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transition: opacity .22s ease, transform .22s ease;
  white-space: nowrap;
}
#resume-toast.visible {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════════════════
   AD-BLOCKER TOAST
═══════════════════════════════════════════════════════════ */
#ad-blocked-toast {
  position: fixed; top: 68px; right: 22px; z-index: 9999;
  background: rgba(14,14,14,.96);
  border: 2px solid #27ae60;
  color: #fff; padding: 9px 18px;
  border-radius: 8px; font-size: 14px; font-weight: 700;
  pointer-events: none;
  opacity: 0; transform: translateX(14px);
  transition: opacity .18s ease, transform .18s ease;
}
#ad-blocked-toast.visible {
  opacity: 1; transform: translateX(0);
}

/* ═══════════════════════════════════════════════════════════
   HISTORY / FAVORITES VIEW
═══════════════════════════════════════════════════════════ */
#view-history { background: var(--bg); }

#history-header {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 16px;
  padding: 16px 52px;
  background: rgba(20,20,20,.98);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
#history-title {
  font-size: 20px; font-weight: 900; flex: 1;
}
#history-mode-tabs {
  display: flex; gap: 6px;
}
.hist-tab {
  padding: 8px 20px; border-radius: var(--radius);
  font-size: 14px; font-weight: 700;
  background: rgba(255,255,255,.08); color: var(--muted);
  border: 3px solid transparent;
  transition: background var(--ease), color var(--ease);
}
.hist-tab.active  { background: var(--accent); color: #fff; }
.hist-tab.focused { background: rgba(255,255,255,.18); color: #fff; }
.hist-tab.active.focused { background: var(--accent2); }

#history-scroll { flex: 1; overflow-y: scroll; padding: 20px 52px; }
#history-list   { display: flex; flex-direction: column; gap: 10px; }

.hist-item {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg2); border-radius: var(--radius);
  padding: 10px 14px;
  border: 3px solid transparent;
  transition: border-color var(--ease), background var(--ease);
  cursor: pointer;
}
.hist-item.focused { background: var(--bg3); }

.hist-poster {
  width: 52px; height: 78px;
  object-fit: cover; border-radius: 4px;
  flex-shrink: 0; background: var(--bg3);
}
.hist-info  { flex: 1; min-width: 0; }
.hist-title {
  font-size: 15px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 4px;
}
.hist-meta  { font-size: 13px; color: var(--muted); }

.hist-del {
  flex-shrink: 0;
  background: rgba(229,9,20,.15); color: #e55;
  padding: 8px 12px; border-radius: var(--radius);
  font-size: 16px;
  border: 3px solid transparent;
  transition: background var(--ease);
}
.hist-del.focused { background: rgba(229,9,20,.35); }

/* ── Favorite button (detail screen) ───────────────────── */
.btn-fav {
  background: rgba(255,255,255,.1); color: var(--text);
  padding: 12px 28px; border-radius: var(--radius);
  font-size: 17px; font-weight: 700;
  border: 3px solid transparent;
  transition: background var(--ease), border-color var(--ease);
}
.btn-fav.focused    { background: rgba(255,255,255,.22); }
.btn-fav.fav-active { background: rgba(229,9,20,.25); color: #ff6b6b; border-color: rgba(229,9,20,.5); }
.btn-fav.fav-active.focused { background: rgba(229,9,20,.4); }

/* Row infinite-scroll sentinel & mini spinner */
.row-sentinel {
  flex-shrink: 0;
  width: 60px; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.row-load-spin {
  width: 28px; height: 28px;
  border: 3px solid rgba(255,255,255,.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

/* ═══════════════════════════════════════════════════════════
   SHARED UTILITIES
═══════════════════════════════════════════════════════════ */
.spin-wrap  { flex: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 18px; min-height: 300px; }
.spinner    { width: 46px; height: 46px; border: 4px solid rgba(255,255,255,.12); border-top-color: var(--accent); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.err        { color: #ff6b6b; font-size: 18px; text-align: center; padding: 80px 40px; }
