/* TABLE STYLING */
table {
  margin-top: 20px;
  border-collapse: collapse;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

th, td {
  border: 1px solid #333;
  padding: 10px;
  text-align: center;
}

td.partial {
  background: #3b82f6;
  /* color: #000; */
  font-weight: bold;
}

th { background: #f9f9f9; }
.correct { background: #1f8f4a; font-weight: bold; }
.wrong { background: #8f1f1f; font-weight: bold; }

/* IMAGE & INFO AREA */
#imageContainer {
  margin: 20px 0;
  text-align: center;
}

#characterImage {
  max-width: 600px;
  width: 100%;
  border-radius: 8px;
  /* filter: blur(10px);  */
  transition: filter 0.5s;
}

/* Hint button and container */
.hint-container {
  margin: 15px auto;
  padding: 10px;
  background: #fdf6e3;
  border-left: 5px solid #ffae00;
  border-radius: 5px;
  max-width: 600px;
  min-height: 20px;
  font-style: italic;
  display: none; /* Hidden by default */
  color: #555;
  padding-bottom: 0px;
}

.button-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

#hintBtn {
  background-color: #ffae00;
  color: #000;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
}

#hintBtn:hover {
  background-color: #282828;
  color: #ffae00;
}

/* INPUT WRAPPER */
.input-wrapper {
  display: flex;
  margin: 0 auto;
  gap: 10px;
  max-width: 500px;
  position: relative;
}


@media (max-width: 768px) {
  /* Hide IMDb column on mobile */
  .imdb_col {
    display: none;
  }
  th, td {
    padding: 3px;
  }
  /* Also hide the header cell */
  th.imdb_col {
    display: none;
  }
}


/* Quiz Question */
#questionText {
  font-size: 2.2rem;
  margin-bottom: 5px;
  color: #000;
}

.instruction {
  font-size: 0.9rem;
  color: #818183;
  margin-bottom: 20px;
}

/* The 12-Item Grid */
.quiz-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 3 columns x 4 rows */
  gap: 8px;
  margin-bottom: 25px;
}

.quiz-item {
  height: 100px;
  background-color: #adadad;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.1s, background-color 0.2s;
  user-select: none;
  text-transform: uppercase;
}

/* Hover & Selection States */
.quiz-item:hover {
  filter: brightness(1.2);
}

.quiz-item.selected {
  background-color: #5a5a5c;
  color: white;
  outline: 2px solid #ffffff;
}

/* Error State (Wrong Answer) */
.quiz-item.error {
  background-color: #721c24 !important;
  animation: shake 0.4s ease-in-out;
}

/* Controls */
.controls {
  margin-top: 20px;
}

/* Result Messages */
.result-message {
  margin-top: 20px;
  padding: 20px;
  border-radius: 8px;
  line-height: 1.5;
}
.result-message h3 {
  font-size: 1.8rem;
}
.result-message p {
  font-size: 1.2rem;
}

.win {
  background-color: #538d4e; /* Green */
  color: white;
}

.loss {
  background-color: #9d656a;
}

/* Animations */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Mobile Responsiveness */
@media (max-width: 400px) {
  .quiz-item {
      font-size: 0.75rem;
      padding: 5px;
  }
}

/* Style for correct items found DURING the game */
.quiz-item.correct-permanent {
  background-color: #538d4e !important;
  color: white !important;
  border-color: #538d4e !important;
  cursor: default;
  transform: scale(1.05);
  z-index: 2;
}

/* Ensure wrong items look distinct when flashing */
.quiz-item.error {
  background-color: #721c24 !important;
  border-color: #dc3545 !important;
  color: white !important;
  transition: background-color 0.2s;
}


:root {
  --correct-color: #538d4e;
  --wrong-color: #b33a3a;
  --bg-dark: #121213;
  --card-bg: #3a3a3c;
}

.quiz-header {
  margin-bottom: 20px;
  border-bottom: 1px solid #3a3a3c;
  padding-bottom: 10px;
}

#attemptsLeft {
  font-weight: bold;
  color: #ffd700;
  font-size: 0.9rem;
}

.quiz-item.correct-permanent {
  background-color: var(--correct-color) !important;
  border-color: var(--correct-color) !important;
  color: white;
  transform: scale(1.02);
  box-shadow: 0 0 15px rgba(83, 141, 78, 0.4);
  pointer-events: none; /* Locked */
}

/* Add a subtle "thumping" pulse to correctly found items */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.quiz-item.correct-permanent {
  animation: pulse 0.3s ease-in-out;
}
