/* Site de Pop Code : une seule feuille de style pour toutes les pages.
   Aux couleurs du jeu, comme les pages privées (APK, maquettes) : fond nuit, laiton, tuiles du logo. */
:root {
  --fond: #0B0E16;
  --surface: #161B29;
  --surface-vive: #232B42;
  --laiton: #C9A35A;
  --laiton-clair: #E3C27F;
  --accent: #F4B740;
  --encre-or: #1D1503;
  --ecriture: #F2ECDF;
  --discret: #B9B1A0;
  --ebene: #1C1812;
  --ivoire: #EFE6D2;
  --jade: #1B7050;
  --bord: rgba(201, 163, 90, 0.35);
}

* { box-sizing: border-box; }

html { background: var(--fond); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ecriture);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(244, 183, 64, 0.16), transparent 60%),
    radial-gradient(ellipse at 100% 100%, rgba(27, 112, 80, 0.22), transparent 55%),
    var(--fond);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Fond : tuiles de Pop Code (ébène, ivoire, jade) qui flottent doucement. */
.tuiles-fond {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.tuiles-fond span {
  position: absolute;
  width: 46px;
  height: 62px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 26px;
  opacity: 0.13;
  border: 2px solid var(--laiton);
  animation: flotte 14s ease-in-out infinite alternate;
}
.tuiles-fond .noir { background: var(--ebene); color: var(--ivoire); }
.tuiles-fond .blanc { background: var(--ivoire); color: #1A150E; }
.tuiles-fond .vert { background: var(--jade); color: var(--ivoire); }
@keyframes flotte {
  from { transform: translateY(0) rotate(var(--r, -8deg)); }
  to { transform: translateY(-26px) rotate(calc(var(--r, -8deg) * -1)); }
}
@media (prefers-reduced-motion: reduce) {
  .tuiles-fond span { animation: none !important; }
}

header, main, footer {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--bord);
}
/* Accueil : le grand logo est juste en dessous, l'en-tête ne garde que les liens. */
header.liens-seuls { justify-content: flex-end; border-bottom: 0; }

nav a { margin-left: 16px; font-weight: 700; text-decoration: none; }
nav a:hover, nav a:focus-visible { text-decoration: underline; }

a { color: var(--accent); }

/* Le logo en tuiles. */
.logo {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 8px 0 14px;
  text-decoration: none;
}
.logo b {
  width: 36px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  border: 2px solid var(--laiton);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}
.logo b:nth-child(odd) { background: var(--ebene); color: var(--ivoire); transform: rotate(-4deg); }
.logo b:nth-child(even) { background: var(--ivoire); color: #1A150E; transform: rotate(4deg) translateY(4px); }
.logo b.vert { background: var(--jade); color: var(--ivoire); }
.logo .espace { width: 10px; }
.logo.petit { margin: 0; gap: 4px; }
.logo.petit b { width: 22px; height: 30px; font-size: 14px; border-radius: 6px; border-width: 1.5px; }
.logo.petit .espace { width: 6px; }

h1 { font-size: 2rem; line-height: 1.2; margin: 28px 0 6px; letter-spacing: 0.02em; }
.accueil h1 { text-align: center; margin-top: 4px; }

/* Titres de section : petites capitales en laiton, comme sur les pages du jeu. */
h2 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--laiton);
  margin: 36px 0 10px;
}

.sous-titre { color: var(--discret); font-size: 1.1rem; margin-top: 0; }
.accueil .sous-titre { text-align: center; margin-bottom: 26px; }

strong { color: var(--laiton-clair); }
code { color: var(--laiton-clair); }
li::marker { color: var(--laiton); }

.bloc {
  background: linear-gradient(180deg, var(--surface-vive), var(--surface));
  border: 1px solid var(--bord);
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
  padding: 16px 20px;
  margin: 16px 0;
}

.bouton {
  display: inline-block;
  background: linear-gradient(180deg, var(--laiton-clair), var(--accent));
  color: var(--encre-or);
  font-weight: 800;
  padding: 12px 22px;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 5px 0 #8a6a2c, 0 8px 16px rgba(0, 0, 0, 0.35);
}

.bouton.inactif {
  background: rgba(255, 255, 255, 0.04);
  color: var(--discret);
  border: 1px dashed var(--bord);
  box-shadow: none;
}

/* Les règles de conduite : leur numéro dans un rond d'or pâle, comme sur leur feuille dans le jeu. */
.regles { list-style: none; counter-reset: regle; padding: 4px 20px; }
.regles li { counter-increment: regle; position: relative; padding: 14px 0 14px 46px; }
.regles li + li { border-top: 1px solid var(--bord); }
.regles li::before {
  content: counter(regle);
  position: absolute;
  left: 0;
  top: 13px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--accent);
  background: rgba(244, 183, 64, 0.12);
  border: 1.5px solid rgba(244, 183, 64, 0.55);
}

.date { color: var(--discret); font-size: 0.9rem; }

footer {
  border-top: 1px solid var(--bord);
  margin-top: 48px;
  padding-top: 16px;
  padding-bottom: 32px;
  color: var(--discret);
  font-size: 0.9rem;
}
