/* =====================================================================
   Jeu de l'oie — styles propres au jeu (préfixe oie-)
   La barre, le plein écran et les infobulles sont dans css/games.css.
   Trois univers : data-univers="classique" | "magie" | "auto" sur .oie-jeu
   ===================================================================== */

/* ---------- Univers classique (par défaut) ---------- */
.oie-jeu {
  --mg-jeu-largeur: 1204px; /* barre de 1180 px + marges de 12 px : ne pas changer */
  --mgb-fond:
    radial-gradient(
      120% 180% at 0% 0%,
      rgba(255, 210, 140, 0.28),
      transparent 55%
    ),
    linear-gradient(120deg, #4a2812, #8e4f1f);
  --mgb-accent: #d9822b;
  --mgb-titre: linear-gradient(100deg, #fff7e0, #f6c766);
  --mgb-police-titre: "Fredoka", sans-serif;
  --mgb-doux: #e7c9a4;
  --mgb-texte: #fff4e2;
  --mg-stat-largeur: 4em;
  --mgc-fond: #fbf3df;
  --mgc-texte: #5b3a1a;
  --mgc-bord: rgba(91, 58, 26, 0.18);
  --mg-fs-fond: #2a170b;
  --mg-bulle-fond: #3b2210;

  --oie-police: "Fredoka", sans-serif;
  --oie-plateau-fond: #f1e2c0;
  --oie-panneau-fond: linear-gradient(180deg, #fdf6e6, #f5e7c8);
  --oie-panneau-bord: rgba(120, 78, 32, 0.25);
  --oie-texte: #4a2f17;
  --oie-doux: #8a6a48;
  --oie-carte-joueur: rgba(255, 255, 255, 0.65);
  --oie-actif: #d9822b;
  --oie-lancer: linear-gradient(180deg, #c8442c, #8f2416);
  --oie-lancer-ombre: #5e170c;
  --oie-de-fond: radial-gradient(circle at 30% 25%, #fffdf6, #efe2c4);
  --oie-de-bord: #c9ae80;
  --oie-de-point: #3b2210;
  --oie-voile: rgba(60, 35, 12, 0.45);
  --oie-fenetre: #fdf6e6;
  --oie-carte-dos: repeating-linear-gradient(
    45deg,
    #8f2416 0 10px,
    #a8321f 10px 20px
  );
  --oie-carte-recto: radial-gradient(circle at 50% 30%, #fffaf0, #f0dfb8);
  --oie-carte-bord: #8f2416;
}

/* ---------- Univers magie ---------- */
.oie-jeu[data-univers="magie"] {
  --mgb-fond:
    radial-gradient(
      120% 180% at 0% 0%,
      rgba(160, 110, 255, 0.35),
      transparent 55%
    ),
    linear-gradient(120deg, #0f0830, #3f1a7d);
  --mgb-accent: #a46bff;
  --mgb-titre: linear-gradient(100deg, #f1e8ff, #ffd36b);
  --mgb-police-titre: "Almendra", serif;
  --mgb-doux: #b9a6e6;
  --mgb-texte: #f1ebff;
  --mgc-fond: #1a1240;
  --mgc-texte: #e6dcff;
  --mgc-bord: rgba(190, 160, 255, 0.22);
  --mg-fs-fond: #07041a;
  --mg-bulle-fond: #24145a;

  --oie-police: "Almendra", serif;
  --oie-plateau-fond: #0d0828;
  --oie-panneau-fond: linear-gradient(180deg, #1d1250, #110a33);
  --oie-panneau-bord: rgba(190, 160, 255, 0.28);
  --oie-texte: #efe8ff;
  --oie-doux: #a89bd6;
  --oie-carte-joueur: rgba(255, 255, 255, 0.06);
  --oie-actif: #ffd36b;
  --oie-lancer: linear-gradient(180deg, #8d55ff, #4f22b8);
  --oie-lancer-ombre: #2c1170;
  --oie-de-fond: radial-gradient(circle at 30% 25%, #fff6d6, #ffd36b 60%, #d9a441);
  --oie-de-bord: #fff3c4;
  --oie-de-point: #4f22b8;
  --oie-voile: rgba(6, 3, 24, 0.55);
  --oie-fenetre: #1b1149;
  --oie-carte-dos:
    radial-gradient(circle at 50% 50%, #ffd36b 0 6%, transparent 7%),
    repeating-conic-gradient(from 0deg, #2a1470 0 15deg, #3b1d93 15deg 30deg);
  --oie-carte-recto: radial-gradient(circle at 50% 30%, #3a1f86, #160c3c);
  --oie-carte-bord: #ffd36b;
}

/* ---------- Univers automobile ---------- */
.oie-jeu[data-univers="auto"] {
  --mgb-fond:
    radial-gradient(
      120% 180% at 0% 0%,
      rgba(255, 60, 50, 0.35),
      transparent 55%
    ),
    linear-gradient(120deg, #121316, #3a3d44);
  --mgb-accent: #e8322b;
  --mgb-titre: linear-gradient(100deg, #ffffff, #ffcc1a);
  --mgb-police-titre: "Bungee", sans-serif;
  --mgb-doux: #b7bac2;
  --mgb-texte: #f4f4f6;
  --mgc-fond: #202329;
  --mgc-texte: #eceef2;
  --mgc-bord: rgba(255, 255, 255, 0.12);
  --mg-fs-fond: #0b0c0e;
  --mg-bulle-fond: #1c1e22;

  --oie-police: "Bungee", sans-serif;
  --oie-plateau-fond: #3f8a3a;
  --oie-panneau-fond: linear-gradient(180deg, #2a2d33, #18191d);
  --oie-panneau-bord: rgba(255, 255, 255, 0.12);
  --oie-texte: #f2f3f5;
  --oie-doux: #9da2ad;
  --oie-carte-joueur: rgba(255, 255, 255, 0.05);
  --oie-actif: #ffcc1a;
  --oie-lancer: linear-gradient(180deg, #ff4a3d, #b8150f);
  --oie-lancer-ombre: #6d0b07;
  --oie-de-fond: radial-gradient(circle at 30% 25%, #ffffff, #e2e4e8);
  --oie-de-bord: #9aa0aa;
  --oie-de-point: #c4161c;
  --oie-voile: rgba(5, 6, 8, 0.55);
  --oie-fenetre: #22252b;
  --oie-carte-dos: repeating-conic-gradient(#111 0 25%, #f4f4f4 0 50%) 0 0 /
    28px 28px;
  --oie-carte-recto: linear-gradient(160deg, #2c3038, #15171b);
  --oie-carte-bord: #ffcc1a;
}

.oie-jeu [hidden] {
  display: none !important;
}

/* ---------- Rangée des univers ---------- */
.oie-commandes-lib {
  font-weight: 700;
  font-size: 0.9em;
  margin-right: 2px;
  opacity: 0.8;
}

/* ---------- Zone de jeu : plateau + panneau ---------- */
.oie-zone {
  position: relative;
  box-sizing: border-box;
  align-self: center;
  width: min(var(--mg-barre-largeur, 1180px), calc(100vw - 24px));
  display: flex;
  gap: 12px;
  border-radius: 16px;
  font-family: "Outfit", sans-serif;
  color: var(--oie-texte);
}

.oie-jeu.mg-fs .oie-zone {
  align-self: stretch;
  width: auto;
  flex: 1;
  min-height: 0;
}

.oie-plateau {
  position: relative;
  flex: 1;
  min-width: 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--oie-plateau-fond);
  box-shadow:
    0 12px 30px -14px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  transition: background 0.4s;
}

.oie-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.oie-pions,
.oie-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.oie-fx {
  z-index: 3;
}

/* ---------- Plateau : textes et cases ---------- */
.oie-svg text {
  font-family: var(--oie-police);
  user-select: none;
  -webkit-user-select: none;
}

.oie-case {
  cursor: help;
}

.oie-case .oie-tuile {
  transition: filter 0.2s;
}

.oie-case:hover .oie-tuile {
  filter: brightness(1.12);
}

.oie-case.oie-cible .oie-halo {
  opacity: 1;
}

.oie-halo {
  opacity: 0;
  transition: opacity 0.3s;
  animation: oie-pulse 1.1s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes oie-pulse {
  50% {
    transform: scale(1.12);
  }
}

.oie-etoile {
  animation: oie-scintille 3s ease-in-out infinite;
}

@keyframes oie-scintille {
  50% {
    opacity: 0.15;
  }
}

.oie-lueur-lente {
  animation: oie-respire 4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes oie-respire {
  50% {
    opacity: 0.55;
    transform: scale(1.05);
  }
}

/* ---------- Pions ---------- */
.oie-pion {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--pion, 40px);
  height: var(--pion, 40px);
  margin: calc(var(--pion, 40px) / -2) 0 0 calc(var(--pion, 40px) / -2);
  pointer-events: auto;
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.45));
  will-change: transform;
  z-index: 1;
}

.oie-pion svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.oie-pion.actif {
  z-index: 2;
}

.oie-pion.actif::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6%;
  width: 90%;
  height: 30%;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 3px solid var(--oie-actif);
  box-shadow: 0 0 10px var(--oie-actif);
  animation: oie-anneau 1.2s ease-in-out infinite;
  z-index: -1;
}

.oie-jeu[data-univers="auto"] .oie-pion.actif::after {
  bottom: auto;
  top: 50%;
  height: 120%;
  width: 120%;
  transform: translate(-50%, -50%);
}

@keyframes oie-anneau {
  50% {
    opacity: 0.35;
  }
}

/* ---------- Effets (particules, textes volants) ---------- */
.oie-particule {
  position: absolute;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
}

.oie-volant {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  font-family: var(--oie-police);
  font-weight: 800;
  font-size: 22px;
  white-space: nowrap;
  color: #fff;
  -webkit-text-stroke: 1px rgba(0, 0, 0, 0.35);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* ---------- Carte surprise ---------- */
.oie-carte-voile {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.32);
  perspective: 1200px;
  cursor: pointer;
  animation: oie-apparait 0.25s ease-out;
}

@keyframes oie-apparait {
  from {
    opacity: 0;
  }
}

.oie-carte {
  position: relative;
  width: 230px;
  height: 320px;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.3, 1.4, 0.5, 1);
  transform: rotateY(0deg) scale(0.9);
}

.oie-carte.retournee {
  transform: rotateY(180deg) scale(1);
}

.oie-carte-face {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 6px solid var(--oie-carte-bord);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
}

.oie-carte-dos {
  background: var(--oie-carte-dos);
  display: flex;
  align-items: center;
  justify-content: center;
}

.oie-carte-motif {
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 4px solid var(--oie-carte-bord);
  background: rgba(255, 255, 255, 0.12);
}

.oie-carte-recto {
  transform: rotateY(180deg);
  background: var(--oie-carte-recto);
  color: var(--oie-texte);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  text-align: center;
}

.oie-carte-type {
  font-size: 0.72em;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oie-doux);
  font-weight: 700;
}

.oie-carte-icone {
  width: 96px;
  height: 96px;
  color: var(--oie-actif);
}

.oie-carte-icone svg {
  width: 100%;
  height: 100%;
}

.oie-carte-titre {
  font-family: var(--oie-police);
  font-size: 1.35em;
  font-weight: 800;
  line-height: 1.1;
}

.oie-carte-texte {
  font-size: 0.95em;
  line-height: 1.35;
  color: var(--oie-doux);
}

/* ---------- Panneau latéral ---------- */
.oie-panneau {
  width: 290px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 12px;
  box-sizing: border-box;
  border-radius: 16px;
  background: var(--oie-panneau-fond);
  border: 1px solid var(--oie-panneau-bord);
  box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.4);
  transition: background 0.4s;
}

.oie-joueurs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.oie-joueur {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 8px;
  border-radius: 12px;
  background: var(--oie-carte-joueur);
  border: 2px solid transparent;
  transition:
    border-color 0.25s,
    transform 0.25s,
    box-shadow 0.25s;
}

.oie-joueur.actif {
  border-color: var(--oie-actif);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--oie-actif) 25%, transparent);
  transform: translateX(-3px);
}

.oie-joueur-pion {
  width: 34px;
  height: 34px;
}

.oie-joueur-pion svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.oie-joueur-nom {
  min-width: 0;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
}

.oie-joueur-nom small {
  display: block;
  font-weight: 500;
  font-size: 0.78em;
  color: var(--oie-doux);
  overflow: hidden;
  text-overflow: ellipsis;
}

.oie-joueur-nom small.alerte {
  color: #e2553a;
  font-weight: 700;
}

.oie-jeu[data-univers="magie"] .oie-joueur-nom small.alerte {
  color: #ff8fb0;
}

.oie-joueur-nom small.bonus {
  color: #2e9d58;
  font-weight: 700;
}

.oie-jeu[data-univers="magie"] .oie-joueur-nom small.bonus,
.oie-jeu[data-univers="auto"] .oie-joueur-nom small.bonus {
  color: #6fe39a;
}

.oie-joueur-case {
  font-family: var(--oie-police);
  font-weight: 800;
  font-size: 1.35em;
  min-width: 1.6em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- Dés et bouton de lancer ---------- */
.oie-lancer-bloc {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 4px 2px;
}

.oie-des {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  height: 64px;
  perspective: 600px;
}

.oie-de {
  position: relative;
  width: 50px;
  height: 50px;
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(0.2, 0.75, 0.25, 1);
}

.oie-face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: 7px;
  box-sizing: border-box;
  border-radius: 11px;
  background: var(--oie-de-fond);
  box-shadow:
    inset 0 0 0 1.5px var(--oie-de-bord),
    inset 0 -4px 8px rgba(0, 0, 0, 0.14);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.oie-face i {
  width: 9px;
  height: 9px;
  margin: auto;
  border-radius: 50%;
  background: var(--oie-de-point);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.oie-jeu[data-univers="magie"] .oie-face i {
  box-shadow: 0 0 5px rgba(120, 60, 255, 0.7);
}

.oie-face:nth-child(1) {
  transform: translateZ(25px);
}
.oie-face:nth-child(2) {
  transform: rotateY(90deg) translateZ(25px);
}
.oie-face:nth-child(3) {
  transform: rotateX(90deg) translateZ(25px);
}
.oie-face:nth-child(4) {
  transform: rotateX(-90deg) translateZ(25px);
}
.oie-face:nth-child(5) {
  transform: rotateY(-90deg) translateZ(25px);
}
.oie-face:nth-child(6) {
  transform: rotateY(180deg) translateZ(25px);
}

.oie-total {
  min-width: 1.5em;
  font-family: var(--oie-police);
  font-size: 2em;
  font-weight: 800;
  text-align: center;
  color: var(--oie-actif);
  opacity: 0;
  transform: scale(0.5);
  transition:
    opacity 0.25s,
    transform 0.35s cubic-bezier(0.3, 1.8, 0.5, 1);
}

.oie-total.visible {
  opacity: 1;
  transform: none;
}

.oie-lancer {
  height: 48px;
  margin: 0;
  border: none;
  border-radius: 14px;
  background: var(--oie-lancer);
  box-shadow:
    0 5px 0 var(--oie-lancer-ombre),
    0 10px 18px -6px rgba(0, 0, 0, 0.5);
  color: #fff;
  font-family: var(--oie-police);
  font-weight: 800;
  font-size: 1.1em;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    transform 0.1s,
    box-shadow 0.1s,
    filter 0.2s,
    opacity 0.2s;
}

.oie-lancer:hover:not(:disabled) {
  filter: brightness(1.1);
}

.oie-lancer:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow:
    0 1px 0 var(--oie-lancer-ombre),
    0 4px 10px -6px rgba(0, 0, 0, 0.5);
}

.oie-lancer:disabled {
  opacity: 0.5;
  cursor: default;
}

.oie-lancer:focus-visible {
  outline: 3px solid var(--oie-actif);
  outline-offset: 3px;
}

.oie-lancer.attend:not(:disabled) {
  animation: oie-appel 1.6s ease-in-out infinite;
}

@keyframes oie-appel {
  50% {
    filter: brightness(1.18);
  }
}

/* ---------- Récit et journal ---------- */
.oie-recit {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--oie-carte-joueur);
  border: 1px solid var(--oie-panneau-bord);
  box-sizing: border-box;
}

.oie-recit-icone {
  flex: none;
  width: 44px;
  height: 44px;
  color: var(--oie-actif);
}

.oie-recit-icone svg {
  width: 100%;
  height: 100%;
}

.oie-recit p {
  margin: 0;
  font-size: 0.93em;
  line-height: 1.35;
  font-weight: 600;
}

.oie-recit.nouveau {
  animation: oie-recit 0.4s ease-out;
}

@keyframes oie-recit {
  from {
    transform: scale(0.96);
    opacity: 0.4;
  }
}

.oie-journal {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0 2px;
  list-style: none;
  overflow: auto;
  font-size: 0.8em;
  color: var(--oie-doux);
  mask-image: linear-gradient(180deg, #000 65%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 65%, transparent);
  scrollbar-width: none;
}

.oie-journal li {
  display: flex;
  gap: 7px;
  align-items: baseline;
  padding: 3px 0;
  border-bottom: 1px dashed var(--oie-panneau-bord);
  line-height: 1.3;
}

.oie-journal li::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--puce, currentColor);
  transform: translateY(-1px);
}

/* ---------- Fenêtres (configuration, fin) : dans la zone, sous la barre ---------- */
.oie-voile {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 16px;
  background: var(--oie-voile);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: oie-apparait 0.25s ease-out;
}

.oie-fenetre {
  position: relative;
  box-sizing: border-box;
  width: min(760px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 20px 24px;
  border-radius: 20px;
  background: var(--oie-fenetre);
  color: var(--oie-texte);
  border: 1px solid var(--oie-panneau-bord);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
}

.oie-fenetre h2 {
  margin: 0 0 14px;
  font-family: var(--oie-police);
  font-size: 1.6em;
  text-align: center;
  color: var(--oie-texte);
}

.oie-fenetre-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

/* Choix de l'univers */
.oie-univers-choix {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.oie-univers-carte {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 10px 10px 12px;
  border-radius: 16px;
  border: 3px solid transparent;
  background: var(--oie-carte-joueur);
  color: var(--oie-texte);
  font: inherit;
  cursor: pointer;
  transition:
    transform 0.15s,
    border-color 0.2s,
    box-shadow 0.2s;
}

.oie-univers-carte:hover {
  transform: translateY(-2px);
}

.oie-univers-carte[aria-pressed="true"] {
  border-color: var(--oie-actif);
  box-shadow: 0 8px 22px -10px var(--oie-actif);
}

.oie-univers-carte b {
  font-size: 1.05em;
  color: var(--oie-texte);
}

.oie-univers-carte small {
  font-size: 0.78em;
  line-height: 1.25;
  color: var(--oie-doux);
  text-align: center;
}

.oie-univers-art {
  width: 100%;
  height: 86px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.oie-univers-art svg {
  height: 72px;
  width: 72px;
}

.oie-univers-carte[data-univers="classique"] .oie-univers-art {
  background: radial-gradient(circle at 50% 40%, #fff6dc, #e8cf9c);
  color: #6b3f17;
}

.oie-univers-carte[data-univers="magie"] .oie-univers-art {
  background: radial-gradient(circle at 50% 40%, #4b2a9e, #120a35);
  color: #ffd36b;
}

.oie-univers-carte[data-univers="auto"] .oie-univers-art {
  background: repeating-linear-gradient(
    90deg,
    #3c3f45 0 22px,
    #34373c 22px 44px
  );
  color: #ffcc1a;
}

/* Joueurs */
.oie-config-joueurs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  margin: 16px 0 12px;
}

.oie-config-joueur {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 12px;
  background: var(--oie-carte-joueur);
  transition: opacity 0.2s;
}

.oie-config-joueur.absent {
  opacity: 0.55;
}

.oie-config-joueur .oie-joueur-pion {
  width: 30px;
  height: 30px;
}

.oie-config-joueur input[type="text"] {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  height: 32px;
  margin: 0;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--oie-panneau-bord);
  background: rgba(255, 255, 255, 0.85);
  color: #2a1a0c;
  font: inherit;
  font-weight: 600;
}

.oie-config-joueur.absent input[type="text"] {
  pointer-events: none;
}

.oie-type {
  display: inline-flex;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  padding: 2px;
}

.oie-jeu[data-univers="magie"] .oie-type,
.oie-jeu[data-univers="auto"] .oie-type {
  background: rgba(255, 255, 255, 0.08);
}

.oie-type button {
  margin: 0;
  padding: 4px 9px;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--oie-doux);
  font: inherit;
  font-size: 0.8em;
  font-weight: 700;
  cursor: pointer;
}

.oie-type button[aria-pressed="true"] {
  background: var(--oie-actif);
  color: #fff;
}

.oie-jeu[data-univers="magie"] .oie-type button[aria-pressed="true"],
.oie-jeu[data-univers="auto"] .oie-type button[aria-pressed="true"] {
  color: #1a1030;
}

.oie-config-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 600;
  font-size: 0.92em;
  cursor: pointer;
}

/* Fin de partie */
.oie-fin {
  width: min(460px, 100%);
  text-align: center;
}

.oie-fin-icone {
  width: 110px;
  height: 110px;
  margin: 0 auto 6px;
  color: var(--oie-actif);
  animation: oie-trophee 2.2s ease-in-out infinite;
}

.oie-fin-icone svg {
  width: 100%;
  height: 100%;
}

@keyframes oie-trophee {
  50% {
    transform: translateY(-6px) rotate(-3deg);
  }
}

.oie-fin h2 {
  margin-bottom: 4px;
}

.oie-fin p {
  margin: 0 0 12px;
  color: var(--oie-doux);
}

.oie-classement {
  margin: 0 auto;
  padding: 0;
  list-style: none;
  max-width: 320px;
  text-align: left;
}

.oie-classement li {
  display: grid;
  grid-template-columns: 28px 30px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 10px;
  font-weight: 700;
}

.oie-classement li:first-child {
  background: color-mix(in srgb, var(--oie-actif) 22%, transparent);
}

.oie-classement .rang {
  font-family: var(--oie-police);
  color: var(--oie-doux);
}

.oie-classement .oie-joueur-pion {
  width: 28px;
  height: 28px;
}

.oie-classement small {
  color: var(--oie-doux);
  font-weight: 600;
}

/* ---------- Écrans étroits : panneau sous le plateau ---------- */
@media (max-width: 820px) {
  .oie-zone {
    flex-direction: column;
  }

  .oie-plateau {
    flex: none;
    aspect-ratio: 1 / 1.05;
  }

  .oie-panneau {
    width: auto;
  }

  .oie-journal {
    max-height: 120px;
  }

  .oie-config-joueurs {
    grid-template-columns: 1fr;
  }

  .oie-univers-choix {
    grid-template-columns: 1fr;
  }

  .oie-univers-art {
    height: 60px;
  }
}

/* Noms dans la barre : largeur fixe pour que la barre ne bouge pas */
.oie-stat-nom {
  --mg-stat-largeur: 7.5em;
}

.oie-stat-nom b {
  display: block;
  max-width: 7.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Titre de la barre en magie : Almendra est plus petite et plus fine que les autres polices */
.oie-jeu[data-univers="magie"] .mg-barre-titre {
  font-size: 2em;
  font-weight: 700;
}

.oie-jeu.mg-etroit[data-univers="magie"] .mg-barre-titre {
  font-size: 1.7em;
}
