/* My POV signage — 세로 9:16 무대 기준. 모든 크기는 무대 기준 단위(cqw = 무대 폭 1%, cqh = 무대 높이 1%) */

@font-face { font-family: "Pretendard"; src: url("fonts/PretendardVariable.woff2") format("woff2"); font-weight: 45 920; font-display: block; }
@font-face { font-family: "Fredoka"; src: url("fonts/Fredoka.ttf") format("truetype"); font-weight: 300 700; font-display: block; }

:root {
  --sky-1: #4a8ce6; --sky-2: #78b3f3; --sky-3: #b4dcfc;
  --pink: #ff6fae; --yellow: #ffd23f; --blue: #3fa7ff; --lav: #ebe8fa; --ink: #0d0d14;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body {
  font-family: "Pretendard", "Malgun Gothic", sans-serif; color: #fff;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  touch-action: none; overscroll-behavior: none;
}
body.hide-cursor, body.hide-cursor * { cursor: none !important; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
img { -webkit-user-drag: none; }
svg { display: block; }
[hidden] { display: none !important; }

#stage {
  position: absolute; left: 50%; top: 50%; overflow: hidden;
  container-type: size; background: var(--sky-2);
  transform-origin: 50% 50%;
}

/* ---------- 하늘 + 비눗방울 배경 ---------- */
.sky { position: absolute; inset: 0; background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 55%, var(--sky-3) 100%); overflow: hidden; }
.bubble {
  position: absolute; bottom: -40cqw; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.95) 0 3.5%, rgba(255,255,255,.28) 11%, rgba(255,255,255,.05) 45%, rgba(200,230,255,.16) 72%, rgba(255,255,255,.6) 100%);
  box-shadow: inset -.8cqw -1.2cqw 2.4cqw rgba(255,170,225,.28), inset .8cqw .8cqw 1.6cqw rgba(255,255,255,.3);
  animation: rise linear infinite; will-change: transform;
}
@keyframes rise { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(var(--dx), -240cqw, 0); } }
.sparkle {
  position: absolute; width: var(--sz); height: var(--sz); background: var(--yellow);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  filter: drop-shadow(0 0 .6cqw rgba(255,240,150,.9)); animation: twinkle 3.2s ease-in-out infinite;
}
@keyframes twinkle { 0%, 100% { transform: scale(.6) rotate(0); opacity: .5; } 50% { transform: scale(1.1) rotate(25deg); opacity: 1; } }

/* ---------- 화면 전환 ---------- */
.screen { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .55s var(--ease), visibility 0s .55s; }
.screen.active { opacity: 1; visibility: visible; transition: opacity .55s var(--ease); }

/* ---------- 로고 ---------- */
.logo { display: inline-flex; align-items: flex-end; font-family: "Fredoka", sans-serif; font-weight: 700; line-height: .82; --s: 1; }
.logo .my { font-size: calc(6.4cqw * var(--s)); color: #fff; transform: rotate(-10deg) translateY(-30%); margin-right: calc(.8cqw * var(--s)); text-shadow: 0 .3cqw .8cqw rgba(30,60,150,.45); }
.logo .l {
  font-size: calc(21cqw * var(--s)); letter-spacing: -.02em; color: transparent; -webkit-background-clip: text; background-clip: text;
  -webkit-text-stroke: calc(.45cqw * var(--s)) rgba(255,255,255,.9); paint-order: stroke fill;
  filter: drop-shadow(0 calc(.9cqw * var(--s)) calc(1.4cqw * var(--s)) rgba(25,55,140,.35));
}
.logo .l1 { background-image: linear-gradient(165deg, #d8f2ff 0%, #6cc8ff 30%, #2c86ee 72%, #7cd6ff 100%); }
.logo .l2 { background-image: linear-gradient(165deg, #ffe3f1 0%, #ff95c9 30%, #ef4f98 72%, #ffaad4 100%); }
.logo .l3 { background-image: linear-gradient(165deg, #fff8cc 0%, #ffe35a 30%, #ffb21c 72%, #ffe68a 100%); }
.logo-img { display: block; max-width: 80cqw; max-height: 22cqh; }
.logo-slot.sm .logo { --s: .4; }
.logo-slot.sm .logo-img { max-width: 40cqw; max-height: 7cqh; }

/* ---------- 순위 배지 ---------- */
.rank-badge {
  --rc: linear-gradient(180deg, #fff, #dfe6f5); --rt: #2b3350;
  display: inline-flex; align-items: center; gap: .3em; white-space: nowrap;
  padding: .32em .9em .36em; border-radius: 999px; font-weight: 800; font-size: 3cqw; letter-spacing: -.01em;
  color: var(--rt); background: var(--rc);
  box-shadow: inset 0 -.2em 0 rgba(0,0,0,.12), inset 0 .15em 0 rgba(255,255,255,.5), 0 .25em .7em rgba(10,20,60,.25);
}
.rank-badge[data-rank="1"] { --rc: linear-gradient(180deg, #fff3b0, #ffd23f 55%, #ffaa00); --rt: #4d2f00; }
.rank-badge[data-rank="1"]::before { content: "★"; }
.rank-badge[data-rank="2"] { --rc: linear-gradient(180deg, #ffc6e2, #ff6fae 60%, #f2559c); --rt: #fff; }
.rank-badge[data-rank="3"] { --rc: linear-gradient(180deg, #bfe6ff, #3fa7ff 60%, #2a86e8); --rt: #fff; }
.rank-badge[data-rank="4"] { --rc: linear-gradient(180deg, #f1edff, #b9a8ff 70%, #9d89f5); --rt: #2a1d6a; }
.rank-badge[data-rank="5"] { --rc: linear-gradient(180deg, #dcfff3, #73e0c1 70%, #48c9a5); --rt: #0b4536; }

/* ---------- 미디어 무대 (대기화면/플레이어 공통) ---------- */
.media { position: absolute; inset: 0; }
.media canvas.blur { position: absolute; left: -8%; top: -8%; width: 116%; height: 116%; filter: blur(2.6cqw) saturate(1.35) brightness(.55); opacity: 0; transition: opacity .8s; }
.media video { position: absolute; opacity: 0; transition: opacity .7s var(--ease); background: transparent; }
.ready .media video { opacity: 1; }
.o-portrait .media video { inset: 0; width: 100%; height: 100%; object-fit: contain; }
.o-portrait .media canvas.blur, #player.o-landscape .media canvas.blur { opacity: 1; }
.o-landscape .media video { left: 0; width: 100%; height: calc(100cqw / var(--ar, 1.7778)); top: var(--land-top, 38cqh); transform: translateY(-50%); object-fit: contain; }

/* ---------- 대기화면 ---------- */
#idle { background: transparent; }
#idle.o-portrait { background: #000; }
#idle.o-landscape .media video { left: 5cqw; width: 90cqw; height: calc(90cqw / var(--ar, 1.7778)); --land-top: 44cqh; border-radius: 0 0 2.2cqw 2.2cqw; background: #000; }
#idle .frame {
  position: absolute; left: 4cqw; width: 92cqw; opacity: 0; transition: opacity .7s;
  top: calc(44cqh - 45cqw / var(--ar, 1.7778) - 5.6cqw); height: calc(90cqw / var(--ar, 1.7778) + 6.6cqw);
  background: var(--ink); border-radius: 3cqw; box-shadow: 0 3cqw 7cqw rgba(10,30,90,.4);
}
#idle .frame i { position: absolute; top: 1.9cqw; width: 1.8cqw; height: 1.8cqw; border-radius: 50%; }
#idle .frame i:nth-child(1) { left: 2.6cqw; background: #ff5f57; }
#idle .frame i:nth-child(2) { left: 5.4cqw; background: #febc2e; }
#idle .frame i:nth-child(3) { left: 8.2cqw; background: #28c840; }
#idle.o-landscape .frame { opacity: 1; }
.idle-shade { position: absolute; inset: 0; opacity: 0; transition: opacity .6s; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 55%, rgba(0,0,0,.82) 100%); }
#idle.o-portrait .idle-shade { opacity: 1; }
.idle-top { position: absolute; left: 0; right: 0; top: 5.5cqh; display: flex; flex-direction: column; align-items: center; gap: 1.6cqw; transition: transform .7s var(--ease); }
.tagline { margin: 0; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 3.6cqw; text-shadow: 0 .3cqw 1cqw rgba(20,50,140,.45); }
#idle.o-portrait .idle-top { top: 2.5cqh; gap: 1.2cqw; }
#idle.o-portrait .tagline { font-size: 3cqw; }
.idle-info { position: absolute; left: 6cqw; right: 6cqw; bottom: 21cqh; text-align: center; transition: opacity .5s; }
.now { display: inline-block; font-family: "Fredoka"; font-weight: 600; font-size: 2.3cqw; letter-spacing: .25em; padding: .5em 1.1em; border-radius: 99px; background: rgba(13,13,20,.55); }
.now::before { content: ""; display: inline-block; width: .7em; height: .7em; border-radius: 50%; background: #ff4d6d; margin-right: .7em; vertical-align: .05em; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.idle-title { display: flex; align-items: center; justify-content: center; gap: 2cqw; margin-top: 2.4cqw; }
.idle-title h2 { margin: 0; font-size: 5.6cqw; font-weight: 800; letter-spacing: -.02em; text-shadow: 0 .3cqw 1.4cqw rgba(0,0,0,.45); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70cqw; }
.idle-author { margin: 1.2cqw 0 0; font-size: 3.2cqw; font-weight: 500; opacity: .9; text-shadow: 0 .2cqw 1cqw rgba(0,0,0,.45); }
#idle.fading .idle-info { opacity: 0; }

.cta {
  position: absolute; left: 50%; bottom: 6.5cqh; transform: translateX(-50%);
  display: flex; align-items: center; gap: 3cqw; padding: 3cqw 6cqw 3cqw 4.4cqw; white-space: nowrap;
  border-radius: 999px; background: var(--lav); color: #3e56a8;
  box-shadow: 0 2cqw 5cqw rgba(15,35,110,.35), inset 0 -.6cqw 0 rgba(80,90,170,.15);
  animation: bob 2.6s ease-in-out infinite;
}
.cta svg { width: 8cqw; height: 8cqw; color: var(--pink); animation: tap 2.6s ease-in-out infinite; }
.cta b { display: block; font-size: 4.1cqw; font-weight: 800; letter-spacing: -.02em; }
.cta small { display: block; margin-top: .6cqw; font-family: "Fredoka"; font-size: 2.6cqw; font-weight: 500; color: #7184c8; }
.cta-ring { position: absolute; inset: 0; border-radius: inherit; border: .5cqw solid rgba(255,255,255,.9); animation: ring 2.6s ease-out infinite; }
@keyframes bob { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-1cqw); } }
@keyframes tap { 0%, 60%, 100% { transform: translateY(0) scale(1); } 70% { transform: translateY(.6cqw) scale(.9); } }
@keyframes ring { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.18, 1.45); opacity: 0; } }
.idle-progress { position: absolute; left: 0; right: 0; bottom: 0; height: .5cqw; background: rgba(255,255,255,.15); }
.idle-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--yellow)); }
.empty-msg { position: absolute; left: 8cqw; right: 8cqw; top: 40cqh; padding: 5cqw; border-radius: 3cqw; background: rgba(13,13,20,.8); text-align: center; font-size: 3.4cqw; line-height: 1.6; }

/* ---------- 목록 공통 ---------- */
#list { overflow: hidden; }
.list-head { position: absolute; left: 0; right: 0; top: 0; height: 13cqh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.4cqw; padding-top: 1cqh; }
.list-title { display: flex; align-items: baseline; gap: 2cqw; }
.list-title b { font-size: 5cqw; font-weight: 800; letter-spacing: -.02em; text-shadow: 0 .3cqw 1cqw rgba(20,50,140,.35); }
.list-title small { font-family: "Fredoka"; font-size: 2.8cqw; font-weight: 500; opacity: .9; }
.list-body { position: absolute; left: 0; right: 0; top: 13cqh; bottom: 11.5cqh; }
.swipe-view, .grid-view { position: absolute; inset: 0; transition: opacity .45s var(--ease), transform .45s var(--ease); }
#list:not(.mode-swipe) .swipe-view, #list:not(.mode-grid) .grid-view { opacity: 0; pointer-events: none; transform: scale(.96); }

.list-foot { position: absolute; left: 0; right: 0; bottom: 0; height: 11.5cqh; display: flex; align-items: center; justify-content: center; gap: 3cqw; padding: 0 5cqw 1.2cqh; }
.btn-home { display: flex; align-items: center; gap: 1.6cqw; height: 10cqw; padding: 0 4cqw 0 3.2cqw; border-radius: 999px; background: rgba(13,13,20,.78); font-size: 3.2cqw; font-weight: 700; box-shadow: 0 1.4cqw 3cqw rgba(15,35,110,.3); }
.btn-home svg { width: 4.8cqw; height: 4.8cqw; fill: none; stroke: #fff; stroke-width: 2; stroke-linejoin: round; }
.seg { position: relative; display: flex; height: 10cqw; padding: .8cqw; border-radius: 999px; background: var(--lav); box-shadow: 0 1.4cqw 3cqw rgba(15,35,110,.3); }
.seg button { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 1.4cqw; width: 26cqw; border-radius: 999px; color: #6a7cbf; font-size: 3.2cqw; font-weight: 800; transition: color .3s; }
.seg button span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.seg button small { font-family: "Fredoka"; font-size: 2cqw; font-weight: 500; opacity: .8; }
.seg button svg { width: 5cqw; height: 5cqw; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.seg-thumb { position: absolute; top: .8cqw; bottom: .8cqw; left: .8cqw; width: 26cqw; border-radius: 999px; background: var(--ink); transition: transform .4s var(--ease); }
#list.mode-grid .seg-thumb { transform: translateX(26cqw); }
#list.mode-swipe .seg [data-mode="swipe"], #list.mode-grid .seg [data-mode="grid"] { color: #fff; }

/* ---------- 넘겨보기 (스와이프) ---------- */
.swipe-track { position: absolute; top: 0; bottom: 9cqh; left: 0; display: flex; align-items: center; padding-left: 8cqw; will-change: transform; }
.swipe-track.anim { transition: transform .5s var(--ease); }
.slide { flex: 0 0 84cqw; padding: 0 2cqw; transform: scale(.88); opacity: .5; transition: transform .5s var(--ease), opacity .5s; }
.slide.active { transform: none; opacity: 1; }
.card { position: relative; border-radius: 3.4cqw; overflow: hidden; background: var(--ink); box-shadow: 0 3cqw 7cqw rgba(10,30,90,.38); }
.titlebar { height: 5cqw; display: flex; align-items: center; gap: 1cqw; padding-left: 3cqw; }
.titlebar i { width: 1.8cqw; height: 1.8cqw; border-radius: 50%; background: #ff5f57; }
.titlebar i:nth-child(2) { background: #febc2e; } .titlebar i:nth-child(3) { background: #28c840; }
.titlebar span { margin-left: auto; margin-right: 3cqw; font-family: "Fredoka"; font-size: 2.2cqw; color: #8b93b8; letter-spacing: .1em; }
.card .stage-box { position: relative; height: min(84cqw, 47cqh); overflow: hidden; background: #000; }
.stage-box .bg { position: absolute; inset: -10%; width: 120%; height: 120%; object-fit: cover; filter: blur(2.4cqw) brightness(.55) saturate(1.3); }
.stage-box .fg, .stage-box video { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); object-fit: contain; }
.stage-box.o-portrait .fg, .stage-box.o-portrait video { height: 100%; aspect-ratio: var(--ar, .5625); }
.stage-box.o-landscape .fg, .stage-box.o-landscape video { width: 100%; aspect-ratio: var(--ar, 1.7778); }
.stage-box video { opacity: 0; transition: opacity .6s; }
.stage-box video.on { opacity: 1; }
.ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 6%; text-align: center; font-weight: 800; font-size: 4cqw; color: rgba(255,255,255,.85); background: linear-gradient(150deg, #5d8fe6, #ff8cc6 60%, #ffd56a); }
.play-btn {
  position: absolute; left: 50%; top: 50%; width: 17cqw; height: 17cqw; margin: -8.5cqw 0 0 -8.5cqw; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.92); box-shadow: 0 1.6cqw 4cqw rgba(0,0,0,.35); opacity: 0; transform: scale(.7); transition: opacity .4s, transform .4s var(--ease);
}
.play-btn svg { width: 7cqw; height: 7cqw; margin-left: 1cqw; fill: var(--pink); }
.slide.active .play-btn { opacity: 1; transform: none; }
.slide.active .play-btn::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: .5cqw solid #fff; animation: ring2 2s ease-out infinite; }
@keyframes ring2 { from { transform: scale(1); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
.card .info { padding: 3.2cqw 4cqw 4cqw; }
.info-row { display: flex; align-items: center; gap: 1.6cqw; flex-wrap: wrap; }
.chip { font-size: 2.4cqw; font-weight: 600; color: #b8c0e4; padding: .4em .9em; border-radius: 99px; background: rgba(255,255,255,.09); }
.card h3 { margin: 2.2cqw 0 0; font-size: 5cqw; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .author { margin: 1.2cqw 0 0; font-size: 3cqw; font-weight: 600; color: #ff9cc9; }
.card .desc { margin: 1.4cqw 0 0; font-size: 2.7cqw; line-height: 1.5; color: #aab1d1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.nav { position: absolute; top: 38%; width: 10cqw; height: 10cqw; margin-top: -5cqw; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.88); box-shadow: 0 1.2cqw 3cqw rgba(10,30,90,.3); z-index: 2; }
.nav svg { width: 5cqw; height: 5cqw; fill: none; stroke: #3e56a8; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.nav.prev { left: 1.4cqw; } .nav.next { right: 1.4cqw; }
.swipe-foot { position: absolute; left: 0; right: 0; bottom: 1cqh; height: 7cqh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2cqw; }
.dots { display: flex; gap: 1.4cqw; }
.dots i { width: 2cqw; height: 2cqw; border-radius: 99px; background: rgba(255,255,255,.55); transition: width .35s var(--ease), background .35s; }
.dots i.on { width: 6cqw; background: #fff; }
.dots i[data-rank="1"].on { background: var(--yellow); } .dots i[data-rank="2"].on { background: var(--pink); }
.dots i[data-rank="3"].on { background: #2a86e8; }
.swipe-hint { font-size: 2.7cqw; font-weight: 600; opacity: .95; text-shadow: 0 .2cqw .8cqw rgba(20,50,140,.4); }
.swipe-hint b { font-family: "Fredoka"; font-weight: 600; }

/* ---------- 모아보기 (그리드) ---------- */
.grid-view { display: flex; flex-direction: column; gap: 1.8cqw; padding: 0 4cqw 1.5cqh; }
.tier { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 1.8cqw; flex: var(--grow) 1 0; min-height: 0; }
.gcard { position: relative; overflow: hidden; border-radius: 2.6cqw; background: var(--ink); box-shadow: 0 1.6cqw 4cqw rgba(10,30,90,.3); text-align: left; animation: pop .6s var(--ease) backwards; animation-delay: calc(var(--i) * 45ms); }
#list:not(.mode-grid) .gcard { animation: none; }
@keyframes pop { from { opacity: 0; transform: translateY(3cqw) scale(.94); } }
.gcard:active { transform: scale(.97); }
.gcard img, .gcard video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.gcard video { opacity: 0; transition: opacity .6s; } .gcard video.on { opacity: 1; }
.gcard .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.1) 0%, rgba(0,0,0,0) 40%, rgba(5,8,25,.85) 100%); }
.gcard .rank-badge { position: absolute; left: 2cqw; top: 2cqw; font-size: 2.6cqw; }
.gcard .ori { position: absolute; right: 2cqw; top: 2cqw; padding: .35em .8em; border-radius: 99px; font-size: 2cqw; font-weight: 700; background: rgba(0,0,0,.45); }
.gcard .gtext { position: absolute; left: 2.6cqw; right: 2.6cqw; bottom: 2.2cqw; }
.gcard .gtext b { display: block; font-size: 3.6cqw; font-weight: 800; line-height: 1.25; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcard .gtext small { display: block; margin-top: .6cqw; font-size: 2.5cqw; font-weight: 600; color: #ffb3d6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcard .gplay { position: absolute; right: 2.4cqw; bottom: 2.4cqw; width: 8cqw; height: 8cqw; border-radius: 50%; background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center; }
.gcard .gplay svg { width: 3.6cqw; height: 3.6cqw; margin-left: .5cqw; fill: var(--pink); }
.gcard .gtext:has(+ .gplay) { right: 12cqw; }
.tier.t-hero .gcard .rank-badge { font-size: 3.4cqw; left: 2.6cqw; top: 2.6cqw; }
.tier.t-hero .gtext b { font-size: 5.2cqw; } .tier.t-hero .gtext small { font-size: 3cqw; }
.tier.t-hero .gplay { width: 11cqw; height: 11cqw; } .tier.t-hero .gplay svg { width: 5cqw; height: 5cqw; }
.tier.t-hero .gtext:has(+ .gplay) { right: 15cqw; }
.tier.t-small .gcard { border-radius: 2cqw; }
.tier.t-small .rank-badge { font-size: 2cqw; left: 1.2cqw; top: 1.2cqw; }
.tier.t-small .ori, .tier.t-small .gplay, .tier.t-small small { display: none; }
.tier.t-small .gtext { left: 1.4cqw; right: 1.4cqw; bottom: 1.4cqw; }
.tier.t-small .gtext b { font-size: 2.4cqw; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- 플레이어 ---------- */
#player { background: #000; }
#player { --land-top: 34cqh; }
.p-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.85) 100%); transition: opacity .5s; }
#player.o-landscape .p-shade { background: none; }
.p-tap { position: absolute; inset: 0; }
.p-panel { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 6cqw 5.5cqh; transition: opacity .45s, transform .45s var(--ease); }
#player.ui-hidden .p-panel { opacity: 0; transform: translateY(4cqw); pointer-events: none; }
#player.ui-hidden .p-shade { opacity: 0; }
.p-info { margin-bottom: 4cqw; }
.p-info h2 { margin: 2cqw 0 0; font-size: 5.6cqw; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.p-author { margin: 1.2cqw 0 0; font-size: 3.2cqw; font-weight: 600; color: #ffa6cf; }
#player.o-portrait .p-info h2 { font-size: 4.6cqw; }
#player.o-landscape .p-panel { top: calc(var(--land-top) + 28.2cqw + 4cqh); display: flex; flex-direction: column; justify-content: space-between; }
.p-progress { display: flex; align-items: center; gap: 2.6cqw; font-family: "Fredoka"; font-size: 2.8cqw; font-weight: 500; font-variant-numeric: tabular-nums; }
.bar { position: relative; flex: 1; height: 7cqw; display: flex; align-items: center; touch-action: none; }
.bar::before { content: ""; position: absolute; left: 0; right: 0; height: 1.3cqw; border-radius: 99px; background: rgba(255,255,255,.25); }
.bar .fill { position: absolute; left: 0; height: 1.3cqw; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--pink), var(--yellow)); }
.bar .knob { position: absolute; left: 0; width: 4.2cqw; height: 4.2cqw; margin-left: -2.1cqw; border-radius: 50%; background: #fff; box-shadow: 0 .4cqw 1.2cqw rgba(0,0,0,.4); }
.p-ctrls { display: flex; align-items: center; justify-content: space-between; margin-top: 3cqw; }
.p-ctrls button { display: flex; flex-direction: column; align-items: center; gap: 1cqw; font-size: 2.6cqw; font-weight: 700; color: rgba(255,255,255,.92); }
.p-ctrls button svg { width: 12cqw; height: 12cqw; padding: 3.4cqw; border-radius: 50%; background: rgba(255,255,255,.14); fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.p-ctrls .c-prev svg path:last-child, .p-ctrls .c-next svg path:last-child { fill: #fff; }
.p-ctrls .big svg { width: 19cqw; height: 19cqw; padding: 5.4cqw; background: #fff; stroke: var(--ink); }
.p-ctrls .big .i-play path { fill: var(--pink); stroke: var(--pink); }
.p-ctrls .big .i-play { padding-left: 6.2cqw; }
#player.paused .i-pause, #player:not(.paused) .i-play { display: none; }
.p-ctrls button:active svg { transform: scale(.92); }
.p-flash { position: absolute; left: 50%; top: 42%; width: 22cqw; height: 22cqw; margin: -11cqw 0 0 -11cqw; border-radius: 50%; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.p-flash svg { width: 10cqw; height: 10cqw; fill: #fff; }
.p-flash.show { animation: flash .7s ease-out; }
@keyframes flash { 0% { opacity: 1; transform: scale(.8); } 100% { opacity: 0; transform: scale(1.25); } }
.p-error { position: absolute; left: 8cqw; right: 8cqw; top: 38cqh; padding: 5cqw; border-radius: 3cqw; background: rgba(13,13,20,.9); text-align: center; font-size: 3.4cqw; line-height: 1.6; }

/* ---------- 관리자 진입 / PIN ---------- */
#hotspot { position: absolute; left: 0; top: 0; width: 12cqw; height: 12cqw; z-index: 50; }
.overlay { position: absolute; inset: 0; z-index: 40; }
#pin { display: flex; align-items: center; justify-content: center; background: rgba(8,12,30,.72); }
.pin-box { width: 66cqw; padding: 5cqw; border-radius: 4cqw; background: #fff; color: var(--ink); text-align: center; box-shadow: 0 4cqw 10cqw rgba(0,0,0,.4); }
.pin-box h3 { margin: 0; font-size: 4.4cqw; }
.pin-msg { margin: 1.4cqw 0 0; font-size: 2.8cqw; color: #66708f; }
.pin-msg.err { color: #e5345f; }
.pin-dots { display: flex; justify-content: center; gap: 2.4cqw; height: 4cqw; margin: 3.4cqw 0; }
.pin-dots i { width: 3cqw; height: 3cqw; border-radius: 50%; border: .4cqw solid #b9c0d8; }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); }
.pin-box.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-2cqw); } 75% { transform: translateX(2cqw); } }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2cqw; }
.pin-pad button { height: 12cqw; border-radius: 2.4cqw; background: #eef1f8; font-size: 5cqw; font-weight: 700; color: var(--ink); }
.pin-pad button.fn { font-size: 3cqw; color: #5a6485; }
.pin-pad button:active { background: #d9deec; }

/* ---------- 관리자 패널 ---------- */
#admin { background: #10131d; color: #e8ebf5; overflow-y: auto; touch-action: pan-y; font-size: 2.6cqw; }
.adm { padding: 5cqw 5cqw 10cqw; }
.adm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4cqw; }
.adm-head h2 { margin: 0; font-size: 4.6cqw; }
.adm-head small { display: block; color: #8a92b2; font-size: 2.3cqw; margin-top: .6cqw; }
.adm-sec { margin-top: 4cqw; padding: 3.6cqw; border-radius: 2.6cqw; background: #181c2a; }
.adm-sec h3 { margin: 0 0 2.6cqw; font-size: 3.2cqw; }
.adm-grid { display: grid; grid-template-columns: auto 1fr; gap: 1.6cqw 3cqw; align-items: center; }
.adm-grid dt { color: #8a92b2; } .adm-grid dd { margin: 0; word-break: break-all; }
.warn { color: #ffb84d; } .bad { color: #ff6b8a; } .good { color: #6be3b0; }
.abtn { display: inline-flex; align-items: center; justify-content: center; min-height: 8cqw; padding: 0 3.6cqw; border-radius: 1.8cqw; background: #2a3150; font-weight: 700; font-size: 2.6cqw; }
.abtn.primary { background: #ff6fae; color: #fff; } .abtn.danger { background: #5a1f30; color: #ffb3c3; } .abtn.armed { background: #e5345f; color: #fff; }
.abtn-row { display: flex; flex-wrap: wrap; gap: 2cqw; }
.vrow { display: grid; grid-template-columns: 18cqw 1fr; gap: 2.6cqw; padding: 2.4cqw 0; border-top: 1px solid #262b3d; }
.vrow:first-of-type { border-top: 0; }
.vthumb { position: relative; width: 18cqw; aspect-ratio: 1; border-radius: 1.6cqw; overflow: hidden; background: #000; }
.vthumb img { width: 100%; height: 100%; object-fit: contain; }
.vmeta b { font-size: 2.9cqw; } .vmeta p { margin: .6cqw 0 0; color: #9aa2c2; font-size: 2.3cqw; word-break: break-all; }
.vctl { display: flex; flex-wrap: wrap; gap: 1.4cqw; margin-top: 1.6cqw; align-items: center; }
.opt { display: inline-flex; border-radius: 1.6cqw; overflow: hidden; background: #2a3150; }
.opt button { min-height: 7cqw; padding: 0 2.6cqw; font-size: 2.4cqw; font-weight: 700; color: #aeb6d6; }
.opt button.on { background: #ff6fae; color: #fff; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 3cqw; padding: 2cqw 0; border-top: 1px solid #262b3d; }
.field:first-of-type { border-top: 0; }
.field label { flex: 1; } .field label small { display: block; color: #8a92b2; font-size: 2.2cqw; margin-top: .4cqw; }
.stepper { display: inline-flex; align-items: center; gap: 1.6cqw; }
.stepper button { width: 8cqw; height: 8cqw; border-radius: 1.6cqw; background: #2a3150; font-size: 4cqw; font-weight: 700; }
.stepper output { min-width: 12cqw; text-align: center; font-weight: 700; font-size: 3cqw; }
.adm-warn { margin: 0; padding-left: 4cqw; color: #ffb84d; font-size: 2.4cqw; line-height: 1.6; }

#toast { position: absolute; left: 50%; bottom: 14cqh; transform: translate(-50%, 2cqw); z-index: 60; padding: 2.4cqw 5cqw; border-radius: 99px; background: rgba(13,13,20,.9); font-size: 3cqw; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; white-space: nowrap; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 가로 영상 대기화면: 하늘 배경 위라 글자를 어두운 카드에 올린다 */
#idle.o-landscape .idle-info { left: 10cqw; right: 10cqw; padding: 3cqw 4cqw 3.4cqw; border-radius: 3cqw; background: rgba(13,13,20,.82); box-shadow: 0 2cqw 5cqw rgba(10,30,90,.3); }
#idle.o-landscape .now { background: rgba(255,255,255,.1); }

/* ===== 대기화면(가로 영상) = 키비주얼 레이아웃 =====
   배경(글자 없음) 위에 투명 글자 레이어를 겹친다. 좌표는 키비주얼(1024×1820 환산) 기준 % 값. */
.idle-bg, .hero { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .7s; pointer-events: none; }
.idle-bg { object-fit: fill; }
#idle.o-landscape .idle-bg, #idle.o-landscape .hero { opacity: 1; }
#idle.o-landscape .idle-top { display: none; }
.hero img { position: absolute; will-change: transform; }
.hero-pov { left: 15.625%; top: 8.240%; width: 67.19%; height: 19.06%; transform-origin: 50% 60%; animation: boing 2.8s ease-in-out infinite; }
.hero-korea { left: 17.773%; top: 27.30%; width: 64.45%; height: 6.152%; transform-origin: 50% 60%; animation: boing-sm 2.8s ease-in-out .35s infinite; }
.hero-qr { left: 83.01%; top: 1.758%; width: 13.28%; height: 9.119%; }
.hero-sub { position: absolute; left: 0; right: 0; top: 33.5%; margin: 0; text-align: center; white-space: nowrap;
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 3.55cqw; letter-spacing: -.005em; color: #fff;
  text-shadow: 0 .25cqw .8cqw rgba(20,50,140,.35); }

/* 풍선 글자: 말랑하게 눌렸다 늘어났다 (뽀잉뽀잉) */
@keyframes boing {
  0%, 70%, 100% { transform: scale(1, 1); }
  10% { transform: scale(1.06, .95); }
  22% { transform: scale(.96, 1.06); }
  34% { transform: scale(1.03, .98); }
  46% { transform: scale(.99, 1.02); }
  58% { transform: scale(1.01, .995); }
}
@keyframes boing-sm {
  0%, 70%, 100% { transform: scale(1, 1); }
  10% { transform: scale(1.04, .96); }
  22% { transform: scale(.97, 1.05); }
  34% { transform: scale(1.02, .985); }
  46% { transform: scale(.995, 1.015); }
}
/* 서브타이틀: 글자가 차례로 콩콩 */
.wave span { display: inline-block; animation: hop 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * 55ms); }
@keyframes hop { 0%, 40%, 100% { transform: translateY(0); } 20% { transform: translateY(-.32em) rotate(-4deg); } 30% { transform: translateY(.04em); } }
/* CSS 로고(세로 영상 대기화면·목록 머리)도 글자마다 말랑하게 */
.logo .l { display: inline-block; transform-origin: 50% 80%; animation: boing 2.8s ease-in-out infinite; }
.logo .l2 { animation-delay: .12s; } .logo .l3 { animation-delay: .24s; }

/* 영상 창: 목업의 검은 창 위치(위 51%)에서 시작, 제목 줄 + 영상 */
#idle { --vh: min(calc(90cqw / var(--ar, 1.7778)), 50.6cqw); }
#idle .frame { top: 50cqh; height: calc(var(--vh) + 9cqw); background: #000; border-radius: 3cqw; }
#idle .frame i { top: 3.1cqw; }
#idle.o-landscape .media video { left: 5cqw; width: 90cqw; top: calc(50cqh + 8cqw); height: var(--vh); transform: none; border-radius: 0 0 2cqw 2cqw; background: #000; }
#idle.o-landscape .idle-info {
  top: 50cqh; bottom: auto; left: 15cqw; right: 6cqw; height: 8cqw; padding: 0; border-radius: 0; background: none; box-shadow: none;
  display: flex; align-items: center; gap: 2cqw; text-align: left;
}
#idle.o-landscape .now { flex: none; font-size: 1.7cqw; padding: .45em 1em; }
#idle.o-landscape .idle-title { flex: 0 1 auto; min-width: 0; margin: 0; gap: 1.4cqw; justify-content: flex-start; }
#idle.o-landscape .idle-title .rank-badge { font-size: 2.2cqw; }
#idle.o-landscape .idle-title h2 { font-size: 3.2cqw; max-width: none; text-shadow: none; }
#idle.o-landscape .idle-author { flex: none; margin: 0; font-size: 2.4cqw; color: #ff9cc9; text-shadow: none; white-space: nowrap; }
/* 터치 안내: 창과 하단 로고 사이 */
#idle.o-landscape .cta { bottom: 8.2cqh; padding: 2.2cqw 5cqw 2.2cqw 3.6cqw; gap: 2.4cqw; }
#idle.o-landscape .cta svg { width: 6.6cqw; height: 6.6cqw; }
#idle.o-landscape .cta b { font-size: 3.7cqw; }
#idle.o-landscape .cta small { font-size: 2.3cqw; }

/* 키비주얼 비눗방울/소품: 제자리에서 둥실둥실 */
.hero .obj { transform-origin: 50% 50%; animation: floaty var(--d) ease-in-out var(--dl) infinite alternate; }
@keyframes floaty {
  from { transform: translate3d(0, calc(var(--amp) * -1), 0) rotate(calc(var(--rot) * -1)) scale(1); }
  to { transform: translate3d(0, var(--amp), 0) rotate(var(--rot)) scale(var(--sc)); }
}

/* 배경에 흐르는 빈 비눗방울 (아래 → 위, 원근감) */
.rise { position: absolute; inset: 0; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .7s; }
#idle.o-landscape .rise { opacity: 1; }
.rise b { position: absolute; top: 100%; left: var(--x); width: var(--s); will-change: transform; animation: rise-up var(--d) linear var(--dl) infinite; }
.rise b img { display: block; width: 100%; opacity: var(--op); filter: blur(var(--bl)); animation: sway var(--sw) ease-in-out var(--dl) infinite alternate; }
@keyframes rise-up { to { transform: translate3d(0, calc(-100cqh - 30cqw), 0); } }
@keyframes sway { from { transform: translateX(calc(var(--amp) * -1)) rotate(-6deg); } to { transform: translateX(var(--amp)) rotate(6deg); } }

/* 키비주얼 풍선 글자 로고 (세로 영상 대기화면 상단, 목록 머리) */
.logo-kv { display: flex; flex-direction: column; align-items: center; width: var(--lw, 42cqw); filter: drop-shadow(0 .6cqw 1.4cqw rgba(10,30,90,.3)); }
.logo-kv img { display: block; will-change: transform; }
.kv-pov { width: 100%; transform-origin: 50% 60%; animation: boing 2.8s ease-in-out infinite; }
.kv-korea { width: 100%; transform-origin: 50% 60%; animation: boing-sm 2.8s ease-in-out .35s infinite; }
.logo-slot.sm .logo-kv { --lw: 29cqw; }
/* 목록 머리: 풍선 로고만 가운데 */
.list-head { padding-top: .4cqh; }
.list-title { display: none; }
