/* ===== CSS Custom Properties ===== */
:root {
    --green: #58CC02;
    --green-dark: #46A302;
    --green-light: #89E219;
    --blue: #1CB0F6;
    --blue-dark: #1899D6;
    --red: #FF4B4B;
    --red-dark: #EA2B2B;
    --orange: #FF9600;
    --purple: #CE82FF;
    --yellow: #FFC800;
    --gray-50: #F7F7F7;
    --gray-100: #E5E5E5;
    --gray-200: #CDCDCD;
    --gray-300: #AFAFAF;
    --gray-400: #787878;
    --gray-500: #4B4B4B;
    --gray-600: #3C3C3C;
    --white: #FFFFFF;
    --bg: #FFFFFF;
    --text: #3C3C3C;
    --text-light: #787878;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: 0.2s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
}

#app {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px 32px;
    min-height: 100vh;
    min-height: 100dvh;
}

button {
    font-family: var(--font);
    cursor: pointer;
    border: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* ===== Typography ===== */
.title-xl { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.title-lg { font-size: 24px; font-weight: 700; }
.title-md { font-size: 20px; font-weight: 700; }
.title-sm { font-size: 16px; font-weight: 700; }
.body-lg { font-size: 18px; font-weight: 500; }
.body-md { font-size: 16px; font-weight: 500; }
.body-sm { font-size: 14px; font-weight: 500; }
.caption { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); }

/* ===== Header Bar ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 100;
}

.header-left, .header-right { display: flex; align-items: center; gap: 12px; }

.header-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--green);
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background var(--transition);
    color: var(--gray-500);
}

.icon-btn:hover { background: var(--gray-100); }

.streak-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    border-radius: 20px;
    font-weight: 700;
    font-size: 15px;
    color: var(--orange);
}

/* ===== Back Button ===== */
.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: background var(--transition);
    color: var(--gray-500);
}

.back-btn:hover { background: var(--gray-100); }

/* ===== Suggested Practice Button ===== */
.suggested-btn {
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: white;
    border-radius: var(--radius-lg);
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md), 0 4px 0 var(--green-dark);
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
}

.suggested-btn:active {
    transform: translateY(2px);
    box-shadow: var(--shadow-sm), 0 2px 0 var(--green-dark);
}

.suggested-btn .badge {
    background: rgba(255,255,255,0.25);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
}

.suggested-btn.pulse::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    animation: pulse-ring 2s ease-out infinite;
    border: 3px solid var(--green);
}

@keyframes pulse-ring {
    0% { opacity: 0.6; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.05); }
}

/* ===== Category Grid ===== */
.section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    margin-bottom: 16px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.category-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--gray-100);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.category-card:active {
    transform: scale(0.97);
}

.category-icon {
    font-size: 36px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.category-meta {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 600;
}

/* ===== Progress Bar ===== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}

.progress-bar.thin { height: 4px; }
.progress-bar.thick { height: 10px; }

.progress-segment {
    height: 100%;
    transition: width 0.5s ease;
}

.progress-mastered { background: var(--green); }
.progress-learned { background: var(--blue); }
.progress-learning { background: var(--yellow); }
.progress-new { background: var(--gray-200); }

/* ===== Category Detail ===== */
.category-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.category-header-icon {
    font-size: 48px;
    width: 72px;
    height: 72px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-header-info { flex: 1; }
.category-header-info h2 { font-size: 24px; font-weight: 800; }
.category-header-info p { font-size: 14px; color: var(--text-light); margin-top: 4px; }

.review-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: white;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm), 0 3px 0 var(--blue-dark);
    transition: transform var(--transition);
}

.review-btn:active {
    transform: translateY(2px);
    box-shadow: var(--shadow-sm), 0 1px 0 var(--blue-dark);
}

.round-card {
    background: var(--white);
    border: 2px solid var(--gray-100);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform var(--transition), border-color var(--transition);
}

.round-card:hover {
    border-color: var(--gray-200);
    transform: translateY(-1px);
}

.round-card:active { transform: scale(0.98); }

.round-info h3 { font-size: 16px; font-weight: 700; }
.round-info p { font-size: 13px; color: var(--text-light); margin-top: 2px; }

.round-progress {
    width: 48px;
    height: 48px;
    position: relative;
}

.round-progress svg {
    width: 48px;
    height: 48px;
    transform: rotate(-90deg);
}

.round-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

/* ===== Session Progress ===== */
.session-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 100;
}

.session-progress-bar {
    flex: 1;
    height: 12px;
    background: var(--gray-100);
    border-radius: 6px;
    overflow: hidden;
}

.session-progress-fill {
    height: 100%;
    background: var(--green);
    border-radius: 6px;
    transition: width 0.4s ease;
}

.session-counter {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-light);
    white-space: nowrap;
}

.close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--gray-400);
    transition: background var(--transition);
}

.close-btn:hover { background: var(--gray-200); }

/* ===== Exercise Area ===== */
.exercise-area {
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 60vh;
}

.exercise-prompt {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 20px;
    text-align: center;
}

.exercise-word {
    font-size: 36px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
    color: var(--text);
}

.exercise-phonetic {
    font-size: 16px;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 8px;
    text-align: center;
}

.speak-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--blue);
    color: white;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 3px 0 var(--blue-dark);
    transition: transform var(--transition);
}

.speak-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--blue-dark);
}

/* ===== Flashcard ===== */
.flashcard-container {
    perspective: 1000px;
    width: 100%;
    max-width: 340px;
    height: 240px;
    margin: 20px auto;
    cursor: pointer;
}

.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.flashcard.flipped { transform: rotateY(180deg); }

.flashcard-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 3px solid var(--gray-100);
}

.flashcard-front {
    background: var(--white);
}

.flashcard-back {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    transform: rotateY(180deg);
}

.flashcard-face .exercise-word { font-size: 28px; }
.flashcard-face .exercise-phonetic { font-size: 14px; }
.flashcard-hint { font-size: 13px; color: var(--text-light); margin-top: 16px; }

/* ===== Choice Buttons ===== */
.choices {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.choice-btn {
    width: 100%;
    padding: 16px 20px;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 17px;
    font-weight: 600;
    text-align: left;
    color: var(--text);
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.choice-btn:hover { border-color: var(--blue); background: #F0F9FF; }
.choice-btn:active { transform: scale(0.98); }
.choice-btn.correct {
    border-color: var(--green);
    background: #E8F5E9;
    color: var(--green-dark);
}
.choice-btn.incorrect {
    border-color: var(--red);
    background: #FFEBEE;
    color: var(--red-dark);
}
.choice-btn.disabled { pointer-events: none; opacity: 0.7; }

/* ===== Flashcard Self-Report Buttons ===== */
.self-report-btns {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 340px;
    margin-top: 20px;
}

.report-btn {
    flex: 1;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    color: white;
    transition: transform var(--transition);
}

.report-btn:active { transform: translateY(2px); }
.report-btn.still-learning {
    background: var(--orange);
    box-shadow: 0 3px 0 #D47F00;
}
.report-btn.got-it {
    background: var(--green);
    box-shadow: 0 3px 0 var(--green-dark);
}

/* ===== Match Pairs ===== */
.match-container {
    display: flex;
    gap: 16px;
    width: 100%;
    margin-top: 16px;
}

.match-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.match-item {
    padding: 14px 12px;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), transform var(--transition), opacity var(--transition);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
}

.match-item:hover { border-color: var(--blue); }
.match-item.selected {
    border-color: var(--blue);
    background: #E3F2FD;
    transform: scale(1.03);
}
.match-item.matched {
    border-color: var(--green);
    background: #E8F5E9;
    opacity: 0.6;
    pointer-events: none;
}
.match-item.wrong {
    border-color: var(--red);
    background: #FFEBEE;
}

/* ===== Fill in the Blank ===== */
.sentence-display {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    padding: 20px;
    line-height: 1.6;
}

.sentence-display .blank {
    display: inline-block;
    min-width: 80px;
    border-bottom: 3px solid var(--blue);
    margin: 0 4px;
    padding: 2px 8px;
    font-weight: 800;
    color: var(--blue);
}

.word-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.word-bank-item {
    padding: 12px 20px;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.word-bank-item:hover { border-color: var(--blue); background: #F0F9FF; }
.word-bank-item.selected { border-color: var(--blue); background: #E3F2FD; }
.word-bank-item.correct { border-color: var(--green); background: #E8F5E9; }
.word-bank-item.incorrect { border-color: var(--red); background: #FFEBEE; }

/* ===== Type Answer ===== */
.type-input-container {
    width: 100%;
    max-width: 400px;
    margin-top: 20px;
}

.type-input {
    width: 100%;
    padding: 16px 20px;
    border: 3px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 18px;
    font-weight: 600;
    font-family: var(--font);
    text-align: center;
    transition: border-color var(--transition);
    outline: none;
}

.type-input:focus { border-color: var(--blue); }
.type-input.correct { border-color: var(--green); background: #E8F5E9; }
.type-input.incorrect { border-color: var(--red); background: #FFEBEE; }

.char-helper {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
    flex-wrap: wrap;
}

.char-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid var(--gray-200);
    background: var(--white);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}

.char-btn:hover { border-color: var(--blue); background: #F0F9FF; }

.check-btn {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 17px;
    font-weight: 700;
    color: white;
    background: var(--green);
    box-shadow: 0 3px 0 var(--green-dark);
    margin-top: 16px;
    transition: transform var(--transition);
}

.check-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--green-dark);
}

.check-btn:disabled {
    background: var(--gray-200);
    box-shadow: 0 3px 0 var(--gray-300);
    color: var(--gray-400);
}

/* ===== Listening Mode ===== */
.listen-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), #0D8ECF);
    color: white;
    font-size: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    cursor: pointer;
    box-shadow: var(--shadow-md), 0 4px 0 var(--blue-dark);
    transition: transform var(--transition);
    animation: listen-pulse 2s ease infinite;
}

.listen-icon:active {
    transform: translateY(2px) scale(0.97);
}

@keyframes listen-pulse {
    0%, 100% { box-shadow: var(--shadow-md), 0 4px 0 var(--blue-dark), 0 0 0 0 rgba(28, 176, 246, 0.3); }
    50% { box-shadow: var(--shadow-md), 0 4px 0 var(--blue-dark), 0 0 0 12px rgba(28, 176, 246, 0); }
}

/* ===== Results Screen ===== */
.results-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 0;
}

.score-circle {
    width: 160px;
    height: 160px;
    position: relative;
    margin-bottom: 24px;
}

.score-circle svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.score-circle-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-value { font-size: 44px; font-weight: 800; }
.score-label { font-size: 14px; color: var(--text-light); font-weight: 600; }

.results-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 28px;
}

.result-stat {
    text-align: center;
}

.result-stat-value {
    font-size: 28px;
    font-weight: 800;
}

.result-stat-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
}

.results-items {
    width: 100%;
    margin-bottom: 24px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}

.result-item.correct-result { background: #F1F8E9; }
.result-item.incorrect-result { background: #FFEBEE; }

.result-item-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.result-item-icon.correct-icon { background: var(--green); }
.result-item-icon.incorrect-icon { background: var(--red); }

.result-item-text { flex: 1; }
.result-item-dutch { font-weight: 700; font-size: 15px; }
.result-item-english { font-size: 13px; color: var(--text-light); }

.results-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 17px;
    font-weight: 700;
    color: white;
    background: var(--green);
    box-shadow: 0 3px 0 var(--green-dark);
    transition: transform var(--transition);
}

.btn-primary:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--green-dark);
}

.btn-secondary {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    background: var(--white);
    border: 2px solid var(--gray-200);
    transition: all var(--transition);
}

.btn-secondary:hover { border-color: var(--gray-300); background: var(--gray-50); }

/* ===== Settings ===== */
.settings-section {
    margin-bottom: 28px;
}

.settings-section h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-100);
}

.setting-label {
    font-size: 16px;
    font-weight: 600;
}

.setting-desc {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
}

/* Toggle Switch */
.toggle {
    width: 52px;
    height: 30px;
    border-radius: 15px;
    background: var(--gray-200);
    position: relative;
    cursor: pointer;
    transition: background var(--transition);
    flex-shrink: 0;
}

.toggle.active { background: var(--green); }

.toggle-knob {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: white;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: left var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle.active .toggle-knob { left: 24px; }

/* Slider */
.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    height: 8px;
    border-radius: 4px;
    background: var(--gray-100);
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--green);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.slider-value {
    font-weight: 700;
    font-size: 16px;
    min-width: 30px;
    text-align: center;
}

.danger-btn {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    color: var(--red);
    background: #FFF5F5;
    border: 2px solid #FFCDD2;
    transition: all var(--transition);
}

.danger-btn:hover { background: #FFEBEE; }

/* ===== Stats Screen ===== */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border: 2px solid var(--gray-100);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.stat-card-value {
    font-size: 32px;
    font-weight: 800;
}

.stat-card-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 4px;
}

.category-stats { margin-top: 20px; }

.cat-stat-row {
    margin-bottom: 16px;
}

.cat-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.cat-stat-name {
    font-size: 14px;
    font-weight: 700;
}

.cat-stat-pct {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-light);
}

/* ===== Practice Calendar ===== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-top: 8px;
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: 4px;
    background: var(--gray-100);
}

.calendar-day.practiced { background: var(--green); opacity: 0.3; }
.calendar-day.practiced.today { opacity: 1; }

/* ===== Animations ===== */
.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confetti-fall 1s ease forwards;
    animation-delay: var(--delay);
    z-index: 1000;
    pointer-events: none;
}

@keyframes confetti-fall {
    0% { transform: translate(0, 0) rotate(0); opacity: 1; }
    100% { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; }
}

.shake {
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

.flash-correct {
    animation: flash-green 0.4s ease;
}

@keyframes flash-green {
    0% { box-shadow: 0 0 0 0 rgba(88, 204, 2, 0.6); }
    50% { box-shadow: 0 0 0 8px rgba(88, 204, 2, 0.2); }
    100% { box-shadow: 0 0 0 0 rgba(88, 204, 2, 0); }
}

.flash-incorrect {
    animation: flash-red 0.4s ease;
}

@keyframes flash-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 75, 75, 0.6); }
    50% { box-shadow: 0 0 0 8px rgba(255, 75, 75, 0.2); }
    100% { box-shadow: 0 0 0 0 rgba(255, 75, 75, 0); }
}

.slide-in-right {
    animation: slide-right 0.3s ease;
}

@keyframes slide-right {
    from { transform: translateX(40px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.pop-in {
    animation: pop 0.3s ease;
}

@keyframes pop {
    0% { transform: scale(0.8); opacity: 0; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* ===== Toast ===== */
#toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    color: white;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.toast-visible { opacity: 1; transform: translateY(0); }
.toast-info { background: var(--gray-600); }
.toast-success { background: var(--green-dark); }
.toast-error { background: var(--red); }

/* ===== Confirm Dialog ===== */
.dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.dialog {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.dialog h3 { font-size: 20px; font-weight: 800; margin-bottom: 12px; }
.dialog p { font-size: 15px; color: var(--text-light); margin-bottom: 24px; }

.dialog-actions {
    display: flex;
    gap: 10px;
}

.dialog-actions button { flex: 1; }

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-light);
}

.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state-text { font-size: 16px; font-weight: 600; }

/* ===== Responsive ===== */
@media (max-width: 380px) {
    .category-grid { gap: 10px; }
    .category-card { padding: 16px 12px; }
    .category-icon { font-size: 30px; width: 48px; height: 48px; }
    .exercise-word { font-size: 28px; }
    .match-item { padding: 10px 8px; font-size: 13px; }
}

@media (min-width: 601px) {
    #app { padding: 0 24px 32px; }
    .category-grid { grid-template-columns: repeat(3, 1fr); }
}
