:root {
  --bg-start: #fef9f4;
  --bg-end: #fce4ec;
  --coral: #ff6b6b;
  --coral-light: #ff8a8a;
  --purple: #7c5cbf;
  --purple-light: #a78bfa;
  --teal: #2ec4b6;
  --teal-light: #5eead4;
  --amber: #f59e0b;
  --amber-light: #fbbf24;
  --sky: #38bdf8;
  --sky-light: #7dd3fc;
  --rose: #f472b6;
  --rose-light: #f9a8d4;
  --green: #34d399;
  --green-light: #6ee7b7;
  --slate: #475569;
  --slate-light: #94a3b8;
  --white: #ffffff;
}

/* ---------- Base ---------- */
html,
body {
  min-height: 100vh;
  min-height: 100svh;
}

body {
  font-family: "Grandstander", sans-serif;
  background: linear-gradient(160deg, var(--bg-start) 0%, var(--bg-end) 100%);
  color: var(--slate);
  margin: 0;
  padding: 0;
  text-align: center;
  overflow-x: hidden;
}

/* ---------- YouTube overlay ---------- */
#ytplayer {
  width: 0px;
  height: 0px;
  border: none;
}

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(254, 249, 244, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  font-size: 5vw;
  color: var(--purple);
  align-items: center;
  justify-content: center;
  z-index: 10;
  cursor: pointer;
}

#overlay img {
  width: 80px;
  height: 80px;
}

/* ---------- Header ---------- */
header {
  width: 100%;
  background: linear-gradient(135deg, var(--coral-light), var(--purple-light));
  padding: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

.logo {
  width: 100px;
  height: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.08);
}

/* ---------- Title ---------- */
h1 {
  font-family: "Grandstander", cursive;
  font-size: clamp(28px, 6vw, 44px);
  background: linear-gradient(135deg, var(--coral), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 1.5rem 0 0.5rem;
  font-weight: 700;
  text-align: center;
}

/* ---------- Container ---------- */
.container {
  padding: 0 20px 40px;
  max-width: 700px;
  margin: 0 auto;
}

/* ---------- Book cover ---------- */
.book-placeholder {
  width: 220px;
  height: 220px;
  background-size: cover;
  background-position: center;
  margin: 20px auto;
  border-radius: 20px;
  border: 4px solid var(--white);
  box-shadow:
    0 12px 32px rgba(124, 92, 191, 0.2),
    0 0 0 1px rgba(124, 92, 191, 0.08);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ---------- Level pill tabs ---------- */
.level-picker {
  margin: 16px auto 24px;
  max-width: 420px;
  text-align: center;
}

.level-picker-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 10px;
}

.level-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.level-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid #e2e8f0;
  background: var(--white);
  color: var(--slate-light);
  font-family: "Grandstander", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.level-pill:hover {
  border-color: var(--purple-light);
  color: var(--purple);
  transform: scale(1.08);
}

.level-pill.active {
  background: linear-gradient(135deg, var(--purple), var(--coral));
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 4px 14px rgba(124, 92, 191, 0.3);
  transform: scale(1.1);
}

.level-pill-words {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  opacity: 0.8;
  line-height: 1;
  margin-top: 1px;
}

.level-summary {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--slate-light);
  line-height: 1.4;
}

@media (max-width: 360px) {
  .level-pill {
    width: 42px;
    height: 42px;
    font-size: 1rem;
  }

  .level-pills {
    gap: 6px;
  }
}

/* ---------- Activity sections ---------- */
.button-container {
  display: block;
  margin: 20px 0;
  padding: 0;
}

.activity-section {
  margin-bottom: 28px;
}

.activity-section__heading {
  display: flex;
  align-items: center;
  gap: 10px;

  font-family: "Grandstander", cursive;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--purple);
  text-align: left;

  margin: 0 0 12px 4px;
  -webkit-text-fill-color: initial;
  background: none;
}

.activity-section__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.section-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- Activity buttons ---------- */
.button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 12px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--white);
  border: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  transition: all 0.25s ease;
  min-height: 120px;
  -webkit-tap-highlight-color: transparent;
}

.button svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  opacity: 0.9;
}

.button__label {
  line-height: 1.2;
}

.button__helper {
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.82;
  line-height: 1.3;
  text-align: center;
}

.button:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.button:active {
  transform: translateY(-1px);
}

/* Per-activity colors */
.button--readaloud {
  background: linear-gradient(135deg, var(--coral), #e8554e);
}

.button--flashcards {
  background: linear-gradient(135deg, var(--purple), #6346a3);
}

.button--quiz {
  background: linear-gradient(135deg, var(--amber), #e68a00);
}

.button--matching {
  background: linear-gradient(135deg, var(--teal), #1fa89c);
}

.button--riddles {
  background: linear-gradient(135deg, var(--rose), #db2777);
}

.button--memory {
  background: linear-gradient(135deg, var(--sky), #2196f3);
}

.button--wordsearch {
  background: linear-gradient(135deg, var(--green), #10b981);
}

.button--speedgrid {
  background: linear-gradient(135deg, #f472b6, #7c5cbf);
}

.button--fallingwords {
  background: linear-gradient(135deg, #fb923c, #ef4444);
}

.button--wordsort {
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
}

.button--allvocabcards {
  background: linear-gradient(135deg, #a4d8ff, #c3b6ff);
  color: #2d1f6e;
}

.button--allvocabcards svg {
  opacity: 0.85;
}

.button--allstory {
  background: linear-gradient(135deg, #b8f0d8, #7dd3c0);
  color: #1a4a3a;
}

.button--allstory svg {
  opacity: 0.85;
}

.button--fillblank {
  background: linear-gradient(135deg, #ffd76a, #ffb347);
}

@media (max-width: 500px) {
  .activity-section__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .activity-section__heading {
    font-size: 0.9rem;
  }

  .button {
    min-height: 110px;
    padding: 16px 10px 12px;
    font-size: 0.85rem;
  }

  .button svg {
    width: 30px;
    height: 30px;
  }

  .button__helper {
    font-size: 0.63rem;
  }
}

/* ---------- Hearts ---------- */
.heart {
  position: absolute;
  bottom: 0;
  font-size: 1.5rem;
  opacity: 0;
  animation: floatSwirl 6s linear infinite;
}

@keyframes floatSwirl {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  50% {
    transform: translateY(-50vh) translateX(20px) rotate(180deg);
  }
  100% {
    transform: translateY(-100vh) translateX(-20px) rotate(360deg);
    opacity: 0;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  .book-placeholder {
    width: 180px;
    height: 180px;
  }
}
