/* Little Masons : page officielle du jeu (evaveo.com/LittleMasons).
 * Pixel art toujours agrandi par multiples entiers, sans lissage. */

@font-face {
  font-family: "Pixelify Sans";
  src: url("/LittleMasons/assets/pixelify-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ink: #4a2e18;
  --ink-soft: #6e4b2c;
  --parchment: #f3e7cf;
  --parchment-2: #fbf4e4;
  --stone: #e3cfa4;
  --gold: #e2a83c;
  --gold-dark: #b47a1c;
  --red: #b3362c;
  --sky-1: #9cc4e4;
  --sky-2: #d4e6f1;
  --grass: #5f9a4b;
  --pixel: "Pixelify Sans", ui-monospace, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}
img, canvas { display: block; max-width: 100%; }
.px { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: inherit; }
h1, h2, h3, .pixel { font-family: var(--pixel); font-weight: 600; line-height: 1.15; letter-spacing: 0.01em; }
h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 0 0 0.4em; }
h3 { font-size: 1.35rem; margin: 0 0 0.35em; }
p { margin: 0 0 1em; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 16px; }
.section { padding: 72px 0; }
.eyebrow {
  font-family: var(--pixel);
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
  margin-bottom: 0.6em;
}
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 40rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: #fff; padding: 8px 12px; }

/* --- Barre du haut ------------------------------------------------------- */
.topbar {
  position: absolute; inset: 0 0 auto 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
}
.topbar .by { font-family: var(--pixel); font-size: 0.95rem; text-decoration: none; color: var(--ink); opacity: 0.85; }
.topbar .by:hover { opacity: 1; text-decoration: underline; }
.lang { display: flex; border: 3px solid var(--ink); background: var(--parchment-2); }
.lang a, .lang span {
  font-family: var(--pixel); font-weight: 600; font-size: 0.95rem;
  padding: 4px 11px; text-decoration: none; min-width: 44px; text-align: center;
}
.lang span[aria-current] { background: var(--ink); color: var(--parchment-2); }
.lang a:hover { background: var(--stone); }

/* --- En-tête ------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 100%);
  padding-top: 84px; text-align: center;
}
.logo img { display: block; width: min(640px, 88vw); height: auto; margin: 0 auto; }
.logo {
  font-family: var(--pixel); font-weight: 700;
  font-size: clamp(3rem, 11vw, 6.2rem); line-height: 1; margin: 0 0 18px;
  color: var(--gold);
  text-shadow:
    3px 0 var(--ink), -3px 0 var(--ink), 0 3px var(--ink), 0 -3px var(--ink),
    3px 3px var(--ink), -3px 3px var(--ink), 3px -3px var(--ink), -3px -3px var(--ink),
    6px 7px 0 rgba(74, 46, 24, 0.35);
}
.hero h1 { font-size: clamp(1.45rem, 4.2vw, 2.4rem); margin: 0 auto 12px; max-width: 22em; }
.hero .date { font-family: var(--pixel); font-size: 1.15rem; margin: 0 0 22px; }
.hero .lead { margin: 0 auto 26px; color: var(--ink); }
.band-wrap { position: relative; margin-top: 10px; height: 240px; }
.band { position: absolute; left: 0; bottom: 0; }
@media (min-width: 1800px) { .band-wrap { height: 360px; } }

/* --- Illustration du chantier ------------------------------------------ */
.keyart { padding: 56px 0 0; }
.keyart img { width: 100%; height: auto; border: 3px solid var(--ink); box-shadow: 6px 6px 0 rgba(74, 46, 24, 0.25); }

/* --- Boutons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--pixel); font-weight: 600; font-size: 1.2rem;
  color: var(--ink); text-decoration: none;
  background: none; border: 16px solid transparent;
  border-image: url("/LittleMasons/assets/btn-normal.webp") 8 fill / 16px stretch;
  image-rendering: pixelated;
  padding: 2px 20px; min-height: 64px; cursor: pointer;
  transition: transform 0.08s;
}
.btn:hover { border-image-source: url("/LittleMasons/assets/btn-hover.webp"); }
.btn:active { transform: translateY(2px); border-image-source: url("/LittleMasons/assets/btn-pressed.webp"); }
.btn:focus-visible, .lang a:focus-visible, .shot:focus-visible { outline: 3px dashed var(--red); outline-offset: 4px; }
.soon {
  display: inline-block; font-family: var(--pixel); font-size: 1.1rem;
  border: 3px dashed var(--ink); padding: 10px 18px; background: rgba(251, 244, 228, 0.75);
}

/* --- Cartes -------------------------------------------------------------- */
.card {
  background: var(--parchment-2); border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 rgba(74, 46, 24, 0.22);
  padding: 22px;
}
.grid3 { display: grid; gap: 22px; margin-top: 34px; }
.stack { display: grid; gap: 22px; margin-top: 34px; }
@media (min-width: 768px) {
  .grid3 { grid-template-columns: repeat(3, 1fr); }
}
.card p:last-child { margin-bottom: 0; }
.scene {
  height: 150px; margin: -22px -22px 18px; border-bottom: 3px solid var(--ink);
  background: linear-gradient(180deg, var(--sky-1), var(--sky-2));
  position: relative; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
}
.scene img { max-width: none; }
.scene::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--grass); border-top: 2px solid #477a37; }

/* Écran de bureau miniature, avec la bande du jeu en bas */
.desk { position: absolute; inset: 14px 18px 18px; background: #2f3a4a; border: 3px solid var(--ink); z-index: 1; overflow: hidden; }
.desk::before, .desk::after { content: ""; position: absolute; background: #e9edf2; border-top: 8px solid #8fa3ba; }
.desk::before { left: 8%; top: 10%; width: 52%; height: 46%; }
.desk::after { left: 46%; top: 22%; width: 44%; height: 40%; }
.desk .strip { position: absolute; left: 0; right: 0; bottom: 0; height: 30px; background-size: auto 30px; background-position: 6% 100%; z-index: 1; }

.sprites { display: flex; gap: 6px; align-items: flex-end; position: relative; z-index: 1; margin-bottom: 4px; }
.sprite { display: inline-block; background-repeat: no-repeat; }

.monument { display: flex; flex-direction: column; }
.mon-img { height: auto; }
.monument .art { display: flex; justify-content: center; align-items: flex-end; min-height: 120px; margin-bottom: 18px; overflow: hidden; }
.phases { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.phases li { font-family: var(--pixel); font-size: 0.95rem; border: 2px solid var(--ink); padding: 1px 9px; background: var(--stone); }

/* --- Le chat ------------------------------------------------------------- */
.cat-block { display: grid; gap: 22px; align-items: center; background: #f6dfb2; }
@media (min-width: 768px) { .cat-block { grid-template-columns: 220px 1fr; } }
.cat-stage { position: relative; height: 140px; display: flex; align-items: flex-end; justify-content: center; }
.cat-btn { border: 0; background: none; padding: 0; cursor: pointer; position: relative; }
.cat-btn:focus-visible { outline: 3px dashed var(--red); outline-offset: 6px; }
.heart { position: absolute; left: 50%; top: -26px; font-family: var(--pixel); color: var(--red); font-size: 1.6rem; opacity: 0; transform: translate(-50%, 6px); transition: opacity 0.25s, transform 0.6s; pointer-events: none; }
.heart.on { opacity: 1; transform: translate(-50%, -8px); }
.cat-hint { font-family: var(--pixel); font-size: 0.95rem; margin: 0; opacity: 0.8; }

/* --- Succès --------------------------------------------------------------- */
.ach { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 18px 10px; grid-template-columns: repeat(4, 1fr); }
@media (min-width: 768px) { .ach { grid-template-columns: repeat(8, 1fr); } }
.ach li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.ach img { width: 80px; height: 80px; max-width: 100%; height: auto; box-shadow: 3px 3px 0 rgba(74, 46, 24, 0.25); }
.ach span { font-family: var(--pixel); font-size: 0.85rem; line-height: 1.2; }

/* --- Captures ------------------------------------------------------------ */
.shots { display: grid; gap: 18px; margin-top: 30px; }
.shot { display: block; border: 3px solid var(--ink); box-shadow: 5px 5px 0 rgba(74, 46, 24, 0.22); background: var(--sky-1); cursor: zoom-in; padding: 0; }
.shot img { width: 100%; height: auto; }
@media (min-width: 768px) { .shots { grid-template-columns: repeat(2, 1fr); } }
.shots figure { margin: 0; }
.shots figcaption { font-family: var(--pixel); font-size: 0.95rem; margin-top: 10px; }
dialog.lightbox { border: 3px solid var(--ink); padding: 0; max-width: 96vw; background: var(--sky-1); }
dialog.lightbox::backdrop { background: rgba(30, 18, 8, 0.8); }
dialog.lightbox img { width: min(1920px, 94vw); height: auto; image-rendering: pixelated; }
dialog.lightbox button { position: absolute; top: 6px; right: 6px; }

/* --- Steam --------------------------------------------------------------- */
.steam { text-align: center; }
.widget-scroll { overflow-x: auto; margin: 24px auto; max-width: 646px; }
.facts { display: grid; gap: 10px 26px; margin: 26px auto 0; max-width: 760px; text-align: left; padding: 0; list-style: none; }
@media (min-width: 640px) { .facts { grid-template-columns: auto 1fr; } }
.facts dt { font-family: var(--pixel); font-weight: 600; }
.facts dd { margin: 0 0 6px; }

/* --- Pied de page -------------------------------------------------------- */
.foot { background: var(--ink); color: var(--parchment); padding: 40px 0; font-size: 0.95rem; }
.foot a { color: var(--parchment); }
.foot .row { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 14px; }
.foot .legal { opacity: 0.75; font-size: 0.85rem; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .heart { transition: none; }
}
