/* ==========================================================================
   Interactive Science Grade 1: Kinds of Animals (Optimized for Android Smartboards)
   Ultra-responsive, high-contrast, zero-lag, touch-first stylesheet (English Version)
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #7c3aed;
  --accent-warm: #ec4899;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-main: #f1f5f9;
  --card-bg: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border-radius-lg: 20px;
  --border-radius-md: 14px;
  --border-radius-sm: 8px;
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 24px rgba(37, 99, 235, 0.35);
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Comic Sans MS", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

body {
  font-family: var(--font-family);
  background: var(--bg-main);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  touch-action: manipulation;
  direction: ltr; /* English LTR */
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
header.app-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0284c7 100%);
  color: white;
  padding: 12px 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 20;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-badge {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
  font-size: 28px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.title-group h1 {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.title-group .sub-title {
  font-size: 15px;
  opacity: 0.95;
  font-weight: 600;
  display: flex;
  gap: 10px;
  align-items: center;
}

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

.header-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: white;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s, background-color 0.15s;
  touch-action: manipulation;
}

.header-btn:active, .header-btn.active {
  background: white;
  color: #1e3a8a;
  transform: scale(0.96);
  border-color: white;
}

/* Nav Tabs */
nav.app-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
nav.app-nav::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 10px 20px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-tab:active {
  transform: scale(0.96);
}

.nav-tab.active {
  background: #ffffff;
  color: #1e3a8a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  border-color: #ffffff;
  transform: translateY(-2px);
}

.nav-tab .tab-icon {
  font-size: 20px;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
main.app-main {
  flex: 1;
  padding: 16px 24px;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-pane.active {
  display: block;
}

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

/* Section Header Banner */
.lesson-banner {
  background: white;
  border-radius: var(--border-radius-md);
  padding: 18px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-left: 6px solid var(--primary);
}

.banner-text h2 {
  font-size: 23px;
  color: var(--text-dark);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.banner-text p {
  font-size: 17px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

.banner-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.voice-btn {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #1d4ed8;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 9px 20px;
  border-radius: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s, background 0.15s;
}

.voice-btn:active {
  transform: scale(0.95);
  background: #dbeafe;
}

/* ==========================================================================
   Tab 1: Animals & Colours Showcase (Page 13)
   ========================================================================== */
.filter-pills {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.pill-btn {
  background: white;
  border: 2px solid #e2e8f0;
  color: #475569;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
  white-space: nowrap;
}

.pill-btn:active, .pill-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.pill-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0,0,0,0.15);
}

.animals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.animal-card {
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  border: 3px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.18s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.18s, border-color 0.18s;
  overflow: hidden;
}

.animal-card:active {
  transform: scale(0.97);
}

.animal-card.highlight {
  border-color: var(--primary);
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.25);
  background: #f8faff;
}

.card-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: #f1f5f9;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.animal-img-wrapper {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 15px;
  margin-bottom: 12px;
  background: radial-gradient(circle, #f8fafc 40%, #edf2f7 100%);
  border-radius: var(--border-radius-md);
  overflow: hidden;
}

.animal-img-wrapper img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.animal-card:hover .animal-img-wrapper img,
.animal-card:active .animal-img-wrapper img {
  transform: scale(1.06);
}

.animal-card-info {
  text-align: center;
  width: 100%;
}

.animal-card-name {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-dark);
}

.animal-card-desc {
  font-size: 15px;
  font-weight: 600;
  color: #475569;
  margin-top: 4px;
}

.animal-traits {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.trait-tag {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  padding: 4px 10px;
  border-radius: 12px;
}

.card-action-bar {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
}

.card-btn {
  flex: 1;
  background: var(--primary);
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: white;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, transform 0.15s;
}

.card-btn:active {
  transform: scale(0.95);
  background: var(--primary-hover);
}

/* ==========================================================================
   Tab 2: Outer Coverings Laboratory (Page 14)
   ========================================================================== */
.coverings-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.covering-card {
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 3px solid transparent;
  transition: all 0.2s;
}

.covering-card.active-flip {
  border-color: #f59e0b;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.2);
}

.covering-badge-top {
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.badge-scales { background: #e0f2fe; color: #0369a1; }
.badge-feathers { background: #fef3c7; color: #b45309; }
.badge-fur { background: #f3e8ff; color: #7e22ce; }
.badge-shell { background: #dcfce7; color: #15803d; }
.badge-quills { background: #fee2e2; color: #b91c1c; }

/* Flip View Container */
.interactive-view-box {
  width: 100%;
  height: 220px;
  border-radius: var(--border-radius-md);
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.view-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.view-layer.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
}

.view-layer img {
  max-width: 90%;
  max-height: 85%;
  object-fit: contain;
}

.view-layer.texture-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: 100%;
  max-height: 100%;
}

.texture-overlay-label {
  position: absolute;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.covering-card-info {
  text-align: center;
}

.cov-animal-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-dark);
}

.cov-formula {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px 12px;
  margin: 10px 0;
  font-size: 16px;
  font-weight: 800;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cov-formula .highlight-part {
  color: #d97706;
}

.cov-desc {
  font-size: 14px;
  color: #64748b;
  font-weight: 600;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
}

.toggle-lens-btn {
  margin-top: 12px;
  width: 100%;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  transition: transform 0.15s;
}

.toggle-lens-btn:active {
  transform: scale(0.96);
}

/* ==========================================================================
   Tab 3: Animal Sizes (Big vs Small)
   ========================================================================== */
.sizes-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sizes-split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 850px) {
  .sizes-split-row {
    grid-template-columns: 1fr;
  }
}

.size-category-box {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  border-top: 8px solid;
}

.size-category-box.big {
  border-top-color: #2563eb;
}

.size-category-box.small {
  border-top-color: #10b981;
}

.cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px dashed #f1f5f9;
}

.cat-title-group h3 {
  font-size: 22px;
  font-weight: 800;
}

.cat-title-group .cat-en {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
}

.cat-badge {
  font-size: 14px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 20px;
}

.cat-badge.big { background: #dbeafe; color: #1d4ed8; }
.cat-badge.small { background: #d1fae5; color: #047857; }

.size-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
}

.size-mini-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--border-radius-md);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.size-mini-card:active {
  transform: scale(0.95);
  border-color: var(--primary);
  background: #eff6ff;
}

.size-mini-card img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  margin-bottom: 8px;
}

.size-mini-card .name-main {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-dark);
}

.size-mini-card .name-tag {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 2px;
}

/* Interactive Scale Arena */
.interactive-scale-arena {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.arena-title {
  font-size: 21px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text-dark);
}

.arena-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.scale-stage {
  min-height: 260px;
  background: linear-gradient(180deg, #eff6ff 0%, #e0f2fe 70%, #d1fae5 70%, #a7f3d0 100%);
  border-radius: var(--border-radius-md);
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 20px 40px;
  overflow: hidden;
  border: 2px solid #bfdbfe;
}

.scale-animal-actor {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.scale-animal-actor img {
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,0.15));
  transition: transform 0.3s ease;
}

.scale-animal-actor.huge img {
  height: 200px;
}

.scale-animal-actor.tiny img {
  height: 60px;
}

.scale-label-tag {
  background: white;
  font-size: 15px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  margin-top: 8px;
}

/* ==========================================================================
   Tab 4: Touch & Connect Matching Game
   ========================================================================== */
.match-game-wrapper {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.game-score-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--border-radius-md);
  padding: 12px 20px;
  margin-bottom: 24px;
}

.score-display {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stars-row {
  display: flex;
  gap: 6px;
  font-size: 24px;
}

.star-icon {
  color: #cbd5e1;
  transition: color 0.2s, transform 0.2s;
}

.star-icon.earned {
  color: #fbbf24;
  transform: scale(1.15);
}

.game-instructions-banner {
  font-size: 16px;
  font-weight: 700;
  color: #2563eb;
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-reset-btn {
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #475569;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.game-reset-btn:active {
  transform: scale(0.95);
  background: #e2e8f0;
}

/* Matching Columns */
.matching-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  position: relative;
}

@media (max-width: 768px) {
  .matching-board {
    gap: 16px;
  }
}

.match-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.match-column-header {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-dark);
  text-align: center;
  padding: 10px;
  background: #f1f5f9;
  border-radius: 12px;
}

.match-item {
  background: #ffffff;
  border: 3px solid #e2e8f0;
  border-radius: var(--border-radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  min-height: 80px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.match-item:active {
  transform: scale(0.97);
}

.match-item.selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.35);
  transform: translateY(-2px);
}

.match-item.matched {
  border-color: #10b981;
  background: #ecfdf5;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
  pointer-events: none;
  opacity: 0.85;
}

.match-item.wrong {
  animation: wiggle 0.4s ease;
  border-color: #ef4444;
  background: #fef2f2;
}

@keyframes wiggle {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.match-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.match-item-thumb {
  width: 58px;
  height: 58px;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 10px;
  padding: 4px;
}

.match-item-label {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-dark);
}

.match-item-sublabel {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 2px;
}

.match-item-indicator {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.match-item.selected .match-item-indicator {
  border-color: #2563eb;
  background: #2563eb;
  color: white;
}

.match-item.matched .match-item-indicator {
  border-color: #10b981;
  background: #10b981;
  color: white;
}

/* ==========================================================================
   Tab 5: "Who Am I?" Interactive Quiz
   ========================================================================== */
.quiz-wrapper {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  max-width: 900px;
  margin: 0 auto;
}

.quiz-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.quiz-progress-text {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-muted);
}

.quiz-score-pill {
  background: #fef3c7;
  border: 1.5px solid #fde68a;
  color: #92400e;
  font-size: 16px;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.quiz-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--border-radius-lg);
  padding: 26px;
  text-align: center;
  margin-bottom: 24px;
  position: relative;
}

.quiz-riddle-badge {
  background: #7c3aed;
  color: white;
  font-size: 14px;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 14px;
}

.quiz-question {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.4;
  margin-bottom: 12px;
}

.quiz-read-btn {
  margin-top: 10px;
  background: white;
  border: 1.5px solid #bfdbfe;
  color: #2563eb;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.quiz-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 650px) {
  .quiz-options-grid {
    grid-template-columns: 1fr;
  }
}

.quiz-option-btn {
  background: white;
  border: 3px solid #e2e8f0;
  border-radius: var(--border-radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.quiz-option-btn:active {
  transform: scale(0.96);
}

.quiz-option-btn img {
  width: 105px;
  height: 105px;
  object-fit: contain;
}

.quiz-option-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-dark);
}

.quiz-option-btn.correct {
  border-color: #10b981;
  background: #ecfdf5;
  animation: pulseSuccess 0.4s ease;
}

.quiz-option-btn.wrong {
  border-color: #ef4444;
  background: #fef2f2;
}

@keyframes pulseSuccess {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   Tab 6: Classroom Spin Wheel
   ========================================================================== */
.wheel-wrapper {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.wheel-stage {
  position: relative;
  width: 320px;
  height: 320px;
  margin: 20px 0;
}

.wheel-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 32px solid #ef4444;
  z-index: 10;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.3));
}

#wheelCanvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.spin-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  font-family: inherit;
  font-size: 22px;
  font-weight: 800;
  padding: 14px 44px;
  border-radius: 40px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.15s;
}

.spin-btn:active {
  transform: scale(0.95);
}

.wheel-result-card {
  margin-top: 24px;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: var(--border-radius-md);
  padding: 18px 24px;
  width: 100%;
  max-width: 520px;
  display: none;
}

.wheel-result-card.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.result-congrats {
  font-size: 23px;
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 6px;
}

.result-task {
  font-size: 18px;
  color: #334155;
  font-weight: 700;
  line-height: 1.4;
}

/* ==========================================================================
   Teacher's Whiteboard Magic Pen Overlay
   ========================================================================== */
#drawingCanvasOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999;
  pointer-events: none;
}

#drawingCanvasOverlay.drawing-mode-active {
  pointer-events: auto;
  cursor: crosshair;
}

.pen-toolbar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(10px);
  padding: 8px 18px;
  border-radius: 36px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.pen-toolbar.hidden {
  transform: translate(-50%, 100px);
  opacity: 0;
  pointer-events: none;
}

.pen-color-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid white;
  cursor: pointer;
  transition: transform 0.15s;
}

.pen-color-btn:active, .pen-color-btn.active {
  transform: scale(1.25);
  box-shadow: 0 0 10px white;
}

.pen-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pen-btn:active {
  background: white;
  color: #1e293b;
}

/* ==========================================================================
   Full High-Res Posters Modal
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: white;
  border-radius: var(--border-radius-lg);
  max-width: 1100px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 800;
}

.modal-close-btn {
  background: #f1f5f9;
  border: none;
  font-size: 20px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--border-radius-md);
}

/* ==========================================================================
   Confetti Elements
   ========================================================================== */
.confetti-piece {
  position: fixed;
  width: 12px;
  height: 12px;
  z-index: 2000;
  pointer-events: none;
  animation: confettiFall 2.2s linear forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ==========================================================================
   Android Screen Safe-Area & Touch Performance
   ========================================================================== */
button, .nav-tab, .animal-card, .size-mini-card, .match-item, .quiz-option-btn {
  touch-action: manipulation;
}
