/* 온오프뮤직 좁은 화면(휴대폰, 세로 태블릿). aura.css 뒤에 부른다.
   - 왼쪽 메뉴는 서랍으로 들어가고, 자주 쓰는 다섯 곳은 아래 탭에 둔다.
   - 플레이어는 탭 위의 작은 막대가 되고, 누르면 화면 가득 펼쳐진다.
   - 넓은 화면에서는 이 파일이 더하는 단추와 탭이 모두 숨는다. */
.icon-btn { width:44px; height:44px; flex:none; border:0; border-radius:22px; background:transparent; color:var(--text); display:none; align-items:center; justify-content:center; }
.icon-btn:hover { background:color-mix(in srgb, var(--surface2) 60%, transparent); }
.top-logo, .tabbar, .pl-close, .drawer-logout, .theme-slot, .scrim { display:none; }
.player { --p:0%; }

@media (max-width:860px) {
  :root { --tab-h:62px; --player-h:66px; --safe:env(safe-area-inset-bottom, 0px); }
  .app { display:block; }
  .app > .main { min-height:100vh; min-height:100dvh; }

  /* ---------- 서랍 메뉴 ---------- */
  .side { position:fixed; left:0; top:0; bottom:0; z-index:30; width:min(304px, 84vw); height:auto !important; flex-direction:column; flex-wrap:nowrap; align-items:stretch; gap:6px;
    padding:calc(20px + env(safe-area-inset-top, 0px)) 16px calc(22px + var(--safe)); overflow:auto; transform:translateX(-104%); visibility:hidden;
    background:color-mix(in srgb, var(--nav) 93%, transparent); border-right:1px solid var(--hair); box-shadow:24px 0 60px rgba(0,0,0,.45); }
  body.menu-open .side { transform:none; visibility:visible; }
  body.menu-open { overflow:hidden; }
  .side .nav { flex-direction:column; flex-wrap:nowrap; }
  .side .nav a { height:48px; }
  .tagline { display:block; }
  .support-box, .visits, .legal { display:flex; }
  .visits[hidden] { display:none; }
  .side .theme { align-self:flex-start; margin:10px 4px 0; }
  .drawer-logout { display:block; align-self:flex-start; height:44px; margin:2px 0 0; padding:0 14px; border:0; border-radius:12px; background:transparent; color:var(--muted); font-size:15px; }
  .drawer-logout[hidden] { display:none; }
  .scrim { display:block; position:fixed; inset:0; z-index:29; background:rgba(8,10,14,.58); }
  .scrim[hidden] { display:none; }

  /* ---------- 위쪽 바: 메뉴, 로고, 검색, 알림, 내 사진 ---------- */
  .top { padding:calc(8px + env(safe-area-inset-top, 0px)) 10px 8px; gap:2px; flex-wrap:wrap; }
  .menu-btn, .search-open { display:flex; }
  .top-logo { display:flex; gap:8px; padding:0 4px; }
  .top-logo span { font-size:21px; }
  .top-upload { display:none; }
  .top .search { display:none; order:10; flex:1 0 100%; max-width:none; min-width:0; margin:6px 2px 2px; }
  .top.searching .search { display:flex; }
  .account { min-height:44px; gap:2px; }
  .account .me { padding:0 4px; }
  .account .me span, .top-logout, .wide-only { display:none; }
  .account .btn.kakao { height:40px; padding:0 16px; font-size:15px; margin-left:4px; }
  .bell { width:44px; height:44px; }
  .bell-panel { position:fixed; left:10px; right:10px; top:calc(62px + env(safe-area-inset-top, 0px)); width:auto; max-width:none; }
  .bell-list { max-height:min(420px, 56vh); }

  /* ---------- 본문 ---------- */
  .view { padding:18px 16px calc(28px + var(--tab-h) + var(--safe)); gap:34px; }
  body.has-player .view { padding-bottom:calc(28px + var(--tab-h) + var(--player-h) + var(--safe)); }
  .title { font-size:28px; }
  .h2 { font-size:20px; }
  .lead { font-size:16px; }
  .card { padding:18px; border-radius:18px; }
  .card:has(> .song-table) { overflow-x:auto; }
  .tabs { max-width:100%; overflow-x:auto; scrollbar-width:none; }
  .tabs::-webkit-scrollbar { display:none; }
  .tabs a { padding:0 14px; white-space:nowrap; }
  .shot { width:100%; }
  .amb-phones { width:124vw; right:-48vw; top:5vh; }
  :root:not([data-theme=light]) .amb-phones { width:110vw; right:-34vw; top:16vh; opacity:.42; }
  .amb-wave, body.has-player .amb-wave { bottom:0; height:150px; }
  .toast { bottom:calc(var(--tab-h) + var(--safe) + 14px); max-width:calc(100vw - 32px); width:max-content; text-align:center; }
  body.has-player .toast { bottom:calc(var(--tab-h) + var(--player-h) + var(--safe) + 14px); }

  /* 무대: 커버를 위에, 글을 아래에 쌓는다. */
  .stage-body { flex-direction:column; align-items:flex-start; padding:22px 20px 24px; gap:18px; }
  .stage-art { width:min(50vw, 210px); }
  .stage-text { min-width:0; width:100%; gap:12px; }
  .stage h1 { font-size:clamp(28px, 8.4vw, 40px); }
  .stage-kicker { font-size:13px; }
  .stage::before, .stage:has(.stage-bg.flat)::before { width:86%; right:-18%; top:0; bottom:auto; height:300px; background-size:auto 100%; background-position:right center; }
  .empty-stage .stage-body { padding:36px 20px; }
  .facts { gap:8px 22px; }

  /* 커버 칸: 홈에서는 옆으로 넘기고, 다른 곳에서는 두 줄 칸으로. */
  .shelf { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:22px 14px; }
  .shelf.swipe { display:flex; gap:14px; overflow-x:auto; scroll-snap-type:x proximity; margin:0 -16px; padding:0 16px 6px; scroll-padding-left:16px; scrollbar-width:none; }
  .shelf.swipe::-webkit-scrollbar { display:none; }
  .shelf.swipe .cv { flex:0 0 42vw; max-width:190px; scroll-snap-align:start; }

  /* 곡 줄: 순위 숫자는 그대로 보이고, 숫자나 커버를 누르면 재생된다. */
  .tracks { padding:4px; border-radius:16px; }
  .tracks li { grid-template-columns:30px 44px minmax(0,1fr) auto; gap:10px; padding:8px 8px 8px 6px; }
  .tracks li .tk-num, .tracks li:hover .tk-num { visibility:visible; }
  .tracks li .tk-play { opacity:1; inset:0 auto 0 0; margin:auto 0; width:86px; height:44px; border-radius:8px; background:transparent; color:var(--primary); justify-content:flex-start; padding-left:7px; box-shadow:none; }
  .tracks li .tk-play svg { opacity:0; }
  .tracks li .tk-play.on svg, .tracks li .tk-n > .tk-play:only-child svg { opacity:1; }
  .tracks li .tk-n:has(.tk-play.on) .tk-num { visibility:hidden; }
  .col-side .tracks li { grid-template-columns:30px 44px minmax(0,1fr) auto; }
  .songs li { gap:10px; }
  .rank { width:30px; font-size:20px; }
  .song-title { font-size:16px; }
  .likes { width:auto; font-size:13px; }
  .songs .play { width:40px; height:40px; }
  .songs li > .cover { width:48px !important; height:48px !important; }
  .songs .song-title, .songs .song-sub { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

  /* ---------- 아래 탭 ---------- */
  .tabbar { display:grid; grid-template-columns:repeat(5, 1fr); position:fixed; left:0; right:0; bottom:0; z-index:11; height:calc(var(--tab-h) + var(--safe)); padding:0 4px var(--safe);
    background:color-mix(in srgb, var(--nav) 84%, transparent); backdrop-filter:blur(22px) saturate(1.3); -webkit-backdrop-filter:blur(22px) saturate(1.3); border-top:1px solid var(--hair); }
  .tabbar a { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; font-size:12px; font-weight:500; color:var(--muted); text-decoration:none; white-space:nowrap; }
  .tabbar a[aria-current=page] { color:var(--primary); font-weight:700; }
  .tab-up i { width:46px; height:30px; border-radius:15px; background:var(--primary); color:var(--onprimary); display:flex; align-items:center; justify-content:center; box-shadow:0 6px 18px color-mix(in srgb, var(--primary) 40%, transparent); }
  .tabbar .tab-up, .tabbar .tab-up[aria-current=page] { color:var(--text); }

  /* ---------- 작은 플레이어 ---------- */
  .player { left:8px; right:8px; bottom:calc(var(--tab-h) + var(--safe) + 6px); min-height:0; height:58px; padding:0 8px; gap:8px; flex-wrap:nowrap; overflow:hidden;
    border:1px solid rgba(255,255,255,.1); border-radius:16px; background:rgba(26,30,39,.9); box-shadow:0 14px 34px -10px rgba(0,0,0,.6); }
  .player::before { display:none; }
  .player::after { content:''; position:absolute; left:0; bottom:0; height:2px; width:var(--p); background:#6EA8FF; }
  .player #pl-prev, .player .pl-time, .player .pl-seek, .player .pl-vol, .player .pl-vol-icon, .player .pl-queue-btn, .player .pl-queue { display:none; }
  .pl-cover { width:42px; height:42px; border-radius:10px; cursor:pointer; }
  .pl-meta { flex:1; width:auto; min-width:0; }
  .pl-meta:hover { text-decoration:none; }
  .pl-meta strong { font-size:15px; }
  .player .pl-btn.main { width:42px; height:42px; border-radius:21px; }

  /* ---------- 펼친 플레이어 ---------- */
  body.player-full { overflow:hidden; }
  .player.full { left:0; right:0; top:0; bottom:0; height:auto; z-index:40; border:0; border-radius:0; overflow:auto; box-shadow:none;
    display:grid; grid-template-columns:1fr auto 1fr; grid-auto-rows:min-content; align-content:start; column-gap:26px; row-gap:0;
    grid-template-areas:"close close close" "cover cover cover" "meta meta meta" "seek seek seek" "time . dur" "prev toggle next" "qbtn qbtn qbtn" "queue queue queue";
    padding:calc(10px + env(safe-area-inset-top, 0px)) 26px calc(26px + var(--safe));
    background:radial-gradient(90% 46% at 80% 0%, rgba(74,130,240,.3), transparent 72%), linear-gradient(180deg, #1A2030, #121419 62%); animation:none; }
  .player.full::after { display:none; }
  /* 펼친 화면에도 헤드폰이 연하게 걸린다. */
  .player.full::before { content:''; display:block; position:absolute; z-index:-1; left:auto; right:-110px; top:-20px; width:440px; height:454px; opacity:.5; mix-blend-mode:screen;
    background:url(/img/headphones-photo.webp) center / contain no-repeat;
    -webkit-mask:radial-gradient(closest-side, #000 50%, transparent 100%); mask:radial-gradient(closest-side, #000 50%, transparent 100%); }
  .player.full .pl-close { grid-area:close; justify-self:start; display:flex; align-items:center; gap:6px; height:44px; margin-left:-10px; padding:0 14px 0 8px; border:0; border-radius:22px; background:transparent; color:#CFD5E2; font-size:15px; }
  .player.full .pl-cover { grid-area:cover; justify-self:center; width:min(78vw, 340px, 44vh); height:auto; aspect-ratio:1; margin:18px 0 28px; border-radius:24px; box-shadow:0 30px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.08); cursor:default; }
  .player.full .pl-eq { display:none; }
  .player.full .pl-meta { grid-area:meta; text-align:center; gap:4px; }
  .player.full .pl-meta strong { font-size:23px; font-weight:750; letter-spacing:-0.02em; white-space:normal; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
  .player.full .pl-meta span { font-size:15px; }
  .player.full .pl-seek { grid-area:seek; display:block; width:100%; min-width:0; height:32px; margin-top:22px; }
  .player.full .pl-time { display:block; width:auto; font-size:13px; }
  .player.full #pl-time { grid-area:time; justify-self:start; }
  .player.full #pl-dur { grid-area:dur; justify-self:end; }
  .player.full #pl-prev { grid-area:prev; display:flex; justify-self:end; }
  .player.full #pl-next { grid-area:next; justify-self:start; }
  .player.full #pl-prev, .player.full #pl-next { width:56px; height:56px; border-radius:28px; margin-top:16px; }
  .player.full #pl-prev svg, .player.full #pl-next svg { width:28px; height:28px; }
  .player.full #pl-toggle { grid-area:toggle; width:72px; height:72px; border-radius:36px; margin-top:8px; }
  .player.full #pl-toggle svg { width:28px; height:28px; }
  .player.full .pl-queue-btn { grid-area:qbtn; display:block; justify-self:center; margin-top:24px; }
  .player.full .pl-queue { grid-area:queue; display:block; position:static; width:auto; max-height:none; margin-top:12px; box-shadow:none; background:rgba(255,255,255,.05); }
  .player.full .pl-queue[hidden] { display:none; }
}

@media (max-width:860px) and (prefers-reduced-motion:no-preference) {
  .side { transition:transform .38s var(--expo), visibility 0s linear .38s; }
  body.menu-open .side { transition:transform .38s var(--expo), visibility 0s; }
  .scrim { animation:scrim-in .25s ease-out; }
  @keyframes scrim-in { from { opacity:0; } }
  .player.full { animation:full-in .42s var(--expo); }
  @keyframes full-in { from { transform:translateY(8%); opacity:0; } }
  .tabbar a { transition:color .15s; }
  .tab-up i { transition:transform .25s var(--back); }
  .tab-up:active i { transform:scale(.92); }
}
