/* ==========================================================================
   Design System for Science Land (วิทยาศาสตร์ ป.2)
   Theme: Pastel and Child-friendly Playful Graphics
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Itim&family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
  /* Pastel Palette */
  --primary-color: #B19FFB;
  --primary-color-dark: #8E73FA;
  --primary-color-light: #E8E3FF;
  
  --secondary-color: #FFB7D5;
  --secondary-color-dark: #FF87B4;
  --secondary-color-light: #FFF0F6;
  
  --success-color: #A8E6CF;
  --success-color-dark: #56C29B;
  --success-color-light: #EEFAF5;
  
  --info-color: #A8DADC;
  --info-color-dark: #5FA5A7;
  --info-color-light: #EDF7F7;
  
  --warning-color: #FFEBB7;
  --warning-color-dark: #F3BA39;
  --warning-color-light: #FFFDF0;
  
  --accent-color: #FFD3B6;
  --accent-color-dark: #FFA86E;
  
  --bg-color-light: #FFFDF9;
  --bg-color-dark: #F9F7EF;
  --border-color: #E2E8F0;
  
  /* Text */
  --text-color: #3A3A3C;
  --text-muted: #7C7C80;
  --text-white: #FFFFFF;

  /* Shadows */
  --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.04);
  --card-shadow-hover: 0 15px 30px rgba(177, 159, 251, 0.25);
  --btn-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
  --btn-shadow-active: 0 2px 4px rgba(0, 0, 0, 0.1);
  
  /* Borders and Radii */
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --border-width: 3px;
  --transition-speed: 0.3s;
}

/* ==========================================================================
   Basic Settings & Reset
   ========================================================================== */

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

body {
  font-family: 'Itim', 'Fredoka', 'Sarabun', sans-serif;
  background-color: var(--bg-color-dark);
  color: var(--text-color);
  font-size: 1.2rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(#FFEBB7 1px, transparent 1px),
    radial-gradient(#E8E3FF 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: var(--radius-sm);
  border: 2px solid var(--bg-color-dark);
}

/* ==========================================================================
   Typography Rules (Easy-to-read)
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Itim', 'Fredoka', sans-serif;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-color);
  letter-spacing: 0.5px;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.3rem; }

p {
  margin-bottom: 1rem;
}

/* ==========================================================================
   Buttons (Bubbly and Fun)
   ========================================================================== */

.btn-pastel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.8rem;
  font-size: 1.2rem;
  font-family: 'Itim', sans-serif;
  font-weight: 700;
  border-radius: var(--radius-lg);
  border: var(--border-width) solid var(--text-color);
  cursor: pointer;
  box-shadow: 0 6px 0 var(--text-color);
  background-color: var(--text-white);
  transition: all 0.15s ease-out;
  transform: translateY(-2px);
  user-select: none;
}

.btn-pastel:hover {
  transform: translateY(0);
  box-shadow: 0 4px 0 var(--text-color);
}

.btn-pastel:active {
  transform: translateY(2px);
  box-shadow: 0 0px 0 var(--text-color);
}

/* Variances */
.btn-pastel-purple { background-color: var(--primary-color); }
.btn-pastel-pink { background-color: var(--secondary-color); }
.btn-pastel-green { background-color: var(--success-color); }
.btn-pastel-blue { background-color: var(--info-color); }
.btn-pastel-yellow { background-color: var(--warning-color); }
.btn-pastel-red { background-color: #FFAAA6; }

/* Disabled */
.btn-pastel:disabled, .btn-action-game:disabled {
  background-color: #E2E8F0 !important;
  color: #94A3B8 !important;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   Layout Shell
   ========================================================================== */

.app-header {
  background-color: var(--text-white);
  border-bottom: var(--border-width) solid var(--text-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--card-shadow);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.8rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mascot-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--text-color);
  background-color: var(--primary-color-light);
  object-fit: cover;
}

.brand-name {
  font-size: 1.8rem;
  background: linear-gradient(135deg, var(--primary-color-dark), var(--secondary-color-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.05);
}

.nav-links {
  display: flex;
  gap: 15px;
}

.nav-item {
  font-size: 1.15rem;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  font-weight: 700;
  transition: all var(--transition-speed);
}

.nav-item:hover {
  background-color: var(--primary-color-light);
  color: var(--primary-color-dark);
}

.nav-item.active {
  background-color: var(--primary-color-light);
  border-color: var(--primary-color-dark);
  color: var(--primary-color-dark);
}

/* Main Area */
.app-main {
  flex: 1;
  max-width: 1000px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.app-footer {
  background-color: var(--text-white);
  border-top: var(--border-width) solid var(--text-color);
  padding: 1.5rem;
  text-align: center;
  font-size: 1.1rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -5px 15px rgba(0,0,0,0.02);
}

/* ==========================================================================
   Home/Dashboard Page
   ========================================================================== */

.welcome-banner {
  background: linear-gradient(135deg, var(--primary-color-light) 0%, var(--secondary-color-light) 100%);
  border: var(--border-width) solid var(--text-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  display: flex;
  align-items: center;
  gap: 30px;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.welcome-banner::before {
  content: "🧪 🪐 🌿 🦠";
  position: absolute;
  font-size: 4rem;
  opacity: 0.05;
  right: 10px;
  bottom: 10px;
  letter-spacing: 15px;
  transform: rotate(-10deg);
}

.mascot-mascot-landing {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 3px solid var(--text-color);
  background-color: var(--text-white);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  object-fit: cover;
  animation: floating 3s ease-in-out infinite;
}

.welcome-text h2 {
  font-size: 2.2rem;
  color: var(--primary-color-dark);
}

.welcome-text p {
  color: var(--text-color);
  font-size: 1.3rem;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* Grid of Units */
.unit-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.unit-section-title {
  border-bottom: 3px dashed var(--text-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.unit-card {
  background-color: var(--text-white);
  border: var(--border-width) solid var(--text-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.unit-card-header {
  padding: 1.5rem 2rem;
  border-bottom: var(--border-width) solid var(--text-color);
  color: var(--text-color);
}

.unit-card-header h3 {
  margin-bottom: 0.2rem;
}

.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  background-color: #FAF8F2;
}

.chapter-box {
  background-color: var(--text-white);
  border: 2px solid var(--text-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  position: relative;
  transition: all var(--transition-speed);
}

.chapter-box:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--primary-color-dark);
}

.chapter-info {
  display: flex;
  gap: 15px;
}

.chapter-icon-circle {
  font-size: 2.2rem;
  width: 60px;
  height: 60px;
  min-width: 60px;
  border-radius: 50%;
  background-color: var(--primary-color-light);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--text-color);
}

.chapter-details h4 {
  font-size: 1.25rem;
  margin-bottom: 0.3rem;
}

.chapter-details p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.badge-status {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.5rem;
  animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ==========================================================================
   Lesson Page (Details Layout)
   ========================================================================== */

.back-to-home-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--primary-color-dark);
  margin-bottom: 1.5rem;
  transition: transform 0.2s;
}

.back-to-home-link:hover {
  transform: translateX(-5px);
}

.lesson-page-container {
  background-color: var(--text-white);
  border: var(--border-width) solid var(--text-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--card-shadow);
  position: relative;
}

.lesson-header {
  border-bottom: var(--border-width) solid var(--text-color);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lesson-title-area h2 {
  font-size: 2.2rem;
}

.lesson-badge-unlocked {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--warning-color);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--text-color);
  font-weight: 700;
  font-size: 1rem;
}

/* Tabs: Content vs Game vs Quiz */
.tabs-navigation {
  display: flex;
  gap: 10px;
  margin-bottom: 2rem;
}

.tab-btn {
  flex: 1;
  padding: 0.8rem;
  font-size: 1.2rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 2px solid var(--text-color);
  background-color: var(--bg-color-dark);
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background-color: var(--primary-color);
  box-shadow: 0 4px 0 var(--text-color);
  transform: translateY(-2px);
}

/* Content Panel */
.lesson-content-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.intro-bubble {
  background-color: var(--primary-color-light);
  border-radius: var(--radius-md);
  border: 2px solid var(--text-color);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 20px;
}

.intro-mascot-pic {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid var(--text-color);
  background-color: var(--text-white);
  object-fit: cover;
}

.intro-text-balloon {
  font-size: 1.25rem;
  font-weight: 700;
}

.lesson-section-card {
  background-color: var(--text-white);
  border: 2px solid var(--text-color);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  box-shadow: 0 5px 0 var(--text-color);
  transition: all var(--transition-speed);
}

.lesson-section-card:hover {
  transform: scale(1.01);
}

.lesson-section-card h3 {
  border-bottom: 2px dashed var(--text-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.lesson-section-card p {
  font-size: 1.2rem;
  line-height: 1.7;
}

/* ==========================================================================
   Games Layout (Inside panels)
   ========================================================================== */

.game-container {
  background-color: #FAF8F2;
  border: 2px solid var(--text-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-top: 1rem;
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.02);
}

.game-instruction {
  background-color: var(--text-white);
  border: 2px solid var(--text-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.game-workspace {
  margin-bottom: 1.5rem;
}

.game-feedback {
  background-color: var(--text-white);
  border: 2px dashed var(--text-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  font-weight: 700;
  font-size: 1.25rem;
  margin-top: 1rem;
  min-height: 50px;
}

.btn-action-game {
  width: 100%;
  padding: 1rem;
  font-size: 1.3rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 3px solid var(--text-color);
  box-shadow: 0 6px 0 var(--text-color);
  cursor: pointer;
  margin-top: 1rem;
  transition: all 0.15s;
}

.btn-action-game:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 var(--text-color);
}

/* 1. Classification Game Specific Styles */
.baskets-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 2rem;
}

.basket-dropzone {
  background-color: var(--text-white);
  border: 3px dashed var(--text-muted);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.2s;
}

.basket-dropzone.drag-over {
  background-color: var(--primary-color-light);
  border-color: var(--primary-color-dark);
  transform: scale(1.02);
}

.basket-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--text-color);
  padding-bottom: 0.3rem;
  width: 100%;
  text-align: center;
}

.basket-items-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  width: 100%;
}

.items-to-sort-container {
  background-color: var(--text-white);
  border: 2px solid var(--text-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  min-height: 100px;
}

.sort-card {
  background-color: var(--warning-color);
  border: 2px solid var(--text-color);
  border-radius: var(--radius-md);
  padding: 0.8rem 1.5rem;
  font-weight: 700;
  cursor: grab;
  box-shadow: 0 4px 0 var(--text-color);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.sort-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 0 var(--text-color);
}

.sort-card.dragging {
  opacity: 0.4;
}

.sort-card.correct-sorted {
  background-color: var(--success-color-light);
  border-color: var(--success-color-dark);
  box-shadow: none;
  cursor: default;
  transform: none;
}

.mobile-sort-buttons {
  display: flex;
  gap: 6px;
  margin-top: 5px;
}

.btn-sort-mob {
  border: 1px solid var(--text-color);
  padding: 0.2rem 0.6rem;
  font-size: 0.85rem;
  font-family: 'Itim', sans-serif;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* 2. Inquiry Game Specific Styles */
.inquiry-options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-option-inquiry {
  width: 100%;
  padding: 1rem 1.5rem;
  text-align: left;
  font-size: 1.15rem;
  font-family: 'Itim', sans-serif;
  font-weight: 700;
  border: 2px solid var(--text-color);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 0 var(--text-color);
  cursor: pointer;
  background-color: var(--text-white);
  transition: all 0.1s;
}

.btn-option-inquiry:hover {
  background-color: var(--warning-color);
}

.btn-correct-selected {
  background-color: var(--success-color) !important;
  border-color: var(--success-color-dark) !important;
  color: var(--text-color);
}

.instruction-box-game {
  background-color: var(--text-white);
  border: 2px solid var(--text-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}

.instruction-box-game h4 {
  color: var(--primary-color-dark);
  margin-bottom: 0.3rem;
}

.inquiry-lab-interactive {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.pot-display {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background-color: var(--text-white);
  border: 3px solid var(--text-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.emoji-plant {
  font-size: 4.5rem;
  line-height: 1;
}

.soil-dry-label {
  position: absolute;
  bottom: 15px;
  background-color: #E63946;
  color: white;
  font-size: 0.85rem;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.pot-display.inspecting {
  animation: pulse-border 1.5s infinite;
}

.game-navigation {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* 3. Water Lab Specific Styles */
.lab-workspace {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 20px;
}

.lab-table {
  background-color: var(--text-white);
  border: 3px solid var(--text-color);
  border-radius: var(--radius-lg);
  height: 300px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  box-shadow: 0 8px 0 var(--text-color);
}

.dropper-apparatus {
  height: 80px;
  width: 100%;
  position: relative;
}

.dropper {
  font-size: 3.5rem;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  transition: transform 0.1s;
}

.dropper.squeezing {
  transform: translateX(-50%) translateY(10px) scale(0.95);
}

.material-stage {
  width: 180px;
  height: 110px;
  border: 3px dashed var(--text-muted);
  border-radius: var(--radius-md);
  background-color: var(--bg-color-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-stage-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  padding: 10px;
}

.active-material-block {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  border: 2px solid var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-weight: 700;
  font-size: 1.3rem;
  box-shadow: inset 0 -10px 0 rgba(0,0,0,0.1);
}

/* Material Colors */
.mat-sponge { background-color: #FFE66D; }
.mat-cloth { background-color: #FFAAA6; }
.mat-plastic { background-color: #D4F1F4; }
.mat-spoon { background-color: #C0C0C0; }

.water-droplets-on-mat {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.water-spot {
  font-size: 2.2rem;
  opacity: 0;
}

.water-roll {
  font-size: 2.2rem;
  position: absolute;
  top: -20px;
  left: 0;
}

.absorb-anim {
  animation: drop-and-absorb 0.8s forwards;
}

.roll-anim {
  animation: drop-and-roll 0.8s forwards;
}

.lab-shelf {
  background-color: var(--text-white);
  border: 2px solid var(--text-color);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
}

.shelf-materials {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  flex: 1;
  justify-content: center;
}

.btn-shelf-item {
  width: 100%;
  padding: 0.8rem;
  font-family: 'Itim', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  border: 2px solid var(--text-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  background-color: var(--bg-color-dark);
  box-shadow: 0 4px 0 var(--text-color);
  transition: all 0.1s;
}

.btn-shelf-item:hover {
  background-color: var(--primary-color-light);
}

.btn-shelf-item.selected {
  background-color: var(--primary-color);
  border-color: var(--primary-color-dark);
}

.lab-status-panel {
  margin-top: 1.5rem;
}

.lab-output-message {
  background-color: var(--text-white);
  border: 2px dashed var(--text-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  font-weight: 700;
  margin-top: 10px;
  min-height: 50px;
}

.tested-progress {
  text-align: right;
  margin-top: 0.8rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-muted);
}

/* 4. Mixer Game Specific Styles */
.mixer-workspace {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 20px;
}

.shelf-ingredients {
  background-color: var(--text-white);
  border: 2px solid var(--text-color);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
}

.ingredients-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 10px;
}

.btn-ingredient-item {
  padding: 0.6rem 1rem;
  border: 2px solid var(--text-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-color-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Itim', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 0 4px 0 var(--text-color);
  transition: all 0.1s;
}

.btn-ingredient-item:hover {
  background-color: var(--warning-color-light);
}

.btn-ingredient-item.selected-in-pot {
  background-color: var(--accent-color);
  border-color: var(--accent-color-dark);
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--text-color);
}

.mixer-area {
  background-color: var(--text-white);
  border: 3px solid var(--text-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 0 var(--text-color);
}

.mixer-pot {
  width: 200px;
  height: 180px;
  position: relative;
  margin-bottom: 20px;
}

.pot-rim {
  width: 160px;
  height: 25px;
  border: 3px solid var(--text-color);
  border-radius: 50%;
  background-color: #CBD5E1;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.pot-body {
  width: 100%;
  height: 160px;
  border: 3px solid var(--text-color);
  border-radius: 0 0 100px 100px;
  background: linear-gradient(180deg, #E2E8F0 0%, #94A3B8 100%);
  position: absolute;
  top: 15px;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 -20px 0 rgba(0,0,0,0.1);
}

.pot-emoji {
  font-size: 5rem;
  opacity: 0.15;
  pointer-events: none;
}

.pot-inside-items {
  position: absolute;
  top: 30px;
  width: 80%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 3;
}

.no-items-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
  width: 100%;
  padding-top: 20px;
}

.floating-pot-item {
  font-size: 1.8rem;
  animation: bounce 0.6s ease infinite alternate;
}

.floating-pot-item:nth-child(2) { animation-delay: 0.15s; }
.floating-pot-item:nth-child(3) { animation-delay: 0.3s; }
.floating-pot-item:nth-child(4) { animation-delay: 0.45s; }

.mixer-controls {
  width: 100%;
  display: flex;
  gap: 10px;
}

.mixer-feedback-box {
  background-color: var(--text-white);
  border: 2px dashed var(--text-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  text-align: center;
  font-weight: 700;
  margin-top: 1.5rem;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mix-success-card {
  display: flex;
  align-items: center;
  gap: 15px;
  text-align: left;
}

.mix-result-emoji {
  font-size: 3rem;
}

.mixer-recipes-book {
  margin-top: 1.5rem;
  background-color: var(--text-white);
  border: 2px solid var(--text-color);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
}

.recipes-status-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.recipe-item-track {
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--text-color);
  font-size: 1rem;
}

.recipe-item-track.locked {
  background-color: #F1F5F9;
  border-style: dotted;
  color: var(--text-muted);
}

.recipe-item-track.unlocked {
  background-color: var(--success-color-light);
  border-color: var(--success-color-dark);
  color: var(--text-color);
}

.shaking-pot-anim {
  animation: shake 0.15s infinite;
}

/* 5. Builder Game Specific Styles */
.customer-bubble {
  background-color: var(--text-white);
  border: 2px solid var(--text-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 2rem;
  box-shadow: 0 6px 0 var(--text-color);
  position: relative;
}

.customer-bubble::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 40px;
  border-width: 15px 15px 0;
  border-style: solid;
  border-color: var(--text-color) transparent;
  display: block;
  width: 0;
}

.customer-avatar {
  font-size: 3.5rem;
  line-height: 1;
}

.bubble-text {
  font-size: 1.25rem;
}

.bubble-text strong {
  color: var(--primary-color-dark);
}

.builder-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.btn-builder-option {
  padding: 1rem;
  border: 2px solid var(--text-color);
  border-radius: var(--radius-md);
  background-color: var(--text-white);
  box-shadow: 0 4px 0 var(--text-color);
  cursor: pointer;
  font-family: 'Itim', sans-serif;
  font-size: 1.15rem;
  text-align: center;
  transition: all 0.15s;
}

.btn-builder-option:hover {
  background-color: var(--warning-color);
}

.opt-desc-sm {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: block;
  margin-top: 5px;
  line-height: 1.3;
}

.builder-navigation {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* ==========================================================================
   Quiz Section Styles
   ========================================================================== */

.quiz-container-box {
  background-color: #FAF8F2;
  border: 2px solid var(--text-color);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
}

.quiz-progress {
  font-weight: 700;
  color: var(--primary-color-dark);
  margin-bottom: 0.8rem;
  text-align: right;
}

.quiz-question-title {
  background-color: var(--text-white);
  border: 2px solid var(--text-color);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.8rem;
  margin-bottom: 1.5rem;
  font-size: 1.35rem;
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-quiz-option {
  width: 100%;
  padding: 1rem 1.5rem;
  text-align: left;
  font-size: 1.2rem;
  font-family: 'Itim', sans-serif;
  font-weight: 700;
  border: 2px solid var(--text-color);
  border-radius: var(--radius-md);
  background-color: var(--text-white);
  box-shadow: 0 4px 0 var(--text-color);
  cursor: pointer;
  transition: all 0.1s;
}

.btn-quiz-option:hover {
  background-color: var(--primary-color-light);
}

.btn-quiz-option.correct {
  background-color: var(--success-color) !important;
  border-color: var(--success-color-dark) !important;
}

.btn-quiz-option.wrong {
  background-color: #FFAAA6 !important;
  border-color: #E63946 !important;
}

.quiz-feedback-box {
  background-color: var(--text-white);
  border: 2px dashed var(--text-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  margin-top: 1.5rem;
  font-weight: 700;
  line-height: 1.5;
}

.quiz-nav-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* Quiz Finished / Result Summary */
.quiz-summary-card {
  text-align: center;
}

.score-display-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background-color: var(--warning-color);
  border: 4px solid var(--text-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 1.5rem auto;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.score-num {
  font-size: 3rem;
  line-height: 1;
}

.score-total {
  font-size: 1.2rem;
  border-top: 2px solid var(--text-color);
  padding-top: 2px;
  width: 50%;
}

.badge-reward-display {
  margin: 1.5rem 0;
  font-size: 1.15rem;
}

.badge-big-emoji {
  font-size: 4rem;
  display: block;
  animation: scaleUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ==========================================================================
   Certificate Page (Awards)
   ========================================================================== */

.badge-status-board {
  background-color: var(--text-white);
  border: var(--border-width) solid var(--text-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 2rem;
}

.badges-row-flex {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 20px;
  margin: 2rem 0;
}

.badge-holder-spot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 140px;
}

.badge-bubble {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--text-color);
  background-color: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  box-shadow: inset 0 4px 8px rgba(0,0,0,0.05);
}

.badge-bubble.earned {
  background-color: var(--warning-color);
  border-color: var(--warning-color-dark);
  box-shadow: 0 8px 16px rgba(243, 186, 57, 0.2);
  animation: pulse-glow 2s infinite;
}

.badge-bubble.locked {
  filter: grayscale(1);
  opacity: 0.4;
}

.badge-name-lbl {
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

/* Certificate Layout */
.diploma-card-wrapper {
  background-color: #FFFDF0;
  border: 12px double #D69E2E;
  border-radius: var(--radius-md);
  padding: 3rem 2rem;
  text-align: center;
  max-width: 650px;
  margin: 2rem auto;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  position: relative;
}

.diploma-card-wrapper::after {
  content: "🛡️";
  position: absolute;
  font-size: 7rem;
  opacity: 0.04;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.diploma-header {
  font-size: 2rem;
  color: #B7791F;
  margin-bottom: 1.5rem;
  font-weight: 700;
  border-bottom: 2px solid #ECC94B;
  display: inline-block;
  padding-bottom: 5px;
}

.diploma-body p {
  font-size: 1.25rem;
  margin-bottom: 1.2rem;
  line-height: 1.8;
}

.student-name-field {
  font-size: 2.2rem;
  color: var(--primary-color-dark);
  font-weight: 700;
  margin: 1.5rem 0;
  text-decoration: underline;
  text-decoration-style: double;
}

.diploma-footer {
  margin-top: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 2rem;
}

.diploma-stamp {
  font-size: 3.5rem;
  line-height: 1;
}

.diploma-sign {
  border-top: 2px solid var(--text-color);
  padding-top: 5px;
  width: 150px;
  font-size: 0.95rem;
  text-align: center;
  font-weight: 700;
}

.cert-locked-message {
  text-align: center;
  padding: 2rem;
  background-color: #FAF8F2;
  border: 2px dashed var(--text-muted);
  border-radius: var(--radius-lg);
}

/* ==========================================================================
   Animations & Transitions
   ========================================================================== */

@keyframes floating {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

@keyframes bounce {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-10px); }
}

@keyframes scaleUp {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0px rgba(177, 159, 251, 0.7); }
  100% { box-shadow: 0 0 0 15px rgba(177, 159, 251, 0); }
}

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

@keyframes shake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translate(-3px, 0px) rotate(1deg); }
  30% { transform: translate(0px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  70% { transform: translate(2px, 1px) rotate(-1deg); }
  80% { transform: translate(-1px, -1px) rotate(1deg); }
  90% { transform: translate(2px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.shake-anim {
  animation: shake 0.5s;
  animation-iteration-count: 1;
}

/* Water Absorption Custom Animations */
@keyframes drop-and-absorb {
  0% { transform: scale(0.5) translateY(-40px); opacity: 0; }
  30% { transform: scale(1.2) translateY(0); opacity: 1; }
  60% { transform: scale(1) translateY(0); opacity: 0.8; }
  100% { transform: scale(2.5) translateY(0); opacity: 0; filter: blur(4px); }
}

@keyframes drop-and-roll {
  0% { transform: scale(0.5) translateY(-40px); opacity: 0; }
  30% { transform: scale(1) translateY(0); opacity: 1; }
  50% { transform: scale(1) translateY(0) translateX(20px); opacity: 1; }
  100% { transform: scale(0.9) translateY(40px) translateX(60px); opacity: 0; }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  h3 { font-size: 1.3rem; }
  
  .header-container {
    flex-direction: column;
    gap: 10px;
    padding: 1rem;
  }
  
  .nav-links {
    width: 100%;
    justify-content: center;
    gap: 8px;
  }
  
  .nav-item {
    font-size: 0.95rem;
    padding: 0.4rem 0.8rem;
  }

  .welcome-banner {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }

  .mascot-mascot-landing {
    width: 100px;
    height: 100px;
  }

  .chapters-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .baskets-container {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .basket-dropzone {
    min-height: 180px;
    padding: 1rem;
  }

  .lab-workspace, .mixer-workspace {
    grid-template-columns: 1fr;
  }

  .lab-shelf, .shelf-ingredients {
    order: 2;
  }

  .lab-table, .mixer-area {
    order: 1;
    height: auto;
    min-height: 250px;
  }

  .diploma-footer {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .diploma-sign {
    width: 80%;
  }

  .lesson-page-container {
    padding: 1.5rem;
  }

  .tabs-navigation {
    flex-direction: column;
    gap: 5px;
  }

  .tab-btn {
    padding: 0.6rem;
    font-size: 1rem;
  }
}

/* ==========================================================================
   Print Styles for Certificates
   ========================================================================== */

@media print {
  body {
    background: none !important;
    background-image: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 14pt !important;
  }
  
  .app-header,
  .app-footer,
  .back-to-home-link,
  .badge-status-board,
  .diploma-settings-card,
  h2, p {
    display: none !important;
  }
  
  .app-main {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  
  #app-content-root {
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .diploma-card-wrapper {
    border: 12px double #D69E2E !important;
    box-shadow: none !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 650px !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    page-break-inside: avoid !important;
    background-color: #FFFDF0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

