/* APPLE: Mobile-first layout - top nav, pages, bottom nav, mini player */

:root {
  --ui-bg: rgba(255,255,255,0.95);
  --ui-border: rgba(0,0,0,0.08);
  --ink: #0b1220;
  --muted: #64748b;
  --brand: #111827;
  --accent: #22c55e;
}

body { margin:0; overflow-x:hidden; }

/* Top Nav */
#topNav { position:sticky; top:0; z-index:100; background:var(--ui-bg); border-bottom:1px solid var(--ui-border); backdrop-filter:blur(10px); height: 69px; }
.nav-inner { max-width:1400px; margin:0 auto; padding:0 18px; display:flex; align-items:center; gap:16px; flex-wrap:wrap; height:100%; }
.nav-brand { font-weight:900; font-size:22px; letter-spacing:0.2px; margin-right:auto; }
.nav-btn { height:40px; padding:0 16px; border-radius:10px; border:1px solid var(--ui-border); background:#fff; font-weight:600; cursor:pointer; }
.nav-btn.primary { background:var(--brand); color:#fff; border-color:var(--brand); }
.nav-btn.success { background:var(--accent); color:#fff; border-color:var(--accent); }
.nav-badge { padding:4px 10px; border-radius:8px; font-size:13px; font-weight:600; background:rgba(34,197,94,.1); color:var(--accent); }

/* Pages */
#pages { position:relative; z-index:1; padding-bottom:160px; /* bottom nav + mini player */ }
.page { display:none; padding:16px; }
.page.active { display:block; }

/* Bottom nav */
#bottomNav { position:fixed; left:0; right:0; bottom:0; height:64px; background:#fff; border-top:1px solid var(--ui-border); display:flex; justify-content:space-around; align-items:center; z-index:140; padding-bottom:env(safe-area-inset-bottom); }
#bottomNav button { appearance:none; background:transparent; border:none; font-weight:800; font-size:14px; color:#64748b; padding:8px 10px; border-radius:10px; }
#bottomNav button.active { color:#0b1220; background:#f3f4f6; }

/* Home */
.home-card { background:#fff; border:1px solid var(--ui-border); border-radius:16px; padding:18px; margin-bottom:14px; }
.setup-btn { height:52px; padding:0 18px; border-radius:12px; border:1px solid var(--ui-border); background:#fff; font-weight:700; font-size:16px; cursor:pointer; display:flex; align-items:center; justify-content:space-between; transition:all 0.2s; }
.setup-btn:disabled { opacity:0.5; cursor:not-allowed; }
.setup-btn.primary { background:var(--brand); color:#fff; border-color:var(--brand); }
.setup-btn:active:not(:disabled) { transform:scale(0.98); }
.setup-input { height:52px; padding:0 18px; border-radius:12px; border:1px solid var(--ui-border); background:#fff; font-size:16px; width:100%; box-sizing:border-box; display:block; }

/* Song Room mini button */
.mini-room { height:44px; min-width:64px; border-radius:999px; border:1px solid var(--ui-border); background:#111827; color:#fff; font-weight:800; padding:0 14px; }

.panel { display:none; }
.panel.active { display:block; }

/* Search */
.search-bar { margin-bottom:20px; }
.search-input { width:100%; height:48px; border-radius:12px; border:1px solid var(--ui-border); padding:0 16px; font-size:16px; background:#fff; }
.result-group { margin-top:20px; }
.result-header { font-weight:800; color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:0.5px; margin:12px 4px 12px; }
.result-row { display:flex; align-items:center; gap:14px; padding:12px; border-radius:12px; border:1px solid var(--ui-border); background:#fff; margin-bottom:10px; transition:all 0.2s; }
.result-row:hover { box-shadow:0 4px 12px rgba(0,0,0,0.08); transform:translateY(-1px); }
.result-cover { width:60px; height:60px; border-radius:10px; background:#e5e7eb; background-size:cover; background-position:center; flex-shrink:0; }
.result-meta { flex:1; min-width:0; }
.result-title { font-weight:700; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:15px; }
.result-sub { font-size:13px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:2px; }
.result-actions { display:flex; gap:8px; flex-shrink:0; }
.btn-sm { height:40px; padding:0 14px; border-radius:10px; border:1px solid var(--ui-border); background:#fff; font-weight:700; cursor:pointer; transition:all 0.2s; }
.btn-sm:hover { background:#f9fafb; }
.btn-sm.primary { background:var(--brand); color:#fff; border-color:var(--brand); }
.btn-sm.primary:hover { background:#0a0f19; }

/* Rails (Browse) */
.section-title { font-weight:900; font-size:22px; margin:24px 0 16px; letter-spacing:0.2px; }
.rail { display:flex; gap:16px; overflow-x:auto; padding-bottom:8px; }
.rail::-webkit-scrollbar { height:6px; }
.rail::-webkit-scrollbar-thumb { background:rgba(0,0,0,0.2); border-radius:3px; }
.card { min-width:180px; max-width:180px; cursor:pointer; transition:transform 0.2s; }
.card:hover { transform:translateY(-4px); }
.card .art { width:180px; height:180px; border-radius:12px; background:#e5e7eb; background-size:cover; background-position:center; box-shadow:0 4px 16px rgba(0,0,0,0.1); }
.card .title { font-weight:700; margin-top:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:14px; }
.card .sub { color:var(--muted); font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:2px; }
.card .row { display:flex; gap:8px; margin-top:10px; }

/* Live Now */
.live-row { display:flex; align-items:center; gap:14px; padding:12px; border:1px solid var(--ui-border); border-radius:12px; background:#fff; margin-bottom:10px; transition:all 0.2s; }
.live-row:hover { box-shadow:0 4px 12px rgba(0,0,0,0.08); }
.live-art { width:60px; height:60px; border-radius:10px; background-size:cover; background-position:center; flex-shrink:0; }
.live-meta { flex:1; min-width:0; }

/* Map page */
#page-map { display:none; padding:0; height:calc(100vh - 69px - 64px); }
#page-map.active { display:block; }
#mapPageContainer { width:100%; height:100%; }

/* Blurred album background */
#albumBg { position:fixed; inset:0; background-size:cover; background-position:center; filter:blur(60px) saturate(1.2); opacity:0.35; z-index:0; transition:opacity 0.4s; }
.albumOverlay { position:fixed; inset:0; background:linear-gradient(180deg, rgba(255,255,255,0.65) 0%, rgba(255,255,255,0.45) 40%, rgba(255,255,255,0.35) 100%); z-index:0; }

/* Detail panel */
#detailOverlay { position:fixed; inset:0; background:rgba(0,0,0,0.5); display:none; z-index:200; backdrop-filter:blur(4px); }
#detailSheet { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); background:#fff; border-radius:20px; padding:24px; max-height:80vh; overflow:auto; width:90%; max-width:500px; box-shadow:0 20px 60px rgba(0,0,0,0.3); }
@media (min-width:900px){ #detailSheet { max-width:600px; } }
.sheet-header { display:flex; align-items:center; gap:16px; margin-bottom:20px; }
.sheet-art { width:120px; height:120px; border-radius:14px; background-size:cover; background-position:center; flex-shrink:0; box-shadow:0 8px 24px rgba(0,0,0,0.15); }
.track-row { display:flex; align-items:center; gap:12px; padding:10px; border-radius:10px; border:1px solid var(--ui-border); margin-bottom:8px; transition:all 0.2s; }
.track-row:hover { background:#f9fafb; }

/* Mini player (above bottom nav) */
#miniPlayer { position:fixed; left:0; right:0; bottom:64px; z-index:145; background:var(--ui-bg); border-top:1px solid var(--ui-border); backdrop-filter:blur(14px); box-shadow:0 -6px 24px rgba(0,0,0,0.1); }
.mini-bar { max-width:1400px; margin:0 auto; display:flex; align-items:center; gap:18px; padding:14px 18px; }
.mini-art { width:60px; height:60px; border-radius:12px; background-size:cover; background-position:center; flex-shrink:0; box-shadow:0 6px 16px rgba(0,0,0,0.18); }
.mini-meta { flex:1; min-width:0; }
.mini-title { font-weight:800; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:16px; }
.mini-sub { color:var(--muted); font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:2px; }
.mini-controls { display:flex; align-items:center; gap:10px; }
.mini-btn { height:44px; min-width:44px; border-radius:10px; border:1px solid var(--ui-border); background:#fff; font-weight:700; cursor:pointer; transition:all 0.2s; }
.mini-btn:hover { background:#f9fafb; transform:scale(1.05); }
.mini-btn:active { transform:scale(0.95); }
.progress { position:absolute; bottom:0; left:0; right:0; height:3px; background:rgba(0,0,0,0.06); }
.progress > div { height:100%; width:0%; background:var(--brand); transition:width 0.3s; }

/* Song Room */
/* Removed roomBar (moved to mini-player) */

#roomSheet { position:fixed; left:0; right:0; bottom:0; top:0; background:rgba(0,0,0,0.35); z-index:300; display:flex; align-items:flex-end; }
#roomSheet[hidden] { display:none; }
.room-panel { background:#fff; border-top-left-radius:16px; border-top-right-radius:16px; width:100%; max-height:80vh; box-shadow:0 -12px 36px rgba(0,0,0,0.25); display:flex; flex-direction:column; }
.room-header { display:flex; align-items:center; justify-content:space-between; padding:12px 14px; border-bottom:1px solid var(--ui-border); }
#roomMessages { flex:1; overflow-y:auto; padding:12px 14px; }
.room-input { display:flex; gap:8px; padding:12px 14px; border-top:1px solid var(--ui-border); }
.room-input input { flex:1; height:48px; border-radius:12px; border:1px solid var(--ui-border); padding:0 12px; }
.room-input button { height:48px; border-radius:12px; border:1px solid var(--ui-border); background:#111827; color:#fff; font-weight:700; padding:0 16px; }
.room-emojis { display:flex; gap:8px; padding:8px 14px 14px; }
.room-emojis button { height:40px; width:40px; border-radius:10px; border:1px solid var(--ui-border); background:#fff; font-size:18px; }

/* Utility */
.muted { color:var(--muted); font-size:14px; }
.empty-state { text-align:center; padding:60px 20px; color:var(--muted); }



