/* ═══════════════════════════════════════════════════════════
   JEU DU JOUR PUBLIC (Global Daily)
   ═══════════════════════════════════════════════════════════ */

.daily-page {
  display: flex; flex-direction: column; align-items: center;
  min-height: 100vh; min-height: 100dvh;
  padding-bottom: 4.5rem; /* espace pour le bouton BMC fixe */
}

/* ─── BANNIÈRE DE PRÉVISUALISATION (staff uniquement) ─── */
.daily-preview-banner {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: 1rem; flex-wrap: wrap;
  padding: 0.6rem 1.2rem; flex-shrink: 0;
  background: rgba(251,191,36,0.14); border-bottom: 1px solid var(--warning);
  color: var(--warning); font-family: var(--mono); font-size: 0.82rem;
  text-align: center;
}
.daily-preview-exit {
  color: var(--warning); font-weight: 700; text-decoration: underline;
  white-space: nowrap;
}
.daily-preview-exit:hover { opacity: 0.8; }

/* ─── TOPBAR ─── */
.daily-topbar {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.5rem; border-bottom: 1px solid var(--border);
  background: var(--bg2); flex-shrink: 0;
}
.daily-logo {
  font-family: var(--sans); font-weight: 800; font-size: 1rem; letter-spacing: 0.02em;
  color: var(--text); text-decoration: none;
}
.daily-login-btn { white-space: nowrap; }

/* ─── HERO ─── */
.daily-hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 0.5rem; padding: clamp(1.4rem, 5vw, 2.4rem) 1.2rem clamp(0.6rem, 3vw, 1.2rem);
  max-width: 560px;
}
.daily-hero-badges { display: flex; align-items: center; justify-content: center; gap: 0.4rem; flex-wrap: wrap; }
.daily-hero-badge {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em;
  color: var(--accent); background: rgba(124,106,255,0.1);
  border: 1px solid rgba(124,106,255,0.28); border-radius: 20px;
  padding: 0.25rem 0.75rem;
}
.daily-hero-badge--theme { color: var(--success, #22c55e); background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.28); }
.daily-hero-badge--sub { color: var(--text-dim); background: var(--bg3); border-color: var(--border); }
.daily-hero-title {
  font-size: clamp(1.6rem, 5vw, 2.1rem); font-weight: 800;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.daily-hero-sub { color: var(--text-dim); font-size: 0.88rem; line-height: 1.55; max-width: 440px; }

/* ─── GAME AREA (réutilise .game-area / .start-screen / .game-playing de room.css) ─── */
.daily-page .game-area { width: 100%; max-width: 720px; flex: none; }

/* ─── FOOTER CTA ("Envie de jouer entre amis ?") ───────────────────────────
   Mobile (<768px) : masqué tant que la partie n'est pas terminée (score
   affiché + pop-up fermée) — le JS ajoute .daily-game-finished sur <body>.
   Desktop moyen (768–1299px) : reste dans le flux normal, sous le jeu
   (pas assez de place pour une colonne fixe sans recouvrir le jeu centré).
   Grand écran (≥1300px) : colonne fixe à droite, centrée verticalement,
   plus étroite et plus haute — largement assez de marge pour ne jamais
   chevaucher le jeu (centré à max-width 720px) ni décaler son centrage. */
.daily-footer-cta {
  width: 100%; max-width: 640px; margin-top: 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.1rem 1.3rem;
  transition: opacity 0.4s ease;
}
.daily-footer-cta-text { font-size: 0.82rem; color: var(--text-dim); line-height: 1.5; flex: 1; min-width: 220px; }
.daily-footer-cta-text strong { display: block; color: var(--text); font-size: 0.92rem; margin-bottom: 0.15rem; }

@media (max-width: 767px) {
  .daily-footer-cta { display: none; }
  body.daily-game-finished .daily-footer-cta { display: flex; }
}

@media (min-width: 1300px) {
  .daily-footer-cta {
    position: fixed; z-index: 20;
    right: clamp(0.8rem, 3vw, 2rem); top: 50%; transform: translateY(-50%);
    width: 230px; max-width: 230px; margin-top: 0;
    flex-direction: column; justify-content: center; align-items: center;
    text-align: center; gap: 1rem; padding: 1.8rem 1.3rem;
  }
  .daily-footer-cta-text { min-width: 0; }
  .daily-footer-cta-text strong { margin-bottom: 0.3rem; }
}

/* ─── PARTAGER ─── */
.daily-share-row {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  margin-top: 0.5rem; width: 100%;
}
.daily-share-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; color: #fff; border-radius: 10px;
  padding: 0.65rem 1.4rem; font-family: var(--sans); font-weight: 700;
  font-size: 0.88rem; cursor: pointer; transition: opacity 0.15s, transform 0.15s;
  width: 100%; max-width: 320px;
}
.daily-share-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.daily-share-note { font-size: 0.72rem; color: var(--text-dim); font-family: var(--mono); }

/* ─── DÉTAIL REPLIABLE (score-breakdown) ─── */
.daily-breakdown-details { width: 100%; margin-top: 0.4rem; }
.daily-breakdown-summary {
  cursor: pointer; font-size: 0.78rem; color: var(--accent); font-weight: 600;
  padding: 0.35rem 0; list-style: none; user-select: none;
}
.daily-breakdown-summary::-webkit-details-marker { display: none; }
.daily-breakdown-summary::before { content: '▸ '; }
.daily-breakdown-details[open] .daily-breakdown-summary::before { content: '▾ '; }

/* ─── COPIE MANUELLE (dernier recours si presse-papier indisponible) ─── */
.daily-share-fallback {
  position: fixed; inset: 0; z-index: 3100; display: none;
  align-items: center; justify-content: center; padding: 1.2rem;
  background: rgba(10,10,14,0.72);
}
.daily-share-fallback.visible { display: flex; }
.daily-share-fallback-inner {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 16px;
  padding: 1.2rem; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 0.6rem;
}
.daily-share-fallback-inner p { font-size: 0.8rem; color: var(--text-dim); margin: 0; }
.daily-share-fallback-inner textarea {
  width: 100%; min-height: 110px; resize: vertical; font-family: var(--mono); font-size: 0.78rem;
  background: var(--bg3); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.6rem; box-sizing: border-box;
}
.daily-share-fallback-close {
  align-self: flex-end; background: var(--bg3); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.4rem 0.9rem; font-size: 0.8rem; cursor: pointer;
}

/* ─── TOAST (léger, sans dépendre de room-admin.js) ─── */
.daily-toast {
  position: fixed; left: 50%; bottom: 5.5rem; transform: translateX(-50%) translateY(12px);
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  padding: 0.6rem 1rem; border-radius: 10px; font-size: 0.82rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s; z-index: 3000; max-width: 90vw; text-align: center;
}
.daily-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ═══════════════════════════════════════════════════════════
   MODALE EXPLICATIVE (rooms / score / saison) — fin de partie
   ═══════════════════════════════════════════════════════════ */
.daily-explainer-box {
  max-width: 420px; position: relative; padding-top: 2.25rem;
}

.daily-explainer-close {
  position: absolute; top: 0.9rem; right: 0.9rem;
  width: 40px; height: 40px; padding: 0; border: none; background: none;
  cursor: not-allowed; display: flex; align-items: center; justify-content: center;
}
.daily-explainer-close.ready { cursor: pointer; }
.daily-explainer-close:disabled { cursor: not-allowed; }

.daily-explainer-close-ring { position: absolute; inset: 0; width: 40px; height: 40px; transform: rotate(-90deg); }
.daily-explainer-close-track { fill: none; stroke: var(--border); stroke-width: 2.5; }
.daily-explainer-close-fill {
  fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round;
  stroke-dasharray: 106.8; stroke-dashoffset: 106.8;
}
.daily-explainer-close-x {
  position: relative; width: 14px; height: 14px;
  stroke: var(--text-dim); stroke-width: 2; stroke-linecap: round;
  transition: stroke 0.2s;
}
.daily-explainer-close.ready .daily-explainer-close-x { stroke: var(--text); }
.daily-explainer-close.ready:hover .daily-explainer-close-x { stroke: var(--accent); }

.daily-explainer-header { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.3rem; }
.daily-explainer-emoji { font-size: 2rem; }
.daily-explainer-title { font-size: 1.15rem; font-weight: 800; }

.daily-explainer-steps { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 0.4rem; }
.daily-explainer-step {
  display: flex; gap: 0.75rem; align-items: flex-start;
  opacity: 0; transform: translateY(6px);
  animation: dailyStepIn 0.5s ease-out forwards;
  animation-delay: var(--d, 0s);
}
.daily-explainer-step-icon {
  font-size: 1.3rem; flex-shrink: 0; width: 2rem; text-align: center;
}
.daily-explainer-step strong { display: block; font-size: 0.88rem; color: var(--text); margin-bottom: 0.15rem; }
.daily-explainer-step p { font-size: 0.8rem; color: var(--text-dim); line-height: 1.45; margin: 0; }

@keyframes dailyStepIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.daily-explainer-cta {
  display: block; text-align: center; margin-top: 0.4rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; text-decoration: none; font-weight: 700; font-size: 0.88rem;
  border-radius: 10px; padding: 0.7rem 1rem;
}
.daily-explainer-cta:hover { opacity: 0.9; }

@media (max-width: 560px) {
  .daily-hero { padding-left: 0.8rem; padding-right: 0.8rem; }
  .daily-footer-cta { flex-direction: column; align-items: stretch; text-align: center; }
}
