/* ---------- Fonts ---------- */
/* Font files go in assets/fonts/ */

@font-face {
  font-family: 'Klaster Sans';
  src: url('../assets/fonts/KlasterSans-Book.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Klaster Sans';
  src: url('../assets/fonts/KlasterSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Klaster Sans';
  src: url('../assets/fonts/KlasterSans-Heavy.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: 'DigitalStripCyrillic';
  src: url('../assets/fonts/DigitalStripCyrillic_Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  --black: #0b0b0b;
  --white: #ffffff;
  --offwhite: #f5f5f0;
  --yellow: #ffd400;
  --gray: #878787;
  --green: #7dd700;
  --red: #f65036;

  --font-base: 'Klaster Sans', system-ui, sans-serif;
  --font-display: 'DigitalStripCyrillic', 'Comic Sans MS', cursive;

  --gutter: 24px;
  --body-max-width: 908px;
  --btn-max-width: 430px;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--black);
  font-family: var(--font-base);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

p,
h1,
h2,
ul {
  margin: 0;
}

/* ---------- Screens ---------- */

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 var(--gutter) 48px;
}

.screen.is-active {
  display: flex;
}

.screen__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  flex-shrink: 0;
}

.screen__header--logo {
  height: 110px;
  justify-content: flex-end;
  padding-bottom: 20px;
}

.screen__header--progress {
  height: 110px;
  justify-content: flex-end;
  padding: 42px var(--gutter) 32px;
}

.screen__header--result {
  gap: 24px;
  padding: 72px var(--gutter) 24px;
}

.screen__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gutter);
  width: 100%;
  max-width: var(--body-max-width);
  /* grows up to max-height, but never smaller than its content */
  flex: 1 1 auto;
  max-height: 660px;
  min-height: min-content;
  padding: var(--gutter) var(--gutter) 32px;
  background: var(--offwhite);
}

.screen__body--dark {
  gap: 24px;
  max-height: 471px;
  padding-top: 24px;
  background: var(--black);
}

/* Full-width body on narrow screens */
@media (max-width: 407px) {
  .screen {
    padding-inline: 0;
  }
}

.logo {
  display: block;
}

/* ---------- Typography ---------- */

.title {
  width: 100%;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.1;
  text-transform: uppercase;
  color: #000;
}

.title--question {
  font-size: 28px;
}

.title--light {
  text-align: center;
  color: var(--white);
}

.text {
  font-size: 14px;
  line-height: 1.45;
}

.text p + p {
  margin-top: 1.45em;
}

/* ---------- Buttons ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 100%;
  max-width: var(--btn-max-width);
  padding: 18px 32px;
  border: 0;
  border-radius: 0;
  font-family: var(--font-base);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.54px;
  text-align: center;
  cursor: pointer;
}

.btn:disabled,
.btn--disabled {
  cursor: default;
  background: var(--gray);
  color: var(--white);
  cursor: not-allowed;
}

.btn--yellow {
  background: var(--yellow);
  color: var(--black);
}

.btn--yellow:hover {
  background: var(--black);
  color: var(--yellow);
}

.btn--black {
  background: var(--black);
  color: var(--yellow);
}

.btn--black:hover {
  background: var(--yellow);
  color: var(--black);
}

.btn--outline {
  background: var(--black);
  color: var(--white);
  border: 2px solid var(--white);
}

.btn--outline:hover {
  color: var(--yellow);
  border-color: var(--yellow);
}


/* ---------- Start ---------- */

.start__content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1 0 auto;
  width: 100%;
}

.info-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  background: var(--white);
  border: 2px solid var(--black);
  font-size: 14px;
  line-height: 1.4;
}

.info-card__title {
  font-weight: 500;
}

.info-card__text {
  color: var(--gray);
}

/* ---------- Progress ---------- */

.progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 860px;
}

.progress__label {
  height: 20px;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.48px;
  color: var(--yellow);
  text-transform: uppercase;
}

.progress__track {
  height: 6px;
  background: var(--gray);
  border-radius: 3px;
  overflow: hidden;
}

.progress__fill {
  width: 0;
  height: 100%;
  background: var(--yellow);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ---------- Options ---------- */

.options {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: center;
  gap: 12px;
  flex: 0 0 auto;
  width: 100%;
  padding: 0;
  list-style: none;
}

/* Pin the question screen button to the bottom */
.screen--question .btn {
  margin-top: auto;
}

.options__item {
  display: flex;
  flex: 1 0 0;
  min-width: min(312px, 100%);
  max-width: 430px;
}

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: 2px;
  font-family: var(--font-base);
  text-align: left;
  color: var(--black);
  cursor: pointer;
}

.option:disabled {
  cursor: default;
}

/* Hover only before answering and only on mouse devices (it sticks on touch) */
@media (hover: hover) {
  .option:not(:disabled):hover {
    background: var(--yellow);
  }
}

.option:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

/* After answering: correct is green, selected wrong is red */
.option.is-correct {
  background: var(--green);
}

.option.is-wrong {
  background: var(--red);
}

.option__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--black);
  font-weight: 800;
  font-size: 13px;
  color: var(--white);
}

.option__label {
  flex: 1 1 0;
  min-width: 0;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.45;
}

/* ---------- Explanation ---------- */

.explanation {
  width: 100%;
  max-width: 430px;
  padding: 12px;
  background: var(--white);
}

.explanation[hidden] {
  display: none;
}

.explanation__text {
  font-weight: 400;
  font-size: 12px;
  line-height: 1.27;
  color: #484848;
}

/* ---------- Result ---------- */

.score-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border: 3px solid var(--yellow);
  font-weight: 800;
  font-size: 26px;
  color: var(--yellow);
  white-space: nowrap;
}

.result__heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  text-align: center;
}

.result__subtitle {
  font-size: 14px;
  line-height: 1.4;
  color: var(--gray);
}

.result__prize {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1 0 auto;
  width: 100%;
  text-align: center;
}

.prize-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 20px;
  background: var(--yellow);
  color: var(--black);
}

.prize-card__label {
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.72px;
}

.prize-card__name {
  font-weight: 800;
  font-size: 30px;
  text-transform: uppercase;
}

.result__instruction {
  font-size: 14px;
  line-height: 1.45;
  color: var(--white);
}
