body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #4b6cb7, #182848);
  color: #fff;
  margin: 0; padding: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 1s ease-in;
}
.screen { display: none !important; }
.screen.active { display: block !important; }
#login-screen {
  position: fixed;
  z-index: 10000;
  left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(16,23,42,0.96);
  display: flex;
  align-items: center;
  justify-content: center;
}
#login-box {
  background: #fff;
  color: #22223b;
  border-radius: 16px;
  padding: 32px 40px;
  box-shadow: 0 0 30px #1e293b88;
  min-width: 320px;
  text-align: center;
}
#login-box input {
  width: 70%;
  font-size: 1.1em;
  padding: 8px 12px;
  margin: 18px 0;
  border-radius: 7px;
  border: 1px solid #b4b4b4;
  text-align: center;
}
#login-box button {
  background-color: #edf2f7;
  color: #1a202c;
  font-weight: bold;
  padding: 10px 24px;
  font-size: 1.07em;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s;
}
#login-box button:hover { background-color: #e2e8f0; }
#login-error { color: #ef4444; font-weight: bold; min-height: 1.5em; }
#logout-btn {
  position: fixed; bottom: 10px; right: 10px;
  background: #18181b; color: #fff;
  border: none; border-radius: 10px; padding: 10px 20px; opacity:0.7;
  cursor:pointer; z-index:10001;
  font-size: 1em;
}
#logout-btn:hover { opacity:1; background: #ef4444; }
.quiz-card, .intro-card {
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 20px;
  padding: 40px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
  text-align: center;
}
.intro-title {
  font-size: 2rem;
  margin-bottom: 20px;
  color: #fff;
}
.intro-text {
  font-size: 1.22rem;
  margin-bottom: 32px;
  color: #f3f4f6;
}
.nav-btn, #next-btn, #minigame-next, #back-to-menu, #back-to-menu-minigame {
  background-color: #edf2f7;
  color: #1a202c;
  margin-top: 20px;
  padding: 16px 24px;
  font-size: 1.1rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}
.nav-btn:hover, #next-btn:hover, #minigame-next:hover, #back-to-menu:hover, #back-to-menu-minigame:hover {
  background-color: #e2e8f0;
}
#pseudo-aff {
  font-weight: bold;
  color: #facc15;
  margin-bottom: 10px;
  font-size: 1.2em;
  letter-spacing: 1px;
}
#minigame-screen {
  background: #334155;
  border-radius: 12px;
  width: 480px;
  max-width: 95vw;
  padding: 25px;
  box-shadow: 0 0 30px #3b82f6;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: auto;
}
.health-bar {
  width: 100%;
  background: #475569;
  border-radius: 10px;
  height: 25px;
  margin: 10px 0;
  overflow: hidden;
  box-shadow: inset 0 0 6px #000000cc;
}
.health-fill {
  height: 100%;
  transition: width 0.5s ease;
}
#player-health-fill {
  background: #4ade80;
  width: 100%;
}
#enemy-health-fill {
  background: #f87171;
  width: 100%;
}
#minigame-dialogue {
  margin: 15px 0;
  font-size: 1.2rem;
  min-height: 4em;
  text-align: center;
  font-weight: 600;
  text-shadow: 0 0 6px #00000099;
}
#minigame-timer {
  font-weight: bold;
  margin-bottom: 15px;
  font-size: 1.1rem;
  color: #fbbf24;
  text-shadow: 0 0 10px #fbbf24cc;
}
#minigame-question {
  font-weight: 700;
  margin: 15px 0 10px 0;
  font-size: 1.3rem;
  text-align: center;
  min-height: 2.5em;
}
#minigame-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
button.choice {
  background: #2563eb;
  color: white;
  border: none;
  padding: 10px 18px;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  min-width: 120px;
  box-shadow: 0 0 8px #2563ebaa;
  transition: background 0.3s ease;
  font-weight: bold;
}
button.choice:hover {
  background: #1e40af;
}
button.choice.correct {
  background: #22c55e !important;
  box-shadow: 0 0 12px #22c55eaa !important;
  cursor: default;
}
button.choice.incorrect {
  background: #ef4444 !important;
  box-shadow: 0 0 12px #ef4444aa !important;
  cursor: default;
}
#minigame-next {
  margin-top: 20px;
  background: #3b82f6;
  border: none;
  color: white;
  padding: 12px 30px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.1rem;
  box-shadow: 0 0 15px #3b82f6bb;
  display: none;
  transition: background 0.3s ease;
}
#minigame-next:hover {
  background: #2563eb;
}
#back-to-menu-minigame {
  margin-top: 20px;
  background: #6b7280;
  border: none;
  color: white;
  padding: 10px 30px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 0 12px #6b7280bb;
  display: none;
  transition: background 0.3s ease;
}
#back-to-menu-minigame:hover {
  background: #4b5563;
}
#bonus-game,
#guess-game,
#choice-game,
#qte-game,
#memory-game,
#emoji-game,
#quickmath-game {
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  margin: 15px 0;
  background: #334155dd;
  padding: 15px 20px;
  border-radius: 12px;
  text-align: center;
  user-select: none;
}
#click-counter {
  font-weight: 700;
  font-size: 1.4rem;
  color: #fbbf24;
  margin-top: 8px;
}
#guess-input {
  padding: 8px 10px;
  font-size: 1.1rem;
  border-radius: 8px;
  border: none;
  margin-right: 10px;
  width: 70px;
  text-align: center;
}
#guess-submit, #choice-game button, #emoji-game button {
  background: #2563eb;
  color: white;
  border: none;
  padding: 10px 18px;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 8px #2563ebaa;
  transition: background 0.3s ease;
  font-weight: bold;
}
#guess-submit:hover, #choice-game button:hover, #emoji-game button:hover { background: #1e40af; }
#minigame-final {
  margin-top: 15px; font-weight: 700; font-size: 1.2rem; min-height: 2em;
  color: #facc15;
  white-space: pre-line;
}
#qte-game-key {
  font-size: 2em;
  font-weight: bold;
  color: #fbbf24;
  margin: 10px 0 12px 0;
  letter-spacing: 4px;
  text-shadow: 0 0 8px #fbbf24cc;
}
#memory-sequence {
  font-size: 1.2em;
  font-weight: bold;
  margin: 8px 0 12px 0;
  color: #38bdf8;
  letter-spacing: 2px;
}
#memory-choices {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}
#memory-choices button {
  border: none;
  border-radius: 8px;
  background: #64748b;
  color: #fff;
  padding: 10px 18px;
  font-size: 1em;
  cursor: pointer;
  box-shadow: 0 0 8px #64748baa;
  transition: background 0.3s;
  font-weight: bold;
}
#memory-choices button:hover { background: #0ea5e9; }
#emoji-game-ask {
  font-size: 1.5em;
  margin: 10px 0 10px 0;
}
#emoji-game-choices {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin-top: 14px;
}
#quickmath-input {
  padding: 7px 10px;
  font-size: 1.1rem;
  border-radius: 8px;
  border: none;
  margin-right: 10px;
  width: 70px;
  text-align: center;
}
#quickmath-submit {
  background: #10b981;
  color: white;
  border: none;
  padding: 10px 18px;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 8px #10b981aa;
  transition: background 0.3s;
  font-weight: bold;
}
#quickmath-submit:hover { background: #059669; }