:root {
    --primary: #58cc02;
    --primary-dark: #46a302;
    --danger: #ff4b4b;
    --secondary: #1cb0f6;
    --bg-color: #ffffff;
    --text-color: #3c3c3c;
    --gray-light: #e5e5e5;
}

body {
    font-family: 'Nunito', sans-serif;
    margin: 0;
    background: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
}

/* Screens */
.screen {
    display: none;
    min-height: 100vh;
    flex-direction: column;
}
.screen.active { display: flex; }
.hidden { display: none !important; }

/* Home Screen */
.home-header { padding: 40px 20px; text-align: center; background: #f0f0f0; }
.course-grid { display: flex; gap: 20px; padding: 20px; justify-content: center; flex-wrap: wrap; }
.course-card {
    background: white; border: 2px solid var(--gray-light); border-radius: 16px;
    padding: 20px; width: 200px; text-align: center; cursor: pointer;
    transition: transform 0.2s;
    border-bottom: 5px solid var(--gray-light);
}
.course-card:active { transform: translateY(4px); border-bottom-width: 2px; }

/* Modals */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 100;
    display: flex; justify-content: center; align-items: center;
}
.modal-content {
    background: white; padding: 30px; border-radius: 20px;
    width: 90%; max-width: 400px; text-align: center;
}
.mode-buttons { display: flex; gap: 10px; margin: 20px 0; }
.mode-card {
    flex: 1; padding: 15px; border: 2px solid var(--secondary);
    border-radius: 12px; background: white; cursor: pointer;
}
.mode-card:hover { background: #eaf8ff; }

/* Game UI */
.top-bar { padding: 15px; display: flex; justify-content: space-between; align-items: center; }
.stats-box { font-weight: 800; font-size: 1.2rem; display: flex; gap: 15px; }
.progress-container { background: var(--gray-light); height: 10px; width: 100%; }
.progress-bar { background: var(--primary); height: 100%; transition: width 0.3s; }

.content-area { flex: 1; padding: 20px; max-width: 600px; margin: 0 auto; width: 100%; box-sizing: border-box; }

.instruction-box { margin-bottom: 20px; }
.header-row { display: flex; justify-content: space-between; align-items: center; }
.hint-icon { background: none; border: 2px solid #ffce00; border-radius: 50%; width: 36px; height: 36px; cursor: pointer; }
.hint-text { background: #fff8d6; padding: 10px; margin-top: 10px; border-radius: 8px; border-left: 4px solid #ffce00; }

/* Preview Window */
.preview-container { margin-bottom: 20px; border: 2px solid var(--gray-light); border-radius: 12px; overflow: hidden; }
.preview-label { background: var(--gray-light); padding: 5px 10px; font-size: 0.8rem; font-weight: bold; text-transform: uppercase; color: #777; }
.preview-box { height: 100px; padding: 15px; background: white; display: flex; align-items: center; justify-content: center; }
.preview-box h1 { margin: 0; font-size: 2em; } /* Normalize preview styles */

.answer-zone {
    min-height: 60px; border: 2px dashed var(--gray-light); border-radius: 12px;
    padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;
    align-items: center;
}
.options-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* Code Buttons */
.code-btn {
    background: white; border: 1px solid #ccc; border-bottom: 3px solid #ccc;
    border-radius: 8px; padding: 10px 15px; font-family: monospace; font-weight: bold;
    cursor: pointer; font-size: 1rem;
}
.code-btn:active { transform: translateY(2px); border-bottom-width: 1px; }

/* Action Footer */
.action-bar { padding: 20px; border-top: 1px solid #eee; text-align: center; }
.primary-btn {
    background: var(--primary); color: white; border: none; padding: 15px 30px;
    width: 100%; max-width: 400px; font-size: 1.2rem; font-weight: 800; border-radius: 12px;
    border-bottom: 5px solid var(--primary-dark); cursor: pointer;
}
.primary-btn.error { background: var(--danger); border-bottom-color: #cc0000; }
.primary-btn.next { background: var(--secondary); border-bottom-color: #118cc6; }