:root {
  --bg: #0b0d17;
  --surface: #141726;
  --card: rgba(255, 255, 255, 0.045);
  --card-strong: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4f5fb;
  --muted: #9aa0b8;
  --dim: #6b7190;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --pink: #f472b6;
  --gold: #fbbf24;
  --green: #34d399;
  --red: #f87171;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #22d3ee 100%);
  --radius: 18px;
  --nav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body.light {
  --bg: #f4f5fb;
  --surface: #ffffff;
  --card: rgba(15, 18, 40, 0.04);
  --card-strong: rgba(15, 18, 40, 0.07);
  --line: rgba(15, 18, 40, 0.08);
  --text: #12142b;
  --muted: #5d6280;
  --dim: #8a8fa8;
  --gold: #b45309;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); color: var(--text); }
body { min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; user-select: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input { font: inherit; color: inherit; }
img { display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; margin-top: 10px; text-align: center; }

.bg-blur {
  position: fixed; inset: -40px; z-index: 0; pointer-events: none;
  background: radial-gradient(60% 40% at 20% 0%, rgba(139, 92, 246, .28), transparent 70%),
              radial-gradient(50% 35% at 100% 30%, rgba(34, 211, 238, .14), transparent 70%);
  background-size: cover; background-position: center;
  filter: blur(0); transition: background-image .6s;
}
.bg-blur.has-cover { filter: blur(60px) saturate(1.2); opacity: .32; }
body.light .bg-blur.has-cover { opacity: .18; }

.app { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; min-height: 100vh;
  padding: 10px 16px calc(var(--nav-h) + var(--safe-b) + 84px); }

/* üst bar */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 14px; }
.me { display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); display: grid; place-items: center;
  font-weight: 700; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.big { width: 84px; height: 84px; font-size: 30px; box-shadow: 0 10px 30px rgba(139, 92, 246, .35); }
.hello { font-size: 12px; color: var(--muted); }
.me-name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.top-right { display: flex; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 13px;
  background: var(--card-strong); border: 1px solid var(--line); }
.chip.coins b { color: var(--gold); }
.chip.vip { background: linear-gradient(135deg, rgba(251, 191, 36, .2), rgba(244, 114, 182, .2)); color: var(--gold); font-weight: 700; }

.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* boş çalar */
.empty-player { text-align: center; padding: 60px 20px 20px; }
.empty-art { width: 140px; height: 140px; margin: 0 auto 22px; border-radius: 36px; display: grid; place-items: center;
  font-size: 60px; background: var(--grad); box-shadow: 0 20px 50px rgba(99, 102, 241, .35); }
.empty-player h2 { font-size: 22px; margin-bottom: 8px; }
.empty-player p { color: var(--muted); font-size: 14px; line-height: 1.5; margin-bottom: 22px; }

/* çalar */
.cover-wrap { position: relative; width: min(78vw, 320px); aspect-ratio: 1; margin: 6px auto 0; }
.cover { width: 100%; height: 100%; object-fit: cover; border-radius: 26px; background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45); transition: transform .4s ease; }
.now.playing .cover { transform: scale(1.02); }
.live-badge { position: absolute; top: 12px; left: 12px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px);
  padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .5px; display: flex; gap: 6px; align-items: center; }
.live-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
#viz { width: 100%; height: 40px; margin: 14px 0 4px; display: block; }
.meta { text-align: center; margin-bottom: 14px; }
.title { font-size: 21px; font-weight: 800; line-height: 1.25; }
.artist { color: var(--muted); margin-top: 4px; font-size: 14.5px; }
.seek { margin: 4px 2px 10px; }
.rail { position: relative; height: 6px; border-radius: 999px; background: var(--card-strong); cursor: pointer; }
.fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--grad); }
.knob { position: absolute; top: 50%; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); margin-top: 8px; }
.preview-note { text-align: center; font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.controls { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 16px; }
.icon-btn { width: 46px; height: 46px; border-radius: 50%; font-size: 19px; display: grid; place-items: center; opacity: .8; }
.icon-btn.on { background: var(--card-strong); opacity: 1; box-shadow: inset 0 0 0 1px var(--accent); }
.play { width: 72px; height: 72px; border-radius: 50%; background: var(--grad); font-size: 26px; display: grid; place-items: center;
  box-shadow: 0 14px 34px rgba(99, 102, 241, .45); transition: transform .15s; }
.play:active, .btn:active, .mini-play:active { transform: scale(.94); }

.row-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin-bottom: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 16px; border-radius: 14px;
  font-weight: 700; font-size: 14px; background: var(--card-strong); border: 1px solid var(--line); transition: transform .15s; }
.btn.primary { background: var(--grad); border: 0; color: #fff; }
.btn.ghost { background: var(--card); }
.btn[disabled] { opacity: .55; pointer-events: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; margin-bottom: 10px; }
.card-head small { color: var(--dim); font-weight: 500; }
.card.tip { font-size: 13px; color: var(--muted); line-height: 1.5; }
.lyrics { max-height: 260px; overflow-y: auto; scroll-behavior: smooth; mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent); padding: 10px 0; }
.lyrics .l { padding: 6px 2px; color: var(--dim); font-size: 15px; font-weight: 600; transition: color .2s, transform .2s; transform-origin: left; }
.lyrics .l.on { color: var(--text); transform: scale(1.04); }

/* keşfet */
.search { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 48px; border-radius: 14px;
  background: var(--card-strong); border: 1px solid var(--line); margin-bottom: 12px; }
.search input { flex: 1; background: none; border: 0; outline: none; font-size: 15px; user-select: text; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.cat { white-space: nowrap; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--card); border: 1px solid var(--line); }
.cat.active { background: var(--grad); border-color: transparent; color: #fff; }
.list { display: flex; flex-direction: column; gap: 6px; }
.item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px; transition: background .15s; }
.item:active, .item.current { background: var(--card-strong); }
.item img, .item .ph { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface); }
.item .ph { display: grid; place-items: center; font-size: 22px; }
.item .txt { flex: 1; min-width: 0; }
.item .t { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .a { color: var(--muted); font-size: 12.5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .n { width: 20px; text-align: center; color: var(--dim); font-size: 13px; font-weight: 700; flex: none; }
.item .dl { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--card); flex: none; }
.skel { height: 68px; border-radius: 14px; background: linear-gradient(90deg, var(--card) 25%, var(--card-strong) 50%, var(--card) 75%);
  background-size: 300% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; font-size: 14px; }

/* radyo */
.section-title { font-size: 18px; margin: 2px 0 12px; }
.radio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio { position: relative; border-radius: var(--radius); padding: 14px; min-height: 112px; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); text-align: left; display: flex; flex-direction: column; justify-content: space-between; }
.radio::before { content: ""; position: absolute; inset: 0; opacity: .22; background: var(--g, var(--grad)); }
.radio > * { position: relative; }
.radio .ic { font-size: 26px; }
.radio .nm { font-weight: 800; font-size: 15px; margin-top: 8px; }
.radio .gn { color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.3; }
.radio.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.radio .eq { position: absolute; top: 14px; right: 14px; display: none; gap: 2px; align-items: flex-end; height: 14px; }
.radio.on .eq { display: flex; }
.eq i { width: 3px; background: var(--accent-2); border-radius: 2px; animation: eq .9s infinite ease-in-out; }
.eq i:nth-child(2) { animation-delay: .2s; } .eq i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }

/* stüdyo */
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 14px; }
.preset { padding: 12px 6px; border-radius: 14px; font-weight: 700; font-size: 13px; background: var(--card); border: 1px solid var(--line); }
.preset.active { background: var(--grad); color: #fff; border-color: transparent; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: var(--card-strong); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 0; }
.switch { position: relative; width: 46px; height: 26px; }
.switch input { display: none; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--card-strong); transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); }

/* profil */
.profile { text-align: center; padding: 8px 0 16px; }
.profile .avatar { margin: 0 auto 12px; }
.p-name { font-size: 21px; font-weight: 800; }
.p-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.p-rank { display: inline-block; margin-top: 10px; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--card-strong); border: 1px solid var(--line); }
.level { height: 8px; border-radius: 999px; background: var(--card-strong); margin: 14px 10px 6px; overflow: hidden; }
.level-fill { height: 100%; width: 0; background: var(--grad); border-radius: inherit; transition: width .6s ease; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 4px; text-align: center; }
.stat b { display: block; font-size: 17px; }
.stat span { font-size: 11.5px; color: var(--muted); }
.stat:first-child b { color: var(--gold); }
.btn.daily { width: 100%; margin-bottom: 14px; background: linear-gradient(135deg, #f59e0b, #f472b6); color: #fff; border: 0; padding: 15px; }
.vip-box { border-radius: 22px; padding: 18px 16px 14px; background: linear-gradient(160deg, rgba(251, 191, 36, .14), rgba(139, 92, 246, .14));
  border: 1px solid rgba(251, 191, 36, .28); }
.vip-title { font-size: 18px; font-weight: 800; color: var(--gold); }
.vip-head { margin-bottom: 12px; }
.products { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prod { padding: 12px 10px; border-radius: 14px; background: var(--card-strong); border: 1px solid var(--line); text-align: left; }
.prod b { display: block; font-size: 14px; }
.prod span { font-size: 12.5px; color: var(--gold); font-weight: 700; }
.prod.vipp { border-color: rgba(251, 191, 36, .35); }

/* mini oynatıcı */
.mini { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + 10px);
  width: calc(100% - 24px); max-width: 496px; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border-radius: 16px;
  background: rgba(20, 23, 38, .88); backdrop-filter: blur(16px); border: 1px solid var(--line); z-index: 20; cursor: pointer; }
body.light .mini { background: rgba(255, 255, 255, .92); }
.mini img { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; background: var(--surface); }
.mini-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-text b, .mini-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-text b { font-size: 13.5px; }
.mini-text span { font-size: 12px; color: var(--muted); }
.mini-play { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; }

/* alt gezinme */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: rgba(11, 13, 23, .9); backdrop-filter: blur(18px);
  border-top: 1px solid var(--line); }
body.light .tabs { background: rgba(255, 255, 255, .94); }
.tab { flex: 1; max-width: 104px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: var(--dim); }
.tab span { font-size: 20px; filter: grayscale(1); opacity: .7; transition: .2s; }
.tab.active { color: var(--text); }
.tab.active span { filter: none; opacity: 1; transform: translateY(-1px); }

.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 12px); transform: translate(-50%, -20px);
  background: rgba(20, 23, 38, .95); color: #fff; padding: 11px 16px; border-radius: 14px; font-size: 13.5px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: 86vw; text-align: center; border: 1px solid var(--line); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
