/* arcade-end.css · overlay fin de partie Cumulus (pseudo + Top 10 + continuer)
   Theme-neutral : fonctionne sur n'importe quel fond de jeu. Mobile-first.
   Accent thémable via les variables --ae-* (personnalisation BRAND). */

.ae-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(8, 10, 16, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
  animation: ae-fade 0.18s ease-out;
}

@keyframes ae-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ae-pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

.ae-panel {
  /* Accent thémable (BRAND) · teal par défaut */
  --ae-accent: #2dd4bf;
  --ae-accent-strong: #14b8a6;
  --ae-accent-ink: #042b25;
  --ae-accent-soft: rgba(45, 212, 191, 0.10);
  --ae-accent-line: rgba(45, 212, 191, 0.30);

  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  box-sizing: border-box;
  padding: 24px 24px 18px;
  border-radius: 18px;
  background: #11181c;
  color: #f1f3f8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  text-align: center;
  animation: ae-pop 0.22s cubic-bezier(.2,.8,.3,1);
}

/* Croix de fermeture */
.ae-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(241, 243, 248, 0.8);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, color 0.12s, transform 0.12s;
}
.ae-close:hover { background: rgba(255, 255, 255, 0.12); color: #fff; transform: rotate(90deg); }
.ae-close:focus-visible { outline: 2px solid var(--ae-accent); outline-offset: 2px; }

/* Bandeau « nouveau record » */
.ae-record {
  display: inline-block;
  margin: 0 auto 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--ae-accent-ink);
  background: var(--ae-accent);
  box-shadow: 0 0 22px var(--ae-accent-line);
}

.ae-title {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.ae-reason {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(241, 243, 248, 0.62);
}

.ae-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 8px 0 16px;
}
.ae-score-k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(241, 243, 248, 0.55);
}
.ae-score-v {
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ae-accent);
  text-shadow: 0 0 26px var(--ae-accent-line);
}

.ae-form { margin: 0 0 14px; text-align: left; }
.ae-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 6px;
  color: rgba(241, 243, 248, 0.78);
}
.ae-row { display: flex; gap: 8px; }
.ae-input {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #f1f3f8;
  font: 600 15px system-ui, sans-serif;
}
.ae-input::placeholder { color: rgba(241, 243, 248, 0.4); }
.ae-input:focus-visible,
.ae-btn:focus-visible {
  outline: 2px solid var(--ae-accent);
  outline-offset: 2px;
}

.ae-btn {
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 9px 13px;
  font: 600 14px system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: filter 0.12s, opacity 0.12s;
}
.ae-btn:active { filter: brightness(0.92); }
.ae-btn:disabled { opacity: 0.7; cursor: default; }

.ae-primary {
  background: var(--ae-accent);
  border-color: var(--ae-accent);
  color: var(--ae-accent-ink);
}
.ae-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f1f3f8;
}
.ae-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(241, 243, 248, 0.85);
}

.ae-sub {
  margin: 4px 0 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(241, 243, 248, 0.7);
}

.ae-board {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  max-height: 230px;
  overflow-y: auto;
  text-align: left;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.ae-board li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.ae-board li:last-child { border-bottom: 0; }
.ae-rank {
  flex: 0 0 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ae-accent);
  text-align: right;
}
.ae-nick {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ae-nick .ae-nm {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ae-nick .ae-meta {
  font-size: 11px;
  font-weight: 600;
  color: rgba(241, 243, 248, 0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ae-sc {
  flex: 0 0 auto;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(241, 243, 248, 0.92);
}
.ae-empty {
  padding: 14px 12px !important;
  text-align: center;
  font-size: 13px;
  color: rgba(241, 243, 248, 0.55);
}

.ae-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ae-actions .ae-btn { width: 100%; }

.ae-note {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(241, 243, 248, 0.45);
}

/* ---- Défi viral : bloc de partage ---- */
.ae-share {
  margin: 4px 0 16px;
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid var(--ae-accent-line);
  background: var(--ae-accent-soft);
}
.ae-share .ae-sub { margin-top: 0; }
.ae-share-tag {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(241, 243, 248, 0.72);
}
/* Badge parcours : TOUJOURS sur une seule ligne */
.ae-badge {
  font-size: 21px;
  line-height: 1.1;
  letter-spacing: 1px;
  margin: 0 0 12px;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -ms-overflow-style: none;
  scrollbar-width: none;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", system-ui, sans-serif;
}
.ae-badge::-webkit-scrollbar { display: none; }
.ae-share-actions { margin: 0 0 10px; }
.ae-share-actions .ae-btn { width: 100%; }
.ae-btn.ae-ok {
  background: #4cd07d;
  border-color: #4cd07d;
  color: #06210f;
}
.ae-social {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
}
.ae-soc {
  flex: 1 1 auto;
  min-width: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 8px 9px;
  font: 600 13px system-ui, sans-serif;
  background: rgba(255, 255, 255, 0.06);
  color: #f1f3f8;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: filter 0.12s, background 0.12s;
}
.ae-soc:hover { background: rgba(255, 255, 255, 0.12); }
.ae-soc:active { filter: brightness(0.92); }
.ae-soc:focus-visible {
  outline: 2px solid var(--ae-accent);
  outline-offset: 2px;
}
.ae-soc svg { width: 15px; height: 15px; }
.ae-soc[hidden] { display: none; }

/* Confettis de victoire (record) */
.ae-confetti {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}

@media (max-width: 460px) {
  .ae-panel { padding: 22px 18px 16px; }
  .ae-score-v { font-size: 36px; }
  .ae-title { font-size: 20px; }
  .ae-badge { font-size: 17px; letter-spacing: 0.5px; }
  .ae-soc { min-width: 72px; font-size: 12px; }
}

/* Rituel quotidien : série de jours (local) + invitation à revenir. Ton chaleureux, jamais coercitif. */
.ae-daily {
  margin: 10px auto 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.ae-streak {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 11px;
  border-radius: 999px;
  background: var(--ae-accent-soft);
  border: 1px solid var(--ae-accent-line);
  animation: ae-pop 0.32s ease-out both;
}
.ae-streak-flame { font-size: 17px; line-height: 1; }
.ae-streak-txt {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.15;
}
.ae-streak-day {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--ae-accent);
  opacity: 0.85;
}
.ae-streak-n {
  font-size: 13.5px;
  font-weight: 700;
  color: #f1f3f8;
}
.ae-comeback {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #aeb6c2;
  text-align: center;
  line-height: 1.4;
}
@media (prefers-reduced-motion: reduce) {
  .ae-streak { animation: none; }
}
