body {
  margin: 0 auto;
  max-width: 760px;
  padding: 16px;
  font-family: ui-rounded, "Nunito", system-ui, sans-serif;
  color: #2b2340;
  background: #f2fbff;
}

.tagasi {
  font-weight: 800;
  color: inherit;
}

h1 {
  margin: 0 0 8px;
  font-size: 2.4rem;
  color: #8c6cf2;
}

h2 {
  font-size: 1.2rem;
}

/* Header: Ralf and his speech bubble */
.pea {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.ralf {
  width: 110px;
  flex: none;
}

.ralf .tuli {
  animation: vilgu 1.6s infinite;
}

.ralf.raagib .suu {
  animation: raagi 0.25s infinite alternate;
  transform-origin: 60px 76px;
}

@keyframes vilgu {
  50% { fill: #ffc933; }
}

@keyframes raagi {
  to { transform: scaleY(2.2); }
}

.mull {
  margin: 0;
  padding: 10px 14px;
  background: #fff;
  border: 3px solid #2b2340;
  border-radius: 18px;
}

section {
  margin-top: 18px;
}

.nupud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

button,
input {
  font: inherit;
  padding: 0.5rem 1rem;
  border: 3px solid #2b2340;
  border-radius: 999px;
}

button {
  font-weight: 800;
  background: #8c6cf2;
  color: #fff;
  cursor: pointer;
}

button.valitud {
  background: #ffc933;
  color: #2b2340;
}

.kusi {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.kusi input {
  flex: 1 1 200px;
  min-width: 0;
}

/* Video: a small screen with scenes */
.ekraan {
  position: relative;
  min-height: 260px;
  padding: 20px 16px 30px;
  text-align: center;
  background: linear-gradient(#fff6c9, #ffd6e6);
  border: 4px solid #2b2340;
  border-radius: 22px;
  overflow: hidden;
}

.stseen-emoji {
  font-size: 5rem;
  line-height: 1.2;
}

.stseen-emoji.uus {
  animation: hupe 0.6s ease-out;
}

@keyframes hupe {
  from { transform: scale(0.3) rotate(-15deg); opacity: 0; }
  70% { transform: scale(1.15); }
}

.stseen-tekst {
  font-size: 1.25rem;
  font-weight: 700;
}

.riba {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  height: 8px;
  background: #fff;
  border-radius: 4px;
}

#riba-sees {
  width: 0;
  height: 100%;
  background: #8c6cf2;
  border-radius: 4px;
}

/* Flashcards */
.kaart {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 200px;
  padding: 20px;
  font-size: 1.4rem;
  color: #2b2340;
  background: #fff;
  border-radius: 22px;
  transition: transform 0.3s;
}

.kaart.vastus {
  background: #b8f0c8;
  transform: rotateY(360deg);
}

.kaart-silt {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: #8c6cf2;
}

.vihje {
  text-align: center;
  opacity: 0.7;
}

.osa .nupud {
  justify-content: center;
}

/* Easy-to-read text */
.leht {
  padding: 6px 20px;
  font-size: 1.2rem;
  line-height: 1.6;
  background: #fff;
  border: 3px solid #2b2340;
  border-radius: 18px;
}

@media (max-width: 480px) {
  .pea { flex-direction: column; text-align: center; }
  .ralf { width: 90px; }
}

/* Steps: subject, grade, topic */
[hidden] {
  display: none !important;
}

#ained button,
#teemad button,
#leiud button {
  border-radius: 16px;
}

#klassid button {
  background: #5ec8f2;
  color: #2b2340;
}

#klassid button.valitud {
  background: #ffc933;
}

#kaart-nr {
  font-weight: 800;
}

/* Links to outside study sites */
.edasi p {
  margin: 12px 0 6px;
  font-weight: 700;
}

.edasi a {
  padding: 0.5rem 1rem;
  font-weight: 800;
  color: #2b2340;
  text-decoration: none;
  background: #b8f0c8;
  border: 3px solid #2b2340;
  border-radius: 16px;
}

button:disabled {
  cursor: default;
}

/* My progress */
.minu {
  padding: 4px 16px 12px;
  background: #fff6c9;
  border: 3px solid #2b2340;
  border-radius: 18px;
}

.minu .vihje {
  margin: 8px 0;
  text-align: left;
  font-size: 0.9rem;
}

.minu-rida {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
  margin-bottom: 10px;
  font-weight: 700;
}

.minu-riba {
  flex: 1 1 100%;
  height: 10px;
  background: #fff;
  border: 2px solid #2b2340;
  border-radius: 6px;
}

.minu-riba div {
  height: 100%;
  background: #5ec8f2;
  border-radius: 4px;
}

button.jatka {
  margin-top: 4px;
  border-radius: 16px;
  background: #ff5d8f;
}

button.kustuta {
  font-size: 0.9rem;
  background: #fff;
  color: #2b2340;
}

/* Textbook */
.sisukord {
  margin-bottom: 12px;
  padding: 8px 14px;
  background: #fff;
  border: 3px solid #2b2340;
  border-radius: 18px;
}

.sisukord summary {
  font-weight: 800;
  cursor: pointer;
}

.sisukord ol {
  padding-left: 1.6rem;
}

.sisukord li {
  margin: 6px 0;
}

.sisukord button {
  padding: 0.3rem 0.8rem;
  border-radius: 12px;
  text-align: left;
  background: #f2fbff;
  color: #2b2340;
}

.sisukord button.valitud {
  background: #ffc933;
}

#opik-leht {
  min-height: 220px;
}

.opik-aine {
  margin-top: -8px;
  font-size: 1rem;
  font-weight: 700;
  color: #8c6cf2;
}

.opik-pilt {
  margin-top: 10px;
  font-size: 3.5rem;
  text-align: center;
}

.lk-nupud button:disabled {
  opacity: 0.4;
}

#lk-nr {
  font-weight: 800;
}

/* Exercises */
.harj {
  padding: 6px 18px 12px;
  background: #fff;
  border: 3px solid #2b2340;
  border-radius: 18px;
}

.harj-nr {
  font-weight: 800;
  color: #8c6cf2;
}

.harj-kysimus {
  font-size: 1.2rem;
  font-weight: 700;
}

.harj-valikud {
  display: grid;
  gap: 8px;
}

.harj button {
  border-radius: 16px;
}

.harj-valikud button,
.paarid button {
  text-align: left;
  background: #f2fbff;
  color: #2b2340;
}

.harj button.valitud {
  background: #ffc933;
}

.harj button.oige,
.lunk.oige {
  background: #b8f0c8;
  color: #2b2340;
}

.harj button.vale,
.lunk.vale {
  background: #ffc2d4;
  color: #2b2340;
}

.paarid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.paarid-veerg {
  display: grid;
  align-content: start;
  gap: 8px;
}

.paarid button {
  padding: 0.4rem 0.6rem;
  font-size: 0.95rem;
}

.harj-lause {
  font-size: 1.2rem;
  line-height: 2;
}

.lunk {
  max-width: 100%;
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  font-weight: 700;
}

.tagasiside.hea {
  font-weight: 800;
  color: #1e7a3c;
}

.tagasiside.halb {
  font-weight: 800;
  color: #c0265a;
}

.harj-tahed {
  margin-bottom: 0;
  font-size: 3rem;
  text-align: center;
}

.harj-tulemus {
  font-size: 1.3rem;
  font-weight: 800;
  text-align: center;
}
