body {
  background: #6f2d3e;
}

.posterDownload {
  display: none;
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 10;
  padding: 12px 16px;
  border: 2px solid #8f3d4c;
  border-radius: 12px;
  background: #fff9f2;
  color: #672f3b;
  font: 600 16px/1.3 Arial, sans-serif;
  max-width: calc(100vw - 32px);
}

.smartboard-mode .posterDownload { display: block; }
.posterDownload:hover { background: #f4e5d6; }
.posterDownload:focus-visible { outline: 3px solid #672f3b; outline-offset: 3px; }

.background {
  background:
    linear-gradient(rgba(255, 248, 240, 0.22), rgba(255, 248, 240, 0.22)),
    url("letters-background.png") center / cover fixed no-repeat;
  border-color: rgba(255, 239, 224, 0.9);
  box-shadow: inset 0 0 100px rgba(125, 45, 54, 0.1);
}

.title {
  background: #8f3d4c;
  border-color: #6f2d3e;
  box-shadow: 4px 4px 0 rgba(91, 36, 48, 0.25);
}

.back,
#activityBack {
  border: 2px solid #8f3d4c;
  color: #672f3b;
  background: #fff9f2;
}

.lettersMenu {
  position: relative;
  overflow: hidden;
  background: rgba(255, 250, 243, 0.9);
  border: 2px solid rgba(143, 61, 76, 0.34);
}

.lettersMenu::before {
  content: "Aa";
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: 0;
  color: #8f3d4c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(14rem, 32vw, 34rem);
  font-weight: 800;
  line-height: 1;
  opacity: 0.055;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-8deg);
  white-space: nowrap;
}

.lettersMenu > * {
  position: relative;
  z-index: 1;
}

.learnAlphabetButton,
.activityLink:nth-child(4n + 1) { background: #ef9b86; }
.activityLink:nth-child(4n + 2) { background: #f4c36d; }
.activityLink:nth-child(4n + 3) { background: #d88d9d; }
.activityLink:nth-child(4n) { background: #edb49d; }

.learnAlphabetButton,
.activityLink {
  border-color: #743342;
  box-shadow: 5px 5px 0 rgba(91, 36, 48, 0.25);
}

.learnAlphabetPicture,
.activityPicture {
  border-color: #743342;
  background: rgba(255, 250, 243, 0.83);
  color: #522733;
}

.learnAlphabetPicture,
.activityPicture,
.unitButton {
  font-family: "Comic Sans MS", "Comic Sans", cursive;
}

.levelRow {
  background: rgba(216, 141, 157, 0.78);
  border-color: rgba(116, 51, 66, 0.42);
  box-shadow: 0 7px 22px rgba(91, 36, 48, 0.2);
}

.levelHeading {
  background: linear-gradient(180deg, #a65364, #8f3d4c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 4px 12px rgba(91, 36, 48, 0.24);
}

.unitButton {
  border-color: rgba(143, 61, 76, 0.3);
  background: rgba(255, 249, 242, 0.9);
  color: #672f3b;
}

.levelRow:hover {
  background: rgba(239, 155, 134, 0.88);
  box-shadow: 0 10px 28px rgba(91, 36, 48, 0.24);
}

.levelRow:hover .unitButton {
  border-color: rgba(116, 51, 66, 0.48);
  background: #fffaf3;
}

.levelRow.completed,
.levelRow.completed:hover {
  background: rgba(185, 239, 154, 0.92);
  border-color: rgba(71, 142, 72, 0.68);
}
.lettersPage {
  background: #fbf5ea;
  color: #743342;
}

.lettersPage .stage { padding: 0; }
.lettersPage .background {
  min-height: 100vh;
  padding: clamp(20px, 3vw, 48px);
  gap: clamp(28px, 5vh, 60px);
  border: 0;
  border-radius: 0;
  background: linear-gradient(rgba(255, 248, 240, .22), rgba(255, 248, 240, .22)),
    url("letters-background.png") center / cover fixed no-repeat;
  box-shadow: none;
}
.lettersPage .topbar { gap: 24px; }
.lettersPage .title {
  min-height: 88px;
  border-radius: 16px;
  background: #743342;
  border: 0;
  box-shadow: none;
  font-size: clamp(36px, 4vw, 60px);
}
.lettersPage .back {
  min-height: 64px;
  border-color: #743342;
  border-radius: 12px;
  color: #743342;
  background: rgba(255, 252, 247, .8);
  box-shadow: none;
  font-size: 22px;
}
.lettersPage .lettersMenu {
  padding: 0;
  margin: clamp(12px, 5vh, 64px) auto 40px;
  max-width: 1400px;
  background: none;
  border: 0;
  overflow: visible;
  box-shadow: none;
}
.lettersPage .lettersMenu::before { content: none; }
.lettersPage .mainLettersGrid { gap: clamp(20px, 2.5vw, 40px); }
.lettersPage .mainLettersGrid .activityLink {
  --accent: #d6a08b;
  position: relative;
  overflow: hidden;
  min-height: clamp(300px, 29vw, 440px);
  padding: 48px 22px 36px;
  gap: 20px;
  border: 1px solid #dfc7a4;
  border-radius: 20px;
  background: #fffbf5;
  box-shadow: 0 8px 18px rgba(99, 68, 43, .10);
  color: #743342;
}
.lettersPage .mainLettersGrid .activityLink:nth-child(2) { --accent: #dcc16e; }
.lettersPage .mainLettersGrid .activityLink:nth-child(3) { --accent: #bc8b9e; }
.lettersPage .mainLettersGrid .activityLink::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 26px;
  background: var(--accent);
}
.lettersPage .mainLettersGrid .activityPicture {
  height: clamp(150px, 16vw, 240px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: #743342;
}
.lettersPage .activityPicture svg { width: 80%; height: 100%; max-width: 270px; }
.lettersPage .mainLettersGrid .alphabetMark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(130px, 15vw, 220px);
  line-height: 1;
}
.lettersPage .mainLettersGrid .activityDetail {
  color: #743342;
  font-size: clamp(32px, 3.6vw, 56px);
}
.lettersPage .mainLettersGrid .activityLink:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(99, 68, 43, .16);
}
.lettersPage a:focus-visible { outline: 4px solid #743342; outline-offset: 5px; }
@media (max-width: 780px) {
  .lettersPage .background { padding: 20px 16px; gap: 24px; }
  .lettersPage .topbar { grid-template-columns: auto 1fr; gap: 14px; }
  .lettersPage .title { min-height: 64px; font-size: 32px; }
  .lettersPage .back { min-height: 54px; padding: 12px; font-size: 18px; }
  .lettersPage .lettersMenu { margin: 0 auto 20px; }
  .lettersPage .mainLettersGrid .activityLink {
    min-height: 196px;
    padding: 32px 20px 20px;
    gap: 8px;
    border-radius: 16px;
  }
  .lettersPage .mainLettersGrid .activityLink::before { height: 14px; }
  .lettersPage .mainLettersGrid .activityPicture { height: 110px; }
  .lettersPage .mainLettersGrid .alphabetMark { font-size: 110px; }
  .lettersPage .mainLettersGrid .activityDetail { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .lettersPage .mainLettersGrid .activityLink { transition: none; }
  .lettersPage .mainLettersGrid .activityLink:hover { transform: none; }
}
