/*
 * Défi Races Ovines — système de mise en page public 1.23.03
 *
 * Cette feuille définit uniquement la géométrie commune des pages publiques :
 * largeur du site, rythmes verticaux, panneaux principaux et pied de page.
 * Les composants propres à chaque page restent dans leurs feuilles dédiées.
 */

:root {
  --site-shell-home: 860px;
  --site-shell-standard: 1040px;
  --site-shell-game: 1120px;
  --site-shell-wide: 1240px;
  --site-gutter: 18px;
  --site-section-gap: 18px;
  --site-radius: 13px;
  --site-border: 3px solid var(--wood, #7c3f19);
  --site-panel-bg: rgba(239, 231, 200, .95);
  --site-panel-shadow: 0 4px 0 rgba(92, 52, 25, .22);
}

/* Un seul conteneur de référence pour le bandeau, le contenu et le pied de page. */
.site-shell {
  --site-shell-max: var(--site-shell-standard);
  width: min(var(--site-shell-max), calc(100% - (2 * var(--site-gutter)))) !important;
  max-width: none !important;
  min-height: 100vh;
  margin: 0 auto !important;
  padding: 18px 0 30px !important;
}

.site-shell--home { --site-shell-max: var(--site-shell-home); }
.site-shell--standard { --site-shell-max: var(--site-shell-standard); }
.site-shell--game { --site-shell-max: var(--site-shell-game); }
.site-shell--wide { --site-shell-max: var(--site-shell-wide); }

/* Les blocs de premier niveau ne réinventent plus leur propre largeur. */
.site-shell > .app-header,
.site-shell > .panel,
.site-shell > form.panel,
.site-shell > .intro,
.site-shell > .empty,
.site-shell > .error-box,
.site-shell > .thanks,
.site-shell > .proposal-hero,
.site-shell > .proposal-message,
.site-shell > .proposal-layout,
.site-shell > .filters,
.site-shell > .photo-contribution-banner,
.site-shell > .defi-hero,
.site-shell > .defi-grid,
.site-shell > .defi-error,
.site-shell > .defi-play-placeholder,
.site-shell > .defi-game-start,
.site-shell > .defi-result-panel,
.site-shell > .welcome-layout,
.site-shell > .game,
.site-shell > .join-error,
.site-shell > .join-card {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.site-shell > .app-header {
  margin-bottom: var(--site-section-gap) !important;
}

/* Accueil : on conserve l'équilibre historique entre le bandeau et le grand panneau. */
.site-shell--home > .app-header {
  margin-bottom: 0 !important;
  border-radius: var(--site-radius) var(--site-radius) 0 0 !important;
  border-bottom-width: 0 !important;
}

.site-shell--home > #welcome,
.site-shell--home > .welcome-layout {
  margin-top: 0 !important;
}

.site-shell--home > #welcome > .home-hero,
.site-shell--home > .welcome-layout > .home-hero,
.site-shell--home > .welcome-layout > .welcome-form {
  border-radius: 0 0 var(--site-radius) var(--site-radius) !important;
}

/* Les pages Défi utilisent la largeur commune ; leur composition interne reste intacte. */
.site-shell.defi-page > .defi-hero,
.site-shell.defi-page > .defi-grid,
.site-shell.defi-page > .defi-top-scores,
.site-shell.defi-page > .defi-error,
.site-shell.defi-page > .defi-game-shell,
.site-shell.defi-page > .defi-game-start,
.site-shell.defi-page > .defi-result-panel,
.site-shell.defi-page > .defi-play-placeholder {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Formulaire de connexion : panneau extérieur aligné au bandeau,
   contenu conservé à une largeur confortable. */
.site-shell.join-page-compact {
  width: min(var(--site-shell-standard), calc(100% - (2 * var(--site-gutter)))) !important;
}

.site-shell.join-page-compact > .join-card,
.site-shell.join-page-compact > .join-error,
.site-shell.join-page-compact > .app-header {
  width: 100% !important;
  max-width: none !important;
}

.site-shell.join-page-compact > .join-card > .join-card-head,
.site-shell.join-page-compact > .join-card > .join-instructions,
.site-shell.join-page-compact > .join-card > .join-closed-box,
.site-shell.join-page-compact > .join-card > .join-fields-row,
.site-shell.join-page-compact > .join-card > .join-code-field,
.site-shell.join-page-compact > .join-card > .join-help,
.site-shell.join-page-compact > .join-card > .join-actions,
.site-shell.join-page-compact > .join-card > .join-waiting,
.site-shell.join-page-compact > .join-card > .join-success-actions,
.site-shell.join-page-compact > .join-card > p {
  width: min(100%, 760px);
  margin-left: auto;
  margin-right: auto;
}

/* Le contenu juridique suit désormais la même largeur que son bandeau. */
.site-shell .legal-content {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Pied de page public compact : le lien reste visible sans créer un nouveau
   panneau de la largeur complète de la page. */
.site-shell > .site-footer {
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  box-sizing: border-box;
  width: fit-content !important;
  max-width: calc(100% - 24px) !important;
  min-height: 0;
  margin: var(--site-section-gap) auto 0 !important;
  padding: 7px 15px !important;
  border: 1px solid rgba(124, 63, 25, .48) !important;
  border-radius: 999px !important;
  background: rgba(255, 248, 226, .78) !important;
  box-shadow: none !important;
  color: #4b2c19 !important;
  font-size: .82rem !important;
  font-weight: 750 !important;
  line-height: 1.3;
  text-align: center !important;
}

.site-footer-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
}

.site-footer a {
  color: #6f321c !important;
  font-weight: 850 !important;
  text-decoration: none !important;
  border-bottom: 1px solid transparent;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--accent-dark, #8f341c) !important;
  border-bottom-color: currentColor;
  outline: none;
}

.site-footer .footer-separator {
  color: rgba(92, 52, 25, .55);
}

/* Les pages sans include de pied de page peuvent utiliser ce conteneur ensuite. */
.site-page-section {
  width: 100%;
  margin-bottom: var(--site-section-gap);
}

@media (max-width: 700px) {
  :root {
    --site-gutter: 8px;
    --site-section-gap: 10px;
  }

  .site-shell,
  .site-shell.join-page-compact {
    width: calc(100% - (2 * var(--site-gutter))) !important;
    padding: 8px 0 18px !important;
  }

  .site-shell > .app-header {
    margin-bottom: 10px !important;
  }

  .site-shell--home > .app-header {
    margin-bottom: 0 !important;
  }

  .site-shell > .site-footer {
    max-width: calc(100% - 12px) !important;
    padding: 6px 12px !important;
    font-size: .78rem !important;
  }

  .site-shell.join-page-compact > .join-card > * {
    max-width: 100%;
  }
}

@media (max-width: 950px) and (max-height: 620px) and (orientation: landscape) {
  :root {
    --site-gutter: 8px;
    --site-section-gap: 10px;
  }

  .site-shell {
    width: calc(100% - 16px) !important;
    padding: 8px 0 16px !important;
  }
}

@media print {
  .site-footer {
    display: none !important;
  }
}

/* L'ancienne feuille d'accueil imposait une largeur de 1120 px au conteneur
   général, puis 860 px à ses blocs internes. On fixe désormais 860 px une seule
   fois au niveau du shell afin que bandeau, contenu et pied de page coïncident. */
body:has(.site-shell--home #welcome:not(.hidden)) .site-shell--home {
  width: min(var(--site-shell-home), calc(100% - (2 * var(--site-gutter)))) !important;
  max-width: none !important;
  padding: 18px 0 30px !important;
}

@media (max-width: 700px) {
  body:has(.site-shell--home #welcome:not(.hidden)) .site-shell--home {
    width: calc(100% - (2 * var(--site-gutter))) !important;
    padding: 8px 0 18px !important;
  }
}

/* v1.23.12 — les règles de largeur des pages Défi ne ciblent plus les fenêtres modales imbriquées. */
/*
 * Défi Races Ovines — bandeau public commun 1.23.02
 *
 * Une seule composition ordinateur et une seule composition mobile.
 * Le logo occupe les deux lignes sur ordinateur ; la navigation reste
 * sur une ligne et le sélecteur de langue demeure dans l'angle supérieur droit.
 */

.app-header {
  color: #fff8e8;
  background: linear-gradient(135deg, #bd7c28 0%, #cf9638 62%, #c78b31 100%) !important;
  border: 3px solid var(--wood, #7c3f19) !important;
  border-radius: 13px !important;
  box-shadow: 0 5px 0 rgba(92, 52, 25, .22) !important;
}

/* Espace professeur 1.27.03 : langue et compte occupent deux zones distinctes. */
@media (min-width: 701px) {
  .app-header.is-unified-desktop.teacher-area-header {
    grid-template-columns: 86px minmax(0, 1fr) auto auto !important;
    grid-template-areas:
      "logo title utility account"
      "logo navigation navigation navigation" !important;
  }

  .teacher-area-header > .header-extra-topright {
    grid-area: account !important;
    position: relative;
    justify-self: end;
    align-self: center;
  }
}

.teacher-account-menu { position: relative; color: #fff; }
.teacher-account-menu > summary {
  min-width: 92px;
  padding: 7px 12px;
  border: 2px solid rgba(255, 248, 226, .94);
  border-radius: 999px;
  background: rgba(255, 248, 226, .10);
  color: #fff;
  cursor: pointer;
  font-size: .84rem;
  font-weight: 900;
  list-style: none;
  text-align: center;
  white-space: nowrap;
}
.teacher-account-menu > summary::-webkit-details-marker { display: none; }
.teacher-account-menu > summary::after { content: " ▾"; }
.teacher-account-menu[open] > summary::after { content: " ▴"; }
.teacher-account-menu > div {
  position: absolute;
  z-index: 100;
  top: calc(100% + 7px);
  right: 0;
  display: grid;
  min-width: 220px;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d1b9a7;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(50, 27, 14, .22);
  color: #442618;
}
.teacher-account-menu > div span { padding: 4px 5px; font-size: .82rem; font-weight: 800; }
.teacher-account-menu > div a {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f3e9df;
  color: #6b301a;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

@media (max-width: 700px) {
  .teacher-area-header > .header-extra-topright { display: none !important; }
}

.app-header a { color: inherit; }

.site-header-language {
  display: inline-flex;
  flex: 0 0 auto;
  overflow: hidden;
  border: 2px solid rgba(255, 248, 226, .96);
  border-radius: 999px;
  background: rgba(255, 250, 229, .96);
  box-shadow: 0 2px 0 rgba(70, 38, 18, .14);
  vertical-align: middle;
}

.site-header-language a {
  display: grid;
  place-items: center;
  min-width: 38px;
  min-height: 30px;
  padding: 4px 8px;
  color: #5b341e;
  font-size: .75rem;
  font-weight: 950;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.site-header-language a + a {
  border-left: 1px solid rgba(93, 53, 26, .35);
}

.site-header-language a:hover,
.site-header-language a:focus-visible {
  background: rgba(230, 221, 164, .8);
  outline: none;
}

.site-header-language a.is-active {
  color: #fff;
  background: #6e3f22;
}

.site-mobile-header-row,
.site-mobile-menu,
.site-mobile-header-controls {
  display: none;
}

@media (min-width: 701px) {
  .app-header.is-unified-desktop,
  .site-shell > .app-header {
    display: grid !important;
    grid-template-columns: 86px minmax(0, 1fr) auto;
    grid-template-rows: minmax(38px, auto) 38px;
    grid-template-areas:
      "logo title utility"
      "logo navigation navigation";
    align-items: center !important;
    column-gap: 13px !important;
    row-gap: 2px !important;
    min-height: 104px !important;
    padding: 9px 16px 10px !important;
  }

  .app-header > .site-desktop-brand {
    display: contents !important;
    color: inherit;
    text-decoration: none;
  }

  .app-header .header-logo {
    grid-area: logo;
    align-self: center;
    justify-self: center;
    width: 82px !important;
    height: 82px !important;
    max-width: 82px !important;
    object-fit: contain;
    filter: drop-shadow(0 2px 0 rgba(65, 34, 17, .22));
  }

  .app-header .brand-text {
    grid-area: title;
    display: flex !important;
    align-items: baseline !important;
    gap: 12px !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .app-header h1 {
    flex: 0 0 auto;
    margin: 0 !important;
    color: #fff8e8 !important;
    font-size: clamp(1.72rem, 2.45vw, 2.12rem) !important;
    line-height: 1 !important;
    letter-spacing: -.015em !important;
    white-space: nowrap !important;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .18);
    text-align: left !important;
  }

  .app-header .subtitle,
  .app-header .credits {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 520px;
    margin: 0 !important;
    color: #fff8e8 !important;
    font-size: .69rem !important;
    font-weight: 850 !important;
    line-height: 1.15 !important;
    text-align: left;
    opacity: .96;
  }

  .app-header .credits { display: none !important; }

  .app-header > .site-header-desktop-language,
  .app-header > .header-extra-topright,
  .app-header > .scoreboard {
    grid-area: utility;
    justify-self: end;
    align-self: center;
  }

  .app-header > .site-header-desktop-language {
    display: flex !important;
    align-items: center;
  }

  .app-header > .header-actions {
    grid-area: navigation;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 9px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .app-header .header-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    min-height: 35px !important;
    margin: 0 !important;
    padding: 7px 14px !important;
    border: 2px solid rgba(255, 248, 226, .94) !important;
    border-radius: 9px !important;
    background: rgba(255, 248, 226, .09) !important;
    box-shadow: 0 2px 0 rgba(73, 38, 18, .18) !important;
    color: #fff9eb !important;
    font-size: .91rem !important;
    font-weight: 900 !important;
    line-height: 1.05 !important;
    text-align: center !important;
    text-decoration: none !important;
    white-space: nowrap !important;
  }

  .app-header .header-link:hover,
  .app-header .header-link:focus-visible {
    background: rgba(255, 248, 226, .20) !important;
    transform: translateY(-1px);
    outline: none;
  }

  .app-header .header-link.is-active,
  .app-header .header-link[aria-current="page"] {
    border-color: #166f38 !important;
    background: linear-gradient(180deg, #27a854, #17813f) !important;
    color: #fff !important;
    box-shadow: 0 3px 0 rgba(19, 92, 47, .55) !important;
  }

  .app-header > .site-header-stacked-subtitle,
  .app-header > .site-mobile-header-row,
  .app-header > .site-mobile-menu {
    display: none !important;
  }

  .app-header > .scoreboard {
    display: grid;
    grid-template-columns: repeat(3, minmax(72px, auto));
    gap: 6px;
  }

  .app-header > .scoreboard > div {
    min-width: 76px;
    padding: 4px 7px;
    border: 2px solid rgba(255, 248, 226, .8);
    border-radius: 8px;
    background: rgba(255, 248, 226, .92);
    color: #4b2816;
    box-shadow: none;
  }

  .app-header > .scoreboard span {
    font-size: .62rem;
  }

  .app-header > .scoreboard strong {
    font-size: 1rem;
  }

  /* L'accueil garde son tableau de scores dans le contenu, pas dans le bandeau. */
  .site-shell--home > .app-header > .scoreboard {
    display: none !important;
  }
}

@media (min-width: 701px) and (max-width: 940px) {
  .app-header.is-unified-desktop,
  .site-shell > .app-header {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    grid-template-rows: minmax(34px, auto) 36px;
    min-height: 90px !important;
    column-gap: 10px !important;
    row-gap: 1px !important;
    padding: 8px 12px 9px !important;
  }

  .app-header .header-logo {
    width: 69px !important;
    height: 69px !important;
    max-width: 69px !important;
  }

  .app-header .brand-text { gap: 8px !important; }
  .app-header h1 { font-size: 1.48rem !important; }

  .app-header .subtitle {
    max-width: 300px;
    font-size: .59rem !important;
  }

  .app-header > .header-actions { gap: 6px !important; }

  .app-header .header-link {
    min-height: 33px !important;
    padding: 6px 9px !important;
    font-size: .82rem !important;
  }

  .site-header-language a {
    min-width: 33px;
    min-height: 28px;
    padding-inline: 6px;
  }
}

@media (max-width: 700px) {
  .app-header,
  .app-header.is-unified-desktop,
  .site-shell > .app-header {
    position: relative !important;
    display: block !important;
    min-height: 0 !important;
    padding: 9px 10px !important;
    border-width: 2px !important;
    border-radius: 11px !important;
    overflow: visible !important;
  }

  .site-shell--home > .app-header {
    border-radius: 11px 11px 0 0 !important;
  }

  .app-header > .site-desktop-brand,
  .app-header > .header-actions,
  .app-header > .site-header-desktop-language,
  .app-header > .site-header-stacked-subtitle,
  .app-header > .header-extra-topright {
    display: none !important;
  }

  .app-header > .site-mobile-header-row {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
  }

  .site-mobile-brand {
    display: flex !important;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: #fff8e8 !important;
    font-size: 1.02rem;
    font-weight: 950;
    line-height: 1.05;
    text-decoration: none;
  }

  .site-mobile-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .site-mobile-logo {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    object-fit: contain;
  }

  .site-mobile-header-controls {
    display: flex !important;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
  }

  .site-header-language:not(.site-header-language-mobile) {
    display: none !important;
  }

  .site-header-language-mobile {
    display: inline-flex !important;
    border-color: rgba(93, 53, 26, .62);
  }

  .site-header-language-mobile a {
    min-width: 32px;
    min-height: 29px;
    padding: 3px 6px;
    font-size: .68rem;
  }

  .site-mobile-menu-button {
    display: grid !important;
    place-content: center;
    gap: 4px;
    width: 37px;
    height: 34px;
    margin: 0;
    padding: 0 !important;
    border: 2px solid rgba(255, 248, 226, .92) !important;
    border-radius: 8px !important;
    background: rgba(255, 248, 226, .12) !important;
    box-shadow: none !important;
  }

  .site-mobile-menu-button span {
    display: block;
    width: 19px;
    height: 2.5px;
    border-radius: 999px;
    background: currentColor;
    transition: transform .16s ease, opacity .16s ease;
  }

  .site-mobile-menu-button[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .site-mobile-menu-button[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .site-mobile-menu-button[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  /* Menu mobile commun : panneau clair et textes foncés.
     Toutes les propriétés sont définies ici afin de neutraliser les anciennes
     versions du menu encore présentes dans certaines feuilles de page. */
  .app-header > .site-mobile-menu:not([hidden]) {
    position: absolute !important;
    z-index: 1000 !important;
    top: calc(100% + 7px) !important;
    right: 0 !important;
    bottom: auto !important;
    left: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px !important;
    width: auto !important;
    margin: 0 !important;
    padding: 9px !important;
    border: 2px solid var(--wood, #7c3f19) !important;
    border-radius: 12px !important;
    background: #fff8e2 !important;
    box-shadow: 0 13px 30px rgba(59, 29, 12, .28) !important;
  }

  .app-header > .site-mobile-menu[hidden] {
    display: none !important;
  }

  .site-mobile-menu a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 9px;
    border: 1px solid #d8b77a !important;
    border-radius: 8px;
    background: #fffaf0 !important;
    color: #3d1e0f !important;
    font-size: .84rem;
    font-weight: 850;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
  }

  .site-mobile-menu a:hover,
  .site-mobile-menu a:focus-visible {
    border-color: #b9823f !important;
    background: #f6e8bf !important;
    color: #2e160b !important;
    outline: none;
  }

  .site-mobile-menu a.is-active {
    border-color: #166f38 !important;
    background: linear-gradient(180deg, #27a854, #17813f) !important;
    color: #fff !important;
    box-shadow: inset 0 -2px 0 rgba(24, 84, 31, .25);
  }

  .site-mobile-menu a.site-mobile-menu-cta {
    grid-column: 1 / -1;
    border-color: #91b879 !important;
    background: #e8f4dc !important;
    color: #245c2c !important;
  }

  .app-header > .scoreboard {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 9px;
  }

  .app-header > .scoreboard > div {
    padding: 5px 4px;
    border: 1px solid rgba(255, 248, 226, .72);
    border-radius: 7px;
    background: rgba(255, 248, 226, .9);
    color: #4b2816;
    text-align: center;
  }

  .app-header > .scoreboard span { font-size: .58rem; }
  .app-header > .scoreboard strong { font-size: .88rem; }
  .site-shell--home > .app-header > .scoreboard { display: none !important; }
}

@media (max-width: 390px) {
  .site-mobile-brand { font-size: .94rem; }
  .site-mobile-logo { width: 34px; height: 34px; }
  .site-mobile-header-controls { gap: 5px; }
  .site-header-language-mobile a { min-width: 29px; padding-inline: 4px; }
  .app-header > .site-mobile-menu:not([hidden]) { grid-template-columns: 1fr; }
}

@media print {
  .app-header { display: none !important; }
}

/* Accueil : neutralisation centralisée des anciennes règles très spécifiques.
   Le gabarit visuel est conservé, mais il repose désormais sur le bandeau commun. */
@media (min-width: 701px) {
  body:has(#welcome:not(.hidden)) .site-shell--home > .topbar.app-header.is-unified-desktop {
    display: grid !important;
    grid-template-columns: 86px minmax(0, 1fr) auto !important;
    grid-template-rows: minmax(38px, auto) 38px !important;
    grid-template-areas:
      "logo title utility"
      "logo navigation navigation" !important;
    align-items: center !important;
    min-height: 104px !important;
    padding: 9px 16px 10px !important;
    column-gap: 13px !important;
    row-gap: 2px !important;
  }

  body:has(#welcome:not(.hidden)) .site-shell--home > .topbar.app-header .site-desktop-brand {
    display: contents !important;
  }

  body:has(#welcome:not(.hidden)) .site-shell--home > .topbar.app-header .header-logo {
    grid-area: logo !important;
    width: 82px !important;
    height: 82px !important;
    max-width: 82px !important;
  }

  body:has(#welcome:not(.hidden)) .site-shell--home > .topbar.app-header .brand-text {
    grid-area: title !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-width: 0 !important;
    text-align: left !important;
  }

  body:has(#welcome:not(.hidden)) .site-shell--home > .topbar.app-header h1 {
    font-size: clamp(1.72rem, 2.45vw, 2.12rem) !important;
    white-space: nowrap !important;
    text-align: left !important;
  }

  body:has(#welcome:not(.hidden)) .site-shell--home > .topbar.app-header .subtitle,
  body:has(#welcome:not(.hidden)) .site-shell--home > .topbar.app-header .credits {
    display: none !important;
  }

  body:has(#welcome:not(.hidden)) .site-shell--home > .topbar.app-header .header-actions {
    grid-area: navigation !important;
    display: flex !important;
    width: 100% !important;
    margin: 0 !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 9px !important;
  }

  body:has(#welcome:not(.hidden)) .site-shell--home > .topbar.app-header .header-link {
    min-height: 35px !important;
    padding: 7px 12px !important;
    font-size: .88rem !important;
    white-space: nowrap !important;
  }

  body:has(#welcome:not(.hidden)) .site-shell--home > .topbar.app-header .site-header-desktop-language {
    grid-area: utility !important;
    display: flex !important;
  }
}

@media (min-width: 701px) and (max-width: 940px) {
  body:has(#welcome:not(.hidden)) .site-shell--home > .topbar.app-header.is-unified-desktop {
    grid-template-columns: 72px minmax(0, 1fr) auto !important;
    grid-template-rows: 34px 36px !important;
    min-height: 90px !important;
    padding: 8px 12px 9px !important;
  }

  body:has(#welcome:not(.hidden)) .site-shell--home > .topbar.app-header .header-logo {
    width: 69px !important;
    height: 69px !important;
    max-width: 69px !important;
  }

  body:has(#welcome:not(.hidden)) .site-shell--home > .topbar.app-header h1 {
    font-size: 1.48rem !important;
  }

  body:has(#welcome:not(.hidden)) .site-shell--home > .topbar.app-header .header-actions {
    gap: 6px !important;
  }

  body:has(#welcome:not(.hidden)) .site-shell--home > .topbar.app-header .header-link {
    padding: 6px 8px !important;
    font-size: .79rem !important;
  }
}

@media (max-width: 700px) {
  body:has(#welcome:not(.hidden)) .site-shell--home > .topbar.app-header.is-unified-desktop {
    display: block !important;
    min-height: 0 !important;
    padding: 9px 10px !important;
  }

  body:has(#welcome:not(.hidden)) .site-shell--home > .topbar.app-header .site-mobile-header-row {
    display: flex !important;
  }

  body:has(#welcome:not(.hidden)) .site-shell--home > .topbar.app-header .site-desktop-brand,
  body:has(#welcome:not(.hidden)) .site-shell--home > .topbar.app-header .header-actions {
    display: none !important;
  }
}

/* Priorité de migration : les anciennes feuilles de certaines pages classe
   comportaient encore des règles !important. Ces sélecteurs, tous regroupés
   ici, garantissent que le composant commun reste l'unique source de vérité. */
@media (min-width: 701px) {
  .site-shell > .topbar.app-header.is-unified-desktop {
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 var(--site-section-gap, 18px) !important;
  }

  .site-shell--home > .topbar.app-header.is-unified-desktop {
    margin-bottom: 0 !important;
  }

  .site-shell > .topbar.app-header.is-unified-desktop > .site-desktop-brand {
    display: contents !important;
  }

  .site-shell > .topbar.app-header.is-unified-desktop .header-logo {
    grid-area: logo !important;
    width: 82px !important;
    height: 82px !important;
    max-width: 82px !important;
    margin: 0 !important;
  }

  .site-shell > .topbar.app-header.is-unified-desktop .brand-text {
    grid-area: title !important;
    display: flex !important;
    align-items: baseline !important;
    gap: 12px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .site-shell > .topbar.app-header.is-unified-desktop h1 {
    margin: 0 !important;
    font-size: clamp(1.72rem, 2.45vw, 2.12rem) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .site-shell > .topbar.app-header.is-unified-desktop .subtitle {
    display: block !important;
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 520px !important;
    margin: 0 !important;
    font-size: .69rem !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  .site-shell > .topbar.app-header.is-unified-desktop > .header-actions {
    grid-area: navigation !important;
    display: flex !important;
    width: 100% !important;
    margin: 0 !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
  }

  .site-shell.join-page-compact > .topbar.app-header.join-topbar.is-unified-desktop {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

@media (min-width: 701px) and (max-width: 940px) {
  .site-shell > .topbar.app-header.is-unified-desktop .header-logo {
    width: 69px !important;
    height: 69px !important;
    max-width: 69px !important;
  }

  .site-shell > .topbar.app-header.is-unified-desktop .brand-text {
    gap: 8px !important;
  }

  .site-shell > .topbar.app-header.is-unified-desktop h1 {
    font-size: 1.48rem !important;
  }

  .site-shell > .topbar.app-header.is-unified-desktop .subtitle {
    max-width: 300px !important;
    font-size: .59rem !important;
  }
}

/*
 * Défi Races Ovines 1.23.30
 * État « résultat » du jeu classique.
 *
 * L'écran final reprend exactement les proportions du bandeau commun :
 * le compteur est retiré, sans agrandir le logo ni comprimer le sous-titre.
 */
@media (min-width: 701px) {
  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results {
    display: grid !important;
    grid-template-columns: 86px minmax(0, 1fr) !important;
    grid-template-rows: minmax(38px, auto) 38px !important;
    grid-template-areas:
      "logo title"
      "logo navigation" !important;
    align-items: center !important;
    min-height: 104px !important;
    padding: 9px 16px 10px !important;
    column-gap: 13px !important;
    row-gap: 2px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .site-desktop-brand {
    display: contents !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results .header-logo {
    grid-area: logo !important;
    display: block !important;
    align-self: center !important;
    justify-self: center !important;
    width: 82px !important;
    height: 82px !important;
    max-width: 82px !important;
    min-width: 0 !important;
    margin: 0 !important;
    object-fit: contain !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results .brand-text {
    grid-area: title !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: baseline !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results .brand-text h1 {
    display: block !important;
    flex: 0 0 auto !important;
    width: auto !important;
    margin: 0 !important;
    color: #fff8e8 !important;
    font-size: clamp(1.72rem, 2.45vw, 2.12rem) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results .brand-text .subtitle {
    display: block !important;
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    color: #fff8e8 !important;
    font-size: .69rem !important;
    font-weight: 850 !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    visibility: visible !important;
    opacity: .97 !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .header-actions {
    grid-area: navigation !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 9px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .scoreboard {
    display: none !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .site-header-desktop-language,
  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .header-extra-topright {
    position: absolute !important;
    top: 9px !important;
    right: 12px !important;
  }
}

@media (min-width: 701px) and (max-width: 940px) {
  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results {
    grid-template-columns: 72px minmax(0, 1fr) !important;
    grid-template-rows: minmax(34px, auto) 36px !important;
    min-height: 90px !important;
    padding: 8px 12px 9px !important;
    column-gap: 10px !important;
    row-gap: 1px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results .header-logo {
    width: 69px !important;
    height: 69px !important;
    max-width: 69px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results .brand-text {
    gap: 8px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results .brand-text h1 {
    font-size: 1.48rem !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results .brand-text .subtitle {
    font-size: .59rem !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .header-actions {
    gap: 6px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results .header-link {
    min-height: 33px !important;
    padding: 6px 9px !important;
    font-size: .82rem !important;
  }
}

/*
 * Défi Races Ovines 1.23.31
 * Première étape de remise en état du bandeau final du mode classique :
 * restaurer de façon certaine le titre et le sous-titre.
 *
 * Le résultat ne dépend plus de la mise en page historique de .brand-text.
 * Le logo conserve volontairement la taille du bandeau commun ; son réglage
 * pourra être affiné séparément après validation de cette étape.
 */
.site-classic-results-heading {
  display: none;
}

@media (min-width: 701px) {
  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results {
    position: relative !important;
    display: block !important;
    min-height: 116px !important;
    padding: 10px 16px 11px !important;
    overflow: hidden !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .site-desktop-brand {
    position: absolute !important;
    z-index: 3 !important;
    top: 15px !important;
    left: 16px !important;
    display: block !important;
    width: 82px !important;
    height: 82px !important;
    margin: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .site-desktop-brand .header-logo {
    display: block !important;
    width: 82px !important;
    height: 82px !important;
    max-width: 82px !important;
    margin: 0 !important;
    object-fit: contain !important;
    transform: none !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .site-desktop-brand .brand-text {
    display: none !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .site-classic-results-heading {
    position: absolute !important;
    z-index: 4 !important;
    top: 14px !important;
    right: 16px !important;
    left: 112px !important;
    display: flex !important;
    align-items: baseline !important;
    gap: 12px !important;
    min-width: 0 !important;
    height: 31px !important;
    margin: 0 !important;
    color: #fff8e8 !important;
    white-space: nowrap !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: none !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .site-classic-results-heading strong {
    display: block !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    color: inherit !important;
    font-size: clamp(1.58rem, 2.25vw, 1.92rem) !important;
    font-weight: 950 !important;
    line-height: 1 !important;
    letter-spacing: -.015em !important;
    white-space: nowrap !important;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .18) !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .site-classic-results-heading span {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
    color: inherit !important;
    font-size: .69rem !important;
    font-weight: 850 !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    opacity: .97 !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .header-actions {
    position: absolute !important;
    z-index: 4 !important;
    top: auto !important;
    right: 16px !important;
    bottom: 11px !important;
    left: 112px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 9px !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .scoreboard {
    display: none !important;
  }
}

@media (min-width: 701px) and (max-width: 940px) {
  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results {
    min-height: 108px !important;
    padding: 9px 12px 10px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .site-desktop-brand {
    top: 16px !important;
    left: 12px !important;
    width: 70px !important;
    height: 70px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .site-desktop-brand .header-logo {
    width: 70px !important;
    height: 70px !important;
    max-width: 70px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .site-classic-results-heading {
    top: 13px !important;
    right: 12px !important;
    left: 94px !important;
    gap: 8px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .site-classic-results-heading strong {
    font-size: 1.38rem !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .site-classic-results-heading span {
    font-size: .61rem !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .header-actions {
    right: 12px !important;
    bottom: 10px !important;
    left: 94px !important;
    gap: 6px !important;
  }
}

/*
 * Défi Races Ovines 1.23.32
 * Ajustement fin du bandeau de résultat classique :
 * logo plus présent et rapprochement vertical du titre et de la navigation.
 */
@media (min-width: 941px) {
  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results {
    min-height: 110px !important;
    padding: 8px 14px 9px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .site-desktop-brand {
    top: 7px !important;
    left: 12px !important;
    width: 96px !important;
    height: 96px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .site-desktop-brand .header-logo {
    width: 96px !important;
    height: 96px !important;
    max-width: 96px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .site-classic-results-heading {
    top: 11px !important;
    right: 14px !important;
    left: 122px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .header-actions {
    right: 14px !important;
    bottom: 17px !important;
    left: 122px !important;
  }
}

@media (min-width: 701px) and (max-width: 940px) {
  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results {
    min-height: 104px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .site-desktop-brand {
    top: 11px !important;
    width: 78px !important;
    height: 78px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .site-desktop-brand .header-logo {
    width: 78px !important;
    height: 78px !important;
    max-width: 78px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .site-classic-results-heading,
  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .header-actions {
    left: 102px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.is-classic-results > .header-actions {
    bottom: 14px !important;
  }
}

/*
 * Défi Races Ovines 1.23.36
 * Pages d'impression du mode classe : même composition que session-prof.php.
 *
 * style-classe.css contient encore d'anciennes règles très spécifiques sur
 * .topbar.app-header .brand et .header-logo. Les sélecteurs ci-dessous sont
 * volontairement plus précis pour que le bandeau commun conserve sa grille :
 * logo à gauche sur deux rangées, titre et sous-titre sur une seule ligne,
 * langues en haut à droite et actions sur la seconde rangée.
 */
@media (min-width: 701px) {
  html body .site-shell > header.topbar.app-header.is-unified-desktop.site-header--class-print {
    display: grid !important;
    grid-template-columns: 86px minmax(0, 1fr) auto !important;
    grid-template-rows: minmax(38px, auto) 38px !important;
    grid-template-areas:
      "logo title utility"
      "logo navigation navigation" !important;
    align-items: center !important;
    column-gap: 13px !important;
    row-gap: 2px !important;
    min-height: 104px !important;
    padding: 9px 16px 10px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.site-header--class-print > a.brand.site-desktop-brand {
    display: contents !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.site-header--class-print > a.brand.site-desktop-brand > img.header-logo {
    grid-area: logo !important;
    align-self: center !important;
    justify-self: center !important;
    width: 82px !important;
    height: 82px !important;
    max-width: 82px !important;
    margin: 0 !important;
    object-fit: contain !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.site-header--class-print > a.brand.site-desktop-brand > .brand-text {
    grid-area: title !important;
    display: flex !important;
    align-items: baseline !important;
    gap: 12px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.site-header--class-print > a.brand.site-desktop-brand > .brand-text > h1 {
    flex: 0 0 auto !important;
    margin: 0 !important;
    font-size: clamp(1.72rem, 2.45vw, 2.12rem) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.site-header--class-print > a.brand.site-desktop-brand > .brand-text > .subtitle {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    font-size: .69rem !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.site-header--class-print > .site-header-desktop-language {
    grid-area: utility !important;
    display: flex !important;
    align-items: center !important;
    justify-self: end !important;
    align-self: center !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.site-header--class-print > nav.header-actions {
    grid-area: navigation !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 9px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.site-header--class-print > nav.header-actions > .header-link {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    min-height: 35px !important;
    padding: 7px 14px !important;
    font-size: .91rem !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
  }
}

@media (min-width: 701px) and (max-width: 940px) {
  html body .site-shell > header.topbar.app-header.is-unified-desktop.site-header--class-print {
    grid-template-columns: 72px minmax(0, 1fr) auto !important;
    grid-template-rows: minmax(34px, auto) 36px !important;
    min-height: 90px !important;
    column-gap: 10px !important;
    row-gap: 1px !important;
    padding: 8px 12px 9px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.site-header--class-print > a.brand.site-desktop-brand > img.header-logo {
    width: 69px !important;
    height: 69px !important;
    max-width: 69px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.site-header--class-print > a.brand.site-desktop-brand > .brand-text {
    gap: 8px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.site-header--class-print > a.brand.site-desktop-brand > .brand-text > h1 {
    font-size: 1.48rem !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.site-header--class-print > a.brand.site-desktop-brand > .brand-text > .subtitle {
    font-size: .59rem !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.site-header--class-print > nav.header-actions {
    gap: 6px !important;
  }

  html body .site-shell > header.topbar.app-header.is-unified-desktop.site-header--class-print > nav.header-actions > .header-link {
    min-height: 33px !important;
    padding: 6px 9px !important;
    font-size: .82rem !important;
  }
}


/* Repli visuel si le logo officiel ne peut exceptionnellement pas être chargé. */
.header-logo-placeholder {
  display: inline-grid;
  place-items: center;
  width: 72px;
  height: 72px;
  font-size: 48px;
  line-height: 1;
  flex: 0 0 auto;
}
.site-mobile-logo.header-logo-placeholder {
  width: 44px;
  height: 44px;
  font-size: 32px;
}
