.competition-test {
  --test-accent: #C87552;
  --test-border: #e5cfb2;
  --test-paper: #FDFCF8;
  padding: clamp(30px, 5vw, 64px) 0;
  color: var(--base-color-black);
}
.competition-test [hidden] {
  display: none !important;
}
.competition-test__container {
  max-width: 1080px;
}
.competition-test__heading {
  margin-bottom: 24px;
  text-align: center;
}
.competition-test__subtitle {
  color: var(--test-accent);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.6;
}
.competition-test__title {
  margin: 10px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 4vw, 54px);
  font-weight: 400;
  line-height: 1.15;
}
.competition-test__demo {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-left: 3px solid var(--test-accent);
  background: #FFF8E8;
  color: #606060;
  font-size: 14px;
  line-height: 1.6;
}
.competition-test__card {
  position: relative;
  padding: clamp(22px, 4vw, 48px);
  border: 1px solid var(--test-border);
  border-radius: 16px;
  background: var(--test-paper);
}
.competition-test__card--title {
  margin: 0 0 28px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 400;
  line-height: 1.2;
}
.competition-test__card--result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}
.competition-test__card--result .competition-test__card--title {
  margin-bottom: 0;
}
.competition-test__rules {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 34px;
}
.competition-test__rule {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}
.competition-test__rule > div {
  min-width: 0;
}
.competition-test__rule h3 {
  margin: 0 0 5px;
  font-size: clamp(16px, 1.8vw, 20px);
  font-weight: 600;
  line-height: 1.4;
}
.competition-test__rule p {
  margin: 0;
  color: #606060;
  font-size: 15px;
  line-height: 1.6;
}
.competition-test__rule--icon {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: #f5e8df;
  color: #a25232;
  font-size: 24px;
}
.competition-test__rule:nth-child(3) .competition-test__rule--icon {
  font-size: 13px;
  font-weight: 700;
}
.competition-test__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  width: 100%;
}
.competition-test__actions--right {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.competition-test__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 48px;
  padding: 13px 24px;
  border: 1px solid var(--test-accent);
  border-radius: 8px;
  background: var(--test-accent);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  transition: background 0.2s, color 0.2s;
}
.competition-test__button--secondary {
  color: #3D2B1F;
  border-color: #cfbda8;
  background: transparent;
  font-weight: 400;
}
.competition-test__button:hover:not(:disabled) {
  background: #a95f40;
  color: #fff;
}
.competition-test__button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.competition-test button:focus-visible, .competition-test input:focus-visible, .competition-test__answer:has(input:focus-visible) {
  outline: 3px solid #a25232;
  outline-offset: 3px;
}
.competition-test__attempts {
  color: #606060;
  font-size: 14px;
  line-height: 1.5;
}
.competition-test__attempts strong {
  color: #101010;
}
.competition-test__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.competition-test__counter {
  font-size: 14px;
  color: #606060;
}
.competition-test__timer {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f7e5db;
  border-radius: 8px;
  color: #8c3e24;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.competition-test__timer--urgent {
  outline: 1px solid #a25232;
}
.competition-test__progress {
  display: block;
  width: 100%;
  height: 4px;
  margin: 0 0 28px;
  border: 0;
  appearance: none;
  border-radius: 4px;
  background: #eee4d8;
}
.competition-test__progress::-webkit-progress-bar {
  background: #eee4d8;
  border-radius: 4px;
}
.competition-test__progress::-webkit-progress-value {
  background: var(--test-accent);
  border-radius: 4px;
}
.competition-test__progress::-moz-progress-bar {
  background: var(--test-accent);
  border-radius: 4px;
}
.competition-test__question {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.competition-test__question--title {
  padding: 0;
  margin-bottom: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 2.5vw, 32px);
  line-height: 1.3;
}
.competition-test__question--note {
  margin: 0 0 24px;
  font-size: 14px;
  color: #606060;
  line-height: 1.6;
}
.competition-test__answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.competition-test__answer {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 54px;
  padding: 14px 18px;
  border: 1px solid #ddcfbf;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1.5;
}
.competition-test__answer input {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--test-accent);
}
.competition-test__answer:has(input:checked) {
  border-color: var(--test-accent);
  background: #fcf0e8;
}
.competition-test__navigation {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 12px;
}
.competition-test__number {
  width: 40px;
  height: 40px;
  border: 1px solid #e5cfb2;
  border-radius: 50%;
  background: #f7f3ea;
  color: #101010;
  font: inherit;
}
.competition-test__number--answered {
  border-color: var(--test-accent);
}
.competition-test__number[aria-current=step] {
  background: var(--test-accent);
  border-color: var(--test-accent);
  color: #fff;
}
.competition-test__answered {
  margin: 0 0 24px;
  text-align: center;
  font-size: 13px;
  color: #606060;
}
.competition-test__score {
  --test-score: 0%;
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  padding: 8px;
  border-radius: 50%;
  background: conic-gradient(var(--test-accent) var(--test-score), #ede5db 0);
}
.competition-test__score span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border-radius: 50%;
  background: var(--test-paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 48px;
}
.competition-test__result--caption, .competition-test__result--reason {
  color: #606060;
  font-size: 14px;
  line-height: 1.5;
}
.competition-test__result--status {
  max-width: 650px;
  font-size: 16px;
  line-height: 1.6;
}
.competition-test__preview {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  padding: 14px;
  border: 1px dashed #cfbda8;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}
.competition-test__preview span {
  flex-basis: 100%;
  color: #606060;
}
.competition-test__preview button {
  padding: 8px 12px;
  border: 1px solid #cfbda8;
  border-radius: 6px;
  font: inherit;
  color: #101010;
}
.competition-test__preview button[aria-pressed=true] {
  background: #f5e8df;
  border-color: var(--test-accent);
}
.competition-test__notice {
  width: 100%;
  padding: 16px 20px;
  border: 1px solid #ecd6c5;
  border-radius: 8px;
  background: #fff8ed;
  color: #6a4934;
  font-size: 14px;
  line-height: 1.6;
}
.competition-test__message {
  min-height: 24px;
  color: #606060;
  font-size: 14px;
  line-height: 1.6;
}
.competition-test__dialog {
  width: min(560px, 100vw - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: clamp(24px, 4vw, 40px);
  overflow-y: auto;
  border: 1px solid var(--test-border);
  border-radius: 14px;
  background: var(--test-paper);
  color: #101010;
}
.competition-test__dialog::backdrop {
  background: rgba(29, 30, 37, 0.45);
}
.competition-test__dialog h2 {
  margin: 0 24px 16px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 3vw, 32px);
  font-weight: 400;
}
.competition-test__dialog p {
  font-size: 15px;
  line-height: 1.6;
}
.competition-test__dialog--close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  font-size: 28px;
  color: #606060;
}
.competition-test__dialog--summary {
  margin: 12px 0 24px;
  color: #606060;
}
.competition-test__live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 768px) {
  .competition-test__actions--right {
    flex: 1 1 auto;
    justify-content: flex-end;
  }
  .competition-test__card--result .competition-test__actions {
    justify-content: center;
  }
}
@media (max-width: 576px) {
  .competition-test__heading {
    margin-bottom: 18px;
  }
  .competition-test__card {
    padding: 22px 18px;
    border-radius: 12px;
  }
  .competition-test__rules {
    gap: 20px;
  }
  .competition-test__rule {
    gap: 12px;
  }
  .competition-test__rule--icon {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
    font-size: 22px;
  }
  .competition-test__rule p {
    font-size: 14px;
  }
  .competition-test__toolbar {
    align-items: flex-start;
    gap: 12px;
  }
  .competition-test__timer {
    padding: 8px 10px;
    font-size: 16px;
  }
  .competition-test__counter {
    font-size: 13px;
  }
  .competition-test__answer {
    gap: 12px;
    padding: 12px;
    font-size: 15px;
  }
  .competition-test__actions {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .competition-test__actions--right {
    display: contents;
  }
  .competition-test__button {
    width: 100%;
    padding: 12px 16px;
  }
  .competition-test__attempts {
    text-align: center;
  }
  .competition-test__notice {
    padding: 14px;
  }
  .competition-test__dialog .competition-test__actions {
    flex-direction: column;
  }
}
@media (prefers-reduced-motion: reduce) {
  .competition-test__button {
    transition: none;
  }
}
