:root {
    color-scheme: dark;
    --quiz-forest: #111a16;
    --quiz-forest-light: #344d3e;
    --quiz-ink: #f1f3ed;
    --quiz-muted: #aeb8af;
    --quiz-paper: #1b2420;
    --quiz-line: #3a4940;
    --quiz-coral: #d87864;
    --quiz-gold: #e2b54b;
    --quiz-green: #75b992;
}

* { box-sizing: border-box; }

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--quiz-ink);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background-color: var(--quiz-forest);
    background-image: repeating-linear-gradient(135deg, transparent 0 42px, rgba(255,255,255,.025) 43px 44px);
}

button, a { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--quiz-gold); outline-offset: 3px; }

.quiz-header {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px max(24px, calc((100vw - 1060px) / 2));
    border-bottom: 1px solid rgba(255,255,255,.17);
    color: #fff;
}

.quiz-brand { display: inline-flex; min-width: 0; align-items: center; gap: 10px; color: inherit; font: 700 16px/1.2 Georgia, serif; text-decoration: none; }
.quiz-brand span:first-child { font: 26px/1 "Segoe UI Emoji", sans-serif; }
.quiz-home { color: #f0c978; font-size: 13px; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.quiz-main { width: min(840px, 100%); margin: 0 auto; padding: 46px 20px 60px; }

.quiz-panel {
    overflow: hidden;
    padding: 32px 36px 30px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 9px;
    background: var(--quiz-paper);
    box-shadow: 0 24px 70px rgba(7,25,20,.25);
    animation: panel-arrive .42s ease-out both;
}

.quiz-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.quiz-kicker { margin: 0 0 7px; color: var(--quiz-coral); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.quiz-topline h1 { margin: 0; font: 700 32px/1.15 Georgia, "Times New Roman", serif; }
.language-tabs { display: inline-flex; flex: 0 0 auto; gap: 3px; padding: 4px; border: 1px solid var(--quiz-line); border-radius: 7px; background: #232e28; }
.language-tabs button { min-width: 42px; min-height: 34px; padding: 6px 9px; border: 0; border-radius: 4px; color: var(--quiz-muted); background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.language-tabs button[aria-pressed="true"] { color: #fff; background: var(--quiz-forest); }
.quiz-progress-row { display: flex; justify-content: space-between; gap: 16px; margin: 26px 0 8px; color: var(--quiz-muted); font-size: 12px; font-weight: 700; }
#quiz-progress { display: block; width: 100%; height: 7px; margin: 0 0 26px; border: 0; border-radius: 8px; background: #303d35; accent-color: var(--quiz-coral); }
#quiz-progress::-webkit-progress-bar { border-radius: 8px; background: #303d35; }
#quiz-progress::-webkit-progress-value { border-radius: 8px; background: var(--quiz-coral); transition: width .25s ease; }
#quiz-progress::-moz-progress-bar { border-radius: 8px; background: var(--quiz-coral); }

#question-panel h2 { margin: 0 0 19px; font: 700 23px/1.35 Georgia, "Times New Roman", serif; }
#answer-list { display: grid; gap: 9px; }
.answer-option { width: 100%; min-height: 52px; padding: 13px 15px; border: 1px solid var(--quiz-line); border-radius: 6px; color: var(--quiz-ink); background: #202b25; font-size: 15px; line-height: 1.4; text-align: left; cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.answer-option:not(:disabled):hover { transform: translateX(3px); border-color: var(--quiz-forest-light); background: #29392f; }
.answer-option:disabled { cursor: default; }
.answer-option.is-correct { border-color: #5b966f; background: #20372a; }
.answer-option.is-wrong { border-color: #a85f54; background: #3a2826; }
#answer-feedback { margin: 15px 0 0; padding: 12px 14px; border-left: 3px solid var(--quiz-green); border-radius: 0 5px 5px 0; background: #20372a; font-size: 14px; line-height: 1.55; }
#answer-feedback.is-wrong { border-left-color: var(--quiz-coral); background: #3a2826; }
.quiz-navigation { display: flex; align-items: center; gap: 10px; margin-top: 24px; }
.quiz-button { min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 6px; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .16s ease, transform .16s ease; }
.quiz-button:hover:not(:disabled) { transform: translateY(-1px); }
.quiz-button:disabled { opacity: .46; cursor: not-allowed; }
.quiz-button.primary { margin-left: auto; color: #fff; background: var(--quiz-coral); }
.quiz-button.primary:hover:not(:disabled) { background: #a63d30; }
.quiz-button.secondary { border-color: var(--quiz-line); color: var(--quiz-ink); background: transparent; }
.quiz-button.secondary:hover:not(:disabled) { background: #28352d; }
.completion-panel { padding: 26px 0 6px; text-align: center; }
.completion-bear { display: block; font: 52px/1 "Segoe UI Emoji", sans-serif; }
.completion-panel h2 { margin: 14px 0 8px; font: 700 28px/1.2 Georgia, serif; }
.completion-panel p { margin: 0 0 20px; color: var(--quiz-muted); }
.completion-panel .quiz-button.primary { margin: 0; }
.quiz-status { margin: 20px 0 0; color: var(--quiz-muted); font-size: 13px; text-align: center; }
[hidden] { display: none !important; }

@keyframes panel-arrive {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .quiz-header { min-height: 64px; padding: 12px 16px; }
    .quiz-brand { font-size: 14px; }
    .quiz-home { font-size: 12px; }
    .quiz-main { padding: 22px 12px 36px; }
    .quiz-panel { padding: 22px 18px 20px; }
    .quiz-topline { flex-direction: column; }
    .quiz-topline h1 { font-size: 28px; }
    .quiz-progress-row { margin-top: 20px; }
    #question-panel h2 { font-size: 20px; }
    .answer-option { min-height: 48px; font-size: 14px; }
}
