:root {
  --main: #ffde03;
  --text: #262626;
  --muted: #a6a6a6;
  --line: #e5e5e5;
  --shadow: #cfcfcf;
  --correct: #20d86d;
  --wrong: #fd403e;
  --surface: #ffffff;
  --soft: #f7f7f7;
  --teal: #2fb7a1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: #f3f3ef;
  font-family: "Open Sans", Arial, sans-serif;
}

button {
  font: inherit;
}

.site-header {
  display: flex;
  justify-content: center;
  min-height: 58px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 130px;
  min-height: 34px;
  padding: 0 18px;
  border: 2px solid var(--text);
  background: var(--main);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.22);
  font-family: "Montserrat", Arial, sans-serif;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-logo {
  display: block;
  max-width: 138px;
  max-height: 34px;
  object-fit: contain;
}

.page-shell {
  display: flex;
  justify-content: center;
  padding: 20px 12px 40px;
}

.quiz-shell {
  width: min(100%, 1080px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
}

.quiz-card,
.stats-section {
  background: var(--surface);
  border: 1px solid var(--line);
}

.quiz-card {
  width: 100%;
  padding: 24px;
}

.article-title {
  margin: 4px 8px 28px;
  text-align: center;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 34px;
  line-height: 1.18;
}

.question-page {
  display: grid;
  grid-template-columns: minmax(320px, 46%) minmax(360px, 1fr);
  grid-template-areas:
    "media answers"
    "copy answers"
    "scroll actions"
    "count count";
  gap: 18px 28px;
  align-items: start;
}

.question-media {
  grid-area: media;
  position: relative;
  width: 100%;
  height: clamp(260px, 31vw, 350px);
  perspective: 1000px;
}

.card-layer,
.top-card {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) rotateX(5deg);
  border: 2px solid #fcfcfc;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.layer-c {
  width: 80%;
  top: 26px;
  bottom: 0;
  border-radius: 22px;
  background: #e5e5e5;
}

.layer-b {
  width: 88%;
  top: 18px;
  bottom: 8px;
  border-radius: 20px;
  background: #cfcfcf;
}

.layer-a {
  width: 96%;
  top: 9px;
  bottom: 16px;
  border-radius: 18px;
  background: #a6a6a6;
}

.top-card {
  width: 100%;
  top: 0;
  bottom: 25px;
  border-radius: 14px;
  outline: 1px solid var(--shadow);
  outline-offset: -3px;
  box-shadow: 0 9px 18px rgba(0, 0, 0, 0.14);
}

.question-copy {
  grid-area: copy;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  text-align: center;
}

.desktop-question-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.question-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 15px;
  letter-spacing: 0;
}

.question-copy h2 {
  margin: 0;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 24px;
  line-height: 1.3;
}

.trivia-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 48px;
  width: 100%;
  padding: 12px 18px;
  border: 1px solid var(--text);
  border-radius: 30px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.25);
  cursor: pointer;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.trivia-button:active:not(:disabled) {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.trivia-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.primary-button {
  background: var(--main);
}

.scroll-button {
  grid-area: scroll;
  display: none;
  margin-top: -2px;
  background: var(--main);
  animation: scrollPulse 1.8s ease-in-out infinite;
}

.arrow-down {
  width: 8px;
  height: 13px;
  flex: 0 0 auto;
  animation: arrowBounce 1s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%,
  100% {
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.25);
    transform: translateY(0);
  }

  50% {
    box-shadow: 2px 5px 0 rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
  }
}

@keyframes arrowBounce {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(4px);
  }
}

.answers-panel {
  grid-area: answers;
  scroll-margin-top: 76px;
}

.answers-wrapper {
  display: grid;
  gap: 14px;
  min-height: 360px;
}

.answer-option {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  width: 100%;
  padding: 10px 16px;
  border: 2px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  box-shadow: 2px 3px 0 var(--shadow);
  cursor: pointer;
  text-align: left;
}

.answer-option:not(.is-disabled):hover {
  background: #f1f1f1;
}

.answer-option.is-disabled {
  background: #f8f8f8;
  cursor: default;
}

.answer-option:disabled {
  color: var(--text);
}

.answer-option.is-correct {
  border-color: var(--correct);
}

.answer-option.is-wrong {
  border-color: var(--wrong);
}

.answer-index {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--muted);
  font-size: 25px;
  font-weight: 800;
}

.answer-option.is-correct .answer-index,
.answer-option.is-wrong .answer-index {
  color: transparent;
  position: relative;
}

.answer-option.is-correct .answer-index::after,
.answer-option.is-wrong .answer-index::after {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--correct);
  font-size: 25px;
  line-height: 1;
}

.answer-option.is-correct .answer-index::after {
  content: "✓";
}

.answer-option.is-wrong .answer-index::after {
  content: "×";
  color: var(--wrong);
}

.answer-text {
  overflow-wrap: anywhere;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.answer-info {
  padding: 18px 18px 0;
  text-align: center;
}

.answer-info h3 {
  margin: 0 0 7px;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 25px;
  line-height: 1.15;
}

.answer-info h3.correct {
  color: var(--correct);
}

.answer-info h3.incorrect {
  color: var(--wrong);
}

.answer-info p {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.action-row {
  grid-area: actions;
  display: flex;
  gap: 12px;
}

.mobile-question-count {
  grid-area: count;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.2em;
}

.stats-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  overflow: hidden;
}

.stats-section.has-results {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-item {
  min-height: 118px;
  padding: 18px 16px;
  background: #fbfbfb;
  text-align: center;
}

.stats-subtext {
  color: #777;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.stats-value {
  margin-top: 10px;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.stats-value-pending {
  min-height: 0;
  color: var(--text);
  font-size: 30px;
}

.stats-value-pending::after {
  content: "";
  display: none;
}

.stats-item-players.is-active .stats-value-pending {
  color: var(--text);
  font-size: 30px;
}

.stats-item-players.is-active .stats-value-pending::after {
  content: "";
  display: none;
}

.stats-percentage {
  display: none;
  margin-top: 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.stats-item.is-active .stats-percentage {
  display: block;
}

.result-page {
  padding: 6px 8px 0;
}

.result-hero {
  display: flex;
  min-height: 255px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

.result-hero::before {
  content: "";
  position: absolute;
  inset: 8px 0;
  z-index: 0;
  opacity: 0.55;
  background:
    radial-gradient(circle at 18% 28%, #9cffb0 0 4px, transparent 5px),
    radial-gradient(circle at 82% 38%, #b8caff 0 5px, transparent 6px),
    radial-gradient(circle at 34% 74%, #fff781 0 5px, transparent 6px),
    radial-gradient(circle at 65% 70%, #ff8bdc 0 4px, transparent 5px);
}

.result-hero h2,
.result-hero p,
.result-badge {
  position: relative;
  z-index: 1;
}

.result-hero h2 {
  margin: 0;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 31px;
}

.result-hero p {
  margin: 7px 0 0;
  font-size: 18px;
  font-weight: 800;
}

.result-badge {
  margin-top: 18px;
  color: var(--main);
  -webkit-text-stroke: 1px var(--text);
  font-size: 42px;
}

.score-panel {
  padding: 22px 16px;
  border: 2px solid var(--line);
  background: var(--soft);
  text-align: center;
}

.score-panel h3 {
  margin: 0 0 8px;
  color: var(--correct);
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 30px;
  line-height: 1.15;
}

.score-panel p {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
}

.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.quiz-about {
  grid-column: 1 / -1;
  padding: 26px 24px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.quiz-about p {
  max-width: 760px;
  margin: 0 auto;
  color: #4b4b4b;
  font-size: 17px;
  line-height: 1.65;
  text-align: center;
}

.quiz-about h2 {
  margin: 28px 0 12px;
  color: var(--muted);
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 26px;
  line-height: 1.2;
  text-align: center;
}

.site-footer {
  padding: 34px 18px 28px;
  background: #20261f;
  color: #f7f5ea;
  text-align: left;
}

.footer-directory {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.5fr);
  gap: 28px;
  width: min(100%, 1080px);
  margin: 0 auto;
}

.footer-intro strong {
  display: block;
  color: var(--main);
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.footer-intro p {
  max-width: 330px;
  margin: 10px 0 0;
  color: #d9d8c9;
  font-size: 14px;
  line-height: 1.6;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
}

.footer-links a {
  min-height: 38px;
  padding: 9px 12px 8px;
  border-left: 3px solid var(--main);
  color: #f7f5ea;
  background: rgba(255, 255, 255, 0.07);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  background: rgba(255, 222, 3, 0.16);
}

.footer-note {
  width: min(100%, 1080px);
  margin: 22px auto 0;
  color: #b9b8aa;
  font-size: 12px;
  line-height: 1.5;
}

.content-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 26px;
  width: min(100% - 32px, 1080px);
  margin: 0 auto;
  padding: 34px 0 58px;
}

.content-aside {
  position: sticky;
  top: 18px;
  align-self: start;
  padding: 20px;
  background: #20261f;
  color: #f7f5ea;
}

.back-link {
  display: inline-flex;
  color: var(--main);
  font-weight: 800;
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.content-nav {
  display: grid;
  gap: 2px;
  margin-top: 22px;
}

.content-nav a {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  color: #f7f5ea;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
}

.content-nav a:hover,
.content-nav a:focus-visible,
.content-nav a.is-current {
  color: var(--main);
}

.content-panel {
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid var(--line);
  background: var(--surface);
}

.content-kicker {
  margin: 0 0 8px;
  color: #6b6b61;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.content-panel h1 {
  margin: 0;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
}

.content-summary {
  max-width: 720px;
  margin: 14px 0 30px;
  color: #4f514d;
  font-size: 18px;
  line-height: 1.65;
}

.content-section {
  display: grid;
  grid-template-columns: minmax(160px, 0.35fr) minmax(0, 1fr);
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.content-section h2 {
  margin: 0;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.25;
}

.content-section p {
  margin: 0;
  color: #3f3f3f;
  font-size: 16px;
  line-height: 1.7;
}

.content-section p + p {
  margin-top: 12px;
  grid-column: 2;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .site-header {
    min-height: 52px;
    padding: 10px 12px;
  }

  .page-shell {
    padding: 12px 8px 32px;
  }

  .quiz-shell {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .quiz-card {
    order: 1;
    padding: 16px 8px 22px;
    overflow: hidden;
  }

  .article-title {
    margin: 2px 8px 18px;
    font-size: 24px;
  }

  .question-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .question-media {
    height: clamp(185px, 56vw, 240px);
    margin-inline: auto;
    max-width: 100%;
  }

  .desktop-question-label {
    display: none;
  }

  .question-copy h2 {
    font-size: 22px;
  }

  .scroll-button {
    display: inline-flex;
    padding-inline: 12px;
    gap: 5px;
  }

  .action-row {
    width: 100%;
    display: block;
  }

  .action-row .trivia-button {
    width: 100%;
  }

  .answers-wrapper {
    width: 100%;
    min-height: 0;
    gap: 12px;
  }

  .answers-panel {
    width: 100%;
    min-width: 0;
  }

  .answer-option {
    width: 100%;
    min-width: 0;
    justify-self: stretch;
    appearance: none;
    min-height: 70px;
    padding: 10px 13px;
  }

  .answer-text {
    font-size: 17px;
  }

  .stats-section {
    position: static;
    grid-template-columns: 1fr;
    order: 2;
    width: 100%;
  }

  .stats-section.has-results {
    grid-template-columns: 1fr;
  }

  .stats-item {
    min-height: auto;
    padding: 16px 14px;
  }

  .stats-value,
  .stats-item-players.is-active .stats-value-pending {
    font-size: 27px;
  }

  .quiz-about {
    order: 3;
    padding: 22px 16px;
  }

  .quiz-about p {
    font-size: 15px;
    line-height: 1.6;
    text-align: left;
  }

  .quiz-about h2 {
    margin-top: 24px;
    font-size: 23px;
    text-align: left;
  }

  .site-footer {
    padding: 28px 14px 26px;
  }

  .footer-directory {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .footer-links {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .content-shell {
    grid-template-columns: 1fr;
    width: min(100% - 24px, 1080px);
    padding: 24px 0 42px;
  }

  .content-aside {
    position: static;
  }

  .content-panel {
    padding: 26px 20px;
  }

  .content-section {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 22px 0;
  }

  .content-section p + p {
    grid-column: auto;
  }

}

@media (max-width: 380px) {
  .article-title {
    font-size: 21px;
  }

  .trivia-button {
    min-height: 46px;
    padding-inline: 10px;
    font-size: 12px;
  }

  .question-media {
    height: clamp(170px, 54vw, 210px);
  }

  .answer-option {
    grid-template-columns: 28px 1fr;
    gap: 10px;
    min-height: 66px;
    padding-inline: 10px;
  }

  .answer-text {
    font-size: 15px;
  }

  .answer-info {
    padding-inline: 8px;
  }

  .answer-info p {
    font-size: 15px;
  }
}
