/* ============================
   Thème global PauseBrain jeux (clair, sobre)
   ============================ */

:root {
  --pb-page-bg: #f3f4f6;
  /* gris très clair */
  --pb-game-bg: #f9fafb;
  /* fond du bloc jeu */
  --pb-surface: #ffffff;
  /* cartes / panneaux */
  --pb-surface-soft: #f9fafb;
  --pb-border-subtle: #e5e7eb;

  --pb-text-main: #111827;
  /* texte principal */
  --pb-text-soft: #6b7280;
  /* texte secondaire */

  /* Couleurs d’accent très lisibles */
  --pb-accent: #2563eb;
  /* bleu */
  --pb-good: #16a34a;
  /* vert */
  --pb-warn: #ea580c;
  /* orange */
  --pb-danger: #dc2626;
  /* rouge */

  --pb-radius-lg: 16px;
  --pb-radius-md: 12px;
  --pb-radius-pill: 999px;
}

/* Pour la page globale si tu veux l'utiliser */
body.pausebrain-games-page {
  background: var(--pb-page-bg);
}

/* ============================
     Shell générique de jeu
     ============================ */

.pb-game-shell {
  position: relative;
  border-radius: var(--pb-radius-lg);
  padding: 16px 16px 20px;
  background: var(--pb-game-bg);
  color: var(--pb-text-main);
  border: 1px solid var(--pb-border-subtle);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  max-width: 960px;
  margin-inline: auto;
  animation: pb-shell-in 200ms ease-out;
}

.pb-game-shell-inner {
  position: relative;
}

/* En-tête de jeu */

.pb-game-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.pb-game-header-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pb-game-title {
  font-size: 1rem;
  font-weight: 600;
}

.pb-game-subtitle {
  font-size: 0.8rem;
  color: var(--pb-text-soft);
}

/* Zone d’infos (timer, score, etc.) */

.pb-game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

/* Badges / tags */

.pb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--pb-radius-pill);
  font-size: 0.72rem;
  background: #ffffff;
  border: 1px solid var(--pb-border-subtle);
  color: var(--pb-text-soft);
}

.pb-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #9ca3af;
}

.pb-chip--timer .pb-chip-dot {
  background: var(--pb-warn);
}

.pb-chip--score .pb-chip-dot {
  background: var(--pb-good);
}

.pb-chip--difficulty .pb-chip-dot {
  background: var(--pb-accent);
}

/* ============================
     Layout contenu principal
     ============================ */

.pb-game-body {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 8px;
}

.pb-game-main {
  background: var(--pb-surface);
  border-radius: var(--pb-radius-md);
  padding: 10px 10px 12px;
  border: 1px solid var(--pb-border-subtle);
}

.pb-game-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Section latérale (difficulté, règles, stats, etc.) */

.pb-side-card {
  background: var(--pb-surface);
  border-radius: var(--pb-radius-md);
  padding: 8px 10px 10px;
  border: 1px solid var(--pb-border-subtle);
}

.pb-side-card-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pb-text-soft);
  margin-bottom: 6px;
}

/* ============================
     Boutons génériques
     ============================ */

.pb-btn {
  border-radius: var(--pb-radius-pill);
  border: 1px solid var(--pb-border-subtle);
  padding: 6px 12px;
  font-size: 0.8rem;
  background: #ffffff;
  color: var(--pb-text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease,
    transform 0.05s ease,
    box-shadow 0.08s ease;
}

.pb-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

.pb-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.pb-btn-icon {
  font-size: 0.9rem;
}

/* ============================
     Cards de difficulté
     ============================ */

.pb-difficulty-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 640px) {
  .pb-difficulty-cards {
    flex-direction: row;
  }
}

.pb-difficulty-card {
  flex: 1;
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid var(--pb-border-subtle);
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  font-size: 0.8rem;
  display: flex;
  gap: 8px;
  align-items: center;
  position: relative;
  transition:
    transform 0.08s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease,
    background-color 0.12s ease;
}

.pb-difficulty-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

/* Pastille d’icône */

.pb-difficulty-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  background: var(--pb-surface-soft);
}

.pb-difficulty-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.pb-difficulty-title {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pb-difficulty-subtitle {
  font-size: 0.7rem;
  color: var(--pb-text-soft);
}

/* État actif générique */

.pb-difficulty-card.pb-difficulty-card--active {
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.02);
}

/* ============================
     Couleurs par niveau
     (vert / orange / rouge sobres)
     ============================ */

/* FACILE – VERT */
.pb-difficulty-card[data-difficulty="facile"] {
  border-color: rgba(22, 163, 74, 0.35);
  background: #ecfdf3;
}

.pb-difficulty-card[data-difficulty="facile"] .pb-difficulty-icon {
  background: #dcfce7;
  color: #15803d;
}

.pb-difficulty-card.pb-difficulty-card--active[data-difficulty="facile"] {
  border-color: #16a34a;
}

/* NORMAL – ORANGE */
.pb-difficulty-card[data-difficulty="normal"] {
  border-color: rgba(234, 88, 12, 0.35);
  background: #fff7ed;
}

.pb-difficulty-card[data-difficulty="normal"] .pb-difficulty-icon {
  background: #ffedd5;
  color: #c2410c;
}

.pb-difficulty-card.pb-difficulty-card--active[data-difficulty="normal"] {
  border-color: #ea580c;
}

/* DIFFICILE – ROUGE */
.pb-difficulty-card[data-difficulty="difficile"] {
  border-color: rgba(220, 38, 38, 0.4);
  background: #fef2f2;
}

.pb-difficulty-card[data-difficulty="difficile"] .pb-difficulty-icon {
  background: #fee2e2;
  color: #b91c1c;
}

.pb-difficulty-card.pb-difficulty-card--active[data-difficulty="difficile"] {
  border-color: #dc2626;
}

/* Le texte du niveau actif légèrement renforcé */
.pb-difficulty-card.pb-difficulty-card--active .pb-difficulty-title {
  color: var(--pb-text-main);
}

.pb-pause-progress {
  padding: 8px 12px;
  margin-bottom: 8px;
  background: #0f172a;
  color: #e5e7eb;
  border-radius: 999px;
  font-size: 13px;
}

.pb-pause-progress-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pb-pause-progress-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.pb-pause-progress-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: #1f2937;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pb-pause-progress-text strong {
  font-weight: 600;
}

/* Évite tout débordement horizontal */
.pb-pause-progress {
  max-width: 100%;
  box-sizing: border-box;
}

/* Mobile */
@media (max-width: 600px) {
  .pb-pause-progress {
    padding: 8px 10px;
    margin-bottom: 10px;
    border-radius: 14px;
    /* un peu moins "capsule" pour mieux gérer le texte */
    font-size: 12px;
  }

  .pb-pause-progress-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .pb-pause-progress-pill {
    font-size: 10px;
    padding: 2px 6px;
  }

  .pb-pause-progress-text {
    font-size: 12px;
    line-height: 1.3;
    word-break: break-word;
  }
}

/* ===========================
   POPUP "Tu n'as pas fini ta pause"
   (version carte en bas à droite)
   =========================== */

.pb-pause-reminder-popup {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  max-width: 380px;
  width: calc(100% - 32px);
  /* pour ne pas coller aux bords sur petits écrans */
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 160ms ease-out, transform 160ms ease-out;
  pointer-events: none;
  /* évite les clics avant l'anim */
}

.pb-pause-reminder-popup--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.pb-pause-reminder-popup-inner {
  background: #ffffff;
  color: #111827;
  border-radius: 16px;
  padding: 18px 18px 16px;
  /* + de padding */
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.25),
    0 0 0 1px rgba(148, 163, 184, 0.35);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 140px;
  /* 👉 force une hauteur mini */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* espace bien titre/texte/boutons */
}

/* Titre + petite icône */

.pb-pause-reminder-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.pb-pause-reminder-title::before {
  content: "⏱";
  font-size: 18px;
}

/* Texte */

.pb-signup-reminder-text {
  font-size: 13px;
  color: #4b5563;
  margin-bottom: 18px;
  line-height: 1.7;
}

.pb-signup-reminder-text-sub {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
  text-align: center;
}

/* Zone boutons */

.pb-signup-reminder-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.pb-signup-reminder-later {
  background: none;
  border: none;
  padding: 0;
  margin-top: 6px;
  font-size: 12px;
  color: #9ca3af;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  align-self: flex-end;
  /* à droite dans la popup */
}

.pb-signup-reminder-later:hover {
  color: #6b7280;
}


/* Boutons */

.pb-pause-reminder-btn {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid transparent;
  font-weight: 500;
  line-height: 1.2;
}

/* Bouton principal (reprendre) */

.pb-pause-reminder-btn--primary {
  background: #111827;
  color: #f9fafb;
  border-color: #111827;
}

.pb-pause-reminder-btn--primary:hover {
  background: #020617;
}

/* Bouton secondaire (plus tard) */

.pb-pause-reminder-btn--ghost {
  background: #f9fafb;
  color: #374151;
  border-color: #e5e7eb;
}

.pb-pause-reminder-btn--ghost:hover {
  background: #e5e7eb;
}

/* Mobile : on garde en bas mais on laisse plus de place */

@media (max-width: 640px) {
  .pb-pause-reminder-popup {
    right: 8px;
    left: 8px;
    top: 15px;
    bottom: 10px;
    width: auto;
    max-width: 100%;
  }

  .pb-pause-reminder-popup-inner {
    padding: 12px 12px 10px;
    border-radius: 14px;
  }

  .pb-pause-reminder-title {
    font-size: 13px;
  }

  .pb-pause-reminder-text {
    font-size: 12px;
  }
}


/* ===========================
   POPUP VISITEUR : CRÉER UN COMPTE / SE CONNECTER
   (modal centré, fond plein écran)
   =========================== */

.pb-signup-reminder-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;

  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;

  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(15, 23, 42, 0.65);
  /* overlay sombre sur tout l'écran */

  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease-out, transform 160ms ease-out;
  pointer-events: none;
}

.pb-signup-reminder-popup--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Carte intérieure */

.pb-signup-reminder-popup-inner {
  background: #ffffff;
  color: #111827;
  border-radius: 20px;
  padding: 22px 22px 18px;
  max-width: 460px;
  width: calc(100% - 40px);

  box-shadow:
    0 22px 55px rgba(15, 23, 42, 0.35),
    0 0 0 1px rgba(148, 163, 184, 0.45);

  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Titre */

.pb-signup-reminder-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.pb-signup-reminder-title::before {
  content: "🎮";
  font-size: 20px;
}

/* Texte */

.pb-signup-reminder-text {
  font-size: 13px;
  color: #4b5563;
  margin-bottom: 18px;
  line-height: 1.7;
}

/* Ligne d'actions (boutons + "Plus tard") */

.pb-signup-reminder-actions {
  display: flex;
  justify-content: center;
  /* 👉 boutons centrés */
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}

/* Boutons principaux */

.pb-signup-reminder-btn {
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

/* Créer un compte (primaire) */

.pb-signup-reminder-btn--primary {
  background: #0f172af0;
  color: #ffffff;
  border-color: #0f172af0;
}

.pb-signup-reminder-btn--primary:hover {
  background: #253863f0;
}

/* Se connecter (secondaire) */

.pb-signup-reminder-btn--secondary {
  background: #f9fafb;
  color: #374151;
  border-color: #e5e7eb;
}

.pb-signup-reminder-btn--secondary:hover {
  background: #e5e7eb;
}

/* Lien "Plus tard" (sur la même ligne que les boutons) */

.pb-signup-reminder-later {
  background: none;
  border: none;
  padding: 0 2px;
  margin-top: 20px;
  font-size: 12px;
  color: #9ca3af;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pb-signup-reminder-later:hover {
  color: #6b7280;
}

/* Mobile */

@media (max-width: 640px) {
  .pb-signup-reminder-popup-inner {
    max-width: 100%;
    width: calc(100% - 24px);
    padding: 18px 16px 14px;
    border-radius: 18px;
    min-height: 0;
  }

  .pb-signup-reminder-title {
    font-size: 14px;
  }

  .pb-signup-reminder-text {
    font-size: 12px;
  }

  .pb-signup-reminder-btn {
    font-size: 12px;
    padding: 7px 14px;
  }
}

/* Overlay plein écran */
.pb-pause-summary-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  /* #0f172a avec opacité */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease-out;
  z-index: 9999;
}

.pb-pause-summary-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

/* Conteneur de la popup */
.pb-pause-summary {
  background: #0f172a;
  color: #e5e7eb;
  border-radius: 16px;
  padding: 20px 24px;
  max-width: 720px;
  width: 95%;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  transform: translateY(12px);
  opacity: 0;
  transition: transform 150ms ease-out, opacity 150ms ease-out;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pb-pause-summary--visible {
  transform: translateY(0);
  opacity: 1;
}

/* Header de la popup */
.pb-pause-summary-header {
  margin-bottom: 14px;
}

.pb-pause-summary-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
}

.pb-pause-summary-sub {
  margin: 0;
  font-size: 14px;
  color: #cbd5f5;
}

.pb-pause-summary-sub strong {
  font-weight: 600;
}

/* Table */
.pb-pause-summary-table-wrapper {
  max-height: 260px;
  overflow: auto;
  margin: 14px -4px 16px;
  padding: 0 4px;
}

.pb-pause-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.pb-pause-summary-table th,
.pb-pause-summary-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  text-align: left;
  white-space: nowrap;
}

.pb-pause-summary-table th {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  background: rgba(15, 23, 42, 0.9);
  position: sticky;
  top: 0;
  z-index: 1;
}

.pb-pause-summary-row:nth-child(even) td {
  background: rgba(15, 23, 42, 0.4);
}

.pb-pause-summary-cell-name {
  max-width: 220px;
  white-space: normal;
}

.pb-pause-summary-empty {
  text-align: center;
  padding: 18px 8px;
  color: #9ca3af;
}

/* Bouton de fermeture */
.pb-pause-summary-close {
  border: none;
  background: #f97316;
  color: #111827;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pb-pause-summary-close:hover {
  background: #fb923c;
}

.pb-pause-summary-close:active {
  transform: translateY(1px);
}

/* ============================
     Animations & responsive
     ============================ */

@keyframes pb-shell-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .pb-game-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .pb-game-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .pb-game-meta {
    justify-content: flex-start;
  }
}