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

body {
    font-family: 'Arial', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #121213;
    color: #ffffff;
    min-height: 100vh;
    padding: 20px;
}

h1 {
    margin-bottom: 30px;
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    color: #ffffff;
}

#game-board {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 40px;
}

.row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.tile {
    width: 65px;
    height: 65px;
    border: 2px solid #3a3a3c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    text-transform: uppercase;
    background-color: #121213;
    color: #ffffff;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.tile.filled {
    border-color: #565758;
    animation: tileScale 0.1s ease-in-out;
}

@keyframes tileScale {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.correct {
    background-color: #538d4e;
    border-color: #538d4e;
    animation: flip 0.6s ease-in-out;
}

.present {
    background-color: #b59f3b;
    border-color: #b59f3b;
    animation: flip 0.6s ease-in-out;
}

.absent {
    background-color: #3a3a3c;
    border-color: #3a3a3c;
    animation: flip 0.6s ease-in-out;
}

@keyframes flip {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg); }
    100% { transform: rotateY(0deg); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}

#keyboard-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.keyboard-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.key {
    padding: 14px 12px;
    background-color: #818384;
    border: none;
    color: white;
    font-weight: bold;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    min-width: 44px;
    transition: all 0.1s ease;
}

.key:hover {
    background-color: #9a9a9a;
}

.key:active {
    transform: scale(0.95);
}

.key.wide {
    min-width: 80px;
    font-size: 12px;
}

.key.correct {
    background-color: #538d4e;
}

.key.present {
    background-color: #b59f3b;
}

.key.absent {
    background-color: #3a3a3c;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    animation: modalFadeIn 0.3s ease-out;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: none;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #2d2d2d, #1a1a1a);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    min-width: 350px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid #3a3a3c;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from { 
        transform: translate(-50%, -60%);
        opacity: 0;
    }
    to { 
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: iconBounce 0.8s ease-out;
}

@keyframes iconBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

.modal-icon.win {
    color: #538d4e;
}

.modal-icon.lose {
    color: #f87171;
}

.modal h2 {
    margin-bottom: 15px;
    font-size: 1.8rem;
    color: #ffffff;
}

.modal p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: #d1d5db;
    line-height: 1.5;
}

.modal-word {
    font-size: 2.2rem;
    font-weight: bold;
    color: #b59f3b;
    margin: 25px 0;
    letter-spacing: 3px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.modal-btn {
    padding: 12px 25px;
    margin: 8px;
    background: linear-gradient(135deg, #538d4e, #6aaa64);
    border: none;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.modal-btn.secondary {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
}

.modal-btn.secondary:hover {
    background: linear-gradient(135deg, #9ca3af, #d1d5db);
}

/* Responsive Design */
@media (max-width: 600px) {
    .tile {
        width: 55px;
        height: 55px;
        font-size: 1.6rem;
    }
    
    .key {
        min-width: 36px;
        padding: 12px 8px;
        font-size: 12px;
    }
    
    .key.wide {
        min-width: 65px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .modal-content {
        min-width: 300px;
        padding: 30px;
    }
    
    .modal-word {
        font-size: 1.8rem;
    }
}
