:root {
  --peach: #ffd6ba;
  --lav: #e0c3fc;
  --cream: #fff8f0;
  --plum: #3a1a4a;
  --plum-soft: #6b4a7a;
  --accent: #c74b8f;
  --en-tint: #f4ecff;
  --fa-tint: #fff0e8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  color: var(--plum);
  background:
    radial-gradient(circle at 15% 10%, rgba(224,195,252,0.55), transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(255,214,186,0.6), transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(199,75,143,0.18), transparent 55%),
    linear-gradient(180deg, #fffaf5, #fef2ea);
  min-height: 100vh;
}

.app-root { position: relative; overflow-x: hidden; }

/* ---- Header ---- */
.app-title {
  font-family: 'Playfair Display', 'Vazirmatn', serif;
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(120deg, var(--accent), #7b3fa0 60%, #e08a3c);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
  animation: fadeDown .8s ease both;
}
.tagline {
  color: var(--plum-soft);
  font-weight: 300;
  animation: fadeDown 1s .15s ease both;
}
.note-bounce { animation: bounce 1.8s ease-in-out infinite; display: inline-block; }
@keyframes bounce {
  0%,100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-10px) rotate(6deg); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Tabs ---- */
.tabs {
  display: flex; gap: .5rem; justify-content: center;
  margin: 0 auto 1.5rem; max-width: 400px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(199,75,143,0.15);
  border-radius: 999px; padding: .35rem; backdrop-filter: blur(8px);
}
.tab {
  flex: 1; border: none; background: transparent; cursor: pointer;
  padding: .6rem 1rem; border-radius: 999px; font-family: inherit;
  font-weight: 600; color: var(--plum-soft); font-size: .95rem;
  transition: all .25s;
}
.tab-on {
  background: linear-gradient(120deg, var(--accent), #7b3fa0);
  color: #fff; box-shadow: 0 6px 18px rgba(199,75,143,0.3);
}

/* ---- Search ---- */
.search-card {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 1.5rem; padding: 1.5rem;
  box-shadow: 0 20px 50px -20px rgba(123,63,160,0.35);
  backdrop-filter: blur(10px);
  animation: fadeUp .6s .1s ease both;
}
.field {
  width: 100%; padding: .85rem 1.1rem;
  border: 1.5px solid rgba(199,75,143,0.2);
  border-radius: 1rem; background: rgba(255,255,255,0.85);
  font-family: inherit; font-size: 1rem; color: var(--plum);
  transition: all .2s; outline: none;
}
.field::placeholder { color: #b89bbf; }
.field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(199,75,143,0.12);
  background: #fff;
}
.btn-search {
  padding: .9rem; border: none; border-radius: 1rem; cursor: pointer;
  font-family: inherit; font-weight: 800; font-size: 1.1rem; color: #fff;
  background: linear-gradient(120deg, var(--accent), #7b3fa0);
  box-shadow: 0 12px 28px -8px rgba(199,75,143,0.55);
  transition: transform .18s, box-shadow .18s;
}
.btn-search:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px -8px rgba(199,75,143,0.65);
}
.btn-search:disabled { opacity: .7; cursor: wait; }

.chip {
  border: 1px solid rgba(123,63,160,0.25); background: rgba(255,255,255,0.7);
  color: var(--plum-soft); border-radius: 999px; padding: .4rem .9rem;
  font-family: inherit; font-size: .85rem; cursor: pointer; transition: all .2s;
}
.chip:hover { background: var(--lav); color: var(--plum); border-color: transparent; }

/* ---- Loading / idle ---- */
.loading-box, .hero-idle {
  display: flex; flex-direction: column; align-items: center;
  padding: 3rem 1rem; text-align: center; gap: .5rem;
  animation: fadeUp .5s ease both;
}
.loading-text, .idle-text { color: var(--plum-soft); font-weight: 300; font-size: 1.05rem; }
.vinyl {
  width: 70px; height: 70px; border-radius: 50%;
  background: repeating-radial-gradient(circle, #2a1030 0 3px, #1a0820 3px 6px);
  display: flex; align-items: center; justify-content: center;
  animation: spin 1.4s linear infinite;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
.vinyl-hole { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

.eq { display: flex; gap: 4px; align-items: flex-end; height: 30px; margin-top: .5rem; }
.eq span {
  width: 5px; background: linear-gradient(var(--accent), #7b3fa0);
  border-radius: 3px; height: 100%;
  animation: eqbar 1s ease-in-out infinite;
}
@keyframes eqbar {
  0%,100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

.error-box {
  max-width: 500px; margin: 1.5rem auto; text-align: center;
  background: rgba(255,235,235,0.8); border: 1px solid #f0b9b9;
  color: #a13c3c; padding: 1rem 1.25rem; border-radius: 1rem; font-weight: 600;
}

/* ---- Lyrics view ---- */
.lyrics-wrap {
  background: rgba(255,255,255,0.72); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.9); border-radius: 1.5rem;
  padding: 1.5rem; box-shadow: 0 24px 60px -24px rgba(123,63,160,0.4);
  animation: fadeUp .5s ease both;
}
.song-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; flex-wrap: wrap; padding-bottom: 1rem; margin-bottom: 1rem;
  border-bottom: 1px dashed rgba(199,75,143,0.25);
}
.song-title {
  font-family: 'Playfair Display', serif; font-size: 1.6rem; font-weight: 700;
  color: var(--plum); margin: 0;
}
.song-artist { color: var(--accent); font-weight: 600; margin: .2rem 0 0; }

.font-toggle { display: flex; gap: .25rem; }
.ft-btn {
  border: 1px solid rgba(123,63,160,0.25); background: rgba(255,255,255,0.7);
  color: var(--plum-soft); border-radius: .6rem; padding: .35rem .6rem;
  cursor: pointer; font-family: 'Playfair Display', serif; font-weight: 600;
}
.ft-btn:hover { background: var(--lav); }
.heart-btn {
  border: none; background: rgba(255,255,255,0.7); cursor: pointer;
  font-size: 1.4rem; border-radius: 50%; width: 46px; height: 46px;
  display: grid; place-items: center; transition: transform .2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.heart-btn:hover { transform: scale(1.12); }
.heart-btn.faved { animation: pop .35s ease; }
@keyframes pop {
  0% { transform: scale(1); } 40% { transform: scale(1.4); } 100% { transform: scale(1); }
}

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 720px) { .cols { grid-template-columns: 1fr; } }
.col { border-radius: 1rem; padding: 1rem; }
.col-en { background: var(--en-tint); }
.col-fa { background: var(--fa-tint); }
.col-label {
  font-weight: 800; font-size: .9rem; color: var(--plum-soft);
  margin-bottom: .75rem; padding-bottom: .5rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.lyric-line {
  margin: 0; padding: .3rem .45rem; border-radius: .5rem;
  line-height: 1.9; transition: background .18s; color: var(--plum);
}
.hl-en { background: rgba(123,63,160,0.15); }
.hl-fa { background: rgba(224,138,60,0.18); }

.btn-ghost {
  border: 1.5px solid var(--accent); background: transparent; color: var(--accent);
  border-radius: 1rem; padding: .6rem 1.4rem; font-family: inherit;
  font-weight: 700; cursor: pointer; transition: all .2s;
}
.btn-ghost:hover { background: var(--accent); color: #fff; }

/* ---- Favorites ---- */
.empty-note { text-align: center; color: var(--plum-soft); font-weight: 300; padding: 3rem 1rem; font-size: 1.1rem; }
.fav-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem; max-width: 900px; margin: 0 auto;
}
.fav-card {
  background: rgba(255,255,255,0.75); border: 1px solid rgba(255,255,255,0.9);
  border-radius: 1.1rem; padding: 1rem 1.2rem; display: flex;
  align-items: center; justify-content: space-between; gap: .5rem;
  box-shadow: 0 12px 30px -16px rgba(123,63,160,0.35);
  transition: transform .2s; animation: fadeUp .4s ease both;
}
.fav-card:hover { transform: translateY(-3px); }
.fav-info { cursor: pointer; flex: 1; min-width: 0; }
.fav-title { font-weight: 700; color: var(--plum); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-artist { color: var(--accent); font-size: .85rem; margin-top: .15rem; }
.fav-remove {
  border: none; background: rgba(255,235,235,0.7); cursor: pointer;
  border-radius: .6rem; padding: .4rem .5rem; font-size: 1rem; transition: background .2s;
}
.fav-remove:hover { background: #f5c8c8; }

/* ---- Footer ---- */
.footer {
  text-align: center; padding: 1.5rem 1rem 2rem;
  color: var(--plum-soft); font-weight: 300; font-size: .9rem;
  border-top: 1px solid rgba(199,75,143,0.12); margin-top: auto;
  background: rgba(255,255,255,0.35);
}
.remix-link {
  color: var(--accent); font-weight: 700; text-decoration: none;
  display: inline-block; margin-top: .4rem;
}
.remix-link:hover { text-decoration: underline; }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(120deg, var(--accent), #7b3fa0); color: #fff;
  padding: .75rem 1.4rem; border-radius: 999px; font-weight: 700;
  box-shadow: 0 12px 30px rgba(123,63,160,0.4); z-index: 100;
  animation: toastIn .3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---- Floating notes ---- */
.floating-notes { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.fnote {
  position: absolute; font-size: 1.5rem; opacity: 0.25;
  animation: floatUp 12s linear infinite;
}
.fnote-0 { left: 8%; animation-delay: 0s; }
.fnote-1 { left: 28%; animation-delay: 3s; font-size: 2rem; }
.fnote-2 { left: 55%; animation-delay: 6s; }
.fnote-3 { left: 75%; animation-delay: 1.5s; font-size: 1.8rem; }
.fnote-4 { left: 90%; animation-delay: 8s; }
@keyframes floatUp {
  0% { transform: translateY(105vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.25; }
  90% { opacity: 0.25; }
  100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

main { position: relative; z-index: 1; }
header, .tabs, .footer { position: relative; z-index: 1; }