:root {
    --sky-blue: #2575fc;
    --deep-blue: #6a11cb;
    --gold: #FFD700;
    --silver: #C0C0C0;
    --cloud: rgba(255, 255, 255, 0.8);
    --color-bg1: rgb(108, 0, 162);
    --color-bg2: rgb(0, 17, 82);
    --color1: 18, 113, 255;
    --color2: 221, 74, 255;
    --color3: 100, 220, 255;
    --color4: 200, 50, 50;
    --color5: 180, 180, 50;
    --color-interactive: 140, 100, 255;
    --circle-size: 80%;
    --blending: hard-light;
}

#app-content {
    max-width: 100%; /* Asegura que no se desborde horizontalmente */
    overflow-x: auto; /* Evita el desbordamiento horizontal */
}

body {
    font-family: 'Arial Rounded MT Bold', 'Helvetica Rounded', Arial, sans-serif;
    text-align: center;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(145deg, var(--deep-blue) 0%, var(--sky-blue) 100%);
    color: white;
    overflow: auto;
    position: relative;
}

h1 {
    font-size: 4rem;
    text-transform: uppercase;
    margin: 2rem 0;
    color: var(--gold);
    text-shadow: 0px 3px 8px rgba(255, 215, 0, 0.4);
    animation: titleGlow 4s ease-in-out infinite;
    position: relative;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 8px rgba(255, 215, 0, 0.5); }
    50% { text-shadow: 0 0 20px rgba(255, 217, 0, 0.9); }
}

.card {
    background: rgba(0, 0, 0, 0.644);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 600px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

.card-header {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px 20px 0 0; /* Bordes redondeados en la parte superior */
    padding: 0.5rem 2rem;
    width: 100%; /* Asegura que el card-header tenga el mismo ancho que el card */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 2px solid yellow; /* Borde inferior amarillo */
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    margin-top: -2rem; /* Ajusta esta propiedad para mover el card-header hacia arriba */
    margin-bottom: 0; /* Ajusta esta propiedad para mover el card-header hacia abajo */
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px; /* Espacio entre los botones */
}

.header-right {
    display: flex;
    align-items: center;
    margin-left: auto; /* Empuja el contenido a la derecha */
}

.spacer {
    flex-grow: 1; /* Espacio flexible entre elementos */
}

.header-btn {
    background: #ffffff; /* Fondo blanco por defecto */
    border: none;
    cursor: pointer;
    padding: 8px; /* Aumenta el padding para hacer el botón más grande */
    font-size: 18px;
    color: #333; /* Color del ícono #333 por defecto */
    transition: transform 0.2s, color 0.2s, background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center; /* Centra el ícono dentro del botón */
    width: 35px; /* Ancho fijo para todos los botones */
    height: 35px; /* Alto fijo para todos los botones */
    margin: 0 5px; /* Añade margen para centrar mejor */
}

.header-btn.retry-btn {
    display: none; /* Ocultar por defecto */
    margin-left: 18px; /* Espacio a la izquierda del botón de reintentar */
}

.header-btn i {
    margin: auto; /* Centra el ícono dentro del botón */
}

.header-btn:hover,
.header-btn:focus {
    transform: scale(1.1);
    outline: none;
}

.language-selector {
    display: flex;
    gap: 10px; /* Espacio entre los botones de idioma */
}

.lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    transition: transform 0.2s, border 0.2s;
    display: flex;
    align-items: center;
    justify-content: center; 
    width: 40px; /* Ancho fijo para todos los botones */
    height: 40px; /* Alto fijo para todos los botones */
}

.lang-btn img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: block; /* Asegura que la imagen esté centrada */
    margin: auto; /* Centra la imagen dentro del botón */
}

.lang-btn:hover,
.lang-btn:focus {
    transform: scale(1.1);
    outline: none;
}

.lang-btn.active {
    border: 2px solid #ffffff;
}

.lang-btn#es-btn {
    margin-right: 8px; /* Espacio a la derecha del botón de español */
}

.lang-btn#en-btn {
    margin-left: 8px; /* Espacio a la izquierda del botón de inglés */
}

.number-input {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #ffffff;
}

.number-input label {
    margin: 0;
}

.number-input select {
    padding: 2px 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
}

.github-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #ffffff;
    font-weight: bold;
    font-size: 16px;
    transition: transform 0.2s;
    gap: 6px; /* Espacio entre el ícono y el texto */
}

.github-link i {
    font-size: 23px;
}

.github-link:hover,
.github-link:focus {
    transform: scale(1.1);
    outline: none;
}

.selection-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

.option {
    flex: 1;
    text-align: center;
}

.divider {
    position: relative;
    margin: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.divider::before,
.divider::after {
    content: '';
    width: 2px;
    height: 40px;
    background-color: yellow;
}

.divider span {
    color: yellow;
    background-color: transparent;
    font-size: 1.5rem;
    margin: 10px 0;
}

button {
    padding: 12px 28px;
    margin: 15px;
    font-size: 1.1rem;
    background: linear-gradient(145deg, var(--gold) 0%, var(--silver) 100%);
    border: none;
    border-radius: 25px;
    color: var(--deep-blue);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.25);
    background: linear-gradient(145deg, var(--silver) 0%, var(--gold) 100%);
}

button:disabled {
    background-color: grey;
    cursor: not-allowed;
}

input {
    padding: 10px 18px;
    font-size: 1.1rem;
    border: 2px solid var(--gold);
    border-radius: 25px;
    background: rgba(255,255,255,0.95);
    margin: 10px;
    width: 200px;
    text-align: center;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

input:focus {
    outline: none;
    box-shadow: 0 0 10px var(--gold);
    border-color: var(--silver);
}

input:disabled {
    background-color: lightgrey;
}

#game-dashboard {
    max-width: 100%; /* Asegura que no se desborde horizontalmente */
    overflow-x: auto; /* Evita el desbordamiento horizontal */
}

#game-area {
    background: rgba(202, 200, 200, 0.2);
    border-radius: 15px;
    padding: 20px;
    margin: 20px auto;
    display: flex;
    flex-direction: column; /* Alinea los elementos verticalmente */
    align-items: flex-start; /* Alinea los elementos al inicio */
    overflow-x: hidden; /* Permite el desplazamiento horizontal */
    overflow-y: hidden; /* Evita el desplazamiento vertical */
    white-space: nowrap; /* Evita que los botones se desborden verticalmente */
    width: 90%; /* Ancho fijo para el contenedor */
    max-width: 800px; /* Máximo ancho para pantallas grandes */
    min-width: 300px; /* Mínimo ancho para pantallas pequeñas */
    box-sizing: border-box; /* Incluye el padding y el borde en el tamaño total */
    overflow-x: auto; /* Permite el desplazamiento horizontal */
}

#game-area::-webkit-scrollbar {
    height: 14px;
}

#game-area::-webkit-scrollbar-track {
    background: #232e33;
    border-radius: 0px;
}

#game-area::-webkit-scrollbar-thumb {
    background: #a9a9a9;
    border-radius: 4px;
}


#initial-word {
    font-size: 1.5rem;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(255,215,0,0.5);
    margin: 15px 0;
}

#valid-words {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px; /* Espacio entre las palabras */
    width: 94%; /* Ancho fijo para el contenedor */
    max-width: 800px; /* Máximo ancho para pantallas grandes */
    min-width: 300px; /* Mínimo ancho para pantallas pequeñas */
    padding: 10px;
    box-sizing: border-box; /* Incluye el padding en el tamaño total */
    overflow: hidden; /* Evita el desplazamiento */
    margin: 20px auto; /* Centra el contenedor horizontalmente */
}

.word-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 600px; /* Ancho máximo para el contenedor de palabras */
    padding: 10px 45px;
    background: rgba(0,0,0,0.3);
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Sombra ligera */
    box-sizing: border-box;
}

.word-text {
    font-size: 1.2rem;
    color: white;
    margin-right: 10px;
}

body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="25" cy="75" r="15" fill="white" opacity="0.05"/><circle cx="40" cy="60" r="12" fill="white" opacity="0.05"/><circle cx="70" cy="80" r="18" fill="white" opacity="0.05"/></svg>');
    animation: clouds 80s linear infinite;
    z-index: -1;
}

@keyframes clouds {
    from { background-position: 0 0 }
    to { background-position: 1000px 0 }
}

@media (max-width: 768px) {
    h1 {
        font-size: 3rem;
    }
    
    #language-selection, 
    #game-dashboard {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    button {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    input {
        width: 180px;
    }

    .circle {
        display: none; /* Ocultar animaciones de fondo y cursor en pantallas pequeñas */
    }
}

.circle {
    height: 24px;
    width: 24px;
    border-radius: 24px;
    background-color: black;
    position: fixed; 
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999; /* so that it stays on top of all other elements */
}

.gradient-bg {
    width: 100vw;
    height: 100vh;
    position: fixed;
    overflow: hidden;
    background: linear-gradient(40deg, var(--color-bg1), var(--color-bg2));
    top: 0;
    left: 0;
    z-index: -1;
}

.gradient-bg svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
}

.gradients-container {
    filter: url(#goo) blur(40px);
    width: 100%;
    height: 100%;
}

.g1, .g2, .g3, .g4, .g5, .interactive {
    position: absolute;
    mix-blend-mode: var(--blending);
    background: radial-gradient(circle at center, rgba(var(--color1), 0.8) 0, rgba(var(--color1), 0) 50%) no-repeat;
}

.g1 {
    background: radial-gradient(circle at center, rgba(var(--color1), 0.8) 0, rgba(var(--color1), 0) 50%) no-repeat;
    width: var(--circle-size);
    height: var(--circle-size);
    top: calc(50% - var(--circle-size) / 2);
    left: calc(50% - var(--circle-size) / 2);
    transform-origin: center center;
    animation: moveVertical 30s ease infinite;
    opacity: 1;
}

.g2 {
    background: radial-gradient(circle at center, rgba(var(--color2), 0.8) 0, rgba(var(--color2), 0) 50%) no-repeat;
    width: var(--circle-size);
    height: var(--circle-size);
    top: calc(50% - var(--circle-size) / 2);
    left: calc(50% - var(--circle-size) / 2);
    transform-origin: calc(50% - 400px);
    animation: moveInCircle 20s reverse infinite;
    opacity: 1;
}

.g3 {
    background: radial-gradient(circle at center, rgba(var(--color3), 0.8) 0, rgba(var(--color3), 0) 50%) no-repeat;
    width: var(--circle-size);
    height: var(--circle-size);
    top: calc(50% - var(--circle-size) / 2 + 200px);
    left: calc(50% - var(--circle-size) / 2 - 500px);
    transform-origin: calc(50% + 400px);
    animation: moveInCircle 40s linear infinite;
    opacity: 1;
}

.g4 {
    background: radial-gradient(circle at center, rgba(var(--color4), 0.8) 0, rgba(var(--color4), 0) 50%) no-repeat;
    width: var(--circle-size);
    height: var(--circle-size);
    top: calc(50% - var(--circle-size) / 2);
    left: calc(50% - var(--circle-size) / 2);
    transform-origin: calc(50% - 200px);
    animation: moveHorizontal 40s ease infinite;
    opacity: 0.7;
}

.g5 {
    background: radial-gradient(circle at center, rgba(var(--color5), 0.8) 0, rgba(var(--color5), 0) 50%) no-repeat;
    width: calc(var(--circle-size) * 2);
    height: calc(var(--circle-size) * 2);
    top: calc(50% - var(--circle-size));
    left: calc(50% - var(--circle-size));
    transform-origin: calc(50% - 800px) calc(50% + 200px);
    animation: moveInCircle 20s ease infinite;
    opacity: 1;
}

.interactive {
    background: radial-gradient(circle at center, rgba(var(--color-interactive), 0.8) 0, rgba(var(--color-interactive), 0) 50%) no-repeat;
    width: 100%;
    height: 100%;
    top: -50%;
    left: -50%;
    opacity: 0.7;
}

@keyframes moveInCircle {
    0% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(180deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes moveVertical {
    0% {
        transform: translateY(-50%);
    }
    50% {
        transform: translateY(50%);
    }
    100% {
        transform: translateY(-50%);
    }
}

@keyframes moveHorizontal {
    0% {
        transform: translateX(-50%) translateY(-10%);
    }
    50% {
        transform: translateX(50%) translateY(10%);
    }
    100% {
        transform: translateX(-50%) translateY(-10%);
    }
}

/* Estilos para los botones de las palabras */
.word-btngame {
    background: none; /* Elimina cualquier gradiente heredado */
    background-color: #6c757d; /* Gris por defecto */
    color: white;
    border: none;
    border-radius: 5px;
    width: 60px; /* Ancho fijo */
    height: 60px; /* Alto fijo */
    margin: 5px;
    font-size: 2rem; /* Tamaño de fuente grande */
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center; /* Centra el texto dentro del botón */
}

.word-btngame:hover {
    background: none;
}

.word-btngame.btn-warning {
    background-color: #ffc107; /* Amarillo */
    color: black;
}

.word-btngame.btn-success {
    background-color: #198754; /* Verde */
    color: white;
}

.suggested-word-button {
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px;
    margin: 5px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.select-word-button {
    background: none;
    background-color: #ffc107;
    color: black;
    border: none;
    border-radius: 50%;
    width: 50px;  /* Ancho del botón */
    height: 50px; /* Altura del botón */
    padding: 10px;
    margin-left: 10px;
    margin-right: 5px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    flex-shrink: 0;
}

.select-word-button:hover {
    background: none;
    background-color: #ffc107;
    color: rgb(0, 0, 0);
}

.remove-word-button {
    background: none;
    background-color: #dc3545;
    color: rgb(255, 255, 255);
    border: none;
    border-radius: 50%;
    width: 50px;  /* Ancho del botón */
    height: 50px; /* Altura del botón */
    padding: 10px;
    margin-left: 10px;;
    margin-right: 5px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    flex-shrink: 0;
}

.remove-word-button:hover {
    background: none;
    background-color: #dc3545;
    color: rgb(255, 255, 255);
}

#intentos-container {
    display: flex;
    flex-direction: column; /* Alinea los elementos verticalmente */
    align-items: flex-start;
    gap: 0.5px; /* Espacio entre filas */
    width: 100%;
}

.intento-container {
    display: flex; /* Asegura que los botones se alineen horizontalmente */
    flex-direction: row; /* Alinea los elementos horizontalmente */
    align-items: center;
    white-space: nowrap; /* Evita que los botones se desborden verticalmente */
    margin: 1px auto;
    padding: 0 5px; /* Agrega padding para evitar que los botones se corten en los bordes */
    box-sizing: border-box; /* Incluye el padding y el borde en el tamaño total */
    width: auto; /* Asegura que el contenedor ocupe todo el ancho disponible */
    overflow-x: auto; /* Permite el desplazamiento horizontal */
}

.check-word-button {
    background: none;
    background-color: #22c55e; /* Verde */
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;  /* Ancho del botón */
    height: 50px; /* Altura del botón */
    padding: 10px;
    margin-left: 10px;
    margin-right: 5px;
    font-size: 1.2rem;
    cursor: default; /* No hace nada, solo retroalimentación visual */
    transition: background-color 0.3s, color 0.3s;
    flex-shrink: 0;
}

.check-word-button:hover {
    background: none;
    background-color: #22c55e; /* Verde */
    color: white;
}

.felicitacion {
    background-color: #22c55e; /* Verde */
    color: rgb(255, 255, 255);
    border-radius: 30px;
    padding: 10px;
    margin-top: 20px;
    font-size: 1.5rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
}

/* Media query para pantallas pequeñas */
@media (max-width: 768px) {
    .gradient-bg,
    .circle {
        display: none; /* Ocultar animaciones de fondo y cursor en pantallas pequeñas */
    }
}

/* Personalización de la barra de desplazamiento */
.intento-container::-webkit-scrollbar {
    height: 8px;
}

.intento-container::-webkit-scrollbar-track {
    background: rgba(202, 200, 200, 0.1);
    border-radius: 4px;
}

.intento-container::-webkit-scrollbar-thumb {
    background: rgba(169, 169, 169, 0.5);
    border-radius: 4px;
}

.intento-container::-webkit-scrollbar-thumb:hover {
    background: rgba(169, 169, 169, 0.7);
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Oscurece la pantalla */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    display: none; /* Oculto por defecto */
}

.loader-container {
    display: flex;
}

.dot {
    width: 10px;
    height: 10px;
    background-color: var(--gold); /* Color dorado */
    border-radius: 50%;
    margin: 0 5px;
    transform: scale(0);
    animation: fx 1s ease infinite;
}

.dot:nth-child(2) {
    animation-delay: 0.3s;
}

.dot:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes fx {
    50% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}