:root {
  --red: #ff0738;
  --red-dark: #d9002d;
  --yellow-soft: #fffed8;
  --black: #171717;
  --white: #fff;
  --gray: #666;
  --max: 1180px;
  --side: 160px;
  --gap: 12px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--yellow-soft);
  color: var(--black);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

.site {
  width: min(100%, var(--max));
  margin: 0 auto;
}

.site-header {
  margin-top: 6px;
  min-height: 122px;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #fff;
  padding: 12px;
}

.brand-title {
  font-size: clamp(2.4rem, 6vw, 3.3rem);
  line-height: 1;
  font-weight: 800;
}

.brand-site {
  margin-top: 7px;
  padding: 0 5px;
  background: #fcfbb3;
  color: var(--red);
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  line-height: 1.15;
  font-weight: 700;
}

.brand-site span {
  color: #05c;
}

.main-nav {
  margin-top: 4px;
  border: 3px solid var(--red);
  background: #f9fc95;
}

.nav-fallback {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
}

.nav-fallback a {
  min-height: 34px;
  padding: 3px 5px;
  border-right: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  text-decoration: none;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
}

.nav-fallback a:last-child {
  border-right: 0;
}

.nav-fallback a:hover,
.nav-fallback a:focus-visible {
  background: var(--red);
  color: #fcfbb3;
}

.ad-slot {
  display: flex;
  justify-content: center;
  align-items: center;
}

.top-ad,
.bottom-ad {
  min-height: 300px;
  padding: 10px 0;
}

.ad-placeholder {
  width: 336px;
  height: 280px;
  border: 0px solid var(--black);
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 15px;
}

.ad-placeholder strong {
  font-size: 1.4rem;
}

.ad-placeholder span {
  font-size: 1.1rem;
  font-weight: 700;
}

.ad-placeholder small {
  margin-top: 6px;
  color: var(--gray);
}

.page-layout {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr) var(--side);
  gap: var(--gap);
  align-items: start;
  padding: 0 var(--gap);
}

.side-ad {
  width: var(--side);
}

.side-ad .ad-placeholder {
  width: var(--side);
  height: 600px;
  border-width: 0px;
  padding: 10px 6px;
}

.side-ad .ad-placeholder strong {
  font-size: 1.05rem;
}

.side-ad .ad-placeholder span {
  font-size: 0.95rem;
}

.side-ad .ad-placeholder small {
  font-size: 0.72rem;
}

.content-column {
  min-width: 0;
}

.sharing-bar {
  min-height: 44px;
  margin-bottom: 7px;
  border: 0px solid var(--black);
  background: #ffd24a;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
}

.content-card {
  min-height: 430px;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid var(--black);
  background: #fff;
}

.content-heading {
  max-width: 760px;
  margin: 0 auto 24px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--red-dark);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.content-heading h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
}

.content-heading p:last-child {
  margin-bottom: 0;
  color: #444;
}

.exercise {
  max-width: 680px;
  margin: 0 auto;
  border: 2px solid #222;
  background: #fff;
}

.exercise-top {
  padding: 15px 18px;
  border-bottom: 2px solid #222;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
}

.level {
  display: inline-block;
  padding: 3px 7px;
  background: var(--red);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}

.exercise-top h2 {
  margin: 5px 0 0;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
}

.question-counter {
  white-space: nowrap;
  color: #555;
  font-size: 0.85rem;
}

.question-box {
  padding: 22px;
}

.question-text {
  margin: 0 0 18px;
  text-align: center;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  font-weight: 700;
}

.answers {
  display: grid;
  gap: 9px;
}

.answer {
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid #bbb;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.answer:hover {
  border-color: var(--red);
}

.answer input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.check-button,
.reset-button {
  min-height: 46px;
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.check-button {
  width: 100%;
  margin-top: 18px;
  background: var(--red);
  color: #fff;
}

.check-button:hover,
.check-button:focus-visible {
  background: var(--red-dark);
}

.feedback {
  min-height: 28px;
  margin-top: 12px;
  text-align: center;
  font-weight: 700;
}

.feedback.correct {
  color: #08752c;
}

.feedback.incorrect {
  color: #b00020;
}

.exercise-footer {
  padding: 11px 15px;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #666;
  font-size: 0.78rem;
}

.reset-button {
  padding: 5px 10px;
  background: #eee;
  color: #222;
}


.exercise-result {
  padding: 35px 20px;
  text-align: center;
}

.exercise-result h2 {
  margin: 12px 0 8px;
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.result-score {
  margin: 12px 0 2px;
  font-size: 2rem;
  font-weight: 800;
}

.exercise-result .check-button {
  max-width: 320px;
}

.site-footer {
  min-height: 60px;
  margin-top: 10px;
  padding: 12px;
  background: var(--red);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.copyright-placeholder {
    padding: 3px 10px;
    background: #feffe8;
    color: #FF0000; /* Strong yellow/gold text */
    font-size: 0.85rem;
    font-weight: 700; /* Bold */
}


@media (max-width: 1050px) {
  .page-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .side-ad {
    display: none;
  }

  .content-column {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .site-header {
    min-height: 105px;
  }

  .nav-fallback {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-fallback a {
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #ddd;
  }

  .nav-fallback a:last-child {
    grid-column: 1 / -1;
  }

  .page-layout {
    padding: 0 5px;
  }

  .content-card {
    border-width: 1px;
    padding: 15px 10px;
  }

  .exercise-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .question-counter {
    white-space: normal;
  }

  .exercise-footer {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .reset-button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  body {
    font-size: 15px;
  }

  .site-header {
    margin-top: 0;
    min-height: 95px;
  }

  .brand {
    padding: 9px;
  }

  .brand-title {
    font-size: 2.35rem;
  }

  .brand-site {
    font-size: 1.05rem;
  }

  .main-nav {
    margin-top: 3px;
    border-width: 2px;
  }

  .nav-fallback a {
    min-height: 40px;
    font-size: 0.88rem;
  }

  .ad-placeholder {
    width: min(336px, calc(100vw - 24px));
    height: 280px;
  }

  .sharing-bar {
    min-height: 42px;
    border-width: 2px;
  }

  .content-card {
    padding: 12px 8px;
  }

  .question-box {
    padding: 15px 10px;
  }

  .answer {
    min-height: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
/* Left-align the introduction and exercise list by default */
.intro-text,
.exercise-list {
  text-align: left;
}

/* Center only the level headings and category labels */
.exercise-list .centered-label {
  text-align: center;
}
.back-to-index {
  display: block;
  margin: 20px auto 0;
  color: var(--red);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.back-to-index:hover,
.back-to-index:focus-visible {
  color: var(--red-dark);
  text-decoration: underline;
}
.legal-links {
  text-align: center;
}

.legal-links a {
  display: inline-block;
  background-color: #ffeb00;
  color: #000;
  font-weight: 700;
  padding: 6px 12px;
  text-decoration: underline;
}

.legal-links a:hover {
  background-color: #ffd600;
}
.audio-player {
  display: inline-block;
  width: min(100%, 320px);
  margin: 8px 0;
  vertical-align: middle;
}

.audio-player audio {
  display: block;
  width: 100%;
  height: 40px;
}
.nav-fallback2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 3px solid var(--red);
  background: #f9fc95;
}

.nav-fallback2 a {
  min-height: 34px;
  padding: 3px 5px;
  border-right: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  text-decoration: none;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
}

.nav-fallback2 a:last-child {
  border-right: 0;
}

.nav-fallback2 a:hover,
.nav-fallback2 a:focus-visible {
  background: var(--red);
  color: #fcfbb3;
}

@media (max-width: 700px) {
  .nav-fallback2 {
    grid-template-columns: 1fr;
  }

  .nav-fallback2 a {
    min-height: 40px;
    border-right: 0;
    border-bottom: 1px solid #ddd;
  }

  .nav-fallback2 a:last-child {
    border-bottom: 0;
  }
  
  
  /* This formatting  below exclusive for lesson page */
}.lesson-intro {
  margin: 28px 0;
  padding: 24px;
  border: 3px solid var(--red);
  border-radius: 18px;
  background: #ffff8a;
  color: #152b73;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
}

.lesson-intro h2 {
  margin: 0 0 10px;
  color: var(--red-dark);
}

.lesson-intro p {
  margin: 0;
}

.lesson-section {
  margin: 32px 0;
}

.lesson-section > h2 {
  margin: 0 0 18px;
  color: #152b73;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.treatment-card {
  margin: 16px 0;
  padding: 18px 20px;
  border-left: 6px solid var(--red);
  background: #fffed8;
}

.treatment-card h3 {
  margin: 0 0 8px;
  color: var(--red-dark);
}

.treatment-card p {
  margin: 0;
}

.treatment-card strong {
  color: var(--red-dark);
}

.vocabulary-table-wrap {
  overflow-x: auto;
  border: 4px solid var(--red);
  background: #fff;
}

.vocabulary-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  color: var(--black);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
}

.vocabulary-table th,
.vocabulary-table td {
  padding: 10px 12px;
  border: 2px solid var(--red);
  text-align: left;
}

.vocabulary-table th {
  background: var(--red);
  color: #fffed8;
  text-align: center;
  font-size: 1.1em;
}

.vocabulary-table tbody tr:nth-child(even) td {
  background: #fff9ed;
}

.vocabulary-table tbody tr:hover td {
  background: #fff3b0;
}

@media (max-width: 500px) {
  .lesson-intro {
    padding: 18px 14px;
    font-size: 1rem;
  }

  .vocabulary-table {
    border-spacing: 2px;
    font-size: 0.95rem;
  }

  .vocabulary-table th,
  .vocabulary-table td {
    padding: 8px;
  }
}