:root {
  color-scheme: dark;
  --bg: #08070d;
  --bg-soft: #11101a;
  --card: rgba(255, 255, 255, 0.08);
  --card-strong: rgba(255, 255, 255, 0.13);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f8f7ff;
  --muted: #b8b4c7;
  --primary: #ff1f57;
  --primary-2: #ff8a00;
  --accent: #7c3cff;
  --success: #29e6a7;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 31, 87, 0.26), transparent 34rem),
    radial-gradient(circle at 85% 15%, rgba(124, 60, 255, 0.22), transparent 28rem),
    linear-gradient(180deg, #14101d 0%, var(--bg) 38%, #050409 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 7, 13, 0.82);
  backdrop-filter: blur(18px);
}

.brand,
.main-nav,
.hero-actions,
.hero-stats,
.section-heading,
.score-board,
.mini-stats {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand-mark {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 28px rgba(255, 31, 87, 0.28);
  font-size: 0.8rem;
  letter-spacing: 0;
}

.brand-logo {
  width: clamp(10rem, 19vw, 15rem);
  height: 4.2rem;
  object-fit: contain;
  object-position: left center;
}

.main-nav {
  gap: 1.35rem;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.main-nav a:hover,
.section-heading a:hover {
  color: var(--text);
}

.ghost-button,
.primary-button,
.secondary-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.ghost-button {
  padding: 0.75rem 1.05rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.25rem;
}

.primary-button {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  box-shadow: 0 16px 40px rgba(255, 31, 87, 0.28);
}

.secondary-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.small {
  padding: 0.7rem 1rem;
}

.ghost-button:hover,
.primary-button:hover,
.secondary-button:hover,
.connect-button:hover,
.challenge-button:hover {
  transform: translateY(-2px);
}

main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(310px, 0.82fr);
  gap: 2rem;
  align-items: stretch;
  padding: clamp(3rem, 8vw, 7rem) 0 3rem;
}

.hero-copy {
  display: grid;
  align-content: center;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--success);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 1.15rem;
  font-size: clamp(2.6rem, 7vw, 5.9rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  letter-spacing: -0.055em;
}

.hero-text,
.panel-copy {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.hero-actions {
  gap: 0.8rem;
  flex-wrap: wrap;
  margin: 1.1rem 0 1.8rem;
}

.hero-stats,
.mini-stats {
  gap: 0.8rem;
  flex-wrap: wrap;
  color: var(--muted);
}

.login-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  max-width: 520px;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.9rem;
}

.login-card strong {
  display: block;
}

.login-card p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.hero-stats span,
.mini-stats span,
.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.6rem 0.85rem;
}

.hero-stats strong,
.mini-stats strong {
  color: var(--text);
}

.featured-card,
.panel,
.battle-card,
.singer-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--card-strong), rgba(255, 255, 255, 0.04));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.featured-card {
  position: relative;
  overflow: hidden;
  min-height: 470px;
  padding: 2rem;
  border-radius: 2rem;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.82)),
    radial-gradient(circle at 50% 22%, rgba(255, 138, 0, 0.38), transparent 15rem),
    linear-gradient(135deg, rgba(255, 31, 87, 0.45), rgba(124, 60, 255, 0.34));
}

.featured-card::after {
  content: "";
  position: absolute;
  inset: auto -15% -18% 18%;
  height: 58%;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.22), transparent);
  filter: blur(8px);
}

.featured-card h2,
.featured-card p,
.score-board,
.live-badge {
  position: relative;
  z-index: 1;
}

.featured-card h2 {
  margin-top: 13rem;
}

.live-badge {
  display: inline-flex;
  border-radius: 999px;
  background: var(--primary);
  padding: 0.42rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.score-board {
  gap: 0.8rem;
  margin-top: 1.3rem;
}

.score-board div {
  flex: 1;
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.34);
  padding: 1rem;
}

.score-board span,
.battle-meta,
.singer-style {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.score-board strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.7rem;
}

.content-section,
.grid-layout {
  padding: 2rem 0;
}

.section-heading {
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading.compact {
  align-items: flex-start;
}

.section-heading a,
.pill {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.stage-row,
.battle-grid,
.singer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.stage-card {
  min-height: 230px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.45rem;
  padding: 1.2rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
}

.stage-card span,
.stage-card strong {
  position: relative;
  z-index: 1;
  display: block;
}

.stage-card span {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 900;
}

.stage-card strong {
  margin-top: 7.5rem;
  font-size: 1.25rem;
  line-height: 1.1;
}

.pop {
  background: radial-gradient(circle at 80% 20%, rgba(255, 31, 87, 0.72), transparent 9rem), #191122;
}

.sertanejo {
  background: radial-gradient(circle at 80% 20%, rgba(255, 138, 0, 0.72), transparent 9rem), #191122;
}

.rock {
  background: radial-gradient(circle at 80% 20%, rgba(124, 60, 255, 0.72), transparent 9rem), #191122;
}

.gospel {
  background: radial-gradient(circle at 80% 20%, rgba(41, 230, 167, 0.55), transparent 9rem), #191122;
}

.grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 1rem;
}

.panel {
  border-radius: 1.6rem;
  padding: 1.3rem;
}

.ranking-list {
  display: grid;
  gap: 0.72rem;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}

.ranking-item,
.battle-header,
.singer-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.ranking-item {
  justify-content: space-between;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.85rem;
}

.rank-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.rank-number,
.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  font-weight: 900;
}

.rank-number {
  width: 2.2rem;
  height: 2.2rem;
  background: rgba(255, 255, 255, 0.1);
}

.avatar {
  width: 2.85rem;
  height: 2.85rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.rank-name,
.singer-name {
  display: block;
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-genre {
  color: var(--muted);
  font-size: 0.84rem;
}

.rank-score {
  color: var(--success);
  font-size: 1.25rem;
  font-weight: 900;
}

.meter {
  height: 0.95rem;
  overflow: hidden;
  margin: 1.2rem 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-2), var(--success));
}

.battle-card,
.singer-card {
  border-radius: 1.35rem;
  padding: 1rem;
}

.battle-card {
  display: grid;
  gap: 1rem;
}

.battle-header,
.singer-header {
  justify-content: space-between;
}

.battle-title,
.singer-card p {
  margin: 0;
}

.battle-title {
  font-size: 1.05rem;
  font-weight: 900;
}

.battle-score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.8rem;
  align-items: center;
  text-align: center;
}

.battle-score strong {
  font-size: 1.6rem;
}

.versus {
  color: var(--muted);
  font-weight: 900;
}

.challenge-button,
.connect-button {
  width: 100%;
  border: 0;
  border-radius: 0.9rem;
  cursor: pointer;
  padding: 0.8rem 1rem;
  color: white;
  font-weight: 900;
}

.challenge-button {
  background: linear-gradient(135deg, var(--accent), var(--primary));
}

.connect-button {
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.12);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.recorder-panel,
.score-panel {
  min-height: 100%;
}

.recorder-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.2rem 0;
}

.danger-button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff204d, #a50034);
  box-shadow: 0 16px 40px rgba(255, 31, 87, 0.28);
  color: white;
  cursor: pointer;
  font-weight: 900;
  padding: 0.9rem 1.25rem;
}

.recording-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.recording-dot.active {
  background: var(--primary);
  box-shadow: 0 0 0 0 rgba(255, 31, 87, 0.75);
  animation: pulse 1.2s infinite;
}

.status-message {
  color: var(--muted);
  line-height: 1.6;
}

.playback-card {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 1rem;
}

.playback-card h3,
.singer-card h3 {
  margin: 0 0 0.75rem;
}

.playback-card audio {
  width: 100%;
}

.score-panel h2 {
  margin: 0.8rem 0 0;
  font-size: clamp(4rem, 10vw, 7rem);
  line-height: 0.9;
}

.singer-card p {
  color: var(--muted);
  line-height: 1.55;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  max-width: 340px;
  transform: translateY(1rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(13, 12, 20, 0.92);
  box-shadow: var(--shadow);
  opacity: 0;
  padding: 1rem;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 0.75rem rgba(255, 31, 87, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 31, 87, 0);
  }
}

@media (max-width: 980px) {
  .hero,
  .grid-layout {
    grid-template-columns: 1fr;
  }

  .stage-row,
  .battle-grid,
  .singer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .hero {
    padding-top: 2.2rem;
  }

  .featured-card {
    min-height: 390px;
  }

  .section-heading,
  .battle-header,
  .singer-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .stage-row,
  .battle-grid,
  .singer-grid {
    grid-template-columns: 1fr;
  }
}
