/* =========================================================
   RANDMUSIC 디자인 시스템 (DESIGN.md)
   dark neutral surfaces · white typography · blue→violet accent (5%) · rounded geometry
   앱 셸: 데스크톱 좌측 사이드바 240px / 모바일 상단바 + 하단 탭
   ========================================================= */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #090A0F; --bg-secondary: #0E1017;
    --surface: #13151E; --surface-hover: #191C27; --surface-elevated: #1D202C; --input-bg: #141620;
    --border: rgba(255,255,255,.08); --border-hover: rgba(255,255,255,.15);
    --text: #F7F8FA; --text-secondary: #A2A7B5; --text-muted: #666C7A; --icon: #8F95A3;
    --blue: #276BFF; --indigo: #4C4DFF; --violet: #7547FF;
    --success: #38D996; --warning: #FFB547; --error: #FF5572;
    --grad: linear-gradient(135deg, #2477FF 0%, #4C4DFF 50%, #7547FF 100%);
    --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 24px;
    --ease: cubic-bezier(.2,.8,.2,1);
    --font: Inter, 'Pretendard Variable', Pretendard, system-ui, -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
    --side-w: 240px; --top-h: 56px; --tab-h: 62px; --track: #343743;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; overflow-x: hidden; }
body {
    margin: 0; min-height: 100vh; overflow-x: hidden;
    background: radial-gradient(circle at 50% -10%, rgba(70,82,255,.10), transparent 38%), var(--bg);
    color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; color: inherit; }
img { max-width: 100%; }
::selection { background: rgba(76,77,255,.4); }
.ico { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex-shrink: 0; color: inherit; }

/* ---------- 타이포 ---------- */
h1, .h1 { font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin: 0; }
h2, .h2 { font-size: 18px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; margin: 0; }
h3, .h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
@media (min-width: 900px) { h1, .h1 { font-size: 32px; } h2, .h2 { font-size: 20px; } }
.sub { color: var(--text-secondary); font-size: 14px; margin: 4px 0 0; }
.muted { color: var(--text-muted); }
.caption { font-size: 12px; color: var(--text-muted); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- 앱 셸 ---------- */
.shell { display: flex; min-height: 100vh; }
.side { display: none; }
.top { position: sticky; top: 0; z-index: 900; height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 14px;
    background: rgba(15,17,25,.72); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; font-size: 16px; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.top .brand { margin-right: auto; }
.content { flex: 1; min-width: 0; }
.main { width: 100%; max-width: 1200px; margin: 0 auto; padding: 18px 16px calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) {
    .top { display: none; }
    .side { display: flex; flex-direction: column; width: var(--side-w); flex-shrink: 0; position: sticky; top: 0; height: 100vh; padding: 22px 14px; border-right: 1px solid var(--border); background: var(--bg-secondary); }
    .side .brand { padding: 0 10px 20px; font-size: 17px; }
    .side .brand img { width: 30px; height: 30px; border-radius: 9px; }
    .main { padding: 32px 32px 56px; }
}
.side-sec { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); padding: 14px 12px 6px; }
.side a.nav-item, .side .nav-item { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 10px; color: var(--text-secondary); font-weight: 500; font-size: 14.5px; transition: background .15s var(--ease), color .15s var(--ease); }
.nav-item .ico { width: 19px; height: 19px; color: var(--icon); }
.nav-item:hover { background: rgba(255,255,255,.05); color: var(--text); }
.nav-item.active { background: rgba(255,255,255,.06); color: var(--text); }
.nav-item.active .ico { color: var(--indigo); }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 14px; color: var(--text-secondary); }
.side-user .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-elevated); display: flex; align-items: center; justify-content: center; color: var(--icon); }
.side-user b { color: var(--text); font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(15,17,25,.86); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(4, 1fr); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--text-muted); }
.tabbar a .ico { width: 22px; height: 22px; color: var(--icon); }
.tabbar a.active { color: var(--text); } .tabbar a.active .ico { color: var(--indigo); }
@media (min-width: 900px) { .tabbar { display: none; } }

/* ---------- 버튼 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 14.5px; cursor: pointer; white-space: nowrap; user-select: none; -webkit-tap-highlight-color: transparent;
    transition: background .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease), filter .15s var(--ease), border-color .15s var(--ease); }
.btn-primary { background: var(--grad); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 6px 24px rgba(66,76,255,.24); }
.btn-secondary { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.10); color: var(--text); }
.btn-secondary:hover { background: rgba(255,255,255,.10); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: rgba(255,255,255,.05); color: var(--text); }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: var(--radius-sm); }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: var(--radius-sm); background: transparent; border: 1px solid transparent; color: var(--icon); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s var(--ease), color .15s var(--ease); }
.btn-icon:hover { background: rgba(255,255,255,.06); color: var(--text); }
.btn-icon .ico { width: 19px; height: 19px; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--text-secondary); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; }
.link:hover { color: var(--text); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--border); }
.seg button { height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text-secondary); font-weight: 600; font-size: 13px; cursor: pointer; }
.seg button.active { background: var(--surface-elevated); color: var(--text); }

/* ---------- 입력 ---------- */
.input, .select { width: 100%; min-width: 0; height: 46px; padding: 0 14px; border-radius: 10px; background: var(--input-bg); border: 1px solid var(--border); color: var(--text); font-family: inherit; font-size: 15px; outline: none; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.input::placeholder { color: var(--text-muted); }
.input:focus, .select:focus { border-color: rgba(82,89,255,.7); box-shadow: 0 0 0 3px rgba(82,89,255,.10); }
.input-wrap { position: relative; flex: 1 1 200px; min-width: 0; }
.input-wrap .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--icon); width: 18px; height: 18px; pointer-events: none; }
.input-wrap .input { padding-left: 40px; }
.select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238F95A3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row .btn { flex: 1 1 auto; }
.row .select { flex: 1 1 130px; width: auto; }
@media (min-width: 600px) { .row .btn, .row .select { flex: 0 0 auto; } .row .select { min-width: 150px; } }
label.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-secondary); cursor: pointer; }
label.check input { width: 18px; height: 18px; accent-color: var(--indigo); margin: 0; }

/* ---------- 섹션 / 카드 ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-head a { font-size: 13px; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 4px; }
.section-head a:hover { color: var(--text); }
.card { background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.07); border-radius: var(--radius-lg); padding: 16px; min-width: 0; transition: background .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease); }
@media (min-width: 900px) { .card { padding: 20px; } }
.card-hover:hover { background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.13); transform: translateY(-2px); }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 15.5px; font-weight: 600; margin: 0 0 12px; }
.card-title .ico { color: var(--icon); width: 18px; height: 18px; }
.hint { font-size: 13px; color: var(--text-muted); margin: 10px 0 0; line-height: 1.5; }
.hint b { color: var(--text-secondary); font-weight: 500; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; } }
.narrow { max-width: 760px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 8px; background: rgba(255,255,255,.05); border: 1px solid var(--border); font-size: 12.5px; font-weight: 500; color: var(--text-secondary); white-space: nowrap; }
.chip .ico { width: 15px; height: 15px; color: var(--indigo); }
.chip b { color: var(--text); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.num { font-family: Inter, monospace; font-variant-numeric: tabular-nums; }
.kbadge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--text-secondary); background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
.kbadge i { font-style: normal; color: var(--text-muted); font-weight: 600; }

/* ---------- 곡 리스트 ---------- */
.list { border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,.02); overflow: hidden; }
.list-scroll { max-height: 420px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.list-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-secondary); margin: 14px 0 8px; min-height: 18px; font-weight: 500; }
.song { display: flex; align-items: center; gap: 12px; padding: 8px 12px; min-height: 60px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s var(--ease); }
.song:last-child { border-bottom: 0; }
.song:hover { background: rgba(255,255,255,.04); }
.song-num { width: 18px; text-align: center; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.song-art { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; flex-shrink: 0; background: var(--surface-elevated); }
.song-art-empty { display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.song-meta { flex: 1; min-width: 0; text-align: left; }
.song-title { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-sub { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; min-width: 0; }
.song-sub > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.song-sub .kbadge { flex-shrink: 0; }
.song-play { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--icon); flex-shrink: 0; transition: all .15s var(--ease); }
.song-play .ico { width: 13px; height: 13px; margin-left: 2px; }
.song:hover .song-play { background: #fff; color: #0B0C12; }
.song.playing .song-play { background: var(--grad); color: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pop .song, .pop .tile { animation: rise .22s var(--ease) both; }
.pop > :nth-child(2){animation-delay:.04s}.pop > :nth-child(3){animation-delay:.08s}.pop > :nth-child(4){animation-delay:.12s}.pop > :nth-child(5){animation-delay:.16s}.pop > :nth-child(6){animation-delay:.2s}.pop > :nth-child(7){animation-delay:.24s}

/* ---------- 아트워크 타일 (가로 스크롤 / 그리드) ---------- */
.tiles { display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 12px; overflow-x: auto; padding: 2px 0 8px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; scroll-snap-type: x proximity; }
.tiles::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .tiles { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 0; padding: 2px 0; overflow: visible; } }
.tile { cursor: pointer; scroll-snap-align: start; min-width: 0; }
.tile-art { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface-elevated); border: 1px solid var(--border); }
.tile-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .2s var(--ease); display: block; }
.tile:hover .tile-art img { transform: scale(1.03); }
.tile-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.55)); opacity: 0; transition: opacity .15s var(--ease); }
.tile:hover .tile-art::after { opacity: 1; }
.tile-play { position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; border-radius: 50%; background: #fff; color: #0B0C12; display: flex; align-items: center; justify-content: center; opacity: 0; transform: translateY(4px); transition: all .15s var(--ease); z-index: 1; }
.tile-play .ico { width: 13px; height: 13px; margin-left: 2px; }
.tile:hover .tile-play { opacity: 1; transform: none; }
.tile-num { position: absolute; left: 8px; top: 8px; z-index: 1; font-size: 11px; font-weight: 600; color: #fff; background: rgba(0,0,0,.55); backdrop-filter: blur(8px); border-radius: 6px; padding: 2px 7px; }
.tile-title { font-size: 13.5px; font-weight: 500; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-sub { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.tile-skel .tile-art { background: linear-gradient(90deg, #161821 25%, #20232E 50%, #161821 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border: 0; }

.song-reason { display: flex; align-items: flex-start; gap: 5px; font-size: 12px; color: var(--text-secondary); margin-top: 4px; line-height: 1.4; }
.song-reason .ico { width: 13px; height: 13px; color: var(--indigo); margin-top: 2px; }
.theme { font-size: 15px; font-weight: 600; margin: 0 0 4px; letter-spacing: -.01em; }

/* ---------- 빈 상태 / 스켈레톤 ---------- */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 30px 16px; text-align: center; }
.empty .ico { width: 26px; height: 26px; color: var(--text-muted); margin-bottom: 4px; }
.empty b { font-size: 15px; font-weight: 600; color: var(--text); }
.empty span { font-size: 13px; color: var(--text-muted); max-width: 320px; line-height: 1.5; }
.empty .btn { margin-top: 10px; }
.skeleton { height: 60px; border-bottom: 1px solid var(--border); background: linear-gradient(90deg, #161821 25%, #20232E 50%, #161821 75%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ---------- 재생목록 행 ---------- */
.pl { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; background: rgba(255,255,255,.02); }
.pl-meta { flex: 1; min-width: 0; }
.pl-meta b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-meta span { font-size: 12px; color: var(--text-muted); }

/* ---------- 오늘의 플리 배지 ---------- */
.badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.badge { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--border); min-width: 0; }
.badge .ico { width: 22px; height: 22px; color: var(--indigo); flex-shrink: 0; }
.badge .lbl { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.badge .val { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .badge { flex-direction: column; align-items: flex-start; gap: 6px; } }

/* ---------- 탭 ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; margin: 0 -16px 8px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .tabs { margin: 0 0 12px; padding-left: 0; padding-right: 0; } }
.tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 13px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text-secondary); font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap; transition: all .15s var(--ease); }
.tab .ico { color: var(--icon); width: 17px; height: 17px; }
.tab:hover { background: rgba(255,255,255,.05); color: var(--text); }
.tab.active { background: rgba(255,255,255,.07); border-color: var(--border); color: var(--text); }
.tab.active .ico { color: var(--indigo); }
.hidden-tab { display: none !important; }

/* ---------- 게임 ---------- */
.game-stage { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 8px 0 4px; }
.game-label { font-size: 12px; color: var(--text-muted); letter-spacing: .08em; text-transform: uppercase; }
.game-big { font-size: clamp(24px, 5vw, 34px); font-weight: 700; letter-spacing: -.03em; line-height: 1.2; word-break: keep-all; min-height: 34px; }
.now { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 520px; margin: 6px auto 0; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--border); text-align: left; cursor: pointer; }
.now img, .now .now-art { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--surface-elevated); flex-shrink: 0; }
.now-meta { flex: 1; min-width: 0; }
.now-meta b { display: block; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-meta span { font-size: 13px; color: var(--text-secondary); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.game-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.game-actions .btn { flex: 1 1 140px; max-width: 240px; }
.hidden-answer { display: none; }
.game-list { margin-top: 14px; }

/* ---------- 플레이어 모달 ---------- */
.modal { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; opacity: 1; visibility: visible; transition: opacity .22s var(--ease), visibility .22s; }
.modal.hidden { opacity: 0; visibility: hidden; }
.modal-box { width: 100%; max-width: 780px; background: #14161F; border: 1px solid var(--border); border-radius: 20px 20px 0 0; padding: 14px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); transition: transform .24s var(--ease); }
.modal.hidden .modal-box { transform: translateY(16px); }
@media (min-width: 900px) { .modal { align-items: center; padding: 24px; } .modal-box { border-radius: 20px; } }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-width: 0; }
.modal-head > .ico { color: var(--indigo); }
.modal-head span { flex: 1; min-width: 0; font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frame { position: relative; padding-top: 56.25%; border-radius: 12px; overflow: hidden; background: #000; border: 1px solid var(--border); }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- 토스트 ---------- */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + 14px + env(safe-area-inset-bottom)); z-index: 3000; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
@media (min-width: 900px) { .toasts { bottom: 28px; left: var(--side-w); } }
.toast { display: inline-flex; align-items: center; gap: 10px; background: rgba(20,22,31,.92); backdrop-filter: blur(16px); border: 1px solid var(--border-hover); border-radius: 12px; padding: 10px 14px; font-size: 14px; font-weight: 500; animation: rise .2s var(--ease) both; max-width: 100%; }
.toast .ico { width: 18px; height: 18px; color: var(--indigo); }
.toast.ok .ico { color: var(--success); } .toast.err .ico { color: var(--error); }

/* ---------- 홈 ---------- */
.home-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.home-head .chips { margin-top: 10px; }
.quick { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 720px) { .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.quick a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.quick .ico-box { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--indigo); flex-shrink: 0; }
.quick .ico-box .ico { width: 18px; height: 18px; }
.quick b { display: block; font-size: 14.5px; font-weight: 600; }
.quick span { font-size: 12.5px; color: var(--text-secondary); display: block; }
.quick .go { margin-left: auto; color: var(--text-muted); }
.connect { display: flex; flex-direction: column; gap: 10px; }
.footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 12px; color: var(--text-muted); }
.footer a:hover { color: var(--text-secondary); }

/* ---------- 인증 ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-box { width: 100%; max-width: 400px; background: rgba(255,255,255,.035); border: 1px solid var(--border); border-radius: 20px; padding: 26px 20px; }
@media (min-width: 600px) { .auth-box { padding: 34px 32px; } }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; text-align: center; }
.auth-brand img { width: 48px; height: 48px; border-radius: 13px; display: block; }
.auth-brand h1 { font-size: 21px; }
.auth-brand p { margin: 0; color: var(--text-secondary); font-size: 14px; }
.auth form { display: flex; flex-direction: column; gap: 12px; }
.auth .label { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin: 2px 0 -4px; }
.auth .alert { display: none; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(255,85,114,.10); border: 1px solid rgba(255,85,114,.3); color: #FF8DA1; font-size: 13.5px; }
.auth .alert.show { display: flex; }
.auth .alert .ico { color: var(--error); flex-shrink: 0; }
.auth-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 18px; font-size: 13.5px; color: var(--text-secondary); }
.auth-foot a { color: var(--text); font-weight: 500; }
.auth-foot .back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); }
.agree { display: flex; align-items: center; gap: 8px; }
.agree label { flex: 1; }

/* ---------- 약관 ---------- */
.doc { max-width: 820px; }
.doc-body { color: var(--text-secondary); font-size: 14px; line-height: 1.75; }
.doc-body h3, .doc-body h2 { color: var(--text); margin: 24px 0 8px; }
.doc-body h3:first-child, .doc-body h2:first-child { margin-top: 0; }
.doc-body table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13px; }
.doc-body td, .doc-body th { border: 1px solid var(--border); padding: 8px 10px; }
.doc-body tr:first-child td { background: rgba(255,255,255,.05); color: var(--text); font-weight: 600; }

/* ---------- 확장 기능: 내 플리 / 곡 정보 / 커뮤니티 / 팟 ---------- */
.tabbar { grid-template-columns: repeat(5, 1fr); }
.song .info { opacity: 0; transition: opacity .15s var(--ease); }
.song:hover .info, .song:focus-within .info { opacity: 1; }
@media (hover: none) { .song .info { opacity: 1; } }
.song-title a, a.song-title { color: inherit; }
a.song-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.song.sung { opacity: .45; }
.song.sung .song-title { text-decoration: line-through; }
.song .drag { cursor: grab; }
.song.dragging { opacity: .4; }
.kbadge.set { color: var(--text); border-color: rgba(76,77,255,.5); background: rgba(76,77,255,.12); }
.kbadge.singer { color: #fff; background: var(--grad); border: 0; }
.kbadge.together { color: var(--success); border-color: rgba(56,217,150,.4); background: rgba(56,217,150,.1); }
.song-settings { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 10px 12px 12px 44px; background: rgba(255,255,255,.03); border-bottom: 1px solid var(--border); }
.song-settings label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.song-settings label.grow { flex: 1 1 180px; }
.input.xs, .select.xs { height: 36px; font-size: 13.5px; padding: 0 10px; width: 92px; }
.song-settings .grow .input.xs { width: 100%; }
.pl-card { align-items: center; }
.pl-cover { width: 52px; height: 52px; border-radius: 10px; background: var(--surface-elevated); overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--text-muted); flex-shrink: 0; }
.pl-cover img { width: 100%; height: 100%; object-fit: cover; }
.pl-desc { display: block; font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; white-space: normal; }
a.pl { transition: background .15s var(--ease); } a.pl:hover { background: rgba(255,255,255,.05); }
a.pl > .ico { color: var(--icon); }
.pl-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 720px) { .pl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .pl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.plc { display: flex; gap: 14px; padding: 14px; }
.plc-art { width: 84px; height: 84px; border-radius: 12px; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-elevated); flex-shrink: 0; color: var(--text-muted); align-items: center; justify-items: center; }
.plc-art img { width: 100%; height: 100%; object-fit: cover; }
.plc-art img:only-child { grid-column: 1 / -1; }
.plc-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.plc-meta b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plc-meta > span { font-size: 12.5px; color: var(--text-secondary); }
.plc-meta .caption { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-hero { margin-bottom: 18px; }
.song-hero-in { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: 16px; background: rgba(255,255,255,.035); border: 1px solid var(--border); flex-wrap: wrap; }
.hero-art { width: 96px; height: 96px; border-radius: 14px; object-fit: cover; background: var(--surface-elevated); flex-shrink: 0; }
.hero-meta { flex: 1; min-width: 200px; }
.hero-meta h1 { font-size: 22px; }
@media (min-width: 900px) { .song-hero-in { padding: 22px; } .hero-art { width: 132px; height: 132px; } .hero-meta h1 { font-size: 28px; } }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.stat { padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--border); }
.stat .lbl { display: block; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.stat b { font-size: 16px; }
.comments { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.comment { font-size: 13.5px; color: var(--text-secondary); padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.03); }
.comment b { color: var(--text); margin-right: 4px; }
.vote-group { margin-bottom: 10px; }
.vote-group .caption { margin-bottom: 4px; }
.tagchip input { display: none; }
.tagchip span { display: inline-flex; align-items: center; height: 30px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--border); background: rgba(255,255,255,.04); font-size: 12.5px; color: var(--text-secondary); cursor: pointer; transition: all .15s var(--ease); }
.tagchip input:checked + span { background: rgba(76,77,255,.18); border-color: rgba(76,77,255,.6); color: var(--text); }
.vote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 6px; }
.vote-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
[contenteditable]:empty::before { content: attr(data-placeholder); color: var(--text-muted); }
[contenteditable]:focus { outline: 1px dashed rgba(82,89,255,.6); border-radius: 6px; }

/* ---------- 잘림 점검 보정 (2026-09-04) ---------- */
.song-title, a.song-title { display: block; min-width: 0; }
.kbadge { white-space: normal; line-height: 1.3; }
.game-stage > * { max-width: 100%; min-width: 0; }
.game-stage > div { width: 100%; }
.game-stage .game-actions, .game-stage .score { width: auto; }
.now-meta b, .now-meta span { white-space: normal; overflow: visible; }
.now-meta b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pl-meta b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.plc-meta b, .plc-meta .caption { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.page-head h1 { min-width: 0; overflow-wrap: anywhere; }
.page-head > div:first-child { min-width: 0; flex: 1 1 240px; }
.page-head .row { flex: 0 1 auto; }
h1, h2, h3, .big-result, .game-big { overflow-wrap: anywhere; }
.chip, .stat, .comment, .hint, .caption, .sub { overflow-wrap: anywhere; }
.chip { white-space: normal; height: auto; min-height: 30px; padding-top: 4px; padding-bottom: 4px; }
.song-settings { padding-left: 12px; }
@media (max-width: 400px) {
    .badges { grid-template-columns: 1fr; }
    .badge { flex-direction: row; align-items: center; }
    .stats { grid-template-columns: 1fr 1fr; }
    .vote-grid { grid-template-columns: 1fr 1fr; }
    .song { gap: 10px; padding: 8px 10px; }
    .song-art { width: 42px; height: 42px; }
    .main { padding-left: 12px; padding-right: 12px; }
    .tiles { margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
    .tabs { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
}
.song-sub .kbadge { flex-shrink: 1; min-width: 0; }
.song-reason { min-width: 0; }
.song-reason .ico { flex-shrink: 0; }
.song-meta { overflow: hidden; }
/* 좁은 화면의 편집 행: 버튼을 줄이고 제목은 2줄까지 */
.song-edit .song-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 400px) {
    .song-edit { gap: 8px; }
    .song-edit .song-num { display: none; }
    .song-edit .btn-icon { width: 30px; height: 30px; }
    .song-edit .btn-icon .ico { width: 17px; height: 17px; }
    .song .btn-icon.info { display: none; }
    .song-play { width: 28px; height: 28px; }
}

/* ---------- 퀴즈 / 랭킹 / 버저 ---------- */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 12px; }
.mode { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,.03); color: var(--text-secondary); cursor: pointer; text-align: left; min-width: 0; transition: all .15s var(--ease); }
.mode .ico { width: 18px; height: 18px; color: var(--indigo); }
.mode b { color: var(--text); font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.mode span { font-size: 12px; color: var(--text-muted); }
.mode.active { background: rgba(76,77,255,.14); border-color: rgba(76,77,255,.6); }
.mode-grid.small { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); margin-top: 0; }
.mode-grid.small .mode { padding: 9px 10px; }
.quiz-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.quiz-head .btn-ghost { margin-left: auto; }
.quiz-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 0 8px; }
.eq { display: flex; align-items: flex-end; gap: 5px; height: 44px; }
.eq i { display: block; width: 7px; height: 8px; border-radius: 4px; background: var(--track); transition: background .2s; }
.eq.on i { background: var(--grad); animation: eq .8s ease-in-out infinite alternate; }
.eq i:nth-child(2){animation-delay:.12s}.eq i:nth-child(3){animation-delay:.24s}.eq i:nth-child(4){animation-delay:.06s}.eq i:nth-child(5){animation-delay:.18s}
@keyframes eq { from { height: 8px; } to { height: 44px; } }
.quiz-cover { width: 200px; height: 200px; max-width: 100%; border-radius: 16px; object-fit: cover; border: 1px solid var(--border); transition: filter .4s var(--ease); }
.quiz-cover.blur3 { filter: blur(22px) saturate(1.4); } .quiz-cover.blur2 { filter: blur(12px); } .quiz-cover.blur1 { filter: blur(5px); }
.choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 12px; }
@media (min-width: 600px) { .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.choice { min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,.04); color: var(--text); font-size: 14.5px; font-weight: 500; cursor: pointer; text-align: left; overflow-wrap: anywhere; transition: all .15s var(--ease); }
.choice:hover:not([disabled]) { background: rgba(255,255,255,.07); border-color: var(--border-hover); }
.choice.right { background: rgba(56,217,150,.14); border-color: rgba(56,217,150,.6); }
.choice.wrong { background: rgba(255,85,114,.12); border-color: rgba(255,85,114,.5); }
.choice[disabled] { cursor: default; opacity: .8; }
.quiz-answer { text-align: center; margin: 14px 0 6px; font-size: 18px; }
.quiz-answer.ok b { color: var(--success); } .quiz-answer.no b { color: var(--error); }
.lb { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lb li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.03); border: 1px solid var(--border); }
.lb li.me { border-color: rgba(76,77,255,.5); background: rgba(76,77,255,.10); }
.lb-rank { width: 22px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; text-align: center; }
.lb li:nth-child(1) .lb-rank { color: #FFC24B; } .lb li:nth-child(2) .lb-rank { color: #C8CCD6; } .lb li:nth-child(3) .lb-rank { color: #D2905A; }
.lb-user { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.lb-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.buzzer { width: 160px; height: 160px; max-width: 100%; border-radius: 50%; border: 0; background: var(--grad); color: #fff; font-size: 22px; font-weight: 800; letter-spacing: -.02em; cursor: pointer; box-shadow: 0 12px 40px rgba(76,77,255,.4); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; transition: transform .1s var(--ease); }
.buzzer .ico { width: 30px; height: 30px; } .buzzer:active { transform: scale(.94); }
.pq-scores .chip.me { border-color: rgba(76,77,255,.6); background: rgba(76,77,255,.14); color: var(--text); }

/* ---------- 노래방 모드 ---------- */
body.live .side, body.live .top, body.live .tabbar { display: none !important; }
body.live .main { max-width: 1100px; padding: 12px 14px calc(16px + env(safe-area-inset-bottom)); }
body.live .toasts { bottom: 20px; left: 0; }
.live-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.live-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.live-title b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-title span { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 900px) { .live-body { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; } }
.live-card { border-radius: 20px; padding: 18px; background: linear-gradient(180deg, rgba(76,77,255,.10), rgba(255,255,255,.03)); border: 1px solid rgba(76,77,255,.25); }
.live-card.together { background: linear-gradient(180deg, rgba(56,217,150,.12), rgba(255,255,255,.03)); border-color: rgba(56,217,150,.3); }
@media (min-width: 900px) { .live-card { padding: 26px; } }
.live-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.live-head .timer { margin-left: auto; font-variant-numeric: tabular-nums; }
.live-who { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--grad); color: #fff; font-weight: 600; font-size: 13px; }
.live-who.together { background: rgba(56,217,150,.18); color: var(--success); border: 1px solid rgba(56,217,150,.4); }
.live-who .ico { width: 15px; height: 15px; }
.live-main { display: flex; gap: 16px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.live-art { width: 110px; height: 110px; border-radius: 16px; object-fit: cover; background: var(--surface-elevated); flex-shrink: 0; }
@media (min-width: 600px) { .live-art { width: 150px; height: 150px; } }
.live-meta { flex: 1; min-width: 200px; }
.live-song { font-size: clamp(24px, 6vw, 40px); line-height: 1.15; margin: 0; letter-spacing: -.03em; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.live-artist { font-size: clamp(15px, 3vw, 20px); color: var(--text-secondary); margin: 6px 0 12px; overflow-wrap: anywhere; }
.knums { display: flex; gap: 10px; flex-wrap: wrap; }
.knum { display: flex; flex-direction: column; padding: 8px 14px; border-radius: 12px; background: rgba(0,0,0,.35); border: 1px solid var(--border-hover); min-width: 90px; }
.knum span { font-size: 11px; letter-spacing: .1em; color: var(--text-muted); font-weight: 600; }
.knum b { font-size: clamp(22px, 5vw, 34px); font-family: Inter, var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; }
.live-chips { margin-top: 14px; }
.live-note { display: flex; gap: 6px; align-items: flex-start; margin-top: 10px; font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.live-note .ico { color: var(--warning); flex-shrink: 0; margin-top: 3px; }
.live-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.live-actions .btn-lg { flex: 1 1 160px; }
.live-actions .btn-ghost { flex: 1 1 100%; }
@media (min-width: 600px) { .live-actions .btn-ghost { flex: 0 0 auto; } }
.live-side .card-title { margin-top: 4px; }
.live-all { margin-top: 12px; }
.live-all summary { cursor: pointer; font-size: 13px; color: var(--text-secondary); padding: 6px 0; }
.live-all .list { margin-top: 8px; max-height: 50vh; overflow-y: auto; }

/* ---------- 광고 / 쿠키 / 언어 / 푸터 ---------- */
.ad { position: relative; margin: 18px 0 0; min-height: 90px; border-radius: 12px; border: 1px dashed var(--border); background: rgba(255,255,255,.02); overflow: hidden; }
.ad-label { position: absolute; top: 6px; left: 8px; font-size: 10px; letter-spacing: .1em; color: var(--text-muted); z-index: 1; }
.ad-mt { margin-top: 16px; }
.ad ins { min-height: 90px; }
.cookie { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom)); z-index: 2500; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(20,22,31,.96); border: 1px solid var(--border-hover); backdrop-filter: blur(16px); font-size: 13px; color: var(--text-secondary); max-width: 720px; margin: 0 auto; }
.cookie.hidden { display: none; }
.cookie span { flex: 1; min-width: 0; line-height: 1.45; }
.cookie a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 900px) { .cookie { bottom: 20px; left: calc(var(--side-w) + 20px); right: 20px; } }
.lang-row { display: flex; align-items: center; gap: 4px; padding: 8px 12px 2px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.lang-row .ico { width: 14px; height: 14px; margin-right: 4px; }
.lang-row a { padding: 3px 7px; border-radius: 6px; }
.lang-row a.active { background: rgba(255,255,255,.08); color: var(--text); }
.footer-lang { margin-left: auto; display: inline-flex; gap: 8px; }
.footer-lang a.active { color: var(--text); font-weight: 600; }
.lang-btn { margin-left: auto; }
.top .lang-btn + .btn, .top .lang-btn + .btn-icon { margin-left: 0; }

/* ---------- 문서 페이지 (소개/문의) ---------- */
.doc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 16px; }
@media (min-width: 720px) { .doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.doc-grid .card b { display: block; margin-bottom: 4px; }
.doc-grid .card p { margin: 0; font-size: 13.5px; color: var(--text-secondary); line-height: 1.55; }
.doc-body ul { padding-left: 20px; } .doc-body li { margin: 4px 0; }
.doc-body p { margin: 8px 0; }
body.live .cookie { display: none; }

/* Product refresh — shared surfaces, navigation and discovery */
:root { --text-muted: #9399a9; --side-w: 232px; --top-h: 68px; }
body { background: var(--bg); }
:focus-visible { outline: 2px solid #98a5ff; outline-offset: 4px; }
.main:focus { outline: none; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 4000; padding: 12px 20px; background: var(--surface-elevated); border-radius: 10px; }
.skip-link:focus-visible { top: 12px; }
.side { overflow-y: auto; }
.side .brand { letter-spacing: -.7px; }
.side .nav-item { margin-bottom: 4px; flex-shrink: 0; }
.side .nav-item.active { background: #202039; color: #e4e3ff; }
.nav-item.active .ico, .tabbar a.active .ico { color: #a29cff; }
.side-sec { padding-top: 24px; padding-bottom: 12px; }
.side-tip { margin: auto 0 20px; padding: 18px 14px; border: 1px solid var(--border); border-radius: 12px; background: #14151f; }
.side-tip > .ico { display: block; color: #aaa4f7; margin-bottom: 12px; }
.side-tip b { display: block; font-size: 12px; }
.side-tip p { font-size: 12px; color: var(--text-muted); margin: 6px 0 14px; }
.side-tip a { font-size: 12px; color: #b6b1ff; display: flex; align-items: center; justify-content: space-between; }
.side-foot { margin-top: 0; }
.top-context { color: var(--text-muted); font-size: 13px; }
.mobile-menu { position: relative; }
.mobile-menu summary { list-style: none; display: grid; place-items: center; height: 44px; width: 40px; cursor: pointer; }
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu nav { position: absolute; top: 50px; right: -90px; width: 220px; padding: 8px; background: var(--surface-elevated); border: 1px solid var(--border-hover); border-radius: 14px; box-shadow: 0 16px 48px #0008; }
.mobile-menu nav a { display: block; padding: 12px; border-radius: 8px; font-size: 14px; }
.mobile-menu nav a:hover { background: var(--surface-hover); }
.page-head { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.page-head h1 { line-height: 1.3; }
.sub { line-height: 1.7; margin-top: 9px; }
.card { background: #13151d; border-color: #252732; padding: 22px; }
.card-title { font-size: 17px; }
.section { margin-top: 38px; }
.section-head { margin-bottom: 20px; align-items: center; }
.section-head > a { white-space: nowrap; font-size: 12px; gap: 7px; }
.card .section-head { margin-bottom: 0; }
.card .section-head .card-title { margin: 0; }
.input, .select { border-color: #353746; }
.select { background-position: right 10px center; background-size: 14px; }
.song { padding: 12px; min-height: 72px; }
.song-play { border: 0; background: transparent; cursor: pointer; }
.empty { padding: 32px 16px; min-height: 174px; }
.empty > .ico { color: #b0aaf9; width: 32px; height: 32px; margin-bottom: 8px; }
.empty span { color: var(--text-secondary); }
.tiles > .empty { grid-column: 1 / -1; width: 100%; border: 1px dashed var(--border-hover); border-radius: 16px; }
.tile:focus-visible .tile-play, .tile:focus-within .tile-play { opacity: 1; transform: none; }
.tile-placeholder { height: 12px; margin-top: 12px; width: 70%; border-radius: 4px; }
.tiles .tile-art { background: linear-gradient(145deg, #2b2940, #191c29); }
.tabs { gap: 8px; }
.tab { min-height: 44px; }
.footer { margin-top: 52px; padding-top: 24px; padding-bottom: 12px; }
.home-welcome { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.home-welcome > span { font-size: 14px; color: #c7cad4; }
.home-welcome .chip { background: transparent; border: 0; padding: 0; font-size: 11px; }
.home-welcome .chips { gap: 12px; }
.eyebrow { display: block; color: #a7a0db; font-size: 10px; font-weight: 600; letter-spacing: 2px; margin-bottom: 10px; }
.discovery-hero { display: grid; grid-template-columns: 1.35fr 1fr; position: relative; overflow: hidden; background: linear-gradient(110deg, #1c1c32, #1c1b2a 65%, #29203a); border: 1px solid #393345; border-radius: 20px; min-height: 350px; align-items: center; }
.discovery-copy { padding: 40px; z-index: 1; }
.discovery-copy h1 { font-size: clamp(28px, 3vw, 43px); line-height: 1.35; letter-spacing: -1.7px; word-break: keep-all; }
.discovery-copy h1 span { color: #b5a7ff; }
.discovery-copy p { font-size: 14px; line-height: 1.85; color: #b9b6c9; max-width: 430px; margin: 18px 0 24px; word-break: keep-all; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions .btn { font-size: 13px; padding: 0 18px; }
.hero-note { display: flex; gap: 7px; align-items: center; font-size: 11px; color: #a8a3ba; margin-top: 18px; }
.hero-note .ico { color: #b0a9da; }
.record-scene { position: relative; height: 320px; margin-right: 30px; }
.record-sleeve { position: absolute; width: 218px; height: 244px; top: 30px; left: 0; background: #b0a3de; color: #29223f; padding: 22px; z-index: 2; transform: rotate(-9deg); border: 1px solid #d3c6ed; overflow: hidden; box-shadow: 10px 18px 25px #0003; }
.record-sleeve > span { font-size: 48px; font-weight: 700; line-height: .95; letter-spacing: -3px; }
.record-sleeve small { display: block; margin-top: 12px; font-size: 7px; letter-spacing: 1.8px; }
.sleeve-lines { width: 300px; height: 130px; position: absolute; bottom: -25px; left: -40px; border-radius: 50%; border: 1px solid #554a78; box-shadow: 0 -7px 0 #b0a3de, 0 -8px 0 #554a78, 0 -15px 0 #b0a3de, 0 -16px 0 #554a78, 0 -23px 0 #b0a3de, 0 -24px 0 #554a78, 0 -31px 0 #b0a3de, 0 -32px 0 #554a78; transform: rotate(-18deg); }
.vinyl { position: absolute; width: 248px; height: 248px; top: 34px; right: -12px; border-radius: 50%; background: repeating-radial-gradient(circle, #18171e 0 2px, #302e38 3px, #18171e 4px); border: 3px solid #393540; display: grid; place-items: center; transform: rotate(14deg); }
.vinyl::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(transparent, #ffffff12, transparent 25%, #ffffff10, transparent 60%); }
.vinyl-label { border-radius: 50%; width: 94px; height: 94px; background: #b1a4df; color: #211c33; display: flex; align-items: center; justify-content: center; flex-direction: column; font-size: 36px; font-weight: 700; letter-spacing: -3px; }
.vinyl-label span { font-size: 5px; letter-spacing: .5px; }
.record-caption { position: absolute; bottom: 8px; left: 15px; right: 0; display: flex; align-items: center; gap: 8px; font-size: 8px; letter-spacing: 1.6px; color: #c4bbd4; }
.record-caption > span:last-child { margin-left: auto; font-size: 17px; }
.record-dot { width: 5px; height: 5px; border-radius: 50%; background: #b6a6e8; }
.start-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border-bottom: 1px solid var(--border); padding: 24px 0; }
.start-steps a { display: flex; gap: 14px; align-items: center; padding: 0 22px; border-right: 1px solid var(--border); }
.start-steps a:first-child { padding-left: 0; }
.start-steps a:last-child { border: 0; }
.step-no { color: #847baf; font-size: 20px; font-weight: 500; }
.start-steps b { display: block; font-size: 13px; font-weight: 500; }
.start-steps div > span { display: block; font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.start-steps a > .ico { margin-left: auto; color: #85808f; }
.start-steps a:hover b { color: #bbb1ff; }
.small-label { font-size: 10px; background: #25223a; color: #bab1ef; border-radius: 5px; padding: 4px 8px; }
.quick-controls { margin: 20px 0 14px; }
.quick-controls label { font-size: 13px; color: var(--text-secondary); }
.quick-controls .select { min-width: 80px; flex: 1; }
.quick-controls .btn { flex: 1; }
#quick-gacha { scroll-margin-top: 90px; }
#lib-area { margin-top: 18px; }
.experience-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.experience-card { position: relative; padding: 22px 20px 38px; }
.experience-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.experience-top > span:last-child { font-size: 8px; letter-spacing: 1.4px; color: var(--text-muted); }
.experience-top .ico-box { display: grid; place-items: center; width: 38px; height: 38px; background: #26213a; color: #b5a4e5; border-radius: 10px; }
.experience-card:nth-child(2) .ico-box { background: #1e2b36; color: #9cbfda; }
.experience-card:nth-child(3) .ico-box { background: #302824; color: #d7b392; }
.experience-card:nth-child(4) .ico-box { background: #25312e; color: #9fc8b8; }
.experience-card h3 { font-size: 16px; }
.experience-card p { font-size: 12px; color: var(--text-muted); line-height: 1.7; margin: 8px 0; word-break: keep-all; }
.experience-arrow { position: absolute; right: 20px; bottom: 16px; color: var(--text-muted); }
@media (min-width: 900px) {
    .top { display: flex; padding: 0 36px; background: #0d0e14e8; }
    .top .brand, .mobile-menu { display: none; }
    .main { max-width: 1420px; padding: 28px 36px 48px; }
    .side { padding-top: 28px; gap: 2px; }
    .side-tip { margin-top: 40px; }
    .side-foot { margin-top: auto; }
    .tiles { grid-template-columns: repeat(6,minmax(0,1fr)); gap: 18px; }
    .tile-title { font-size: 14px; margin-top: 12px; }
    .tile-sub { margin-top: 5px; }
}
@media (max-width: 1150px) and (min-width: 900px) {
    :root { --side-w: 210px; }
    .main { padding: 24px; }
    .discovery-copy { padding: 28px; }
    .record-scene { transform: scale(.78); transform-origin: center right; margin-right: 10px; }
    .discovery-hero { grid-template-columns: 1.4fr 1fr; }
    .hero-actions .btn { padding: 0 12px; }
    .experience-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .start-steps a { padding: 0 12px; gap: 9px; }
}
@media (max-width: 899px) {
    .top-context { display: none; }
    .top { gap: 5px; }
    .top .lang-btn { margin-left: 0; }
    .main { padding-top: 22px; }
    .discovery-copy { padding: 28px; }
    .discovery-copy h1 { font-size: 34px; }
    .record-scene { transform: scale(.85); transform-origin: right center; margin-right: 20px; }
    .experience-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .tiles { grid-auto-columns: 160px; gap: 16px; }
    .tile-play { opacity: 1; transform: none; }
    .btn-icon { min-width: 44px; min-height: 44px; }
    .home-welcome { flex-wrap: wrap; gap: 8px; }
    .footer-lang { width: 100%; margin-left: 0; }
}
@media (max-width: 650px) {
    .discovery-hero { display: flex; flex-direction: column; align-items: stretch; }
    .discovery-copy { padding: 28px 22px 12px; }
    .discovery-copy h1 { font-size: 31px; letter-spacing: -1.2px; }
    .discovery-copy p { font-size: 13px; margin: 14px 0 20px; }
    .hero-actions { gap: 8px; }
    .hero-actions .btn { padding: 0 12px; font-size: 12px; }
    .record-scene { width: 300px; height: 252px; align-self: center; transform: scale(.83); margin: -5px 0 0; transform-origin: center center; }
    .record-sleeve { top: 6px; height: 218px; }
    .vinyl { top: 12px; height: 218px; width: 218px; }
    .record-caption { bottom: -10px; }
    .start-steps { padding: 16px 0; gap: 16px; grid-template-columns: 1fr; }
    .start-steps a, .start-steps a:first-child { border: 0; padding: 0 6px; }
    .start-steps a div { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
    .start-steps div > span { margin: 0; font-size: 10px; }
    .step-no { font-size: 15px; }
    .section { margin-top: 30px; }
    .section-head { gap: 8px; }
    .section-head .sub { font-size: 12px; }
    .card { padding: 18px; }
    .experience-card { padding-bottom: 36px; }
    .experience-top { margin-bottom: 18px; }
    .experience-top > span:last-child { font-size: 7px; letter-spacing: .5px; }
    .cookie { align-items: flex-start; font-size: 11px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* ---------- 공유 카드 / 홈 화면 추가 ---------- */
.share-card { width: 240px; height: 240px; max-width: 100%; border-radius: 16px; border: 1px solid var(--border); margin: 8px auto 0; display: block; }
.install { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom)); z-index: 2400; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(20,22,31,.96); border: 1px solid var(--border-hover); backdrop-filter: blur(16px); font-size: 13px; color: var(--text-secondary); max-width: 560px; margin: 0 auto; }
.install.hidden { display: none; }
.install > .ico { color: var(--indigo); flex-shrink: 0; }
.install span { flex: 1; min-width: 0; line-height: 1.45; }
.install b { color: var(--text); }
.install em { display: block; font-style: normal; color: var(--text-muted); font-size: 12px; }
@media (min-width: 900px) { .install { bottom: 20px; left: calc(var(--side-w) + 20px); right: auto; } }
#lib-chip .link { margin-left: 6px; font-size: 12px; }
/* ---------- AI 추정 / 취향 분석 ---------- */
.ai-box { margin-top: 14px; padding: 12px 14px; border-radius: 12px; border: 1px dashed rgba(76,77,255,.45); background: rgba(76,77,255,.06); }
.ai-box > .caption { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.ai-box > .caption .ico { color: var(--indigo); width: 14px; height: 14px; }
.ai-box > .caption span { color: var(--text-muted); }
.an-hero { text-align: center; padding: 6px 0 4px; }
.an-lines { list-style: none; margin: 12px auto; padding: 0; max-width: 560px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.an-hero .chips { justify-content: center; }
.bar { display: grid; grid-template-columns: 64px 1fr 32px; align-items: center; gap: 8px; margin: 4px 0; font-size: 12.5px; color: var(--text-secondary); }
.bar i { display: block; height: 8px; border-radius: 4px; background: var(--grad); min-width: 4px; }
.bar b { text-align: right; font-variant-numeric: tabular-nums; }
#an-picks .list-title { justify-content: flex-start; gap: 6px; } #an-picks .list-title .ico { color: var(--indigo); }
