:root {
  --bg-dark: #08090d;
  --bg-card: rgba(18, 20, 28, 0.7);
  --bg-card-hover: rgba(28, 32, 45, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-focus: rgba(0, 240, 255, 0.35);
  
  --primary: #00f0ff;
  --primary-glow: rgba(0, 240, 255, 0.3);
  --secondary: #a855f7;
  --secondary-glow: rgba(168, 85, 247, 0.3);
  --accent: #ff007f;
  --accent-glow: rgba(255, 0, 127, 0.3);
  --gold: #fbbf24;
  --success: #10b981;
  --danger: #ef4444;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(0, 240, 255, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(168, 85, 247, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(255, 0, 127, 0.03) 0%, transparent 50%);
  background-attachment: fixed;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- GLASSMORPHISM HELPERS --- */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.glass-inner {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ========================================================================= */
/* 1. AUTH LANDING PAGE                                                      */
/* ========================================================================= */
.auth-landing-wrapper {
  display: none;
  min-height: 100vh;
  padding: 3rem 1.5rem;
  align-items: center;
  justify-content: center;
}

.auth-landing-wrapper.active {
  display: flex;
  animation: fadeIn 0.4s ease;
}

.auth-landing-container {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3.5rem;
  max-width: 1200px;
  width: 100%;
  align-items: center;
}

@media (max-width: 960px) {
  .auth-landing-container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 1.5rem;
}

.logo-icon {
  font-size: 1.7rem;
  filter: drop-shadow(0 0 10px var(--primary-glow));
}

.logo-title {
  color: #fff;
}

.logo-highlight {
  color: var(--primary);
}

.landing-hero-heading {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -1px;
  color: #fff;
  margin-bottom: 1rem;
}

@media (max-width: 600px) {
  .landing-hero-heading {
    font-size: 2.1rem;
  }
}

.landing-hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.feature-pills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .feature-pills-grid {
    grid-template-columns: 1fr;
  }
}

.feature-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.feature-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(0, 240, 255, 0.3);
  transform: translateY(-2px);
}

.pill-icon {
  font-size: 1.5rem;
}

.feature-pill div {
  display: flex;
  flex-direction: column;
}

.feature-pill strong {
  color: #fff;
  font-weight: 700;
}

.feature-pill span {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.auth-card {
  padding: 2.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: -0.25rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1rem 0;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--glass-border);
}

.auth-divider span {
  padding: 0 0.75rem;
}

.auth-debug-box {
  margin-top: 1.25rem;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
}

.auth-debug-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 0.4rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  color: var(--primary);
}

.auth-debug-content {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 150px;
  overflow-y: auto;
  line-height: 1.5;
  color: #6ee7b7;
}

/* ========================================================================= */
/* 2. WORKSTATION APPLICATION                                                */
/* ========================================================================= */
.workstation-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.workstation-wrapper.active {
  display: flex;
  animation: fadeIn 0.4s ease;
}

/* --- HEADER & NAVIGATION --- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem 1.5rem;
  margin: 0.75rem 1.25rem 0;
  border-radius: var(--radius-md);
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}

.header-tag {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-left: 1px solid var(--glass-border);
  padding-left: 0.75rem;
}

.header-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.suite-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.3rem 0.4rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-border);
  flex-wrap: wrap;
  justify-content: center;
}

.suite-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
}

.suite-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.suite-tab.active {
  color: #000;
  background: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #eab308;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.5);
}

.status-pill.online .status-dot {
  background: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.wallet-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius-full);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.15);
}

.wallet-icon {
  font-size: 1.1rem;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.5));
}

.wallet-amount {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--gold);
}

.wallet-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-icon-tiny {
  background: transparent;
  border: none;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  color: var(--text-dim);
  transition: transform 0.2s ease;
}

.btn-icon-tiny:hover {
  transform: rotate(180deg);
  color: #fff;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-fast);
}

.floating-logout-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  background: rgba(18, 20, 28, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--radius-full);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 12px rgba(239, 68, 68, 0.2);
  cursor: pointer;
  transition: var(--transition-normal);
}

.floating-logout-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--danger);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.7), 0 0 20px rgba(239, 68, 68, 0.5);
  transform: translateY(-2px);
}

.floating-logout-btn .float-icon {
  font-size: 1.1rem;
}

@media (max-width: 1200px) {
  .app-header {
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }
}

/* --- MAIN WORKSTATION CONTAINER --- */
.app-main {
  flex: 1;
  padding: 1.25rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.suite-section {
  display: none;
}

.suite-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* --- HERO HEADERS --- */
.hero-header {
  text-align: center;
  margin-bottom: 2rem;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.4rem;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 700px;
  margin: 0 auto;
}

/* --- TAB PILL BAR --- */
.tab-pill-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.tab-pill {
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.tab-pill:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.tab-pill.active {
  color: #fff;
  background: rgba(168, 85, 247, 0.2);
  border-color: var(--secondary);
  box-shadow: 0 0 14px var(--secondary-glow);
}

.subtab-panel {
  display: none;
}

.subtab-panel.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

/* --- GRID LAYOUTS & CARDS --- */
.grid-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .grid-layout {
    grid-template-columns: 1fr;
  }
}

.card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: -0.5rem;
}

/* --- DROP ZONE --- */
.drop-zone {
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-normal);
  background: rgba(255, 255, 255, 0.01);
}

.drop-zone.mini {
  padding: 1.5rem 1rem;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--primary);
  background: rgba(0, 240, 255, 0.03);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
}

.drop-zone.has-file {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.06);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.15);
  padding: 1.25rem 1rem;
}

.selected-file-badge {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-align: left;
}

.selected-file-badge .badge-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.4));
}

.selected-file-badge .badge-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.selected-file-badge .badge-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selected-file-badge .badge-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 0.15rem;
}

.btn-clear-badge {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-clear-badge:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger);
  color: #fff;
}

.drop-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.drop-heading {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.drop-subtext {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.file-input-hidden {
  display: none;
}

/* --- FORMS & INPUTS --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-fast);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.code-input {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.custom-checkbox input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: var(--transition-normal);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #0284c7);
  color: #000;
  font-weight: 700;
  box-shadow: 0 0 16px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--glass-border);
}

.btn-outline:hover {
  border-color: var(--primary);
  background: rgba(0, 240, 255, 0.05);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #e11d48);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 16px var(--accent-glow);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
}

.btn-icon-round {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 0;
  background: var(--primary);
  color: #000;
}

.btn-icon-sm {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
}

.btn-icon-sm:hover {
  color: #fff;
}

/* --- STEM PRESETS --- */
.stem-presets {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stem-preset-btn.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

/* --- MULTI-TRACK STEM MIXER --- */
.stem-mixer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stem-track-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

.stem-track-name {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  min-width: 100px;
  color: var(--primary);
}

.stem-track-audio {
  flex: 1;
  height: 32px;
}

/* --- KARAOKE GAME HUD --- */
.game-hud {
  display: grid;
  grid-template-columns: 1.5fr 2fr 1fr 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
}

@media (max-width: 1000px) {
  .game-hud {
    grid-template-columns: 1fr 1fr;
  }
}

.hud-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary);
  text-transform: uppercase;
}

.hud-title {
  font-size: 1.2rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pitch-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-bottom: 0.2rem;
}

#pitchCanvas {
  width: 100%;
  height: 48px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

.hud-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.score-pct-box {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.hud-score .score-val {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(251, 191, 36, 0.6), 0 0 24px rgba(0, 240, 255, 0.4);
  letter-spacing: -0.5px;
}

.score-pct-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}

.streak-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.streak-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #fff;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.streak-multi {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 700;
}

.rec-dot-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulseRec 1.2s infinite;
}

@keyframes pulseRec {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.rec-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--danger);
}

.time-readout {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* --- TELEPROMPTER ARENA & LRC SYNCHRONIZER --- */
.teleprompter-arena {
  position: relative;
  min-height: 420px;
  max-height: 520px;
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  margin-bottom: 1rem;
}

.stage-glow {
  position: absolute;
  top: -30%;
  left: 15%;
  width: 70%;
  height: 100%;
  background: radial-gradient(ellipse, rgba(0, 240, 255, 0.12) 0%, transparent 75%);
  pointer-events: none;
}

.lrc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  z-index: 10;
  margin-bottom: 0.5rem;
}

.lrc-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lrc-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
  animation: pulseDot 1s infinite alternate;
}

@keyframes pulseDot {
  0% { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(1.3); opacity: 1; }
}

.lrc-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lrc-sync-offset-control {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.5rem;
}

.sync-label {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.sync-value-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 48px;
  text-align: center;
  user-select: none;
}

.btn-icon-xs {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.btn-icon-xs:hover {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
}

.lrc-tool-btn {
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
}

/* Modern Luminous Lyric Vocal Tracker (Beacon & Sonic Beam) */
.lrc-vocal-tracker {
  position: absolute;
  top: 31%;
  left: 50%;
  transform: translate3d(-50%, -50%, 0);
  pointer-events: none;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: left 0.16s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.8));
}

.lrc-vocal-tracker.active {
  opacity: 1;
}

.tracker-sparkle {
  width: 4px;
  height: 4px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 8px #ffffff, 0 0 18px var(--primary);
  margin-bottom: 3px;
  animation: sparkleFloat 1.2s infinite alternate ease-in-out;
}

@keyframes sparkleFloat {
  0% { transform: translateY(0) scale(0.8); opacity: 0.5; }
  100% { transform: translateY(-4px) scale(1.4); opacity: 1; }
}

.tracker-ring {
  position: absolute;
  top: 4px;
  width: 24px;
  height: 24px;
  border: 1.5px solid rgba(0, 240, 255, 0.7);
  border-radius: 50%;
  animation: ringSonar 1.5s infinite cubic-bezier(0.1, 0.8, 0.3, 1);
  pointer-events: none;
}

@keyframes ringSonar {
  0% { transform: scale(0.5); opacity: 1; border-color: rgba(0, 240, 255, 0.9); }
  100% { transform: scale(2.2); opacity: 0; border-color: rgba(251, 191, 36, 0); }
}

.tracker-gem {
  width: 13px;
  height: 13px;
  background: linear-gradient(135deg, #00f0ff 0%, #a855f7 50%, #fbbf24 100%);
  border-radius: 3.5px;
  transform: rotate(45deg);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.9), 0 0 24px rgba(168, 85, 247, 0.8), inset 0 0 4px #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  animation: gemPulse 2s infinite ease-in-out alternate;
}

@keyframes gemPulse {
  0% { transform: rotate(45deg) scale(0.92); filter: drop-shadow(0 0 6px var(--primary)); }
  100% { transform: rotate(45deg) scale(1.15); filter: drop-shadow(0 0 16px #fbbf24); }
}

.tracker-beam {
  width: 2px;
  height: 20px;
  background: linear-gradient(to bottom, rgba(0, 240, 255, 0.85) 0%, rgba(251, 191, 36, 0.4) 70%, transparent 100%);
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.6);
  margin-top: 4px;
  border-radius: 1px;
}

/* Single-Line Focus Teleprompter Stage - Screen Fitted */
.single-line-viewport {
  width: 100%;
  min-height: 220px;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
  padding: 1rem 1.5rem;
}

.single-line-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1100px;
  text-align: center;
  gap: 1rem;
}

.active-lyric-line {
  font-size: clamp(1.6rem, 3.8vw, 2.75rem);
  font-weight: 900;
  line-height: 1.35;
  color: #ffffff;
  text-align: center;
  width: 100%;
  max-width: 100%;
  padding: 0 0.5rem;
  letter-spacing: -0.3px;
  text-shadow: 0 0 25px rgba(255, 255, 255, 0.45), 0 0 45px rgba(0, 240, 255, 0.25);
  transition: opacity 0.2s ease, transform 0.2s ease, font-size 0.15s ease;
  animation: lineEntrance 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  word-break: normal;
  overflow-wrap: break-word;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

@keyframes lineEntrance {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.upcoming-lyric-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  max-width: 95%;
  min-height: 28px;
  letter-spacing: 0.2px;
  transition: opacity 0.25s ease;
  text-align: center;
}

.upcoming-lyric-preview:not(:empty)::before {
  content: 'Next ▸';
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: var(--radius-full);
  padding: 0.15rem 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Progressive Smooth Word Flow */
.lyric-word {
  display: inline-block;
  position: relative;
  transition: color 0.12s ease, transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1), text-shadow 0.12s ease;
  padding: 0 0.15em;
  color: rgba(255, 255, 255, 0.9);
  white-space: pre-wrap;
}

.lyric-word.placeholder {
  color: var(--primary);
  font-size: 2rem;
  font-weight: 800;
  text-shadow: 0 0 20px var(--primary-glow);
}

.lyric-word.sung {
  color: var(--primary);
  text-shadow: 0 0 14px var(--primary-glow), 0 0 24px rgba(0, 240, 255, 0.6);
  transform: translateY(-1.5px);
}

.lyric-word.active-word {
  color: transparent;
  background-image: linear-gradient(
    90deg,
    #fbbf24 0%,
    #00f0ff var(--word-progress, 60%),
    rgba(255, 255, 255, 0.98) var(--word-progress, 60%),
    rgba(255, 255, 255, 0.7) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 0 18px rgba(0, 240, 255, 0.8), 0 0 30px rgba(251, 191, 36, 0.5);
  transform: translateY(-3px) scale(1.08);
  font-weight: 900;
}

.lyric-word.active-word::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: var(--word-progress, 100%);
  height: 2px;
  background: linear-gradient(90deg, #fbbf24, #00f0ff);
  border-radius: 2px;
  box-shadow: 0 0 8px #00f0ff;
  transition: width 0.04s linear;
}

/* Timeline Scrubber */
.lrc-timeline-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 850px;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
}

.timeline-time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 45px;
  text-align: center;
}

.timeline-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  accent-color: var(--primary);
  cursor: pointer;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* --- STAGE CONTROLS --- */
.stage-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
}

.control-cluster {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.slider-cluster {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.slider-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.slider-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.range-slider {
  accent-color: var(--primary);
  width: 100px;
}

/* --- SCORECARD REVIEW --- */
.scorecard-container {
  padding: 2.5rem;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.scorecard-badge {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--gold);
}

.scorecard-title {
  font-size: 2rem;
  font-weight: 800;
  margin: 0.5rem 0 1.5rem;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .score-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.grade-card {
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.12) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.grade-circle {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 25px rgba(251, 191, 36, 0.8), 0 0 45px rgba(251, 191, 36, 0.4);
  margin-bottom: 0.35rem;
}

.grade-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 1px;
}

.metric-card {
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.highlight-card {
  background: radial-gradient(circle, rgba(0, 240, 255, 0.15) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1.5px solid rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
}

.metric-val.highlight-val {
  color: var(--primary);
  text-shadow: 0 0 16px var(--primary-glow);
  font-size: 2.1rem;
}

.metric-lbl {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.feedback-box {
  padding: 1.25rem;
  text-align: left;
  margin-bottom: 1.5rem;
}

.feedback-header {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.feedback-text {
  font-size: 1rem;
  color: var(--text-main);
  line-height: 1.5;
}

.recording-box {
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.rec-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.full-width-audio {
  width: 100%;
}

.score-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* --- PREVIEW BOXES & OUTPUTS --- */
.code-preview {
  background: rgba(0, 0, 0, 0.4);
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #38bdf8;
  max-height: 360px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.transcript-box, .diarization-box, .timeline-container, .video-preview-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  min-height: 220px;
  max-height: 380px;
  overflow-y: auto;
}

.placeholder-text {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-style: italic;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.metric-box {
  padding: 1.25rem;
  text-align: center;
}

.metric-box .val {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.2rem;
}

.metric-box .lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* --- AUTH TABS & FORMS --- */
.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.75rem;
}

.auth-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  padding-bottom: 0.25rem;
  transition: var(--transition-fast);
}

.auth-tab:hover {
  color: #fff;
}

.auth-tab.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 1rem;
}

.auth-form.active {
  display: flex;
}

.alert-box {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.alert-box.success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

/* --- UTILITIES --- */
.hidden {
  display: none !important;
}

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mb-3 { margin-bottom: 0.75rem; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-dim);
}

.empty-icon {
  font-size: 2.5rem;
}

.spinner-glow {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 240, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 16px var(--primary-glow);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 1rem 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.3s ease;
}

.stage-steps {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.step-pill {
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.step-pill.active {
  color: var(--primary);
  background: rgba(0, 240, 255, 0.1);
  font-weight: 700;
}

/* ========================================================================= */
/* CYPHER 32: TRAP & HIP-HOP FREESTYLE ARENA STYLES                          */
/* ========================================================================= */
.cypher-hero-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.35);
  padding: 0.25rem 0.85rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.cypher-config-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.cypher-style-group, .cypher-action-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.cypher-stage {
  padding: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.cypher-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.bar-counter-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.bar-pill {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 900;
  color: #ffffff;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.4);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-sm);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.rhyme-scheme-pill {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.cypher-bar-progress-track {
  width: 190px;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.cypher-bar-progress-fill {
  width: 3.125%;
  height: 100%;
  background: linear-gradient(90deg, #00f0ff, #fbbf24);
  box-shadow: 0 0 8px #00f0ff;
  transition: width 0.2s ease;
}

.cypher-center-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.beat-dots-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.beat-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-dim);
  transition: all 0.08s ease;
}

.beat-dot.active-beat {
  background: rgba(0, 240, 255, 0.35);
  border-color: #00f0ff;
  color: #ffffff;
  transform: scale(1.18);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.8);
}

.beat-dot.hit-beat {
  border-color: rgba(251, 191, 36, 0.4);
}

.beat-dot.hit-beat.active-beat {
  background: linear-gradient(135deg, #fbbf24, #ef4444);
  border-color: #fbbf24;
  color: #ffffff;
  transform: scale(1.3);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.9), 0 0 35px rgba(239, 68, 68, 0.6);
}

.bpm-readout {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.instruments-pill {
  font-size: 0.7rem;
  font-weight: 700;
  color: #00f0ff;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  margin-top: 0.1rem;
  white-space: nowrap;
}

.cypher-prompter-arena {
  position: relative;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
  text-align: center;
}

.cypher-glow-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.15) 0%, rgba(168, 85, 247, 0.05) 50%, transparent 70%);
  pointer-events: none;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

.cypher-glow-pulse.bass-hit {
  transform: translate(-50%, -50%) scale(1.35);
  opacity: 1;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.3) 0%, rgba(0, 240, 255, 0.15) 50%, transparent 70%);
}

.cypher-active-bar-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  max-width: 900px;
}

.cypher-bar-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.ping-pong-canvas {
  width: 100%;
  max-width: 880px;
  height: 120px;
  border-radius: var(--radius-md);
  background: radial-gradient(ellipse at bottom, rgba(0, 240, 255, 0.05) 0%, rgba(0, 0, 0, 0.25) 70%);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ping-pong-pads-row {
  display: grid;
  grid-template-columns: 90px 90px 90px 1fr;
  gap: 1.25rem;
  align-items: center;
  width: 100%;
  max-width: 880px;
}

.bounce-pad {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s ease;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.bounce-pad.bounce-active {
  background: rgba(0, 240, 255, 0.2);
  border-color: #00f0ff;
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.7), inset 0 0 15px rgba(0, 240, 255, 0.4);
}

.pad-num {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.75);
}

.bounce-pad.bounce-active .pad-num {
  color: #00f0ff;
  text-shadow: 0 0 15px #00f0ff;
  transform: scale(1.15);
}

.rhyme-landing-pad {
  background: rgba(251, 191, 36, 0.06);
  border: 2px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.15);
  transition: all 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.rhyme-landing-pad.bounce-active {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(239, 68, 68, 0.3));
  border-color: #fbbf24;
  transform: translateY(-6px) scale(1.08);
  box-shadow: 0 0 35px rgba(251, 191, 36, 0.8), 0 0 50px rgba(239, 68, 68, 0.5);
}

.pad-target-icon {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #fbbf24;
  text-transform: uppercase;
}

.cypher-rhyme-word {
  font-size: 3.2rem;
  font-weight: 900;
  color: #fbbf24;
  text-shadow: 0 0 25px rgba(251, 191, 36, 0.9), 0 0 45px rgba(251, 191, 36, 0.5);
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 0 0.5rem;
  transition: all 0.1s ease;
  line-height: 1.1;
}

.cypher-rhyme-word.pulse-target {
  transform: scale(1.18);
  color: #00f0ff;
  text-shadow: 0 0 35px rgba(0, 240, 255, 0.95), 0 0 60px rgba(0, 240, 255, 0.7);
}

.cypher-upcoming-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  padding: 0.4rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.upcoming-prefix {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.upcoming-rhyme {
  color: #fbbf24;
  font-weight: 900;
  text-transform: uppercase;
}

.cypher-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
}

/* Live Diction Speech HUD */
.cypher-speech-hud {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1.25rem;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: var(--radius-full);
  margin-bottom: 0.85rem;
  max-width: 780px;
  width: 90%;
  font-size: 0.85rem;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

.speech-indicator {
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}

.speech-transcript {
  font-family: var(--font-mono);
  color: #a7f3d0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
}

/* 64-Bar Rhyme Matrix */
.cypher-matrix-box {
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.matrix-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--gold);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.5rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.matrix-legend {
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.leg-crisp { color: #10b981; }
.leg-rhyme { color: #00f0ff; }
.leg-muffled { color: #f59e0b; }
.leg-miss { color: #ef4444; }

.cypher-bars-matrix {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.5rem;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

@media (max-width: 900px) {
  .cypher-bars-matrix {
    grid-template-columns: repeat(4, 1fr);
  }
}

.bar-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.25rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  transition: all 0.15s ease;
  text-align: center;
}

.bar-cell.crisp {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.55);
  color: #6ee7b7;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.bar-cell.rhyme {
  background: rgba(0, 240, 255, 0.15);
  border-color: rgba(0, 240, 255, 0.45);
  color: #a5f3fc;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.bar-cell.muffled {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde68a;
}

.bar-cell.miss {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.bar-cell.prep {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}

.bar-cell-num {
  font-weight: 800;
  font-size: 0.6rem;
  opacity: 0.75;
  margin-bottom: 0.1rem;
}

.bar-cell-word {
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.bar-cell-status {
  font-size: 0.58rem;
  font-weight: 700;
  opacity: 0.85;
  margin-top: 0.1rem;
}

/* ========================================================================= */
/* CYPHER ENHANCEMENTS: PREP COUNT-IN, UPCOMING QUEUE, & ACE PROMPT BEAT     */
/* ========================================================================= */

.cypher-rhyme-word.prep-word {
  font-size: 2.1rem;
  color: #38bdf8;
  letter-spacing: 3px;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.8), 0 0 40px rgba(56, 189, 248, 0.4);
  animation: pulsePrep 1.2s infinite ease-in-out;
}

@keyframes pulsePrep {
  0%, 100% {
    opacity: 0.7;
    transform: scale(0.97);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

/* ========================================================================= */
/* CYPHER RHYTHM PROMPTER: THE FOUR BARS ON SCREEN (4 BOXES PER BAR)          */
/* ========================================================================= */

.cypher-4bars-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  z-index: 2;
}

.cypher-bar-row {
  display: grid;
  grid-template-columns: 85px 85px 85px 1fr;
  gap: 0.85rem;
  align-items: center;
  width: 100%;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cypher-bar-row.row-active {
  transform: scale(1.02);
  z-index: 3;
}

.cypher-bar-row.row-next {
  opacity: 0.92;
  z-index: 2;
}

.cypher-bar-row.row-queued {
  opacity: 0.82;
}

.cypher-bar-row.row-last {
  opacity: 0.72;
}

/* Box Styling */
.cypher-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  height: 64px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  transition: all 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cypher-box .pad-num {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.75);
  transition: all 0.12s ease;
}

/* Row 1 (Active) Height and High-Contrast */
.row-active .cypher-box {
  height: 72px !important;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.045);
}

.row-active .cypher-box .pad-num {
  font-size: 1.85rem;
  color: rgba(255, 255, 255, 0.95);
}

/* Row 1 Active Bouncing on Beats 1, 2, 3 */
.cypher-box.bounce-active {
  transform: translateY(-5px) scale(1.06);
  border-color: #00f0ff !important;
  background: rgba(0, 240, 255, 0.2) !important;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.8), inset 0 0 15px rgba(0, 240, 255, 0.4) !important;
}

.cypher-box.bounce-active .pad-num {
  color: #00f0ff;
  text-shadow: 0 0 18px #00f0ff;
}

/* Box 4: Rhyme Box in Row 1 (Active) */
.cypher-box.rhyme-box {
  background: rgba(251, 191, 36, 0.06);
  border: 2px solid rgba(251, 191, 36, 0.4);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.16);
  padding: 0.5rem 1rem;
}

/* Empty Prep Slot (Bars 1 & 2: No Rhyme Word at End) */
.cypher-box.rhyme-box.prep-empty-box {
  border: 1.5px dashed rgba(255, 255, 255, 0.14) !important;
  background: rgba(255, 255, 255, 0.015) !important;
  box-shadow: none !important;
}

.row-active .cypher-box.rhyme-box.prep-empty-box {
  border: 1.5px dashed rgba(0, 240, 255, 0.28) !important;
  background: rgba(0, 240, 255, 0.03) !important;
  box-shadow: none !important;
}

.cypher-box.rhyme-box.prep-empty-box.bounce-active {
  border-color: #00f0ff !important;
  background: rgba(0, 240, 255, 0.15) !important;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.6) !important;
}

.row-active .cypher-box.rhyme-box {
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 0 28px rgba(251, 191, 36, 0.25);
}

.cypher-box.rhyme-box.bounce-active {
  transform: translateY(-6px) scale(1.07);
  border-color: #fbbf24 !important;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(239, 68, 68, 0.28)) !important;
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.9), 0 0 60px rgba(239, 68, 68, 0.5) !important;
}

.cypher-box.rhyme-box .cypher-rhyme-word {
  font-size: clamp(1.4rem, 2.8vw, 2.1rem);
  font-weight: 900;
  color: #fbbf24;
  text-shadow: 0 0 22px rgba(251, 191, 36, 0.9), 0 0 45px rgba(251, 191, 36, 0.45);
  text-transform: uppercase;
  letter-spacing: 2px;
  line-height: 1;
  transition: all 0.12s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.cypher-box.rhyme-box .cypher-rhyme-word.pulse-target {
  transform: scale(1.15);
  color: #00f0ff;
  text-shadow: 0 0 35px rgba(0, 240, 255, 0.95), 0 0 55px rgba(0, 240, 255, 0.7);
}

.cypher-box.rhyme-box .cypher-rhyme-word.prep-word {
  font-size: clamp(1.2rem, 2.4vw, 1.65rem);
  color: #38bdf8;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.85);
  animation: pulsePrep 1.2s infinite ease-in-out;
}

/* Rows 2, 3, 4 Rhyme Words Preview Styling */
.row-next .cypher-box.rhyme-box {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.04);
}

.row-next .cypher-box.rhyme-box .cypher-rhyme-word {
  font-size: clamp(1.2rem, 2.3vw, 1.65rem);
  color: #fef08a;
  text-shadow: 0 0 14px rgba(251, 191, 36, 0.6);
}

.row-queued .cypher-box.rhyme-box {
  border-color: rgba(168, 85, 247, 0.3);
  background: rgba(168, 85, 247, 0.04);
}

.row-queued .cypher-box.rhyme-box .cypher-rhyme-word {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: #e9d5ff;
  text-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
}

.row-last .cypher-box.rhyme-box {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.02);
}

.row-last .cypher-box.rhyme-box .cypher-rhyme-word {
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  color: rgba(255, 255, 255, 0.82);
  text-shadow: none;
}

@media (max-width: 768px) {
  .cypher-bar-row {
    grid-template-columns: 46px 46px 46px 1fr;
    gap: 0.45rem;
  }
  .cypher-box {
    height: 52px !important;
  }
  .row-active .cypher-box {
    height: 58px !important;
  }
  .cypher-box .pad-num {
    font-size: 1.15rem;
  }
  .cypher-box.rhyme-box .cypher-rhyme-word {
    font-size: 1.25rem;
    letter-spacing: 1px;
  }
}

@media (max-width: 768px) {
  .cypher-bar-row {
    grid-template-columns: 65px 1fr;
    gap: 0.5rem;
  }
  .row-pads-wrapper {
    grid-template-columns: 46px 46px 46px 1fr;
    gap: 0.4rem;
  }
  .row-box {
    padding: 0.25rem;
  }
  .row-box .pad-num {
    font-size: 1.1rem;
  }
  .row-box.rhyme-box .cypher-rhyme-word {
    font-size: 1.35rem;
  }
}

/* ACE Prompt Beat Elements */
.cypher-ace-btn {
  background: linear-gradient(135deg, #ec4899, #8b5cf6) !important;
  border: none !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.4);
  transition: all 0.2s ease;
}

.cypher-ace-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 26px rgba(236, 72, 153, 0.75) !important;
}

.cypher-custom-beat-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(236, 72, 153, 0.45);
  background: linear-gradient(90deg, rgba(236, 72, 153, 0.16), rgba(139, 92, 246, 0.16));
  margin-top: 0.75rem;
  backdrop-filter: blur(10px);
}

.custom-beat-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
}

.custom-beat-icon {
  font-size: 1.1rem;
}

.custom-beat-title {
  color: #ec4899;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.custom-beat-prompt {
  color: #ffffff;
  font-style: italic;
  max-width: 480px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-beat-meta {
  color: #38bdf8;
  font-family: var(--font-mono);
  font-weight: 700;
}

.prompt-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.prompt-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.8rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.prompt-chip:hover {
  background: rgba(236, 72, 153, 0.22);
  border-color: #ec4899;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.35);
}

.generation-progress-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #f1f5f9;
}

.progress-bar-track {
  width: 100%;
  height: 9px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ec4899, #8b5cf6, #00f0ff);
  transition: width 0.3s ease;
}

.progress-spinner-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.progress-subtext {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
}

