/* P2.8: the static pages of the site (PH09 to PH15), in the colours of the platform
   (08-design-system), readable from 320 px wide to a big screen, without any script. */
:root {
  color-scheme: dark;
  --bg: #0e0b1f;
  --surface: #1a1633;
  --surface-raised: #241e45;
  --line: #3a3366;
  --text: #f5f3ff;
  --muted: #b8b2d9;
  --pink: #ff4fa3;
  --cyan: #2ee6f5;
  --on-pink: #14061a;
  --display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --gutter: max(16px, env(safe-area-inset-left));
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(60rem 30rem at 85% -10%, #3b1a5c 0%, transparent 60%), var(--bg);
  color: var(--text);
  font:
    17px / 1.6 "Nunito",
    "Segoe UI",
    system-ui,
    sans-serif;
}

a {
  color: var(--cyan);
  text-underline-offset: 0.2em;
}

a:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

img {
  max-width: 100%;
  height: auto;
}

/* ------------------------------------------------------------------ Header and footer */

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  color: var(--text);
  font: 600 26px var(--display);
  text-decoration: none;
}

/* P2.8 (decision of 16 November 2026): « ☰ Menu », the menu of the application
   (host/components/SiteMenu.module.css, phone sizes), opened without any script as a popover. */
.menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 48px;
  margin-left: auto;
  padding: 0 16px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition:
    border-color 120ms ease,
    box-shadow 250ms ease;
}

.menu-button-icon {
  width: 24px;
  height: 24px;
  color: var(--cyan);
}

.menu-button:focus-visible,
.menu-close:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

/* The layer of the popover covers the screen: the veil (a « close » button) and the card, under the
   button, at the right end of the column of the page. */
.menu-layer {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--text);
}

.menu-layer:popover-open {
  display: block;
}

.menu-veil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgb(14 11 31 / 60%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: default;
}

.menu-card {
  position: absolute;
  top: 16px;
  right: max(16px, calc((100% - 1120px) / 2 + 16px));
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: min(calc(100% - 32px), 360px);
  max-height: calc(100% - 32px);
  overflow-y: auto;
  padding: 8px 8px 16px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface-raised);
  box-shadow: 0 16px 48px rgb(0 0 0 / 60%);
}

.menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-left: 8px;
}

.menu-title {
  font: 700 20px var(--display);
}

.menu-close {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.menu-close-icon {
  width: 24px;
  height: 24px;
}

.menu-pages {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-link-icon {
  flex: none;
  width: 24px;
  height: 24px;
  color: var(--cyan);
}

.menu-legal {
  display: flex;
  flex-wrap: wrap;
  column-gap: 16px;
  margin: 4px 8px 0;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

@media (prefers-reduced-motion: no-preference) {
  .menu-layer:popover-open .menu-card {
    animation: menu-drop 250ms ease;
  }
}

@keyframes menu-drop {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
}

/* A browser without popovers (Safari before 17): no menu, the footer keeps every link. */
@supports not selector(:popover-open) {
  .menu-button,
  .menu-layer {
    display: none;
  }
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 24px;
  border-radius: 999px;
  background: var(--pink);
  box-shadow: 0 0 24px rgb(255 79 163 / 35%);
  color: var(--on-pink);
  font-weight: 800;
  text-decoration: none;
}

/* A phone: the logo, « Jouer maintenant », then the icon of the menu alone at the right end, as in
   the application; on one line from 375 px wide (iPhone SE, mini). */
@media (max-width: 699px) {
  .top {
    gap: 8px;
  }

  .brand {
    gap: 8px;
    font-size: 20px;
  }

  .brand img {
    width: 28px;
    height: 28px;
  }

  .top .cta {
    order: 1;
    margin-left: auto;
    padding: 8px 12px;
    font-size: 14px;
  }

  .menu-button {
    order: 2;
    width: 48px;
    margin-left: 0;
    padding: 0;
  }

  .menu-button-text {
    display: none;
  }
}

.bottom {
  max-width: 1120px;
  margin: 64px auto 0;
  padding: 24px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}

.bottom nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
}

.publisher {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------ Content */

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px var(--gutter) 0;
}

.text,
.game > :not(.hero, .others) {
  max-width: 72ch;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  margin: 8px 0 16px;
  font-size: clamp(34px, 6vw, 52px);
}

h2 {
  margin: 40px 0 8px;
  font-size: 26px;
}

h3 {
  margin: 32px 0 12px;
  font-size: 21px;
}

h3 span {
  color: var(--muted);
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
}

.lead {
  font-size: 20px;
}

li + li {
  margin-top: 8px;
}

.crumbs {
  color: var(--muted);
  font-size: 15px;
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}

/* A game: its visual beside its name and facts, one above the other on a phone. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px 32px;
  align-items: center;
  margin-bottom: 24px;
}

.visual {
  display: block;
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgb(0 0 0 / 45%);
}

.kicker {
  margin: 0;
  color: var(--cyan);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 14px;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.facts li {
  margin: 0;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 700;
}

/* P2.10: the players' rating, written by the Worker at serve time (« Pas encore assez d'avis »
   in the built page), gold like the stars of the app. */
.rating {
  margin: 0;
  color: #ffd23f;
  font-weight: 700;
}

.rating:not([data-note]) {
  color: var(--muted);
  font-weight: 600;
}

/* Read by screen readers only (the rating written by the Worker). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.sensors {
  color: var(--muted);
}

@media (min-width: 760px) {
  .hero {
    grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
  }
}

.play {
  margin: 48px 0 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-raised);
}

.play h2 {
  margin-top: 0;
}

/* Other games: a grid of cards, the whole card a link. */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cards li {
  margin: 0;
}

.cards a {
  display: grid;
  gap: 4px;
  height: 100%;
  padding: 10px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.cards img {
  width: 100%;
  border-radius: 10px;
}

.cards .name {
  font: 600 19px var(--display);
}

.cards .meta {
  color: var(--muted);
  font-size: 15px;
}

@media (hover: hover) {
  .cards a:hover {
    border-color: var(--cyan);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .cards a {
    transition: border-color 0.15s ease;
  }
}

/* PH14: the running order of a guide, one numbered card per game, its visual beside its text
   (above it on a narrow phone). */
.programme ol {
  display: grid;
  gap: 16px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.programme li {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px 16px;
  align-items: start;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  counter-increment: step;
}

.programme li img {
  width: 120px;
  border-radius: 8px;
}

.programme h3 {
  margin: 0;
}

.programme h3::before {
  content: counter(step) ". ";
  color: var(--pink);
}

.programme .step {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--text);
}

.programme .meta {
  margin: 0;
  color: var(--cyan);
  font-size: 15px;
  font-weight: 700;
}

.programme li p:last-child {
  margin-bottom: 0;
}

.programme .total {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 479px) {
  .programme li {
    grid-template-columns: minmax(0, 1fr);
  }

  .programme li img {
    width: 100%;
    max-width: 240px;
  }
}

/* PH14: the guides, as cards, the whole card a link. */
.guides {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guides li {
  margin: 0;
}

.guides a {
  display: grid;
  align-content: start;
  gap: 6px;
  height: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.guides .name {
  font: 600 21px var(--display);
}

.guides .meta {
  color: var(--cyan);
  font-size: 15px;
  font-weight: 700;
}

.guides a > span:last-child {
  color: var(--muted);
  font-size: 15px;
}

@media (hover: hover) {
  .guides a:hover {
    border-color: var(--cyan);
  }
}

/* PH15: one entry per date, newest first. */
.news {
  margin: 40px 0 0;
  border-top: 1px solid var(--line);
}

.news h2 {
  margin-top: 4px;
}

.news .date {
  margin: 20px 0 0;
  color: var(--cyan);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.news-games {
  color: var(--muted);
}

/* ------------------------------------------------------------------ Links of the menu and the footer
   (last: they are the most specific links of the page). */

.menu-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 8px;
  border-radius: 16px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.menu-link[aria-current="page"] {
  background: color-mix(in srgb, var(--cyan) 14%, transparent);
  color: var(--cyan);
}

.menu-legal a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.bottom nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.bottom nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
}

@media (hover: hover) {
  .bottom nav a:hover {
    color: var(--text);
  }

  .menu-link:hover {
    background: var(--surface);
  }

  .menu-button:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 20px rgb(46 230 245 / 50%);
  }
}

/* P2.9: the rules video of a game, 16:9, its poster until « Lecture ». */
.rules-video video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #000;
}
