:root {
  --bg: #0b0f14;
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.72);
  --muted2: rgba(255, 255, 255, 0.56);

  --glass: rgba(20, 26, 35, 0.40);
  --glass2: rgba(255, 255, 255, 0.08);

  --stroke: rgba(255, 255, 255, 0.16);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.55);

  --accent: #9b7bff;
  --accent2: #4df1ff;
  --ok: #35ffb5;

  --radius: 22px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow-x: hidden;
}

.bg {
  position: fixed;
  inset: 0;
  background: url("assets/bg.gif") center / cover no-repeat;
  z-index: -2;
  transform: scale(1.02);
  will-change: filter, transform;
}

/* Overlay escuro para legibilidade */
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 55% at 50% 35%, rgba(0,0,0,0.35), rgba(0,0,0,0.75)),
    linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0.78));
  z-index: -1;
}

.wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 22px 16px;
}

.card {
  width: min(720px, 100%);
  padding: 18px 16px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(80% 60% at 20% 10%, rgba(155, 123, 255, 0.20), transparent 60%),
    radial-gradient(70% 55% at 90% 20%, rgba(77, 241, 255, 0.18), transparent 55%),
    radial-gradient(60% 50% at 30% 90%, rgba(53, 255, 181, 0.12), transparent 60%);
  pointer-events: none;
  filter: blur(10px);
}

.hero {
  text-align: center;
  padding: 10px 8px 2px;
  position: relative;
}

.kicker {
  margin: 6px 0 10px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.title {
  margin: 0 0 6px;
  font-family: "Bebas Neue", "Poppins", sans-serif;
  font-size: clamp(44px, 8vw, 86px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: lowercase;

  /* sombra + outline leve */
  text-shadow:
    0 2px 0 rgba(0,0,0,0.25),
    0 10px 30px rgba(0,0,0,0.55),
    0 0 18px rgba(155, 123, 255, 0.22);
  -webkit-text-stroke: 1px rgba(0,0,0,0.25);
}

.audio, .aura, .footer {
  position: relative;
  margin-top: 16px;
  padding: 14px 14px;
  border-radius: calc(var(--radius) - 8px);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.audio__status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.25);
  box-shadow: 0 0 0 6px rgba(255,255,255,0.06);
}

.audio__actions {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.vol {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.10);
}

.vol__label {
  color: var(--muted2);
  font-size: 0.85rem;
}

.vol__range {
  width: 100%;
  accent-color: var(--accent2);
}

.btn {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease, filter 160ms ease;
  user-select: none;
}

.btn:focus-visible {
  outline: 3px solid rgba(77, 241, 255, 0.35);
  outline-offset: 3px;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  border-color: rgba(255,255,255,0.22);
}

.btn:active {
  transform: translateY(0px) scale(0.99);
  filter: brightness(0.98);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: linear-gradient(135deg, rgba(155,123,255,0.85), rgba(77,241,255,0.60));
  border-color: rgba(255,255,255,0.22);
  text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

.btn--ghost {
  background: rgba(0,0,0,0.22);
}

.btn--subtle {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
}

.aura__top {
  display: grid;
  gap: 10px;
}

.aura__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.aura__name {
  font-weight: 800;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.aura__pct {
  color: var(--muted);
  font-weight: 700;
}

.aura__note {
  color: var(--muted2);
  font-size: 0.9rem;
}

.bar {
  position: relative;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.10);
}

.bar__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(155,123,255,0.95), rgba(77,241,255,0.80), rgba(53,255,181,0.75));
  box-shadow: 0 0 18px rgba(77,241,255,0.18);
  transition: width 220ms ease;
}

.bar__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.14), transparent);
  transform: translateX(-60%);
  animation: shine 2.2s infinite linear;
  pointer-events: none;
  opacity: 0.8;
}

@keyframes shine {
  to { transform: translateX(60%); }
}

.aura__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.footer {
  text-align: center;
  color: var(--muted2);
  font-size: 0.9rem;
}

.footer strong {
  color: rgba(255,255,255,0.95);
}

/* Desktop layout */
@media (min-width: 720px) {
  .card { padding: 22px 22px; }
  .audio__actions {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
  .aura__actions {
    grid-template-columns: 1fr 1fr;
  }
}

/* PARTY MODE (piscando) */
body.party-mode .bg {
  animation: partyBg 520ms infinite steps(2, end);
}

body.party-mode .card,
body.party-mode .audio,
body.party-mode .aura,
body.party-mode .footer {
  animation: partyCard 520ms infinite steps(2, end);
}

body.party-mode .title {
  animation: partyText 520ms infinite steps(2, end);
}

body.party-mode .btn {
  animation: partyBtn 520ms infinite steps(2, end);
}

@keyframes partyBg {
  0% {
    filter: brightness(0.85) contrast(1.05) saturate(1.1) hue-rotate(0deg);
    transform: scale(1.02);
  }
  50% {
    filter: brightness(1.35) contrast(1.25) saturate(1.8) hue-rotate(120deg);
    transform: scale(1.035);
  }
  100% {
    filter: brightness(0.85) contrast(1.05) saturate(1.1) hue-rotate(0deg);
    transform: scale(1.02);
  }
}

@keyframes partyCard {
  0% {
    box-shadow: 0 18px 60px rgba(0,0,0,0.55);
    border-color: rgba(255,255,255,0.16);
    background: rgba(20, 26, 35, 0.40);
    filter: none;
  }
  50% {
    box-shadow:
      0 22px 80px rgba(0,0,0,0.60),
      0 0 22px rgba(77,241,255,0.22),
      0 0 34px rgba(155,123,255,0.18);
    border-color: rgba(77,241,255,0.40);
    background: rgba(255,255,255,0.10);
    filter: brightness(1.15) saturate(1.25);
  }
  100% {
    box-shadow: 0 18px 60px rgba(0,0,0,0.55);
    border-color: rgba(255,255,255,0.16);
    background: rgba(20, 26, 35, 0.40);
    filter: none;
  }
}

@keyframes partyText {
  0% {
    text-shadow:
      0 2px 0 rgba(0,0,0,0.25),
      0 10px 30px rgba(0,0,0,0.55),
      0 0 18px rgba(155, 123, 255, 0.22);
  }
  50% {
    text-shadow:
      0 2px 0 rgba(0,0,0,0.25),
      0 12px 34px rgba(0,0,0,0.65),
      0 0 22px rgba(77, 241, 255, 0.30),
      0 0 34px rgba(53, 255, 181, 0.18);
  }
  100% {
    text-shadow:
      0 2px 0 rgba(0,0,0,0.25),
      0 10px 30px rgba(0,0,0,0.55),
      0 0 18px rgba(155, 123, 255, 0.22);
  }
}

@keyframes partyBtn {
  0% { filter: none; }
  50% { filter: brightness(1.2) saturate(1.4); box-shadow: 0 0 18px rgba(77,241,255,0.22); }
  100% { filter: none; }
}

/* Respeitar preferências do usuário */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
