/* ✨ Base Style */
body {
  font-family: 'Palatino Linotype', 'Book Antiqua', serif;
  background-color: #fdf6e3;
  color: #5c4326;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-weight: bold;
  text-align: center;
  color: #7f4a2f;
  text-shadow: 0 0 3px #c9b18f;
}

.btn {
  background-color: #d6c9a8;
  color: #3c2b1a;
  border: 2px solid #a08364;
  padding: 10px 20px;
  margin: 5px;
  font-weight: bold;
  border-radius: 5px;
  box-shadow: 2px 2px 5px #c6b193;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.btn:hover {
  background-color: #e6d9b7;
  color: #000;
}

/* 🧩 Layout */
.game-wrapper {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 20px;
}

.left-panel, .right-panel {
  width: 48%;
}

/* 📜 Quiz Area */
.quiz-area {
  border: 2px dashed #bfa77a;
  background-color: #fff8e1;
  padding: 15px;
  margin-bottom: 15px;
}

.choiceBtn {
  display: block;
  width: 100%;
  margin: 8px 0;
  font-size: 16px;
}

/* 💬 Word Display */
#wordDisplay {
  font-size: 22px;
  margin-bottom: 10px;
  cursor: help;
}

/* 🎨 Avatar Styling */
#avatarPanel {position: relative;
  text-align: center;
  margin-bottom: 20px;
}
#socratesAvatar {
  max-width: 150px;
  border: 3px solid #a08364;
  border-radius: 50%;
  box-shadow: 0 0 8px #ccc;
  transition: all 0.3s ease;
}
.avatar-happy { box-shadow: 0 0 12px #c6af60; }
.avatar-sad { opacity: 0.7; filter: grayscale(70%); }
.avatar-neutral { opacity: 0.9; }

#socratesAvatar.animate {
  animation: pulse 0.8s ease;
}

.avatar-happy {
  filter: brightness(1.2);
}
.avatar-sad {
  filter: grayscale(80%) contrast(0.8);
}
.avatar-neutral {
  filter: none;
}

@keyframes blink {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.1); }
}

#socratesAvatar.animate-blink {
  animation: blink 0.2s ease-in-out;
  transform-origin: center center;
}


@keyframes pulse {
  0% { transform: scale(1); }
  25% { transform: scale(1.05) rotate(1deg); }
  50% { transform: scale(1); }
  75% { transform: scale(1.05) rotate(-1deg); }
  100% { transform: scale(1); }
}


/* 📈 Progress Panel */
#progressBarContainer {
  width: 100%;
  height: 20px;
  background-color: #ddd0a8;
  border: 1px solid #bfa77a;
  margin-top: 10px;
}
#progressBar {
  width: 0%;
  height: 100%;
  background: linear-gradient(to right, #c6af60, #e8ca7e);
  transition: width 1s ease-in-out;
}
#scoreDisplay {
  font-size: 18px;
  color: #7f4a2f;
  text-align: center;
  margin-top: 10px;
}

/* 🏆 Leaderboard */
#leaderboardList {
  list-style-type: none;
  padding-left: 0;
}
#leaderboardList li {
  padding: 6px;
  border-bottom: 1px dashed #bfa77a;
  font-style: italic;
}

/* 🎶 Mute Button */
#muteBtn {
  position: absolute;
  top: 20px;
  right: 20px;
}

/* 📜 Narrator Text */
#narratorLine {
  font-style: italic;
  color: #444;
  margin-top: 15px;
}

/* 🔁 Restart Button */
#restartBtn {
  display: block;
  margin: 20px auto;
}

/* 🎭 Cutscene */
#cutscenePanel {
  text-align: center;
  padding: 40px;
  background-color: #fff9ec;
  color: #3c2b1a;
}
.scrollCutscene {
  border: 2px solid #bfa77a;
  padding: 30px;
  font-size: 18px;
  font-family: 'Georgia', serif;
  background-image: url('parchment-bg.jpg'); /* Optional parchment image */
  background-size: cover;
}

/* ✨ Tooltip Styling */
[title] {
  position: relative;
}
[title]:hover::after {
  content: attr(title);
  position: absolute;
  left: 0;
  top: 110%;
  background: #fefbd8;
  color: #3c2b1a;
  padding: 5px;
  border: 1px solid #ccc;
  font-size: 14px;
  z-index: 10;
  white-space: nowrap;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

/* 🔊 Loading Screen */
#loadingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #f8f0dc;
  color: #5c4326;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  font-size: 20px;
  animation: fadeOut 1s ease-in 4s forwards;
}

@keyframes fadeOut {
  to { opacity: 0; visibility: hidden; }
}

/* 📱 Responsive Mode */
@media screen and (max-width: 768px) {
  .game-wrapper {
    flex-direction: column;
  }
  .left-panel, .right-panel {
    width: 100%;
  }
  #socratesAvatar {
    max-width: 100px;
  }
}
