:root {
  --primary: #c371f5;
  --secondary: #ff6b9d;
  --bg-dark: #0a0118;
  --glass: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --text-main: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.6);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: "Outfit", sans-serif;
  height: 100vh;
  overflow: hidden;
}

/* Fundo de Vídeo */
.video-background {
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -3;
    transform: translate(-50%, -50%);
    object-fit: cover;
    filter: brightness(0.4) blur(2px); /* Escurece e desfoca levemente para destacar a letra */
    transition: opacity 1s ease;
}

/* Fundo Animado (Backup caso não tenha vídeo) */
.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 30%, #2e0854 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, #1a0230 0%, transparent 40%);
  z-index: -4;
  transition: background 3s ease;
}

.stars-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(white 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.1;
  z-index: -1;
}

/* Canvas de Karaoke */
#karaokeCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* UI Layer */
.ui-container {
  position: relative;
  z-index: 10;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  pointer-events: none;
}

.ui-container * {
  pointer-events: auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 2px;
}

.logo span {
  color: var(--secondary);
}

.song-info {
  text-align: right;
}

.song-info h1 {
  font-size: 2rem;
  margin-bottom: 0.2rem;
}

.song-info p {
  color: var(--text-dim);
  font-size: 1rem;
}

/* Controles Base */
.player-controls {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

body:hover .player-controls {
  opacity: 1;
  transform: translateY(0);
}

.time-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-variant-numeric: tabular-nums;
}

.progress-wrapper {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  width: 0%;
  border-radius: 4px;
  box-shadow: 0 0 15px var(--secondary);
}

.progress-knob {
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.main-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px; /* Espaço entre Play e Stop */
}

.play-btn {
  background: white;
  border: none;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.4);
}

/* Novo botão Stop */
.control-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: white;
}

.control-btn:hover {
  background: rgba(255, 59, 59, 0.8); /* Vermelho Stop */
  border-color: rgba(255, 59, 59, 1);
  transform: scale(1.1);
}

.play-btn svg {
  fill: var(--bg-dark); /* Ícone preto no botão branco */
}

/* Setup Overlay */
.setup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s;
}

.setup-card {
  background: var(--bg-dark);
  border: 1px solid var(--glass-border);
  padding: 3rem;
  border-radius: 32px;
  text-align: center;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.setup-card h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.upload-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem 0;
}

.custom-file-upload {
  padding: 1rem;
  background: var(--glass);
  border: 1px dashed var(--text-dim);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s;
}

.custom-file-upload:hover {
  background: rgba(255, 255, 255, 0.15);
}

.custom-file-upload input {
  display: none;
}

/* --- HOME SCREEN --- */
.home-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: rgba(10, 1, 24, 0.95);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.5s ease;
}

.home-screen.hidden {
    opacity: 0; pointer-events: none;
}

.home-content {
    text-align: center;
    max-width: 600px;
    width: 90%;
}

.logo-large {
    font-size: 3.5rem; font-weight: 700; letter-spacing: 5px;
    color: white; margin-bottom: 0.5rem;
    text-shadow: 0 0 30px rgba(195, 113, 245, 0.4);
}
.logo-large span { color: var(--secondary); }
.home-subtitle { color: var(--text-dim); font-size: 1.2rem; margin-bottom: 3rem; letter-spacing: 1px; }

.home-menu { display: flex; flex-direction: column; gap: 1rem; }

/* Nota Final */
.final-score-box {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid gold;
    border-radius: 20px;
    padding: 20px 40px;
    margin-bottom: 3rem;
    animation: popIn 0.8s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    display: inline-block;
}

.score-label {
    color: gold; font-weight: bold; letter-spacing: 2px; font-size: 0.9rem; margin-bottom: 5px;
}
.score-value {
    font-size: 5rem; font-weight: 900; color: white;
    text-shadow: 0 0 20px gold;
    line-height: 1;
}
.score-stars { font-size: 1.5rem; margin-top: 5px; }

@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Circle Progress */
.countdown-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(195, 113, 245, 0.2);
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__circle {
    stroke-dasharray: 326; 
    stroke-dashoffset: 0; /* Começa cheio */
    transition: stroke-dashoffset 1s linear;
    stroke: var(--primary);
    filter: drop-shadow(0 0 5px var(--primary));
}

.countdown-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
    font-family: monospace; /* Para não pular largura */
}

.home-row { display: flex; gap: 1rem; }

.home-btn {
    border: none; border-radius: 16px; padding: 1.5rem;
    cursor: pointer; font-family: 'Outfit', sans-serif;
    transition: all 0.3s;
    display: flex; align-items: center; justify-content: center; gap: 1rem;
    font-size: 1.1rem; font-weight: 600;
}

.home-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; width: 100%;
    box-shadow: 0 10px 30px rgba(195, 113, 245, 0.3);
}
.home-btn.primary:hover { transform: translateY(-3px); box-shadow: 0 15px 40px rgba(195, 113, 245, 0.5); }
.home-btn.primary .text { display: flex; flex-direction: column; align-items: flex-start; }
.home-btn.primary small { font-size: 0.8rem; opacity: 0.8; font-weight: 400; }

.home-btn.secondary {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    color: white; flex: 1;
}
.home-btn.secondary:hover { background: rgba(255,255,255,0.1); border-color: white; }
/* --- WIDGET PRÓXIMA MÚSICA --- */
.next-song-widget {
    position: fixed;
    top: 30px;
    right: 30px;
    background: rgba(195, 113, 245, 0.2); /* Roxo Neon Transparente */
    backdrop-filter: blur(15px);
    border: 1px solid rgba(195, 113, 245, 0.4);
    border-left: 5px solid var(--secondary);
    padding: 15px 25px;
    border-radius: 12px;
    color: white;
    z-index: 900;
    max-width: 300px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    
    transform: translateX(120%); /* Escondido fora da tela */
    transition: transform 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.5s;
    opacity: 0;
}

.next-song-widget.visible {
    transform: translateX(0);
    opacity: 1;
}

.next-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--secondary);
    font-weight: 700;
    margin-bottom: 5px;
}

.next-title {
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.next-requester {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    margin-top: 3px;
    font-style: italic;
}

.home-btn.ghost {
    background: transparent; border: 1px dashed var(--secondary);
    color: var(--secondary); width: 100%;
}
.home-btn.ghost:hover { background: rgba(255, 107, 157, 0.1); }

/* --- MODAL CONFIG --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-card {
    background: #1a0230; padding: 2rem; border-radius: 24px;
    width: 90%; max-width: 400px;
    border: 1px solid var(--glass-border);
}
.modal-card h2 { margin-bottom: 2rem; text-align: center; }
.settings-group { margin-bottom: 1.5rem; }
.settings-group label { display: block; margin-bottom: 0.5rem; color: var(--text-dim); }
.color-options { display: flex; gap: 10px; justify-content: center; }
.color-dot { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.color-dot:hover { transform: scale(1.1); }
.close-btn-modal {
    width: 100%; padding: 1rem; background: var(--primary); color: white;
    border: none; border-radius: 12px; cursor: pointer; font-weight: bold;
    margin-top: 1rem;
}

.demo-btn {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 1rem 2rem;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  font-weight: 600;
  transition: all 0.3s;
}

.demo-btn:hover {
    background: var(--primary);
    color: white;
}

.library-toggle-btn {
    background: var(--glass);
    border: 1px solid var(--primary);
    color: var(--text-main);
    padding: 1rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.3s;
}

.library-toggle-btn:hover {
    background: rgba(195, 113, 245, 0.2);
    border-color: var(--secondary);
}

/* Sidebar Biblioteca */
.library-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background: rgba(10, 1, 24, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    display: flex;
    flex-direction: column;
    padding: 2rem;
}

.library-sidebar.open {
    right: 0;
}

.library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.library-header h3 {
    font-size: 1.5rem;
    color: var(--primary);
}

#closeLibraryBtn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.search-box input {
    width: 100%;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 12px;
    color: white;
    margin-bottom: 2rem;
    outline: none;
}

.search-box input:focus {
    border-color: var(--primary);
}

.song-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.song-item {
    background: var(--glass);
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.song-item:hover {
    background: rgba(255,255,255,0.15);
    border-color: var(--primary);
    transform: translateX(-5px);
}

.song-item h4 {
    margin-bottom: 0.2rem;
}

.song-item p {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.loading-msg {
    text-align: center;
    color: var(--text-dim);
    margin-top: 2rem;
}

/* --- QR CODE --- */
/* --- QR CODE WIDGET FIXO --- */
.qr-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(10, 1, 24, 0.4);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 200;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    width: 140px;
}

.qr-widget:hover {
    transform: scale(1.05) translateY(-5px);
    background: rgba(10, 1, 24, 0.8);
    border-color: var(--primary);
    box-shadow: 0 15px 40px rgba(195, 113, 245, 0.2);
}

.qr-widget h3 {
    font-size: 0.8rem;
    color: var(--secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    text-align: center;
}

.qr-container {
    background: white;
    padding: 6px;
    border-radius: 12px;
    width: 110px;
    height: 110px;
}

.qr-widget p {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.7);
    margin-top: 8px;
    text-align: center;
}/* --- INTERMISSION SCREEN FIXO --- */
.intermission-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 1, 24, 0.98); /* Fundo quase preto e opaco */
    z-index: 9999; /* ACIMA DE TUDO */
    display: flex; justify-content: center; align-items: center;
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.5s;
    visibility: hidden; /* Garante que não clica quando invisivel */
}

.intermission-screen.active { 
    opacity: 1; 
    pointer-events: all; 
    visibility: visible;
}

.intermission-content {
    text-align: center;
    max-width: 800px;
    width: 90%;
    animation: zoomIn 0.5s ease;
}

@keyframes zoomIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.next-label-large {
    font-size: 1.5rem; letter-spacing: 5px; color: var(--secondary);
    font-weight: 700; margin-bottom: 1rem; text-transform: uppercase;
}

#interTitle { font-size: 3.5rem; color: white; margin-bottom: 0.5rem; text-shadow: 0 0 30px rgba(255,255,255,0.2); }
#interArtist { font-size: 2rem; color: var(--text-dim); margin-bottom: 3rem; font-weight: 300; }

.inter-requester {
    display: inline-flex; align-items: center; gap: 15px;
    background: rgba(255,255,255,0.05); padding: 15px 30px; border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.1); margin-bottom: 3rem;
}

.inter-requester .avatar { font-size: 2rem; }
.inter-requester div { text-align: left; }
.inter-requester small { display: block; font-size: 0.8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
#interRequester { font-size: 1.2rem; font-weight: bold; color: var(--primary); }

.start-now-btn {
    background: white; color: var(--bg-dark); border: none;
    padding: 1rem 3rem; font-size: 1.2rem; font-weight: 800;
    border-radius: 50px; cursor: pointer; transition: 0.3s;
    box-shadow: 0 10px 30px rgba(255,255,255,0.2);
    display: block; margin: 0 auto; /* Centraliza botão */
}
.start-now-btn:hover { transform: scale(1.05); box-shadow: 0 15px 40px rgba(255,255,255,0.4); }

/* Nota Final */
.final-score-box {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid gold;
    border-radius: 20px;
    padding: 20px 40px;
    margin-bottom: 3rem;
    animation: popIn 0.8s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    display: inline-block;
}

.score-label {
    color: gold; font-weight: bold; letter-spacing: 2px; font-size: 0.9rem; margin-bottom: 5px;
}
.score-value {
    font-size: 5rem; font-weight: 900; color: white;
    text-shadow: 0 0 20px gold;
    line-height: 1;
}
.score-stars { font-size: 1.5rem; margin-top: 5px; }

@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Circle Progress */
.countdown-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(195, 113, 245, 0.2);
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__circle {
    stroke-dasharray: 326; 
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
    stroke: var(--primary);
    filter: drop-shadow(0 0 5px var(--primary));
}

.countdown-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
    font-family: monospace;
}
/* --- NOVO LAYOUT TV DEMO --- */
.catalog-guide {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(195, 113, 245, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(195, 113, 245, 0.4);
    border-right: none;
    border-radius: 20px 0 0 20px;
    padding: 20px 10px;
    cursor: pointer;
    z-index: 1100;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.catalog-guide:hover {
    background: rgba(195, 113, 245, 0.4);
    padding-right: 20px;
    box-shadow: -10px 0 30px rgba(195, 113, 245, 0.3);
}

.guide-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.guide-icon {
    font-size: 1.5rem;
    transform: rotate(90deg);
}

.guide-text {
    font-weight: 800;
    letter-spacing: 3px;
    color: white;
    font-size: 0.9rem;
}

.qr-floating-corner {
    position: fixed;
    bottom: 40px;
    right: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 1100;
    animation: fadeIn 1s ease;
}

.qr-floating-corner #homeQrCode {
    background: white;
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(195, 113, 245, 0.3);
    transition: transform 0.3s ease;
}

.qr-floating-corner:hover #homeQrCode {
    transform: scale(1.1);
}

.qr-floating-corner p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

