* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: linear-gradient(180deg, #f8fceb 0%, #edf5dc 100%);
  color: #2d3748;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Top Navigation Bar --- */
.topbar-container {
  background: transparent;
  width: 100%;
  padding: 20px 40px 10px 40px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: #2b3a28;
  letter-spacing: -0.2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-item {
  text-decoration: none;
  color: #4a5568;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  transition: color 0.2s ease;
}

.nav-item:hover {
  color: #1a202c;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sound-toggle, .back-link {
  background: #e1ecc8;
  color: #2d4722;
  border: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.78rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.sound-toggle:hover, .back-link:hover {
  background: #d2e2b2;
  color: #1b3013;
}

/* --- Game Container & Screens --- */
.game-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px 20px;
  min-height: calc(100vh - 140px);
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(8px);
  padding: 48px 40px;
  border-radius: 24px;
  text-align: left;
  max-width: 540px;
  width: 90%;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.card.wide {
  max-width: 680px;
}

.subtitle-tag {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #2e7d32;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.card h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: #1e3a1e;
  line-height: 1.15;
}

.card p {
  font-size: 1.05rem;
  margin-bottom: 28px;
  color: #4a5568;
  line-height: 1.6;
}

.btn {
  background-color: #e06d53;
  color: #ffffff;
  border: none;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(224, 109, 83, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:hover {
  background-color: #d05b41;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(224, 109, 83, 0.45);
}

/* Lab Screen */
.instructions-banner {
  position: absolute;
  top: 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  padding: 14px 28px;
  border-radius: 16px;
  text-align: center;
  border: 1px solid rgba(46, 125, 50, 0.2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  z-index: 10;
}

.instructions-banner h2 {
  font-family: 'Playfair Display', Georgia, serif;
  color: #1e3a1e;
  font-size: 1.35rem;
}

.instructions-banner p {
  font-size: 0.9rem;
  color: #4a5568;
  margin-top: 4px;
}

#tracker {
  margin-top: 6px;
  font-weight: 700;
  color: #2e7d32;
}

#lab-container {
  position: relative;
  width: 900px;
  max-width: 90vw;
  height: 520px;
  max-height: 70vh;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  border: 4px solid #ffffff;
}

#lab-background {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.clue-hotspot {
  position: absolute;
  width: 75px;
  height: 75px;
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 12px;
}

.clue-hotspot:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 0 12px rgba(224, 109, 83, 0.6));
}

.clue-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  border: 2px dashed #e06d53;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px;
}

.clue-hotspot.found {
  display: none;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 30, 20, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #ffffff;
  padding: 36px;
  border-radius: 20px;
  text-align: left;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.modal-content h2 {
  font-family: 'Playfair Display', Georgia, serif;
  color: #1e3a1e;
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.riddle-text {
  font-size: 1rem;
  margin-bottom: 24px;
  color: #4a5568;
  line-height: 1.5;
}

/* Options */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.hypothesis-btn {
  background: #ffffff;
  color: #2d3748;
  border: 1px solid #dcdfe4;
  padding: 14px 18px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.hypothesis-btn:hover {
  background: #f4f8ec;
  border-color: #2e7d32;
}

/* Beakers */
.beakers-row {
  display: flex;
  justify-content: space-around;
  gap: 15px;
  margin: 24px 0;
}

.beaker {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  padding: 22px 14px;
  border-radius: 14px;
  cursor: pointer;
  flex: 1;
  text-align: center;
  font-weight: 700;
  color: #2d3748;
  transition: all 0.2s ease;
}

.beaker span {
  font-size: 0.82rem;
  color: #718096;
  font-weight: normal;
  display: block;
  margin-top: 4px;
}

.beaker:hover {
  transform: translateY(-3px);
  border-color: #e06d53;
}

/* Grid */
.grid-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.grid-item {
  background: #ffffff;
  padding: 14px 18px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #e2e8f0;
}

.grid-item span {
  font-weight: 700;
  color: #2e7d32;
}

select {
  background: #f8fafc;
  color: #2d3748;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-family: inherit;
  outline: none;
}

/* Security */
.riddle-box {
  background: #f2f7e8;
  padding: 16px;
  border-radius: 12px;
  margin: 18px 0;
  color: #2e7d32;
  font-size: 0.98rem;
  border: 1px solid #d4e4bc;
}

input[type="text"] {
  width: 100%;
  padding: 14px;
  margin-bottom: 18px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #2d3748;
  font-size: 1rem;
  font-family: inherit;
  text-align: center;
  outline: none;
}

input[type="text"]:focus {
  border-color: #2e7d32;
}

.error {
  color: #e53e3e;
  font-size: 0.9rem;
  margin-top: 10px;
}

.hidden {
  display: none !important;
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 24px 20px;
  background: transparent;
  font-size: 0.8rem;
  color: #718096;
}