@charset "windows-1251";
:root {
  --ink: #3a2413;
  --ink-heading: #4a1b0a;
  --link: #660000;
  --rule: rgba(102, 0, 0, 0.28);
  --panel: rgba(255, 255, 255, 0.18);
  --panel-card: rgba(255, 255, 255, 0.10);
  --panel-border: rgba(102, 0, 0, 0.26);
  --panel-border-strong: rgba(102, 0, 0, 0.48);
  --green: #2e7d32;
  --green-dark: #1b5e20;
  --red: #b71c1c;
  --red-dark: #7f0000;
}

.page-wrap,
.page-wrap *,
.page-wrap *::before,
.page-wrap *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  background-color: #641b07;
  background-image: url("texture/wood-fill.jpg");
  background-repeat: repeat;
  font-family: Georgia, "Times New Roman", Times, serif;
  overflow-x: hidden;
}

.page-wrap {
  flex: 1 0 auto;
  width: 100%;
  display: flex;
  padding: 24px 16px;
}

#shadow-left,
#shadow-right {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 221px;
  height: 100%;
  background-image: url("texture/shadow.png");
  background-repeat: repeat-y;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 1;
}

#shadow-left {
  left: 0;
}

#shadow-right {
  right: 0;
  transform: scaleX(-1);
}

.quiz-window {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 610px;
  margin: auto;
  padding: 12px;
  font-size: 15px;
  line-height: 1.48;
  color: var(--ink);
  background-color: #D7BA8F;
  background-image: url("texture/ContFill.jpg");
  border-radius: 4px;
  box-shadow:
    2px 4px 16px rgba(0, 0, 0, 0.65),
    -1px 2px 5px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(102, 0, 0, 0.30),
    inset 5px 3px 13px rgba(255, 255, 255, 0.28),
    inset -5px -3px 13px rgba(120, 72, 28, 0.20);
  transition: max-width 0.2s ease;
}

.quiz-window.is-wide {
  max-width: 660px;
}

.quiz-card {
  position: relative;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  background: var(--panel-card);
  overflow: hidden;
}

.quiz-card-header {
  margin: 0;
  padding: 7px 16px;
  background-color: #D2A86B;
  background-image: url("texture/ContFillHD.gif");
  border-bottom: 1px solid var(--panel-border);
  font-size: 11pt;
  font-weight: bold;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  text-align: center;
  color: #3a1400;
}

.quiz-card-body {
  padding: 20px 22px 22px;
}

.rule-line {
  height: 1px;
  border: 0;
  border-bottom: 1px dotted var(--rule);
  margin: 16px 0;
}

/* Стартовый экран */
.start-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
}

.header-logo-link {
  display: inline-flex;
  line-height: 0;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.header-logo-link:hover {
  opacity: 0.85;
}

.header-logo {
  display: block;
  width: 90px;
  height: 26px;
}

.start-body {
  text-align: center;
}

.quiz-title {
  margin: 2px 0 0;
  font-size: 15.5pt;
  line-height: 1.35;
  font-weight: bold;
  color: var(--ink-heading);
  text-shadow: rgba(255, 255, 255, 0.35) 0 1px 0;
}

.total-info {
  margin: 0 0 14px;
  font-size: 11.5pt;
  color: var(--ink);
}

.total-info strong {
  color: var(--link);
  font-size: 12.5pt;
}

.mode-selector {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 515px;
  margin: 0 auto;
  text-align: left;
}

.mode-option {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--panel-border);
  border-radius: 3px;
  background: var(--panel);
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.mode-option:hover {
  background-color: rgba(210, 168, 107, 0.45);
  border-color: var(--panel-border-strong);
}

.mode-option:has(input:checked) {
  background-color: #D2A86B;
  background-image: url("texture/ContFillHD.gif");
  border-color: var(--panel-border-strong);
  color: #261004;
}

.mode-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-radio-mark {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #663318;
  background: rgba(255, 255, 255, 0.55);
  position: relative;
}

.mode-option input[type="radio"]:checked + .mode-radio-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--link);
}

.mode-text {
  font-size: 11pt;
  line-height: 1.35;
}

.mode-text-custom {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 7px;
}

.custom-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.count-input {
  width: 58px;
  height: 28px;
  padding: 0 5px 1px;
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 10.5pt;
  line-height: normal;
  font-weight: bold;
  text-align: center;
  color: var(--ink-heading);
  background: rgba(255, 252, 244, 0.82);
  border: 1px solid rgba(102, 0, 0, 0.42);
  border-radius: 3px;
  outline: none;
}

.count-input:focus {
  border-color: var(--link);
  box-shadow: 0 0 0 2px rgba(102, 0, 0, 0.16);
  background: #fffdf8;
}

.count-unit {
  font-size: 11pt;
  line-height: 1.35;
  color: inherit;
}

.error-msg {
  margin: 12px auto 0;
  padding: 6px 12px;
  max-width: 470px;
  font-size: 10.5pt;
  color: var(--red-dark);
  background: rgba(183, 28, 28, 0.10);
  border: 1px solid rgba(183, 28, 28, 0.35);
  border-radius: 3px;
}

.start-actions {
  margin-top: 18px;
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 11pt;
  font-weight: bold;
  line-height: 1.25;
  color: var(--link);
  padding: 8px 18px;
  border: 1px solid var(--panel-border-strong);
  border-radius: 3px;
  background-color: rgba(255, 255, 255, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 1px 2px rgba(58, 36, 19, 0.14);
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease, transform 0.06s ease;
}

.btn:hover:not(:disabled) {
  background-color: #D2A86B;
  background-image: url("texture/ContFillHD.gif");
  border-color: #660000;
  color: #000000;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-primary {
  font-size: 11.5pt;
  padding: 9px 28px;
  color: #3a1400;
  background-color: rgba(210, 168, 107, 0.42);
  border-color: rgba(102, 0, 0, 0.52);
}

/* Экран вопроса */
.question-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 10.5pt;
}

.question-progress-text {
  flex-shrink: 0;
  white-space: nowrap;
  color: #3a1400;
}

.quiz-progress-track {
  flex: 1;
  height: 9px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(102, 0, 0, 0.36);
  box-shadow: inset 0 1px 2px rgba(58, 20, 0, 0.18);
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, #7a1c0a, #9e2a14);
  transition: width 0.32s ease;
}

.question-weight {
  flex-shrink: 0;
  white-space: nowrap;
  font-weight: normal;
  font-size: 10pt;
  color: #5a280c;
  background: rgba(255, 255, 255, 0.30);
  padding: 1px 8px;
  border-radius: 3px;
  border: 1px solid rgba(102, 0, 0, 0.22);
}

.question-header-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

/* Кружок-индикатор слева от вопроса */
.status-circle {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid rgba(102, 0, 0, 0.36);
  background: rgba(255, 255, 255, 0.26);
  box-shadow: inset 0 1px 3px rgba(58, 36, 19, 0.20);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.status-icon {
  width: 20px;
  height: 20px;
  display: none;
}

.status-circle.is-correct {
  background: radial-gradient(circle at 35% 30%, #43a047, var(--green));
  border-color: var(--green-dark);
  box-shadow: 0 2px 6px rgba(27, 94, 32, 0.40), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  animation: pop-indicator 0.28s ease-out;
}

.status-circle.is-correct .icon-check {
  display: block;
}

.status-circle.is-wrong {
  background: radial-gradient(circle at 35% 30%, #e53935, var(--red));
  border-color: var(--red-dark);
  box-shadow: 0 2px 6px rgba(127, 0, 0, 0.40), inset 0 1px 1px rgba(255, 255, 255, 0.30);
  animation: shake-indicator 0.34s ease-out;
}

.status-circle.is-wrong .icon-cross {
  display: block;
}

@keyframes pop-indicator {
  0% {
    transform: scale(0.82);
  }
  60% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shake-indicator {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  50% {
    transform: translateX(3px);
  }
  75% {
    transform: translateX(-2px);
  }
}

.question-text {
  margin: 0;
  font-size: 13pt;
  line-height: 1.42;
  font-weight: bold;
  color: var(--ink-heading);
  white-space: pre-line;
}

/* Список вариантов ответа */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-btn {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 9px 14px;
  text-align: left;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 11.5pt;
  line-height: 1.36;
  color: var(--ink);
  border: 1px solid var(--panel-border);
  border-radius: 3px;
  background-color: var(--panel);
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease, opacity 0.18s ease;
}

.option-btn:hover:not(:disabled) {
  background-color: #D2A86B;
  background-image: url("texture/ContFillHD.gif");
  border-color: var(--panel-border-strong);
  color: #000000;
}

/* Состояние после ответа пользователя (переголосовать нельзя) */
.option-btn:disabled {
  cursor: default;
}

.options-list.is-locked .option-btn:not(.is-selected) {
  opacity: 0.68;
}

.option-btn.is-selected {
  background-color: #D2A86B;
  background-image: url("texture/ContFillHD.gif");
  border-color: #660000;
  color: #1f0a00;
  font-weight: bold;
  box-shadow: inset 0 1px 3px rgba(58, 20, 0, 0.18);
}

/* Полоска 3-секундной паузы внизу карточки вопроса */
.pause-progress-track {
  height: 3px;
  width: 100%;
  background: transparent;
  overflow: hidden;
}

.pause-progress-bar {
  height: 100%;
  width: 0%;
  background: rgba(102, 0, 0, 0.50);
}

.pause-progress-bar.is-running {
  width: 100%;
  animation: pause-countdown 3s linear forwards;
}

@keyframes pause-countdown {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

/* Финальный экран и страница разбора ошибок */
.result-percent-box {
  text-align: center;
  padding: 14px 16px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  background-color: rgba(210, 168, 107, 0.35);
  background-image: url("texture/ContFillHD.gif");
}

.result-percent-label {
  font-size: 10.5pt;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5a280c;
  margin-bottom: 4px;
}

.result-percent-value {
  font-size: 30pt;
  line-height: 1.1;
  font-weight: bold;
  color: var(--link);
  text-shadow: rgba(255, 255, 255, 0.45) 0 1px 0;
}

.stats-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 13px;
  border: 1px solid var(--panel-border);
  border-radius: 3px;
  background: var(--panel);
  font-size: 11.5pt;
}

.stats-val {
  white-space: nowrap;
  color: var(--ink-heading);
  font-size: 12pt;
}

.stats-row-muted {
  font-size: 10.5pt;
  color: #5a361b;
  background: rgba(255, 255, 255, 0.10);
}

.stats-row-muted .stats-val {
  font-size: 10.5pt;
  color: #5a361b;
}

.final-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.final-actions-top {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dotted var(--rule);
}

/* Раздел «Показать, где я ошибся» */
.mistakes-intro {
  margin: 0 0 14px;
  text-align: center;
  font-size: 11pt;
  color: #5a280c;
}

.no-mistakes-box {
  padding: 18px 16px;
  text-align: center;
  border: 1px solid rgba(46, 125, 50, 0.40);
  border-radius: 4px;
  background: rgba(46, 125, 50, 0.10);
  color: var(--green-dark);
  font-size: 11.5pt;
  font-weight: bold;
}

.mistakes-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mistake-card {
  border: 1px solid var(--panel-border-strong);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.mistake-card-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 14px;
  background-color: rgba(210, 168, 107, 0.55);
  background-image: url("texture/ContFillHD.gif");
  border-bottom: 1px solid var(--panel-border);
}

.mistake-badge-wrong {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--red);
  border: 1px solid var(--red-dark);
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.mistake-q-title {
  margin: 0;
  flex: 1;
  font-size: 11.5pt;
  line-height: 1.4;
  font-weight: bold;
  color: var(--ink-heading);
  white-space: pre-line;
}

.mistake-card-body {
  padding: 12px 14px 14px;
}

.mistake-options {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mistake-options:last-child {
  margin-bottom: 0;
}

.mistake-opt {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 3px;
  border: 1px solid rgba(102, 0, 0, 0.16);
  background: rgba(255, 255, 255, 0.18);
  font-size: 10.5pt;
  color: var(--ink);
}

.mistake-opt.is-user-wrong {
  background: rgba(183, 28, 28, 0.12);
  border-color: rgba(183, 28, 28, 0.48);
  color: var(--red-dark);
  font-weight: bold;
}

.mistake-opt.is-right-option {
  background: rgba(46, 125, 50, 0.11);
  border-color: rgba(46, 125, 50, 0.45);
  color: var(--green-dark);
}

.mistake-opt-tag {
  flex-shrink: 0;
  font-size: 9.5pt;
  font-weight: bold;
  padding: 1px 7px;
  border-radius: 3px;
}

.mistake-opt.is-user-wrong .mistake-opt-tag {
  background: rgba(183, 28, 28, 0.16);
  color: var(--red-dark);
}

.mistake-opt.is-right-option .mistake-opt-tag {
  background: rgba(46, 125, 50, 0.16);
  color: var(--green-dark);
}

.mistake-comment-box {
  padding: 9px 12px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.24);
  border-left: 3px solid var(--green);
  font-size: 10.5pt;
  line-height: 1.48;
  color: var(--ink);
}

.mistake-comment-label {
  display: block;
  font-weight: bold;
  color: var(--ink-heading);
  margin-bottom: 3px;
}

.mistake-comment-text {
  white-space: pre-line;
}

@media (max-width: 960px) {
  #shadow-left,
  #shadow-right {
    width: 90px;
    background-size: 90px 221px;
  }
}

@media (max-width: 560px) {
  .page-wrap {
    padding: 12px 8px;
  }

  #shadow-left,
  #shadow-right {
    width: 32px;
    background-size: 32px 221px;
  }

  .quiz-window {
    padding: 8px;
  }

  .quiz-card-body {
    padding: 15px 14px 16px;
  }

  .quiz-title {
    font-size: 13.5pt;
  }

  .mode-option {
    height: auto;
    min-height: 46px;
    padding: 8px 12px;
  }

  .mode-text-custom {
    flex-wrap: wrap;
  }

  .question-text {
    font-size: 11.5pt;
  }

  .status-circle {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
  }

  .stats-row {
    flex-direction: column;
    gap: 3px;
  }

  .final-actions {
    flex-direction: column;
  }

  .final-actions .btn {
    width: 100%;
  }
}