@import url("https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700;800&family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  /* Palette originale QuizPlay - volontairement distincte des couleurs de
     marque de Kahoot (qui utilise un violet #46178F et des tuiles de
     reponse rouge/bleu/jaune/vert tres specifiques). Direction "Vibrant
     Minimal" (E2) : fond clair et sobre, accents de couleur utilises avec
     parcimonie plutot qu'un fond violet plein page - equilibre entre
     energie ludique et lisibilite professionnelle.
     Couleur primaire passee du violet au bleu (validee par Julien le 02/08
     sur la base de la demo des themes de couleur). --purple/--purple-dark
     gardent leur nom de variable (utilisees ~30 fois dans ce fichier) mais
     portent desormais des valeurs bleues, pour limiter le risque de casser
     des regles existantes lors du changement. */
  --purple: #2563eb;
  --purple-dark: #17408f;
  --teal: #0fbfa0;
  --red: #ff4757;
  --blue: #2d8cff;
  --yellow: #e6a800;
  --green: #2ecc71;
  --ink: #1c1830;
  --sub: #6f6a82;
  --bg-page: #ffffff;
  --card-border: #e9edf5;
  --font-display: "Baloo 2", "Inter", -apple-system, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg-page);
  min-height: 100vh;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--card-border);
  flex-wrap: wrap;
}

header.top .logo {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

header.top .logo::before {
  content: "Q";
  font-size: 16px;
  font-weight: 800;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--purple);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.topnav-link {
  color: var(--sub);
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 9px 14px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.topnav-link:hover {
  background: #eef2fb;
  color: var(--ink);
}

.topnav-link.active {
  background: #e8f1ff;
  color: var(--purple);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.account-link {
  color: var(--sub);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
}

.account-link:hover, .account-link.active {
  background: #eef2fb;
  color: var(--ink);
}

.nav-cta {
  padding: 9px 18px;
  font-size: 13px;
  background: var(--ink);
  box-shadow: none;
}

.nav-cta.active {
  background: var(--purple);
}

.cookie-notice {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 640px;
  margin: 0 auto;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(28, 24, 48, 0.14);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  z-index: 500;
  font-size: 13px;
}

.cookie-notice a {
  color: var(--purple);
  font-weight: 700;
}

.cookie-notice-close {
  padding: 7px 16px;
  font-size: 13px;
  background: var(--ink);
  box-shadow: none;
  margin-left: auto;
}

.lang-switcher {
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: #fff;
  color: var(--sub);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 8px;
  cursor: pointer;
}

.topnav-burger {
  display: none;
  background: #eef2fb;
  color: var(--ink);
  box-shadow: none;
  border-radius: 8px;
  padding: 8px 12px;
}

@media (max-width: 720px) {
  .topnav {
    display: none;
    width: 100%;
    order: 3;
    background: #f9f8fc;
    border-radius: 12px;
    padding: 8px;
    flex-direction: column;
    align-items: stretch;
  }
  .topnav.open {
    display: flex;
  }
  .topnav-link {
    text-align: center;
  }
  .topnav-burger {
    display: block;
  }
}

.badge {
  background: #e8f1ff;
  color: var(--purple);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.card {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 10px 28px rgba(28, 24, 48, 0.09), 0 2px 6px rgba(28, 24, 48, 0.06);
  margin-bottom: 20px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.home-tile {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 26px 20px;
  text-align: left;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(28, 24, 48, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}

.home-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--purple);
}

.home-tile:nth-child(4n+1)::before { background: var(--red); }
.home-tile:nth-child(4n+2)::before { background: var(--blue); }
.home-tile:nth-child(4n+3)::before { background: var(--yellow); }
.home-tile:nth-child(4n+4)::before { background: var(--green); }

.home-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 26px rgba(28, 24, 48, 0.12);
}

.home-tile .icon {
  font-size: 20px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #eef2fb;
}

.home-tile .icon svg {
  width: 22px;
  height: 22px;
}

.home-tile:nth-child(4n+1) .icon { background: #ffeef0; color: var(--red); }
.home-tile:nth-child(4n+2) .icon { background: #e9f2ff; color: var(--blue); }
.home-tile:nth-child(4n+3) .icon { background: #fef6e2; color: var(--yellow); }
.home-tile:nth-child(4n+4) .icon { background: #e8f9ee; color: var(--green); }

.home-tile h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}

.home-tile p {
  margin: 0;
  font-size: 13px;
  color: var(--sub);
}

/* --- Hero (page d'accueil) --- */

.hero {
  display: flex;
  align-items: center;
  gap: 36px;
  padding: 10px 0 8px;
  margin-bottom: 34px;
  flex-wrap: wrap;
}

.hero-text {
  flex: 1;
  min-width: 260px;
}

.hero-eyebrow {
  display: inline-block;
  background: #e8f1ff;
  color: var(--purple);
  font-weight: 700;
  font-size: 12.5px;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(30px, 5.5vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 12px;
  color: var(--ink);
}

.hero p.subtitle {
  font-size: 17px;
  color: var(--sub);
  margin: 0;
  max-width: 480px;
}

.hero-visual {
  flex: 0 0 300px;
  max-width: 100%;
  background: linear-gradient(135deg, #2f6fed, #3fc2a8);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.2);
}

.hero-pin-form {
  margin-top: 22px;
  max-width: 420px;
}

.hero-pin-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--sub);
  margin-bottom: 8px;
}

.hero-pin-row {
  display: flex;
  gap: 10px;
}

.hero-pin-row input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 3px;
  text-align: center;
  padding: 12px 10px;
  border-radius: 12px;
  border: 2px solid #d8e2f4;
  box-shadow: inset 0 2px 4px rgba(28, 24, 48, 0.06);
}

.hero-pin-row input:focus {
  outline: none;
  border-color: var(--blue, #2f6fed);
}

.hero-pin-row button {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .hero-pin-row {
    flex-direction: column;
  }
  .hero-pin-row button {
    width: 100%;
  }
}

.hero-pin-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
}

.hero-pin-card .kicker {
  font-size: 11px;
  font-weight: 700;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-pin-card .pin {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  color: var(--purple);
  letter-spacing: 3px;
  margin: 6px 0 8px;
}

.hero-pin-card .bar {
  height: 7px;
  border-radius: 4px;
  background: #e8eefa;
  overflow: hidden;
  margin-bottom: 6px;
}

.hero-pin-card .bar span {
  display: block;
  height: 100%;
  width: 62%;
  background: var(--teal);
}

.hero-pin-card .meta {
  font-size: 11.5px;
  color: var(--sub);
}

.hero-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 34px;
}

.hero-highlight-item {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px 14px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(28, 24, 48, 0.05);
}

.hero-highlight-item .icon {
  width: 34px;
  height: 34px;
  margin: 0 auto 8px;
  border-radius: 10px;
  background: #e8f1ff;
  color: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-highlight-item .icon svg {
  width: 18px;
  height: 18px;
}

.hero-highlight-item span {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

@media (max-width: 640px) {
  .hero-highlights {
    grid-template-columns: 1fr;
  }
}

.learn-progress-track {
  height: 6px;
  border-radius: 4px;
  background: #e8eefa;
  overflow: hidden;
  margin: 10px 0 20px;
}

.learn-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--purple);
  transition: width 0.2s ease;
}

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 5vw, 34px);
  margin: 0 0 4px;
  letter-spacing: -0.3px;
}

.subtitle {
  color: #666;
  margin: 0 0 20px;
  font-size: 16px;
}

label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin: 14px 0 6px;
  color: #333;
}

input[type="text"],
input[type="number"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  border: 2px solid #e6e6f0;
  /* 16px minimum : en dessous, Safari iOS zoome automatiquement l'ecran
     au focus d'un champ - c'etait la cause probable du "zoom" ressenti
     sur mobile signale par Julien. */
  font-size: 16px;
  font-family: inherit;
  background: #fafaff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
select:focus {
  outline: none;
  border-color: var(--teal);
  background: #fff;
}

button, .btn {
  display: inline-block;
  cursor: pointer;
  border: none;
  border-radius: 11px;
  padding: 13px 24px;
  font-size: 16px;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.1px;
  color: #fff;
  text-decoration: none;
  background: var(--purple);
  box-shadow: 0 3px 0 rgba(23, 64, 143, 0.55), 0 5px 14px rgba(37, 99, 235, 0.22);
  transition: transform 0.1s ease, filter 0.15s ease, box-shadow 0.1s ease;
}

button:hover, .btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 3px 0 rgba(23, 64, 143, 0.55), 0 6px 16px rgba(37, 99, 235, 0.28);
}

button:active, .btn:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 rgba(23, 64, 143, 0.55), 0 2px 6px rgba(37, 99, 235, 0.18);
}

button.secondary {
  background: #eef2fb;
  color: var(--purple);
  box-shadow: 0 3px 0 rgba(28, 24, 48, 0.08), 0 4px 10px rgba(28, 24, 48, 0.06);
}

button.secondary:hover {
  box-shadow: 0 4px 12px rgba(28, 24, 48, 0.08);
}

button.danger {
  background: var(--red);
  box-shadow: none;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.question-block {
  border: 2px solid #eee;
  border-radius: 12px;
  padding: 18px;
  margin-top: 18px;
  position: relative;
}

.question-block .qnum {
  position: absolute;
  top: -14px;
  left: 14px;
  background: var(--purple);
  color: #fff;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 6px;
}

.option-row input[type="text"] {
  flex: 1;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.row > div {
  flex: 1 1 160px;
}

@media (max-width: 480px) {
  .row > div {
    flex: 1 1 100%;
  }
}

.pin-display {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 8px;
  margin: 10px 0;
}

#qrCode {
  display: flex;
  justify-content: center;
  margin: 6px 0 4px;
}

#qrCode img,
#qrCode canvas {
  border-radius: 8px;
  border: 6px solid #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.qr-join-url {
  word-break: break-all;
  margin-bottom: 16px;
}

.center {
  text-align: center;
}

.players-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 20px 0;
}

.avatar-choice-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 8px 0 4px;
}

.avatar-choice-tile {
  background: #eef2fb;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 10px 0;
  font-size: 24px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.avatar-choice-tile:hover {
  transform: translateY(-2px);
}

.avatar-choice-tile.selected {
  border-color: var(--purple);
  background: #e8f1ff;
}

@media (max-width: 480px) {
  .avatar-choice-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.player-chip {
  background: var(--teal);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  animation: player-chip-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.player-chip .chip-avatar {
  margin-right: 6px;
}

.wait-avatar {
  font-size: 56px;
  margin-bottom: 10px;
  animation: player-chip-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

@keyframes player-chip-pop {
  0% { transform: scale(0.3); opacity: 0; }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.answers-live {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}

.answer-tile {
  border-radius: 12px;
  padding: 22px 16px;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border: none;
  text-align: left;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2), 0 8px 18px rgba(0, 0, 0, 0.16);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.answer-tile:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 3px 8px rgba(0, 0, 0, 0.14);
}

.answer-tile .shape {
  font-size: 22px;
}

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px auto 0;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
  color: #7a3b00;
  background: linear-gradient(180deg, #ffd966, #ffb703);
  box-shadow: 0 3px 0 rgba(122, 59, 0, 0.35), 0 6px 14px rgba(255, 183, 3, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  animation: streak-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes streak-pop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.answer-tile-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.28);
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.answer-tile:disabled {
  cursor: default;
}

.a0 { background: var(--red); }
.a1 { background: var(--blue); }
.a2 { background: var(--yellow); }
.a3 { background: var(--green); }

.answer-tile.correct {
  outline: 5px solid #fff;
  box-shadow: 0 0 0 5px var(--green);
}

.answer-tile.incorrect {
  opacity: 0.4;
}

.answer-tile.selected {
  outline: 5px solid #fff;
  box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.35);
  transform: scale(0.98);
}

/* Mode Confiance : choix du niveau de certitude apres avoir selectionne une
   reponse (voir play.js). Recompense la certitude honnete, penalise la
   confiance excessive en cas d'erreur. */
.confidence-block {
  margin-top: 14px;
  text-align: center;
}
.confidence-block .confidence-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--sub);
  margin-bottom: 8px;
  display: block;
}
.confidence-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.confidence-btn {
  border: 2px solid #e6e6f0;
  background: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.confidence-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--brand, #4c6ef5);
}
.confidence-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.confidence-btn[data-confidence="pas_sur"] { background: #f4f4fb; }
.confidence-btn[data-confidence="sur"] { background: #fff3cd; border-color: #ffd966; }
.confidence-btn[data-confidence="tres_sur"] { background: #ffe0e0; border-color: #ff8a8a; }

/* Roue aleatoire interactive (voir wheel.js) */
.wheel-launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #8e44ad, #e21b3c);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 11px 20px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}
.wheel-launch-btn:hover {
  transform: translateY(-2px);
}
.wheel-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 20, 0.72);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.wheel-modal-content {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.wheel-modal-close {
  float: right;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--sub);
}
.wheel-stage {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 10px auto 20px;
}
.wheel-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 22px solid #1f2a52;
  z-index: 2;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}
.wheel-disc {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  position: relative;
  border: 6px solid #fff;
  box-shadow: 0 0 0 4px #1f2a52, 0 10px 30px rgba(0, 0, 0, 0.35);
  will-change: transform;
}
.wheel-label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 0;
  transform-origin: left center;
  display: flex;
  align-items: center;
}
.wheel-label span {
  display: inline-block;
  transform: translateX(14px);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wheel-winner-banner {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  min-height: 32px;
}
.wheel-winner-banner.show {
  animation: wheelWinnerPop 0.5s ease;
}
@keyframes wheelWinnerPop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}

/* Version simplifiee cote joueur : pas de roue graphique, juste le resultat
   synchronise avec l'animateur (voir play.js, evenement wheel:show). */
.wheel-player-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 20, 0.85);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding: 20px;
}
.wheel-player-overlay .spinning-emoji {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
  animation: wheelSpinEmoji 1s linear infinite;
}
@keyframes wheelSpinEmoji {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Resume automatique IA des reponses ouvertes (voir host.js / server.js) */
.ai-summary-block {
  margin-top: 18px;
  text-align: center;
}
#summarizeAnswersBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #16a085, #4c6ef5);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 11px 20px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}
#summarizeAnswersBtn:hover:not(:disabled) {
  transform: translateY(-2px);
}
#summarizeAnswersBtn:disabled {
  opacity: 0.6;
  cursor: default;
}
.ai-summary-result {
  margin-top: 14px;
  text-align: left;
}
.ai-summary-text {
  background: #f4f4fb;
  border: 2px solid #e6e6f0;
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text, #1b1b2f);
  white-space: pre-wrap;
}
/* Editeur de quiz : recherche de medias (images Pixabay, videos YouTube/Vimeo)
   - voir create.js. Grille partagee pour les vignettes. */
.media-search-results {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.video-search-results {
  gap: 8px;
}
.video-result-card {
  width: 140px;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: #f4f4fb;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.video-result-card:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
}
.video-result-card img {
  width: 100%;
  height: 78px;
  object-fit: cover;
  display: block;
  background: #e6e6f0;
}
.video-result-card .video-result-title {
  font-size: 11px;
  padding: 4px 6px;
  line-height: 1.3;
  max-height: 2.6em;
  overflow: hidden;
  color: var(--text, #1b1b2f);
}

.q-audio-field audio,
.media-preview audio {
  width: 100%;
  margin-top: 6px;
}

/* Revelation progressive d'image (voir host.js / play.js applyProgressiveReveal) */
.progressive-img {
  will-change: filter;
}

/* Reactions emoji en direct (voir play.js / host.js "player:reaction") */
.reaction-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 500;
  display: none;
  gap: 8px;
  background: rgba(20, 20, 35, 0.55);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 8px 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.reaction-btn {
  border: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  width: 42px;
  height: 42px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.reaction-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}
.reaction-btn-pop {
  animation: reactionPop 0.3s ease;
}
@keyframes reactionPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.reaction-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9997;
}
.floating-reaction {
  position: absolute;
  bottom: 0;
  font-size: 34px;
  animation-name: floatReactionUp;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}
@keyframes floatReactionUp {
  0% {
    transform: translate(0, 0) scale(0.6);
    opacity: 0;
  }
  15% {
    transform: translate(0, -10vh) scale(1.1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--drift, 0px), -95vh) scale(1);
    opacity: 0;
  }
}

.ai-summary-badge {
  display: inline-block;
  background: #ffd966;
  color: #6b4e00;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-radius: 6px;
  padding: 2px 8px;
  margin-right: 8px;
  vertical-align: middle;
}

.media-preview {
  position: relative;
}

.media-preview img,
.media-preview video,
.media-preview iframe {
  max-width: 100%;
  border-radius: 12px;
  margin: 14px 0;
  max-height: 320px;
}

.target-marker {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
  background: var(--purple);
  pointer-events: none;
}

.target-marker-target {
  background: var(--green);
  width: 28px;
  height: 28px;
}

.target-marker-hit {
  background: var(--green);
}

.target-marker-miss {
  background: var(--red);
}

.number-guess-list,
.ranking-result-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.number-guess-list li {
  display: flex;
  justify-content: space-between;
  background: #f4f4f8;
  color: #222;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-weight: 600;
}

.number-guess-list li.correct-guess {
  background: #dff5d8;
}

.ranking-result-list li {
  background: #f4f4f8;
  color: #222;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-weight: 600;
}

.blanks-result {
  font-size: 18px;
  line-height: 2;
  margin: 16px 0;
}

.blank-fill {
  background: var(--teal);
  color: #fff;
  padding: 2px 10px;
  border-radius: 6px;
  font-weight: 800;
  display: inline-block;
}

.blank-input {
  border: 2px solid #e2e2e2;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 15px;
  font-family: inherit;
}

.note-average {
  font-size: 44px;
  font-weight: 900;
  text-align: center;
  color: var(--purple);
  margin: 10px 0 20px;
}

.rating-scale {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.rating-tile {
  background: #e8f1ff;
  color: var(--purple-dark);
  min-width: 56px;
}

.rating-tile.selected {
  background: var(--purple);
  color: #fff;
}

.ranking-drag-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}

.ranking-drag-item {
  background: #f4f4f8;
  color: #222;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ranking-drag-item .handle {
  opacity: 0.5;
}

.ranking-drag-item button {
  padding: 6px 10px;
  font-size: 14px;
}

.timer {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 800;
  text-align: center;
}

.leaderboard {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.leaderboard li {
  display: flex;
  justify-content: space-between;
  background: #f4f4f8;
  color: #222;
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-weight: 700;
}

.leaderboard li:nth-child(1) { background: #ffe08a; }
.leaderboard li:nth-child(2) { background: #e2e2e2; }
.leaderboard li:nth-child(3) { background: #f0c9a0; }

.hint {
  font-size: 13px;
  color: #888;
  margin-top: 4px;
}

.error-msg {
  background: #ffe3e3;
  color: #b30000;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  margin-top: 12px;
}

.quiz-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 2px solid #eee;
  border-radius: 10px;
  padding: 14px 16px;
}

.quiz-item strong {
  display: block;
}

.quiz-item span {
  font-size: 12px;
  color: #888;
}

.quiz-item-highlight {
  border-color: var(--teal);
  background: #f0fffb;
}

.status-pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--purple), #0ea5e9);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.big-input {
  font-size: 24px;
  text-align: center;
  letter-spacing: 4px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.mode-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 2px solid #eee;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  position: relative;
}

.mode-card input {
  position: absolute;
  top: 12px;
  right: 12px;
}

.mode-card strong {
  font-size: 15px;
}

.mode-card span {
  font-size: 12px;
  color: #777;
}

.mode-card:has(input:checked) {
  border-color: var(--purple);
  background: #eef4ff;
}

.reward-banner {
  background: linear-gradient(90deg, #ffd76a, #ffb347);
  color: #4a2a00;
  font-weight: 800;
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 16px;
  text-align: center;
}

.team-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.team-tile {
  border: none;
  border-radius: 10px;
  padding: 16px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.team-tile.selected {
  outline: 4px solid #333;
}

.team-red { background: var(--red); }
.team-blue { background: var(--blue); }
.team-green { background: var(--green); }
.team-yellow { background: var(--yellow); }

.brainstorm-board {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  max-height: 260px;
  overflow-y: auto;
}

.idea-chip {
  background: #e8f1ff;
  border: 1px solid var(--purple);
  color: var(--purple-dark);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.matching-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}

.matching-columns ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.matching-columns li {
  background: #f4f4f8;
  color: #222;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-weight: 600;
}

.word-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}

.word-cloud span {
  color: var(--purple);
  font-weight: 800;
}

.poll-bar-row {
  margin-bottom: 12px;
}

.poll-bar-row .poll-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
}

.poll-bar-track {
  background: #eee;
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
}

.poll-bar-fill {
  background: var(--purple);
  height: 100%;
  border-radius: 999px;
}

.open-answer-item {
  background: #f4f4f8;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
}

.open-answer-item strong {
  color: var(--purple-dark);
}

/* --- Decouvrir (bibliotheque de quiz) --- */

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.category-chip {
  background: #e8f1ff;
  color: var(--purple-dark);
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
}

.category-chip.active {
  background: var(--purple);
  color: #fff;
}

.discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.discover-card {
  background: #fff;
  color: #222;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(20, 0, 60, 0.25);
  display: flex;
  flex-direction: column;
}

.discover-card-thumb {
  height: 120px;
  background: linear-gradient(135deg, var(--purple), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
}

.discover-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-hero-image {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 18px;
  box-shadow: 0 10px 24px rgba(28, 24, 48, 0.12);
}

@media (max-width: 480px) {
  .article-hero-image {
    max-height: 200px;
    border-radius: 10px;
  }
}

.discover-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.discover-card-body h2 {
  font-family: var(--font-display);
  font-size: 16px;
  margin: 0;
}

.discover-card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: #888;
}

.discover-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
}

.discover-card-actions button, .discover-card-actions a {
  padding: 8px 12px;
  font-size: 12px;
  box-shadow: none;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 480px) {
  /* Cibles tactiles plus genereuses sur petit ecran (doigt, pas souris). */
  .discover-card-actions button, .discover-card-actions a {
    min-height: 40px;
    padding: 9px 14px;
    font-size: 12.5px;
  }
  .category-chip {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }
}

/* --- Ressources educatives (mode Apprendre) --- */

.resources-panel {
  background: #f0fffb;
  border: 2px solid #d3f5ea;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.resources-toggle {
  background: none;
  box-shadow: none;
  color: var(--purple-dark);
  padding: 4px 0;
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 700;
}

.resources-toggle:hover {
  filter: none;
  text-decoration: underline;
}

.resources-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.resources-list a {
  background: #fff;
  border: 2px solid var(--teal);
  color: var(--purple-dark);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: none;
}

.resources-list a:hover {
  background: var(--teal);
  color: #fff;
}

/* --- Musique d'ambiance (lobby) --- */

.music-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
  background: #eef4ff;
  border-radius: 12px;
  padding: 10px 14px;
}

.music-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
  color: var(--purple-dark);
  margin: 0;
  cursor: pointer;
}

.music-toggle input {
  width: auto;
}

.music-controls select {
  width: auto;
  padding: 8px 10px;
  font-size: 13px;
}

/* --- Rapports / analytics par eleve (mode Devoir) --- */

.student-report-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.student-report-row {
  border: 2px solid #eee;
  border-radius: 10px;
  overflow: hidden;
}

.student-report-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  background: #f4f4f8;
  color: #222;
  box-shadow: none;
  border-radius: 0;
  font-family: var(--font-body);
  padding: 12px 16px;
}

.student-report-toggle:hover {
  filter: none;
  background: #ececf4;
}

.student-report-detail {
  list-style: none;
  padding: 12px 16px;
  margin: 0;
  background: #fff;
}

.student-report-detail li {
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
}

/* Mascotte QuizPlay (avatar v1) - voir public/js/mascot.js.
   Version SVG/CSS deliberement simple : pas d'asset 3D externe, animation
   par classe d'etat (idle / celebrate / wave / think). */
.mascot-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 110px;
  margin: 0 auto 14px;
  background: var(--card-border);
  border-radius: 50%;
}

.mascot-svg {
  transform-origin: center bottom;
}

.mascot-idle .mascot-body {
  animation: mascot-bob 1.4s ease-in-out infinite;
}

.mascot-celebrate .mascot-body {
  animation: mascot-jump 0.7s ease-in-out infinite;
}

.mascot-celebrate .mascot-arm-left {
  animation: mascot-wave-left 0.5s ease-in-out infinite;
  transform-origin: 78px 155px;
}

.mascot-celebrate .mascot-arm-right {
  animation: mascot-wave-right 0.5s ease-in-out infinite;
  transform-origin: 132px 155px;
}

.mascot-wave .mascot-arm-right {
  animation: mascot-wave-right 0.6s ease-in-out infinite;
  transform-origin: 132px 155px;
}

/* Bande "Jouer" style page d'accueil US (Odoo-like) : bloc plein largeur,
   fond distinct, visuel + texte cote a cote, gros titre + CTA. Placee avant
   la grille de tuiles pour mettre en avant le point de vue joueur. */
.play-hook {
  display: flex;
  align-items: center;
  gap: 32px;
  background: linear-gradient(135deg, #F0F5FF 0%, #EAF8F2 100%);
  border-radius: 20px;
  padding: 32px 40px;
  margin: 28px 0;
}

.play-hook-visual {
  flex: 0 0 140px;
}

.play-hook-mascot {
  width: 140px;
  height: auto;
  animation: mascot-bob 2.4s ease-in-out infinite;
}

.play-hook-text {
  flex: 1;
}

.play-hook-text h2 {
  font-size: 30px;
  margin: 8px 0 10px;
  color: var(--ink);
}

.play-hook-text p {
  color: var(--sub);
  margin: 0 0 18px;
  font-size: 16px;
}

@media (max-width: 640px) {
  .play-hook {
    flex-direction: column;
    text-align: center;
    padding: 28px 24px;
  }
}

.admin-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 14px;
}

/* Le tableau ne se compresse jamais illisiblement sur mobile : la carte qui
   le contient defile horizontalement a la place. */
.card:has(> .admin-table) {
  overflow-x: auto;
}

.admin-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--sub);
  border-bottom: 2px solid var(--card-border);
  font-weight: 600;
}

.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--card-border);
  vertical-align: middle;
}

.admin-table select {
  padding: 6px 10px;
  border-radius: var(--radius, 8px);
  border: 1px solid var(--card-border);
}

/* Tableau de bord admin : statistiques (voir admin-dashboard.js) */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.stat-card {
  background: var(--card-bg2, #f4f4fb);
  border: 1px solid var(--card-border);
  border-radius: var(--radius, 12px);
  padding: 16px;
  text-align: center;
}
.stat-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--teal);
  line-height: 1.1;
}
.stat-label {
  font-size: 13px;
  color: var(--sub);
  margin-top: 6px;
  font-weight: 600;
}

.stat-bars {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 40px;
  align-items: center;
  gap: 10px;
}
.stat-bar-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #1b1b2f);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-bar-track {
  height: 12px;
  background: var(--card-border);
  border-radius: 999px;
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--purple, #5B8FE8), var(--teal));
  border-radius: 999px;
}
.stat-bar-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--sub);
  text-align: right;
}
@media (max-width: 560px) {
  .stat-bar-row {
    grid-template-columns: 100px 1fr 32px;
  }
}

.mascot-bubble {
  margin: 6px auto 0;
  padding: 4px 12px;
  background: white;
  border: 2px solid var(--purple, #5B8FE8);
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  color: #3C3489;
  width: fit-content;
}

.mascot-think .mascot-eye {
  animation: mascot-blink 2.6s ease-in-out infinite;
}

@keyframes mascot-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes mascot-jump {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-14px) scale(1.03); }
  60% { transform: translateY(-14px) scale(1.03); }
}

@keyframes mascot-wave-left {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-25deg); }
}

@keyframes mascot-wave-right {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(25deg); }
}

@keyframes mascot-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.1); }
}

/* ============================================================
   Accessibilite (parametres dans "Mon compte", public/js/accessibility.js)
   Classes posees sur <html> ; s'appliquent a tout le site.
   ============================================================ */

@font-face {
  font-family: "OpenDyslexic";
  src: url("https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/open-dyslexic-regular.woff2") format("woff2");
  font-display: swap;
  font-weight: normal;
  font-style: normal;
}

html.a11y-text-lg { font-size: 113%; }
html.a11y-text-xl { font-size: 128%; }

html.a11y-dyslexia body,
html.a11y-dyslexia input,
html.a11y-dyslexia textarea,
html.a11y-dyslexia select,
html.a11y-dyslexia button {
  font-family: "OpenDyslexic", var(--font-body) !important;
  letter-spacing: 0.02em;
  line-height: 1.65;
}
html.a11y-dyslexia h1,
html.a11y-dyslexia h2,
html.a11y-dyslexia .logo,
html.a11y-dyslexia .btn {
  font-family: "OpenDyslexic", var(--font-display) !important;
}

html.a11y-contrast {
  --ink: #000000;
  --sub: #262626;
  --card-border: #000000;
  --bg-page: #ffffff;
}
html.a11y-contrast .card,
html.a11y-contrast button,
html.a11y-contrast .btn,
html.a11y-contrast input,
html.a11y-contrast select,
html.a11y-contrast textarea {
  border: 2px solid #000 !important;
}
html.a11y-contrast a,
html.a11y-contrast .topnav-link,
html.a11y-contrast .account-link {
  text-decoration: underline !important;
}
html.a11y-contrast *:focus-visible {
  outline: 3px solid #000 !important;
  outline-offset: 2px;
}

html.a11y-underline-links a { text-decoration: underline !important; }

html.a11y-reduce-motion *,
html.a11y-reduce-motion *::before,
html.a11y-reduce-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

html.a11y-big-cursor,
html.a11y-big-cursor * {
  cursor: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 24 24"><path d="M3 2 L3 20 L8 16 L11 22 L14 21 L11 15 L18 15 Z" fill="black" stroke="white" stroke-width="1.2"/></svg>') 3 2, auto !important;
}

.a11y-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  margin-top: 14px;
}
@media (max-width: 640px) {
  .a11y-settings-grid { grid-template-columns: 1fr; }
}
.a11y-setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.a11y-setting-row label {
  margin: 0;
  font-weight: 600;
}
.a11y-setting-row.a11y-full-width {
  grid-column: 1 / -1;
}

/* ============================================================
   Podium de fin de partie + confettis (public/js/podium.js)
   ============================================================ */

.podium-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  height: 220px;
  margin: 20px 0;
  position: relative;
  overflow: hidden;
}

.podium-block {
  width: 110px;
  border-radius: 10px 10px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 14px;
  color: #fff;
  font-weight: 800;
  font-family: var(--font-display);
  position: relative;
  text-align: center;
  font-size: 13px;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.4), 0 10px 22px rgba(0, 0, 0, 0.22);
}

.podium-block .avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  margin-bottom: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.podium-block.p1 { height: 170px; background: linear-gradient(180deg, #ffcf4a, #e6a800); order: 2; }
.podium-block.p2 { height: 130px; background: linear-gradient(180deg, #c9c9d6, #9b98ab); order: 1; }
.podium-block.p3 { height: 100px; background: linear-gradient(180deg, #f0b483, #c98a52); order: 3; }

@media (max-width: 400px) {
  /* Sur les petits telephones (< 400px), 3 blocs de 110px + les marges de
     .wrap ne tiennent pas sans deborder : on retrecit le podium et son texte. */
  .podium-stage {
    gap: 8px;
    height: 190px;
  }
  .podium-block {
    width: 88px;
    font-size: 11.5px;
    padding-top: 10px;
  }
  .podium-block.p1 { height: 150px; }
  .podium-block.p2 { height: 115px; }
  .podium-block.p3 { height: 90px; }
  .podium-block .avatar {
    width: 38px;
    height: 38px;
    font-size: 13px;
  }
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 14px;
  opacity: 0.9;
  animation: podium-confetti-fall linear forwards;
}

@keyframes podium-confetti-fall {
  to { transform: translateY(260px) rotate(360deg); opacity: 0; }
}

/* Barre de temps visuelle (ecran animateur, en plus du compte a rebours
   chiffre existant) + flash de couleur sur la tuile de reponse au reveal. */
.timer-bar-track {
  height: 14px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0 14px;
}

.timer-bar-fill {
  height: 100%;
  background: var(--teal);
  width: 100%;
}

/* Flash plein ecran cote joueur (correct/incorrect), au-dessus de tout,
   inspire du feedback immersif de Kahoot - la carte resultat texte reste
   affichee dessous une fois le flash termine. */
.result-flash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.result-flash.show {
  opacity: 1;
}

.result-flash.correct {
  background: rgba(99, 153, 34, 0.94);
}

.result-flash.incorrect {
  background: rgba(226, 75, 74, 0.94);
}

.result-flash #resultFlashIcon,
#resultFlashIcon {
  font-size: 96px;
  transform: scale(0.6);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.result-flash.show #resultFlashIcon {
  transform: scale(1);
}

@media (max-width: 480px) {
  /* Cibles tactiles confortables (>= 44px) pour les boutons principaux et
     les tuiles de reponse, utilises au doigt pendant une partie en classe. */
  button, .btn {
    min-height: 44px;
  }
  .answer-tile {
    min-height: 56px;
    padding: 16px 14px;
    font-size: 16px;
  }
  .player-chip {
    min-height: 32px;
  }
}
