* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #000; color: #fff; font-family: 'Jua', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; overflow: hidden; overscroll-behavior: none; }
button { font-family: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }

#top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,0)); pointer-events: none; }
#top > * { pointer-events: auto; }
.logo { font-size: 26px; letter-spacing: 1px; background: linear-gradient(90deg, #ffd98a, #ff7a5a 60%, #c06bff); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
.logo span { display: block; font-size: 11px; letter-spacing: 0; color: rgba(255,255,255,.75); -webkit-text-fill-color: rgba(255,255,255,.75); margin-top: -2px; }
#btnInstall { font-size: 13px; padding: 7px 12px; border-radius: 16px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); }

#feed { height: 100dvh; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; }
#feed::-webkit-scrollbar { display: none; }
.card { position: relative; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #111; }
.card .bg { position: absolute; inset: -40px; background: center/cover no-repeat; filter: blur(28px) brightness(.55) saturate(1.3); transform: scale(1.1); }
.card video, .card .poster { position: relative; width: 100%; max-height: 72dvh; object-fit: contain; display: block; }
.card .poster { height: auto; }
/* 가로 게임: 위쪽에 4:3 로 크게 / 세로 게임: 화면 꽉 채움(쇼츠처럼) */
.card.land video, .card.land .poster { position: absolute; top: calc(64px + env(safe-area-inset-top)); left: 0; width: 100%; height: auto; aspect-ratio: 4 / 3; max-height: 52dvh; object-fit: cover; border-radius: 0 0 18px 18px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.card.port video, .card.port .poster { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; object-fit: cover; }
.card.port .shade { background: linear-gradient(180deg, rgba(0,0,0,.35) 0, rgba(0,0,0,0) 18%, rgba(0,0,0,0) 50%, rgba(0,0,0,.8) 88%); }
.card .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.75) 85%); pointer-events: none; }

.info { position: absolute; left: 16px; right: 84px; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 2; }
.info h2 { margin: 0; font-size: 28px; font-weight: normal; text-shadow: 0 2px 8px rgba(0,0,0,.7); }
.info .hook { margin: 4px 0 6px; font-size: 16px; opacity: .95; text-shadow: 0 1px 6px rgba(0,0,0,.8); }
.info .desc { margin: 0 0 8px; font-size: 13px; opacity: .78; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tags span { font-size: 12px; padding: 3px 9px; border-radius: 12px; background: rgba(255,255,255,.16); }
.tags span.time { background: rgba(255,217,138,.22); color: #ffe7a8; }
.play { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; padding: 12px 26px; border-radius: 30px; color: #1a1006;
  background: linear-gradient(180deg, #ffe7a8, var(--c, #e8b04a)); box-shadow: 0 6px 20px rgba(0,0,0,.45), inset 0 -3px 0 rgba(0,0,0,.15); }
.play:active { transform: scale(.96); }
.play i { font-style: normal; font-size: 16px; }

.side { position: absolute; right: 10px; bottom: calc(110px + env(safe-area-inset-bottom)); z-index: 2; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.side button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; text-shadow: 0 1px 4px #000; }
.side .ic { width: 46px; height: 46px; border-radius: 50%; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.side .liked .ic { background: rgba(255,64,96,.35); border-color: #ff6a8a; }
.side .thumb { width: 46px; height: 46px; border-radius: 12px; background: center/cover; border: 2px solid #fff; }

.badge-new { position: absolute; top: calc(70px + env(safe-area-inset-top)); left: 16px; z-index: 2; font-size: 12px; padding: 3px 10px; border-radius: 10px; background: #ff4060; }

#hint { position: fixed; inset: 0; z-index: 30; display: none; flex-direction: column; align-items: center; justify-content: center; background: rgba(0,0,0,.55); pointer-events: none; }
#hint.on { display: flex; }
#hint p { font-size: 18px; margin-top: 18px; }
#hint .swipe { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.9); animation: swipe 1.4s ease-in-out infinite; }
@keyframes swipe { 0% { transform: translateY(60px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-80px); opacity: 0; } }

#player { position: fixed; inset: 0; z-index: 50; background: #000; }
#player[hidden] { display: none; }
#frame { width: 100%; height: 100%; border: 0; display: block; }
#btnBack { position: absolute; top: calc(8px + env(safe-area-inset-top)); left: calc(8px + env(safe-area-inset-left)); z-index: 2; font-size: 13px; padding: 6px 12px; border-radius: 16px; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.3); opacity: .75; }
#btnBack:hover { opacity: 1; }
#rotateTip { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); font-size: 14px; padding: 8px 14px; border-radius: 16px; background: rgba(0,0,0,.65); white-space: nowrap; pointer-events: none; }

#toast { position: fixed; left: 50%; top: 40%; transform: translateX(-50%); z-index: 60; background: rgba(20,20,20,.85); padding: 10px 18px; border-radius: 18px; font-size: 15px; opacity: 0; transition: opacity .2s; pointer-events: none; }
#toast.on { opacity: 1; }

/* PC: 가운데 세로 판 */
@media (min-aspect-ratio: 4/5) {
  #feed { width: min(56.25dvh, 100vw); margin: 0 auto; border-left: 1px solid #222; border-right: 1px solid #222; }
  #top { width: min(56.25dvh, 100vw); left: 50%; transform: translateX(-50%); right: auto; }
}
