:root {
    --primary: #4CAF50;
    --primary-dark: #388E3C;
    --secondary: #2196F3;
    --secondary-dark: #1976D2;
    --tertiary: #FF9800;
    --tertiary-dark: #F57C00;
    --light: #f8f9fa;
    --dark: #212529;
    --text: #333333;
    --success: #4CAF50;
    --error: #f44336;
    --warning: #FF9800;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    color: var(--text);
}

.container {
    width: 100%;
    max-width: 800px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    margin-bottom: 20px;
}

header {
    background: var(--primary);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.yakdiel-avatar {
    margin-bottom: 15px;
}

.avatar-circle {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    color: white;
    margin: 0 auto;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

main {
    padding: 20px;
}

.welcome-message {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.2rem;
    padding: 15px;
    background: var(--light);
    border-radius: 10px;
}

.controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .controls {
        grid-template-columns: 1fr 1fr;
    }
}

.btn {
    padding: 15px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-dark);
    transform: translateY(-3px);
}

.btn-tertiary {
    background: var(--tertiary);
    color: white;
}

.btn-tertiary:hover {
    background: var(--tertiary-dark);
    transform: translateY(-3px);
}

.category-selector {
    margin-bottom: 30px;
}

.category-selector h3 {
    margin-bottom: 15px;
    text-align: center;
    color: var(--primary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.category-btn {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.category-btn:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.game-area {
    margin-bottom: 30px;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: var(--light);
    padding: 15px;
    border-radius: 10px;
}

.score-display {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
}

.progress-bar {
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    flex: 1;
    margin: 0 15px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.5s ease;
}

.question-counter {
    font-weight: bold;
    color: var(--primary);
}

.question-container {
    margin-bottom: 20px;
}

.question-text {
    font-size: 1.4rem;
    margin-bottom: 20px;
    line-height: 1.5;
    padding: 15px;
    background: var(--light);
    border-radius: 10px;
    text-align: center;
}

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

@media (min-width: 768px) {
    .options {
        grid-template-columns: 1fr 1fr;
    }
}

.option-btn {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.option-btn:hover:not(:disabled) {
    background: #f0f0f0;
    border-color: var(--primary);
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.option-btn.correct {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.option-btn.wrong {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.feedback {
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
    font-weight: bold;
    display: none;
}

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

.feedback.wrong {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.topic-input {
    margin-bottom: 30px;
}

.selected-category {
    padding: 10px 15px;
    background: var(--light);
    border-radius: 10px;
    margin-bottom: 15px;
    font-weight: bold;
    text-align: center;
    color: var(--primary);
}

.input-group {
    display: flex;
    gap: 10px;
}

@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
    }
}

.input-group input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
}

.input-group input:focus {
    border-color: var(--primary);
    outline: none;
}

.saved-topics {
    margin-bottom: 30px;
}

.saved-list {
    max-height: 400px;
    overflow-y: auto;
}

.topic-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 5px solid var(--primary);
}

.topic-item h4 {
    margin-bottom: 10px;
    color: var(--primary);
}

.topic-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.results-container {
    text-align: center;
    padding: 30px;
}

.results-title {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--primary);
}

.final-score {
    font-size: 3rem;
    font-weight: bold;
    margin: 20px 0;
    color: var(--secondary);
}

.results-message {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

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

.loading {
    text-align: center;
    padding: 20px;
    display: none;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

footer {
    text-align: center;
    padding: 20px;
    background: var(--light);
    color: #666;
    font-size: 0.9rem;
}

.install-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
