:root {
    --bg-color: #fff;
    --text-color: #111;
    --header-bg: #111;
    --header-text: #fff;
    --border-color: #ddd;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --correct-color: #5cb85c;
    --incorrect-color: #d9534f;
    --default-box-color: #f7f7f7;
    --key-bg: #fff;
    --active-border-color: #337ab7;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.container {
    max-width: 500px;
    width: 100%;
    text-align: center;
}

.main-header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.hidden {
    display: none !important;
}

/* Game Screen */
.progress-grid {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1rem;
    min-height: 64px;
}

.progress-box {
    width: 60px;
    height: 60px;
    border: 2px solid var(--text-color);
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 4px 4px 0px var(--shadow-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-color);
}

.progress-box.current-word {
    border-color: var(--active-border-color);
    cursor: pointer;
}
.progress-box.current-word.playing {
    color: var(--active-border-color);
}

.progress-box.correct { background-color: var(--correct-color); border-color: var(--correct-color); color: white; }
.progress-box.incorrect { background-color: var(--incorrect-color); border-color: var(--incorrect-color); color: white; }


/* Styles for the dedicated input display */
#input-display-container {
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}
.input-display {
    width: 100%;
    height: 60px;
    border: 2px solid var(--active-border-color);
    border-radius: 8px;
    font-size: 1.8rem;
    padding: 0 1rem;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.15em;
    font-family: monospace;
}

/* Keyboard & Buttons */
#keyboard-container { margin: 1.5rem 0; }
.keyboard-row { display: flex; justify-content: center; gap: 6px; margin-bottom: 6px; }
.key { height: 50px; flex-grow: 1; max-width: 40px; font-size: 1rem; font-weight: bold; border: 2px solid var(--text-color); border-radius: 6px; background-color: var(--key-bg); cursor: pointer; display: inline-flex; justify-content: center; align-items: center; box-shadow: 2px 2px 0px var(--shadow-color); transition: all 0.1s ease; }
.key:active, .key.pressed { background-color: #ddd; transform: translate(1px, 1px); box-shadow: 1px 1px 0px var(--shadow-color); }
.key.wide-key { flex-grow: 1.5; max-width: 65px; }

.action-btn { display: inline-block; padding: 0.75rem 1.5rem; font-size: 1rem; font-weight: 700; color: var(--text-color); background-color: var(--bg-color); border: 2px solid var(--text-color); border-radius: 8px; cursor: pointer; transition: all 0.2s ease; box-shadow: 4px 4px 0px var(--text-color); margin: 0.5rem; }
.action-btn.wide { width: 100%; }
.action-btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0px var(--text-color); }
.action-btn:disabled { color: #aaa; border-color: #ccc; background-color: #f7f7f7; box-shadow: 4px 4px 0px #ddd; cursor: not-allowed; }
.action-btn:disabled:hover { transform: none; box-shadow: 4px 4px 0px #ddd; }

/* Results Screen Styles */
.results-grid { display: grid; grid-template-columns: repeat(5, 40px); gap: 8px; justify-content: center; margin-bottom: 1.5rem; }
.result-square { width: 40px; height: 40px; border-radius: 4px; }
.typo-item { display: grid; grid-template-columns: 20px 1fr 1fr 60px; gap: 1rem; padding: 0.5rem; border-bottom: 1px solid var(--border-color); align-items: center; }
.typo-item.header-row { font-weight: bold; color: #333; border-bottom: 2px solid #333; margin-bottom: 0.5rem; }
.typo-item .answer { font-weight: bold; }
.typo-item .user-guess.incorrect-guess { color: var(--incorrect-color); }
.percent-correct { text-align: right; color: #555; font-weight: bold; }

/* =============================================== */
/* == Desktop and Tablet Styles (Large Screens) == */
/* =============================================== */

/* This media query applies only when the screen width is 768px or wider */
@media (min-width: 768px) {

    /* Increase the maximum width of the main game container */
    .container {
        max-width: 800px; 
    }

    /* Make the header font bigger and add more vertical margin */
    .main-header {
        font-size: 1.75rem;
        padding: 1rem;
        margin: 2.5rem 0; /* NEW: Increased top/bottom margin */
    }

    /* Make the progress boxes larger and increase the space between them */
    .progress-grid {
        gap: 1.25rem; /* NEW: Increased gap from 0.75rem */
        margin-bottom: 2rem; /* NEW: More space below the grid */
    }

    .progress-box {
        width: 80px;
        height: 80px;
        font-size: 3.5rem;
    }
    
    /* Add more space around the input display */
    #input-display-container {
        margin-bottom: 2rem; /* NEW: More space below the input */
    }

    .input-display {
        height: 80px;
        font-size: 2.5rem;
    }
    
    /* Increase the gap between keyboard rows and individual keys */
    #keyboard-container { 
        margin: 2.5rem 0; /* NEW: More space above/below the whole keyboard */
    }
    .keyboard-row { 
        gap: 8px; /* NEW: Increased gap from 6px */
        margin-bottom: 8px; /* NEW: Increased gap from 6px */
    }
    .key {
        height: 65px;
        font-size: 1.3rem;
        max-width: 55px;
    }

    .key.wide-key {
        max-width: 85px;
    }
    
    /* Make the submit/action buttons bigger */
    .action-btn {
        padding: 1rem 2rem;
        font-size: 1.2rem;
    }
}