:root {
  color-scheme: light;
  font-family: "Comic Sans MS", "Trebuchet MS", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #e9f7ff 0%, #fff7d6 100%);
  color: #1f2937;
}

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
}

.hero {
  text-align: center;
  margin-bottom: 1rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  color: #0f5dc2;
}

.hero p {
  margin: 0.4rem 0 0;
  font-size: 1.15rem;
}

.tab-bar {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin: 1rem 0;
}

.tab-button {
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  background: #bfdbfe;
  color: #1e3a8a;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.tab-button.is-active {
  background: #2563eb;
  color: #ffffff;
}

.lesson-panel[hidden] {
  display: none;
}

.letters-track {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1rem 0.25rem 1.2rem;
  scroll-snap-type: x mandatory;
}

.letters-track::-webkit-scrollbar {
  height: 14px;
}

.letters-track::-webkit-scrollbar-track {
  background: #dbeafe;
  border-radius: 999px;
}

.letters-track::-webkit-scrollbar-thumb {
  background: #3b82f6;
  border-radius: 999px;
}

.letter-card {
  min-width: 140px;
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.09);
  color: #0f172a;
  font-size: clamp(3rem, 7vw, 4.8rem);
  font-weight: 700;
  cursor: pointer;
  scroll-snap-align: center;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.letter-card:hover,
.letter-card:focus-visible {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
  outline: 3px solid #60a5fa;
}

.letter-card.is-speaking {
  background: #dbeafe;
}

.animal-card {
  min-width: 220px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1rem;
  text-align: center;
}

.animal-image {
  width: 78%;
  max-width: 190px;
  border-radius: 14px;
  display: block;
}

.animal-name {
  font-size: clamp(1.3rem, 2.8vw, 1.8rem);
  font-weight: 800;
}

.note {
  text-align: center;
  margin: 0.5rem 0 0;
  font-size: 1rem;
  font-weight: 600;
}

@media (max-width: 768px) {
  .letters-track.is-mobile-single {
    flex-direction: column;
    gap: 0;
    height: 62vh;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0;
    scroll-snap-type: y mandatory;
  }

  .letters-track.is-mobile-single .letter-card {
    width: 100%;
    min-width: 100%;
    min-height: 62vh;
    aspect-ratio: auto;
    border-radius: 0;
    scroll-snap-align: start;
  }

  .letters-track.is-mobile-single .animal-card {
    min-height: 62vh;
  }
}
