/* Jeux | Blog-United — en-tête avec menu, pied de page et pages légales (accueil, mentions légales, confidentialité).
   Les pages de jeu gardent leur propre barre compacte. */

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.stage[id] { scroll-margin-top: 16px; }

/* lien d'évitement : visible seulement au clavier */
.skip {
  position: absolute; left: 12px; top: -80px; z-index: 50;
  padding: 10px 16px; border-radius: 12px; background: var(--sky); color: var(--navy);
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: max(12px, env(safe-area-inset-top)); }

/* ---- en-tête ---- */
.site-header { position: relative; z-index: 20; }
.site-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; max-width: 520px; margin: 0 auto; min-height: 60px;
  padding: max(8px, env(safe-area-inset-top)) 20px 0;
}
.site-bar .brand { min-height: 44px; }
.site-bar .brand-logo { height: 46px; }
.nav-toggle {
  display: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 12px;
  border: 0; border-radius: 999px; background: rgba(224, 239, 255, 0.08); box-shadow: inset 0 0 0 1.5px var(--line);
  font-weight: 500; font-size: 15px; cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .i-close, .site-nav.open .nav-toggle .i-open { display: none; }
.site-nav.open .nav-toggle .i-close { display: block; }
.nav-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 22px; }
.nav-list a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  color: var(--muted); font-weight: 500; font-size: 15px; text-decoration: none;
  transition: color 0.15s var(--ease);
}
.nav-list a:hover { color: var(--text); }
.nav-list .ext { width: 15px; height: 15px; flex: none; }

@media (max-width: 819px) {
  /* le menu se replie derrière le bouton dès que le script est chargé (sans script, les liens restent visibles) */
  .site-nav[data-ready] .nav-toggle { display: inline-flex; }
  .site-nav[data-ready] .nav-list {
    display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    width: calc(100% - 24px); max-width: 496px; margin: 0 auto;
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px;
    border-radius: 22px; background: var(--tile);
    box-shadow: 0 18px 44px rgba(3, 14, 28, 0.6), inset 0 0 0 1.5px var(--line);
  }
  .site-nav[data-ready].open .nav-list { display: flex; animation: nav-in 0.18s var(--ease); }
  .site-nav[data-ready] .nav-list a { display: flex; min-height: 52px; padding: 0 14px; border-radius: 14px; color: var(--text); font-size: 17px; }
  .site-nav[data-ready] .nav-list a:hover { background: rgba(224, 239, 255, 0.07); }
  .site-nav[data-ready] .nav-ext { margin-top: 6px; padding-top: 6px; border-top: 1.5px solid var(--line); }
}
@keyframes nav-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

@media (min-width: 820px) {
  .site-bar { max-width: 1000px; min-height: 70px; padding-top: 12px; }
  .site-bar .brand-logo { height: 54px; }
  .nav-ext a { color: var(--text); padding: 0 16px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line); }
  .nav-ext a:hover { box-shadow: inset 0 0 0 1.5px var(--sky); }
}

/* l'accueil n'occupe plus tout l'écran : le pied de page suit les cartes */
.home-page .home { min-height: 0; padding-top: 30px; }
@media (min-width: 820px) { .home-page .home { padding-top: 32px; } }

/* ---- pied de page ---- */
.site-footer {
  position: relative; z-index: 1;
  background: var(--navy); border-top: 1.5px solid var(--line);
  color: var(--muted); font-size: 15px;
}
.foot-wrap { display: grid; gap: 30px; max-width: 520px; margin: 0 auto; padding: 34px 20px 20px; }
.foot-about p { max-width: 44ch; margin-top: 10px; }
.foot-about .brand { color: var(--text); min-height: 44px; }
.foot-about .brand-logo { height: 52px; }
.foot-about a:not(.brand) { color: var(--text); text-underline-offset: 3px; }
.foot-social { display: flex; flex-wrap: wrap; gap: 10px; }
.foot-social a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--line); text-decoration: none; font-weight: 500;
}
.foot-social a:hover { box-shadow: inset 0 0 0 1.5px var(--sky); }
.foot-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 20px; }
.foot-col h2 { font-size: 14px; font-weight: 700; letter-spacing: 0; color: var(--sky); margin-bottom: 4px; }
.foot-col ul { list-style: none; padding: 0; }
.foot-col a { display: block; padding: 12px 0; line-height: 1.35; text-decoration: none; }
.foot-col a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 819px) {
  /* téléphone : « Les jeux » et « Infos » côte à côte, les rubriques de Blog-United sur toute la largeur */
  .foot-col:nth-child(2) { grid-column: 1 / -1; order: 3; }
  .foot-col:nth-child(2) ul { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
}
.nw { white-space: nowrap; }
.foot-base {
  max-width: 520px; margin: 0 auto;
  padding: 16px 20px max(24px, env(safe-area-inset-bottom));
  border-top: 1.5px solid var(--line); font-size: 14px;
}
@media (min-width: 820px) {
  .foot-wrap { max-width: 1000px; grid-template-columns: 1fr 2fr; gap: 56px; padding-top: 48px; }
  .foot-cols { grid-template-columns: repeat(3, 1fr); }
  .foot-base { max-width: 960px; padding-left: 0; padding-right: 0; }
}

/* ---- pages légales ---- */
.legal { position: relative; z-index: 1; width: 100%; max-width: 520px; margin: 0 auto; padding: 30px 20px 56px; }
.prose { max-width: 68ch; }
.prose h1 { font-size: clamp(30px, 8vw, 44px); margin-top: 10px; }
.legal-updated { color: var(--muted); font-size: 14px; margin: 8px 0 26px; }
.prose h2 { font-size: 21px; margin: 36px 0 10px; scroll-margin-top: 16px; }
.prose p, .prose li { color: #d6e5f6; }
.prose p + p, .prose ul + p, .prose table + p { margin-top: 12px; }
.prose .lead { font-size: 17px; color: var(--text); }
.prose ul { padding-left: 1.2em; margin-top: 10px; }
.prose li + li { margin-top: 6px; }
.prose a { color: var(--p0); text-underline-offset: 3px; }
.facts { margin-top: 12px; padding: 4px 18px; border-radius: 18px; background: var(--night); box-shadow: inset 0 0 0 1.5px var(--line); }
.facts div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.legal-table { width: 100%; margin-top: 12px; border-collapse: collapse; font-size: 15px; }
.legal-table th { text-align: left; font-size: 13px; font-weight: 700; color: var(--sky); padding: 0 14px 10px 0; }
.legal-table td { vertical-align: top; padding: 14px 14px 14px 0; border-top: 1px solid var(--line); color: #d6e5f6; }
.legal-table td:first-child { color: var(--text); font-weight: 500; }
@media (max-width: 639px) {
  /* sur téléphone, chaque ligne devient une fiche */
  .legal-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .legal-table, .legal-table tbody, .legal-table tr, .legal-table td { display: block; }
  .legal-table tr { margin-top: 10px; padding: 12px 16px; border-radius: 16px; background: var(--night); box-shadow: inset 0 0 0 1.5px var(--line); }
  .legal-table td { padding: 6px 0; border-top: 0; }
  .legal-table td + td::before { content: attr(data-label); display: block; font-size: 12.5px; color: var(--muted); }
  .legal-table td:first-child { font-size: 16px; }
}
@media (min-width: 640px) {
  .facts div { display: grid; grid-template-columns: 210px 1fr; gap: 16px; align-items: baseline; }
  .facts dd { margin: 0; }
}
@media (min-width: 820px) {
  .legal { max-width: 1000px; padding-top: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-nav[data-ready].open .nav-list { animation: none; }
}

/* ---- application installable : bouton du pied de page et page hors ligne ---- */
.foot-install { margin-top: 16px; }
.foot-install-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px 0 14px;
  border: 0; border-radius: 999px; background: var(--p0); color: var(--navy);
  font-weight: 700; font-size: 15px; cursor: pointer;
}
.foot-install-btn svg { width: 18px; height: 18px; flex: none; }
.install-help { margin-top: 10px; max-width: 40ch; color: var(--text); }
.offline-page .offline { min-height: 100vh; min-height: 100dvh; }
.offline .brand { align-self: flex-start; }
.offline .brand-logo { height: 46px; }
.offline .h-display { font-size: clamp(32px, 9vw, 48px); margin-bottom: 10px; }
.offline .lede { color: var(--muted); max-width: 40ch; margin-bottom: 26px; }
