:root {
    --primary-bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.85);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --correct: #10b981;
    --incorrect: #ef4444;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #020617 0%, #1e1b4b 100%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 100vh;
}

header {
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    color: transparent;
}

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden {
    display: none !important;
}

/* HOME SCREEN */
.screen-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

.category-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-bottom: 2rem;
}

.category-item {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-item:hover {
    background: rgba(43, 62, 88, 0.85);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
}

.cat-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
    color: var(--accent);
}

.cat-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.cat-stats {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.2);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.cat-stats strong {
    color: var(--text-main);
    display: block;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

/* QUIZ SCREEN */
.quiz-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.stats-header {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.text-accent {
    color: #c084fc;
    font-weight: 600;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    flex: 1; /* evenly divide space */
    max-width: 120px;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
}

.text-green { color: var(--correct); }
.text-red { color: var(--incorrect); }

.glass-effect {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.question-header {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.word-display {
    text-align: center;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #fff;
    text-shadow: 0 0 20px rgba(255,255,255,0.2);
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.option-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.2rem 1rem;
    border-radius: 16px;
    color: var(--text-main);
    font-size: 1.1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    line-height: 1.3;
}

.option-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
}

.option-btn:active:not(:disabled) {
    transform: translateY(0);
}

.option-btn.correct {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: var(--correct) !important;
    color: var(--correct) !important;
    font-weight: 700;
}

.option-btn.wrong {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: var(--incorrect) !important;
    color: var(--incorrect) !important;
    font-weight: 700;
}

.option-btn:disabled {
    cursor: default;
}

/* END SCREEN */
.text-center { text-align: center; }

.text-gradient {
    font-size: 2.5rem;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 2rem;
}

.result-box {
    margin-bottom: 1.5rem;
}

.result-number {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
}

.result-label {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.controls.vertical {
    flex-direction: column;
    align-items: stretch;
}

.btn {
    font-family: inherit;
    padding: 1rem 2rem;
    border-radius: 9999px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border: none;
}

.primary-btn {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.23);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    max-width: 90%;
    width: 400px;
    text-align: center;
    padding: 2rem;
}

.modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

@media (max-width: 600px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .word-display {
        font-size: 2.8rem;
    }
    
    .app-container {
        padding: 1rem;
    }
    
    .glass-effect {
        padding: 1.5rem;
    }
}
