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

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    transition: background 1s ease;
    overflow: hidden;
}

.game-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.start-screen, .game-screen {
    text-align: center;
    padding: 2rem;
    border-radius: 1rem;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.start-screen h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #4a4a4a;
}

.start-screen p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #666;
}

button {
    padding: 1rem 2rem;
    font-size: 1.5rem;
    background-color: #ff9a9e;
    border: none;
    border-radius: 2rem;
    color: white;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background-image: linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    background-color: #ff8a8e;
}

button:active {
    transform: translateY(1px);
}

.character-display {
    font-size: 15rem;
    height: 20rem;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    color: #4a4a4a;
    text-shadow: 3px 3px 5px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, color 0.3s ease;
    user-select: none;
    position: relative;
}

/* Create keyboard key appearance */
.character-display::before {
    content: "";
    position: absolute;
    width: 200px;
    height: 200px;
    background-color: #f8f8f8;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2), inset 0 -8px 0 rgba(0,0,0,0.1);
    z-index: -1;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Key press effect */
.character-display.pop::before {
    transform: translateY(8px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2), inset 0 -3px 0 rgba(0,0,0,0.1);
}

/* Add keyboard row visualization */
.keyboard-row {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    perspective: 500px;
}

.key {
    width: 40px;
    height: 40px;
    margin: 0 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f8f8f8;
    border-radius: 5px;
    box-shadow: 0 3px 0 rgba(0,0,0,0.1);
    font-weight: bold;
    color: #666;
    transform: rotateX(10deg);
    transition: all 0.1s ease;
    cursor: default;
}

.key.active {
    background-color: #ff9a9e;
    color: white;
    transform: rotateX(10deg) translateY(3px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.1);
}

/* Highlight the current character in the keyboard */
.key.current {
    background-color: #4CAF50;
    color: white;
    animation: pulse-key 1s infinite;
}

@keyframes pulse-key {
    0% { transform: rotateX(10deg) scale(1); }
    50% { transform: rotateX(10deg) scale(1.1); }
    100% { transform: rotateX(10deg) scale(1); }
}

.feedback-message {
    font-size: 2rem;
    height: 3rem;
    margin-bottom: 2rem;
    color: #666;
}

.game-screen {
    width: 90%;
    height: 90%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#back-button {
    position: absolute;
    top: 1rem;
    left: 4.5rem;
    background-color: #5f6caf;
    color: white;
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,0.16);
    transition: all 0.3s ease;
    z-index: 100;
    padding: 0;
}

#back-button:hover {
    transform: scale(1.1);
    background-color: #4a5a9e;
}

#back-button:active {
    transform: scale(0.95);
}

#back-button::after {
    content: "Back";
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.7);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 0.3rem;
    font-size: 0.8rem;
    margin-left: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

#back-button:hover::after {
    opacity: 1;
}

/* Animation for correct answers */
@keyframes pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.3); }
    60% { transform: scale(1.3); color: #ff5722; }
    100% { transform: scale(1); }
}

.pop {
    animation: pop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Bubble animation for background */
.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.1));
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: float 8s ease-in-out infinite;
    z-index: -1;
}

@keyframes float {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-1000px) rotate(720deg); opacity: 0; }
}

/* Add shimmer effect to buttons */
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Add a pulsing effect to the start button */
#start-button {
    animation: pulse 2s infinite;
}

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

/* Add a visual indicator when audio is playing */
.audio-playing::after {
    content: "🔊";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 2rem;
    animation: audio-pulse 1s infinite;
}

@keyframes audio-pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Progress bar styles */
.progress-container {
    width: 80%;
    max-width: 500px;
    margin: 1rem auto;
    text-align: center;
}

.progress-bar {
    height: 20px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff9a9e 0%, #fad0c4 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    color: #4a4a4a;
}

/* Celebration styles */
.celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    display: block !important;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.star {
    position: absolute;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23FFD700"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    width: 50px;
    height: 50px;
    animation: fall 3s linear forwards;
}

@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translateY(calc(100vh + 100px)) rotate(360deg);
        opacity: 0;
    }
}

/* Pulse animation for progress bar when full */
@keyframes pulse-progress {
    0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 215, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

.progress-full {
    animation: pulse-progress 1s infinite;
    background: linear-gradient(90deg, #FFD700 0%, #FFA500 100%);
}

/* Enhanced small stars with color oscillation and trails */
.star.small-star {
    z-index: 50;
    filter: brightness(1.2);
    position: relative;
    will-change: transform;
    transform: translateY(-50px);
    transition: transform 2s linear;
}

/* Add trail effect to small stars */
.star.small-star::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: inherit;
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.5;
    filter: blur(2px);
    z-index: -1;
    animation: trail 0.5s linear infinite;
}

/* Color oscillation animation - applied via JS */
@keyframes color-shift {
    0% { filter: brightness(1.2) hue-rotate(0deg); }
    25% { filter: brightness(1.5) hue-rotate(90deg); }
    50% { filter: brightness(1.2) hue-rotate(180deg); }
    75% { filter: brightness(1.5) hue-rotate(270deg); }
    100% { filter: brightness(1.2) hue-rotate(360deg); }
}

/* Trail animation */
@keyframes trail {
    0% { 
        transform: translateY(10px) scale(0.9);
        opacity: 0.5;
    }
    100% { 
        transform: translateY(20px) scale(0.7);
        opacity: 0;
    }
}

/* Update small-fall animation to be smoother */
@keyframes small-fall {
    0% {
        transform: translateY(-50px) rotate(0deg) translateX(0px);
        opacity: 0;
    }
    10% {
        opacity: 0.9;
    }
    50% {
        transform: translateY(calc(50vh - 50px)) rotate(90deg) translateX(20px);
    }
    100% {
        transform: translateY(calc(100vh + 50px)) rotate(180deg) translateX(-20px);
        opacity: 0;
    }
}

/* Add styles for the word display */
.word-display {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 2rem;
    letter-spacing: 0.5rem;
}

.completed-letter {
    color: #4CAF50;
    font-weight: bold;
}

.current-letter {
    color: #FF5722;
    font-weight: bold;
    animation: pulse-letter 1s infinite;
}

.future-letter {
    color: #aaa;
    opacity: 0.7;
}

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

/* Home button styles */
.home-button {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: #ff9a9e;
    color: white;
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,0.16);
    transition: all 0.3s ease;
    z-index: 100;
}

.home-button:hover {
    transform: scale(1.1);
    background-color: #ff6b6b;
}

.home-button:active {
    transform: scale(0.95);
}

/* Tooltip for home button */
.home-button::after {
    content: "Home";
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.7);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 0.3rem;
    font-size: 0.8rem;
    margin-left: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.home-button:hover::after {
    opacity: 1;
}

/* Add shake animation for progress bar decrease */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.progress-fill.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

/* Add incorrect feedback animation */
@keyframes incorrect-feedback {
    0% { background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); }
    50% { background: linear-gradient(135deg, #ffefef 0%, #ffcaca 100%); }
    100% { background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); }
}

body.incorrect {
    animation: incorrect-feedback 0.3s ease;
}

/* Update home button links for both screens */
.start-screen .home-button {
    position: absolute;
    top: 1rem;
    left: 1rem;
}

.game-screen .home-button {
    position: absolute;
    top: 1rem;
    left: 1rem;
}

/* Update button styles for Font Awesome icons */
.home-button i, #back-button i, #mute-button i {
    font-size: 1.2rem;
}

/* Update tooltip for home button */
.home-button::after {
    content: "Home";
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.7);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 0.3rem;
    font-size: 0.8rem;
    margin-left: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

/* Update styling for version info */
.version-info {
    font-size: 0.7rem;
    color: #aaa;
    margin-top: 1rem;
    text-align: center;
}

.game-screen-version {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    margin: 0 auto;
}

.footer-version {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    margin: 0 auto;
    z-index: 10;
}

/* Footer styles */
.footer {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 10;
}

.copyright {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.3rem;
}

.copyright a {
    color: #5f6caf;
    text-decoration: none;
    transition: color 0.3s ease;
}

.copyright a:hover {
    color: #ff9a9e;
    text-decoration: underline;
}

/* Update version info to work with the new footer */
.footer-version {
    position: static;
    margin: 0;
}

/* Add styling for the game icon in the start screen */
.game-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: float-icon 3s ease-in-out infinite;
}

@keyframes float-icon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
} 