* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial Rounded MT Bold', 'Arial', sans-serif;
    touch-action: manipulation;
}

body {
    background-color: #ffe6f2;
    color: #ff66b2;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    max-width: 500px;
    width: 95%;
    padding: 20px;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(255, 102, 178, 0.3);
    text-align: center;
    margin: 10px;
}

header {
    margin-bottom: 20px;
}

.dedication {
    font-size: 0.9rem;
    color: #ff66b2;
    margin-bottom: 10px;
    font-style: italic;
    background-color: #fff0f7;
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 2px 5px rgba(255, 102, 178, 0.2);
    border: 1px dashed #ffb3d9;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

h1 {
    color: #ff66b2;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

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

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

.tile {
    width: 100%;
    height: 60px;
    max-width: 60px;
    border: 2px solid #ffb3d9;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s;
}

.correct {
    background-color: #9eff9e;
    border-color: #9eff9e;
    color: white;
}

.present {
    background-color: #f0c000;
    border-color: #f0c000;
    color: white;
}

.absent {
    background-color: #e6e6e6;
    border-color: #e6e6e6;
    color: #999;
}

#keyboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.key {
    width: 8vw;
    min-width: 28px;
    max-width: 40px;
    height: 50px;
    margin: 0 2px;
    border-radius: 5px;
    background-color: #ffb3d9;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    touch-action: manipulation;
}

.key:hover {
    background-color: #ff99cc;
}

.key.wide {
    width: 12vw;
    min-width: 45px;
    max-width: 65px;
}

.key.correct {
    background-color: #9eff9e;
}

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

.key.absent {
    background-color: #e6e6e6;
}

#message-container {
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

#message {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ff66b2;
}

.instructions {
    background-color: #fff0f7;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: left;
}

.instructions h2 {
    margin-bottom: 10px;
    color: #ff66b2;
}

.instructions p {
    margin-bottom: 5px;
}

#new-game-btn {
    background-color: #ff66b2;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

#new-game-btn:hover {
    background-color: #ff3399;
    transform: scale(1.05);
}

.shake {
    animation: shake 0.5s;
}

.bounce {
    animation: bounce 0.5s;
    animation-timing-function: cubic-bezier(0.280, 0.840, 0.420, 1);
    will-change: transform;
    backface-visibility: hidden;
}

@keyframes shake {
    0% { transform: translateX(0); }
    10% { transform: translateX(-5px); }
    20% { transform: translateX(5px); }
    30% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    50% { transform: translateX(-5px); }
    60% { transform: translateX(5px); }
    70% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
    90% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

@keyframes bounce {
    0% { transform: translateY(0); }
    30% { transform: translateY(-20px); }
    50% { transform: translateY(0); }
    65% { transform: translateY(-10px); }
    80% { transform: translateY(0); }
    90% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

/* Media queries for responsive design */
@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }
    
    .tile {
        height: 50px;
        max-width: 50px;
        font-size: 1.5rem;
    }
    
    .key {
        height: 45px;
        font-size: 1rem;
    }
    
    .instructions {
        font-size: 0.9rem;
    }
    
    #message {
        font-size: 1rem;
    }
    
    #new-game-btn {
        font-size: 1rem;
    }
    
    .dedication {
        font-size: 0.8rem;
    }
}

@media (max-width: 350px) {
    .tile {
        height: 40px;
        max-width: 40px;
        font-size: 1.2rem;
    }
    
    .key {
        height: 40px;
        min-width: 24px;
        font-size: 0.9rem;
    }
}

/* Celebration animations */
.celebration-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.firework, .heart, .bunny, .confetti {
    position: absolute;
    font-size: 2rem;
    animation-duration: 5s;
    animation-fill-mode: forwards;
    z-index: 1001;
}

.firework {
    animation-name: firework;
}

.heart {
    animation-name: float;
}

.bunny {
    animation-name: hop;
}

.confetti {
    animation-name: confetti;
}

@keyframes firework {
    0% { transform: scale(0.5); opacity: 0; }
    10% { transform: scale(1.2); opacity: 1; }
    20% { transform: scale(1); }
    100% { transform: translateY(-100vh) scale(0.5); opacity: 0; }
}

@keyframes float {
    0% { transform: translateY(100vh) scale(0.5); opacity: 0; }
    10% { transform: translateY(80vh) scale(1); opacity: 1; }
    90% { transform: translateY(10vh) scale(1); opacity: 1; }
    100% { transform: translateY(0) scale(0.5); opacity: 0; }
}

@keyframes hop {
    0% { transform: translateY(0) translateX(0) scale(0.5); opacity: 0; }
    10% { transform: translateY(-20px) translateX(20px) scale(1); opacity: 1; }
    20% { transform: translateY(0) translateX(40px); }
    30% { transform: translateY(-20px) translateX(60px); }
    40% { transform: translateY(0) translateX(80px); }
    50% { transform: translateY(-20px) translateX(100px); }
    60% { transform: translateY(0) translateX(120px); }
    70% { transform: translateY(-20px) translateX(140px); }
    80% { transform: translateY(0) translateX(160px); }
    100% { transform: translateY(-50px) translateX(180px) scale(0.5); opacity: 0; }
}

@keyframes confetti {
    0% { transform: translateY(-50vh) rotate(0deg) scale(0.5); opacity: 0; }
    10% { transform: translateY(-40vh) rotate(45deg) scale(1); opacity: 1; }
    50% { transform: translateY(20vh) rotate(180deg); }
    100% { transform: translateY(100vh) rotate(360deg) scale(0.5); opacity: 0; }
}
