/* ==================================================================
   PROTOCOLO X — estilo visual guiado pela logo
   Paleta: navy profundo · roxo místico · dourado · brilho violeta
   Mobile-first.
   ================================================================== */

:root {
  --bg:            #0a0918;
  --bg-2:          #120c2b;
  --surface:       rgba(255, 255, 255, 0.045);
  --surface-2:     rgba(255, 255, 255, 0.08);
  --surface-solid: #17123a;

  --purple:        #6b3fa0;
  --purple-light:  #8b5cf6;
  --violet:        #a78bfa;
  --violet-glow:   #c4b5fd;

  --gold:          #d9b45f;
  --gold-bright:   #f2d98b;
  --gold-soft:     rgba(217, 180, 95, 0.14);

  --text:          #ece9ff;
  --muted:         #9a93c4;
  --muted-2:       #6f688f;

  --radius:        16px;
  --radius-sm:     11px;
  --shadow:        0 10px 40px rgba(0, 0, 0, 0.45);
  --player-h:      132px;

  --font-title: "Cinzel", "Times New Roman", serif;
  --font-body:  "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 700px at 50% -10%, rgba(107, 63, 160, 0.35), transparent 60%),
    radial-gradient(900px 600px at 85% 20%, rgba(139, 92, 246, 0.14), transparent 55%),
    radial-gradient(700px 700px at 10% 90%, rgba(217, 180, 95, 0.07), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
}

.hidden { display: none !important; }

a { color: var(--gold-bright); text-decoration: none; }

/* ---------- Emblema (terceiro olho / geometria sagrada) ---------- */
.emblem {
  display: inline-block;
  width: 84px; height: 84px;
  background: center / contain no-repeat;
  filter: drop-shadow(0 0 18px rgba(167, 139, 250, 0.5));
}
.emblem--sm { width: 44px; height: 44px; }
.emblem--xs { width: 40px; height: 40px; filter: drop-shadow(0 0 10px rgba(167, 139, 250, 0.45)); }

/* ---------- Marca ---------- */
.brand { text-align: center; }
.brand__title {
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 1.9rem;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold) 70%, #b8923f);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.15;
}
.brand__title--sm { font-size: 1.15rem; letter-spacing: 0.12em; }
.brand__x { color: var(--violet-glow); -webkit-text-fill-color: var(--violet-glow); }
.brand__tagline {
  margin-top: 8px; font-size: 0.72rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--muted);
}
.brand__sub { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.02em; }

/* ==================================================================
   LOGIN
   ================================================================== */
.login {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  overflow: hidden;
}
.login__aura {
  position: absolute; width: 460px; height: 460px; border-radius: 50%;
  top: 18%; left: 50%; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent 65%);
  filter: blur(30px);
  animation: pulse 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pulse {
  0%, 100% { opacity: 0.55; transform: translateX(-50%) scale(1); }
  50%      { opacity: 0.9;  transform: translateX(-50%) scale(1.08); }
}
.login__card {
  position: relative; width: 100%; max-width: 380px;
  background: rgba(23, 18, 58, 0.7);
  border: 1px solid rgba(217, 180, 95, 0.25);
  border-radius: 22px;
  padding: 34px 26px 26px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow), inset 0 0 40px rgba(139, 92, 246, 0.08);
}
.brand--login .emblem { margin-bottom: 6px; }
.login__form { margin-top: 26px; display: flex; flex-direction: column; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field__label {
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.field input {
  width: 100%; padding: 13px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.95rem; font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder { color: var(--muted-2); }
.field input:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.btn {
  cursor: pointer; border: none; font-family: var(--font-body);
  font-size: 0.98rem; font-weight: 500; border-radius: var(--radius-sm);
  padding: 14px; transition: transform 0.12s, filter 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn--primary {
  margin-top: 6px;
  color: #1a1330; font-weight: 600; letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: 0 8px 24px rgba(217, 180, 95, 0.28);
}
.btn--primary:hover { filter: brightness(1.06); }

.login__msg { min-height: 1em; font-size: 0.82rem; color: var(--violet-glow); text-align: center; }
.login__link {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-family: var(--font-body); font-size: 0.8rem;
  text-decoration: underline; text-underline-offset: 3px; padding: 2px; margin: 0 auto;
}
.login__link:hover { color: var(--gold-bright); }
.login__hint { margin-top: 20px; text-align: center; font-size: 0.86rem; color: var(--muted); }
.login__note {
  margin-top: 14px; text-align: center; font-size: 0.68rem; color: var(--muted-2);
  line-height: 1.5;
}

/* ==================================================================
   APP
   ================================================================== */
.app { min-height: 100%; padding-bottom: calc(var(--player-h) + env(safe-area-inset-bottom)); }

.header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px calc(14px);
  padding-top: calc(14px + env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(10, 9, 24, 0.92), rgba(10, 9, 24, 0.72) 70%, transparent);
  backdrop-filter: blur(10px);
}
.brand--header { display: flex; align-items: center; gap: 12px; text-align: left; }
.brand--header .brand__title { margin: 0; }

.icon-btn {
  display: grid; place-items: center;
  width: 42px; height: 42px; flex: none;
  background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%; color: var(--muted); cursor: pointer;
  transition: color 0.2s, background 0.2s, transform 0.12s;
}
.icon-btn:hover { color: var(--gold-bright); background: var(--surface-2); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn--sm { width: 36px; height: 36px; }

.main { padding: 8px 16px 20px; max-width: 640px; margin: 0 auto; }

/* ---------- Busca ---------- */
.search {
  position: relative; margin: 8px 0 16px;
}
.search__icon {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  color: var(--muted-2); pointer-events: none;
}
.search input {
  width: 100%; padding: 13px 14px 13px 44px;
  background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px; color: var(--text); font-size: 0.95rem; font-family: var(--font-body);
}
.search input::placeholder { color: var(--muted-2); }
.search input:focus {
  outline: none; border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}

/* ---------- Chips de filtro ---------- */
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; cursor: pointer; white-space: nowrap;
  padding: 8px 15px; border-radius: 999px;
  font-size: 0.82rem; color: var(--muted);
  background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.18s;
}
.chip:hover { color: var(--text); }
.chip.active {
  color: #1a1330; font-weight: 600;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  border-color: transparent;
}

.count { margin: 14px 2px 8px; font-size: 0.76rem; color: var(--muted-2); letter-spacing: 0.03em; }

/* ---------- Lista de faixas ---------- */
.tracks { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.track {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 13px;
  background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius); cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.1s;
}
.track:hover { background: var(--surface-2); }
.track:active { transform: scale(0.995); }
.track.playing {
  border-color: rgba(167, 139, 250, 0.6);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.16), rgba(217, 180, 95, 0.06));
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.25), inset 0 0 30px rgba(139, 92, 246, 0.08);
}

.track__num {
  width: 30px; flex: none; text-align: center;
  font-family: var(--font-title); font-size: 0.9rem; color: var(--gold);
}
.track.playing .track__num { color: transparent; }
.track__eq {
  display: none; gap: 2px; width: 30px; justify-content: center; align-items: flex-end; height: 16px;
}
.track.playing .track__eq { display: flex; }
.track.playing .track__num { display: none; }
.track__eq span {
  width: 3px; background: var(--violet-glow); border-radius: 2px;
  animation: eq 0.9s ease-in-out infinite;
}
.track__eq span:nth-child(1) { animation-delay: 0s; }
.track__eq span:nth-child(2) { animation-delay: 0.25s; }
.track__eq span:nth-child(3) { animation-delay: 0.5s; }
@keyframes eq {
  0%, 100% { height: 4px; } 50% { height: 16px; }
}
.track.playing.paused .track__eq span { animation-play-state: paused; }

.track__body { flex: 1; min-width: 0; }
.track__title {
  font-size: 0.96rem; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track.playing .track__title { color: var(--violet-glow); }
.track__tags { margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; }
.track__tag {
  font-size: 0.66rem; letter-spacing: 0.02em; color: var(--muted);
  padding: 2px 8px; border-radius: 999px;
  background: var(--gold-soft); border: 1px solid rgba(217, 180, 95, 0.18);
}

.fav-btn {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center;
  background: none; border: none; cursor: pointer; color: var(--muted-2);
  transition: color 0.2s, transform 0.15s;
}
.fav-btn:active { transform: scale(0.8); }
.fav-btn.active { color: var(--gold-bright); }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 0.9rem; }

/* ==================================================================
   PLAYER
   ================================================================== */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(18, 12, 43, 0.86), rgba(10, 9, 24, 0.98));
  border-top: 1px solid rgba(217, 180, 95, 0.22);
  backdrop-filter: blur(18px);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}
.player__progress { display: flex; align-items: center; gap: 10px; }
.player__time { font-size: 0.68rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; }
.player__time:last-child { text-align: right; }

.seek {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 4px; cursor: pointer;
  background: linear-gradient(to right, var(--violet) 0%, var(--gold) var(--seek, 0%), rgba(255,255,255,0.12) var(--seek, 0%));
}
.seek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--gold-bright); box-shadow: 0 0 8px rgba(242, 217, 139, 0.7);
  cursor: pointer;
}
.seek::-moz-range-thumb {
  width: 14px; height: 14px; border: none; border-radius: 50%;
  background: var(--gold-bright); box-shadow: 0 0 8px rgba(242, 217, 139, 0.7); cursor: pointer;
}

.player__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.player__meta { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; }
.np-emblem { flex: none; }
.player__info { min-width: 0; }
.player__title {
  font-size: 0.92rem; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player__tags { font-size: 0.7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.player__controls { display: flex; align-items: center; gap: 4px; flex: none; }
.play-btn {
  display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  color: #1a1330;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: 0 6px 20px rgba(217, 180, 95, 0.35);
  transition: transform 0.12s, filter 0.2s;
}
.play-btn:hover { filter: brightness(1.06); }
.play-btn:active { transform: scale(0.92); }

.icon-btn.active { color: var(--violet-glow); background: rgba(139, 92, 246, 0.18); border-color: rgba(167, 139, 250, 0.4); }

/* Telas maiores: centraliza e limita largura do player */
@media (min-width: 680px) {
  .player { padding-left: max(16px, calc((100vw - 640px) / 2)); padding-right: max(16px, calc((100vw - 640px) / 2)); }
  .brand__title { font-size: 2.1rem; }
}
