:root {
  --bg-top: #f7ffef;
  --bg-bottom: #fff1da;
  --panel: rgba(255, 255, 255, 0.78);
  --line: rgba(52, 122, 73, 0.18);
  --text: #1f2f22;
  --muted: #647565;
  --green: #2d8a57;
  --green-dark: #1d5f3a;
  --peach: #ff9f5a;
  --peach-dark: #e87b2b;
  --danger: #ca4a5b;
  --success: #2c9a57;
  --shadow: 0 28px 70px rgba(54, 70, 46, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 15%, rgba(255, 255, 255, 0.72), transparent 20%),
    radial-gradient(circle at 85% 75%, rgba(255, 159, 90, 0.12), transparent 20%),
    linear-gradient(140deg, var(--bg-top), var(--bg-bottom));
  overflow-x: hidden;
}

a {
  text-decoration: none;
}

.page-shell {
  width: min(96%, 1480px);
  margin: 18px auto;
  position: relative;
}

.page-header {
  margin-bottom: 12px;
  padding: 18px 24px;
  text-align: center;
  border-radius: 24px;
  background: linear-gradient(135deg, #1f7a3f, #2d8a57);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 18px 36px rgba(29, 95, 58, 0.16);
}

.page-header-title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.main-card {
  border-radius: 32px;
  padding: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.home-title {
  margin: 0 0 20px;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-align: center;
}

.home-text {
  margin: 14px 0 0;
  max-width: 62ch;
  font-size: 1.2rem;
  line-height: 1.85;
  color: var(--muted);
  text-align: justify;
}

.home-stage {
  align-items: stretch;
}

.home-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.quiz-stage {
  display: grid;
  grid-template-columns: minmax(400px, 600px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.media-panel,
.content-panel,
.final-screen {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}

.media-panel {
  padding: 12px;
}

.media-frame {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(33, 49, 38, 0.12));
  pointer-events: none;
}

.quiz-image {
  display: block;
  width: 100%;
  height: 460px;
  object-fit: cover;
  border-radius: 22px;
  transition: transform 0.5s ease;
}

.media-panel:hover .quiz-image {
  transform: scale(1.03);
}

.media-caption {
  margin: 14px 6px 4px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
}

.content-panel {
  padding: 16px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.progress-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(45, 138, 87, 0.1);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), #6fd58d);
  transition: width 0.35s ease;
}

.timer-badge {
  min-width: 124px;
  padding: 12px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 245, 235, 0.96), rgba(255, 233, 210, 0.92));
  border: 1px solid rgba(255, 159, 90, 0.24);
  box-shadow: 0 10px 28px rgba(232, 123, 43, 0.08);
  text-align: center;
}

.timer-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--muted);
}

.timer-value {
  display: block;
  margin-top: 4px;
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--peach-dark);
}

.question-title {
  margin: 0 0 18px;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.35;
  text-align: justify;
}

.options-heading {
  margin: 0 0 12px;
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.option-btn {
  position: relative;
  min-height: 88px;
  width: 100%;
  padding: 18px 18px 18px 68px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(252, 255, 250, 0.78));
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
  box-shadow: 0 12px 24px rgba(39, 72, 47, 0.06);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.option-btn::before {
  content: attr(data-letter);
  position: absolute;
  top: 16px;
  left: 16px;
  width: 36px;
  height: 36px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(45, 138, 87, 0.12), rgba(111, 213, 141, 0.2));
  color: var(--green-dark);
  font-size: 0.92rem;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.option-btn:hover {
  transform: translateY(-3px);
  border-color: rgba(45, 138, 87, 0.34);
  box-shadow: 0 18px 34px rgba(39, 72, 47, 0.12);
}

.option-btn:focus-visible,
.action-btn:focus-visible {
  outline: 3px solid rgba(255, 159, 90, 0.45);
  outline-offset: 3px;
}

.option-btn:disabled {
  cursor: default;
}

.option-btn.correct {
  border-color: rgba(44, 154, 87, 0.4);
  background: linear-gradient(180deg, rgba(222, 255, 231, 0.98), rgba(234, 255, 240, 0.88));
  color: var(--success);
  box-shadow: 0 18px 34px rgba(44, 154, 87, 0.12);
}

.option-btn.correct::before {
  background: linear-gradient(135deg, rgba(44, 154, 87, 0.18), rgba(111, 213, 141, 0.24));
  color: var(--success);
}

.option-btn.wrong {
  border-color: rgba(202, 74, 91, 0.28);
  background: linear-gradient(180deg, rgba(255, 243, 244, 0.98), rgba(255, 248, 249, 0.9));
  color: var(--danger);
  box-shadow: 0 18px 34px rgba(202, 74, 91, 0.08);
}

.option-btn.wrong::before {
  background: linear-gradient(135deg, rgba(202, 74, 91, 0.12), rgba(248, 223, 226, 0.8));
  color: var(--danger);
}

.actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.actions-center {
  justify-content: center;
}

.action-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 18px;
  padding: 17px 30px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--peach), var(--peach-dark));
  box-shadow: 0 18px 34px rgba(232, 123, 43, 0.24);
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.action-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.3) 50%, transparent 80%);
  transform: translateX(-130%);
  transition: transform 0.55s ease;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 38px rgba(232, 123, 43, 0.28);
  filter: saturate(1.05);
}

.action-btn:hover::after {
  transform: translateX(130%);
}

.action-btn[hidden] {
  display: none;
}

.home-content .actions {
  margin-top: 30px;
}

.final-screen {
  display: none;
  text-align: center;
  padding: 28px 22px 22px;
  margin-top: 8px;
}

.final-screen.is-visible {
  display: block;
}

.final-score-card {
  width: min(100%, 760px);
  height: 420px;
  margin: 8px auto 0;
  display: none;
  flex-direction: column;
  justify-content: center;
}

.final-score-card.is-visible {
  display: flex;
}

.final-badge {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 159, 90, 0.16);
  color: var(--peach-dark);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.final-title {
  margin: 16px 0 8px;
  font-size: clamp(2.1rem, 4vw, 3rem);
  line-height: 1.05;
  color: var(--green-dark);
}

.final-text {
  margin: 0 auto;
  max-width: 34ch;
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--muted);
}

.score-number {
  color: var(--green);
  font-weight: 900;
}

.footer-note {
  margin: 20px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 920px) {
  .quiz-stage {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 20px, 1280px);
    margin: 8px auto;
  }

  .main-card {
    padding: 18px;
    border-radius: 24px;
  }


  .meta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .options-grid {
    grid-template-columns: 1fr;
  }

  .quiz-image {
    height: 320px;
  }

  .actions {
    justify-content: stretch;
  }

  .actions-center {
    justify-content: stretch;
  }

  .action-btn {
    width: 100%;
  }
}
