/* Jarona — le site de Fakefile
   Les couleurs sont ici, en haut. Pour changer une couleur partout, change-la juste ici. */
:root {
  --fond: #07050f;
  --fond-halo: #1c1240;
  --texte: #ffffff;
  --texte-doux: #b9b3d6;
  --coeur: #ff2a3c;
  --rose: #ff4fa3;
  --jaune: #ffd23c;
  --bleu: #36c8f0;
  --vert: #4ee38f;
  --mauve: #a77bff;
  --orange: #ff8a3d;
  --police: "Pixelify Sans", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: var(--police);
  color: var(--texte);
  background: radial-gradient(ellipse at top, var(--fond-halo), var(--fond) 65%);
  background-color: var(--fond);
  overflow-x: hidden;
}

/* ---------- Le bouton de langue, en haut à droite ---------- */
.haut {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 1rem 0;
}

.langue {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1rem;
  border: 3px solid var(--texte);
  background: #000;
  color: var(--texte);
  font-size: 1.1rem;
  text-decoration: none;
}

.langue:hover,
.langue:focus-visible {
  color: var(--jaune);
  border-color: var(--jaune);
}

/* ---------- Le centre de la page ---------- */
.accueil {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  width: 100%;
  max-width: 44rem;
  /* L'accueil remplit le premier écran, sous le bouton de langue */
  min-height: calc(100vh - 3.5rem);
  min-height: calc(100svh - 3.5rem);
  margin: 0 auto;
  padding: 2.5rem 1rem 1rem;
}

/* Le grand titre, une couleur par lettre */
.titre {
  margin: 0;
  font-size: clamp(3.75rem, 17vw, 8.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.06em;
  text-align: center;
}

.lettre {
  display: inline-block;
  text-shadow: 0.06em 0.06em 0 rgba(0, 0, 0, 0.6);
  animation: sauter 2.4s ease-in-out infinite;
}

.l1 { color: var(--rose); animation-delay: 0s; }
.l2 { color: var(--jaune); animation-delay: 0.15s; }
.l3 { color: var(--bleu); animation-delay: 0.3s; }
.l4 { color: var(--vert); animation-delay: 0.45s; }
.l5 { color: var(--mauve); animation-delay: 0.6s; }
.l6 { color: var(--orange); animation-delay: 0.75s; }

@keyframes sauter {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-0.15em); }
}

/* ---------- La boîte de dialogue ---------- */
.dialogue {
  width: 100%;
  padding: 1.1rem 1.25rem;
  border: 4px solid var(--texte);
  background: #000;
  font-size: 1.25rem;
  line-height: 1.45;
}

.dialogue p {
  margin: 0;
}

.dialogue p + p {
  margin-top: 0.4rem;
}

.curseur {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 0.2em;
  vertical-align: -0.12em;
  background: var(--texte);
  animation: clignoter 1s steps(1) infinite;
}

@keyframes clignoter {
  50% { opacity: 0; }
}

/* ---------- Le bouton YouTube ---------- */
.youtube {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  border: 3px solid var(--texte);
  background: #e00030;
  color: var(--texte);
  font-size: 1.35rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 5px 5px 0 #000;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.youtube:hover,
.youtube:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 #000;
}

/* ---------- Le menu avec le cœur ---------- */
.menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1.35rem;
  color: var(--jaune);
}

.menu li {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
}

/* Le cœur saute d'un choix à l'autre */
.coeur {
  width: 1.4em;
  color: var(--coeur);
  opacity: 0;
  animation: viser 6s steps(1) infinite;
}

.c1 { animation-delay: 0s; }
.c2 { animation-delay: 1.5s; }
.c3 { animation-delay: 3s; }
.c4 { animation-delay: 4.5s; }

@keyframes viser {
  0% { opacity: 1; }
  25% { opacity: 0; }
}

/* Un cœur qui ne bouge pas (quand il n'y a qu'un seul choix) */
.coeur.fixe {
  opacity: 1;
  animation: none;
}

.lien-menu {
  color: inherit;
}

/* ---------- La boîte à musique ---------- */
.musique {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  max-width: 44rem;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.titre-section {
  margin: 0;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  font-weight: 700;
  color: var(--jaune);
  text-align: center;
}

.ecran-musique {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 4px solid var(--texte);
  background: #000;
  font-size: 1.25rem;
}

.ecran-musique p {
  margin: 0;
}

.ecran-musique iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.en-cours {
  min-height: 1.5em;
  margin: 0.5rem 0 0;
  text-align: center;
  font-size: 1.1rem;
  color: var(--jaune);
}

.pistes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pistes button {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.35rem 0.6rem;
  border: 3px solid var(--texte-doux);
  background: #000;
  color: var(--texte);
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

/* Le cœur rouge montre la musique qui joue */
.pistes button::before {
  content: "❤";
  flex: none;
  color: var(--coeur);
  opacity: 0;
}

.pistes button:hover,
.pistes button:focus-visible {
  border-color: var(--texte);
  color: var(--jaune);
}

.pistes button[aria-pressed="true"] {
  border-color: var(--jaune);
  color: var(--jaune);
}

.pistes button[aria-pressed="true"]::before {
  opacity: 1;
}

.credit {
  margin: 0;
  text-align: center;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--texte-doux);
}

.credit a {
  color: var(--jaune);
}

/* Ordinateur : le lecteur à gauche, la liste à droite */
@media (min-width: 900px) {
  .musique {
    max-width: 64rem;
  }

  .boite-musique {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 1.25rem;
    align-items: start;
  }

  .pistes {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

/* ---------- Les autres pages (jeux, dessins, idées) ---------- */
.haut-page {
  justify-content: space-between;
  gap: 0.75rem;
}

.page {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
}

.titre-page {
  margin: 0;
  font-size: clamp(2.2rem, 9vw, 3.5rem);
  font-weight: 700;
  color: var(--jaune);
}

.intro {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--texte-doux);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

/* Gros bouton jaune */
.bouton {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem;
  border: 3px solid var(--texte);
  background: var(--jaune);
  color: #1b1340;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 4px 4px 0 #000;
}

.bouton:hover,
.bouton:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.bouton:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Petit bouton noir */
.bouton-petit {
  min-height: 2.75rem;
  padding: 0.35rem 0.9rem;
  border: 2px solid var(--texte-doux);
  background: #000;
  color: var(--texte);
  font: inherit;
  font-size: 1.05rem;
  cursor: pointer;
}

.bouton-petit:hover,
.bouton-petit:focus-visible {
  border-color: var(--texte);
  color: var(--jaune);
}

.etat {
  min-height: 1.5em;
  margin: 0;
  font-size: 1.15rem;
}

/* Mes dessins */
.galerie {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.carte-dessin {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.6rem;
  border: 3px solid var(--texte);
  background: #000;
}

.carte-dessin img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
}

.legende {
  margin: 0;
  font-size: 1.1rem;
}

/* Mes idées */
.liste-idees {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.idee {
  padding: 1rem 1.25rem;
  border: 4px solid var(--texte);
  background: #000;
}

.idee h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--jaune);
  overflow-wrap: anywhere;
}

.date {
  margin: 0.25rem 0 0.75rem;
  font-size: 1rem;
  color: var(--texte-doux);
}

.texte-idee {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Mes jeux */
.liste-jeux {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.carte-jeu {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 4px solid var(--texte);
  background: #000;
  color: var(--texte);
  font-size: 1.2rem;
  text-decoration: none;
}

.carte-jeu:hover,
.carte-jeu:focus-visible {
  border-color: var(--jaune);
}

.carte-jeu strong {
  display: block;
  font-size: 1.5rem;
  color: var(--jaune);
}

.description-jeu {
  display: block;
  margin-top: 0.25rem;
  color: var(--texte-doux);
}

.icone-jeu {
  font-size: 2.5rem;
  color: var(--coeur);
}

/* La page d'un jeu */
.page-jeu {
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.75rem;
}

.titre-jeu {
  margin: 0;
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  color: var(--jaune);
  text-align: center;
}

.hud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.25rem;
  margin: 0;
  font-size: 1.2rem;
}

.hud span:first-child {
  color: var(--coeur);
}

.arene {
  display: block;
  /* L'arène tient dans l'écran avec l'en-tête, le titre, les vies, l'aide et le pied de page */
  width: min(100%, 480px, calc(100vh - 19rem));
  width: min(100%, 480px, calc(100svh - 19rem));
  aspect-ratio: 1;
  border: 4px solid var(--texte);
  background: #000;
  touch-action: none;
  cursor: pointer;
}

.aide-jeu {
  margin: 0;
  font-size: 1.05rem;
  color: var(--texte-doux);
  text-align: center;
}

/* ---------- Les petites fenêtres (code, dessin, idée) ---------- */
.dialogue-boite {
  width: min(100% - 2rem, 32rem);
  max-height: calc(100vh - 2rem);
  max-height: calc(100svh - 2rem);
  padding: 1.25rem;
  border: 4px solid var(--texte);
  background: #000;
  color: var(--texte);
  font-family: var(--police);
}

.dialogue-boite::backdrop {
  background: rgba(7, 5, 15, 0.8);
}

.dialogue-boite form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.dialogue-boite h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--jaune);
}

.dialogue-boite p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.4;
}

.dialogue-boite label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 1.1rem;
}

.dialogue-boite input:not([type="file"]),
.dialogue-boite textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.6rem;
  border: 2px solid var(--texte-doux);
  background: #111;
  color: var(--texte);
  font: inherit;
  font-size: 1.1rem;
}

.dialogue-boite textarea {
  min-height: 10rem;
  resize: vertical;
}

.dialogue-boite input[type="file"] {
  font: inherit;
  font-size: 1rem;
  color: var(--texte-doux);
}

.dialogue-boite input[type="file"]::file-selector-button {
  min-height: 2.75rem;
  margin-right: 0.75rem;
  padding: 0.35rem 0.9rem;
  border: 3px solid var(--texte);
  background: var(--jaune);
  color: #1b1340;
  font: inherit;
  cursor: pointer;
}

.apercu {
  align-self: center;
  max-width: 100%;
  max-height: 14rem;
  object-fit: contain;
  background: #fff;
}

.dialogue-boite .rappel {
  color: var(--texte-doux);
  font-size: 1rem;
}

.dialogue-boite .erreur {
  min-height: 1.4em;
  color: var(--jaune);
}

.boutons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

.pied {
  position: relative;
  z-index: 1;
  padding: 1rem;
  text-align: center;
  font-size: 1rem;
  color: var(--texte-doux);
}

/* ---------- Les étoiles ---------- */
/* Les étoiles restent dans le premier écran seulement */
.ciel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  pointer-events: none;
}

.etoile {
  position: absolute;
  font-size: 1.5rem;
  line-height: 1;
  animation: scintiller 3s ease-in-out infinite;
}

.e1 { top: 9%; left: 7%; color: var(--jaune); }
.e2 { top: 18%; right: 9%; color: var(--bleu); font-size: 2rem; animation-delay: -1s; }
.e3 { top: 48%; left: 4%; color: var(--rose); animation-delay: -2s; }
.e4 { bottom: 14%; right: 6%; color: var(--mauve); font-size: 1.8rem; animation-delay: -0.5s; }
.e5 { bottom: 8%; left: 18%; color: var(--vert); animation-delay: -1.5s; }
.e6 { top: 6%; left: 55%; color: var(--orange); font-size: 1.1rem; animation-delay: -2.5s; }

@keyframes scintiller {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ---------- Écrans ---------- */
/* Cellulaire : le menu se place en colonne, comme dans un jeu */
@media (max-width: 899px) {
  .menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
}

/* Cellulaire peu haut : on resserre les espaces, jamais le texte */
@media (max-width: 899px) and (max-height: 700px) {
  .haut { padding-top: 0.5rem; }
  .accueil { gap: 1rem; padding-top: 0.75rem; padding-bottom: 0.5rem; }
  .pied { padding: 0.5rem 1rem; }
  .musique { gap: 0.6rem; padding: 1rem; }
  .pistes { gap: 0.35rem; }
  /* Le cœur montre déjà la musique qui joue : la ligne reste pour les lecteurs d'écran seulement */
  .en-cours {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* Ordinateur ou tablette couchée peu haut : on resserre les espaces, jamais le texte */
@media (min-width: 900px) and (max-height: 800px) {
  .musique { gap: 0.75rem; padding: 1rem; }
  .page-jeu { gap: 0.5rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
  .pied { padding: 0.5rem 1rem; }
}

/* Très petit écran : seul le grand titre rapetisse un peu */
@media (max-width: 339px) {
  .titre { font-size: 3.2rem; }
}

/* Très grands écrans : tout grossit un peu, comme un zoom */
@media (min-width: 2000px) { html { font-size: 112.5%; } }
@media (min-width: 2400px) { html { font-size: 125%; } }
@media (min-width: 3200px) { html { font-size: 150%; } }

/* Si l'appareil demande moins d'animations, tout reste immobile */
@media (prefers-reduced-motion: reduce) {
  .lettre,
  .etoile,
  .curseur,
  .coeur {
    animation: none;
  }
  .c1 { opacity: 1; }
}
