/* Дилсуруд — фирменный стиль: гранат, шафран, бирюза на ночном фоне */
:root {
  --bg: #160D14; --s1: #24161F; --s2: #2F1E29; --s3: #3A2733; --line: #4A3440;
  --text: #FFF3E6; --muted: #C9B3A6; --dim: #9C8579;
  --pom: #C8283F; --pom-d: #8A2232; --saf: #F4A93B; --tur: #2BB3A3; --cream: #FFF3E6;
  --r: 20px; --nav-h: 68px; --safe-b: env(safe-area-inset-bottom, 0px);
  --display: "Montserrat", "Onest", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.45 "Onest", -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; overscroll-behavior: none; }
button, input, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
a { color: var(--saf); }
h1, h2, h3, .display { font-family: var(--display); letter-spacing: -.3px; margin: 0; }

#app { max-width: 560px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + 110px + var(--safe-b)); }

/* ---------- шапка ---------- */
.top { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.brand b { font-family: var(--display); font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-bal { display: flex; align-items: center; gap: 6px; background: var(--s2); border-radius: 999px; padding: 8px 14px; font-weight: 700; min-height: 40px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--pom); display: grid; place-items: center; font-weight: 800; overflow: hidden; flex: none; color: var(--cream); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.back { width: 44px; height: 44px; border-radius: 14px; background: var(--s2); display: grid; place-items: center; flex: none; }

/* ---------- общее ---------- */
.card { background: var(--s1); border-radius: var(--r); padding: 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.section { font-family: var(--display); font-size: 18px; font-weight: 600; margin: 26px 0 12px; display: flex; align-items: baseline; }
.section .link { margin-left: auto; font: 600 14px "Onest", sans-serif; color: var(--muted); }
.label { font-weight: 700; margin: 18px 0 8px; display: block; }
.label span { font-weight: 400; color: var(--muted); }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.hidden { display: none !important; }
.icon { width: 22px; height: 22px; flex: none; }

.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; padding: 15px 18px;
  border-radius: 18px; font-weight: 700; font-size: 17px; background: var(--pom); color: var(--cream); transition: transform .1s, opacity .2s; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.saf { background: var(--saf); color: var(--bg); }
.btn.ghost { background: var(--s2); }
.btn.cream { background: var(--cream); color: var(--bg); }
.btn.line { background: transparent; border: 2px solid var(--line); }
.btn.small { width: auto; min-height: 44px; padding: 10px 18px; font-size: 15px; }
.btn.wa { background: #1FAF5A; }
.btn.tg { background: #2A9FD8; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 10px 15px; min-height: 44px; border-radius: 999px; border: 1px solid var(--line); font-size: 15px; }
.chip.on { background: var(--saf); color: var(--bg); border-color: var(--saf); font-weight: 700; }
.chip.cream.on { background: var(--cream); border-color: var(--cream); }
.chip.dis { opacity: .4; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--s1); border-radius: 16px; padding: 4px; }
.seg button { padding: 11px 4px; border-radius: 12px; color: var(--muted); font-size: 14px; min-height: 44px; }
.seg button.on { background: var(--cream); color: var(--bg); font-weight: 700; }
.field { width: 100%; background: var(--s1); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; outline: 0; font-size: 17px; }
.field:focus { border-color: var(--saf); }
textarea.field { resize: vertical; min-height: 110px; line-height: 1.5; }
.toggle { width: 52px; height: 32px; border-radius: 999px; background: var(--s3); position: relative; flex: none; transition: background .2s; }
.toggle::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--cream); transition: left .2s; }
.toggle.on { background: var(--tur); }
.toggle.on::after { left: 24px; }
.range { width: 100%; accent-color: var(--saf); }

/* ---------- главная ---------- */
.hello { font-family: var(--display); font-size: 24px; font-weight: 600; line-height: 1.2; margin-bottom: 16px; }
.hello span { display: block; color: var(--muted); font-size: 17px; font-weight: 500; margin-top: 4px; }
.hero { border-radius: 26px; padding: 22px; background: var(--pom); position: relative; overflow: hidden; }
.hero .rosette { position: absolute; right: -70px; top: -60px; width: 230px; opacity: .25; }
.hero h2 { font-size: 22px; line-height: 1.2; max-width: 250px; position: relative; }
.hero p { color: #FFE3E7; max-width: 280px; margin: 8px 0 16px; position: relative; }
.hero .btn { width: auto; display: inline-flex; position: relative; }
.gift { margin-top: 12px; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--s2); }
.gift .ico { width: 44px; height: 44px; border-radius: 14px; background: var(--saf); color: var(--bg); display: grid; place-items: center; flex: none; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--s1); border-radius: 18px; padding: 14px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; text-align: center; min-height: 86px; }
.tile .icon { color: var(--saf); width: 26px; height: 26px; }
.wide-card { width: 100%; text-align: left; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r); background: var(--s1); margin-top: 12px; }
.wide-card .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.chart-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; width: 100%; text-align: left; }
.chart-row .n { font-family: var(--display); font-weight: 700; color: var(--saf); width: 18px; }
.cover-sm { width: 48px; height: 48px; border-radius: 12px; background: var(--pom-d) center/cover; flex: none; }

/* ---------- мастер ---------- */
.wiz-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.bars { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.bars i { height: 5px; border-radius: 5px; background: var(--s3); }
.bars i.on { background: var(--saf); }
.wiz h2 { font-size: 26px; line-height: 1.15; }
.moods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.mood { text-align: left; background: var(--s1); border: 2px solid transparent; border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 4px; min-height: 108px; }
.mood .icon { color: var(--muted); width: 28px; height: 28px; margin-bottom: 6px; }
.mood span { font-size: 13px; color: var(--muted); }
.mood.on { border-color: var(--saf); background: #3A1A24; }
.mood.on .icon { color: var(--saf); }
.pro-btn { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 1px dashed var(--line); border-radius: 16px; padding: 14px 16px; margin-top: 18px; }
.lyrics-box { background: var(--s1); border-radius: 22px; padding: 6px; margin-top: 14px; }
.lyrics-box textarea { width: 100%; min-height: 330px; background: transparent; border: 0; outline: 0; resize: vertical; padding: 12px; font-size: 16px; line-height: 1.6; }
.note-ok { display: flex; gap: 10px; align-items: center; background: #1B2A28; color: #CFEDE8; border-radius: 16px; padding: 12px 14px; font-size: 14px; margin-top: 12px; }
.note-ok .icon { color: var(--tur); }
.bottom-cta { margin-top: 22px; display: flex; gap: 10px; }

/* ---------- мои песни, лента ---------- */
.tracks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tcard { border-radius: var(--r); overflow: hidden; background: var(--s1); position: relative; aspect-ratio: 3 / 4; display: flex; flex-direction: column; text-align: left; width: 100%; }
.tcard .cover { position: absolute; inset: 0; background: var(--pom-d) center/cover; }
.tcard .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(22,13,20,0) 35%, rgba(22,13,20,.92)); }
.tcard .play { position: absolute; top: 10px; left: 10px; width: 44px; height: 44px; border-radius: 50%; background: var(--cream); color: var(--bg); display: grid; place-items: center; z-index: 2; }
.tcard .meta { position: relative; margin-top: auto; padding: 12px; z-index: 1; }
.tcard .title { font-weight: 800; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard .foot { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.tcard .foot .who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.like { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; min-height: 32px; }
.like.on { color: var(--saf); }
.making { grid-column: span 2; background: var(--s1); border-radius: 22px; padding: 18px; }
.stages { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.stage { display: flex; align-items: center; gap: 12px; color: var(--dim); }
.stage .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.stage.done { color: var(--text); }
.stage.done .dot { background: var(--tur); border-color: var(--tur); color: var(--bg); }
.stage.now { color: var(--saf); font-weight: 700; }
.stage.now .dot { border: 3px solid var(--saf); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.82); } }
.pbar { height: 8px; border-radius: 8px; background: var(--s3); overflow: hidden; margin-top: 12px; }
.pbar i { display: block; height: 100%; background: var(--saf); border-radius: 8px; transition: width 1s linear; }
.empty { text-align: center; padding: 50px 16px; }
.search { display: flex; align-items: center; gap: 10px; background: var(--s1); border-radius: 16px; padding: 0 14px; margin-bottom: 12px; }
.search input { flex: 1; background: none; border: 0; outline: 0; padding: 14px 0; font-size: 16px; min-width: 0; }

/* ---------- узнать песню ---------- */
.rec-wrap { text-align: center; padding: 20px 0 8px; }
.rec-btn { width: 170px; height: 170px; border-radius: 50%; background: var(--pom); display: grid; place-items: center; margin: 0 auto 14px; position: relative; color: var(--cream); }
.rec-btn.on::before { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 3px solid var(--saf); animation: ring 1.4s ease-out infinite; }
@keyframes ring { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.15); opacity: 0; } }
.found { background: var(--s1); border-radius: 22px; padding: 18px; margin-top: 16px; }
.links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.links a { background: var(--s2); color: var(--text); text-decoration: none; padding: 12px; border-radius: 14px; text-align: center; font-weight: 600; min-height: 44px; }

/* ---------- баланс ---------- */
.pkg { width: 100%; text-align: left; display: flex; align-items: center; gap: 12px; background: var(--s1); border: 2px solid transparent; border-radius: 20px; padding: 16px; margin-bottom: 12px; position: relative; }
.pkg.on { border-color: var(--saf); background: #3A1A24; }
.pkg .n { font-family: var(--display); font-weight: 700; font-size: 18px; }
.pkg .price { font-family: var(--display); font-weight: 700; font-size: 19px; white-space: nowrap; }
.badge { position: absolute; top: -11px; left: 14px; background: var(--saf); color: var(--bg); font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 8px; text-transform: uppercase; }
.methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.method { text-align: left; background: var(--s1); border: 2px solid transparent; border-radius: 16px; padding: 13px 14px; min-height: 64px; }
.method.on { background: var(--cream); color: var(--bg); }
.method.on .muted { color: #5E4B52; }
.paybar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 20px + var(--safe-b)); width: calc(100% - 24px); max-width: 536px;
  display: flex; align-items: center; gap: 12px; background: rgba(47,30,41,.96); backdrop-filter: blur(12px); border-radius: 22px; padding: 10px 10px 10px 16px; z-index: 30; }
.paybar .btn { width: auto; }
.kv { display: flex; align-items: center; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }

/* ---------- навигация ---------- */
.nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b)); width: calc(100% - 24px); max-width: 536px; height: var(--nav-h);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center; background: rgba(47,30,41,.96); backdrop-filter: blur(14px); border-radius: 24px; z-index: 40; }
.nav button { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 600; height: 100%; justify-content: center; }
.nav button.on { color: var(--text); }
.nav button.on .icon { color: var(--saf); }

/* ---------- плеер ---------- */
.player { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 20px + var(--safe-b)); width: calc(100% - 24px); max-width: 536px;
  display: none; align-items: center; gap: 10px; padding: 8px; background: rgba(58,39,51,.97); backdrop-filter: blur(12px); border-radius: 18px; z-index: 35; }
.player.show { display: flex; }
.player .pc { width: 44px; height: 44px; border-radius: 12px; background: var(--pom-d) center/cover; flex: none; }
.player .bar { height: 3px; background: var(--s1); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.player .bar i { display: block; height: 100%; width: 0; background: var(--saf); }
.player .pt { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round { width: 44px; height: 44px; border-radius: 50%; background: var(--saf); color: var(--bg); display: grid; place-items: center; flex: none; }

/* ---------- шторка ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet-bg.show { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 100%); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  background: var(--bg); border-radius: 26px 26px 0 0; z-index: 51; padding: 10px 16px calc(24px + var(--safe-b)); transition: transform .25s ease; }
.sheet.show { transform: translate(-50%, 0); }
.sheet .grab { width: 42px; height: 5px; border-radius: 5px; background: var(--s3); margin: 0 auto 10px; }
.sheet .x { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; background: var(--s2); display: grid; place-items: center; z-index: 2; }
.big-cover { width: 76%; max-width: 300px; aspect-ratio: 1; margin: 18px auto 16px; border-radius: 24px; background: var(--pom) center/cover; }
.lyr { white-space: pre-wrap; font-size: 15px; color: #E9D9CC; max-height: 240px; overflow-y: auto; margin-top: 8px; }

/* ---------- выбор языка ---------- */
.lang-screen { min-height: 82vh; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.lang-opt { display: flex; align-items: center; gap: 14px; padding: 16px; text-align: left; width: 100%; background: var(--s1); border-radius: 18px; min-height: 64px; font-weight: 700; font-size: 17px; }
.flag { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--s3); font-size: 13px; font-weight: 800; color: var(--saf); }

.toast { position: fixed; top: 14px; left: 50%; transform: translate(-50%, -150%); z-index: 99; background: var(--cream); color: var(--bg); padding: 12px 18px; border-radius: 14px;
  font-weight: 700; transition: transform .25s; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.toast.show { transform: translate(-50%, 0); }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--s3); border-top-color: var(--saf); animation: spin 1s linear infinite; margin: 0 auto; }
.spinner.sm { width: 20px; height: 20px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 80px 0; }

/* v6: приветствие с выбором языка */
.lang-screen { position: relative; min-height: calc(100vh - 40px); justify-content: space-between; overflow: hidden; padding-bottom: 12px; }
.lang-bg { position: absolute; width: 560px; left: -90px; top: -150px; opacity: .14; pointer-events: none; }
.lang-hero { margin-top: 12vh; display: flex; flex-direction: column; align-items: center; gap: 10px; position: relative; }
.lang-hero h1 { font-size: 34px; font-weight: 800; }
.lang-hero p { line-height: 1.5; margin: 0; }
.lang-pick { display: flex; flex-direction: column; gap: 12px; position: relative; }
.lang-big { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 18px; border-radius: 22px; background: var(--s2); border: 1px solid var(--line); color: var(--cream); min-height: 76px; }
.lang-big.main { background: var(--pom); border-color: var(--pom); }
.lang-big .flag { width: 46px; height: 46px; border-radius: 14px; background: rgba(255,243,230,.14); display: grid; place-items: center; font-family: var(--display); font-weight: 800; flex: none; }
.lang-big b { display: block; font-family: var(--display); font-weight: 800; font-size: 20px; }
.lang-big span span { font-size: 14px; opacity: .85; }
.other-langs { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 22px; }

/* v7: проба и открытие песни */
.lock-badge { position: absolute; top: 10px; right: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; background: rgba(22,13,20,.78); color: var(--saf); font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; }
.lock-badge .icon { width: 13px; height: 13px; }
.tiny-ic { width: 13px; height: 13px; vertical-align: -2px; }
.saf { color: var(--saf); }
.phone-ico { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--saf); color: var(--bg); }
.phone-ico .icon { width: 30px; height: 30px; }
.checks { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--muted, #C9B3A6); }
.checks div { display: flex; gap: 10px; align-items: center; }
.checks .icon { color: var(--tur); width: 18px; height: 18px; flex: none; }
.incl { margin: 8px 0 12px; }
.incl div { background: var(--bg); border-radius: 14px; padding: 10px 6px; text-align: center; font-size: 12.5px; color: #E9D9CC; line-height: 1.35; }
.incl b { color: var(--cream); }
.pkg .price s { text-decoration: line-through; }
