body {
  font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
  background-color: #fff1e7;
  margin: 0;
  padding: 0;
  /* overflow: hidden removed from body so start screen can scroll */
}

/* Start Screen */
#start-screen {
  text-align: center;
  padding: 50px 20px;
  background: #fdf5e6;
  min-height: 100vh;
  box-sizing: border-box;
  overflow-y: auto;
}

#start-screen h1 {
  font-size: 3rem;
  color: #ff750b;
  margin-bottom: 10px;
}

#start-screen p {
  font-size: 1.2rem;
  color: #333;
}

#levels-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
  padding-top: 40px;
  max-width: 1000px;
  margin: 0 auto;
}

.level-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  flex: 1;
  min-width: 250px;
  max-width: 300px;
}

.level-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.level-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  border: 4px solid #fff1e7;
}

.level-card h2 {
  color: #ff750b;
  margin-top: 15px;
}

/* Game Screen */
#game-screen {
  position: absolute;
  top: 0; left: 0; 
  width: 100vw; height: 100vh;
  touch-action: none; /* Mobilde scroll olmasını engeller, puzzle parçaları kolay taşınır */
  overflow: hidden; /* Important for puzzle */
}

#hud {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  font-weight: bold;
  z-index: 2000;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 20px;
  border-radius: 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#forPuzzle {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0; left: 0;
  background-color: #fff1e7;
  overflow: hidden;
}

/* Modals */
.modal {
  position: fixed;
  top: 0; left: 0; 
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 3000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  padding: 40px;
  border-radius: 15px;
  text-align: center;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  animation: popIn 0.3s ease-out;
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

#question-text {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #333;
}

#options-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

#options-container button {
  padding: 15px;
  font-size: 18px;
  font-weight: bold;
  background-color: #ff750b;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

#options-container button:hover {
  background-color: #e0660a;
}
#options-container button:active {
  transform: scale(0.98);
}

#result-title {
  font-size: 2.5rem;
  color: #28a745;
  margin-bottom: 15px;
}

#result-message {
  font-size: 1.5rem;
  color: #555;
}

#result-modal button {
  display: block;
  padding: 15px 30px;
  font-size: 18px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin: 30px auto 0 auto;
  font-weight: bold;
}

#result-modal button:hover {
  background-color: #0069d9;
}

/* Puzzle specific from original */
.polypiece {
  display: block;
  overflow: hidden;
  position: absolute;
}
.moving {
  transition-property: top, left;
  transition-duration: 1s;
  transition-timing-function: linear;
}
.gameCanvas {
  display: none;
  overflow: hidden;
  position: absolute;
}

/* Responsive Adjustments for Mobile and Tablets */
@media (max-width: 768px) {
  #start-screen h1 { font-size: 2rem; }
  #start-screen p.slogan { font-size: 1rem; }
  
  #hud {
    font-size: 18px;
    padding: 8px 15px;
    top: 10px; right: 10px;
  }
  
  .level-card { min-width: 100%; }
  .modal-content { padding: 20px; }
  #question-text { font-size: 1.2rem; }
  #options-container button { padding: 12px; font-size: 16px; }
}

/* Landscape Warning Modal */
#landscape-warning {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background-color: #ff750be8; /* translucent orange */
  backdrop-filter: blur(8px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: white;
}

#landscape-warning h2 {
  font-size: 2.5rem;
  margin: 10px 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

#landscape-warning p {
  font-size: 1.2rem;
  font-weight: bold;
}

@media (max-width: 850px) and (orientation: portrait) {
  #landscape-warning {
    display: flex;
    flex-direction: column;
  }
}

/* New Additions: Answer Colors, Animal Name, Bottom Play Again Button */
.correct-answer {
  background-color: #28a745 !important;
  color: white !important;
  transform: scale(1.05);
}

.wrong-answer {
  background-color: #dc3545 !important;
  color: white !important;
}

#animal-name-display {
  position: absolute;
  font-size: 3.5rem;
  font-weight: bold;
  color: #ffeb3b;
  z-index: 2000;
  text-align: center;
  text-shadow: 3px 3px 6px rgba(0,0,0,0.8), -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000;
  pointer-events: none; /* Let clicks pass through to puzzle */
  animation: popIn 0.8s ease-out;
}

#play-again-btn {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 15px 30px;
  font-size: 1.5rem;
  font-weight: bold;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  z-index: 4000;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  transition: transform 0.2s, background-color 0.2s;
}

#play-again-btn:hover {
  background-color: #0056b3;
  transform: translateX(-50%) scale(1.05);
}

/* Loading Screen */
#loading-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background-color: #2c3e50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  color: white;
}

#loading-text {
  margin-top: 20px;
  font-size: 1.5rem;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #ff750b;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.progress-bar-container {
  width: 300px;
  height: 15px;
  background-color: rgba(255,255,255,0.2);
  border-radius: 10px;
  margin-top: 15px;
  overflow: hidden;
}

#progress-bar {
  width: 0%;
  height: 100%;
  background-color: #28a745;
  transition: width 0.3s;
}
