/* ============================================================
   EKO FARKINDALIK | ECO AWARENESS — game.css
   ============================================================ */

:root {
  --g-green: #2d7a4f;
  --g-green-light: #4caf7d;
  --g-green-pale: #a8d5b5;
  --g-orange: #e65100;
  --g-orange-light: #ff8f00;
  --g-brown: #5d4037;
  --g-brown-light: #8d6e63;
  --g-blue: #1565c0;
  --g-blue-light: #42a5f5;
  --g-white: #ffffff;
  --g-dark: #2c3e50;
  --g-glass: rgba(255, 255, 255, 0.9);
  --g-glass-dark: rgba(44, 62, 80, 0.95);
  --g-shadow: 0 10px 30px rgba(45, 122, 79, 0.08);
  --g-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ── Section Container ───────────────────────────────────────── */
#game-section {
  background: linear-gradient(135deg, #f1f8e9 0%, #e8f5e9 50%, #e0f2f1 100%);
  padding: 100px 0;
  position: relative;
  overflow: hidden;
}

#game-section .section-badge {
  background: rgba(76, 175, 125, 0.12);
  color: var(--g-green);
}

#game-section .section-title {
  color: var(--g-green-dark);
}

#game-section .section-line {
  background: linear-gradient(90deg, var(--g-green), var(--g-green-light));
}

/* ── Dashboard Stats Bar ─────────────────────────────────────── */
.game-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  background: var(--g-glass);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(76, 175, 125, 0.2);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 40px;
  box-shadow: var(--g-shadow);
  animation: fade-up 0.8s ease;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.stat-item:last-child {
  border-right: none;
}

.stat-icon-wrapper {
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: float 4s ease-in-out infinite;
}

.stat-details h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-mid);
  margin-bottom: 4px;
}

.stat-details p {
  font-family: 'Raleway', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--g-dark);
}

.stat-details p span {
  font-size: 1.5rem;
  color: var(--g-green);
}

/* Coin animation when updated */
@keyframes coin-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); color: var(--g-orange-light); }
  100% { transform: scale(1); }
}

.coin-animate {
  animation: coin-pulse 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ── Tabs Navigation ─────────────────────────────────────────── */
.game-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.tab-btn {
  background: var(--g-white);
  border: 1px solid rgba(76, 175, 125, 0.2);
  color: var(--g-dark);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 30px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
  transition: var(--g-transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  background: var(--g-green-pale);
  color: var(--g-green);
  transform: translateY(-2px);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--g-green), var(--g-green-light));
  color: var(--g-white);
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(76, 175, 125, 0.3);
}

/* ── Tab Panels ──────────────────────────────────────────────── */
.tab-content {
  background: var(--g-white);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--g-shadow);
  border: 1px solid rgba(76, 175, 125, 0.1);
  min-height: 480px;
  position: relative;
  overflow: hidden;
}

.tab-panel {
  display: none;
  animation: fade-in-slide 0.5s ease forwards;
}

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

@keyframes fade-in-slide {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── GAME 1: QUIZ STYLES ─────────────────────────────────────── */
.quiz-categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.category-card {
  background: linear-gradient(145deg, #ffffff, #f9fbf9);
  border: 1px solid rgba(76, 175, 125, 0.15);
  border-radius: var(--radius-md);
  padding: 30px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--g-transition);
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(45, 122, 79, 0.1);
  border-color: var(--g-green-light);
}

.cat-icon {
  font-size: 2.8rem;
  margin-bottom: 16px;
  display: inline-block;
  transition: transform 0.5s ease;
}

.category-card:hover .cat-icon {
  transform: scale(1.15) rotate(5deg);
}

.cat-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--g-dark);
  margin-bottom: 8px;
}

.cat-title-en {
  font-size: 0.8rem;
  color: var(--gray-mid);
  margin-bottom: 14px;
  font-style: italic;
}

.cat-status {
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
  background: rgba(0, 0, 0, 0.05);
  color: var(--gray-mid);
  font-weight: 500;
}

.cat-status.completed {
  background: rgba(76, 175, 125, 0.12);
  color: var(--g-green);
}

/* Active Quiz Layout */
.quiz-active-container {
  max-width: 700px;
  margin: 0 auto;
}

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

.quiz-back-btn {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--g-green);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--g-transition);
}

.quiz-back-btn:hover {
  color: var(--g-green-light);
  transform: translateX(-3px);
}

.quiz-progress-txt {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-mid);
}

.quiz-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  margin-bottom: 36px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--g-green), var(--g-green-light));
  width: 0%;
  border-radius: 10px;
  transition: width 0.4s ease;
}

.quiz-question-box {
  background: #fcfdfe;
  border: 1px solid rgba(76, 175, 125, 0.1);
  border-radius: var(--radius-md);
  padding: 36px;
  margin-bottom: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  text-align: center;
}

.quiz-question-tr {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--g-dark);
  line-height: 1.5;
  margin-bottom: 12px;
}

.quiz-question-en {
  font-size: 1.05rem;
  color: var(--gray-mid);
  font-style: italic;
  line-height: 1.5;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.quiz-option-btn {
  background: var(--g-white);
  border: 2px solid rgba(76, 175, 125, 0.2);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--g-dark);
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
  transition: var(--g-transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.quiz-option-btn:hover {
  border-color: var(--g-green-light);
  background: rgba(76, 175, 125, 0.02);
  transform: translateY(-2px);
}

.quiz-option-btn.correct {
  background: #e8f5e9 !important;
  border-color: var(--g-green-light) !important;
  color: var(--g-green) !important;
}

.quiz-option-btn.incorrect {
  background: #ffebee !important;
  border-color: #ef5350 !important;
  color: #c62828 !important;
}

/* Quiz Results Screen */
.quiz-results-container {
  text-align: center;
  max-width: 650px;
  margin: 0 auto;
}

.results-circle {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 24px;
}

.results-circle-svg {
  transform: rotate(-90deg);
}

.results-circle-bg {
  fill: none;
  stroke: rgba(0,0,0,0.05);
  stroke-width: 12;
}

.results-circle-fill {
  fill: none;
  stroke: var(--g-green);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 440;
  transition: stroke-dashoffset 1s ease-out;
}

.results-circle-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.results-score-big {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--g-dark);
  line-height: 1;
}

.results-score-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-mid);
  margin-top: 4px;
}

.results-coins-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 143, 0, 0.12);
  color: #ff6f00;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 10px 24px;
  border-radius: 30px;
  margin-bottom: 24px;
  box-shadow: 0 4px 10px rgba(255, 143, 0, 0.05);
}

.results-summary-text {
  font-size: 1.1rem;
  color: var(--gray-dark);
  margin-bottom: 30px;
  line-height: 1.6;
}

.mistakes-review-box {
  text-align: left;
  background: #f8faf8;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 30px;
}

.mistakes-title {
  font-size: 1rem;
  font-weight: 700;
  color: #c62828;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mistake-item {
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.mistake-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.mistake-q {
  font-weight: 600;
  color: var(--g-dark);
  margin-bottom: 6px;
}

.mistake-answers {
  font-size: 0.85rem;
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ans-wrong { color: #d32f2f; font-weight: 500; }
.ans-right { color: #388e3c; font-weight: 500; }

.mistake-explanation {
  font-size: 0.85rem;
  color: var(--gray-mid);
  line-height: 1.5;
  background: #fff;
  border-left: 3px solid var(--g-green-light);
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
}

.learning-tips-box {
  background: rgba(66, 165, 245, 0.08);
  border-left: 4px solid var(--g-blue-light);
  border-radius: 0 12px 12px 0;
  padding: 20px;
  text-align: left;
  margin-bottom: 30px;
}

.tips-title {
  font-weight: 700;
  color: var(--g-blue);
  margin-bottom: 8px;
}

.tips-list {
  font-size: 0.88rem;
  color: var(--gray-dark);
  line-height: 1.6;
  padding-left: 20px;
  list-style-type: disc;
}

.quiz-action-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* ── GAME 2: RECYCLING GAME STYLES ──────────────────────────── */
.recycling-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  align-items: start;
}

.recycling-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.item-source-panel {
  background: #f8faf8;
  border: 2px dashed rgba(76, 175, 125, 0.25);
  border-radius: var(--radius-md);
  padding: 30px;
  text-align: center;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.item-source-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-mid);
  margin-bottom: 20px;
}

.recycling-item-card {
  background: var(--g-white);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  padding: 24px;
  width: 200px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  cursor: grab;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  user-select: none;
  position: relative;
  touch-action: none;
}

.recycling-item-card:active {
  cursor: grabbing;
}

.recycling-item-card.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.recycling-item-card.selected {
  outline: 3px solid var(--g-blue-light);
  box-shadow: 0 0 20px rgba(66, 165, 245, 0.3);
}

.waste-emoji {
  font-size: 3.5rem;
  animation: float 3s ease-in-out infinite;
}

.waste-name-tr {
  font-weight: 700;
  color: var(--g-dark);
}

.waste-name-en {
  font-size: 0.8rem;
  color: var(--gray-mid);
  font-style: italic;
}

.recycling-bins-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.recycling-bin {
  background: var(--g-white);
  border: 2px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  transition: var(--g-transition);
  position: relative;
  overflow: hidden;
}

.recycling-bin::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
}

.recycling-bin.bin-plastic::after { background: #4caf50; }
.recycling-bin.bin-glass::after   { background: #2196f3; }
.recycling-bin.bin-paper::after   { background: #795548; }

.recycling-bin.drag-over {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.recycling-bin.bin-plastic.drag-over { border-color: #4caf50; background: rgba(76, 175, 80, 0.04); }
.recycling-bin.bin-glass.drag-over   { border-color: #2196f3; background: rgba(33, 150, 243, 0.04); }
.recycling-bin.bin-paper.drag-over   { border-color: #795548; background: rgba(121, 85, 72, 0.04); }

.bin-emoji {
  font-size: 2.8rem;
}

.bin-details h4 {
  font-family: 'Raleway', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--g-dark);
}

.bin-details p {
  font-size: 0.8rem;
  color: var(--gray-mid);
}

.bin-indicator {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--gray-mid);
  transition: var(--g-transition);
}

.recycling-bin.drag-over .bin-indicator {
  transform: scale(1.2);
  background: var(--g-green);
  color: white;
}

.recycling-instruction {
  font-size: 0.85rem;
  color: var(--gray-mid);
  line-height: 1.6;
  text-align: center;
  background: #f8faf8;
  padding: 12px;
  border-radius: 8px;
}

/* Flying Score indicator */
.flying-feedback {
  position: absolute;
  font-weight: 800;
  font-size: 1.8rem;
  pointer-events: none;
  z-index: 100;
  animation: fly-up-fade 0.9s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.flying-feedback.plus { color: #4caf50; }
.flying-feedback.minus { color: #f44336; }

@keyframes fly-up-fade {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  20% { opacity: 1; transform: translateY(-20px) scale(1.1); }
  100% { transform: translateY(-70px) scale(0.9); opacity: 0; }
}

/* Recycling Result Layout */
.recycling-results-container {
  text-align: center;
  max-width: 650px;
  margin: 0 auto;
}

/* ── 🌱 TREE DONATION STYLES ─────────────────────────────────── */
.donation-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
}

.donation-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.donation-card {
  background: #fff;
  border: 1px solid rgba(76, 175, 125, 0.15);
  border-radius: var(--radius-md);
  padding: 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
  transition: var(--g-transition);
}

.donation-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(45, 122, 79, 0.06);
  border-color: var(--g-green-light);
}

.donation-card-icon {
  font-size: 2.5rem;
}

.donation-card-details h4 {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--g-dark);
  margin-bottom: 4px;
}

.donation-card-details p {
  font-size: 0.82rem;
  color: var(--gray-mid);
}

.donation-cost-badge {
  background: rgba(255, 143, 0, 0.12);
  color: #ff6f00;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: 20px;
  display: inline-block;
  margin-top: 4px;
}

.donate-action-btn {
  background: var(--g-green);
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 10px 18px;
  border-radius: 24px;
  box-shadow: 0 4px 10px rgba(45, 122, 79, 0.2);
  transition: var(--g-transition);
}

.donate-action-btn:hover {
  background: var(--g-green-light);
  transform: scale(1.05);
}

.donate-action-btn:disabled {
  background: var(--gray-light);
  color: rgba(255, 255, 255, 0.7);
  box-shadow: none;
  cursor: not-allowed;
}

/* Virtual Forest Map Container */
.forest-visualizer {
  background: linear-gradient(to bottom, #b3e5fc 0%, #e8f5e9 60%, #c8e6c9 100%);
  border: 1px solid rgba(76, 175, 125, 0.2);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.05);
}

.forest-canvas-container {
  position: relative;
  flex-grow: 1;
  width: 100%;
}

.forest-clouds-anim {
  position: absolute;
  top: 15px; left: 0; right: 0;
  height: 50px;
  pointer-events: none;
}

.cloud-item {
  font-size: 1.8rem;
  position: absolute;
  opacity: 0.45;
  animation: float-cloud 24s linear infinite;
}

@keyframes float-cloud {
  from { left: -50px; }
  to { left: 100%; }
}

.forest-grid-overlay {
  position: absolute;
  bottom: 10px;
  left: 0; right: 0;
  height: 220px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 12px;
}

.forest-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.forest-tree-sprout {
  font-size: 2.2rem;
  position: absolute;
  bottom: 0;
  transform-origin: bottom center;
  animation: tree-grow-pop 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes tree-grow-pop {
  0% { transform: scale(0) rotate(-15deg); opacity: 0; }
  40% { transform: scale(0.6) rotate(10deg); opacity: 0.8; }
  70% { transform: scale(1.1) rotate(-5deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.forest-meter-panel {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(76, 175, 125, 0.15);
  border-radius: var(--radius-md);
  padding: 16px;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.forest-meter-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--g-dark);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.forest-meter-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  overflow: hidden;
}

.forest-meter-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--g-green), var(--g-green-light));
  width: 0%;
  border-radius: 10px;
  transition: width 0.6s ease;
}

.forest-quote-panel {
  font-family: 'Raleway', sans-serif;
  text-align: center;
  font-size: 0.9rem;
  color: var(--g-green-dark);
  font-weight: 600;
  font-style: italic;
  margin-top: 12px;
}

/* ── 💬 COMMUNITY CHAT AREA STYLES ──────────────────────────── */
.chat-wrapper {
  max-width: 800px;
  margin: 0 auto;
  border: 1px solid rgba(76, 175, 125, 0.15);
  border-radius: var(--radius-lg);
  background: #f8faf8;
  overflow: hidden;
  box-shadow: var(--g-shadow);
}

.chat-header {
  background: linear-gradient(135deg, var(--g-green-dark), var(--g-green));
  color: white;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h3 {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-online-badge {
  font-size: 0.8rem;
  background: rgba(255,255,255,0.15);
  padding: 4px 12px;
  border-radius: 20px;
}

.chat-messages-container {
  height: 380px;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #ffffff;
}

.chat-msg-row {
  display: flex;
  gap: 12px;
  max-width: 75%;
}

.chat-msg-row.sent {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg-row.received {
  align-self: flex-start;
}

.chat-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--g-green-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.chat-msg-row.sent .chat-msg-avatar {
  background: rgba(255, 143, 0, 0.15);
}

.chat-msg-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-msg-meta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-mid);
  display: flex;
  gap: 8px;
}

.chat-msg-row.sent .chat-msg-meta {
  justify-content: flex-end;
}

.chat-msg-bubble {
  background: #eceff1;
  color: var(--g-dark);
  padding: 12px 16px;
  border-radius: 18px;
  border-top-left-radius: 2px;
  font-size: 0.9rem;
  line-height: 1.5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.chat-msg-row.sent .chat-msg-bubble {
  background: linear-gradient(135deg, var(--g-green), var(--g-green-light));
  color: white;
  border-radius: 18px;
  border-top-right-radius: 2px;
  box-shadow: 0 4px 10px rgba(76, 175, 125, 0.15);
}

.chat-input-area {
  background: #f8faf8;
  border-top: 1px solid rgba(76, 175, 125, 0.12);
  padding: 16px 24px;
}

.chat-nickname-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.chat-nickname-input {
  background: white;
  border: 1px solid rgba(76, 175, 125, 0.2);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--g-dark);
  width: 200px;
}

.chat-nickname-input:focus {
  outline: none;
  border-color: var(--g-green);
}

.chat-text-row {
  display: flex;
  gap: 12px;
}

.chat-text-input {
  flex-grow: 1;
  background: white;
  border: 1px solid rgba(76, 175, 125, 0.2);
  border-radius: 24px;
  padding: 12px 20px;
  font-size: 0.9rem;
  color: var(--g-dark);
}

.chat-text-input:focus {
  outline: none;
  border-color: var(--g-green);
}

.chat-send-btn {
  background: linear-gradient(135deg, var(--g-green), var(--g-green-light));
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(76, 175, 125, 0.2);
  transition: var(--g-transition);
}

.chat-send-btn:hover {
  transform: scale(1.05);
}

.chat-warning-msg {
  color: #d32f2f;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 6px;
  display: none;
}

/* ── 🏆 CERTIFICATE SYSTEM STYLES ───────────────────────────── */
.certificate-tab-container {
  max-width: 800px;
  margin: 0 auto;
}

.cert-locked-overlay {
  text-align: center;
  padding: 60px 40px;
}

.cert-lock-icon {
  font-size: 4rem;
  margin-bottom: 24px;
  color: var(--gray-light);
  animation: float 4s ease-in-out infinite;
}

.cert-locked-overlay h3 {
  font-family: 'Raleway', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--g-dark);
  margin-bottom: 12px;
}

.cert-locked-overlay p {
  font-size: 0.95rem;
  color: var(--gray-mid);
  max-width: 500px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

.cert-unlock-progress {
  max-width: 400px;
  margin: 0 auto;
  background: #f8faf8;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: var(--radius-md);
  padding: 20px;
}

.cert-progress-line {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--g-dark);
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.cert-progress-bullet {
  color: #c62828;
}

.cert-progress-bullet.done {
  color: var(--g-green);
}

/* Unlocked Certificate Form */
.cert-form-box {
  background: #f8faf8;
  border: 1px solid rgba(76, 175, 125, 0.15);
  border-radius: var(--radius-md);
  padding: 30px;
  margin-bottom: 40px;
}

.cert-form-title {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--g-green-dark);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cert-form-title span {
  animation: pulse 1.5s infinite;
}

.cert-form-subtitle {
  font-size: 0.88rem;
  color: var(--gray-mid);
  margin-bottom: 24px;
}

.cert-inputs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.cert-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cert-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--g-dark);
}

.cert-field input {
  background: white;
  border: 1px solid rgba(76, 175, 125, 0.2);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.88rem;
  color: var(--g-dark);
}

.cert-field input:focus {
  outline: none;
  border-color: var(--g-green);
}

.cert-generate-btn {
  background: linear-gradient(135deg, var(--g-orange), var(--g-orange-light));
  color: white;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 30px;
  font-size: 0.95rem;
  box-shadow: 0 6px 18px rgba(230, 81, 0, 0.25);
  transition: var(--g-transition);
  width: 100%;
}

.cert-generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(230, 81, 0, 0.35);
}

/* Certificate Visual Preview Document */
.cert-preview-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
  pointer-events: none;
  height: 0;
  overflow: hidden;
}

.cert-preview-shell.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  height: auto;
  overflow: visible;
}

.cert-print-container {
  width: 100%;
  max-width: 800px;
  aspect-ratio: 1.414 / 1; /* A4 Landscape Ratio */
  background: var(--g-white);
  border: 18px double var(--g-green-dark);
  outline: 4px solid var(--g-green-pale);
  outline-offset: -12px;
  border-radius: 4px;
  position: relative;
  padding: 30px 48px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

/* Mascots, Leaves, & Illustrations Placement in Certificate */
.cert-bg-decor {
  position: absolute;
  pointer-events: none;
  user-select: none;
}

.cert-decor-top-left { top: 20px; left: 20px; font-size: 2.2rem; opacity: 0.85; }
.cert-decor-top-right { top: 20px; right: 20px; font-size: 2.2rem; opacity: 0.85; }
.cert-decor-bottom-left { bottom: 20px; left: 20px; font-size: 2.2rem; opacity: 0.85; }
.cert-decor-bottom-right { bottom: 20px; right: 20px; font-size: 2.2rem; opacity: 0.85; }

.cert-decor-center-watermark {
  font-size: 14rem;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.035;
}

.cert-mascot-1 { bottom: 40px; left: 80px; font-size: 2.5rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }
.cert-mascot-2 { bottom: 40px; right: 80px; font-size: 2.5rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }

.cert-header-title {
  text-align: center;
  margin-top: 15px;
}

.cert-logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--g-green);
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cert-main-badge {
  background: rgba(76, 175, 125, 0.1);
  border: 1px solid rgba(76, 175, 125, 0.25);
  color: var(--g-green-dark);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 4px 16px;
  border-radius: 20px;
  display: inline-block;
}

.cert-achievement-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.3rem;
  font-weight: 900;
  color: var(--g-green-dark);
  text-shadow: 0 1px 2px rgba(0,0,0,0.05);
  letter-spacing: 0.03em;
  margin-top: 12px;
}

.cert-recipient-label {
  font-size: 0.8rem;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 14px;
}

.cert-recipient-name {
  font-family: 'Playfair Display', serif;
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--g-orange);
  border-bottom: 2px solid var(--g-green-pale);
  padding: 4px 40px;
  margin-top: 6px;
  display: inline-block;
  min-width: 320px;
  text-align: center;
}

.cert-description-text {
  font-size: 0.88rem;
  color: var(--gray-dark);
  line-height: 1.6;
  max-width: 580px;
  text-align: center;
  margin-top: 15px;
}

.cert-footer-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 25px;
  padding: 0 40px;
}

.cert-sign-box, .cert-date-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.cert-sign-line {
  border-top: 1px solid var(--gray-light);
  width: 150px;
  text-align: center;
  padding-top: 6px;
  font-size: 0.75rem;
  color: var(--gray-mid);
}

.cert-sign-img {
  font-family: 'Raleway', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--g-green);
  opacity: 0.7;
  font-style: italic;
  margin-bottom: 4px;
}

.cert-seal {
  font-size: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: rotate-slow 30s linear infinite;
}

@keyframes rotate-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.cert-print-btn {
  background: linear-gradient(135deg, var(--g-green), var(--g-green-light));
  color: white;
  font-weight: 700;
  padding: 12px 30px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(76,175,125,0.3);
  transition: var(--g-transition);
}

.cert-print-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(76,175,125,0.45);
}

/* ── Floating Decorations ────────────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ── Responsive Styling ──────────────────────────────────────── */
@media (max-width: 992px) {
  .quiz-categories { grid-template-columns: 1fr 1fr; }
  .recycling-container { grid-template-columns: 1fr; gap: 30px; }
  .donation-grid { grid-template-columns: 1fr; gap: 30px; }
  .game-stats-bar { grid-template-columns: 1fr 1fr; gap: 15px; }
  .stat-item { border-right: none; border-bottom: 1px solid rgba(0,0,0,0.05); padding-bottom: 12px; }
  .stat-item:nth-child(3), .stat-item:nth-child(4) { border-bottom: none; padding-bottom: 0; }
}

@media (max-width: 768px) {
  .quiz-categories { grid-template-columns: 1fr; }
  .cert-inputs-grid { grid-template-columns: 1fr; gap: 12px; }
  .quiz-options { grid-template-columns: 1fr; }
  .tab-content { padding: 24px; }
  .cert-preview-shell { transform: none; }
  .cert-print-container {
    padding: 20px 24px;
    border-width: 10px;
    aspect-ratio: auto;
    height: auto;
  }
  .cert-achievement-title { font-size: 1.5rem; }
  .cert-recipient-name { font-size: 1.4rem; min-width: 200px; padding: 2px 20px; }
  .cert-description-text { font-size: 0.78rem; }
  .cert-footer-row { padding: 0 10px; flex-direction: column; gap: 15px; align-items: center; text-align: center; }
  .cert-mascot-1, .cert-mascot-2 { display: none; }
}

/* ── 🖨️ PRINT STYLE OVERRIDES ─────────────────────────────────── */
@media print {
  body * {
    visibility: hidden;
  }
  #game-section, .cert-print-container, .cert-print-container * {
    visibility: visible;
  }
  .cert-print-container {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    border: 24px double #1a4731 !important;
    outline: 4px solid #a8d5b5 !important;
    box-shadow: none !important;
    page-break-after: avoid;
    page-break-inside: avoid;
    transform: none !important;
    margin: 0 !important;
    padding: 40px !important;
  }
  .cert-print-btn, .game-stats-bar, .game-tabs, .cert-form-box, nav, footer, #sound-player, #page-transition {
    display: none !important;
  }
}
