:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --accent-color: #FF9800;
    --background-color: #f0f8ff;
    --card-bg: #ffffff;
    --text-color: #333;
    --font-family: 'Comic Neue', cursive, sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 600px;
    text-align: center;
}

header {
    margin-bottom: 1.5rem;
}

h1 {
    color: var(--secondary-color);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

.card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    border: 3px solid #e0e0e0;
}

.topics-grid {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.topic-card {
    width: 140px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    box-shadow: 0 6px 0 rgba(0,0,0,0.12);
}

.control-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.button-row {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    align-items: stretch;
}

.button-row .btn.small {
    width: auto;
    align-self: center;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    font-size: 1.2rem;
}

select, input {
    width: 100%;
    padding: 10px;
    font-size: 1.1rem;
    border: 2px solid #ccc;
    border-radius: 10px;
    font-family: inherit;
    box-sizing: border-box;
}

select:focus, input:focus {
    border-color: var(--secondary-color);
    outline: none;
}

.btn {
    border: none;
    border-radius: 15px;
    padding: 12px 24px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.1s, box-shadow 0.1s;
    width: 100%;
}

.btn:active {
    transform: scale(0.98);
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 0 #388E3C;
}

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

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

.btn.small {
    width: auto;
    padding: 5px 15px;
    font-size: 1rem;
    background-color: #9E9E9E;
    color: white;
    box-shadow: 0 3px 0 #616161;
}

.hidden {
    display: none;
}

.score-board {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: bold;
}

.problem {
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

#user-input {
    width: 120px;
    text-align: center;
    font-size: 1.5rem;
}

.feedback {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.2rem;
}

.feedback.correct {
    background-color: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.feedback.incorrect {
    background-color: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

/* Reading exercise styles */
#reading-area {
    text-align: left;
}
#reading-content {
    background: #fafafa;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid #e6e6e6;
    box-shadow: inset 0 1px 0 rgba(0,0,0,0.02);
}
.mc-question {
    margin-top: 1rem;
}
.mc-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.6rem;
}
.mc-options .option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border-radius: 10px;
    background: #efefef;
    border: 1px solid #ddd;
    box-shadow: none;
    font-size: 1rem;
}
.mc-options .option:hover {
    background: #e6f0ff;
}
.mc-options .option:focus {
    outline: 2px solid var(--secondary-color);
}

/* covered text state for reading exercise */
.covered {
    filter: blur(6px);
    transition: filter 0.3s ease;
}

/* Auth UI */
.auth-container {
    text-align: center;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin: 1.5rem 0;
}

.user-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1rem;
    font-size: 1.1rem;
    box-shadow: 0 4px 0 #5a4d8a;
}

.new-user-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e0e0e0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.user-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.stats-container {
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid #e0e0e0;
    text-align: left;
}

.stat-card h3 {
    margin: 0 0 1rem 0;
    color: var(--secondary-color);
}

.stat-card p {
    margin: 0.5rem 0;
}
