body {
    font-family: 'Roboto', sans-serif;
    background-color: #87ceeb;
    color: #333;
    margin: 0;
    padding: 20px;
    font-size: 18px;
}

h1, h2 {
    font-family: 'Comic Neue', cursive;
    color: #0066cc;
}

.main-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 20px;
    border-radius: 0;
    box-shadow: none;
}

.header-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

#characterContainer {
    flex-shrink: 0;
    margin-right: 15px;
}

#mascot {
    width: 100px;
    height: auto;
}

button {
    background-color: #ff9900;
    color: white;
    border: none;
    padding: 10px 10px;
    font-size: 1em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
	margin: 10px 0px;
}

button:hover {
    background-color: #ffad33;
    transform: scale(1.05);
}

#startTestButton {
    background-color: #ff9900;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1.2em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    max-width: 200px;
    margin: 20px auto;
}

#startTestButton:hover {
    background-color: #ffad33;
    transform: scale(1.05);
}

input[type='text'] {
    font-size: 1.2em;
    padding: 10px;
    border: 2px solid #0066cc;
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
}

#progressBarContainer {
    width: 100%;
    background-color: #f0f0f0;
    border-radius: 10px;
    margin: 20px 0;
}

#progressBar {
    width: 100%;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

#progressFill {
    height: 100%;
    background-color: #4CAF50;
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s ease-in-out;
}

/* --- Polished word area styles --- */
.word-area-box {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 0 12px rgba(0,0,0,0.08);
    padding: 22px 18px 28px 18px;
    margin: 28px auto 0 auto;
    max-width: 480px;
    min-width: 240px;
}

.word-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.word-header h2 {
    font-size: 1.3em;
    margin: 0;
    color: #0066cc;
}

#wordArea input[type='text'] {
    font-size: 1.2em;
    padding: 10px;
    border: 2px solid #0066cc;
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 18px;
    margin-top: 2px;
}

#wordArea button {
    background-color: #ff9900;
    color: #fff;
    border: none;
    padding: 10px 22px;
    font-size: 1em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 8px 0 0 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    font-family: inherit;
}

#wordArea button:hover {
    background-color: #ffad33;
    transform: scale(1.05);
}

.overview-box {
    background-color: #f9f9f9;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.overview-box h2 {
    margin-top: 0;
    color: #007acc;
    display: inline-block;
}

.button-container {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 18px;
    padding: 0;
    position: static;
}

.button-container .back-button,
.button-container .hide-button,
.button-container .hard-words-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    max-width: 220px;
    flex: 0 1 auto;
    margin: 0;
    font-size: 1rem;
    text-align: center;
    border-radius: 8px;
    padding: 12px 10px;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: #007acc;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    font-family: Arial, sans-serif;
}


@media (max-width: 600px) {
  .button-container {
    flex-direction: row;
    gap: 6px;
  }
  .button-container .back-button,
  .button-container .hide-button,
  .button-container .hard-words-button {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    margin: 0;
    font-size: 0.95rem;
    padding: 11px 0;
  }
}




.button-container .back-button:hover,
.button-container .hide-button:hover,
.button-container .hard-words-button:hover {
    background-color: #005f99;
    color: #fff;
}




.button-container .back-button:hover,
.button-container .hide-button:hover,
.button-container .hard-words-button:hover {
    background-color: #005f99;
    color: #fff;
}

.back-button {
    display: inline-block;
    padding: 10px 20px;
    margin: 20px 0;
    background-color: #007acc;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.2em;
    transition: background-color 0.3s;
    text-align: center;
    font-family: Arial, sans-serif;
}

.back-button:hover {
    background-color: #005f99;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.check-spellings-button {
    background-color: #28a745;
    color: #fff;
    border: none;
    padding: 15px 30px;
    margin-top: 20px;
    margin-bottom: 60px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1.5em;
    display: block;
    width: 100%;
    text-align: center;
    transition: background-color 0.3s;
    font-family: Arial, sans-serif;
}

.check-spellings-button:hover {
    background-color: #218838;
}

button + button {
    margin-left: 10px;
    background-color: #ffc107;
    color: #fff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1em;
    font-family: Arial, sans-serif;
}

button + button:hover {
    background-color: #e0a800;
}

.coffee_button {
    position: fixed;
    bottom: 10px;
    right: 10px;
}

.keyboard {
    display: none;
}

@media only screen and (min-width: 600px) {
    .back-button {
        float: right;
        margin-top: 0;
    }
    h1 {
        display: inline-block;
        margin-right: 20px;
    }
    #yearSelector {
        font-size: 1.3em;
        padding: 0.5em 1em;
        min-height: 2.5em;
        min-width: 220px;
        border-radius: 8px;
        border: 2px solid #444;
        background: #fff;
        color: #222;
        margin-top: 0.5em;
        margin-bottom: 0.5em;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        transition: border-color 0.2s;
    }
    #yearSelector:focus {
        border-color: #007bff;
        outline: none;
        box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
    }
    .dropdown-container label {
        font-size: 1.1em;
        margin-bottom: 0.3em;
        display: block;
    }
}

.year-group-box {
    border: 2px solid #b3d8ff;
    border-radius: 14px;
    background: #f0f7ff;
    padding: 0.5em 1.2em;
    margin: 10px 0 18px 0;
    display: flex;
    align-items: center;
    gap: 1.3em;
    box-shadow: 0 2px 8px rgba(58, 141, 222, 0.06), 0 1px 0 #e6f3ff inset;
    transition: box-shadow 0.25s;
    position: relative;
    justify-content: space-between;
}


.year-group-box:focus-within {
    /* No color change on focus, just a subtle shadow */
    box-shadow: 0 6px 24px rgba(58, 141, 222, 0.08), 0 2px 0 #b3e0ff inset;
}
.year-group-box .icon {
    width: 40px;
    height: 40px;
    margin-right: 1em;
    flex-shrink: 0;
}
.year-group-box label {
    font-size: 1.18em;
    font-weight: 700;
    color: #234c74;
    margin: 0 0.5em 0 0;
    letter-spacing: 0.01em;
    display: block;
    white-space: nowrap;
}
#yearSelector {
    font-size: 1.2em;
    padding: 0.5em 1.6em 0.5em 1em;
    min-height: 2.6em;
    min-width: 180px;
    border-radius: 8px;
    border: 2px solid #3a8dde;
    background: #fff;
    color: #234c74;
    margin: 0;
    box-shadow: 0 2px 8px rgba(58, 141, 222, 0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-weight: 500;
}
#yearSelector:focus, #yearSelector:hover {
    border-color: #3a8dde;
    outline: none;
    box-shadow: 0 0 0 2px rgba(58,141,222,0.10);
}
@media (max-width: 600px) {
    .year-group-box {
        flex-direction: column;
        align-items: stretch;
        padding: 1em 0.7em;
        gap: 0.7em;
    }
    .year-group-box label {
        margin-bottom: 0.4em;
        white-space: normal;
    }
    #yearSelector {
        min-width: 100%;
    }
}



    
    .button-container .back-button,
    .button-container .hide-button,
    .button-container .hard-words-button {
        width: 90vw;
        margin: 6px auto;
        font-size: 1.1rem;
        display: block;
    }

    body {
        background-color: #87ceeb !important;
        padding: 20px 5px;
    }

    .main-container {
        border-radius: 0;
        padding-top: 10px;
    }

    

    .button-container .back-button,
    .button-container .hide-button {
        font-size: 0.8em;
        padding: 5px 10px;
        margin: 0;
        background-color: #007acc;
    }

    .header-container {
        flex-direction: row;
        align-items: flex-start;
    }

    #characterContainer {
        width: 30%;
        max-width: 100px;
    }

    #mascot {
        width: 100%;
        height: auto;
    }

    h1 {
        width: 70%;
        font-size: 1.2em;
        line-height: 1.2;
    }

    .button-container {
        position: static;
        flex-direction: row;
        justify-content: space-between;
        margin-bottom: 10px;
    }

    .button-container .back-button,
    .button-container .hide-button {
        font-size: 0.8em;
        padding: 5px 10px;
        margin-bottom: 0;
        margin-right: 5px;
    }

    .word-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 5px;
    }

    .word-header h2 {
        font-size: 1.1em;
        margin: 0;
    }

    .word-header button {
        font-size: 0.85em;
        padding: 4px 8px;
    }

    input[type='text'] {
        width: calc(100% - 20px);
        margin: 3px auto;
        padding: 6px;
        font-size: 16px;
        border: 1px solid #ccc;
        border-radius: 5px;
    }

    #nextButton {
        display: block;
        width: 100%;
        margin: 3px auto;
        padding: 10px;
        font-size: 16px;
        cursor: pointer;
        background: #333;
        color: #fff;
        border: none;
        border-radius: 5px;
    }

    .keyboard {
        display: grid;
        gap: 6px;
        max-width: 100%;
        margin: 10px auto;
    }

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

    .keyboard-row.bottom {
        grid-template-columns: repeat(8, 1fr);
        justify-content: center;
    }

    .key {
        padding: 15px 5px;
        background: #e0e0e0;
        text-align: center;
        cursor: pointer;
        user-select: none;
        border-radius: 5px;
        font-size: 18px;
        text-transform: lowercase;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        transition: background-color 0.2s, transform 0.1s;
    }

    .key:active {
        background: #ccc;
        transform: translateY(2px);
        box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    }

    .delete-key {
        font-size: 16px;
        font-weight: bold;
    }

    .modal-content {
        margin: 10% auto;
        padding: 15px;
        width: 90%;
    }

    .close {
        font-size: 40px;
        padding: 10px;
        position: absolute;
        right: 5px;
        top: 5px;
    }

@media (min-width: 375px) and (max-width: 768px) {
    .key {
        padding: 18px 5px;
        font-size: 20px;
    }

    .delete-key {
        font-size: 18px;
    }
}

.correct-answer {
    background-color: #d4edda;
    border-color: #c3e6cb;
    animation: pulse-green 0.5s;
}

.incorrect-answer {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    animation: pulse-red 0.5s;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}