@font-face {
    font-family: "Luckiest Guy";
    src: url('/fonts/LuckiestGuy-Regular.ttf') format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Question mise en avant */
.question {
    transform: scaleY(1.1);
    font-family: "LilitaOne";
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    text-align: center;
    color: rgb(247, 76, 76);
    padding: 1rem;
    margin-bottom: 1.5rem;
    min-height: 135px;
}

/* Boutons */
.option-btn {
    font-family: "LilitaOne";
    position: relative;
    flex: 1;
    min-height: 145px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e60000;
    border-radius: 10px;
    font-size: 1.5rem;
    color: #fff;
    background-color: #d14848ff;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    padding: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.option-btn-with-letter {
  padding: 15px 15px 15px 35px;
}

.option-btn:hover {
    background-color: #b30000;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(230, 0, 0, 0.3);
}

.option-letters {
    position: absolute;
    top: 35px;
    left: -20px;
    background-color: #fff;
    color: #f30;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

/* Score et progression */
.stats {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--bs-body-color);
}

/* Start screen spécifique */
.main-screen {
    color: #fff;
    text-align: center;
}

/* Titres */
.main-screen h1 {
    font-family: "Luckiest Guy", cursive;
    font-size: 3rem;
    margin-bottom: 1rem;
    color: rgb(247, 76, 76);
}

.main-screen h2 {
    font-family: "LilitaOne";
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #f87777ff;
}

/* Game screen spécifique */
.game-screen {
    color: #fff;
    text-align: center;
}

.game-screen h2 {
    font-family: "LilitaOne";
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #f87777ff;
}

/* Bouton Start */
.start-button {
    font-family: "Luckiest Guy", cursive;
    font-size: 1.5rem;
    color: #fff;
    background-color: rgb(247, 76, 76);
    border: 0;
    border-radius: 12px;
    padding: 1rem 2rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.start-button:hover {
    background-color: #d14848ff;
}

.card-play {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  position: relative; /* nécessaire pour les pseudo-éléments */

  width: 90px;
  height: 120px;

  background: white;
  border: 2px solid #000;
  border-radius: 8px;
  font-size: 28px;
  font-weight: bold;
  font-family: "Georgia", "Times New Roman", serif;

  box-shadow: 2px 4px 6px rgba(0, 0, 0, 0.4);
  padding: 4px;
  user-select: none;
}

/* petits index */
.card-play::before,
.card-play::after {
  content: attr(data-rank) attr(data-suit);
  position: absolute;
  font-size: 12px;
  line-height: 1;
}

/* haut-gauche */
.card-play::before {
  top: 4px;
  left: 4px;
}

/* bas-droite, inversé */
.card-play::after {
  bottom: 4px;
  right: 4px;
  transform: rotate(180deg);
}

.card-play.red {
  color: red;
  border-color: red;
}

.card-play.black {
  color: black;
  border-color: black;
}

/* Tablette (ex. < 768px) */
@media (max-width: 768px) {
  .card-play {
    width: 70px;
    height: 95px;
    font-size: 22px;
  }
}

/* Mobile (ex. < 480px) */
@media (max-width: 480px) {
  .card-play {
    width: 70px;
    height: 95px;
    font-size: 18px;
  }

  /* On ajuste aussi les petits index */
  .card-play::before,
  .card-play::after {
    font-size: 10px;
  }

  .game-screen h2 {
    font-size: 1.5rem;
  }
}

/* Mobile: réduire le texte des questions et boutons pour mieux remplir l'écran */
@media (max-width: 767.98px) {
  .question {
    font-size: 1rem;
    padding: 0.5rem;
    min-height: 80px;
    margin-bottom: 0.75rem;
  }

  .option-btn {
    font-size: 1rem;
    min-height: 90px;
    padding: 10px;
  }

  .main-screen {
    padding-top: 2.5rem;
  }

  .main-screen h1 {
    font-size: 2rem;
  }

  .main-screen h2 {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
  }

  .start-button {
    font-size: 1.15rem;
    padding: 0.75rem 1.25rem;
  }
}

/* Rebus — image puzzle layout. Cards arranged inline with "+" separators.
   The prompt itself reuses the global .question class so the text scale matches
   every other game (Proverb, Quiz, Postal Code, …). */
.rebus-round {
  text-align: center;
}

.rebus-images {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  margin: 0 auto 1.5rem;
  padding: 1rem;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 14px;
  max-width: 720px;
}

.rebus-images img {
  max-height: 140px;
  max-width: 32%;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 0.25rem;
}

.rebus-plus {
  font-family: "LilitaOne", sans-serif;
  font-size: 2rem;
  color: var(--bs-danger);
  line-height: 1;
}

.rebus-category {
  margin-bottom: 1.25rem;
  font-size: 1.15rem;
}

.rebus-form {
  max-width: 480px;
  margin: 0 auto;
}

.rebus-input {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 1rem;
}

.rebus-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.rebus-skip {
  font-size: 1.15rem;
  color: var(--bs-secondary-color);
  background: none;
  border: 0;
  padding: 0.4rem 1rem;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.rebus-skip:hover {
  color: var(--bs-body-color);
}

@media (max-width: 575.98px) {
  .rebus-images {
    gap: 0.4rem 0.6rem;
    padding: 0.75rem;
  }
  .rebus-images img {
    max-height: 90px;
  }
  .rebus-plus {
    font-size: 1.5rem;
  }
}

/* CatchMarmot — Phaser arcade game embedded in a Live Component frame.
   The Stimulus controller computes the parent height in JS so Phaser sees
   real dimensions on mobile portrait (where aspect-ratio CSS used to leave
   the parent at 0px tall on older mobile Safari). */
.catch-marmot-frame {
  text-align: center;
}

.catch-marmot-canvas {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  background: #2d2d2d;
  border-radius: 12px;
  overflow: hidden;
  touch-action: none;
}

.catch-marmot-controls {
  font-size: 0.95rem;
}

/* On-screen touch controls — visible on touch devices, hidden on desktop.
   Sit BELOW the canvas (separate row) so they don't obscure gameplay. */
.catch-marmot-touch-controls {
  display: none;
  margin: 1rem auto 1.5rem;
  max-width: 800px;
  padding: 0 0.75rem;
  justify-content: space-between;
  align-items: center;
}

@media (pointer: coarse), (max-width: 767.98px) {
  .catch-marmot-touch-controls {
    display: flex;
  }
}

.cm-pad-left {
  display: flex;
  gap: 0.5rem;
}

.cm-btn {
  pointer-events: auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.6rem;
  font-weight: bold;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 0.05s ease, transform 0.05s ease;
}

.cm-btn:active,
.cm-btn.is-pressed {
  background: rgba(220, 53, 69, 0.85);
  transform: scale(0.95);
}

.cm-btn-jump {
  width: 80px;
  height: 80px;
  font-size: 1.9rem;
}
