/* ══════════════════════════════════════════
   EngJoy — 회차 듣기 플레이어 스타일 (player.css)
   style.css 뒤에 로드하세요.
   (기존 퀴즈 화면의 .pl-* 클래스와 충돌하지 않도록 ejp- 접두사 사용)
   ══════════════════════════════════════════ */

/* ── 회차 목록: 전체 이어듣기 배너 ── */
.listen-all {
  display: flex; align-items: center; gap: 12px;
  margin: 10px 16px 12px;
  background: var(--blue); border: 2.5px solid var(--ink);
  border-radius: 16px; padding: 13px 14px;
  box-shadow: 3px 3px 0 var(--ink);
  color: #fff; cursor: pointer;
}
.listen-all:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.la-ic {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: #fff; border: 2px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  color: var(--blue);
}
.la-ic i { font-size: 1.375rem; line-height: 1; }
.la-txt { flex: 1; min-width: 0; }
.la-t1 { font-size: 0.9375rem; font-weight: 900; }
.la-t2 { font-size: 0.71875rem; color: rgba(255,255,255,.85); font-weight: 700; margin-top: 2px; }
.la-play {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: #fff; border: 2px solid var(--ink); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.la-play i { font-size: 1.25rem; line-height: 1; }

/* ── 회차 카드 ▶ 버튼 ── */
.folder-play {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  border: 2px solid var(--ink); background: #e8f0fb; color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  transition: transform .1s;
}
.folder-play i { font-size: 1.25rem; line-height: 1; }
.folder-play:active { transform: scale(.94); }
.folder-play.playing { background: var(--blue); color: #fff; }

/* ── 미니 플레이어 (탭바 위 도킹) ── */
.mini-player {
  position: absolute;
  left: 14px; right: 14px;
  bottom: calc(96px + env(safe-area-inset-bottom));
  display: none; align-items: center; gap: 11px;
  background: #fff; border: 2.5px solid var(--ink);
  border-radius: 16px; padding: 11px 12px;
  box-shadow: 3px 3px 0 var(--ink);
  overflow: hidden; cursor: pointer; z-index: 20;
}
.mini-player.show { display: flex; }
.mp-prog { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: #e8f0fb; z-index: 0; transition: width .3s; }
.mini-player > *:not(.mp-prog) { position: relative; z-index: 1; }
.mp-ic {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  border: 2px solid var(--ink); background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.mp-ic i { font-size: 1.25rem; line-height: 1; }
.mp-txt { flex: 1; min-width: 0; }
.mp-en  { font-size: 0.84375rem; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-sub { font-size: 0.6875rem; color: var(--muted); font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-btn {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  border: 2px solid var(--ink); background: #fff; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.mp-btn i { font-size: 1.1875rem; line-height: 1; }
.mp-btn:active { transform: scale(.94); }
.mp-btn.mp-pp { background: var(--coral); color: #fff; }

/* 플레이어 켜짐: 스크롤 여백 확보 + FAB 위로 피하기 */
.app.player-on .screen { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
.app.player-on .fab-register { bottom: calc(172px + env(safe-area-inset-bottom)); }
/* 집중 화면·프로필에서는 탭바와 함께 숨김 */
.app.chrome-hidden .mini-player,
.app.profile-open  .mini-player { display: none; }

/* ── 풀 플레이어 ── */
.player-screen {
  position: absolute; inset: 0; z-index: 40;
  background: var(--bg);
  display: none; flex-direction: column;
  overflow-y: auto;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.player-screen.open { display: flex; animation: ejp-up .3s cubic-bezier(.32,1,.32,1); }
@keyframes ejp-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.ejp-head { display: flex; align-items: center; gap: 8px; padding: 16px 16px 4px; }
.ejp-title { flex: 1; text-align: center; font-size: 0.9375rem; font-weight: 900; }
.ejp-hbtn {
  width: 38px; height: 38px; border: 2px solid var(--ink); border-radius: 12px;
  background: #fff; color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex: none; padding: 0;
}
.ejp-hbtn i { font-size: 1.1875rem; line-height: 1; }
.ejp-hbtn.plain { border: none; background: none; }
.ejp-hbtn.plain i { font-size: 1.5rem; }

.ejp-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px 0; }
.ejp-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: #e8f0fb; color: var(--blue); border: 1.5px solid var(--blue);
  border-radius: 999px; padding: 5px 12px; font-size: 0.75rem; font-weight: 900;
  min-width: 0;
}
.ejp-badge span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ejp-count { font-family: var(--font-title, inherit); font-size: 0.9375rem; color: var(--muted); white-space: nowrap; flex: none; }
.ejp-count b { color: var(--ink); font-size: 1.375rem; font-weight: 900; }

.ejp-card {
  background: #fff; border: 2.5px solid var(--ink); border-radius: 20px;
  margin: 14px 16px 0; padding: 26px 20px 22px; text-align: center;
  box-shadow: 4px 4px 0 var(--ink); position: relative;
}
.ejp-fav {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--ink); background: #fff; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.ejp-fav i { font-size: 1rem; line-height: 1; }
.ejp-fav.on { background: var(--yellow); }
.ejp-eq { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 22px; margin-bottom: 16px; }
.ejp-eq span { width: 5px; border-radius: 3px; background: var(--blue); animation: ejp-eq 1s ease-in-out infinite; }
.ejp-eq span:nth-child(1) { height: 8px;  animation-delay: 0s; }
.ejp-eq span:nth-child(2) { height: 16px; animation-delay: .15s; }
.ejp-eq span:nth-child(3) { height: 22px; animation-delay: .3s; }
.ejp-eq span:nth-child(4) { height: 12px; animation-delay: .45s; }
.ejp-eq span:nth-child(5) { height: 18px; animation-delay: .6s; }
.ejp-eq span:nth-child(6) { height: 7px;  animation-delay: .75s; }
@keyframes ejp-eq { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.35); } }
.ejp-eq.paused span { animation-play-state: paused; }
.ejp-en { font-size: 1.5rem; font-weight: 900; line-height: 1.4; text-wrap: pretty; word-break: keep-all; }
.ejp-kr { font-size: 0.875rem; color: var(--muted); font-weight: 700; margin-top: 12px; }

.ejp-bar { margin: 22px 24px 0; height: 12px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; }
.ejp-bar i { display: block; height: 100%; width: 0%; background: var(--yellow-bright, #FFE000); border-right: 2px solid var(--ink); transition: width .3s; }
.ejp-bar-lbl { display: flex; justify-content: space-between; margin: 6px 26px 0; font-size: 0.6875rem; font-weight: 800; color: var(--muted); }
.ejp-bar-lbl b { font-family: var(--font-title, inherit); color: var(--ink); }

.ejp-ctrl { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 24px; }
.ejp-side {
  width: 48px; height: 48px; border-radius: 50%;
  border: 2px solid var(--ink); background: #fff; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.ejp-side i { font-size: 1.375rem; line-height: 1; }
.ejp-side:active { transform: scale(.94); }
.ejp-main {
  width: 72px; height: 72px; border-radius: 50%;
  border: 2.5px solid var(--ink); background: var(--coral); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  box-shadow: 4px 4px 0 var(--ink);
}
.ejp-main i { font-size: 2.125rem; line-height: 1; }
.ejp-main:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.ejp-mini2 {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--border-soft, #E3D8BF); background: #fff; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; gap: 0;
}
.ejp-mini2 i { font-size: 0.9375rem; line-height: 1; }
.ejp-mini2.on { border-color: var(--ink); background: #e8f0fb; color: var(--blue); }
.ejp-mini2 .lb { font-size: 0.53125rem; font-weight: 900; }
.ejp-mini2 .rt { font-family: var(--font-title, inherit); font-size: 0.8125rem; font-weight: 900; }

.ejp-opts { display: flex; gap: 8px; margin: 24px 16px 0; }
.ejp-opt {
  flex: 1; background: #fff; border: 2px solid var(--border-soft, #E3D8BF);
  border-radius: 12px; padding: 10px 6px; text-align: center; cursor: pointer;
  color: var(--muted); font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.ejp-opt.on { border-color: var(--ink); color: var(--ink); }
.ejp-opt .ov { font-family: var(--font-title, inherit); font-size: 1rem; font-weight: 900; }
.ejp-opt .ol { font-size: 0.65625rem; font-weight: 800; color: var(--muted); }

/* ── 재생 옵션 시트 ── */
.ejp-sheet-dim {
  position: absolute; inset: 0; z-index: 50;
  background: rgba(0,0,0,.45);
  display: none;
}
.ejp-sheet-dim.open { display: block; }
.ejp-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--bg); border: 2.5px solid var(--ink); border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(28px + env(safe-area-inset-bottom));
  animation: ejp-up .3s cubic-bezier(.32,1,.32,1);
}
.ejp-handle { width: 44px; height: 5px; border-radius: 99px; background: #d8ccb4; margin: 4px auto 12px; }
.ejp-sh-title { font-size: 1.0625rem; font-weight: 900; display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ejp-sh-x { width: 32px; height: 32px; border: none; background: none; font-size: 1.25rem; color: var(--ink); cursor: pointer; padding: 0; }
.ejp-sh-lbl { font-size: 0.8125rem; font-weight: 900; margin: 14px 0 8px; }
.ejp-sh-lbl:first-of-type { margin-top: 0; }
.ejp-sh-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.ejp-sh-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: #fff; border: 2px solid var(--border-soft, #E3D8BF); color: var(--ink);
  border-radius: 999px; padding: 8px 14px;
  font-size: 0.8125rem; font-weight: 800; cursor: pointer; font-family: inherit;
}
.ejp-sh-chip.on { background: var(--blue); border-color: var(--ink); color: #fff; }
.ejp-sh-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; border: 2px solid var(--ink); border-radius: 12px;
  padding: 11px 14px; margin-top: 8px; cursor: pointer;
}
.ejp-sh-row .rt { font-size: 0.8125rem; font-weight: 800; }
.ejp-sh-row .rs { font-size: 0.6875rem; color: var(--muted); font-weight: 700; margin-top: 3px; }
.ejp-toggle {
  width: 46px; height: 27px; border-radius: 999px; flex: none;
  background: var(--coral); border: 2px solid var(--ink); position: relative;
  transition: background .2s;
}
.ejp-toggle::after {
  content: ''; position: absolute; top: 2px; right: 2px;
  width: 19px; height: 19px; border-radius: 50%;
  background: #fff; border: 1.5px solid var(--ink);
  transition: left .2s, right .2s;
}
.ejp-toggle.off { background: #ddd3bd; }
.ejp-toggle.off::after { right: auto; left: 2px; }
