:root {
    --primary-color: #FF6B6B;
    --secondary-color: #4ECDC4;
    --accent-color: #FFE66D;
    --text-color: #2C3E50;
    --bg-color: #F7F9FC;
    --card-bg: #FFFFFF;
    --success-color: #2ECC71;
    --error-color: #E74C3C;
    --font-main: 'Fredoka', sans-serif;
    --streak-green: #2ecc71;
    --streak-amber: #f1c40f;
    --streak-red: #e74c3c;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    /* Prevent scrollbars from confetti */
}

.app-container {
    background-color: var(--card-bg);
    width: 90%;
    max-width: 500px;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
    border: 4px solid var(--secondary-color);
}

header {
    margin-bottom: 2rem;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    text-shadow: 2px 2px 0px var(--accent-color);
}

.score-board {
    position: absolute;
    top: -10px;
    right: 0;
    background: var(--accent-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
}

.icon-btn {
    position: absolute;
    top: -10px;
    left: 0;
    background: #ecf0f1;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    box-shadow: 0 4px 0 #bdc3c7;
    transition: transform 0.1s;
}

.icon-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #bdc3c7;
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.speaker-icon {
    font-size: 4rem;
    background: var(--secondary-color);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    color: white;
    box-shadow: 0 6px 0 #3dbdb5;
    margin: 0 auto;
}

.speaker-icon:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #3dbdb5;
}

.speaker-icon:hover {
    transform: scale(1.05);
}

.instruction {
    margin-top: 0.5rem;
    color: #7f8c8d;
    font-size: 1.1rem;
}

.input-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input[type="text"] {
    width: 100%;
    padding: 1rem;
    font-size: 1.5rem;
    border: 3px solid #e0e0e0;
    border-radius: 16px;
    text-align: center;
    font-family: var(--font-main);
    outline: none;
    transition: border-color 0.3s;
    text-transform: lowercase;
}

input[type="text"]:focus {
    border-color: var(--secondary-color);
}

button {
    font-family: var(--font-main);
    font-size: 1.2rem;
    font-weight: 700;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.1s;
}

#check-btn {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 0 #e05555;
    width: 100%;
}

#check-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #e05555;
}

.secondary-btn {
    background-color: var(--secondary-color);
    color: white;
    box-shadow: 0 4px 0 #3dbdb5;
    margin-top: 1rem;
}

.secondary-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #3dbdb5;
}



.feedback {
    min-height: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.feedback.success {
    color: var(--success-color);
}

.feedback.error {
    color: var(--error-color);
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    position: relative;
    border: 4px solid var(--secondary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 36px;
    /* Larger */
    font-weight: bold;
    cursor: pointer;
    padding: 10px;
    /* Larger hit area */
    line-height: 20px;
    transition: color 0.2s;
}

.close:hover,
.close:focus {
    color: var(--error-color);
    /* Red on hover */
    text-decoration: none;
    cursor: pointer;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-top: 1.5rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.day-header {
    font-weight: 700;
    color: #7f8c8d;
    background: none;
}

.day-green {
    background-color: var(--streak-green);
    color: white;
}

.day-amber {
    background-color: var(--streak-amber);
    color: white;
}

.day-red {
    background-color: var(--streak-red);
    color: white;
}

/* Animations */
@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

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

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-20px);
    }

    60% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 1s;
}

.landing-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}

.landing-page .title {
    font-size: 4rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 1rem;
}

.landing-page .subtitle {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 2rem;
}

.version-footer {
    position: absolute;
    bottom: 1rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-family: monospace;
}

.win-content {
    text-align: center;
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    border: 4px solid #fff;
}

.win-content h2 {
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    margin-bottom: 1rem;
}

.win-content p {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 1.5rem;
}

.star-rating {
    font-size: 3rem;
    margin-bottom: 2rem;
}

.hidden {
    display: none !important;
}