
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a2a6c, #2a5298);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.header {
    text-align: center;
    /*margin-bottom: 30px;*/
    width: 100%;
    max-width: 500px;
}

.title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.title i {
    color: #4CAF50;
}

.date-display {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-top: 5px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-block;
}

.instructions {
    margin-bottom: 20px;
    opacity: 0.9;
    font-size: 1.1rem;
}

.game-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.word-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.letter-box {
    aspect-ratio: 1/1;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #3a7bd5;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.letter-box.filled {
    background: rgba(255, 255, 255, 0.15);
    border-color: #5a9bff;
    animation: pop 0.2s ease;
}

@keyframes pop {
    0% { transform: scale(0.8); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.letter-box.correct {
    background: #4CAF50;
    border-color: #388E3C;
    animation: flip 0.5s ease;
}

.letter-box.present {
    background: #FFC107;
    border-color: #FFA000;
    color: #333;
    animation: flip 0.5s ease;
}

.letter-box.absent {
    background: #616161;
    border-color: #424242;
    animation: flip 0.5s ease;
}

@keyframes flip {
    0% { transform: rotateX(0deg); }
    50% { transform: rotateX(90deg); }
    100% { transform: rotateX(0deg); }
}

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 500px;
    margin-top: 20px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.key {
    height: 50px;
    min-width: 40px;
    flex: 1;
    background: #3a7bd5;
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 3px 5px rgba(0,0,0,0.2);
}

.key:hover {
    background: #2a6bc0;
    transform: translateY(-2px);
}

.key:active {
    transform: translateY(1px);
}

.key.wide {
    flex: 1.5;
    font-size: 1rem;
}

.key.enter {
    background: #4CAF50;
}

.key.enter:hover {
    background: #43A047;
}

.key.backspace {
    background: #F44336;
}

.key.backspace:hover {
    background: #E53935;
}

.key.absent {
    background: #616161;
}

.key.correct {
    background: #4CAF50;
}

.key.present {
    background: #FFC107;
    color: #333;
}

.message {
    height: 40px;
    margin: 15px 0;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.message.win {
    color: #4CAF50;
    font-weight: bold;
    font-size: 1.5rem;
}

.message.lose {
    color: #F44336;
}

.stats {
    display: flex;
    justify-content: space-around;
    width: 100%;
    max-width: 500px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #FFC107;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.stats-modal {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    max-width: 500px;
    margin: 0 auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.distribution {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.dist-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dist-label {
    width: 20px;
}

.dist-bar {
    background: #4CAF50;
    padding: 5px 10px;
    border-radius: 3px;
    text-align: right;
    min-width: 30px;
    transition: width 0.5s ease;
}

.new-game-btn {
    margin-top: 20px;
    padding: 12px 30px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.new-game-btn:hover {
    background: #43A047;
    transform: translateY(-3px);
}

.share-container {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.share-btn {
    padding: 10px 20px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.share-btn:hover {
    background: #0b7dda;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #4CAF50;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Animación para palabras inválidas */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.letter-box.error {
    animation: shake 0.6s ease;
    border-color: #F44336;
    background-color: rgba(244, 67, 54, 0.2);
}

.message.error {
    color: #F44336;
    font-weight: bold;
}

@media (max-width: 500px) {
    .key {
        height: 45px;
        min-width: 30px;
        font-size: 1rem;
    }

    .letter-box {
        font-size: 2rem;
    }

    .title {
        font-size: 2rem;
    }
}
