/* LearningwithME – exciting shared subject world shell */

:root {
  --purple: #6B46C1;
  --blue: #3182CE;
  --gold: #F6AD55;
  --green: #38A169;
  --pink: #ED64A6;
  --ink: #1f2937;
  --world-accent: #6B46C1;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Comic Neue', 'Comic Sans MS', cursive;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(237, 100, 166, 0.18), transparent 45%),
    radial-gradient(ellipse at 80% 10%, rgba(99, 102, 241, 0.2), transparent 40%),
    linear-gradient(165deg, #e0f2fe 0%, #f3e8ff 42%, #fef3c7 100%);
}

.world-wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0.75rem 1rem 3.5rem;
}

.hub-back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  margin-bottom: 0.55rem;
  font-size: 0.95rem;
  padding: 0.35rem 0.6rem;
  background: rgba(255,255,255,0.75);
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.9);
}
.hub-back:hover { text-decoration: underline; transform: translateY(-1px); }
.hub-back img { height: 28px; width: auto; display: block; }

.world-header {
  background: rgba(255,255,255,0.96);
  border-radius: 1.25rem;
  box-shadow: 0 8px 28px rgba(107, 70, 193, 0.14);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  position: sticky;
  top: 0.4rem;
  z-index: 30;
  border: 3px solid #ede9fe;
}

.world-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--world-accent);
}

.stars-pill {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.zone { display: none; animation: fadeIn 0.28s ease; }
.zone.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Exciting home hero */
.hero-card {
  position: relative;
  background: white;
  border-radius: 1.75rem;
  padding: 0;
  text-align: center;
  border: 4px solid #fff;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--world-accent) 35%, white),
    0 16px 40px rgba(107, 70, 193, 0.18);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.hero-art-wrap {
  position: relative;
  background: linear-gradient(180deg, #faf5ff, #e0f2fe);
  min-height: 12rem;
}

.hero-art {
  width: 100%;
  max-height: min(52vw, 320px);
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-art[hidden] { display: none; }

.hero-emoji {
  font-size: 4.5rem;
  line-height: 1;
  padding: 1.5rem 0 0.5rem;
}

.hero-body {
  padding: 1rem 1.25rem 1.35rem;
}

.hero-card h1 {
  font-size: clamp(1.5rem, 5vw, 2rem);
  color: var(--world-accent);
  margin-bottom: 0.35rem;
  text-shadow: 0 2px 0 rgba(255,255,255,0.8);
}

.hero-card .hero-tagline {
  color: #4b5563;
  font-size: 1.08rem;
  line-height: 1.4;
  max-width: 28rem;
  margin: 0 auto;
}

.hero-sparkle {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  background: rgba(255,255,255,0.92);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  color: var(--world-accent);
  border: 2px solid #e9d5ff;
  z-index: 2;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.action-btn {
  border: none;
  cursor: pointer;
  background: white;
  border-radius: 1.35rem;
  padding: 1.15rem 0.5rem 1rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  border: 3px solid #e9d5ff;
  box-shadow: 0 8px 20px rgba(0,0,0,0.07);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  min-height: 6.25rem;
  position: relative;
  overflow: hidden;
}
.action-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, color-mix(in srgb, var(--world-accent) 12%, white), transparent 60%);
  pointer-events: none;
}
.action-btn:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 14px 28px rgba(107, 70, 193, 0.18);
  border-color: var(--world-accent);
}
.action-btn:active { transform: translateY(-1px) scale(0.99); }
.action-btn:focus-visible { outline: 3px solid var(--world-accent); outline-offset: 2px; }
.action-btn .ico {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.3rem;
  position: relative;
}
.action-btn .lbl { position: relative; }
.action-btn .sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #6b7280;
  margin-top: 0.15rem;
  position: relative;
}
.action-learn { border-color: #86efac; }
.action-learn:hover { border-color: #16a34a; }
.action-test { border-color: #fcd34d; }
.action-test:hover { border-color: #d97706; }
.action-play { border-color: #f9a8d4; }
.action-play:hover { border-color: #db2777; }

.hub-back, .back-btn, .btn, .choice-btn, .letter-chip, .action-btn {
  min-height: 44px;
}
.hub-back {
  min-height: 44px;
  padding: 0.45rem 0.85rem;
}
.back-btn:focus-visible,
.hub-back:focus-visible,
.btn:focus-visible,
.choice-btn:focus-visible,
.letter-chip:focus-visible {
  outline: 3px solid var(--world-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .zone, .action-btn, .letter-chip, .choice-btn {
    animation: none !important;
    transition: none !important;
  }
  .action-btn:hover, .letter-chip:hover { transform: none; }
}

.home-tip {
  text-align: center;
  color: #6b7280;
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.panel {
  background: white;
  border-radius: 1.5rem;
  padding: 1.25rem;
  border: 3px solid #e9d5ff;
  box-shadow: 0 10px 28px rgba(107, 70, 193, 0.1);
}

.back-btn {
  background: #f3e8ff;
  border: 2px solid #e9d5ff;
  font-family: inherit;
  font-weight: 700;
  color: var(--purple);
  font-size: 1rem;
  cursor: pointer;
  margin-bottom: 0.85rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
}
.back-btn:hover { background: #ede9fe; }

.lesson-card {
  background: linear-gradient(135deg, #faf5ff, #eff6ff);
  border-radius: 1.1rem;
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
  border-left: 6px solid var(--world-accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.lesson-card h3 {
  color: var(--world-accent);
  margin-bottom: 0.4rem;
  font-size: 1.15rem;
}
.lesson-card p {
  color: #4b5563;
  line-height: 1.5;
  font-size: 1rem;
}

.q-prompt {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--world-accent);
  margin-bottom: 1rem;
  line-height: 1.4;
}
.answer-input {
  width: 100%;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 0.9rem 1rem;
  border: 3px solid #e5e7eb;
  border-radius: 1rem;
  margin-bottom: 0.75rem;
}
.answer-input:focus { outline: none; border-color: var(--world-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--world-accent) 20%, transparent); }

.choice-grid { display: grid; gap: 0.65rem; margin-bottom: 0.75rem; }
.choice-btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 3px solid #e5e7eb;
  background: white;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  min-height: 48px;
}
.choice-btn:hover { border-color: var(--world-accent); transform: translateX(2px); }
.choice-btn.selected { border-color: var(--world-accent); background: #f5f3ff; }
.choice-btn.correct { border-color: var(--green); background: #d1fae5; }
.choice-btn.wrong { border-color: #f87171; background: #fee2e2; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.75rem; }
.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  border: none;
  border-radius: 1rem;
  padding: 0.8rem 1.3rem;
  cursor: pointer;
  min-height: 48px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--world-accent), color-mix(in srgb, var(--world-accent) 70%, #1f2937));
  color: white;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--world-accent) 35%, transparent);
}
.btn-secondary { background: #e5e7eb; color: var(--ink); }
.btn:hover { filter: brightness(1.06); }
.hidden { display: none !important; }

.feedback {
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  font-weight: 700;
  font-size: 1.05rem;
  display: none;
}
.feedback.show { display: block; }
.feedback.ok { background: #d1fae5; color: #065f46; }
.feedback.bad { background: #fee2e2; color: #991b1b; }

.game-area { text-align: center; }
.game-word {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--world-accent);
  margin: 1rem 0;
  min-height: 2.6rem;
}
.letter-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
}
.letter-chip {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.85rem;
  border: 3px solid #e5e7eb;
  background: white;
  font-family: inherit;
  font-weight: 700;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,0.06);
}
.letter-chip:hover { border-color: var(--world-accent); transform: translateY(-2px); }
.letter-chip.used { opacity: 0.3; pointer-events: none; }

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: #374151;
  color: white;
  font-weight: 700;
  padding: 0.8rem 1.3rem;
  border-radius: 1rem;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.toast.show { opacity: 1; }

/* Score & learning review (Myles.E — help strugglers learn) */
.score-banner {
  text-align: center;
  padding: 1rem 0.5rem 1.25rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #faf5ff, #ecfdf5);
  border-radius: 1.25rem;
  border: 3px solid #e9d5ff;
}
.score-big {
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--world-accent);
  line-height: 1.1;
}
.score-big span {
  font-size: 1.35rem;
  color: #6b7280;
}
.score-cheer {
  margin-top: 0.5rem;
  font-weight: 700;
  color: #374151;
  font-size: 1.05rem;
  line-height: 1.4;
  padding: 0 0.5rem;
}
.review-intro {
  margin: 1rem 0 0.75rem;
}
.review-intro h3 {
  color: var(--world-accent);
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
}
.review-intro p {
  color: #4b5563;
  font-weight: 600;
  line-height: 1.45;
  font-size: 0.98rem;
}
.review-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.review-card {
  background: #fffbeb;
  border: 2px solid #fcd34d;
  border-left: 6px solid #f59e0b;
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  text-align: left;
}
.review-num {
  font-size: 0.8rem;
  font-weight: 700;
  color: #b45309;
  margin-bottom: 0.25rem;
}
.review-q {
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.4rem;
  line-height: 1.35;
}
.review-yours {
  font-size: 0.95rem;
  color: #b91c1c;
  margin-bottom: 0.2rem;
}
.review-right {
  font-size: 0.95rem;
  color: #047857;
  margin-bottom: 0.45rem;
}
.review-tip {
  font-size: 0.98rem;
  font-weight: 700;
  color: #5b21b6;
  background: #f5f3ff;
  padding: 0.55rem 0.7rem;
  border-radius: 0.75rem;
  line-height: 1.4;
}
.review-all-good {
  text-align: center;
  font-weight: 700;
  font-size: 1.15rem;
  color: #047857;
  padding: 1rem;
}
#game-progress {
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

@media (max-width: 520px) {
  .action-grid { grid-template-columns: 1fr; }
  .action-btn {
    min-height: 3.75rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    text-align: left;
  }
  .action-btn .ico { display: inline; margin: 0; font-size: 1.5rem; }
  .action-btn .sub { display: inline; margin-left: 0.35rem; }
}
