* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

#app {
    width: 100%;
    max-width: 560px;
}

/* Shared card style */
#welcome-screen, #quiz-screen, #results-screen {
    background: white;
    padding: 28px 24px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

h1 {
    margin: 0 0 8px 0;
    font-size: 1.5em;
    color: #1a1a2e;
}

/* Welcome Screen */
#welcome-screen p {
    color: #555;
    margin-bottom: 20px;
}

/* Randomize toggle */
#randomize-row {
    margin-bottom: 16px;
}

.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95em;
    color: #333;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-label input:checked + .toggle-switch {
    background: #4361ee;
}

.toggle-label input:checked + .toggle-switch::after {
    transform: translateX(20px);
}

#welcome-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger, .btn-ghost {
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    transition: background-color 0.15s, opacity 0.15s;
}

.btn-primary {
    background-color: #4361ee;
    color: white;
}
.btn-primary:hover:not(:disabled) {
    background-color: #3651d4;
}

.btn-secondary {
    background-color: #e8ecf4;
    color: #1a1a2e;
}
.btn-secondary:hover {
    background-color: #d5dceb;
}

.btn-danger {
    background-color: #ef476f;
    color: white;
}
.btn-danger:hover {
    background-color: #d63d62;
}

.btn-ghost {
    background: transparent;
    color: #666;
    padding: 8px 0;
    text-align: left;
}
.btn-ghost:hover {
    color: #333;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Progress bar */
#progress-bar-container {
    width: 100%;
    height: 6px;
    background: #e8ecf4;
    border-radius: 3px;
    margin-bottom: 6px;
    overflow: hidden;
}

#progress-bar {
    height: 100%;
    width: 0%;
    background: #4361ee;
    border-radius: 3px;
    transition: width 0.3s ease;
}

#progress-text {
    font-size: 0.85em;
    color: #888;
    margin: 0 0 16px 0;
}

/* Question */
#question-text {
    font-size: 1.15em;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 16px 0;
    line-height: 1.4;
}

/* Option buttons */
#options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.option-btn {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border: 2px solid #e0e4ec;
    border-radius: 8px;
    background: white;
    color: #1a1a2e;
    font-size: 0.95em;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.option-btn:hover:not(:disabled) {
    border-color: #4361ee;
    background-color: #f5f7ff;
}

.option-btn.selected {
    border-color: #4361ee;
    background-color: #eef1ff;
}

.option-btn.correct {
    border-color: #2ecc71;
    background-color: #eafaf1;
}

.option-btn.incorrect {
    border-color: #e74c3c;
    background-color: #fdedec;
}

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

/* Feedback */
.feedback-hidden {
    display: none;
}

.feedback-visible, .correct, .incorrect {
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 500;
    margin-bottom: 12px;
    font-size: 0.95em;
}

div.correct {
    background: #eafaf1;
    color: #1a7d4a;
}

div.incorrect {
    background: #fdedec;
    color: #b13a2e;
}

/* Quiz buttons area */
#quiz-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Results Screen */
#score-summary {
    text-align: center;
    padding: 24px 0;
}

#score-percentage {
    font-size: 2em;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

#score-stats {
    font-size: 0.95em;
    color: #666;
    margin-top: 4px;
}

#results-breakdown {
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.result-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.9em;
    line-height: 1.4;
}

.result-correct {
    background: #eafaf1;
}

.result-incorrect {
    background: #fdedec;
}

.result-status {
    flex-shrink: 0;
    font-size: 1em;
}

#restart-btn {
    width: 100%;
    margin-top: 8px;
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }
    #welcome-screen, #quiz-screen, #results-screen {
        padding: 20px 16px;
    }
}
.image-row {
    display: flex;
    align-items: center;
    gap: 2px;
}

.image-row img {
    height: 70px;
}

/* move image2 upward */
.img2 {
    position: relative;
    top: -8px;
    height:100px;
}