/* ==========================================================================
   Radio Irmandade Roots — Design System Sound System
   Cores: Pan-Africanas / Rastafari de Luxo (Verde, Ouro Imperial, Carmesim, Onix)
   Estetica: Mesa de Som Profissional, Vinil Giratorio, Acabamento Metalico e VU Meter
   ========================================================================== */

:root {
  --bg-deep: #070809;
  --bg-card: rgba(16, 22, 18, 0.75);
  --bg-card-border: rgba(212, 175, 55, 0.28);
  --bg-surface: #101412;

  --gold-primary: #D4AF37;
  --gold-bright: #F5B041;
  --gold-glow: rgba(212, 175, 55, 0.4);

  --green-deep: #0E2A18;
  --green-vibrant: #1DB954;
  --green-glow: rgba(29, 185, 84, 0.35);

  --red-vibrant: #E74C3C;
  --red-glow: rgba(231, 76, 60, 0.4);

  --text-main: #F4F6F4;
  --text-muted: #8E9A90;
  --text-gold: #E8C15A;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --shadow-gold: 0 0 25px rgba(212, 175, 55, 0.25);
  --shadow-card: 0 16px 40px rgba(0, 0, 0, 0.85);

  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  background-image:
    radial-gradient(circle at 50% 10%, rgba(14, 42, 24, 0.6) 0%, transparent 60%),
    radial-gradient(circle at 10% 80%, rgba(212, 175, 55, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(231, 76, 60, 0.07) 0%, transparent 45%);
}

/* Background com textura acustica sutil de Sound System */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  opacity: 0.035;
  pointer-events: none;
  background-image: radial-gradient(#FFFFFF 1px, transparent 1px);
  background-size: 16px 16px;
  z-index: 0;
}

/* Container Principal */
.app-container {
  width: 100%;
  max-width: 540px;
  min-height: 100vh;
  padding: 16px 16px calc(85px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

@media (min-width: 680px) {
  .app-container {
    max-width: 760px;
    min-height: auto;
    padding: 28px 24px 40px;
    margin: 24px auto;
  }
}

/* Header & Top Bar */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(14, 20, 16, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-full);
  margin-bottom: 20px;
}

/* Desktop Navigation */
.desktop-nav {
  display: none;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.45);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (min-width: 680px) {
  .desktop-nav {
    display: flex;
  }
}

.nav-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.nav-tab-btn.active {
  color: #111412;
  background: var(--gold-bright);
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px var(--gold-glow);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-logo-mini {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--gold-primary);
  object-fit: cover;
  flex-shrink: 0;
}

.station-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--gold-bright);
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.station-badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.status-text {
  white-space: nowrap;
}

.led-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #555;
  transition: all 0.3s ease;
}

.station-badge.is-active {
  border-color: rgba(29, 185, 84, 0.4);
  color: var(--green-vibrant);
}

.station-badge.is-active .led-indicator {
  background: var(--red-vibrant);
  box-shadow: 0 0 10px var(--red-vibrant);
  animation: ledPulse 1.4s infinite ease-in-out;
}

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

/* Card Central do Player */
.player-card {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 24px 20px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
}

/* Faixa dourada decorativa superior */
.player-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

/* Layout Estúdio do Player (Console 2 Colunas) */
.player-studio-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.player-left-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.player-right-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 12px;
}

/* Banner de Vinheta (Ducking Ativo) */
.jingle-alert {
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--gold-bright);
  color: var(--gold-bright);
  transition: all 0.3s ease;
}

.jingle-alert.hidden {
  display: none;
}

.pulse-gold {
  animation: goldPulse 1s infinite alternate;
}

@keyframes goldPulse {
  from { box-shadow: 0 0 5px rgba(212, 175, 55, 0.3); }
  to { box-shadow: 0 0 16px rgba(245, 176, 65, 0.7); }
}

/* Toca-Discos de Vinil & Leao de Juda */
.turntable-wrapper {
  position: relative;
  width: 250px;
  height: 250px;
  margin: 4px 0 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.turntable-chassis {
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, #19201B 0%, #0B0E0C 100%);
  border: 2px solid rgba(212, 175, 55, 0.35);
  border-radius: 50%;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9), 0 8px 24px rgba(0, 0, 0, 0.6);
}

.vinyl-disc {
  width: 232px;
  height: 232px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, transparent 35px, #111111 36px, #1e1e1e 48px, #111111 60px, #191919 75px, #111111 90px, #1a1a1a 105px, #0e0e0e 116px);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.9);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ranhuras do Vinil */
.vinyl-disc::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.08) 0deg,
    transparent 60deg,
    rgba(255, 255, 255, 0.08) 120deg,
    transparent 180deg,
    rgba(255, 255, 255, 0.08) 240deg,
    transparent 300deg,
    rgba(255, 255, 255, 0.08) 360deg
  );
  pointer-events: none;
}

.vinyl-disc.is-spinning {
  animation: spinVinyl 3.6s infinite linear;
}

@keyframes spinVinyl {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Selo Central com o Leao de Juda */
.vinyl-label {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px solid var(--gold-primary);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
  overflow: hidden;
  position: relative;
  z-index: 2;
  background: #000;
}

.vinyl-label img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Pino central */
.vinyl-center-hole {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #D4AF37;
  border-radius: 50%;
  border: 2px solid #000;
  z-index: 3;
}

/* Braco do Toca-Discos (Tonearm) */
.tonearm {
  position: absolute;
  top: 8px;
  right: -6px;
  width: 50px;
  height: 110px;
  pointer-events: none;
  transform-origin: 38px 12px;
  transform: rotate(-32deg);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 4;
}

.tonearm.is-playing {
  transform: rotate(0deg);
}

.tonearm-pivot {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 16px;
  height: 16px;
  background: #444;
  border: 2px solid var(--gold-primary);
  border-radius: 50%;
}

.tonearm-stick {
  position: absolute;
  top: 18px;
  right: 12px;
  width: 4px;
  height: 75px;
  background: linear-gradient(180deg, #D4AF37, #999);
  border-radius: 2px;
}

.tonearm-cartridge {
  position: absolute;
  bottom: 12px;
  right: 8px;
  width: 12px;
  height: 16px;
  background: var(--red-vibrant);
  border-radius: 2px;
  border: 1px solid var(--gold-bright);
}

/* Informacoes da Faixa Atual */
.track-info {
  text-align: center;
  width: 100%;
}

.track-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.3px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-gold);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Visualizador de Frequencias sonoras (VU Meter) */
.visualizer-wrapper {
  width: 100%;
  height: 52px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#visualizer-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Barra de Tempo */
.time-display {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  padding: 0 4px;
}

/* Controles Centrais de Reproducao */
.transport-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  margin-top: 4px;
}

.ctrl-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
}

.ctrl-btn:hover {
  color: var(--gold-bright);
  transform: scale(1.05);
}

.ctrl-btn:active {
  transform: scale(0.95);
}

.ctrl-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.play-main-btn {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-primary));
  color: #070809;
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 20px var(--gold-glow);
}

.play-main-btn:hover {
  background: linear-gradient(135deg, #FFF, var(--gold-bright));
  color: #000;
  box-shadow: 0 0 28px rgba(245, 176, 65, 0.7);
}

.play-main-btn svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.hidden {
  display: none !important;
}

/* Modulo de Volume & Disparo Manual */
.volume-section {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-full);
}

.mute-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.mute-btn:hover, .mute-btn.is-muted {
  color: var(--red-vibrant);
}

.mute-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.volume-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  background: #252D27;
  border-radius: var(--radius-full);
  outline: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--gold-bright);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px var(--gold-glow);
  transition: transform 0.15s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Botao de Vinheta / Sound Effect */
.jingle-trigger-btn {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--gold-primary);
  color: var(--gold-bright);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.jingle-trigger-btn:hover {
  background: var(--gold-primary);
  color: #000;
  box-shadow: 0 0 15px var(--gold-glow);
}

.jingle-trigger-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Footer & Selo Roots */
.footer-info {
  margin-top: 18px;
  text-align: center;
}

.roots-creed {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.roots-flag-bar {
  display: flex;
  height: 3px;
  width: 120px;
  margin: 8px auto 0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.flag-green { flex: 1; background: var(--green-vibrant); }
.flag-gold { flex: 1; background: var(--gold-bright); }
.flag-red { flex: 1; background: var(--red-vibrant); }

/* Ajustes Mobile First */
@media (max-width: 420px) {
  .turntable-wrapper {
    width: 220px;
    height: 220px;
  }
  .vinyl-disc {
    width: 204px;
    height: 204px;
  }
  .vinyl-label {
    width: 80px;
    height: 80px;
  }
  .tonearm {
    right: -12px;
  }
}

/* ==========================================================================
   Preamp Analogico Sound System (Douk Audio Little Bear VU4 Replica)
   ========================================================================== */

.preamp-rack {
  margin-top: 18px;
  background: linear-gradient(180deg, #1C1E22 0%, #121316 60%, #0A0B0D 100%);
  border: 2px solid #2A2F36;
  border-radius: var(--radius-md);
  padding: 16px 14px;
  position: relative;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

/* Textura metalica sutil de aluminio escovado */
.preamp-rack::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  opacity: 0.6;
}

/* Parafusos sextavados de montagem em rack */
.rack-screw {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, #555 30%, #222 100%);
  border: 1px solid #111;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.8);
}

.rack-screw.top-left { top: 8px; left: 8px; }
.rack-screw.top-right { top: 8px; right: 8px; }
.rack-screw.bottom-left { bottom: 8px; left: 8px; }
.rack-screw.bottom-right { bottom: 8px; right: 8px; }

/* Cabecalho do Preamp */
.preamp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.preamp-brand {
  display: flex;
  flex-direction: column;
}

.brand-sub {
  font-size: 0.62rem;
  letter-spacing: 1.2px;
  color: #77807B;
  font-weight: 700;
  text-transform: uppercase;
}

.brand-model {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #DDD;
}

.badge-vu4 {
  background: #C0392B;
  color: #FFF;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.7rem;
  margin-left: 2px;
  font-weight: 900;
  box-shadow: 0 0 6px rgba(192, 57, 43, 0.5);
}

.preamp-title-tag {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.preamp-title-tag span:first-child {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--gold-bright);
}

.crossover-tag {
  font-size: 0.6rem;
  letter-spacing: 1px;
  color: var(--green-vibrant);
  font-weight: 600;
}

/* Chassis dos Mostradores Analogicos */
.vu4-chassis {
  background: #08090A;
  border: 1px solid #20242A;
  border-radius: var(--radius-sm);
  padding: 6px;
  margin: 10px 0;
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.95), 0 2px 4px rgba(255, 255, 255, 0.03);
}

#vu4-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

/* Painel de Controle de Equalizacao */
.eq-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.eq-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.eq-heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #8C9890;
  text-transform: uppercase;
}

.light-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.light-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: #8C9890;
}

.light-select {
  background: #141619;
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--gold-bright);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 6px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.light-select option {
  background: #101214;
  color: #EEE;
}

/* Grade de Sliders de Equalizacao */
.eq-sliders-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.eq-channel {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.eq-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
}

.eq-band-name {
  font-weight: 700;
  color: #DDD;
}

.eq-band-freq {
  color: #777;
  font-size: 0.58rem;
}

.eq-val {
  color: var(--gold-bright);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.65rem;
}

.eq-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: #25282E;
  border-radius: var(--radius-full);
  outline: none;
}

.eq-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--gold-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 6px var(--gold-glow);
  transition: transform 0.15s ease;
}

.eq-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--gold-bright);
}

/* Presets Rapidos */
.eq-presets-row {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.eq-preset-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #AAA;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 36px;
}

.eq-preset-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-primary);
  color: var(--gold-bright);
}

.eq-preset-btn.active {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
}

/* ==========================================================================
   Controle de Abas (Tab Views)
   ========================================================================== */
.tab-view {
  display: none;
  width: 100%;
}

.tab-view.active {
  display: block;
  animation: fadeInTabView 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ==========================================================================
   Mobile Bottom Tab Bar (bottomtabbar)
   ========================================================================== */
.mobile-bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(60px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(9, 12, 10, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(212, 175, 55, 0.22);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.7);
}

@media (min-width: 680px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

.bottom-tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 8px 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.bottom-tab-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: transform 0.2s ease, fill 0.2s ease;
}

.bottom-tab-btn:hover {
  color: var(--text-main);
}

.bottom-tab-btn.active {
  color: var(--gold-bright);
}

.bottom-tab-btn.active svg {
  transform: translateY(-2px);
  fill: var(--gold-bright);
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.5));
}

.bottom-tab-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 28%;
  right: 28%;
  height: 2px;
  background: var(--gold-bright);
  border-radius: var(--radius-full);
  box-shadow: 0 0 8px var(--gold-glow);
}

/* ==========================================================================
   Secao Editorial: Historia do Reggae no Maranhao
   ========================================================================== */
.history-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 680px) {
  .history-card {
    padding: 32px 30px;
    gap: 30px;
  }
}

.history-header {
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
  padding-bottom: 16px;
}

.history-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.history-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gold-bright);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.history-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold-primary);
  text-transform: uppercase;
}

.history-lead {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.6;
  font-weight: 400;
}

.history-chapters-wrapper {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.history-chapter {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 4px solid var(--gold-primary);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.history-chapter:hover {
  transform: translateY(-2px);
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(212, 175, 55, 0.25);
}

.history-chapter.border-green {
  border-left-color: var(--green-vibrant);
}

.history-chapter.border-gold {
  border-left-color: var(--gold-primary);
}

.history-chapter.border-red {
  border-left-color: var(--red-vibrant);
}

.chapter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.chapter-badge {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.chapter-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.3px;
  flex: 1;
  min-width: 200px;
}

.history-text {
  font-size: 0.84rem;
  line-height: 1.68;
  color: #C8D0CA;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-text strong {
  color: var(--gold-bright);
  font-weight: 700;
}

/* Secao Glossario */
.glossary-section {
  border-top: 1px solid rgba(212, 175, 55, 0.18);
  padding-top: 20px;
}

.glossary-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-bright);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.glossary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 520px) {
  .glossary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.glossary-item {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(212, 175, 55, 0.14);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
}

.glossary-item:hover {
  border-color: rgba(212, 175, 55, 0.35);
  background: rgba(212, 175, 55, 0.04);
}

.glossary-term {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--gold-bright);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.glossary-def {
  font-size: 0.75rem;
  line-height: 1.5;
  color: #A9B3AC;
}

/* Listas nos Capitulos Historiograficos */
.chapter-content ul {
  margin: 12px 0 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chapter-content li {
  font-size: 0.84rem;
  line-height: 1.6;
  color: #C8D0CA;
}

.chapter-content li strong {
  color: var(--gold-bright);
}

.chapter-content p {
  font-size: 0.85rem;
  line-height: 1.68;
  color: #C8D0CA;
  margin-bottom: 12px;
}

.chapter-content p strong {
  color: var(--gold-bright);
}

/* Tabelas de Melos e Cronologia Historiografica */
.melo-table-wrapper,
.chrono-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(0, 0, 0, 0.45);
}

.melo-table,
.chrono-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.78rem;
  min-width: 500px;
}

.melo-table th,
.chrono-table th {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-bright);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}

.melo-table td,
.chrono-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #C8D0CA;
  vertical-align: top;
  line-height: 1.5;
}

.melo-table tr:hover td,
.chrono-table tr:hover td {
  background: rgba(212, 175, 55, 0.04);
}

.melo-table td strong,
.chrono-table td strong {
  color: var(--gold-bright);
}

/* ==========================================================================
   Modo Desktop: Studio Console 2 Colunas e Viewport Fit Sem Barra de Rolagem
   ========================================================================== */
@media (min-width: 860px) {
  html, body {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
  }

  .app-container {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    padding: 14px 28px 12px;
    margin: 0 auto;
    max-width: 1060px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .top-header {
    margin-bottom: 10px;
    flex-shrink: 0;
  }

  .tab-view#tab-player {
    flex: 1;
    display: none;
    min-height: 0;
    height: 100%;
  }

  .tab-view#tab-player.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .player-card {
    flex: 1;
    max-height: calc(100vh - 100px);
    padding: 22px 36px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 0;
  }

  .player-studio-layout {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    align-items: center;
    gap: 44px;
    width: 100%;
    max-width: 960px;
  }

  .player-left-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .player-right-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 10px;
  }

  .turntable-wrapper {
    width: 246px;
    height: 246px;
    margin: 0 auto 8px;
  }

  .vinyl-disc {
    width: 228px;
    height: 228px;
  }

  .track-info {
    margin-top: 6px;
    text-align: center;
  }

  .track-title {
    font-size: 1.25rem;
    max-width: 360px;
  }

  .track-artist {
    font-size: 0.95rem;
    max-width: 360px;
  }

  .visualizer-wrapper {
    height: 72px;
    width: 100%;
    max-width: 440px;
    margin-bottom: 2px;
  }

  .time-display {
    max-width: 440px;
  }

  .transport-controls {
    gap: 24px;
    margin-top: 2px;
  }

  .volume-section.minimal-volume {
    max-width: 290px;
    margin: 2px auto 0;
  }

  /* Abas com conteudo longo mantem rolagem interna suave no desktop */
  .tab-view#tab-preamp,
  .tab-view#tab-history {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 8px;
  }

  .tab-view#tab-preamp::-webkit-scrollbar,
  .tab-view#tab-history::-webkit-scrollbar {
    width: 6px;
  }

  .tab-view#tab-preamp::-webkit-scrollbar-thumb,
  .tab-view#tab-history::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.35);
    border-radius: 4px;
  }

  .tab-view#tab-preamp::-webkit-scrollbar-track,
  .tab-view#tab-history::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
  }
}


