/* ═══════════════════════════════════════════
   SamPlay — Netflix-style CSS
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #141414;
  --surface: #181818;
  --surface2: #222;
  --red: #e50914;
  --text: #fff;
  --text2: #aaa;
  --text3: #555;
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); overflow-x: hidden; min-height: 100vh; }

/* GPU acceleration for animated elements */
.card, .hero-bg, .card-img, .card-hover-overlay, .view { will-change: transform; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

/* ══ NAVBAR ══ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  padding: 0 4%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, transparent 100%);
  transition: background 0.4s;
}
.navbar.solid { background: #141414; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav-left  { display: flex; align-items: center; gap: 2.5rem; }
.nav-logo  { font-size: 1.75rem; font-weight: 900; color: var(--red); letter-spacing: -1px; cursor: pointer; display: flex; align-items: center; gap: 8px; user-select: none; transition: transform 0.2s; }
.nav-logo:hover { transform: scale(1.02); }
.nav-logo-img { height: 36px; width: auto; object-fit: contain; }
.nav-logo-text { color: var(--red); }
.nav-links { display: flex; list-style: none; gap: 1.5rem; }
.nav-link  { color: var(--text2); font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: color 0.2s; border-bottom: 2px solid transparent; padding-bottom: 2px; }
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); border-bottom-color: var(--red); }
.nav-right { display: flex; align-items: center; flex-shrink: 0; }

/* Nav player-mode bar */
.nav-player-bar {
  display: flex; align-items: center; gap: 12px;
  min-width: 0; flex: 1;
}
.nav-back-btn {
  display: flex; align-items: center; gap: 7px; flex-shrink: 0;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: var(--text); padding: 7px 14px; border-radius: 5px;
  font-family: 'Inter', sans-serif; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: background 0.2s; white-space: nowrap;
}
.nav-back-btn:hover { background: rgba(255,255,255,0.2); }
.nav-player-title {
  font-size: 0.95rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}

/* Search */
.search-wrap { position: relative; display: flex; align-items: center; justify-content: flex-end; height: 40px; }
.search-icon-btn { 
  position: absolute; left: 2px; z-index: 5;
  background: none; border: none; cursor: pointer; color: var(--text);
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, opacity 0.2s; 
}
.search-icon-btn:hover { opacity: 0.7; transform: scale(1.05); }

.search-box { 
  display: flex; align-items: center; overflow: hidden; 
  width: 40px; height: 40px; /* Collapsed state */
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); 
  background: transparent; border: 1px solid transparent; 
  border-radius: 40px; 
}
.search-box.open { 
  width: 280px; 
  background: rgba(20, 20, 20, 0.65); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2); 
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.search-box.open:focus-within {
  border-color: rgba(255,255,255,0.5);
  background: rgba(0, 0, 0, 0.85);
}

.search-input { 
  background: none; border: none; outline: none; 
  color: var(--text); font-family: 'Inter', sans-serif; font-size: 0.95rem; 
  padding: 8px 40px 8px 44px; /* Space for icon and clear btn */
  width: 100%; height: 100%;
  opacity: 0; transition: opacity 0.3s;
}
.search-box.open .search-input { opacity: 1; }
.search-input::placeholder { color: var(--text2); font-weight: 400; }

.search-clear { 
  position: absolute; right: 10px; z-index: 5;
  background: rgba(255,255,255,0.15); border: none; cursor: pointer; 
  color: var(--text); width: 20px; height: 20px; border-radius: 50%;
  font-size: 11px; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; 
}
.search-clear:hover { color: #fff; background: rgba(229,9,20,0.9); }

/* ══ VIEWS ══ */
.view {
  min-height: 100vh;
  animation: viewFadeIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.view-header { padding: 100px 4% 1.5rem; }
.view-header h1 { font-size: 1.8rem; font-weight: 800; }

/* ══ HERO ══ */
.hero { position: relative; height: 90vh; min-height: 520px; display: flex; align-items: flex-end; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center top;
  transition: opacity 0.7s ease;
}
.hero-bg.fading { opacity: 0; }
.hero-bg-next {
  position: absolute; inset: 0; background-size: cover; background-position: center top;
  opacity: 0; transition: opacity 0.7s ease; pointer-events: none;
}
.hero-bg-next.visible { opacity: 1; }
.hero-vignette {
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(20,20,20,0.95) 30%, rgba(20,20,20,0.4) 70%, transparent 100%),
              linear-gradient(to top, rgba(20,20,20,1) 0%, rgba(20,20,20,0.1) 30%, transparent 60%);
}
.hero-content { position: relative; z-index: 1; padding: 0 4% 6%; max-width: 600px; }
.hero-dots {
  position: absolute; right: 4%; bottom: 10%;
  display: flex; flex-direction: column; gap: 15px;
  z-index: 10;
}
.hero-dot-btn {
  width: 40px; height: 3px; background: rgba(255,255,255,0.2);
  border: none; cursor: pointer; position: relative; overflow: hidden;
  transition: background 0.3s;
}
.hero-dot-btn.active { background: rgba(255,255,255,0.4); }
.hero-dot-progress {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: var(--red); transition: width 0.1s linear;
}
.hero-dot-btn.active .hero-dot-progress { width: 100%; transition: width 8s linear; }

/* Skeleton */
.sk { 
  border-radius: 4px; 
  background: rgba(255,255,255,0.1); 
  animation: shimmer 1.5s infinite alternate; 
  position: relative;
  overflow: hidden;
}
.sk::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  transform: translateX(-100%);
  animation: shimmer-slide 2s infinite;
}
@keyframes shimmer { from { opacity: 0.4; } to { opacity: 0.8; } }
@keyframes shimmer-slide { 100% { transform: translateX(100%); } }

.hero-content.loading .hero-badge,
.hero-content.loading .hero-title,
.hero-content.loading .hero-meta,
.hero-content.loading .hero-overview,
.hero-content.loading .hero-btns {
  display: none;
}
.sk-badge  { width: 80px;  height: 22px; margin-bottom: 14px; }
.sk-title  { width: 400px; max-width: 80vw; height: 60px; margin-bottom: 16px; border-radius: 6px; }
.sk-meta   { width: 220px; height: 18px; margin-bottom: 14px; }
.sk-desc   { width: 100%;  height: 14px; margin-bottom: 8px; }
.sk-short  { width: 70%; }
.sk-btns   { width: 260px; height: 46px; margin-top: 20px; border-radius: 6px; }

/* Skeleton Row */
.skeleton-row { margin-bottom: 2rem; }
.skeleton-row .row-header { margin-bottom: 1rem; }
.skeleton-row .row-track { gap: 0.8rem; padding: 0 4%; }
.skeleton-row .card { 
  background: rgba(255,255,255,0.05); 
  border-radius: 4px;
}

/* Hero real content */
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(229,9,20,0.15); border: 1px solid rgba(229,9,20,0.4); color: #ff6b7a; border-radius: 4px; padding: 4px 10px; font-size: 0.75rem; font-weight: 700; letter-spacing: 1px; margin-bottom: 12px; text-transform: uppercase; }
.hero-title { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900; line-height: 1.05; letter-spacing: -1.5px; margin-bottom: 12px; text-shadow: 2px 2px 8px rgba(0,0,0,0.5); }
.hero-meta  { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.hero-rating { color: #46d369; font-weight: 700; font-size: 0.9rem; }
.hero-year, .hero-genre { color: var(--text2); font-size: 0.85rem; }
.hero-dot { color: var(--text3); }
.hero-overview { font-size: 0.95rem; line-height: 1.6; color: #ddd; margin-bottom: 22px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-play {
  display: flex; align-items: center; gap: 8px;
  background: var(--text); color: #000;
  border: none; padding: 11px 24px; border-radius: 5px;
  font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: background 0.2s, transform 0.12s;
}
.btn-play:hover  { background: rgba(255,255,255,0.85); transform: scale(1.04); }
.btn-play:active { transform: scale(0.97); }
.btn-info {
  display: flex; align-items: center; gap: 8px;
  background: rgba(109,109,110,0.7); color: var(--text);
  border: none; padding: 11px 24px; border-radius: 5px;
  font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: background 0.2s, transform 0.12s;
}
.btn-info:hover  { background: rgba(109,109,110,0.5); transform: scale(1.04); }
.btn-info:active { transform: scale(0.97); }

/* ══ ROWS ══ */
.rows-wrap { padding-bottom: 60px; }
.row { margin-bottom: 3vw; }

.row-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4%; margin-bottom: 10px;
  gap: 1rem;
}
.row-title {
  font-size: 1.1rem; font-weight: 700; color: var(--text); letter-spacing: 0.3px;
  white-space: nowrap;
}
.see-all-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text2); font-family: 'Inter', sans-serif;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.3px;
  display: flex; align-items: center; gap: 4px;
  padding: 4px 8px; border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap; flex-shrink: 0;
}
.see-all-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.08);
}
.see-all-btn .arrow { transition: transform 0.2s; }
.see-all-btn:hover .arrow { transform: translateX(3px); }
.row-track-wrap { position: relative; }
.row-track {
  display: flex; gap: 6px; padding: 6px 4%;
  overflow-x: auto; scroll-behavior: smooth;
  scrollbar-width: none;
}
.row-track::-webkit-scrollbar { display: none; }

/* Scroll arrows */
.row-arrow {
  position: absolute; top: 0; bottom: 0; width: 5%;
  min-width: 40px;
  background: rgba(20,20,20,0.85); border: none; cursor: pointer;
  color: var(--text); font-size: 1.3rem; z-index: 20;
  display: none; align-items: center; justify-content: center;
  transition: background 0.2s;
  pointer-events: auto;
}
.row-track-wrap:hover .row-arrow { display: flex; }
.row-arrow:hover { background: rgba(20,20,20,1); }
.row-arrow-left  { left: 0; border-radius: 0 4px 4px 0; }
.row-arrow-right { right: 0; border-radius: 4px 0 0 4px; }

/* ══ CARDS ══ */
.card {
  flex: 0 0 160px; width: 160px; border-radius: 4px;
  overflow: visible; cursor: pointer; position: relative;
  z-index: 1; flex-shrink: 0;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.card:hover { z-index: 2; transform: translateY(-4px); }
.card:active { transform: scale(0.97) translateY(0); }

.card-img-wrap {
  position: relative; width: 100%; aspect-ratio: 2/3;
  border-radius: 4px; overflow: hidden; background: var(--surface2);
  transition: box-shadow 0.3s ease;
}
.card:hover .card-img-wrap {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.25), 0 14px 35px rgba(0,0,0,0.75);
}

.card-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.card:hover .card-img { transform: scale(1.08); }

.card-no-img {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  color: var(--text3); font-size: 2rem;
}
.card-no-img span { font-size: 0.7rem; text-align: center; padding: 0 8px; color: var(--text3); }

.card-hover-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
  opacity: 0; transition: opacity 0.22s ease;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 10px 8px;
  border-radius: 4px; transform: translateZ(0);
}
.card:hover .card-hover-overlay { opacity: 1; }
.card-hover-title { font-size: 0.75rem; font-weight: 700; line-height: 1.2; margin-bottom: 6px; }
.card-hover-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.card-hover-rating { color: #46d369; font-size: 0.68rem; font-weight: 700; }
.card-hover-year   { color: var(--text2); font-size: 0.68rem; }
.card-play-btn {
  background: var(--text); color: #000;
  border: none; border-radius: 3px; padding: 5px 10px;
  font-family: 'Inter', sans-serif; font-size: 0.72rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 5px;
  transition: background 0.2s; width: fit-content;
}
.card-play-btn:hover { background: rgba(255,255,255,0.85); }
.card-btns { display: flex; gap: 6px; }
.card-list-btn {
  background: rgba(109,109,110,0.7); color: var(--text);
  border: none; border-radius: 3px; width: 28px; height: 28px;
  font-family: 'Inter', sans-serif; font-size: 1rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.card-list-btn:hover { background: rgba(109,109,110,0.5); }

.card-type-pill {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  font-size: 0.58rem; font-weight: 800; padding: 2px 5px; border-radius: 2px; letter-spacing: 0.5px;
}
.pill-movie { background: rgba(229,9,20,0.85); color: white; }
.pill-tv    { background: rgba(70,211,105,0.85); color: #000; }

/* ══ SEE ALL VIEW ══ */
.seeall-inner { padding: 90px 4% 60px; }
.seeall-header {
  display: flex; align-items: baseline; gap: 1rem;
  margin-bottom: 1.5rem; flex-wrap: wrap;
}
.seeall-title { font-size: 1.6rem; font-weight: 800; }
.seeall-count { font-size: 0.85rem; color: var(--text3); }

/* ══ SEARCH VIEW ══ */
.search-view-inner { padding: 100px 4% 60px; }
.search-hint { color: var(--text2); font-size: 1rem; margin-bottom: 1.5rem; }
.search-hint strong { color: var(--text); }
.search-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; }
.search-grid .card { flex: none; width: 100%; }

/* ══ PLAYER VIEW ══ */
.player-page { background: #141414; padding-top: 68px; height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.player-layout {
  display: flex;
  flex-direction: row;
  max-width: 1600px;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 20px 4%;
  gap: 2rem;
  align-items: flex-start;
}

.player-main {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none;
}
.player-main::-webkit-scrollbar { display: none; }

.player-sidebar {
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
}
.player-sidebar::-webkit-scrollbar { display: none; }

.player-box { position: relative; width: 100%; padding-top: 56.25%; background: #000; overflow: hidden; flex-shrink: 0; }
.player-watermark {
  position: absolute; top: 16px; right: 16px; z-index: 50;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(20,20,20,0.4); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; opacity: 0.8;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.player-watermark img { width: 22px; height: auto; object-fit: contain; }

.player-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  color: var(--text2); font-size: 0.9rem;
  transition: opacity 0.35s ease;
}
.player-loading.hidden { opacity: 0; pointer-events: none; }
.spin-ring { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.1); border-top-color: var(--red); animation: spin 0.75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.player-iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: none;
  opacity: 0; transition: opacity 0.5s ease;
}
.player-iframe.ready { opacity: 1; }

/* TV Controls */
.tv-controls { background: var(--surface); padding: 1rem; border-radius: 8px; border: 1px solid #2a2a2a; }
.tv-selects { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.sel-label { display: flex; flex-direction: column; gap: 6px; font-size: 0.78rem; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; flex: 1; }
.sel-label select { background: var(--surface2); border: 1px solid #333; color: var(--text); padding: 8px 12px; border-radius: 4px; font-family: 'Inter', sans-serif; font-size: 0.9rem; cursor: pointer; outline: none; width: 100%; transition: border-color 0.2s; }
.sel-label select:focus { border-color: var(--red); }
.ep-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.ep-btn { background: var(--surface2); border: 1px solid #333; color: var(--text); padding: 8px 18px; border-radius: 4px; cursor: pointer; font-family: 'Inter', sans-serif; font-size: 0.85rem; font-weight: 600; transition: all 0.18s, transform 0.12s; flex: 1; text-align: center; }
.ep-btn:hover  { border-color: var(--red); color: var(--red); transform: scale(1.04); }
.ep-btn:active { transform: scale(0.96); }
.ep-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.ep-indicator { font-size: 0.9rem; font-weight: 700; color: var(--red); white-space: nowrap; }

/* Player Meta */
.player-meta { padding: 0; }
.pm-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 10px; line-height: 1.2; }
.pm-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pm-rating { color: #46d369; font-weight: 700; font-size: 0.9rem; }
.pm-year, .pm-genre, .pm-runtime { color: var(--text2); font-size: 0.85rem; }
.pm-dot { color: var(--text3); }
.pm-overview { font-size: 0.95rem; line-height: 1.6; color: #ccc; }
.pm-tagline { font-style: italic; color: var(--text3); font-size: 0.9rem; margin-bottom: 10px; }


.load-more-wrap { text-align: center; padding: 2rem; }
.load-more-btn { background: transparent; border: 2px solid #555; color: var(--text2); padding: 10px 36px; border-radius: 4px; font-family: 'Inter', sans-serif; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.load-more-btn:hover { border-color: var(--text); color: var(--text); }

/* Toast */
.toast {
  position: fixed; bottom: 2rem; left: 50%;
  transform: translateX(-50%) translateY(16px) scale(0.95);
  background: rgba(30,30,30,0.95); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.12); color: var(--text);
  padding: 10px 20px; border-radius: 8px; font-size: 0.9rem;
  opacity: 0; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 999; pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }

/* Empty state */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text3); }
.empty-icon  { font-size: 3rem; margin-bottom: 1rem; }
.empty-title { font-size: 1.1rem; font-weight: 600; color: var(--text2); margin-bottom: 6px; }

/* Responsive */
@media (max-width: 1024px) {
  .player-page { height: auto; overflow: visible; display: block; width: 100%; overflow-x: hidden; }
  .player-layout { display: flex; flex-direction: column; gap: 0; padding: 0; height: auto; width: 100%; }
  
  /* Use display:contents to allow flex-ordering across wrappers */
  .player-main, .player-sidebar { display: contents; }
  
  /* Set visual order */
  .player-box { order: 1; border-bottom: 1px solid #222; width: 100%; }
  .tv-controls { order: 2; margin: 1.5rem 4% 0; }
  .player-meta { order: 3; padding: 1.5rem 4% 0; }
  #player-suggested-row { order: 4; padding: 0 0 2rem; margin-top: 1.5rem; width: 100%; overflow-x: hidden; }
  
  .card { flex: 0 0 140px; width: 140px; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-player-bar { gap: 8px; }
  .nav-player-title { font-size: 0.82rem; }
  .nav-back-btn { padding: 6px 10px; font-size: 0.8rem; }
  .hero { height: 70vh; }
  .hero-vignette { background: linear-gradient(to top, rgba(20,20,20,1) 0%, rgba(20,20,20,0.6) 50%, rgba(20,20,20,0.3) 100%); }
  .hero-content { max-width: 100%; padding: 0 4% 8%; }
  .hero-title { letter-spacing: -0.5px; }
  .hero-overview { -webkit-line-clamp: 2; }
  .card { flex: 0 0 110px; width: 110px; }
  .search-box.open { width: 180px; }
  .tv-selects { gap: 0.75rem; }
  .tv-controls { padding: 1rem; }
  .player-meta { padding: 1rem; }
  .pm-title { font-size: 1.2rem; }
  .ep-nav { flex-wrap: wrap; gap: 0.5rem; }
  .search-view-inner { padding: 88px 4% 40px; }
  .view-header { padding: 88px 4% 1rem; }
}

/* ══ CUSTOM PLAY SCREEN ══ */
/* Covers the iframe after it loads, intercepting the dangerous first tap */
.custom-play-screen {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: #000 center/cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  transition: opacity 0.3s ease;
}
.cps-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.75) 100%);
}
.cps-play-btn {
  position: relative;
  z-index: 2;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(229, 9, 20, 0.9);
  border: 3px solid rgba(255,255,255,0.3);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), background 0.2s;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 0 rgba(229,9,20,0.4);
  animation: pulse-ring 2s ease-out infinite;
}
.cps-play-btn svg { margin-left: 5px; } /* optical center */
.cps-play-btn:hover  { background: var(--red); transform: scale(1.1); }
.cps-play-btn:active { transform: scale(0.95); }

@keyframes pulse-ring {
  0%   { box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 0   rgba(229,9,20,0.5); }
  70%  { box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 20px rgba(229,9,20,0);   }
  100% { box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 0   rgba(229,9,20,0);   }
}

.cps-hint {
  position: relative;
  z-index: 2;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ══ AD SHIELD OVERLAY ══ */
/*
  Sits permanently on top of the iframe during playback.
  pointer-events controlled by JS: 'none' during play screen, 'auto' during playback.
  Intercepts every tap, locks window focus, then re-dispatches to iframe.
*/
.ad-shield-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none; /* JS sets to 'auto' after play screen dismissed */
  background: transparent;
  /* Uncomment to debug: background: rgba(255,0,0,0.05); */
}
/* .active class no longer needed — JS directly sets style.pointerEvents */

/* Ad blocked micro-toast inside player */
.ad-blocked-toast {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(20, 20, 20, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(70, 211, 105, 0.4);
  color: #46d369;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 60;
  letter-spacing: 0.3px;
}
.ad-blocked-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 480px) {
  .nav-logo { font-size: 1.4rem; }
  .nav-player-title { display: none; }
  .hero { height: 60vh; min-height: 380px; }
  .hero-btns .btn-info { display: none; }
  .card { flex: 0 0 95px; width: 95px; }
  .card:hover { transform: scale(1.1); }
  .row-title { font-size: 0.95rem; }
  .sel-label select { min-width: 100px; font-size: 0.82rem; padding: 6px 8px; }
  .ep-btn { padding: 7px 12px; font-size: 0.8rem; }
  .pm-title { font-size: 1.05rem; }
  .pm-overview { font-size: 0.88rem; }
  .search-grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 10px; }
}
