/* ⬤ AGARIO — ses règles à lui.
   ⚠️ `style.css` fait 200 Ko et il est partagé par tout le site : un jeu qui
   arrive n'a pas à s'y installer. Un fichier séparé se retire aussi vite. */
.agar-scene {
  position: relative;
  user-select: none; -webkit-user-select: none;
  width: 100%;
  height: min(72vh, 760px);
  border-radius: 16px;
  overflow: hidden;
  background: #0e1a14;
}
.agar-canvas {
  display: block;
  /* ⚠️ Le « carré blanc » : le glissé sélectionnait. On coupe la sélection. */
  user-select: none; -webkit-user-select: none;
  width: 100%;
  height: 100%;
  /* ⚠️ Sans ceci, un glissement du doigt fait défiler la page au lieu de
     déplacer le blob — et sur mobile le jeu devient injouable. */
  touch-action: none;
  cursor: crosshair;
}
.agar-hud {
  position: absolute; top: 10px; left: 12px;
  padding: 5px 10px; border-radius: 10px;
  background: rgba(14, 26, 20, 0.72);
  color: #e8f5ea; font-size: 12.5px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.agar-message { padding: 34px 16px; text-align: center; }
.agar-note { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

@media (max-width: 640px) {
  .agar-scene { height: min(62vh, 520px); border-radius: 12px; }
}
/* 📱 Au TACTILE : la scène s'étire — un jeu se joue plein cadre, pas dans un
   timbre-poste. dvh (la hauteur RÉELLE, barre d'adresse déduite) avec repli vh. */
@media (pointer: coarse) {
  .agar-scene { height: min(74vh, 820px); height: min(74dvh, 820px); }
}
/* …et en PAYSAGE téléphone, presque tout l'écran : c'est la vraie posture de jeu. */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 560px) {
  .agar-scene { height: 88vh; height: 88dvh; border-radius: 8px; }
}

/* 💀 Le panneau de mort — un calque, pas un remplacement : le monde continue
   de tourner derrière pendant qu'on décide. */
.agar-mort {
  position: absolute; inset: 0;
  /* ⚠️ AU-DESSUS des contrôles tactiles (z 3) et du feed (z 2) : sans z-index,
     ✂️💧 et le pad flottaient sur l'écran de mort — des commandes mortes qui
     avaient l'air vivantes. (5 > pause 4 : la mort ferme la pause de droit.) */
  z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center;
  background: rgba(14, 26, 20, 0.78);
  color: #e8f5ea;
}
.agar-mort strong { font-size: 26px; }
.agar-mort p { margin: 0; color: #d9a441; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ══ LE MENU PRINCIPAL — du DOM, pas du canvas : il se navigue au clavier
   et se lit au lecteur d'écran. ══ */
.agar-menu {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 18px; overflow-y: auto;
  color: #e8f5ea; text-align: center;
}
.agar-menu-titre { display: flex; flex-direction: column; gap: 2px; }
.agar-menu-titre strong { font-size: 30px; letter-spacing: 0.5px; }
.agar-menu-titre small { color: #9fbfae; }
.agar-menu-nom input { max-width: 240px; text-align: center; }
.agar-menu-membre { color: #d9a441; font-weight: 700; }
.agar-modes {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  max-width: 640px;
}
.agar-mode {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 172px; padding: 12px 10px;
  border-radius: 14px; border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05); color: inherit;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.agar-mode:hover { background: rgba(255, 255, 255, 0.1); }
/* ⚠️ Le choix se dit par la BORDURE, jamais par l'opacité (règle du dépôt :
   l'opacité sur un élément actionnable ment sur son état). */
.agar-mode.choisi { border-color: #7ac74f; background: rgba(122, 199, 79, 0.14); }
.agar-mode small { color: #9fbfae; font-size: 11.5px; line-height: 1.35; }
.agar-mode-emoji { font-size: 24px; }
.agar-mode-pop { font-size: 11px; color: #d9a441; font-variant-numeric: tabular-nums; }
.agar-jouer { min-width: 180px; font-size: 16px; }
.agar-menu-volets { display: flex; gap: 8px; }
.agar-menu-volet {
  width: min(92%, 460px); padding: 12px 14px;
  border-radius: 12px; background: rgba(255, 255, 255, 0.06);
  display: flex; flex-direction: column; gap: 8px; text-align: left;
}
.agar-menu-aide { margin: 0; font-size: 12px; color: #9fbfae; }
.agar-pref { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }

/* 📊 Les statistiques — mêmes pastilles au menu et au panneau de mort. */
.agar-stats-moi, .agar-mort-stats {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.agar-stat {
  display: flex; flex-direction: column; align-items: center;
  min-width: 84px; padding: 8px 10px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
}
.agar-stat strong { font-size: 17px; color: #d9a441; font-variant-numeric: tabular-nums; }
.agar-stat small { font-size: 10.5px; color: #9fbfae; }
.agar-pantheon-titre { color: #d9a441; }
.agar-pantheon { display: flex; flex-direction: column; gap: 4px; }
.agar-pantheon-ligne {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 13px; font-variant-numeric: tabular-nums;
}
.agar-mort-boutons { display: flex; gap: 10px; }

@media (max-width: 640px) {
  .agar-mode { width: 138px; }
  .agar-menu-titre strong { font-size: 24px; }
}

/* ⛶ Le bouton plein écran — coin haut-droit, discret mais atteignable. */
.agar-plein {
  position: absolute; top: 10px; right: 12px; z-index: 3;
  width: 34px; height: 34px; padding: 0;
  border-radius: 9px; border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(14, 26, 20, 0.72); color: #e8f5ea;
  font-size: 17px; line-height: 1; cursor: pointer;
}
.agar-plein:hover { background: rgba(14, 26, 20, 0.9); }
/* ⚠️ En plein écran, la scène EST l'écran : le canvas doit le remplir. */
.agar-scene:fullscreen { width: 100vw; height: 100vh; border-radius: 0; }
.agar-scene:fullscreen .agar-canvas { width: 100vw; height: 100vh; }

/* ⏸ La pause (Échap) et le bouton quitter du spectateur. */
.agar-pause {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 18px; text-align: center;
  background: rgba(14, 26, 20, 0.82); color: #e8f5ea;
}
.agar-pause strong { font-size: 24px; }
.agar-quitter { font-size: 18px; }
.agar-regarder { align-self: center; }

/* 🍴 Le fil des mises à mort — sous le HUD, s'efface tout seul. */
.agar-feed {
  position: absolute; top: 46px; left: 12px; z-index: 2;
  display: flex; flex-direction: column; gap: 3px;
  pointer-events: none;
}
.agar-feed-ligne {
  padding: 3px 9px; border-radius: 8px;
  background: rgba(14, 26, 20, 0.66); color: #e8f5ea;
  font-size: 12px; font-weight: 700;
  animation: agar-feed-vie 6s forwards;
}
@keyframes agar-feed-vie { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
/* ⏸ Le bouton pause, sous le plein écran. */
.agar-bouton-pause { top: 50px; }
/* 📱 Les gestes au tactile — gros, aux coins bas, loin du pouce de visée. */
.agar-tactile {
  position: absolute; z-index: 3;
  /* ⚠️ safe-area : sur un téléphone à encoche/barre, 14px passeraient SOUS la
     barre système — le bouton serait à moitié inatteignable. */
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  width: 64px; height: 64px; padding: 0;
  border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.28);
  background: rgba(14, 26, 20, 0.75); font-size: 28px; line-height: 1;
  cursor: pointer; touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
}
.agar-tactile:active { background: rgba(122, 199, 79, 0.35); }
/* À DROITE : le pad directionnel vit à gauche, sous l'autre pouce. */
.agar-tactile-split { right: calc(14px + env(safe-area-inset-right, 0px)); }
.agar-tactile-eject { right: calc(92px + env(safe-area-inset-right, 0px)); }

/* 🕹️ Le pad directionnel flottant — il naît là où le pouce se pose. */
.agar-pad {
  position: absolute; z-index: 3; pointer-events: none;
  width: 116px; height: 116px; margin: -58px 0 0 -58px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: rgba(14, 26, 20, 0.35);
}
.agar-pad-tige {
  position: absolute; left: 50%; top: 50%;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(122, 199, 79, 0.55);
  border: 2px solid rgba(232, 245, 234, 0.5);
  transform: translate(-50%, -50%);
}

/* 🫧 Le fond vivant du menu — huit blobs en dérive, CSS pur. */
.agar-menu-fond { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.agar-menu-blob {
  position: absolute; border-radius: 50%;
  opacity: 0.16; filter: blur(1px);
  animation: agar-derive 16s ease-in-out infinite alternate;
}
.agar-menu-blob:nth-child(1) { width: 90px; height: 90px; background: #7ac74f; top: 12%; left: 8%; animation-duration: 14s; }
.agar-menu-blob:nth-child(2) { width: 46px; height: 46px; background: #6ec6d9; top: 68%; left: 15%; animation-duration: 19s; }
.agar-menu-blob:nth-child(3) { width: 130px; height: 130px; background: #d9a441; top: 55%; left: 78%; animation-duration: 23s; }
.agar-menu-blob:nth-child(4) { width: 30px; height: 30px; background: #c77ac7; top: 25%; left: 70%; animation-duration: 11s; }
.agar-menu-blob:nth-child(5) { width: 64px; height: 64px; background: #e07a5f; top: 80%; left: 55%; animation-duration: 17s; }
.agar-menu-blob:nth-child(6) { width: 24px; height: 24px; background: #f2cc8f; top: 8%; left: 45%; animation-duration: 13s; }
.agar-menu-blob:nth-child(7) { width: 78px; height: 78px; background: #94e2d5; top: 40%; left: 3%; animation-duration: 21s; }
.agar-menu-blob:nth-child(8) { width: 40px; height: 40px; background: #f38ba8; top: 15%; left: 88%; animation-duration: 15s; }
@keyframes agar-derive {
  from { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(34px, -26px) scale(1.12); }
  to   { transform: translate(-22px, 20px) scale(0.94); }
}
@media (prefers-reduced-motion: reduce) { .agar-menu-blob { animation: none; } }
/* Le menu passe DEVANT son fond. */
.agar-menu { position: relative; z-index: 1; }

/* 🏅 Le rang au panneau de mort. */
.agar-mort-rang { color: #ffd76a; font-weight: 800; font-size: 15px; }

/* 🚩 Le volet de signalement dans la pause. */
.agar-signaler {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  max-width: 440px;
}
.agar-signaler-nom { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }

/* Le retour au menu depuis un refus — jamais de cul-de-sac. */
.agar-message-retour { display: block; margin: 6px auto 0; }
