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

body {
    font-family: "M PLUS Rounded 1c", sans-serif;
    background-color: #FCF9EA;
    color: #333333;
    min-height: 100vh;
    padding: 10px;
    overflow-x: hidden;
}

/* Screen management */
.screen {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.screen.hidden {
    display: none;
}

.container {
    max-width: 100%;
    width: 100%;
    text-align: center;
    position: relative;
    padding: 0 10px;
}

/* Back to menu button */
.btn-back-to-menu-bottom {
    margin-top: 2rem;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    background-color: white;
    color: #666666;
    border: 2px solid #BADFDB;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    display: inline-block;
    font-family: "M PLUS Rounded 1c", sans-serif;
    font-weight: 500;
}

.btn-back-to-menu-bottom:hover {
    background-color: #BADFDB;
    border-color: #A0CFC9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(186, 223, 219, 0.4);
}

.btn-back-to-menu-bottom:active {
    transform: translateY(0);
}

/* Bear icon */
.bear-icon {
    width: 80px;
    height: auto;
    margin-bottom: 0.5rem;
    animation: bounce 2s ease-in-out infinite;
}

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

h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #FFA4A4;
    font-weight: 600;
}

/* Welcome text */
.welcome-text {
    font-size: 1rem;
    color: #666666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Category selection */
.category-selection {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    max-width: 100%;
}

.btn-category {
    font-family: "M PLUS Rounded 1c", sans-serif;
    padding: 0.8rem 1.5rem;
    font-size: 1.2rem;
    background-color: #BADFDB;
    color: #333333;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    min-width: 130px;
}

.btn-category:hover {
    background-color: #A0CFC9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(186, 223, 219, 0.4);
}

.btn-category:active {
    transform: translateY(0);
}

/* Romaji case checkbox */
.romaji-option {
    margin-top: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #999999;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #BADFDB;
}

.checkbox-text {
    user-select: none;
}

/* Daily stats */
.daily-stats {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: #aaa;
    text-align: center;
}

/* Sample text display */
.sample-display {
    background-color: transparent;
    padding: 1rem;
    margin-bottom: 1.5rem;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
}

/* Stamp container */
.stamp-container {
    display: flex;
    flex-direction: row;
    gap: 0.3rem;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.stamp {
    width: 45px;
    height: auto;
    animation: stampAppear 0.3s ease-out;
}

@keyframes stampAppear {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.sample-text {
    font-size: 2.5rem;
    font-family: "M PLUS Rounded 1c", sans-serif;
    line-height: 1.6;
    letter-spacing: 0.5px;
}

.sample-text span {
    display: inline-block;
}

.sample-romaji {
    font-size: 1.5rem;
    font-family: "M PLUS Rounded 1c", sans-serif;
    line-height: 1.4;
    letter-spacing: 1px;
}

.sample-romaji span {
    display: inline-block;
}

/* Character highlighting */
.char-correct {
    color: #BADFDB;
    font-weight: bold;
}

.char-incorrect {
    color: #FFA4A4;
    background-color: rgba(255, 164, 164, 0.2);
    border-radius: 2px;
    font-weight: bold;
}

.char-pending {
    color: #aaa;
}

/* Romaji highlighting */
.romaji-correct {
    color: #BADFDB;
    font-weight: bold;
}

.romaji-incorrect {
    color: #FFA4A4;
    background-color: rgba(255, 164, 164, 0.2);
    border-radius: 2px;
    font-weight: bold;
}

.romaji-pending {
    color: #aaa;
}

/* Input field */
.input-field {
    width: 80%;
    padding: 0.8rem;
    font-size: 1rem;
    font-family: "M PLUS Rounded 1c", sans-serif;
    background-color: #ffffff;
    color: #333333;
    border: 3px solid #BADFDB;
    border-radius: 12px;
    outline: none;
    margin-bottom: 1rem;
    transition: border-color 0.3s;
    box-shadow: 0 2px 4px rgba(186, 223, 219, 0.2);
}

.input-field:focus {
    border-color: #FFBDBD;
    box-shadow: 0 2px 8px rgba(255, 189, 189, 0.3);
}

.input-field:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Control buttons */
.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.btn-start {
    background-color: #BADFDB;
    color: #333333;
    width: 250px;
    height: 60px;
    font-size: 1.2rem;
}

.btn-start:hover {
    background-color: #A0CFC9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(186, 223, 219, 0.4);
}

.btn-start:active {
    transform: translateY(0);
}

.btn-reset {
    background-color: #FFBDBD;
    color: #333333;
}

.btn-reset:hover {
    background-color: #FFA4A4;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 189, 189, 0.4);
}

.btn-reset:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Instructions */
.instructions {
    margin-top: 2rem;
    color: #999999;
    font-size: 0.9rem;
}

kbd {
    background-color: #ffffff;
    border: 2px solid #BADFDB;
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    font-family: "M PLUS Rounded 1c", sans-serif;
    font-size: 0.85rem;
    color: #333333;
    box-shadow: 0 2px 3px rgba(186, 223, 219, 0.2);
}

/* Responsive design */
@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }

    .category-selection {
        flex-direction: column;
        align-items: center;
    }

    .btn-category {
        padding: 1rem 2rem;
        font-size: 1.5rem;
        width: 100%;
        max-width: 300px;
    }

    .sample-display {
        padding: 1.5rem;
    }

    .sample-text {
        font-size: 3rem;
    }

    .sample-romaji {
        font-size: 2rem;
    }

    .stamp {
        width: 45px;
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
