/* One shared stylesheet for index.html and every lesson. */
:root {
  color-scheme: dark;
  --bg: #071426;
  --panel: #102747;
  --card: #193b67;
  --text: #f5f9ff;
  --muted: #c3d5ef;
  --accent: #93c5fd;
  --button: #2563eb;
  --line: #41658d;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e8f1ff;
  --panel: #fff;
  --card: #f0f6ff;
  --text: #142a4a;
  --muted: #486481;
  --accent: #174da8;
  --button: #1757c8;
  --line: #c6d9f2;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 10% 0%, var(--card), transparent 55%), var(--bg);
  color: var(--text);
  font:
    16px/1.65 system-ui,
    Segoe UI,
    sans-serif;
  min-height: 100vh;
}
.container {
  max-width: 1100px;
  margin: auto;
  padding: 24px;
}
nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
nav button {
  margin-left: auto;
}
a {
  color: var(--accent);
}
header {
  background: linear-gradient(130deg, var(--panel), var(--card));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 24px;
}
header p:first-child {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 700;
}
h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.2;
  margin: 0.25em 0;
}
h2 {
  font-size: 1.45rem;
  margin-top: 0;
}
h3 {
  margin: 0.3em 0;
}
p {
  margin: 0 0 1em;
}
header p:last-child {
  color: var(--muted);
  margin: 0;
}
section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
  margin-bottom: 24px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 275px), 1fr));
  gap: 18px;
}
.grid article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}
.grid article p {
  color: var(--muted);
}
small {
  color: var(--accent);
  font-weight: 700;
}
.details {
  grid-template-columns: 1fr 1.6fr;
}
.details section {
  margin: 0;
}
button,
.button {
  display: inline-block;
  background: var(--button);
  color: #fff;
  border: 0;
  border-radius: 9px;
  padding: 11px 16px;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button:hover,
.button:hover {
  filter: brightness(1.15);
}
nav button {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
}
.muted {
  color: var(--muted);
}
ul {
  padding-left: 20px;
}
li {
  margin-bottom: 10px;
}
fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  padding: 16px 0;
  margin: 0;
}
legend {
  font-weight: 700;
  padding-top: 12px;
}
label {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  margin: 8px 0;
  cursor: pointer;
}
label:has(input:checked) {
  background: var(--card);
}
label.correct {
  border-color: #36c98d;
  background: #0d684855;
}
label.incorrect {
  border-color: #ff8585;
  background: #a7252555;
}
input {
  accent-color: var(--button);
}
.result {
  font-weight: 700;
  margin-top: 16px;
}
footer {
  text-align: center;
  color: var(--muted);
  padding: 26px 0;
}
/* Navigation between lessons */
.lesson-navigation {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.lesson-navigation a {
  display: inline-block;
  padding: 12px 24px;
  background: var(--button);
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
}

.lesson-navigation a:hover {
  filter: brightness(1.15);
}

.back-home {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.back-home:hover {
  background: var(--card);
}
@media (max-width: 720px) {
  .container {
    padding: 12px;
  }
  header,
  section {
    padding: 20px;
  }
  .details {
    grid-template-columns: 1fr;
  }
  nav {
    gap: 12px;
  }
}

/* Keep vocabulary card at its natural height. */
.details {
  align-items: start;
}

/* Shared vocabulary pronunciation and lesson navigation */
.pronunciation {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.5;
  margin-top: 3px;
}
.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 12px;
}
.lesson-nav .button:last-child {
  margin-left: auto;
}
