* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f0f14;
  color: #f2f2f5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: 480px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h1 { font-size: 1.3rem; }

#score-bar {
  background: #1e1e2a;
  padding: 8px 14px;
  border-radius: 20px;
  font-weight: 600;
}

#quote-card {
  background: linear-gradient(135deg, #262636, #1a1a24);
  border-radius: 16px;
  padding: 28px 20px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#quote-text {
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.5;
}

#choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-btn {
  background: #1e1e2a;
  color: #f2f2f5;
  border: 1px solid #33333f;
  border-radius: 12px;
  padding: 14px;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.choice-btn:active { background: #2c2c3a; }
.choice-btn.correct { background: #1f7a3d; border-color: #1f7a3d; }
.choice-btn.wrong { background: #7a1f2b; border-color: #7a1f2b; }
.choice-btn:disabled { opacity: 0.7; cursor: default; }

#feedback {
  text-align: center;
  min-height: 24px;
  font-weight: 600;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
}

.hidden { display: none !important; }

input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #33333f;
  background: #1e1e2a;
  color: #f2f2f5;
  font-size: 1rem;
}

button#start-btn, button#restart-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: #4f7cff;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

#leaderboard {
  width: 100%;
  text-align: left;
  padding-left: 20px;
}

#leaderboard li { padding: 4px 0; }

#game { display: none; flex-direction: column; gap: 16px; }
#game.active { display: flex; }

/* --- Auth pages --- */
.auth-card {
  background: #1e1e2a;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-card h1 { font-size: 1.3rem; text-align: center; margin-bottom: 4px; }

.auth-card label { font-size: 0.85rem; color: #b0b0bc; }

.btn-primary {
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: #4f7cff;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #33333f;
  background: #2a2a38;
  color: #f2f2f5;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6a6a78;
  font-size: 0.8rem;
  margin: 4px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #33333f;
}

.error-msg { color: #ff6b7a; font-size: 0.9rem; text-align: center; min-height: 20px; }
.success-msg { color: #4fd67c; font-size: 0.9rem; text-align: center; min-height: 20px; }

.auth-links {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}
.auth-links a { color: #8ab4ff; text-decoration: none; }

#logout-btn {
  background: none;
  border: 1px solid #33333f;
  color: #b0b0bc;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
}

/* --- Language switcher --- */
.lang-switch {
  display: flex;
  gap: 4px;
}
.lang-btn {
  background: #1e1e2a;
  border: 1px solid #33333f;
  color: #b0b0bc;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.lang-btn.active {
  background: #4f7cff;
  border-color: #4f7cff;
  color: white;
}

.top-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px;
}

/* --- Footer légal --- */
.site-footer {
  text-align: center;
  font-size: 0.75rem;
  color: #6a6a78;
  padding: 16px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.site-footer a { color: #8ab4ff; text-decoration: none; }

/* --- Page légale --- */
.legal-content h2 { font-size: 1.05rem; margin: 16px 0 6px; }
.legal-content p { font-size: 0.9rem; line-height: 1.5; color: #d0d0d8; margin-bottom: 8px; }
.legal-content { background: #1e1e2a; border-radius: 16px; padding: 20px; }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
}
.checkbox-row input { width: auto; margin-top: 3px; }
.checkbox-row a { color: #8ab4ff; }

/* --- Factory (admin/modération) --- */
.factory-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.factory-nav a {
  background: #1e1e2a;
  border: 1px solid #33333f;
  color: #b0b0bc;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.85rem;
  text-decoration: none;
}
.factory-nav a.active {
  background: #4f7cff;
  border-color: #4f7cff;
  color: white;
}

.factory-card {
  background: #1e1e2a;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}
.factory-card textarea {
  width: 100%;
  min-height: 70px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #33333f;
  background: #14141c;
  color: #f2f2f5;
  font-size: 0.95rem;
  resize: vertical;
}
.factory-meta {
  font-size: 0.8rem;
  color: #9a9aa8;
}
.factory-actions {
  display: flex;
  gap: 8px;
}
.factory-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
}
.btn-approve { background: #1f7a3d; color: white; }
.btn-delete { background: #7a1f2b; color: white; }
.btn-save { background: #33333f; color: white; }

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #33333f;
}
.user-row select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #33333f;
  background: #14141c;
  color: #f2f2f5;
}
