@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');
        
:root {
    --primary-color: #7b00ff;
    --secondary-color: #00eaff;
    --background-start: #1a0033;
    --background-end: #000000;
    --card-background: rgba(255, 255, 255, 0.12);
    --text-color: #f0f0f0;
    --light-text-color: #ffffff;
    --correct-color: #00cc00;
    --incorrect-color: #e6006e;
    --warning-color: #e6e600;
    --shadow-base: 0 0 6px rgba(0, 255, 255, 0.2);
    --button-shadow-neon: 0 0 6px rgba(0, 234, 255, 0.5), 0 0 10px rgba(123, 0, 255, 0.35);
    --border-radius: 15px;
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: radial-gradient(circle at center, var(--background-start) 0%, var(--background-end) 100%);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
}

html, body {
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch; /* mejora en iOS */
}

.screen {
    display: none;
    width: 100%;
    max-width: 420px;
    background: var(--card-background);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-base);
    text-align: center;
    animation: fadeIn .45s ease-out;
    border: 1px solid var(--secondary-color);
    backdrop-filter: blur(3px);
    position: relative;
}

.screen.active {
    display: block;
}

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

h1, h2, h3 {
    margin-bottom: 20px;
    font-family: 'Luckiest Guy', cursive;
    text-shadow: 0 0 3px rgba(123, 0, 255, 0.7), 0 0 6px rgba(123, 0, 255, 0.5);
}

.logo {
    max-width: 220px;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.4));
}

h1 {
    font-size: 3rem;
    background: -webkit-linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 30px;
    text-shadow: 0 0 6px rgba(123, 0, 255, 0.8), 0 0 10px rgba(0, 234, 255, 0.6);
}

.btn, .category-btn, .player-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 15px;
    margin-bottom: 15px;
    border: none;
    border-radius: 10px;
    background-image: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--light-text-color);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, background-image .3s;
    text-align: center;
    text-decoration: none;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
    box-shadow: var(--button-shadow-neon);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn:hover, .category-btn:hover, .player-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 10px var(--primary-color), 0 0 18px var(--secondary-color);
    background-image: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
}

.btn.secondary {
    background-image: linear-gradient(45deg, #6c757d, #343a40);
    box-shadow: 0 0 8px rgba(108, 117, 125, 0.5);
}
.btn.secondary:hover {
    background-image: linear-gradient(45deg, #343a40, #6c757d);
    box-shadow: 0 0 12px rgba(108, 117, 125, 0.7);
}

.btn.tertiary {
    background-image: linear-gradient(45deg, var(--warning-color), #ff007b);
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.5);
}
.btn.tertiary:hover {
    background-image: linear-gradient(45deg, #ff007b, var(--warning-color));
    box-shadow: 0 0 12px rgba(255, 193, 7, 0.7);
}

.password-field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.password-field .text-input {
    margin-bottom: 0;
    flex: 1;
}

.icon-btn {
    width: 52px;
    height: 52px;
    padding: 0;
    margin-bottom: 0;
    border-radius: 12px;
    font-size: 1.2rem;
}

.small-link {
    font-size: 0.95rem;
    padding: 10px 12px;
}

.bell-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--secondary-color);
    background: rgba(0, 0, 0, 0.3);
    color: var(--light-text-color);
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow-base);
}

.bell-btn:hover {
    box-shadow: 0 0 10px var(--secondary-color);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1200;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    width: min(520px, 100%);
    background: #1c0c2e;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 234, 255, 0.6);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
    padding: 24px;
    text-align: center;
}

.modal-body {
    text-align: left;
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 6px;
}

.modal-section-title {
    font-weight: 700;
    color: var(--secondary-color);
    margin-top: 4px;
}

.modal-body ul {
    margin: 0;
    padding-left: 18px;
}

.modal-body li {
    margin-bottom: 6px;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.hamburger-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.4);
    color: var(--light-text-color);
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-base);
}

.hamburger-btn:hover {
    box-shadow: 0 0 10px var(--secondary-color);
}

.notification-item {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-item small {
    color: rgba(255, 255, 255, 0.6);
}

.locked {
    opacity: 0.7;
    position: relative;
}

.locked::after {
    content: '🔒';
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 0.95rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    margin-left: 8px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--incorrect-color);
    color: var(--light-text-color);
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 0 6px rgba(230, 0, 110, 0.6);
}

.invite-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 320px;
    background: rgba(0, 0, 0, 0.85);
    color: var(--light-text-color);
    border: 1px solid var(--secondary-color);
    border-radius: 12px;
    padding: 14px 16px;
    z-index: 1000;
    box-shadow: var(--shadow-base);
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: toastSlideIn 0.25s ease-out;
}

.invite-toast p {
    font-size: 0.95rem;
    text-align: left;
}

.invite-toast .btn {
    margin-bottom: 0;
    padding: 10px 12px;
    font-size: 0.95rem;
}

.invite-toast.hide {
    animation: toastFadeOut 0.2s ease-in forwards;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* Ajustes para el recuadro del encabezado del juego */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 18px 22px;
    min-height: 80px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    border: 1px solid var(--secondary-color);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.2);
}

.game-header div {
    flex: 1;
}

.game-info {
    text-align: left;
}

.game-score {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
}

#question-counter {
    font-weight: 700;
    color: var(--warning-color);
    text-shadow: 0 0 2px rgba(230, 230, 0, 0.8);
    font-size: 1.1rem;
}

#points-display {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--light-text-color);
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
}

#player-turn {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-shadow: 0 0 4px rgba(0, 234, 255, 0.8);
    margin-bottom: 10px;
}

.attempts-counter {
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 5px;
    color: var(--light-text-color);
    transition: background-color .3s, box-shadow .3s;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
    font-size: 1rem;
}

#attempts-counter[style*="var(--correct-color)"] {
    box-shadow: 0 0 8px var(--correct-color);
}
#attempts-counter[style*="var(--warning-color)"] {
    box-shadow: 0 0 8px var(--warning-color);
}
#attempts-counter[style*="var(--incorrect-color)"] {
    box-shadow: 0 0 8px var(--incorrect-color);
}

#play-song-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 15px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    line-height: 1;
    padding-left: 4px;
    box-shadow: 0 0 10px var(--secondary-color);
    border: 1px solid var(--secondary-color);
}
#play-song-btn:hover {
    box-shadow: 0 0 15px var(--secondary-color), 0 0 20px var(--secondary-color);
}

#answer-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.answer-btn {
    background-image: none;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    text-align: center;
    padding: 12px;
    height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 0;
    font-size: .95rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.15);
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
}

.answer-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 8px var(--secondary-color);
}

.answer-btn.correct {
    background-color: var(--correct-color);
    color: #fff;
    box-shadow: 0 0 8px var(--correct-color), 0 0 15px var(--correct-color);
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
}

.answer-btn.incorrect {
    background-color: var(--incorrect-color);
    color: #fff;
    box-shadow: 0 0 8px var(--incorrect-color), 0 0 15px var(--incorrect-color);
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
}

.answer-btn.disabled {
    pointer-events: none;
    opacity: .6;
}

.answer-btn strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 2px;
    font-family: 'Luckiest Guy', cursive;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
}

.player-selection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.player-btn {
    margin-bottom: 0;
    padding: 20px 15px;
}

#final-scores h3 {
    margin-top: 25px;
    color: var(--secondary-color);
    text-shadow: 0 0 4px rgba(0, 234, 255, 0.7);
}

#final-scores p {
    font-size: 1.2rem;
    padding: 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    margin-bottom: 10px;
    border: 1px solid var(--primary-color);
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
}

#final-scores p strong {
    color: var(--warning-color);
    text-shadow: 0 0 4px rgba(230, 230, 0, 0.8);

}

.text-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--secondary-color);
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--light-text-color);
    font-size: 1rem;
    box-shadow: inset 0 0 5px rgba(0, 255, 255, 0.1);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.text-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.text-input:focus {
    border-color: var(--primary-color);
    box-shadow: inset 0 0 5px rgba(123, 0, 255, 0.4), 0 0 8px rgba(0, 234, 255, 0.4);
}

.small-text {
    font-size: 0.9rem;
    margin-top: -5px;
    margin-bottom: 15px;
    color: var(--text-color);
}

.small-text a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.small-text a:hover {
    color: var(--primary-color);
}

.warning-text {
    color: var(--warning-color);
    font-weight: 700;
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid var(--warning-color);
    border-radius: 8px;
    background-color: rgba(230, 230, 0, 0.1);
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

#winner-display {
    font-family: 'Luckiest Guy', cursive;
    font-size: 2.5rem;
    color: var(--secondary-color);
    text-shadow: 0 0 8px var(--secondary-color), 0 0 15px var(--secondary-color);
    margin-bottom: 25px;
    animation: neonGlow 1.5s ease-in-out infinite alternate;
    padding: 10px 0;
    border-bottom: 2px solid var(--secondary-color);
    border-top: 2px solid var(--secondary-color);
}

@keyframes neonGlow {
    from { text-shadow: 0 0 5px var(--secondary-color), 0 0 10px var(--secondary-color), 0 0 20px var(--secondary-color); }
    to { text-shadow: 0 0 8px var(--primary-color), 0 0 15px var(--primary-color), 0 0 30px var(--secondary-color); }
}

/* Estilos para la tarjeta de cada canción en el listado */
.song-item-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    min-height: 70px;
    background: rgba(255, 255, 255, 0.08);
    padding: 10px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-base);
    text-align: left;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(2px);
}

.song-item-card strong {
    font-family: 'Luckiest Guy', cursive;
    font-size: 1.1rem;
    color: var(--light-text-color);
    text-shadow: 0 0 2px rgba(0,0,0,0.5);
}

.song-item-card span {
    color: var(--text-color);
}

/* Estilos para el nuevo botón único de escuchar */
.btn.small-listen-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    padding: 0;
    margin: 0;
    font-size: 1.5rem;
    border-radius: 50%;
    text-shadow: none;
    box-shadow: 0 0 8px rgba(0,0,0,0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    color: white;
}

.btn.small-listen-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(0,0,0,0.6);
}

/* Estilos para el índice alfabético (enlaces A, B, C...) */
.alpha-index {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: var(--border-radius);
    border: 1px solid var(--secondary-color);
}

.alpha-index a {
    display: inline-block;
    min-width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
    font-weight: bold;
    color: var(--secondary-color);
    background-color: transparent;
    border: 1px solid var(--secondary-color);
    border-radius: 5px;
    transition: all 0.2s ease;
}

.alpha-index a:hover {
    background-color: var(--secondary-color);
    color: var(--background-start);
    transform: translateY(-2px);
    box-shadow: 0 0 8px var(--secondary-color);
}

/* ESTILOS CLAVE PARA EL SCROLL (para #songs-list-scroll-content) */
#songs-list-scroll-content {
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--card-background);
    border-radius: var(--border-radius);
    background: rgba(0, 0, 0, 0.1);
    height: auto; 
    flex-grow: 1;
    display: flex; 
    flex-direction: column; 
}

/* Opcional: Estilo para la barra de desplazamiento (solo webkit browsers como Chrome/Safari) */
#songs-list-scroll-content::-webkit-scrollbar {
    width: 8px;
}

#songs-list-scroll-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

#songs-list-scroll-content::-webkit-scrollbar-thumb {
    background-color: var(--secondary-color);
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

/* Estilos para el contenedor interno de canciones, si necesitas padding extra o diseño */
#songs-list-container {
    padding: 10px 0;
}

/* ✅ Permite hacer scroll vertical en pantallas si el contenido excede la altura de la ventana */
.screen {
    overflow-y: auto;
    max-height: 100vh;
}
