/* 이봐협 플레이어 — 전체 화면 분할 재생(어두운 화면 고정). 칸 개별 컨트롤러 · 아래 전체 컨트롤러 · 오른쪽 순위표. */
:root {
  --ibwa-bg: #050507;
  --ibwa-panel: rgba(18, 18, 24, .92);
  --ibwa-line: rgba(255, 255, 255, .16);
  --ibwa-text: #f1f1f4;
  --ibwa-sub: #a9a9b6;
  --ibwa-accent: #ff4f8b;
  --ibwa-danger: #ff5b5b;
  --ibwa-console-h: 52px;
  --ibwa-panel-w: 340px;
}
* { box-sizing: border-box; }
html, body.ibwa { margin: 0; height: 100%; background: var(--ibwa-bg); color: var(--ibwa-text); overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans KR", sans-serif; }
button, select { font: inherit; color: inherit; }

/* 영상 영역: 아래 전체 컨트롤러 자리를 비우고, 순위표를 열면 오른쪽도 비운다. */
.ibwa-stage { position: fixed; left: 0; top: 0; right: 0; bottom: var(--ibwa-console-h); }
body.ibwa-panel-open .ibwa-stage { right: var(--ibwa-panel-w); }

.ibwa-tile { position: absolute; border: 2px solid transparent; background: #000; overflow: hidden; container-type: inline-size;
  transition: left .18s, top .18s, width .18s, height .18s; }
.ibwa-tile[hidden] { display: none !important; }
.ibwa-tile .ibwa-yt, .ibwa-tile iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ibwa-shield { position: absolute; inset: 0; z-index: 2; cursor: pointer; touch-action: manipulation; }
.ibwa-tile.is-error { opacity: .35; }

/* 칸 개별 컨트롤러(fileMng PlayerSlotToolbar): 위 = 번호·◀▶·소리·↗ + 제목, 아래 = 진행 막대. 마우스를 움직이면 보이고 가만히 있으면 숨는다. */
.ibwa-slot-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 4; padding: 6px 8px 14px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .75), transparent); transition: opacity .25s; }
.ibwa-slot-tools { display: flex; align-items: center; gap: 4px; }
.ibwa-slot-no { font-weight: 800; font-size: 13px; margin-right: 4px; text-shadow: 0 1px 3px #000; }
.ibwa-slot-tools button, .ibwa-slot-tools a { background: var(--ibwa-panel); color: var(--ibwa-text); border: 1px solid var(--ibwa-line);
  border-radius: 6px; padding: 2px 8px; font-size: 13px; cursor: pointer; text-decoration: none; line-height: 1.4; }
.ibwa-slot-tools button.on { border-color: var(--ibwa-accent); background: rgba(255, 79, 139, .35); }
.ibwa-slot-tools a { margin-left: auto; }
.ibwa-slot-title { margin-top: 3px; font-size: 12px; color: #ddd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px #000;
  pointer-events: none; }
.ibwa-slot-seek { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; align-items: center; gap: 6px; padding: 10px 8px 4px;
  background: linear-gradient(to top, rgba(0, 0, 0, .75), transparent); font-size: 11px; font-variant-numeric: tabular-nums; transition: opacity .25s; }
.ibwa-slot-seek input { flex: 1; min-width: 0; accent-color: var(--ibwa-accent); }
@container (max-width: 260px) {
  .ibwa-slot-title, .ibwa-slot-seek .cur, .ibwa-slot-seek .dur { display: none; }
  .ibwa-slot-tools button, .ibwa-slot-tools a { padding: 1px 5px; font-size: 12px; }
}
body.ibwa-idle .ibwa-slot-bar, body.ibwa-idle .ibwa-slot-seek { opacity: 0; pointer-events: none; }

.ibwa-rank-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; pointer-events: none;
  font-size: clamp(16px, 4vw, 40px); font-weight: 800; color: #fff; text-shadow: 0 2px 12px #000; background: rgba(0, 0, 0, .45);
  border-radius: 999px; padding: .1em .6em; }
.ibwa-rank-badge.is-best { background: rgba(255, 79, 139, .75); font-size: clamp(28px, 6vw, 72px); }

/* 광고 칸: 위 광고(정책상 "광고" 표시·테두리), 아래 사용법 안내. 광고와 안내 사이 간격을 둬 잘못 누르기 어렵게. */
.ibwa-ad { display: flex; flex-direction: column; border: 2px solid var(--ibwa-line); background: #0d0d12; }
.ibwa-ad-label { font-size: 11px; color: var(--ibwa-sub); padding: 3px 8px; }
.ibwa-ad-slot { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.ibwa-tip { flex: 0 0 auto; min-height: 30%; margin-top: 10px; padding: 10px 12px; border-top: 1px solid var(--ibwa-line);
  font-size: clamp(12px, 1.3vw, 16px); display: flex; align-items: center; }
.ibwa-strip-tip { position: fixed; left: 50%; bottom: calc(var(--ibwa-console-h) + 8px); transform: translateX(-50%); z-index: 20; background: var(--ibwa-panel);
  border: 1px solid var(--ibwa-line); border-radius: 999px; padding: 6px 14px; font-size: 13px; transition: opacity .3s; max-width: calc(100% - 32px); }
.ibwa-strip-tip[hidden] { display: none; }

/* 돌아가기 · 제목 · 저장 상태는 전체 컨트롤러 왼쪽(위쪽은 칸 개별 컨트롤러 자리라 비운다). */
.ibwa-console .info { min-width: 0; flex: 0 1 auto; gap: 8px; }
.ibwa-back { color: var(--ibwa-text); text-decoration: none; font-size: 20px; }
.ibwa-title { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.ibwa-save-state { font-size: 11px; color: var(--ibwa-sub); white-space: nowrap; }
.ibwa-save-state[data-state="error"] { color: var(--ibwa-danger); }
body.ibwa-idle .ibwa-strip-tip { opacity: 0; pointer-events: none; }

/* 전체 컨트롤러(fileMng PlayerConsole): 화면 아래 한 줄, 늘 보인다. */
.ibwa-console { position: fixed; left: 0; right: 0; bottom: 0; height: var(--ibwa-console-h); z-index: 30; display: flex; align-items: center;
  gap: 10px; padding: 0 12px; background: #0e0e14; border-top: 1px solid var(--ibwa-line); overflow-x: auto; scrollbar-width: none; }
.ibwa-console .grp { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.ibwa-console button, .ibwa-console select { background: #1c1c26; border: 1px solid var(--ibwa-line); border-radius: 8px; padding: 6px 10px;
  font-size: 13px; cursor: pointer; white-space: nowrap; }
.ibwa-console button:disabled { opacity: .4; cursor: default; }
.ibwa-console button.primary { background: var(--ibwa-accent); border-color: var(--ibwa-accent); color: #fff; font-weight: 700; min-width: 84px; }
.ibwa-console button.active { border-color: var(--ibwa-accent); background: rgba(255, 79, 139, .3); }
.ibwa-console .range { display: flex; align-items: center; gap: 6px; font-size: 14px; flex: 0 0 auto; }
.ibwa-console .range input { width: 90px; accent-color: var(--ibwa-accent); }
.ibwa-console .range.wide { flex: 1 1 120px; min-width: 100px; }
.ibwa-console .range.wide input { width: 100%; }
.ibwa-console .sel { display: flex; align-items: center; gap: 4px; font-size: 14px; }
.ibwa-console select { padding: 5px 6px; }

/* 순위표(fileMng PlayerRankPanel) */
.ibwa-rank-panel { position: fixed; top: 0; right: 0; bottom: var(--ibwa-console-h); width: var(--ibwa-panel-w); z-index: 25; background: #0e0e14;
  border-left: 1px solid var(--ibwa-line); display: flex; flex-direction: column; }
.ibwa-rank-panel[hidden] { display: none; }
.ibwa-rank-panel .head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--ibwa-line); }
.ibwa-rank-panel .head button { background: none; border: 0; cursor: pointer; }
.ibwa-rank-panel .head .danger-link { margin-left: auto; color: var(--ibwa-sub); font-size: 12px; text-decoration: underline; }
.ibwa-rank-panel .confirm { padding: 8px 12px; font-size: 12px; background: #3a0e12; border-bottom: 1px solid var(--ibwa-danger); }
.ibwa-rank-panel .confirm .danger { background: var(--ibwa-danger); border: 0; color: #fff; border-radius: 6px; padding: 2px 10px; cursor: pointer; }
.ibwa-rank-panel .muted { color: var(--ibwa-sub); font-size: 13px; padding: 12px; }
#ibwa-rank-list { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; flex: 1; }
#ibwa-rank-list li button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 7px 12px; cursor: pointer; font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .05); }
#ibwa-rank-list li button:hover { background: rgba(255, 255, 255, .06); }
#ibwa-rank-list li.is-playing button { background: rgba(255, 79, 139, .16); }
#ibwa-rank-list b { color: var(--ibwa-accent); margin-right: 4px; }
#ibwa-rank-list small { color: var(--ibwa-sub); }

.ibwa-mode-hint { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 30; background: var(--ibwa-accent);
  color: #fff; padding: 6px 14px; border-radius: 8px; font-size: 14px; max-width: calc(100% - 32px); text-align: center; }
.ibwa-mode-hint[hidden], .ibwa-toast[hidden], .ibwa-sound-hint[hidden], .ibwa-error[hidden], .ibwa-empty[hidden] { display: none; }
.ibwa-toast { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 40; background: var(--ibwa-panel);
  padding: 10px 18px; border-radius: 10px; font-size: 15px; pointer-events: none; }
.ibwa-sound-hint { position: fixed; left: 50%; top: 56px; transform: translateX(-50%); z-index: 35; background: var(--ibwa-accent);
  color: #fff; border: 0; border-radius: 999px; padding: 10px 20px; font-size: 15px; cursor: pointer; }
.ibwa-empty { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ibwa-sub); }
.ibwa-error { position: fixed; left: 16px; right: 16px; bottom: calc(var(--ibwa-console-h) + 16px); z-index: 50; background: #3a0e12; border: 2px solid var(--ibwa-danger);
  color: #fff; padding: 10px 14px; border-radius: 8px; display: flex; gap: 10px; align-items: center; }
.ibwa-error .copy { margin-left: auto; }

@media (max-width: 640px) {
  :root { --ibwa-console-h: 48px; --ibwa-panel-w: 100vw; }
  .ibwa-title { max-width: 90px; font-size: 12px; }
  .ibwa-save-state { display: none; }
  .ibwa-console { gap: 6px; padding: 0 6px; }
  .ibwa-console button, .ibwa-console select { padding: 5px 7px; font-size: 12px; }
  .ibwa-console .range:not(.wide) input { width: 60px; }
  body.ibwa-panel-open .ibwa-stage { right: 0; }
}
