/* ===== 1MZ Play — design 2026: fundo escuro, vidro fosco, Poppins ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* hidden ganha SEMPRE — mesmo quando a classe define display:flex/grid. */
[hidden] { display: none !important; }

:root {
  --bg: #0b0b14;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(20, 20, 34, 0.78);
  --border: rgba(255, 255, 255, 0.14);
  --text: #f2f1f7;
  --muted: #9a97ad;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --gold: #e8c66a;
  --radius: 24px;
}

html, body { height: 100%; }
body {
  font-family: 'Poppins', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.view { min-height: 100dvh; position: relative; }

/* Fundo em malha de cor (mesh) */
.mesh {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 400px at 15% 10%, rgba(139, 92, 246, 0.22), transparent 65%),
    radial-gradient(700px 500px at 85% 20%, rgba(34, 211, 238, 0.12), transparent 65%),
    radial-gradient(800px 600px at 50% 100%, rgba(139, 92, 246, 0.10), transparent 60%),
    var(--bg);
}

/* Vidro fosco verdadeiro */
.glass {
  background: var(--surface);
  backdrop-filter: blur(28px) saturate(1.3);
  -webkit-backdrop-filter: blur(28px) saturate(1.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.glass-flat {
  background: var(--surface-strong);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ===== Login ===== */
#view-login { display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(420px, 100%);
  padding: 42px 34px;
  text-align: center;
}
.logo-ring {
  width: 84px; height: 84px; margin: 0 auto 18px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-weight: 900; font-size: 22px; letter-spacing: -0.5px;
  background: conic-gradient(from 180deg, var(--accent), var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 0 42px rgba(139, 92, 246, 0.55);
}
.login-title { font-size: 34px; font-weight: 900; letter-spacing: -1.5px; }
.login-title span { color: var(--accent); }
.login-sub { color: var(--muted); font-weight: 300; margin: 6px 0 26px; }
#login-form { display: grid; gap: 12px; }
#login-form input {
  padding: 15px 20px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font: 500 15px 'Poppins', sans-serif;
  outline: none;
  transition: border-color .2s;
}
#login-form input:focus { border-color: var(--accent); }
.btn-primary {
  padding: 15px;
  border: 0; border-radius: 18px;
  background: linear-gradient(90deg, var(--accent), #6d3ef0);
  color: #fff; font: 700 15px 'Poppins', sans-serif;
  cursor: pointer;
  transition: transform .12s ease;
}
.btn-primary:active { transform: scale(0.96); }
.btn-primary:disabled { opacity: .6; }
.login-error { color: #ff7d7d; font-size: 13px; }
.login-hint { color: var(--muted); font-size: 12.5px; font-weight: 300; margin-top: 20px; }

/* ===== Topbar ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
}
.brand { font-weight: 900; font-size: 20px; letter-spacing: -1px; white-space: nowrap; }
.brand span { color: var(--accent); }
.search-wrap {
  flex: 1; max-width: 520px;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  color: var(--muted);
}
.search-wrap input {
  flex: 1; border: 0; background: none; outline: none;
  color: var(--text); font: 500 14px 'Poppins', sans-serif;
}
.user-chip { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.vip-badge {
  padding: 3px 10px; border-radius: 999px;
  background: linear-gradient(90deg, #f5d67b, #c9a441);
  color: #241c05; font-weight: 700; font-size: 11px;
}
.icon-btn {
  border: 0; background: rgba(255, 255, 255, 0.08);
  color: var(--text); width: 38px; height: 38px;
  border-radius: 50%; cursor: pointer; font-size: 16px;
  display: grid; place-items: center;
  transition: transform .12s ease, background .2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.16); }
.icon-btn:active { transform: scale(0.9); }
.icon-btn.on { color: var(--accent); background: rgba(139, 92, 246, 0.18); }

/* ===== Conteúdo ===== */
.content { padding: 26px clamp(16px, 4vw, 40px) 140px; }
.stats-line { color: var(--muted); font-weight: 300; font-size: 14px; margin-bottom: 18px; }
.status { color: var(--muted); padding: 40px 0; text-align: center; font-weight: 300; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}
.card {
  padding: 12px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, border-color .2s, background .2s;
}
.card:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-3px); }
.card:active { transform: scale(0.97); }
.card.playing { border-color: var(--accent); background: rgba(139, 92, 246, 0.12); }
.card-cover {
  width: 100%; aspect-ratio: 1;
  border-radius: 16px; object-fit: cover;
  background: linear-gradient(135deg, #1d1d30, #14141f);
  display: block;
}
.card-title {
  margin-top: 10px;
  font-weight: 700; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-artist {
  color: var(--muted); font-weight: 300; font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-eq { color: var(--accent); font-size: 11px; font-weight: 700; }

.empty { text-align: center; padding: 80px 20px; color: var(--muted); }
.empty-icon { font-size: 52px; margin-bottom: 14px; }
.empty h2 { color: var(--text); font-weight: 900; letter-spacing: -0.5px; margin-bottom: 8px; }
.empty p { font-weight: 300; line-height: 1.6; }

/* ===== Barra do leitor ===== */
.player-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 12px clamp(14px, 3vw, 32px);
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 0;
}
.pb-cover {
  width: 54px; height: 54px; border-radius: 14px; object-fit: cover;
  background: #1d1d30; cursor: pointer;
}
.pb-info { min-width: 0; width: 180px; }
.pb-title { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-artist { color: var(--muted); font-weight: 300; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-center { flex: 1; display: grid; gap: 6px; justify-items: center; }
.pb-controls { display: flex; align-items: center; gap: 12px; }
.play-btn {
  width: 48px; height: 48px; border-radius: 50%;
  border: 0; cursor: pointer; font-size: 18px;
  background: linear-gradient(135deg, var(--accent), #6d3ef0);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 6px 22px rgba(139, 92, 246, 0.45);
  transition: transform .12s ease;
}
.play-btn:active { transform: scale(0.9); }
.play-btn.big { width: 68px; height: 68px; font-size: 24px; }
.icon-btn.big { width: 52px; height: 52px; font-size: 20px; }
.pb-seek { display: flex; align-items: center; gap: 10px; width: min(520px, 100%); }
.pb-time { color: var(--muted); font-size: 11.5px; font-weight: 500; min-width: 34px; text-align: center; }
.pb-right { width: 130px; display: flex; justify-content: flex-end; }

input[type=range] {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 4px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
}
input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border: 0; border-radius: 50%;
  background: var(--accent);
}
#volume { width: 110px; }

/* ===== Now Playing expandido ===== */
.now-playing {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 24px;
  background: rgba(11, 11, 20, 0.72);
  backdrop-filter: blur(40px) saturate(1.4);
  -webkit-backdrop-filter: blur(40px) saturate(1.4);
}
.np-close {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 50%;
  transform: translateX(-50%);
  border: 0; background: rgba(255,255,255,0.1); color: var(--text);
  width: 44px; height: 44px; border-radius: 50%; font-size: 18px; cursor: pointer;
}
.np-cover {
  width: min(78vw, 380px); aspect-ratio: 1;
  border-radius: 28px; object-fit: cover;
  background: #1d1d30;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  margin-bottom: 14px;
}
.np-title { font-weight: 900; font-size: 22px; letter-spacing: -0.5px; text-align: center; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-artist { color: var(--muted); font-weight: 300; }
.np-seek { width: min(78vw, 380px); margin-top: 14px; }
.np-controls { margin-top: 10px; gap: 18px; }

/* ===== Responsivo ===== */
@media (max-width: 760px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .pb-info { width: auto; flex: 1; }
  .pb-center { display: none; }        /* mobile: barra compacta, expandir para controlar */
  .pb-right { display: none; }
  .player-bar { gap: 12px; }
  .pb-mobile-play { display: grid !important; }
  .user-chip #user-name { display: none; }
  .search-wrap { padding: 8px 14px; }
}
.pb-mobile-play { display: none; }
@media (max-width: 760px) {
  .pb-mobile-play {
    width: 44px; height: 44px; border-radius: 50%; border: 0;
    background: linear-gradient(135deg, var(--accent), #6d3ef0);
    color: #fff; font-size: 16px; cursor: pointer;
    place-items: center;
  }
}
