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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, rgb(80, 80, 80, 0.6) 0%, rgb(15, 15, 15) 100%);
    color: white;
    min-height: 100vh;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 16px;
    opacity: 0.8;
}

.step-container {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid rgba(255,255,255,0.2);
    display: none;
}

.step-container.active {
    display: block;
}

.step-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;

}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 16px;
}

.form-input {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: rgba(255,255,255,0.9);
    color: #333;
    font-size: 16px;
    transition: all 0.3s ease;
    text-align: center;
}

.form-input:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 20px rgba(255,255,255,0.3);
}

/* Código de acceso de 4 casillas */
.access-code-group { display: flex; gap: 10px; justify-content: center; }
.access-code-input {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.92);
    color: #111;
    text-align: center;
    font-size: 26px;
    font-weight: 800;
    outline: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.access-code-input:focus { background: #fff; box-shadow: 0 0 0 3px rgba(0,184,148,0.3); border-color: #00b894; }
.access-code-input::-webkit-outer-spin-button,
.access-code-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.access-code-input[type=number] { 
    -moz-appearance: textfield; 
    appearance: textfield;
}

.btn {
    width: 100%;
    padding: 20px;
    border: none;
    border-radius: 15px;
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,255,0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Indicador de carga en botones */
.btn.loading { position: relative; }
.btn.loading::after {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    transform: translateY(-50%);
    animation: spin 0.9s linear infinite;
}

.btn-primary {
    background: linear-gradient(45deg, #00b894, #00cec9);
}

.btn-secondary {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
}

.error-message {
    background: rgba(255, 0, 0, 0.2);
    color: #ff6b6b;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid rgba(255, 0, 0, 0.3);
}

.user-info {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.user-name {
    font-size: 18px;
    font-weight: bold;
    color: #00b894;
}

.add-form {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255,255,255,0.2);
    text-align: center;
}

.queue-section {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 8px;
    margin-bottom: 30px;
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    flex-direction: column;
}

.queue-header {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
}

.queue-item {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.queue-item:hover { 
    background: rgba(255,255,255,0.15); 
    transform: translateY(-2px); 
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}
.queue-item.playing { 
    background: linear-gradient(45deg, #000000, #272727); 
    border-color: #00b894; 
    padding: 15px;
}

.queue-item.playing .queue-content {
    padding: 0;
}
.queue-item .queue-content { 
    position: relative; 
    z-index: 1; 
}

/* Estilos para las cards de la cola */
.queue-card {
    display: flex;
    flex-direction: column;
}

.card-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.card-header .user-name {
    font-weight: 700;
    color: #00b894;
    font-size: 14px;
}

.card-header .dedication {
    font-size: 12px;
    opacity: 0.8;
    color: #ffd700;
}

.card-body {
    padding: 15px;
    flex: 1;
}

.card-body .song-title {
    font-size: 0.9em;
    line-height: 1.3;
    color: #ffffff;
}

.song-duration {
    font-size: 12px;
    font-weight: 600;
    color: #00b894;
    opacity: 0.9;
}

.card-footer {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-remove {
    background: linear-gradient(180deg, #e06f68, #c5534e);
    border: 1px solid #a64540;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 100px;
}

/* Estilo específico para el botón en la canción actual */
.queue-item.playing .btn-remove {
    margin-top: 10px;
    width: 100%;
}

.btn-remove:hover {
    background: linear-gradient(180deg, #c5534e, #a64540);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(224, 111, 104, 0.4);
}

.btn-remove:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(224, 111, 104, 0.4);
}
.visualizer-canvas { 
    position: absolute; 
    inset: 0; 
    width: 100%; 
    height: 100%; 
    z-index: 0; 
    opacity: 0.35; 
    pointer-events: none; 
    border-radius: 10px;
}
.queue-remove-btn {
    display: inline-block;
    margin-top: 10px;
    background: linear-gradient(180deg, #e06f68, #c5534e);
    border: 1px solid #a64540;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    cursor: pointer;
}

.queue-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
}

.queue-remaining { font-size: 12px; font-weight: 700; opacity: 0.95; margin-bottom: 6px; color: #fff; }
.queue-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; opacity: 0.8; }

.queue-status {
    background: rgba(255,255,255,0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
    margin-top: 6px;
}

.queue-addedby {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 6px;
}

.empty-queue {
    text-align: center;
    padding: 40px 20px;
    opacity: 0.6;
    font-style: italic;
}
/* Comportamiento de scroll idéntico a TV */
#queueList { flex: 1; overflow-y: auto; padding: 5px; -ms-overflow-style: none; scrollbar-width: none; }
#queueList::-webkit-scrollbar { display: none; }

.status-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 0;
    font-size: 14px;
    z-index: 1000;
    text-align: center;
    pointer-events: none;
}

.status-indicator.connected {
    background: rgba(0,255,0,0.8);
}

.status-indicator.disconnected {
    background: rgba(255,0,0,0.8);
}

.loading {
    text-align: center;
    padding: 40px 20px;
    opacity: 0.6;
}

.spinner {
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 3px solid #00b894;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animación de entrada para los pasos */
@keyframes stepEnter {
    0% { opacity: 0; transform: translateY(100px) scale(0.50); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.step-container.animate-in {
    animation: stepEnter 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* Modal de búsqueda (centrado, separador, botón Elegir en cada resultado) */
.modal { display: none; position: fixed; z-index: 2000; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(2px); align-items: center; justify-content: center; }
.modal-content { background: rgba(24,24,24,0.96); color: #eee; padding: 20px 24px; border-radius: 14px; width: 94%; max-width: 1200px; border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 12px 36px rgba(0,0,0,0.6); }
.search-bar { display: flex; align-items: center; gap: 10px; padding-bottom: 15px;}
.search-input { flex: 1; padding: 12px 14px; border-radius: 10px; background: #efefef; color: #222; font-size: 15px; text-align: left; border: 2px solid #0f0f0f; box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 0 0 1px rgba(255,255,255,0.25); }
.pill-btn { padding: 10px 16px; border: 1px solid transparent; border-radius: 18px; font-weight: 700; font-size: 14px; cursor: pointer; color: #fff; box-shadow: 0 2px 0 rgba(0,0,0,0.25); white-space: nowrap; }
.pill-btn-green { background: linear-gradient(180deg, #10bea6, #0aa291); border-color: #0b7e74; }
.pill-btn-red { background: linear-gradient(180deg, #e06f68, #c5534e); border-color: #a64540; }

.search-results { max-height: 60vh; overflow-y: auto; }
.search-item { display: flex; gap: 12px; align-items: center; background: rgba(255,255,255,0.03); border-radius: 10px; padding: 10px; margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.08); }
.search-item-thumbnail { width: 96px; height: 54px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.search-item-texts { flex: 1; min-width: 0; }
.search-item-title { font-size: 14px; font-weight: 700; color: #fafafa; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item-channel { font-size: 12px; color: #bdbdbd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.choose-btn { padding: 8px 12px; border-radius: 14px; border: 1px solid #0b7e74; background: linear-gradient(180deg, #10bea6, #0aa291); color: #fff; font-weight: 700; font-size: 12px; cursor: pointer; }

/* Grid responsivo de resultados (como en la imagen) */
.results-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 15px;}
@media (max-width: 1100px) { .results-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .results-grid { grid-template-columns: 1fr; gap: 12px; } }
.result-card { display: flex; flex-direction: column; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; overflow: hidden; }
.result-thumb { width: 100%; height: 170px; object-fit: cover; display: block; }
.result-body { padding: 12px; border-top: 1px solid rgba(255,255,255,0.06); background: rgba(0,0,0,0.2); }
.result-title { font-size: 15px; font-weight: 800; color: #fafafa; line-height: 1.25; margin-bottom: 6px; }
.result-channel { font-size: 12px; color: #bdbdbd; }
.result-actions { padding: 12px; background: rgba(0,0,0,0.2); border-top: 1px solid rgba(255,255,255,0.06); }
.result-actions .choose-btn { width: 100%; }
.result-actions .choose-btn + .choose-btn { margin-top: 8px; }
/* Colocar botones debajo del input en móviles */
@media (max-width: 680px) {
    .search-bar { flex-direction: column; align-items: stretch; gap: 8px; }
    .pill-btn { width: 100%; }
}

/* ====== Header y Footer idénticos a TV ====== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    position: sticky;
    top: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    z-index: 900;
}

.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(6px);
    border-top: 1px solid rgba(255,255,255,0.08);
    z-index: 900;
}

.app-footer .footer-copy { font-size: clamp(10px, 1.2vw, 12px); opacity: 0.8; }
.app-footer .footer-brand { font-weight: 700; color: #f03; font-family: "Zen Dots", cursive; }
.app-footer .footer-dev { font-size: clamp(10px, 1.2vw, 12px); opacity: 0.8; }
.app-footer .heart { color: #ff0000; }

.app-title { font-size: 18px; font-weight: 600; opacity: 0.95; font-family: "Zen Dots", cursive; color: #f03; padding-left: 10px; letter-spacing: 0.015em; }
.app-brand { display: flex; flex-direction: column; line-height: 1.05; }
.app-subtitle { font-size: 9px; color: #ffffff; margin-top: 2px; letter-spacing: 0.25em; padding-left: 10px; }
/* Logo en header móvil */
.app-logo { height: 28px; width: auto; display: block; }

/* Marca grande centrada sobre el primer paso */
.hero-brand { align-items: center; text-align: center; margin: 10px 0 20px; }
.hero-brand .app-title { font-size: clamp(28px, 7vw, 40px); padding-left: 0; }
.hero-brand .app-subtitle { font-size: clamp(0.85em, 2.8vw, 14px); padding-left: 0; opacity: 0.95; }

/* Indicador de estado como chip (igual a TV) */
.status-indicator {
    position: static;
    background: rgba(0,0,0,0.45);
    color: #e5e7eb;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    z-index: 1000;
    text-align: right;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.status-indicator::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.status-indicator.connected::before { background: #22c55e; }
.status-indicator.disconnected::before { background: #ef4444; }
/* Forzar estilo de fondo constante como en TV */
.status-indicator.connected,
.status-indicator.disconnected { background: rgba(0,0,0,0.45); }

/* Contenedor principal con centrado vertical (similar a TV) */
.container {
    min-height: calc(100vh - 53px - 46px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 20px 60px;
}
