/* modal.css — 상세 모달·모달 이동·개인 평점·관리자 편집·RT 점수 */
  /* ── MODAL ── */
  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
  }
  .modal-overlay.open {
    display: flex;
    animation: modalOverlayIn 0.3s ease-out;
  }
  @keyframes modalOverlayIn {
    0% { background: rgba(0,0,0,0); }
    100% { background: rgba(0,0,0,0.88); }
  }

  .modal {
    background:
      radial-gradient(120% 80% at 0% 0%, rgba(201,168,76,0.05), transparent 60%),
      linear-gradient(180deg, #171717, #121212);
    border: 1px solid var(--border);
    border-radius: 14px;
    max-width: 1180px;
    width: 100%;
    display: flex;
    gap: 0;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    max-height: 94vh;
    box-shadow: 0 26px 70px rgba(0,0,0,0.62), inset 0 1px 0 rgba(255,255,255,0.05);
    animation: modalPortalIn 0.4s ease-out;
  }
  .modal-poster-col {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: rgba(0,0,0,0.28);
  }
  .modal-media-frame {
    width: 100%;
    flex-shrink: 0;
    position: relative;
    background: #0d0d0d;
  }
  @keyframes modalPortalIn {
    0% { opacity: 0; transform: scale(0.96) translateY(8px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
  }
  /* 포스터 높이 제한 (v2.12.8)
     포스터(2:3) + 전환 바 + 예고편이 합쳐지면 세로가 모달을 넘겨 상세 정보까지
     스크롤해야 했다. 화면 높이에 맞춰 포스터만 줄이고 나머지는 그대로 둔다.
     넓고 높은 화면에서는 aspect-ratio 가 먼저 걸려 기존 크기를 유지한다. */
  .modal-poster {
    width: 100%;
    flex-shrink: 0;
    aspect-ratio: 2/3;
    max-height: calc(94vh - 275px);
    object-fit: contain;
    background: #0d0d0d;
  }
  .modal-poster-placeholder {
    width: 100%;
    flex-shrink: 0;
    aspect-ratio: 2/3;
    max-height: calc(94vh - 275px);
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #333;
  }
  .modal-poster.is-logo-media {
    object-fit: contain;
    object-position: center;
    padding: 1.25rem;
    box-sizing: border-box;
    background: #000;
  }
  .modal-media-controls {
    min-height: 54px;
    padding: 0.5rem 0.65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    flex-shrink: 0;
    border-top: 1px solid rgba(201,168,76,0.22);
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #121212, #0d0d0d);
    box-sizing: border-box;
  }
  .modal-media-controls[hidden] { display: none; }
  .modal-media-toggle {
    position: static;
    transform: none;
    width: max-content;
    min-width: 142px;
    min-height: 40px;
    max-width: 100%;
    padding: 0.52rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(201,168,76,0.72);
    background: rgba(8,8,8,0.9);
    box-shadow: 0 5px 20px rgba(0,0,0,0.56);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    color: var(--gold);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
  }
  .modal-media-toggle .icon {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
  }
  .modal-media-toggle:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: #111;
    transform: translateY(-1px);
  }
  .modal-media-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
  }
  .modal-media-label {
    position: static;
    max-width: 100%;
    padding: 0.24rem 0.55rem;
    border: 1px solid rgba(201,168,76,0.32);
    border-radius: 20px;
    background: rgba(0,0,0,0.42);
    color: var(--gold);
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: center;
    white-space: nowrap;
  }
  .modal-media-label:empty { display: none; }
  .modal-body {
    padding: 1.5rem 1.6rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    justify-content: flex-start;
    flex: 1 1 auto;
    min-width: 0;
  }
  /* ── 본문 2단 (v2.12.8) ──
     정보가 한 줄로만 쌓여 스크롤이 길던 문제를 넓은 화면에서 2단으로 나눠 줄인다. */
  .modal-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.9rem 1.35rem;
    align-items: start;
  }
  .modal-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
  }
  .modal-col > div:empty { display: none; }
  /* 섹션 패널 — 메인 페이지 카드와 같은 질감.
     features.css 가 modal.css 보다 뒤에 로드되어 같은 특이도면 그쪽이 이긴다.
     `.modal` 을 앞에 붙여 특이도를 올려야 실제로 적용된다. 접두사를 빼지 말 것. */
  .modal .modal-rtinfo,
  .modal .modal-ph,
  .modal .modal-admin-tools,
  .modal .modal-note-edit {
    background: rgba(0,0,0,0.34);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.8rem 0.85rem;
    margin-top: 0;
    border-top: 1px solid var(--border);
    padding-top: 0.8rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
    box-sizing: border-box;
  }

  /* ── 모달 이전·다음 이동 ── */
  .modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.4rem; line-height: 1;
    cursor: pointer; z-index: 6;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, border-color 0.2s, opacity 0.2s;
  }
  .modal-nav-btn:hover:not(:disabled) { background: var(--red); border-color: var(--red); }
  .modal-nav-btn.prev { left: 10px; }
  .modal-nav-btn.next { right: 10px; }
  .modal-nav-btn:disabled { opacity: 0.25; cursor: default; }
  .modal-nav-pos {
    position: absolute; top: 0.9rem; left: 50%; transform: translateX(-50%);
    font-size: 0.62rem; letter-spacing: 0.08em; color: var(--muted);
    background: rgba(0,0,0,0.5); padding: 0.15rem 0.6rem; border-radius: 20px; z-index: 6;
  }

  /* ── Project H 개인 평점 ── */
  .modal-ph { margin-top: 0; border-top: none; }
  .modal-ph-label {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--gold); margin-bottom: 0.6rem;
  }
  .ph-score-big { font-size: 1.5rem; font-weight: 700; color: var(--gold); }
  .ph-score-big small { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
  .ph-stars { color: var(--gold); font-size: 1rem; letter-spacing: 0.05em; }
  .ph-stars .off { color: #3a3a3a; }
  .ph-meta { font-size: 0.7rem; color: var(--muted); margin-top: 0.35rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
  .ph-review { font-size: 0.82rem; color: var(--text); margin-top: 0.5rem; line-height: 1.5; font-style: italic; }
  /* 비교 바 (비평/관객/PH)
     .ph-cmp-fill 은 span 이고 부모 .ph-cmp-track 은 flex 컨테이너가 아니다.
     display 를 지정하지 않으면 inline 으로 남아 width/height 가 무시되고 게이지가
     0x0 으로 렌더된다(숫자만 보이고 막대는 안 보이는 증상). display:block 필수. */
  .ph-compare { margin-top: 0.7rem; display: flex; flex-direction: column; gap: 0.42rem; }
  .ph-cmp-row { display: flex; align-items: center; gap: 0.55rem; font-size: 0.68rem; }
  .ph-cmp-name { width: 40px; flex-shrink: 0; color: var(--muted); letter-spacing: 0.04em; }
  .ph-cmp-track {
    flex: 1;
    height: 9px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 999px;
    overflow: hidden;
    box-sizing: border-box;
  }
  .ph-cmp-fill {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: 999px;
    transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .ph-cmp-fill.crit { background: linear-gradient(90deg, #b5271c, #E24136); }
  .ph-cmp-fill.aud  { background: linear-gradient(90deg, #9c7f2e, #C9A84C); }
  .ph-cmp-fill.ph   { background: linear-gradient(90deg, #2f6ba8, #4a8fd6); }
  .ph-cmp-fill.is-na { min-width: 0; background: none; }
  .ph-cmp-val { width: 42px; flex-shrink: 0; text-align: right; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
  /* 관리자 편집 — 세로로 길어지지 않도록 압축한다(v2.12.8). */
  .ph-edit { margin-top: 0.7rem; display: flex; flex-direction: column; gap: 0.4rem; }
  .ph-edit-row { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; font-size: 0.7rem; color: var(--muted); }
  .ph-edit-row label { font-size: 0.64rem; color: var(--muted); min-width: 52px; }
  .modal .ph-edit-row > span { font-size: 0.62rem; }
  .modal .ph-edit textarea { min-height: 38px; padding: 0.42rem 0.5rem; font-size: 0.75rem; }
  .modal .ph-edit select,
  .modal .ph-edit input[type="date"],
  .modal .ph-edit input[type="number"] { padding: 0.22rem 0.35rem; font-size: 0.7rem; }
  .modal .ph-edit input[type="number"] { width: 60px; }
  .ph-edit select, .ph-edit input[type="date"], .ph-edit input[type="number"] {
    background: #1a1a1a; border: 1px solid var(--border); color: var(--text);
    border-radius: 4px; padding: 0.25rem 0.4rem; font-size: 0.72rem; font-family: inherit;
  }
  .ph-edit textarea {
    background: #1a1a1a; border: 1px solid var(--border); color: var(--text);
    border-radius: 6px; padding: 0.5rem; font-size: 0.78rem; font-family: inherit;
    resize: vertical; min-height: 44px; width: 100%;
  }

  /* ── 모달 버튼 통일 (v2.12.8) ──
     메인 페이지 빠른 기능(.ranking-trigger-btn)·아카이브 기능(.archive-feature-btn)의
     어두운 카드 + 금색 호버 + 살짝 떠오르는 모션을 상세 모달에도 그대로 적용한다. */
  .modal .modal-actions .wl-modal-btn,
  .modal .modal-actions .cmp-modal-btn,
  .modal .modal-actions .ph-save-btn,
  .modal .modal-actions .ph-delete-btn,
  .modal .modal-admin-tools button,
  .modal .modal-note-edit-buttons button,
  .modal .modal-src-edit .ph-save-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 36px;
    padding: 0.44rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: rgba(0,0,0,0.4);
    color: var(--text);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  }
  .modal .modal-actions .wl-modal-btn .icon,
  .modal .modal-actions .cmp-modal-btn .icon,
  .modal .modal-admin-tools button .icon {
    width: 1rem; height: 1rem; flex: 0 0 auto; color: var(--red);
    transition: color 0.2s ease;
  }
  .modal .modal-actions .wl-modal-btn:hover,
  .modal .modal-actions .cmp-modal-btn:hover,
  .modal .modal-admin-tools button:hover,
  .modal .modal-note-edit-buttons button:hover,
  .modal .modal-src-edit .ph-save-btn:hover,
  .modal .modal-actions .ph-save-btn:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
    background: rgba(201,168,76,0.1);
    color: var(--gold);
  }
  .modal .modal-actions .wl-modal-btn:hover .icon,
  .modal .modal-actions .cmp-modal-btn:hover .icon,
  .modal .modal-admin-tools button:hover .icon { color: var(--gold); }
  /* 담긴 상태 = 메인 페이지 .active 와 동일한 표현 */
  .modal .modal-actions .wl-modal-btn.on,
  .modal .modal-actions .cmp-modal-btn.on,
  .modal .modal-admin-tools button.tool-primary {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(201,168,76,0.12);
  }
  .modal .modal-actions .wl-modal-btn.on .icon,
  .modal .modal-actions .cmp-modal-btn.on .icon,
  .modal .modal-admin-tools button.tool-primary .icon { color: var(--gold); }
  /* 저장 = 주요 동작만 금색 채움 */
  .modal .modal-actions .ph-save-btn,
  .modal .modal-note-edit-buttons .note-save-btn,
  .modal .modal-src-edit .ph-save-btn {
    background: linear-gradient(180deg, #d8b757, var(--gold));
    border-color: var(--gold);
    color: #1a1500;
  }
  .modal .modal-actions .ph-save-btn:hover,
  .modal .modal-note-edit-buttons .note-save-btn:hover,
  .modal .modal-src-edit .ph-save-btn:hover {
    background: linear-gradient(180deg, #e6c86a, #d8b757);
    color: #1a1500;
  }
  /* 삭제 = 붉은 외곽선 */
  .modal .modal-actions .ph-delete-btn,
  .modal .modal-note-edit-buttons .note-delete-btn {
    background: rgba(0,0,0,0.4);
    border-color: rgba(226,65,54,0.55);
    color: var(--red);
  }
  .modal .modal-actions .ph-delete-btn:hover,
  .modal .modal-note-edit-buttons .note-delete-btn:hover {
    transform: translateY(-2px);
    background: rgba(226,65,54,0.12);
    border-color: var(--red);
    color: #ff8a80;
  }
  /* 입력 영역도 세로를 아껴 스크롤 없이 들어가게 한다(v2.12.8). */
  .modal .modal-note-edit textarea { min-height: 46px; padding: 0.45rem 0.6rem; font-size: 0.76rem; }
  .modal .modal-note-edit-buttons { margin-top: 0.4rem; }
  .modal .modal-admin-tools { gap: 0.4rem; row-gap: 0.4rem; }
  .modal .modal-admin-tools input[type="number"] { padding: 0.24rem 0.35rem; }
  .modal .modal-rtinfo { gap: 0.22rem; font-size: 0.7rem; }
  .modal .modal-src-edit { margin-top: 0.35rem; }

  .modal .modal-actions .wl-modal-btn:focus-visible,
  .modal .modal-actions .cmp-modal-btn:focus-visible,
  .modal .modal-actions .ph-save-btn:focus-visible,
  .modal .modal-actions .ph-delete-btn:focus-visible,
  .modal .modal-admin-tools button:focus-visible,
  .modal .modal-note-edit-buttons button:focus-visible,
  .modal .modal-src-edit .ph-save-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

  .ph-save-btn { background: var(--gold); color: #1a1500; border: none; border-radius: 5px; padding: 0.35rem 0.8rem; font-weight: 700; font-size: 0.72rem; cursor: pointer; }
  .ph-delete-btn { background: none; border: 1px solid var(--red); color: var(--red); border-radius: 5px; padding: 0.35rem 0.8rem; font-size: 0.72rem; cursor: pointer; }
  .modal-phase-tag {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.5rem;
  }
  /* 헤더는 스크롤을 줄이기 위해 여백을 조인다(v2.12.8). */
  .modal-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.72rem;
    letter-spacing: 0.05em;
    line-height: 1.08;
    margin-bottom: 0.25rem;
  }
  .modal-subtitle {
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.6rem;
  }
  .modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0;
  }
  .modal-head .modal-phase-tag { margin-bottom: 0.3rem; }
  .meta-chip {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--muted);
    text-transform: uppercase;
  }
  .modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255,255,255,0.08);
    border: none;
    color: var(--text);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 12;
    transition: background 0.2s;
  }
  .modal-close:hover { background: rgba(255,255,255,0.15); }


  /* ── RT SCORE ── */
  .rt-score {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.3rem;
  }
  .rt-tomato {
    font-size: 0.7rem;
  }
  .rt-pct {
    font-size: 0.72rem;
    font-weight: 700;
  }
  .rt-fresh  { color: #FA320A; }
  .rt-rotten { color: #7DB631; }

  .rt-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.2rem;
  }
  .rt-label {
    font-size: 0.58rem;
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    min-width: 30px;
  }
  .audience-pct {
    font-size: 0.72rem;
    font-weight: 700;
  }
  .audience-fresh  { color: #7DB631; }
  .audience-rotten { color: #888; }
