/* Wallpaper:LAB 효과 체험: 화면 가득 실제 렌더러, 오른쪽(휴대폰은 아래)에 유리 패널.
   색은 Wallpaper:LAB 페이지(kit--wl)의 보라·분홍·금색을 따른다. */
:root {
  --tr-bg: #08040d;
  --tr-glass: rgba(18, 9, 28, 0.62);
  --tr-glass-strong: rgba(18, 9, 28, 0.82);
  --tr-line: rgba(255, 220, 240, 0.12);
  --tr-ink: #fff;
  --tr-ink-2: rgba(255, 255, 255, 0.72);
  --tr-ink-3: rgba(255, 255, 255, 0.5);
  --tr-gold: #ffd58a;
  --tr-accent: #e2b8ff;
  --tr-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --tr-display: 'Instrument Sans', 'Pretendard Variable', Pretendard, system-ui, sans-serif;
  --tr-text: 'Pretendard Variable', Pretendard, -apple-system, 'Segoe UI', system-ui, sans-serif;
}
[hidden] { display: none !important; }
html:has(body.tr-body) { height: 100%; overflow: hidden; background: var(--tr-bg); color-scheme: dark; }
body.tr-body { margin: 0; height: 100%; overflow: hidden; background: var(--tr-bg); color: var(--tr-ink); font-family: var(--tr-text); -webkit-font-smoothing: antialiased; word-break: keep-all; }
.tr-body button, .tr-body select, .tr-body input { font: inherit; color: inherit; }
.tr-body .ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ── 화면 ── */
.tr-stage { position: fixed; inset: 0; background: #000; }
.tr-poster, .tr-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.tr-poster { object-fit: cover; }
.tr-frame { opacity: 0; transition: opacity 0.6s ease; }
.tr-stage.is-live .tr-frame { opacity: 1; }
.tr-status { position: absolute; left: 16px; bottom: 16px; z-index: 2; margin: 0; padding: 8px 14px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); font-size: 14px; color: var(--tr-ink-2); }
.tr-status:empty, .tr-status[hidden] { display: none; }

/* ── 위 막대: 돌아가기, 일시정지, 전체 화면 ── */
.tr-bar { position: fixed; z-index: 3; top: max(16px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); display: flex; gap: 8px; align-items: center; }
.tr-back, .tr-icon { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 10px; border: 1px solid var(--tr-line); border-radius: 999px; background: var(--tr-glass); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2); color: var(--tr-ink); text-decoration: none; font-size: 14px; cursor: pointer; transition: background-color 0.2s ease, border-color 0.2s ease; }
.tr-back img { border-radius: 8px; }
.tr-back span { font-family: var(--tr-display); font-weight: 600; letter-spacing: 0.01em; }
.tr-icon { padding: 0 14px; }
.tr-actions { display: flex; gap: 8px; }
.tr-back:hover, .tr-icon:hover { background: var(--tr-glass-strong); border-color: rgba(255, 220, 240, 0.24); }
.tr-back:focus-visible, .tr-icon:focus-visible, .tr-panel :focus-visible { outline: 2px solid var(--tr-accent); outline-offset: 2px; }

/* ── 설정 패널 ── */
.tr-panel { position: fixed; z-index: 3; top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); width: 360px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; border: 1px solid var(--tr-line); border-radius: 20px; background: var(--tr-glass); -webkit-backdrop-filter: blur(22px) saturate(1.25); backdrop-filter: blur(22px) saturate(1.25); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); overflow: hidden; }
.tr-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 14px 22px; }
.tr-eyebrow { margin: 0 0 4px; font-family: var(--tr-display); font-size: 11px; font-weight: 600; letter-spacing: 0.16em; color: var(--tr-gold); }
.tr-title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.tr-fold { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--tr-line); border-radius: 12px; background: rgba(255, 255, 255, 0.04); cursor: pointer; transition: transform 0.3s var(--tr-ease), background-color 0.2s ease; }
.tr-fold:hover { background: rgba(255, 255, 255, 0.1); }
.tr-panel.is-folded .tr-fold { transform: rotate(45deg); }
.tr-panel.is-folded .tr-panel__body { display: none; }
.tr-panel__body { overflow-y: auto; overscroll-behavior: contain; padding: 0 22px 20px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent; }

.tr-sec { padding: 16px 0 18px; border-top: 1px solid var(--tr-line); }
.tr-h { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.tr-help { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: var(--tr-ink-3); }
.tr-sec .tr-help:last-child { margin: 10px 0 0; }

.tr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-chips button { min-height: 36px; padding: 0 13px; border: 1px solid var(--tr-line); border-radius: 10px; background: rgba(255, 255, 255, 0.04); font-size: 13.5px; cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease; }
.tr-chips button:hover { background: rgba(255, 255, 255, 0.1); }
.tr-chips button[aria-pressed='true'] { background: #fff; border-color: #fff; color: #140a1f; font-weight: 600; }

.tr-props { margin-top: 14px; }
.tr-range { padding: 6px 0; }
.tr-range label, .tr-row label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13.5px; color: var(--tr-ink-2); }
.tr-range output { font-variant-numeric: tabular-nums; color: var(--tr-ink); font-size: 13px; }
.tr-range input[type='range'] { width: 100%; height: 28px; margin: 2px 0 0; accent-color: var(--tr-accent); cursor: pointer; }
.tr-row { display: grid; gap: 8px; padding: 6px 0; }
.tr-row select, .tr-props select { width: 100%; min-height: 40px; padding: 0 12px; border: 1px solid var(--tr-line); border-radius: 10px; background: rgba(0, 0, 0, 0.35); }

.tr-bgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tr-bgbtn { position: relative; padding: 0; border: 0; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; background: #120a1c; cursor: pointer; }
.tr-bgbtn img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s var(--tr-ease), opacity 0.2s ease; opacity: 0.82; }
.tr-bgbtn:hover img { transform: scale(1.04); opacity: 1; }
.tr-bgbtn[aria-pressed='true'] img { opacity: 1; }
.tr-bgbtn[aria-pressed='true']::after { content: ''; position: absolute; inset: 0; border-radius: 8px; box-shadow: inset 0 0 0 2px #fff; }
.tr-file { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin-top: 10px; border: 1px dashed rgba(255, 220, 240, 0.3); border-radius: 12px; font-size: 14px; cursor: pointer; transition: background-color 0.2s ease, border-color 0.2s ease; }
.tr-file:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 220, 240, 0.5); }
.tr-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.tr-file:focus-within { outline: 2px solid var(--tr-accent); outline-offset: 2px; }

.tr-switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0 10px; cursor: pointer; }
.tr-switch strong { display: block; font-size: 14px; font-weight: 500; }
.tr-switch small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--tr-ink-3); }
.tr-switch input { appearance: none; flex: none; width: 44px; height: 26px; margin: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.18); position: relative; cursor: pointer; transition: background-color 0.2s ease; }
.tr-switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.25s var(--tr-ease); }
.tr-switch input:checked { background: #9b5fe0; }
.tr-switch input:checked::after { transform: translateX(18px); }

.tr-foot { margin: 0; padding-top: 14px; border-top: 1px solid var(--tr-line); font-size: 12.5px; line-height: 1.6; color: var(--tr-ink-3); }

/* ── 휴대폰: 패널은 아래 시트, 처음엔 접혀 있다 ── */
@media (max-width: 720px) {
  .tr-icon span { display: none; }
  .tr-icon { padding: 0; width: 44px; justify-content: center; }
  .tr-back { padding-right: 12px; }
  .tr-panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 62dvh; border-radius: 20px 20px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  .tr-panel__head { padding: 14px 16px 12px 20px; }
  .tr-panel__body { padding: 0 20px 18px; }
  .tr-title { font-size: 19px; }
  .tr-status { bottom: auto; top: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .tr-frame, .tr-fold, .tr-bgbtn img, .tr-switch input::after { transition: none; }
}
