:root{
  --cw-ink:#1e2433;
  --cw-cover:#232c45;
  --cw-cover-dark:#161d30;
  --cw-paper:#f6f7fb;
  --cw-line:#e2e5f0;
  --cw-purple:#7c6cff;
  --cw-purple-dark:#5b4bd6;
  --cw-purple-light:#efeaff;
  --cw-green:#1f9d6c;
  --cw-green-bg:#e3f6ec;
  --cw-red:#d1495b;
  --cw-red-bg:#fbe8ea;
  --cw-radius-sm: 6px;
  --cw-radius-md: 10px;
  --cw-radius-lg: 16px;
  --cw-shadow-soft: 0 2px 8px rgba(30, 36, 51, 0.06);
  --cw-shadow-elevated: 0 20px 40px -12px rgba(20, 20, 40, 0.28), 0 8px 16px -8px rgba(20, 20, 40, 0.18);
  --cw-ease: cubic-bezier(0.4, 0, 0.2, 1);
--dark-color: #172033;
--dark-blue: #1e3a5f;
}

.card-time i{ margin-right: 4px; color: white; }
.card-time {
  color: white;
  padding: 4px 6px;
  border-radius: 10px;
}
/* ---- Bouton "Jouer aux mots croisés" : variante du .card-cta existant ---- */
.card-cta.cta-jouer1,
.card-cta.cta-jouer2{
  transition: background .2s var(--cw-ease), border-color .2s var(--cw-ease),
              color .2s var(--cw-ease), transform .15s var(--cw-ease), box-shadow .2s var(--cw-ease);
}
.card-cta.cta-jouer1{
  border: 1px solid var(--cw-purple);
  background: var(--cw-purple-light);
  color: var(--cw-ink);
}
.card-cta.cta-jouer1:hover{
  background: var(--cw-purple-dark);
  border-color: var(--cw-purple-dark);
  color:#fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -4px rgba(91, 75, 214, 0.45);
}
.card-cta.cta-jouer2{
  border: 1px solid var(--cw-purple);
  background: var(--cw-purple-dark);
  color: #fff;
}
.card-cta.cta-jouer2:hover{
  background: var(--cw-purple-light);
  border-color: var(--cw-purple-dark);
  color: var(--cw-ink);
  transform: translateY(-1px);
  box-shadow: var(--cw-shadow-soft);
}
.card-cta.cta-jouer1:active,
.card-cta.cta-jouer2:active{
  transform: translateY(0);
}
/* ==========================================================================
   Modale mots croisés
   ========================================================================== */
.cw-modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(30, 36, 51, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  backdrop-filter: blur(4px);
  visibility: hidden;
  transition: opacity 0.25s var(--cw-ease), visibility 0.25s var(--cw-ease);
}
.cw-modal-overlay.open{
  opacity: 1;
  visibility: visible;
}

.cw-modal{
  background: var(--cw-cover);
  border-radius: var(--cw-radius-lg);
  width: 80%;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--cw-shadow-elevated);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.28s var(--cw-ease), opacity 0.28s var(--cw-ease);
}
.cw-modal-overlay.open .cw-modal{
  transform: translateY(0) scale(1);
}

.cw-modal-header {
  position: relative;
  padding: 12px 70px 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  flex: 0 0 auto;
background: linear-gradient(270deg, #42a5f5, #1565c0, #061a40);
}

/* Ligne 1 */
.cw-eyebrow {
  display: block;
  text-align: left;       /* left / center / right */
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  font-weight: bolder;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

/* Ligne 2 */
.cw-modal-title {
  text-align: left;       /* left / center / right */
  color: #fff;
  font-family: var(--font-display, 'Outfit', sans-serif);
  font-size: 1.4rem;
  font-weight: bolder;letter-spacing:unset;
  margin: 0;
  line-height: 1.25;

}

/* Ligne 3 */
.cw-modal-sub {
  width: fit-content;
  margin: 0 auto;        /* gauche */
  padding: 3px 15px;
  color: #1e3a5f;
  font-size: 1rem;
  text-align: center !important;     /* contenu du sous-titre */
  background: #fff;
  border-radius: 10px;
}


/* Bouton fermer */
.cw-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: red;
  border: 1px solid rgba(255,255,255,1);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s var(--cw-ease), border-color .2s var(--cw-ease),
              color .2s var(--cw-ease), transform .25s var(--cw-ease);
  font-size: 1.15rem;
}

.cw-modal-close:hover {
  background: #fff;
  border-color: var(--cw-red);
  color: red;
  transform: rotate(90deg) scale(1.05);
}
.cw-modal-close:focus-visible{
  outline: 2px solid #fff;
  outline-offset: 2px;
}


.cw-modal-body{
  background: #f6ffff;
  padding: 20px;
  display: flex;
  gap: 22px;
  flex-wrap: nowrap;
  align-items: stretch;
  /* Le corps prend tout l'espace restant sous l'en-tête et au-dessus du pied :
     plus besoin de deviner une hauteur, ça s'adapte à la vraie taille de l'en-tête. */
  flex: 1 1 auto;
  min-height: 0;
}

.cw-grid-wrap{
  flex: 2.2 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--cw-line);
  border-radius: var(--cw-radius-md);
  box-shadow: var(--cw-shadow-soft);
  padding: 22px;
}
.cw-grid{
  display: grid;
  grid-auto-rows: auto;
  gap: 1px;
  background: #e6f9ff;
  padding: 35px;
  border-radius: 2px;
  flex-shrink: 0;
  width: max-content;
  margin: auto;
}
.cw-cell{
  position: relative;
  width: 37px;
  height: 37px;
  background: #fff;
  border: 1px solid #aaa;
  border-radius: 4px;
  transition: background .15s var(--cw-ease), box-shadow .15s var(--cw-ease);
}
.cw-cell.blocked{ background: transparent; border: none; }
.cw-cell .cw-num{
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 0.65rem;
  color: #000;
  font-weight: 700;
  pointer-events: none;
}
.cw-cell input{
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 4px;
  background: transparent;
  text-align: center;
  text-transform: uppercase;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cw-ink);
  outline: none;padding:1px;
  transition: background .15s var(--cw-ease), box-shadow .15s var(--cw-ease), color .15s var(--cw-ease);
}
.cw-cell input:focus{
  background: var(--cw-purple-light);
  box-shadow: inset 0 0 0 2px var(--cw-purple);
}
.cw-cell.correct input{
  background: var(--cw-green-bg);
  color: var(--cw-green);
  box-shadow: inset 0 0 0 2px var(--cw-green);
}
.cw-cell.incorrect input{
  background: var(--cw-red-bg);
  color: var(--cw-red);
  box-shadow: inset 0 0 0 2px var(--cw-red);
}

.cw-clues{
  flex: 1 1 200px;
  min-width: 180px;
  max-width: 260px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--cw-purple) transparent;
}
.cw-clues::-webkit-scrollbar{ width: 6px; }
.cw-clues::-webkit-scrollbar-track{ background: transparent; }
.cw-clues::-webkit-scrollbar-thumb{
  background: var(--cw-purple);
  border-radius: 10px;
}
.cw-clues h4{
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #000;
  border-bottom: 1px solid #000;
  padding-bottom: 6px;
  margin: 0 0 10px;
}
.cw-clues ol{ list-style: none; margin: 0 0 20px; padding: 0; }
.cw-clues li{
  display: flex;
  gap: 8px;
  font-size: 0.86rem;
  line-height: 1.4;
  margin-bottom: 9px;
  color: var(--cw-ink);
}
.cw-clues li b{ color: var(--cw-purple-dark); flex-shrink: 0; }


.cw-modal-footer{
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  background:  #7aa2cd;
  flex: 0 0 auto;
}
.cw-score{
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  color: #1e3a5f;
  background: #fff;
  padding: 5px 14px;
  border-radius: 999px;
  box-shadow: var(--cw-shadow-soft);
  font-size: 1rem;
  font-weight: 600;
  transition:
    color .2s var(--cw-ease),
    background .2s var(--cw-ease);
}
.cw-success-msg{
  justify-self: center;
  text-align: center;
  color: green;
  padding: 5px 14px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--cw-shadow-soft);
  font-size: 1rem;
  font-weight: bolder;
  transition:
    color .2s var(--cw-ease),
    background .2s var(--cw-ease);
}
.cw-actions{ justify-self: end; display: flex; gap: 10px; }
 
@media (max-width: 640px){
  .cw-modal-footer{
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .cw-score, .cw-success-msg, .cw-actions{ justify-self: center; }
}
 
@media (max-width: 640px) {
  .cw-modal-footer {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .cw-score,
  .cw-success-msg,
  .cw-actions {
    grid-column: 1;
    justify-self: center;
  }
}


@media (max-width: 700px){
  .cw-modal-body{
    flex-wrap: wrap;
    overflow-y: auto;
  }
  .cw-grid-wrap{
    flex: 1 1 auto;
    width: 100%;
    min-height: 260px;
  }
  .cw-clues{
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    max-height: 32vh;
  }
}

@media (max-width: 560px){
  .cw-cell{ width: 25px; height: 25px; }
  .cw-modal-body{ padding: 14px; gap: 14px; }
  .cw-grid-wrap{ padding: 12px; }
}

.breaking-bubble {
  position: fixed; /* Position dans le coin supérieur gauche */
  top: 80px;
  left: 15px; /* Au-dessus de tout le contenu */
  z-index: 99999;
  width: 380px;
  min-height: 200px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px; /* Forme irrégulière */
  clip-path: polygon(
    50% 0%,
    57% 10%,
    65% 3%,
    68% 15%,
    78% 8%,
    78% 22%,
    90% 18%,
    85% 30%,
    100% 35%,
    88% 43%,
    98% 52%,
    86% 57%,
    94% 70%,
    80% 68%,
    82% 83%,
    69% 76%,
    64% 91%,
    55% 82%,
    45% 100%,
    41% 84%,
    29% 92%,
    29% 77%,
    15% 82%,
    20% 68%,
    5% 70%,
    13% 57%,
    0% 51%,
    13% 43%,
    2% 34%,
    16% 31%,
    8% 18%,
    22% 22%,
    22% 8%,
    35% 15%,
    42% 5%
  ); /* Apparition */
  animation: bubbleIn 0.6s cubic-bezier(0.17, 0.89, 0.32, 1.28) forwards; /* La bulle ne bloque pas les clics de la page */
  pointer-events: none;
} /* ============================== CONTENU DE LA BULLE ============================== */
.breaking-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: darkblue;
  text-align: left;
} /* Icône */
.breaking-icon {
  font-size: 35px;
  transform: rotate(-15deg);
  flex-shrink: 0;
} /* Première ligne */
.breaking-title {
  font-size: 25px;
  font-weight: bolder;
  line-height: 0.9;
  
} /* Deuxième ligne */
.breaking-subtitle {
  font-size: 25px;
  font-weight: 900;
  line-height: 0.9;
} /* Texte supplémentaire */

@keyframes bubbleIn {
  from {
    opacity: 0;
    transform: translate(-120px, -80px) scale(0.4) rotate(-10deg);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0);
  }
} /* ============================== ANIMATION DE DISPARITION ============================== */
.breaking-bubble.closing {
  animation: bubbleOut 0.5s ease forwards;
}
@keyframes bubbleOut {
  from {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0);
  }
  to {
    opacity: 0;
    transform: translate(-120px, -80px) scale(0.4) rotate(-10deg);
  }
} /* ============================== CONTENU DE LA PAGE ============================== */
.page-content {
  min-height: 100vh;
  padding: 80px 40px;
  max-width: 1200px;
  margin: 0 auto;
}
.page-content h1 {
  font-size: 48px;
  margin-bottom: 20px;
}
.page-content p {
  font-size: 20px;
  line-height: 1.6;
} /* ============================== VERSION MOBILE ============================== */
@media (max-width: 600px) {
  .breaking-bubble {
    top: 10px;
    left: 10px;
    width: 90vw;
    min-height: 250px;
    padding: 45px 35px;
  }
  .breaking-content {
    gap: 10px;
  }
  .breaking-icon {
    font-size: 40px;
  }
  .breaking-message {
    margin-top: 20px;
    font-size: 18px;
  }
  .page-content {
    padding: 40px 20px;
  }
  .page-content h1 {
    font-size: 36px;
  }
}
