/* Blocks Universe — HeroUI 스타일 */
* { box-sizing: border-box; }

/* display:flex 클래스가 hidden 속성을 덮지 않도록 */
[hidden] { display: none !important; }

/* 위 여백은 셸 .app-main(--app-pad-top 56px)이 준다 — body에 또 주면 위가 112px 빈다 */
body {
  min-height: 100vh;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Noto Sans KR", sans-serif;
}

/* 배경 그리드 패턴 (flash-deck 패턴) */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(0,111,238,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,111,238,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none; z-index: 0;
}

.bu-root { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; }
/* 오른쪽 아래 '내 재생목록' 버튼(48px + 18px)이 마지막 줄 카드를 가리지 않게 아래 자리를 비운다 */
body .bu-root.app-main { padding-bottom: calc(48px + 18px + 2rem + env(safe-area-inset-bottom, 0px)); }

/* ── 뒤로가기 버튼 (top-overlay-left 안에 위치) ── */
#welcomeBack { font-size: 0.875rem; display: inline-flex; align-items: center; gap: 0.3rem; }
.bu-root .app-badge { font-size: 0.875rem; }

/* ── 시리즈 탭 ── */
.series-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.series-tab {
  --sc: var(--primary);
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 0.7rem 0.9rem;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 1rem;
  cursor: pointer;
  font: inherit; color: var(--fg);
  text-align: left;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
.series-tab::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--sc);
  opacity: 0.35;
  transition: opacity 0.15s;
}
.series-tab:hover { transform: translateY(-2px); border-color: var(--sc); }
.series-tab.active {
  border-color: var(--sc);
  box-shadow: 0 4px 18px color-mix(in srgb, var(--sc) 25%, transparent);
}
.series-tab.active::before { opacity: 1; }
.series-tab .st-name { font-weight: 700; font-size: 1rem; }
.series-tab .st-meta { font-size: 0.875rem; color: var(--fg-muted); }
.series-tab .st-emoji { font-size: 1.2rem; }

/* ── 툴바 ── */
#toolbarSentinel { height: 1px; margin-bottom: -1px; }
.toolbar {
  position: sticky; top: 0; z-index: 50;
  margin: 0 -0.5rem 1.1rem;
  padding: 0.6rem 0.5rem;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
/* sticky 감지: 오버레이 버튼 영역만큼 공간 확보 */
.toolbar.is-stuck { padding-top: 52px; }

.season-chips {
  display: flex; flex-wrap: nowrap; gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.55rem;
}
.season-chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0.32rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--card-bg);
  color: var(--fg-muted);
  font: inherit; font-size: 0.875rem; font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}
.chip:hover { border-color: var(--sc, var(--primary)); color: var(--fg); }
.chip.active {
  background: var(--sc, var(--primary));
  border-color: var(--sc, var(--primary));
  color: #fff;
}
.chip.theme-chip.active { background: #ee5396; border-color: #ee5396; }

.filter-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.level-seg { display: flex; gap: 2px; background: var(--bg-sec); border-radius: 0.6rem; padding: 3px; }
.level-seg button {
  border: none; background: transparent;
  min-height: 40px; min-width: 44px;
  padding: 0.28rem 0.6rem; border-radius: 0.45rem;
  font: inherit; font-size: 0.875rem; font-weight: 600;
  color: var(--fg-muted); cursor: pointer;
}
.level-seg button.active { background: var(--card-bg); color: var(--fg); box-shadow: 0 1px 4px rgba(0,0,0,0.12); }

.fav-toggle {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border: 1px solid var(--border); background: var(--card-bg);
  border-radius: 0.6rem; padding: 0.34rem 0.8rem;
  min-height: 44px;
  font: inherit; font-size: 0.875rem; font-weight: 600;
  color: var(--fg-muted); cursor: pointer;
}
.fav-toggle.active { border-color: #f5a524; color: #f5a524; background: color-mix(in srgb, #f5a524 12%, transparent); }
.fav-toggle.recent-toggle.active { border-color: #006fee; color: #006fee; background: color-mix(in srgb, #006fee 12%, transparent); }

.search-box { display: flex; gap: 0.4rem; flex: 1; min-width: 200px; margin-left: auto; }
.search-box input {
  flex: 1; min-width: 0;
  min-height: 44px;
  padding: 0.42rem 0.9rem;
  border: 1px solid var(--border); border-radius: 0.6rem;
  background: var(--input-bg); color: var(--fg);
  font: inherit; font-size: 1rem;
}
.search-box input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.ai-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border: none; border-radius: 0.6rem;
  min-height: 44px;
  padding: 0.42rem 0.9rem;
  background: linear-gradient(135deg, #9353d3, #006fee);
  color: #fff; font: inherit; font-size: 0.875rem; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.ai-btn:hover { opacity: 0.88; }

.result-info { font-size: 0.875rem; color: var(--fg-muted); margin-bottom: 0.7rem; }

/* ── 에피소드 그리드 ── */
.ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 0.85rem;
}
.ep-card {
  --sc: var(--primary);
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.ep-card:hover {
  transform: translateY(-3px);
  border-color: var(--sc);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--sc) 18%, transparent);
}
.ep-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-sec);
  overflow: hidden;
}
.ep-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.ep-se {
  position: absolute; top: 6px; left: 6px;
  padding: 1px 8px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--sc) 88%, black);
  color: #fff;
  font-size: 0.875rem; font-weight: 700;
  letter-spacing: 0.02em;
}
.ep-ko-badge {
  position: absolute; top: 6px; right: 6px;
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(0,0,0,0.62);
  color: #fff;
  font-size: 0.875rem; font-weight: 700;
}
/* 즐겨찾기 버튼은 카드 전체를 덮는 .ep-open::after(z-index 1)보다 위 */
.ep-fav {
  position: absolute; bottom: 6px; right: 6px; z-index: 2;
  width: 40px; height: 40px;
  border: none; border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform 0.12s;
}
.ep-fav:hover { transform: scale(1.1); }
.ep-fav.on { color: #f5a524; }
.ep-fav .ic { width: 1.25rem; height: 1.25rem; }
.ep-fav.on .ic, .m-act.on-fav .ic, .fav-toggle.active .ic { fill: currentColor; }
.welcome-feat .wf-icon { color: var(--primary); }
.pl-drag .ic { width: 1.1rem; height: 1.1rem; }
.ep-fav:focus-visible { outline: 3px solid #fff; outline-offset: 1px; box-shadow: 0 0 0 5px var(--primary); }
.ep-body { padding: 0.6rem 0.75rem 0.7rem; }
/* 카드 열기 = 카드 전체를 덮는 투명 버튼(이름은 aria-label). 즐겨찾기 버튼(z-index 2)만 그 위 */
.ep-open {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  margin: 0; padding: 0;
  border: 0; border-radius: inherit; background: transparent;
  cursor: pointer;
}
.ep-open:focus-visible { outline: 3px solid var(--sc, var(--primary)); outline-offset: -3px; }
.ep-title {
  font-size: 0.95rem; font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.3em;
}
.ep-sub { display: flex; align-items: center; gap: 0.4rem; margin-top: 4px; }
.ep-level {
  font-size: 0.875rem; font-weight: 700;
  padding: 0 7px; border-radius: 99px;
  color: #fff;
}
.ep-en { font-size: 0.875rem; color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty-state {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--fg-muted);
  font-size: 0.95rem;
}

/* ── 웰컴 섹션 (시리즈 미선택 시) ── */
.welcome-section {
  padding: 2rem 0 3rem;
  text-align: center;
}
.welcome-section .welcome-hint {
  font-size: 1rem; color: var(--fg-muted); margin-bottom: 2rem;
}
.welcome-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.75rem;
  max-width: 760px; margin: 0 auto;
}
.welcome-feat {
  padding: 1rem 1.1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  text-align: left;
}
.welcome-feat .wf-icon { font-size: 1.5rem; margin-bottom: 0.4rem; }
.welcome-feat .wf-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.2rem; }
.welcome-feat .wf-desc { font-size: 0.875rem; color: var(--fg-muted); line-height: 1.5; }
.wf-random-btns { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.wf-random-btn {
  min-height: 44px;
  padding: 0.28rem 0.8rem;
  border: 1.5px solid var(--sc, var(--primary));
  border-radius: 99px;
  background: color-mix(in srgb, var(--sc, var(--primary)) 10%, transparent);
  color: var(--fg);
  font: inherit; font-size: 0.875rem; font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.wf-random-btn:hover { background: var(--sc, var(--primary)); color: #fff; }

/* ── AI 결과 배너 ── */
.ai-banner {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.8rem;
  margin-bottom: 0.8rem;
  background: color-mix(in srgb, #9353d3 10%, transparent);
  border: 1px solid color-mix(in srgb, #9353d3 30%, transparent);
  border-radius: 0.7rem;
  font-size: 0.875rem; font-weight: 600; color: #7828c8;
}
[data-theme="dark"] .ai-banner { color: #c9a7f0; }
.ai-banner > .ic { flex: none; }
.ai-banner button {
  margin-left: auto;
  min-height: 40px; padding: 0 0.6rem;
  border: none; background: transparent;
  color: inherit; font: inherit; font-size: 0.875rem;
  cursor: pointer; opacity: 0.8;
}
.ai-banner button:hover { opacity: 1; }

/* ── 상세 모달 ── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-card {
  /* 화면 너비의 75% — 세로가 짧은 화면에선 영상+본문이 92vh 안에 들어오도록 높이 기준으로 제한 */
  width: min(75vw, 130vh, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  box-shadow: var(--shadow);
}
.modal-video { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 1.1rem 1.1rem 0 0; overflow: hidden; }
.modal-video iframe { width: 100%; height: 100%; border: 0; display: block; }
.modal-close {
  position: absolute; top: 8px; right: 8px; z-index: 5;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border: none; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff;
  font-size: 1.1rem; cursor: pointer;
}
.modal-close:focus-visible { outline: 3px solid #fff; outline-offset: 1px; }
.modal-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.6rem 1.2rem 0;
}
.modal-nav[hidden] { display: none; }
.m-nav {
  display: inline-flex; align-items: center; gap: 0.3rem;
  min-height: 44px;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border); border-radius: 0.7rem;
  background: var(--card-bg); color: var(--fg);
  font: inherit; font-size: 0.875rem; font-weight: 700;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.m-nav:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.m-nav:disabled { opacity: 0.35; cursor: default; }
.m-nav-pos { font-size: 0.875rem; font-weight: 700; color: var(--fg-muted); }
.modal-body { padding: 1rem 1.2rem 1.2rem; }
.modal-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-bottom: 0.5rem; }
.mtag {
  font-size: 0.875rem; font-weight: 700;
  padding: 2px 9px; border-radius: 99px;
  background: var(--bg-sec); color: var(--fg-muted);
}
.mtag.series-tag { color: #fff; }
.modal-title { font-size: 1.25rem; font-weight: 800; margin: 0 0 0.15rem; }
.modal-title-sub { font-size: 0.9rem; color: var(--fg-muted); margin-bottom: 0.6rem; }
.modal-desc { font-size: 1rem; line-height: 1.65; color: var(--fg); white-space: pre-wrap; }

.lang-toggle { display: inline-flex; gap: 2px; background: var(--bg-sec); border-radius: 99px; padding: 2px; margin-left: auto; }
.lang-toggle button {
  border: none; background: transparent;
  min-height: 38px; min-width: 44px;
  padding: 2px 12px; border-radius: 99px;
  font: inherit; font-size: 0.875rem; font-weight: 700;
  color: var(--fg-muted); cursor: pointer;
}
.lang-toggle button.active { background: var(--card-bg); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.lang-toggle button.ai-lang { color: #9353d3; }
.lang-toggle button.ai-lang.active { background: linear-gradient(135deg, #9353d3, #006fee); color: #fff; box-shadow: 0 1px 4px rgba(147,83,211,0.35); }

.modal-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}
.m-act {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  min-height: 44px;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  background: var(--card-bg);
  color: var(--fg);
  font: inherit; font-size: 0.9rem; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.m-act:hover { border-color: var(--primary); color: var(--primary); }
.m-act.on-fav {
  border-color: #f5a524; color: #c07c0a;
  background: color-mix(in srgb, #f5a524 12%, transparent);
}
.m-act.on-pl {
  border-color: var(--success); color: var(--success);
  background: color-mix(in srgb, var(--success) 10%, transparent);
}

/* ── 재생목록 FAB + 드로어 ── */
.pl-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 900;
  display: flex; align-items: center; gap: 0.45rem;
  min-height: 48px;
  padding: 0.7rem 1.1rem;
  border: none; border-radius: 99px;
  background: var(--primary); color: #fff;
  font: inherit; font-size: 0.95rem; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,111,238,0.4);
  transition: transform 0.15s;
}
.pl-fab:hover { transform: translateY(-2px); }
.pl-fab .pl-count[hidden] { display: none; }
.pl-fab .pl-count {
  background: rgba(255,255,255,0.25);
  border-radius: 99px;
  padding: 0 7px;
  font-size: 0.875rem;
}
/* 닫혀 있을 때는 visibility:hidden — 화면 밖에 있어도 Tab으로 들어가지 않게(전환이 끝난 뒤 숨김) */
.pl-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1100;
  width: min(380px, 94vw);
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0,0,0,0.18);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.22s ease, visibility 0s linear 0.22s;
}
.pl-drawer.open { transform: translateX(0); visibility: visible; transition: transform 0.22s ease; }
.pl-head {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1rem 0.6rem;
}
.pl-head h2 { font-size: 1rem; margin: 0; flex: 1; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.pl-close-btn {
  border: none; background: var(--bg-sec); color: var(--fg-muted);
  width: 44px; height: 44px; border-radius: 50%;
  font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background 0.12s, color 0.12s;
}
.pl-close-btn:hover { background: var(--border); color: var(--fg); }
.pl-title-wrap {
  padding: 0 1rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
.pl-title-input {
  width: 100%;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border); border-radius: 0.6rem;
  background: var(--input-bg); color: var(--fg);
  font: inherit; font-size: 0.85rem;
}
.pl-list { flex: 1; overflow-y: auto; padding: 0.6rem; }
.pl-item {
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.35rem 0.3rem;
  border-radius: 0.6rem;
  transition: background 0.1s;
}
.pl-open {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 0.5rem;
  min-height: 44px; padding: 0.15rem;
  border: 0; border-radius: 0.45rem; background: none;
  font: inherit; color: var(--fg); text-align: left; cursor: pointer;
}
.pl-move { display: flex; gap: 2px; flex-shrink: 0; }
.pl-item:hover { background: var(--bg-sec); }
.pl-item.dragging { opacity: 0.35; }
.pl-item.drag-over { background: color-mix(in srgb, var(--primary) 10%, var(--bg-sec)); outline: 2px dashed var(--primary); }
.pl-drag {
  color: var(--fg-muted); cursor: grab; font-size: 1.1rem;
  padding: 0 1px; flex-shrink: 0; user-select: none; line-height: 1;
}
.pl-drag:active { cursor: grabbing; }
.pl-item img { width: 60px; aspect-ratio: 16/9; object-fit: cover; border-radius: 0.35rem; flex-shrink: 0; }
.pl-item .pl-item-title {
  flex: 1; min-width: 0; font-size: 0.875rem; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pl-del-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--fg-muted);
  font-size: 0.875rem; cursor: pointer; padding: 0; border-radius: 0.45rem;
  flex-shrink: 0; transition: background 0.1s, color 0.1s;
}
.pl-del-btn:hover { background: var(--border); color: var(--fg); }
.pl-del-btn:disabled { opacity: 0.3; cursor: default; background: transparent; }
.pl-foot {
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0.45rem;
}
.pl-play-btn {
  width: 100%; font-size: 0.95rem; padding: 0.65rem; font-weight: 700;
  min-height: 48px;
  border-radius: 0.75rem; letter-spacing: 0.01em;
}
.pl-foot-row { display: flex; gap: 0.45rem; }
.pl-sec-btn {
  flex: 1; font-size: 0.875rem; padding: 0.55rem 0.3rem;
  min-height: 44px;
  text-align: center; border-radius: 0.65rem;
}
body.pl-open .top-overlay,
body.pl-open .top-overlay-left { display: none; }   /* 드로어(대화상자)가 열리면 상단 버튼이 제목을 가리지 않게 */
body.player-open .top-overlay,
body.player-open .top-overlay-left { display: none; }
.pl-empty { text-align: center; color: var(--fg-muted); font-size: 0.9rem; padding: 2.5rem 1rem; line-height: 1.6; }

/* ── 순차재생 오버레이 ── */
.player-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(8,8,12,0.96);
  display: flex; flex-direction: column;
  padding: 1rem;
  overflow: auto;            /* 낮은 화면에서도 이전·다음·재생 순서 줄까지 스크롤로 닿게 */
  overscroll-behavior: contain;
}
.player-overlay > * { flex-shrink: 0; }
.player-head {
  display: flex; align-items: center; gap: 0.7rem;
  color: #fff; padding-bottom: 0.7rem;
  max-width: 960px; width: 100%; margin: 0 auto;
}
.player-head h2 { font-size: 1rem; margin: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-head button {
  display: inline-flex; align-items: center; gap: 0.3rem;
  min-height: 44px;
  border: 1px solid rgba(255,255,255,0.25); border-radius: 0.55rem;
  background: rgba(255,255,255,0.08); color: #fff;
  font: inherit; font-size: 0.9rem; padding: 0.35rem 0.9rem; cursor: pointer;
}
.player-overlay button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
/* 영상은 높이 기준으로도 줄어든다 — 1280×720·844×390에서 이전·다음 버튼과 재생 순서 줄이 화면 안에 남게 */
.player-stage {
  width: min(100%, 960px, calc((100vh - 240px) * 16 / 9));
  width: min(100%, 960px, calc((100dvh - 240px) * 16 / 9));
  min-width: min(100%, 240px);
  margin: 0 auto;
  aspect-ratio: 16/9; background: #000; border-radius: 0.8rem; overflow: hidden;
}
.player-stage iframe, .player-stage > div { width: 100%; height: 100%; }
.player-controls {
  max-width: 960px; width: 100%; margin: 0.7rem auto 0;
  display: flex; align-items: center; gap: 0.7rem;
  color: #fff;
}
.player-controls .pc-info { flex: 1; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-controls .pc-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  min-height: 44px;
  color: #fff; border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.08);
}
.player-controls .pc-btn:disabled { opacity: 0.4; }
.player-queue {
  max-width: 960px; width: 100%; margin: 0.6rem auto 0;
  display: flex; gap: 0.5rem; overflow-x: auto;
  padding-bottom: 0.6rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.18) transparent;
}
.player-queue::-webkit-scrollbar { height: 4px; }
.player-queue::-webkit-scrollbar-track { background: transparent; }
.player-queue::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 2px; }
.player-queue .pq-item {
  position: relative;
  flex: 0 0 120px; cursor: pointer; border-radius: 0.5rem; overflow: hidden;
  margin: 3px 0 0 3px; padding: 0; border: 0; background: none; font: inherit;
  outline: 2px solid transparent;
  opacity: 0.6;
}
.player-queue .pq-item.current { outline-color: var(--primary); opacity: 1; }
.player-queue .pq-item:hover, .player-queue .pq-item:focus-visible { opacity: 1; }
.player-queue .pq-item img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.pq-dur {
  position: absolute; right: 4px; bottom: 4px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(0,0,0,0.75); color: #fff;
  font-size: 0.875rem; font-weight: 600;
}
.pl-total { font-size: 0.875rem; font-weight: 500; color: var(--fg-muted); }
.pl-item-dur { display: block; margin-top: 2px; font-size: 0.875rem; font-weight: 500; color: var(--fg-muted); }

/* 토스트는 공용 VUI.toast(public/common/ui.js)를 쓴다 */

/* 낮은 화면(가로 폰 844×390 등): 여백·재생 순서 썸네일을 줄여 영상을 조금 더 크게 */
@media (max-height: 500px) {
  .player-overlay { padding: 0.5rem 1rem; }
  .player-head { padding-bottom: 0.35rem; }
  .player-stage {
    width: min(100%, 960px, calc((100vh - 190px) * 16 / 9));
    width: min(100%, 960px, calc((100dvh - 190px) * 16 / 9));
  }
  .player-controls { margin-top: 0.35rem; }
  .player-queue { margin-top: 0.35rem; padding-bottom: 0.3rem; }
  .player-queue .pq-item { flex-basis: 88px; }
}

/* ── 반응형 ── */
@media (max-width: 720px) {
  .series-tabs { grid-template-columns: repeat(2, 1fr); }
  .ep-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; }
  .ep-title { font-size: 0.9rem; }
  .search-box { flex-basis: 100%; }
  .modal-body { padding: 0.85rem 1rem 1rem; }
  .modal-card { width: 100%; }
  .modal-nav { padding: 0.55rem 1rem 0; }
}
