body {
    margin: 0;
    padding: 0;
    font-family: 'Georgia', serif; /* Mellow font choice */
    /* Full screen background gradient */
    background: #dab;
    min-height: 100vh;
    display: flex;
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
}

#mode-indicator{
  z-index:101;
  position: fixed;
  top: 2vh;
  left: 2vw;
  border-radius: 9999px;
  font-family: sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 1rem;
  color: #a66;
  background: #fff1;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  user-select: none;
  pointer-events: none;
}

#question-container {
  z-index: 101;
  font-size: 6rem;
  color: #a66;
  position: relative;
}

.text-bubble:active {
  border: 1px solid #999;
  box-shadow: 0 0 45px #0009;
}

/* ---- Correct answer popup ---- */

.answer-popup {
  position: fixed;
  left: 50%;
  top: 35%;
  transform: translate(-50%, -50%);
  padding: 1.2em 2.4em;
  border-radius: 9999px;
  font-family: sans-serif;
  font-size: 2rem;
  font-weight: 600;
  color: #fff;
  pointer-events: none;          /* never blocks clicks beneath it */
  z-index: 10000;
  background: linear-gradient(135deg, #8fdcb099, #4caf7d99);
  box-shadow: 0 0 45px rgba(130, 225, 175, 0.45);
  opacity: 0;
}

.incorrect-answer {
  background: linear-gradient(135deg, #dc8fb099, #af4c7d99);
}

.answer-popup.show {
  animation: correct-pop 2.4s ease forwards;
}

.answer-popup.show-longer {
  animation: long-pop 10s ease forwards;
}

@keyframes correct-pop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  18%  { opacity: 1; transform: translate(-50%, -40%) scale(1.06); }
  30%  { transform: translate(-50%, -50%) scale(1); }
  75%  { opacity: 1; transform: translate(-50%, -60%) scale(1); }
  90%  { opacity: 1; transform: translate(-50%, -60%) scale(1); }
  97%  { opacity: 0.5; transform: translate(-50%, -75%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(0.98); }
}

@keyframes long-pop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  3%  { opacity: 1; transform: translate(-50%, -40%) scale(1.06); }
  6%  { transform: translate(-50%, -50%) scale(1); }
  85%  { opacity: 1; transform: translate(-50%, -60%) scale(1); }
  97%  { opacity: 1; transform: translate(-50%, -60%) scale(1); }
  99%  { opacity: 0.5; transform: translate(-50%, -75%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(0.98); }
}


/* ---- Score counter (top right) ---- */

.score-counter {
  position: fixed;
  top: 2vh;
  right: 2vw;
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.6em 1.4em;
  border-radius: 9999px;
  font-family: sans-serif;
  font-size: 2rem;
  font-weight: 600;
  color: #fff;
  background: rgba(25, 28, 38, 0.55);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  user-select: none;
  pointer-events: none;          /* display only — never eats clicks */
  z-index: 10001;
}

.score-counter .score-correct   { color: #8fdcb0; }
.score-counter .score-incorrect { color: #f0939b; }
.score-counter .score-divider   { opacity: 0.45; }

/* Little "pop" feedback when a count changes */
.score-counter.bump-correct,
.score-counter.bump-incorrect {
  animation: score-bump 0.35s ease;
}
@keyframes score-bump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ---- Startup file gate ---- */

.file-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 14, 20, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;               /* above everything, including score counter */
}

.file-gate-dialog {
  background: #fff;
  border-radius: 16px;
  padding: 2.2em 2.8em;
  text-align: center;
  font-family: sans-serif;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.4);
  max-width: 90vw;
}

.file-gate-dialog h2 { margin: 0 0 0.4em; }
.file-gate-dialog p  { margin: 0 0 1.4em; color: #555; }

.file-gate-btn {
  font-size: 1.05em;
  font-weight: 600;
  color: #fff;
  background: #4c7ddf;
  border: none;
  border-radius: 9999px;
  padding: 0.8em 2em;
  cursor: pointer;
}

.file-gate-btn:hover { background: #3b6bc8; }

.file-gate-error { color: #c0392b; margin-top: 1em; }
