/* ==========================================================================
   Styles partagés par toutes les cartes de jeux (cadres, boutons, Bravo, anecdotes)
   ========================================================================== */

/* Les appuis répétés ou prolongés restent des commandes, sans sélectionner leur texte. */
.metamorph-swim,
.arcade-control,
.arcade-tongue,
.crossing-jump,
.crossing-move {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.game-loading-indicator {
  top: 50%;
  left: 50%;
  width: max-content;
  padding: 11px 18px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: rgba(20, 53, 46, 0.94);
  box-shadow: 0 9px 24px rgba(20, 53, 46, 0.28);
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.game-loading-indicator[hidden] {
  display: none;
}

.restart-puzzle,
.arcade-button {
  letter-spacing: -0.035em;
  text-align: center;
  transform: none;
}

.restart-puzzle:active,
.arcade-button:active {
  transform: translateY(1px);
}

.puzzle-card .eyebrow,
.arcade-card .eyebrow {
  align-items: center;
  font-style: normal;
  transform: none;
  rotate: 0deg;
  skew: 0deg;
}

.puzzle-card,
.arcade-card {
  isolation: isolate;
  animation: playfulCardIn 0.52s ease both;
}

.puzzle-card::after,
.arcade-card::after {
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 1px;
}

.restart-puzzle:hover,
.arcade-button:hover {
  transform: translate(-1px, -2px);
}

.puzzle-card h2,
.arcade-card h2 {
  letter-spacing: -0.015em;
}

.arcade-status,
.puzzle-status {
  border-radius: 12px;
}

.puzzle-card,
.arcade-card,
.metamorph-card,
.seek-card,
.photo-mask-card {
  position: relative;
  padding: 10px 18px 16px;
  overflow: hidden;
  color: #687b42;
}

.puzzle-card::after,
.arcade-card::after,
.metamorph-card::after,
.seek-card::after,
.photo-mask-card::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 18px;
  z-index: 0;
  width: 70px;
  height: 56px;
  border: 0;
  border-radius: 0;
  background: url("../assets/images/grenouille-vecto.png") center / contain no-repeat;
  box-shadow: none;
  transform: none;
  pointer-events: none;
}

.arcade-card::after,
.seek-card::after {
  background-image: url("../assets/images/triton-vecto.png");
}

.puzzle-card > *,
.arcade-card > *,
.metamorph-card > *,
.seek-card > *,
.photo-mask-card > * {
  position: relative;
  z-index: 1;
}

.puzzle-card .eyebrow,
.arcade-card .eyebrow,
.metamorph-card .eyebrow,
.seek-card .eyebrow,
.photo-mask-card .eyebrow {
  display: block;
  width: 100%;
  min-height: 0;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #b89b8f;
  -webkit-text-fill-color: #b89b8f;
  background: transparent;
  box-shadow: none;
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: uppercase;
}

.puzzle-card h2,
.arcade-card h2,
.metamorph-card h2,
.seek-card h2,
.photo-mask-card h2 {
  max-width: calc(100% - 76px);
  margin: 0 0 10px;
  color: #667b41;
  -webkit-text-fill-color: #667b41;
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.12;
  text-align: left;
}

.puzzle-card > p:not(.eyebrow):not(.puzzle-status),
.arcade-card > p:not(.eyebrow):not(.arcade-status):not(.arcade-rules),
.metamorph-card > p:not(.eyebrow):not(.metamorph-status),
.seek-card > p:not(.eyebrow):not(.seek-status) {
  max-width: calc(100% - 76px);
  margin: 0 0 14px;
  color: #667b41;
  -webkit-text-fill-color: #667b41;
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
}

.arcade-hud,
.metamorph-hud,
.seek-toolbar {
  gap: 10px;
  margin: 8px 6px 12px;
}

.arcade-canvas,
.metamorph-canvas {
  display: block;
}

.restart-puzzle,
.arcade-button,
.metamorph-start,
.metamorph-swim,
.seek-toolbar button,
.photo-mask-start,
.photo-mask-shot,
.photo-mask-share {
  min-height: 34px;
  padding: 0 16px;
  border: 2px solid rgba(28, 55, 48, 0.14);
  border-radius: 999px;
  color: #fff;
  -webkit-text-fill-color: #fff;
  background: #6d7f42;
  box-shadow: 0 4px 7px rgba(29, 59, 61, 0.24);
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  font-weight: 900;
}

.metamorph-start,
.arcade-button,
.restart-puzzle,
.photo-mask-shot {
  color: #687b42;
  -webkit-text-fill-color: #687b42;
  background: #e8c54c;
}

.metamorph-swim,
.seek-toolbar button,
.photo-mask-start {
  background: #2f7ecb;
}

.metamorph-status.is-fun-fact,
.arcade-status.is-fun-fact,
.seek-status.is-fun-fact,
.crossing-status.is-fun-fact,
.puzzle-fun-fact {
  border: 3px solid transparent;
  border-radius: 20px;
  color: #5f6f34;
  -webkit-text-fill-color: #5f6f34;
  background: linear-gradient(180deg, rgba(255, 252, 230, 0.96), rgba(255, 244, 194, 0.94)) padding-box,
    linear-gradient(135deg, #fff2a8 0%, #f1c63c 28%, #d49b20 52%, #fff0a1 74%, #b87a16 100%) border-box;
  box-shadow: 0 0 0 2px rgba(255, 244, 174, 0.35),
    0 0 18px rgba(241, 198, 60, 0.42),
    0 10px 20px rgba(94, 82, 30, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Fond commun opaque : l'icône blanche reste lisible sur tous les décors. */
.arcade-stage .arcade-button.is-replay,
.metamorph-play .metamorph-start.is-replay,
.crossing-stage .crossing-start.is-replay {
  padding: 10px 12px;
  border: 2px solid #fff;
  border-radius: 18px;
  background-color: #236b5b;
  background-position: center;
  background-size: 49px 61px;
  background-repeat: no-repeat;
  box-shadow: 0 4px 10px rgba(20, 53, 46, 0.28);
}

img[data-language-fr="assets/images/metamorph-bravo.png"] {
  aspect-ratio: 980 / 406;
  object-fit: contain;
}

/* Même image de commande et même boîte dans les deux langues. En anglais,
   seule la légende intégrée au PNG est masquée, puis remplacée par le vrai texte
   traduit du bouton : le cercle et le triangle français restent identiques. */
html[lang="en"] .metamorph-play .metamorph-start,
html[lang="en"] .arcade-stage .arcade-button,
html[lang="en"] .crossing-stage .crossing-start {
  --command-image-width: 126px;
  --command-image-height: 155px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 3px;
  color: #fff;
  -webkit-text-fill-color: #fff;
  background-image: none;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 20px;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

html[lang="en"] .metamorph-play .metamorph-start::before,
html[lang="en"] .arcade-stage .arcade-button::before,
html[lang="en"] .crossing-stage .crossing-start::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--command-image-width);
  height: var(--command-image-height);
  background: url("../assets/images/jouer.png") center / contain no-repeat;
  clip-path: inset(0 0 20% 0);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

html[lang="en"] .metamorph-play .metamorph-start.is-replay,
html[lang="en"] .arcade-stage .arcade-button.is-replay,
html[lang="en"] .crossing-stage .crossing-start.is-replay {
  --command-image-width: 49px;
  --command-image-height: 61px;
  padding-bottom: 14px;
  font-size: 7px;
  line-height: 9px;
}

@media (max-width: 380px) {
  .puzzle-card h2,
  .arcade-card h2,
  .metamorph-card h2,
  .seek-card h2,
  .photo-mask-card h2 {
    font-size: 20px;
  }

  .puzzle-card::after,
  .arcade-card::after,
  .metamorph-card::after,
  .seek-card::after,
  .photo-mask-card::after {
    width: 62px;
    height: 50px;
  }
}

@keyframes playfulCardIn {
  from {
    opacity: 0;
    transform: translateY(18px) rotate(0.6deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
}
