:root {
  --bg-main: #08040f;
  --bg-card: rgba(255, 255, 255, 0.075);
  --bg-card-strong: rgba(255, 255, 255, 0.105);
  --border-soft: rgba(255, 255, 255, 0.12);
  --border-purple: rgba(168, 85, 247, 0.45);

  --text-main: #ffffff;
  --text-soft: #ddd6fe;
  --text-muted: rgba(245, 243, 255, 0.68);

  --purple: #8b5cf6;
  --purple-light: #c084fc;
  --pink: #ec4899;
  --blue: #38bdf8;
  --green: #22c55e;

  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-main);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(236, 72, 153, 0.28), transparent 35%),
    radial-gradient(circle at top right, rgba(139, 92, 246, 0.34), transparent 34%),
    radial-gradient(circle at bottom, rgba(56, 189, 248, 0.12), transparent 38%),
    linear-gradient(135deg, #08040f 0%, #14091f 50%, #090514 100%);
}

button,
input,
select,
a {
  font-family: inherit;
}

button,
a,
.file-picker {
  -webkit-tap-highlight-color: transparent;
}

.app {
  width: 100%;
  min-height: 100vh;
  padding: 28px 16px;
}

.shell {
  width: min(980px, 100%);
  margin: 0 auto;
}

.hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.logo-circle {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -1px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.28), transparent 28%),
    linear-gradient(135deg, var(--purple), var(--pink));
  box-shadow:
    0 18px 45px rgba(139, 92, 246, 0.38),
    inset 0 0 0 1px rgba(255, 255, 255, 0.20);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--purple-light);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 8vw, 4.7rem);
  line-height: 0.95;
  letter-spacing: -0.08em;
}

.subtitle {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  line-height: 1.5;
}

.player-card,
.card,
.tips,
.legal-footer {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.player-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 20px;
  padding: 24px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-soft);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.055)),
    radial-gradient(circle at top left, rgba(236, 72, 153, 0.20), transparent 34%),
    radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.20), transparent 40%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cover {
  width: 180px;
  height: 180px;
  border-radius: 34px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(139, 92, 246, 0.42), rgba(236, 72, 153, 0.36));
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.disc {
  width: 126px;
  height: 126px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #12081d 0 13%, #c084fc 14% 16%, #16091f 17% 38%, #2a103a 39% 42%, #100717 43% 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 20px 40px rgba(0, 0, 0, 0.38);
}

.disc span {
  color: #ffffff;
  font-size: 2rem;
  font-weight: 900;
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.9);
}

.player-card.playing .disc {
  animation: spinDisc 4.8s linear infinite;
}

@keyframes spinDisc {
  to {
    transform: rotate(360deg);
  }
}

.player-info {
  min-width: 0;
}

.player-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.now-playing {
  margin: 0 0 6px;
  color: var(--purple-light);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.player-top h2 {
  margin: 0;
  max-width: 100%;
  color: #ffffff;
  font-size: clamp(1.25rem, 3.4vw, 2rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.badge {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
  background: rgba(139, 92, 246, 0.28);
  border: 1px solid rgba(196, 181, 253, 0.28);
}

.player-subtitle {
  margin: 12px 0 18px;
  color: var(--text-muted);
  line-height: 1.45;
}

.progress-area {
  width: 100%;
}

.time-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: rgba(245, 243, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 800;
}

.progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--pink), var(--blue));
  transition: width 0.16s linear;
}

.visualizer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 38px;
  margin-top: 18px;
}

.visualizer span {
  width: 8px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--purple-light), var(--pink));
  opacity: 0.5;
}

.player-card.playing .visualizer span {
  animation: visualizerPulse 0.75s ease-in-out infinite alternate;
  opacity: 1;
}

.player-card.playing .visualizer span:nth-child(2) {
  animation-delay: 0.1s;
}

.player-card.playing .visualizer span:nth-child(3) {
  animation-delay: 0.2s;
}

.player-card.playing .visualizer span:nth-child(4) {
  animation-delay: 0.3s;
}

.player-card.playing .visualizer span:nth-child(5) {
  animation-delay: 0.4s;
}

.player-card.playing .visualizer span:nth-child(6) {
  animation-delay: 0.5s;
}

.player-card.playing .visualizer span:nth-child(7) {
  animation-delay: 0.6s;
}

@keyframes visualizerPulse {
  from {
    height: 10px;
  }

  to {
    height: 34px;
  }
}

.card {
  padding: 24px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-soft);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.052)),
    rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
}

.box,
.control-box {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.095);
}

.label {
  display: block;
  margin-bottom: 12px;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 900;
}

.file-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 14px 18px;
  border-radius: 18px;
  cursor: pointer;
  color: #ffffff;
  font-weight: 900;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.98), rgba(236, 72, 153, 0.94));
  box-shadow: 0 16px 35px rgba(139, 92, 246, 0.27);
  transition:
    transform 0.18s ease,
    filter 0.18s ease,
    box-shadow 0.18s ease;
}

.file-picker:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 18px 42px rgba(139, 92, 246, 0.35);
}

.file-picker input {
  display: none;
}

.small {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.control-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.control-header .label {
  margin: 0;
}

.control-header strong {
  color: #ffffff;
  font-size: 1rem;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.24);
  border: 1px solid rgba(196, 181, 253, 0.20);
}

input[type="range"] {
  width: 100%;
  height: 8px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(90deg, var(--purple), var(--pink));
}

input[type="range"]::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 50%;
  cursor: pointer;
  background: #ffffff;
  border: 4px solid var(--purple);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.48);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  background: #ffffff;
  border: 4px solid var(--purple);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.48);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  color: rgba(245, 243, 255, 0.58);
  font-size: 0.78rem;
  font-weight: 800;
}

.buttons {
  display: grid;
  grid-template-columns: 1fr 0.7fr 1.25fr;
  gap: 12px;
  margin-top: 20px;
}

button {
  min-height: 54px;
  padding: 13px 16px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 900;
  transition:
    transform 0.16s ease,
    opacity 0.16s ease,
    filter 0.16s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  box-shadow: 0 16px 35px rgba(236, 72, 153, 0.26);
}

.secondary {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.secondary.dark {
  background: rgba(0, 0, 0, 0.28);
}

.status {
  min-height: 22px;
  margin: 18px 0 0;
  color: var(--text-soft);
  text-align: center;
  font-weight: 800;
  line-height: 1.45;
}

.download {
  display: block;
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  color: #052e16;
  text-align: center;
  text-decoration: none;
  font-weight: 950;
  background: linear-gradient(135deg, #4ade80, #22c55e);
  box-shadow: 0 18px 38px rgba(34, 197, 94, 0.26);
  overflow-wrap: anywhere;
}

.hidden {
  display: none !important;
}

.tips {
  margin-top: 22px;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.045);
}

.tips h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.tips p {
  margin: 10px 0 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.legal-footer {
  margin-top: 24px;
  padding: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.10);
  text-align: center;
}

.legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.legal-links a {
  color: #ddd6fe;
  font-weight: 900;
  text-decoration: none;
}

.legal-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.legal-links span {
  color: rgba(255, 255, 255, 0.35);
}

.legal-footer p {
  margin: 0;
  color: rgba(245, 243, 255, 0.72);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ANIMAÇÃO SIMPLES DE GERAÇÃO */
/* Isso esconde qualquer animação antiga que cobria a tela */
.processing-overlay {
  display: none !important;
}

/* Quando estiver gerando, a animação aparece só no botão */
.primary.generating {
  position: relative;
  opacity: 0.92;
  cursor: wait;
  pointer-events: none;
}

/* Bolinha girando dentro do botão */
.primary.generating::before {
  content: "";
  width: 16px;
  height: 16px;
  display: inline-block;
  margin-right: 9px;
  vertical-align: -3px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: buttonSpinner 0.85s linear infinite;
}

/* Mantém o botão bonito mesmo desativado durante a geração */
.primary.generating:disabled {
  opacity: 0.92;
}

@keyframes buttonSpinner {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {
  .app {
    padding: 18px 12px;
  }

  .hero {
    gap: 14px;
    margin-bottom: 18px;
  }

  .logo-circle {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
    border-radius: 20px;
    font-size: 1.12rem;
  }

  .player-card {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px;
  }

  .cover {
    width: 100%;
    height: 160px;
  }

  .disc {
    width: 112px;
    height: 112px;
  }

  .player-top {
    flex-direction: column;
    gap: 10px;
  }

  .badge {
    align-self: flex-start;
  }

  .card {
    padding: 16px;
  }

  .box,
  .control-box {
    padding: 16px;
  }

  .buttons {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .hero {
    align-items: flex-start;
  }

  .logo-circle {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    border-radius: 18px;
    font-size: 1rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .cover {
    height: 140px;
  }

  .disc {
    width: 100px;
    height: 100px;
  }

  .control-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .legal-footer,
  .tips {
    padding: 18px;
  }
}