/* Top Panel Controls and Dashboard (matching tower-blocks) */
.game-info {
  display: flex;
  align-items: center;
  gap: 32px;
  justify-content: center;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 14px 0;
  box-shadow: 0 1px 8px rgba(102,126,234,0.10);
  width: 100%;
  margin-left: 0;
}
.game-info .stat-label, .game-info label { color: #fff; }
.game-info .stat-value, .game-info select, .game-info button { color: #fff; }
.game-info select {
  background: linear-gradient(90deg, #6a82fb 0%, #fc5c7d 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 1em;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  box-shadow: 0 2px 8px rgba(102,126,234,0.10);
}
.game-info select option {
  background: #6a82fb;
  color: #fff;
}
.game-info button { box-shadow: 0 2px 8px rgba(102,126,234,0.10); }
.control-group { display: flex; align-items: center; gap: 10px; }
.stats { display: flex; align-items: center; gap: 24px; }
.stat-item { display: flex; align-items: center; gap: 6px; font-size: 1.1em; }
.stat-label { color: #667eea; font-weight: bold; }
.stat-value { color: #333; font-weight: bold; }
.reset-btn { background: linear-gradient(90deg, #6a82fb 0%, #fc5c7d 100%); color: #fff; border: none; border-radius: 12px; padding: 8px 22px; font-size: 1em; cursor: pointer; margin-left: 12px; transition: background 0.2s; }
.reset-btn:hover { background: linear-gradient(90deg, #fc5c7d 0%, #6a82fb 100%); }
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f9f9f9;
}
.panel-card, .game-info, .dashboard, .stats, .stat-item, .middle-panel, .left-panel, .right-panel, .ad-container, .ad-placeholder, #quiz-container, #question-area, #options-area, #result-area {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}
@media (max-width: 900px) {
  .main-header {
    padding: 0 0 0 0;
  }
  .header-content {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 8px;
  }
  .site-title {
    font-size: 1.3em;
    margin-bottom: 8px;
  }
  .main-nav {
    flex-direction: column;
    width: 100%;
    align-items: flex-start;
    gap: 0;
    position: relative;
  }
  .nav-link, .nav-dropdown {
    width: 100%;
    text-align: left;
    padding: 10px 0;
    font-size: 1em;
  }
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    background: none;
    padding-left: 16px;
    width: 100%;
    display: none;
  }
  .nav-dropdown.open .nav-dropdown-menu {
    display: block;
  }
  .nav-dropdown-toggle {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-size: 1em;
    padding: 10px 0;
    cursor: pointer;
  }
  .nav-dropdown-item {
    padding: 8px 0 8px 18px;
    font-size: 0.98em;
    width: 100%;
    display: block;
  }
  .main-nav.mobile-active {
    display: flex;
  }
  .mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.7em;
    color: #667eea;
    position: absolute;
    right: 16px;
    top: -4px;
    z-index: 2001;
  }
}

@media (max-width: 600px) {
  .game-info {
    flex-direction: column;
    gap: 12px;
    padding: 10px 4px;
    font-size: 0.98em;
    border-radius: 8px;
    width: 100%;
    margin-left: 0;
  }
  .stats {
    flex-direction: column;
    gap: 10px;
    width: 100%;
    align-items: stretch;
  }
  .control-group {
    flex-direction: column;
    gap: 8px;
    width: 100%;
    align-items: stretch;
  }
  .reset-btn {
    width: 100%;
    margin-left: 0;
    padding: 10px 0;
    font-size: 1em;
  }
  .main-header {
    padding: 0;
  }
  .header-content {
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 4px;
  }
  .site-title {
    font-size: 1.1em;
    margin-bottom: 6px;
  }
  .main-nav {
    flex-direction: column;
    width: 100%;
    align-items: flex-start;
    gap: 0;
    position: relative;
  }
  .nav-link, .nav-dropdown {
    width: 100%;
    text-align: left;
    padding: 8px 0;
    font-size: 0.98em;
  }
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    background: none;
    padding-left: 12px;
    width: 100%;
    display: none;
  }
  .nav-dropdown.open .nav-dropdown-menu {
    display: block;
  }
  .nav-dropdown-toggle {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-size: 0.98em;
    padding: 8px 0;
    cursor: pointer;
  }
  .nav-dropdown-item {
    padding: 7px 0 7px 16px;
    font-size: 0.97em;
    width: 100%;
    display: block;
  }
  .main-nav.mobile-active {
    display: flex;
  }
  .mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.5em;
    color: #667eea;
    position: absolute;
    right: 16px;
    top: -4px;
    z-index: 2001;
  }
}

/* Hide mobile menu toggle by default */
.mobile-menu-toggle {
  display: none;
}
/* Panel, Dashboard, and Layout Styles (matching tower-blocks) */
.game-layout { display: flex; gap: 20px; align-items: flex-start; }
.left-panel { width: 280px; display: flex; flex-direction: column; gap: 15px; }
.panel-card { background: white; padding: 20px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.panel-card h2 { color: #667eea; font-size: 24px; margin: 0 0 10px; text-align: center; }
.panel-card h3 { color: #667eea; font-size: 18px; margin: 0 0 15px; }
.game-description { text-align: center; color: #666; font-size: 14px; margin: 0; }
.instructions-list { list-style: none; padding: 0; margin: 0; }
.instructions-list li { padding: 10px; margin-bottom: 8px; background: linear-gradient(135deg,#f8f9fa 0%,#e9ecef 100%); border-radius: 8px; font-size: 14px; border-left: 4px solid #667eea; }
.middle-panel { flex: 1; background: white; padding: 20px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; min-height: 480px; }
.right-panel { width: 220px; display: flex; flex-direction: column; gap: 15px; }
.ad-container { background: white; padding: 15px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); height: 100px; margin-bottom: 10px; }
.ad-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg,#667eea 0%,#764ba2 100%); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 14px; }
.dashboard { display: flex; gap: 24px; align-items: center; justify-content: center; margin-bottom: 18px; font-size: 1.1em; background: #f8f9fa; border-radius: 10px; padding: 12px 0; box-shadow: 0 1px 4px rgba(0,0,0,0.04); width: 100%; }
.reset-btn { background: linear-gradient(90deg, #6a82fb 0%, #fc5c7d 100%); color: #fff; border: none; border-radius: 12px; padding: 8px 22px; font-size: 1em; cursor: pointer; margin-left: 12px; transition: background 0.2s; }
.reset-btn:hover { background: linear-gradient(90deg, #fc5c7d 0%, #6a82fb 100%); }
.stat-label { color: #667eea; font-weight: bold; }
.stat-value { color: #333; font-weight: bold; }
@media (max-width: 900px) {
  .game-layout { flex-direction: column; }
  .left-panel, .right-panel { width: 100%; }
  .middle-panel { min-height: 320px; }
}
/* Best Celebration Modal Styles */
#celebration-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 50% 30%, #fffbe7 0%, #ffe0f7 60%, #b3e5fc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: modalFadeIn 0.7s;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.best-modal {
  background: rgba(255,255,255,0.98);
  border-radius: 32px;
  padding: 48px 36px 36px 36px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  position: relative;
  min-width: 340px;
  min-height: 340px;
  overflow: visible;
  animation: popIn 0.8s cubic-bezier(.68,-0.55,.27,1.55);
}
.fireworks-bg {
  position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}
.firework {
  position: absolute;
  width: 120px;
  height: 120px;
  top: 10px;
  left: 10px;
  opacity: 0.85;
  animation: firework-burst 1.2s infinite alternate;
}
.firework:nth-child(2) {
  left: 60px;
  top: 30px;
  animation-delay: 0.5s;
}
@keyframes firework-burst {
  0% { transform: scale(0.7) rotate(0deg); opacity: 0.7; }
  60% { opacity: 1; }
  100% { transform: scale(1.1) rotate(20deg); opacity: 0.9; }
}
.trophy-container {
  margin: 0 auto 18px auto;
  z-index: 2;
}
.trophy-img {
  width: 90px;
  max-width: 30vw;
  filter: drop-shadow(0 6px 18px #ffd70088);
  animation: trophy-pop 1.2s cubic-bezier(.68,-0.55,.27,1.55);
  display: block;
  margin: 0 auto;
}

/* Ensure SVG trophy displays correctly */
.trophy-img svg {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 600px) {
  .trophy-img {
    width: 60px;
    max-width: 22vw;
    margin-bottom: 10px;
  }
  .trophy-img svg {
    width: 100%;
    height: auto;
  }
}

@keyframes trophy-pop {
  0% { transform: scale(0.5) rotate(-20deg); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: scale(1.1) rotate(0deg); opacity: 1; }
}
.congrats-title {
  font-size: 2.2em;
  color: #ff9800;
  margin-bottom: 0.2em;
  font-family: 'Comic Sans MS', cursive, sans-serif;
  letter-spacing: 1px;
  z-index: 2;
}
.congrats-text {
  font-size: 1.3em;
  color: #6a1b9a;
  margin-bottom: 1.2em;
  z-index: 2;
}
.emoji {
  font-size: 2em;
  display: block;
  margin-top: 0.2em;
}
.close-btn {
  background: linear-gradient(90deg, #6a82fb 0%, #fc5c7d 100%);
  color: #fff;
  border: none;
  border-radius: 16px;
  padding: 14px 38px;
  font-size: 1.1em;
  cursor: pointer;
  margin-top: 18px;
  transition: background 0.2s;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.close-btn:hover {
  background: linear-gradient(90deg, #fc5c7d 0%, #6a82fb 100%);
}
/* Flower Shower Animation */
.flower-shower {
  position: absolute;
  left: 0; right: 0; top: 0; height: 0;
  width: 100%;
  pointer-events: none;
  z-index: 2;
}
.flower-piece {
  position: absolute;
  top: 0;
  width: 40px;
  height: 40px;
  opacity: 0.85;
  animation: flower-fall 2.8s cubic-bezier(.68,-0.55,.27,1.55) forwards;
}
@keyframes flower-fall {
  0% { transform: translateY(-60px) scale(0.8) rotate(0deg); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(260px) scale(1.1) rotate(360deg); opacity: 0; }
}
/* Paper Pieces Blast (Confetti) Enhancement */
.confetti-piece {
  position: absolute;
  top: 0;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  opacity: 0.85;
  animation: confetti-fall 2.2s cubic-bezier(.68,-0.55,.27,1.55) forwards;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
/* Celebration Modal Styles */
#celebration-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: #fff;
  border-radius: 24px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  position: relative;
  animation: popIn 0.8s cubic-bezier(.68,-0.55,.27,1.55);
}
.celebration-img {
  width: 120px;
  margin: 24px auto 16px auto;
  display: block;
}
.modal-content button {
  background: #6a82fb;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 32px;
  font-size: 1em;
  cursor: pointer;
  margin-top: 18px;
  transition: background 0.2s;
}
.modal-content button:hover {
  background: #fc5c7d;
}
.confetti {
  position: absolute;
  left: 0; right: 0; top: 0; height: 0;
  width: 100%;
  pointer-events: none;
}
.confetti-piece {
  position: absolute;
  top: 0;
  width: 12px;
  height: 24px;
  border-radius: 4px;
  opacity: 0.85;
  animation: confetti-fall 2.2s cubic-bezier(.68,-0.55,.27,1.55) forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(-40px) rotate(0deg); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(220px) rotate(360deg); opacity: 0; }
}
/* science-quiz.css */
body {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  font-family: 'Comic Sans MS', cursive, sans-serif;
  margin: 0;
  padding: 0;
}
/* Make quiz box larger and centered in middle panel */
#quiz-container {
  width: 100%;
  max-width: 700px;
  min-width: 340px;
  margin: 32px auto 0 auto;
  background: rgba(255,255,255,0.97);
  border-radius: 28px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.13);
  padding: 44px 36px 36px 36px;
  text-align: center;
  animation: popIn 1s cubic-bezier(.68,-0.55,.27,1.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
@keyframes popIn {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
#question-area {
  font-size: 1.4em;
  margin-bottom: 24px;
  min-height: 60px;
  color: #333;
  font-weight: bold;
}
.options-area, #options-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
  width: 100%;
  align-items: stretch;
}
.option-btn {
  background: linear-gradient(90deg, #f6d365 0%, #fda085 100%);
  border: none;
  border-radius: 16px;
  padding: 16px;
  font-size: 1.1em;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  width: 100%;
  min-width: 0;
  display: block;
  text-align: center;
  margin: 0;
  align-self: stretch;
}
.option-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.option-btn.correct {
  background: linear-gradient(90deg, #a8ff78 0%, #78ffd6 100%);
  color: #1b5e20;
  animation: correctPop 0.5s;
}
.option-btn.wrong {
  background: linear-gradient(90deg, #ff5858 0%, #f09819 100%);
  color: #fff;
  animation: wrongShake 0.5s;
}
@keyframes correctPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}
#next-btn {
  background: #6a82fb;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 32px;
  font-size: 1em;
  cursor: pointer;
  margin-top: 12px;
  transition: background 0.2s;
}
#next-btn:hover {
  background: #fc5c7d;
}
#result-area {
  font-size: 1.2em;
  margin-top: 24px;
  min-height: 32px;
  color: #4a148c;
  font-weight: bold;
}
