/* Styles spécifiques à index.php.
   Externalisés depuis la balise <style> de la page pour faciliter la maintenance. */

.game-info-box {
  grid-column: 1 / -1;
  border: 2px solid #9a5a2e;
  border-radius: 8px;
  padding: 12px 16px;
  background: #f3ebcf;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #2b1a12;
  line-height: 1.35;
}

.game-info-line {
  font-size: 1rem;
}

.game-info-line strong {
  color: #5a2a12;
}

@media (max-width: 700px) {
  .game-info-box {
    padding: 10px 12px;
  }
}

/* ─────────────────────────────────────────────────────────────
   Accueil index.php
   Règles déplacées depuis style.css pour isoler l'écran d'accueil.
   Les règles du jeu, du mode paysage et des résultats restent dans style.css.
   ───────────────────────────────────────────────────────────── */

/* Les compteurs ne sont utiles que pendant le jeu */
body:has(#welcome:not(.hidden)) .scoreboard {
  display: none;
}

/* Correction accueil avec logo dans l'en-tête */
body:has(#welcome:not(.hidden)) .app {
  padding-top: 10px;
}

body:has(#welcome:not(.hidden)) .topbar {
  max-width: 760px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-bottom: 10px !important;
}

body:has(#welcome:not(.hidden)) .brand {
  width: 100%;
  justify-content: space-between;
}

body:has(#welcome:not(.hidden)) h1 {
  font-size: clamp(2rem, 3.4vw, 2.8rem);
}

body:has(#welcome:not(.hidden)) .subtitle {
  margin-top: 4px;
}

body:has(#welcome:not(.hidden)) .credits {
  margin-top: 2px;
}

body:has(#welcome:not(.hidden)) .header-logo {
  width: 120px;
  max-width: 18vw;
  height: auto;
}

body:has(#welcome:not(.hidden)) .welcome-layout {
  max-width: 760px !important;
  margin: 10px auto 0 !important;
  display: block !important;
}

body:has(#welcome:not(.hidden)) .welcome-form {
  max-width: 760px !important;
  margin: 0 auto !important;
  padding: 18px 22px !important;
}

body:has(#welcome:not(.hidden)) .welcome-form h2 {
  margin: 0 0 10px;
}

body:has(#welcome:not(.hidden)) .welcome-form .notice {
  margin: 0 0 14px;
}

body:has(#welcome:not(.hidden)) .welcome-form .form-grid {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px 16px;
  margin: 12px 0;
}

body:has(#welcome:not(.hidden)) .welcome-form .actions {
  margin-top: 10px;
}

body:has(#welcome:not(.hidden)) .best {
  margin-top: 12px;
}

/* Sur l'accueil, on masque les compteurs inutiles */
body:has(#welcome:not(.hidden)) .scoreboard {
  display: none;
}

/* En-tête compact sur téléphone portrait */
@media (max-width: 700px) {
  body:has(#welcome:not(.hidden)) .topbar,
  body:has(#welcome:not(.hidden)) .welcome-layout,
  body:has(#welcome:not(.hidden)) .welcome-form {
    max-width: 100% !important;
  }

  body:has(#welcome:not(.hidden)) .brand {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  body:has(#welcome:not(.hidden)) .brand-text {
    min-width: 0;
  }

  body:has(#welcome:not(.hidden)) .brand h1 {
    font-size: 1.45rem;
    line-height: 1.05;
    white-space: normal;
  }

  body:has(#welcome:not(.hidden)) .subtitle {
    font-size: .72rem;
  }

  body:has(#welcome:not(.hidden)) .credits {
    font-size: .68rem;
  }

  body:has(#welcome:not(.hidden)) .header-logo {
    width: 75px !important;
    max-width: 22vw !important;
    margin-top: 0 !important;
    flex-shrink: 0;
  }

  body:has(#welcome:not(.hidden)) .welcome-form .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Logo plus petit sur téléphone en mode paysage */
@media (max-width: 950px) and (max-height: 520px) and (orientation: landscape) {
  body:has(#welcome:not(.hidden)) .app {
    padding-top: 6px;
  }

  body:has(#welcome:not(.hidden)) .brand {
    display: flex !important;
    align-items: center;
    gap: 8px;
  }

  body:has(#welcome:not(.hidden)) .brand h1 {
    font-size: 1.15rem !important;
    line-height: 1 !important;
    white-space: nowrap;
  }

  body:has(#welcome:not(.hidden)) .subtitle,
  body:has(#welcome:not(.hidden)) .credits {
    display: none;
  }

  body:has(#welcome:not(.hidden)) .header-logo {
    width: 48px !important;
    max-width: 12vw !important;
    height: auto !important;
    margin-top: 0 !important;
    flex-shrink: 0;
  }
}

/* ─────────────────────────────────────────────────────────────
   Correctif accueil mobile : libellés courts et meilleur score local.
   Les anciennes règles des boutons Encyclopédie / Mode classe intégrés
   au panneau Joueur ont été supprimées : le bandeau commun les remplace.
   ───────────────────────────────────────────────────────────── */
.label-short {
  display: none;
}

.label-long {
  display: inline;
}

body:has(#welcome:not(.hidden)) .welcome-main-actions {
  align-items: center;
}

body:has(#welcome:not(.hidden)) .best-inline {
  margin: 0;
  min-height: 0;
}

body:has(#welcome:not(.hidden)) .best-empty {
  display: none;
}

@media (max-width: 700px) {
  body:has(#welcome:not(.hidden)) .welcome-heading {
    display: block;
  }

  body:has(#welcome:not(.hidden)) .welcome-main-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    align-items: stretch;
  }

  body:has(#welcome:not(.hidden)) .welcome-main-actions button {
    width: 100%;
    min-width: 0;
    padding: 9px 8px;
    font-size: .88rem;
    white-space: nowrap;
  }

  body:has(#welcome:not(.hidden)) .welcome-main-actions .label-long {
    display: none !important;
  }

  body:has(#welcome:not(.hidden)) .welcome-main-actions .label-short {
    display: inline !important;
  }

  body:has(#welcome:not(.hidden)) .best-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 7px 8px;
    min-width: 76px;
    white-space: nowrap;
    font-size: .86rem;
  }

  body:has(#welcome:not(.hidden)) .best-inline::before {
    content: attr(data-short);
  }

  body:has(#welcome:not(.hidden)) .best-inline {
    color: transparent;
    font-size: 0;
  }

  body:has(#welcome:not(.hidden)) .best-inline::before {
    color: var(--text);
    font-size: .86rem;
  }

  body:has(#welcome:not(.hidden)) .best-inline.best-empty {
    display: none !important;
  }
}

@media (max-width: 420px) {
  body:has(#welcome:not(.hidden)) .welcome-main-actions {
    grid-template-columns: 1fr 1fr;
  }

  body:has(#welcome:not(.hidden)) .best-inline {
    grid-column: 1 / -1;
    width: fit-content;
    justify-self: start;
  }
}

/* ─────────────────────────────────────────────────────────────
   Correctif score local mobile — version prudente
   Objectif : éviter les carrés vides et les soucis Chrome liés à :has()
   et à content: attr(data-short).
   ───────────────────────────────────────────────────────────── */
.best-inline.best-empty {
  display: none !important;
}

.best-inline::before {
  content: none !important;
}

.best-inline {
  color: var(--text) !important;
  font-size: inherit;
}

body:has(#welcome:not(.hidden)) .best-inline {
  margin: 0;
  min-height: 0;
}

@media (max-width: 700px) {
  body:has(#welcome:not(.hidden)) .welcome-main-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto !important;
    gap: 8px;
    align-items: stretch !important;
  }

  body:has(#welcome:not(.hidden)) .best-inline:not(.best-empty) {
    display: inline-flex !important;
    grid-column: auto !important;
    width: auto !important;
    min-width: 72px !important;
    justify-self: stretch !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 7px 8px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    color: var(--text) !important;
    font-size: .86rem !important;
  }
}

@media (max-width: 420px) {
  body:has(#welcome:not(.hidden)) .welcome-main-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto !important;
  }

  body:has(#welcome:not(.hidden)) .best-inline:not(.best-empty) {
    grid-column: auto !important;
    justify-self: stretch !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Essai interface accueil — boutons tactiles niveau/mode
   Objectifs : usage mobile plus rapide, sélecteurs horizontaux,
   accueil plus compact sans modifier l'écran de jeu.
   ───────────────────────────────────────────────────────────── */

.js-enhanced .choice-native {
  display: none !important;
}

.choice-field {
  min-width: 0;
}

.choice-title {
  margin-bottom: 6px;
  font-weight: 900;
  color: #3b2416;
}

.choice-strip {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  padding: 2px 2px 7px;
}

.choice-pill {
  flex: 1 0 130px;
  min-height: 42px;
  padding: 8px 12px;
  border: 2px solid rgba(124, 63, 25, .7);
  border-radius: 9px;
  background: #e3de93;
  color: #3b2416;
  box-shadow: none;
  font-weight: 900;
  font-size: .92rem;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
  scroll-snap-align: start;
  touch-action: manipulation;
}

.choice-pill:hover {
  background: #dcd98a;
  transform: none;
}

.choice-pill.is-selected,
.choice-pill[aria-checked="true"] {
  background: #fff7df;
  border-color: var(--accent);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.choice-pill:focus-visible {
  outline: 3px solid rgba(15, 155, 215, .45);
  outline-offset: 2px;
}

.mode-choice-strip .choice-pill {
  flex-basis: 155px;
}

body:has(#welcome:not(.hidden)) .welcome-layout {
  max-width: 880px !important;
}

body:has(#welcome:not(.hidden)) .welcome-form {
  max-width: 880px !important;
}

body:has(#welcome:not(.hidden)) .welcome-form .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px 18px !important;
}

body:has(#welcome:not(.hidden)) .game-info-box {
  margin-top: -2px;
  padding: 10px 14px;
}

body:has(#welcome:not(.hidden)) #startBtn.primary {
  background: #d45a24;
  color: #fff;
  border-color: #b54318;
}

body:has(#welcome:not(.hidden)) #startBtn.primary:hover {
  background: #c95120;
}

@media (min-width: 701px) {
  body:has(#welcome:not(.hidden)) .level-choice-field,
  body:has(#welcome:not(.hidden)) .mode-choice-field {
    min-width: 0;
  }

  body:has(#welcome:not(.hidden)) .choice-strip {
    overflow-x: visible;
  }
}

@media (max-width: 700px) {
  body:has(#welcome:not(.hidden)) .app {
    padding: 6px 8px 10px !important;
  }

  body:has(#welcome:not(.hidden)) .topbar {
    margin-bottom: 6px !important;
  }

  body:has(#welcome:not(.hidden)) .brand h1 {
    font-size: 1.32rem !important;
    line-height: 1.05 !important;
  }

  body:has(#welcome:not(.hidden)) .subtitle {
    font-size: .68rem !important;
    margin-top: 2px !important;
  }

  body:has(#welcome:not(.hidden)) .credits {
    font-size: .64rem !important;
  }

  body:has(#welcome:not(.hidden)) .header-logo {
    width: 62px !important;
    max-width: 20vw !important;
  }

  body:has(#welcome:not(.hidden)) .welcome-form {
    padding: 12px 14px !important;
    border-width: 3px;
    border-radius: 14px;
  }

  body:has(#welcome:not(.hidden)) .welcome-heading {
    margin-bottom: 10px !important;
  }

  body:has(#welcome:not(.hidden)) .welcome-heading h2 {
    font-size: 1.08rem;
    margin-bottom: 4px !important;
  }

  body:has(#welcome:not(.hidden)) .welcome-heading .notice {
    font-size: .78rem;
  }

  body:has(#welcome:not(.hidden)) .welcome-form .form-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 9px !important;
    margin: 10px 0 !important;
  }

  body:has(#welcome:not(.hidden)) label {
    font-size: .78rem;
  }

  body:has(#welcome:not(.hidden)) input,
  body:has(#welcome:not(.hidden)) select {
    min-height: 36px;
    margin-top: 4px;
    padding: 8px 10px;
    font-size: .92rem;
    border-width: 1.5px;
  }

  .choice-title {
    margin-bottom: 4px;
    font-size: .78rem;
  }

  .choice-strip {
    gap: 7px;
    padding: 1px 1px 5px;
    margin-inline: -1px;
  }

  .choice-pill {
    flex: 0 0 auto;
    min-width: 112px;
    min-height: 34px;
    padding: 7px 9px;
    border-width: 1.5px;
    border-radius: 8px;
    font-size: .78rem;
  }

  .mode-choice-strip .choice-pill {
    min-width: 118px;
  }

  body:has(#welcome:not(.hidden)) .game-info-box {
    gap: 4px;
    padding: 7px 9px !important;
    border-width: 1.5px;
    font-size: .76rem;
    line-height: 1.22;
  }

  body:has(#welcome:not(.hidden)) .game-info-line {
    font-size: .76rem;
  }

  body:has(#welcome:not(.hidden)) .welcome-main-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 7px !important;
    margin-top: 8px !important;
  }

  body:has(#welcome:not(.hidden)) #startBtn {
    grid-column: 1 / -1;
    min-height: 42px;
    font-size: 1rem !important;
  }

  body:has(#welcome:not(.hidden)) .welcome-main-actions button {
    min-height: 34px;
    padding: 7px 8px !important;
    border-width: 2px;
    border-radius: 8px;
    box-shadow: none;
  }

  body:has(#welcome:not(.hidden)) .best-inline:not(.best-empty) {
    grid-column: 1 / -1 !important;
    width: fit-content !important;
    min-width: 0 !important;
    justify-self: center !important;
    padding: 4px 8px !important;
    border-width: 2px !important;
    box-shadow: none !important;
    font-size: .74rem !important;
  }

  body:has(#welcome:not(.hidden)) .contribute-box {
    margin-top: 10px;
    padding: 9px 10px;
    gap: 8px;
    border-radius: 10px;
  }

  body:has(#welcome:not(.hidden)) .contribute-text h3 {
    font-size: .88rem;
    margin-bottom: 0;
  }

  body:has(#welcome:not(.hidden)) .contribute-text p {
    display: none;
  }

  body:has(#welcome:not(.hidden)) .contribute-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  body:has(#welcome:not(.hidden)) .contribute-btn {
    padding: 7px 5px;
    border-width: 2px;
    border-radius: 8px;
    font-size: .75rem;
    line-height: 1.05;
  }
}

@media (max-width: 380px) {
  body:has(#welcome:not(.hidden)) .choice-pill {
    min-width: 104px;
    font-size: .74rem;
  }

  body:has(#welcome:not(.hidden)) .mode-choice-strip .choice-pill {
    min-width: 110px;
  }
}

/* Ajustement ordinateur : les boutons niveau/mode occupent toute la largeur du panneau. */
@media (min-width: 701px) {
  body:has(#welcome:not(.hidden)) .level-choice-field,
  body:has(#welcome:not(.hidden)) .mode-choice-field {
    grid-column: 1 / -1;
  }

  body:has(#welcome:not(.hidden)) .choice-strip {
    overflow-x: auto;
  }

  body:has(#welcome:not(.hidden)) .choice-pill,
  body:has(#welcome:not(.hidden)) .mode-choice-strip .choice-pill {
    flex: 1 1 0;
    min-width: 0;
  }
}

/* ─────────────────────────────────────────────────────────────
   Ajustement essai 2
   - Ordinateur : retour aux menus déroulants classiques.
   - Mobile portrait / paysage : boutons tactiles horizontaux.
   - Mobile : score local aligné comme un vrai bouton d'information.
   ───────────────────────────────────────────────────────────── */

/* Par défaut, on garde les vrais menus déroulants. */
html.js-enhanced .choice-native {
  display: block !important;
}

html.js-enhanced .choice-field {
  display: none !important;
}

/* Ordinateur : retour à une carte proche de la version initiale. */
@media (min-width: 701px) and (min-height: 621px) {
  body:has(#welcome:not(.hidden)) .welcome-layout,
  body:has(#welcome:not(.hidden)) .welcome-form,
  body:has(#welcome:not(.hidden)) .topbar {
    max-width: 760px !important;
  }

  body:has(#welcome:not(.hidden)) .welcome-form .form-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr)) !important;
    gap: 12px 16px !important;
  }
}

/* Téléphones et petits écrans en paysage : les boutons tactiles remplacent les selects. */
@media (max-width: 700px),
       (max-width: 950px) and (max-height: 620px) and (orientation: landscape) {
  html.js-enhanced body:has(#welcome:not(.hidden)) .choice-native {
    display: none !important;
  }

  html.js-enhanced body:has(#welcome:not(.hidden)) .choice-field {
    display: block !important;
    min-width: 0 !important;
  }

  html.js-enhanced body:has(#welcome:not(.hidden)) .choice-title {
    margin-bottom: 4px !important;
    font-size: .78rem !important;
  }

  html.js-enhanced body:has(#welcome:not(.hidden)) .choice-strip {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 7px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-x: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x proximity !important;
    padding: 1px 1px 6px !important;
    margin-inline: -1px !important;
  }

  html.js-enhanced body:has(#welcome:not(.hidden)) .choice-pill,
  html.js-enhanced body:has(#welcome:not(.hidden)) .mode-choice-strip .choice-pill {
    flex: 0 0 auto !important;
    min-width: 116px !important;
    max-width: 180px !important;
    min-height: 36px !important;
    padding: 7px 10px !important;
    font-size: .80rem !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    border-width: 2px !important;
    border-radius: 8px !important;
    box-shadow: none !important;
  }

  html.js-enhanced body:has(#welcome:not(.hidden)) .mode-choice-strip .choice-pill {
    min-width: 132px !important;
  }

  body:has(#welcome:not(.hidden)) .welcome-main-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: stretch !important;
  }

  body:has(#welcome:not(.hidden)) #startBtn {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }

  body:has(#welcome:not(.hidden)) #showScoresBtn {
    grid-column: 1 !important;
    width: 100% !important;
  }

  body:has(#welcome:not(.hidden)) .best-inline:not(.best-empty) {
    grid-column: 2 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 34px !important;
    justify-self: stretch !important;
    margin: 0 !important;
    padding: 7px 8px !important;
    border-width: 2px !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    font-size: .78rem !important;
    line-height: 1.05 !important;
    text-align: center !important;
    white-space: nowrap !important;
  }
}

/* Très petits écrans : boutons un peu plus courts. */
@media (max-width: 380px) {
  html.js-enhanced body:has(#welcome:not(.hidden)) .choice-pill,
  html.js-enhanced body:has(#welcome:not(.hidden)) .mode-choice-strip .choice-pill {
    min-width: 108px !important;
    max-width: 160px !important;
    font-size: .74rem !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  body:has(#welcome:not(.hidden)) .best-inline:not(.best-empty) {
    font-size: .72rem !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Ajustement essai 3
   Niveaux mobile : intitulés lisibles en deux lignes + aide courte.
   Ordinateur : les menus déroulants restent conservés.
   ───────────────────────────────────────────────────────────── */

.choice-help {
  display: none;
}

.level-pill-kicker,
.level-pill-label {
  display: block;
  min-width: 0;
}

.level-pill-kicker {
  font-size: .66rem;
  line-height: 1;
  opacity: .78;
  font-weight: 800;
}

.level-pill-label {
  margin-top: 2px;
  font-size: .88rem;
  line-height: 1.05;
  font-weight: 950;
}

@media (max-width: 700px),
       (max-width: 950px) and (max-height: 620px) and (orientation: landscape) {
  html.js-enhanced body:has(#welcome:not(.hidden)) .level-choice-pill {
    min-width: 148px !important;
    max-width: 190px !important;
    min-height: 48px !important;
    padding: 7px 10px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }

  html.js-enhanced body:has(#welcome:not(.hidden)) .level-choice-pill .level-pill-kicker {
    font-size: .63rem !important;
  }

  html.js-enhanced body:has(#welcome:not(.hidden)) .level-choice-pill .level-pill-label {
    font-size: .80rem !important;
  }

  html.js-enhanced body:has(#welcome:not(.hidden)) #levelChoices {
    padding-bottom: 4px !important;
  }

  html.js-enhanced body:has(#welcome:not(.hidden)) .choice-help {
    display: block;
    margin: 1px 0 0;
    padding: 5px 7px;
    border: 1px solid rgba(124, 63, 25, .35);
    border-radius: 7px;
    background: rgba(255, 255, 255, .34);
    color: #4a2a17;
    font-size: .72rem;
    line-height: 1.18;
  }
}

@media (max-width: 380px) {
  html.js-enhanced body:has(#welcome:not(.hidden)) .level-choice-pill {
    min-width: 136px !important;
    max-width: 176px !important;
  }

  html.js-enhanced body:has(#welcome:not(.hidden)) .level-choice-pill .level-pill-label {
    font-size: .76rem !important;
  }
}

body:has(#welcome:not(.hidden)) .app {
  max-width: 1120px !important;
  padding-top: 18px !important;
}

body:has(#welcome:not(.hidden)) .topbar.app-header {
  width: min(100%, 860px) !important;
  max-width: 860px !important;
  margin: 0 auto !important;
  padding: 12px 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px !important;
  background: linear-gradient(135deg, #bd7c28, #d19a37) !important;
  border: 3px solid var(--wood) !important;
  border-bottom-width: 0 !important;
  border-radius: 12px 12px 0 0 !important;
  box-shadow: 0 4px 0 rgba(0,0,0,.16) !important;
}

body:has(#welcome:not(.hidden)) .topbar.app-header .brand {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  width: auto !important;
  min-width: 0 !important;
  color: #fff8e8 !important;
}

body:has(#welcome:not(.hidden)) .topbar.app-header .header-logo {
  order: 0 !important;
  width: 46px !important;
  max-width: 46px !important;
  height: auto !important;
  flex: 0 0 auto !important;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.18));
}

body:has(#welcome:not(.hidden)) .topbar.app-header .brand-text {
  min-width: 0 !important;
}

body:has(#welcome:not(.hidden)) .topbar.app-header h1 {
  margin: 0 !important;
  color: #fff8e8 !important;
  font-size: clamp(1.15rem, 2vw, 1.55rem) !important;
  line-height: 1.05 !important;
  white-space: nowrap !important;
  letter-spacing: 0 !important;
  text-shadow: 0 1px 0 rgba(0,0,0,.18);
}

body:has(#welcome:not(.hidden)) .topbar.app-header .subtitle {
  margin: 2px 0 0 !important;
  color: #fff8e8 !important;
  font-size: .78rem !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  opacity: .96 !important;
}

body:has(#welcome:not(.hidden)) .topbar.app-header .credits {
  display: none !important;
}

body:has(#welcome:not(.hidden)) .topbar.app-header .header-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  margin-left: auto !important;
  flex: 0 0 auto !important;
}

body:has(#welcome:not(.hidden)) .topbar.app-header .scoreboard {
  display: none !important;
}

body:has(#welcome:not(.hidden)) .welcome-layout {
  width: min(100%, 860px) !important;
  max-width: 860px !important;
  margin: 0 auto !important;
  display: block !important;
}

body:has(#welcome:not(.hidden)) .welcome-form {
  max-width: 860px !important;
  margin: 0 auto !important;
  padding: 20px 24px !important;
  border-radius: 0 0 12px 12px !important;
}

body:has(#welcome:not(.hidden)) .welcome-heading {
  display: block !important;
  margin-bottom: 14px !important;
}

body:has(#welcome:not(.hidden)) .welcome-heading h2 {
  margin: 0 0 8px !important;
}

body:has(#welcome:not(.hidden)) .welcome-heading .notice {
  margin: 0 !important;
}

/* Ordinateur : on garde les menus, pas les boutons tactiles. */
@media (min-width: 701px) and (min-height: 621px) {
  html.js-enhanced body:has(#welcome:not(.hidden)) .choice-native {
    display: block !important;
  }

  html.js-enhanced body:has(#welcome:not(.hidden)) .choice-field {
    display: none !important;
  }

  body:has(#welcome:not(.hidden)) .welcome-form .form-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr)) !important;
    gap: 12px 18px !important;
  }
}

/* Téléphone portrait : bandeau sur deux lignes si nécessaire. */
@media (max-width: 700px) and (orientation: portrait) {
  body:has(#welcome:not(.hidden)) .app {
    padding: 8px !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header {
    width: 100% !important;
    max-width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 9px 10px !important;
    border-width: 2px !important;
    border-bottom-width: 0 !important;
    border-radius: 11px 11px 0 0 !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .brand {
    gap: 7px !important;
    width: 100% !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .header-logo {
    width: 34px !important;
    max-width: 34px !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header h1 {
    font-size: 1.02rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .subtitle {
    font-size: .62rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .header-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px !important;
    width: 100% !important;
    margin-left: 0 !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .header-link {
    min-height: 30px !important;
    padding: 6px 8px !important;
    border-width: 1.5px !important;
    border-radius: 7px !important;
    font-size: .78rem !important;
  }

  body:has(#welcome:not(.hidden)) .welcome-layout,
  body:has(#welcome:not(.hidden)) .welcome-form {
    width: 100% !important;
    max-width: 100% !important;
  }

  body:has(#welcome:not(.hidden)) .welcome-form {
    padding: 14px 14px !important;
    border-width: 2px !important;
    border-radius: 0 0 11px 11px !important;
  }
}

/* Téléphone paysage sur l'accueil : une barre compacte, boutons à droite. */
@media (max-width: 950px) and (max-height: 620px) and (orientation: landscape) {
  body:has(#welcome:not(.hidden)) .app {
    padding: 6px 8px !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header {
    width: 100% !important;
    max-width: 100% !important;
    padding: 7px 10px !important;
    gap: 10px !important;
    border-width: 2px !important;
    border-bottom-width: 0 !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .header-logo {
    width: 32px !important;
    max-width: 32px !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header h1 {
    font-size: .96rem !important;
    max-width: 260px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .subtitle {
    display: none !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .header-actions {
    display: flex !important;
    gap: 7px !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .header-link {
    min-height: 28px !important;
    padding: 5px 10px !important;
    border-width: 1.5px !important;
    font-size: .76rem !important;
  }

  body:has(#welcome:not(.hidden)) .welcome-layout,
  body:has(#welcome:not(.hidden)) .welcome-form {
    width: 100% !important;
    max-width: 100% !important;
  }

  body:has(#welcome:not(.hidden)) .welcome-form {
    padding: 12px 14px !important;
  }
}

@media (max-width: 420px) and (orientation: portrait) {
  body:has(#welcome:not(.hidden)) .topbar.app-header .subtitle {
    display: none !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Essai 5 — réglages fins accueil
   - bouton Commencer plus dominant
   - bouton scores raccourci et plus sobre
   - meilleur score affiché comme badge d'information
   - bloc contribution un peu moins dominant sur ordinateur
   ───────────────────────────────────────────────────────────── */

body:has(#welcome:not(.hidden)) .welcome-main-actions {
  display: grid !important;
  grid-template-columns: minmax(210px, 1.25fr) minmax(150px, .9fr) auto !important;
  gap: 12px !important;
  align-items: stretch !important;
}

body:has(#welcome:not(.hidden)) #startBtn.primary {
  min-height: 44px !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
  font-size: .98rem !important;
  background: #d45a24 !important;
  color: #fff !important;
  border-color: #b54318 !important;
}

body:has(#welcome:not(.hidden)) #showScoresBtn {
  min-height: 44px !important;
  background: #e3de93 !important;
  border-color: #c5522b !important;
  box-shadow: 0 2px 0 rgba(0,0,0,.18) !important;
}

body:has(#welcome:not(.hidden)) .best-inline:not(.best-empty) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 7px 12px !important;
  border: 2px solid rgba(124, 63, 25, .65) !important;
  border-radius: 7px !important;
  background: rgba(227, 222, 147, .72) !important;
  box-shadow: none !important;
  white-space: nowrap !important;
  font-weight: 700 !important;
}

body:has(#welcome:not(.hidden)) .contribute-box {
  margin-top: 14px !important;
  padding: 12px 14px !important;
  gap: 14px !important;
}

body:has(#welcome:not(.hidden)) .contribute-actions {
  min-width: 170px !important;
  gap: 7px !important;
}

body:has(#welcome:not(.hidden)) .contribute-btn {
  padding: 8px 10px !important;
  border-width: 2px !important;
  border-radius: 7px !important;
  font-size: .90rem !important;
  line-height: 1.1 !important;
  box-shadow: none !important;
}

body:has(#welcome:not(.hidden)) .secondary-link {
  background: rgba(220, 217, 138, .82) !important;
}

body:has(#welcome:not(.hidden)) .contribute-text h3 {
  font-size: 1rem !important;
}

body:has(#welcome:not(.hidden)) .contribute-text p {
  font-size: .84rem !important;
}

@media (max-width: 700px),
       (max-width: 950px) and (max-height: 620px) and (orientation: landscape) {
  body:has(#welcome:not(.hidden)) .welcome-main-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  body:has(#welcome:not(.hidden)) #startBtn {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-height: 42px !important;
  }

  body:has(#welcome:not(.hidden)) #showScoresBtn {
    grid-column: 1 !important;
    width: 100% !important;
    min-height: 34px !important;
  }

  body:has(#welcome:not(.hidden)) .best-inline:not(.best-empty) {
    grid-column: 2 !important;
    width: 100% !important;
    min-height: 34px !important;
    padding: 6px 7px !important;
    font-size: .76rem !important;
  }

  body:has(#welcome:not(.hidden)) .contribute-box {
    margin-top: 10px !important;
    padding: 9px 10px !important;
  }

  body:has(#welcome:not(.hidden)) .contribute-btn {
    padding: 7px 5px !important;
    font-size: .74rem !important;
  }
}

@media (max-width: 380px) {
  body:has(#welcome:not(.hidden)) .best-inline:not(.best-empty) {
    font-size: .70rem !important;
  }
}

/* Bloc contribution accueil */

.contribute-box {
  margin-top: 18px;
  padding: 14px 16px;
  border: 2px dashed var(--wood);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.42);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.contribute-text h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: var(--accent-dark);
}

.contribute-text p {
  margin: 4px 0;
  font-size: 0.88rem;
  line-height: 1.35;
}

.contribute-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 190px;
}

.contribute-btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  font-weight: 900;
  border-radius: 7px;
  padding: 9px 12px;
  border: 3px solid var(--accent);
  color: #111;
}

.primary-link {
  background: #d38b50;
}

.primary-link:hover {
  background: #c97f43;
}

.secondary-link {
  background: var(--button-bg);
}

.secondary-link:hover {
  background: var(--button-bg-hover);
}

@media (max-width: 720px) {
  .contribute-box {
    flex-direction: column;
    align-items: stretch;
  }

  .contribute-actions {
    min-width: 0;
  }
}


/* Ajustement niveaux dynamiques accueil */

/* v8 — niveaux mobiles dynamiques : les libellés viennent de la base.
   On laisse donc plus de place au nom exact du niveau. */
@media (max-width: 700px),
       (max-width: 950px) and (max-height: 620px) and (orientation: landscape) {
  html.js-enhanced body:has(#welcome:not(.hidden)) .level-choice-pill {
    min-width: 164px !important;
    max-width: 230px !important;
    min-height: 56px !important;
  }

  html.js-enhanced body:has(#welcome:not(.hidden)) .level-choice-pill .level-pill-label {
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    line-height: 1.08 !important;
  }
}

@media (max-width: 380px) {
  html.js-enhanced body:has(#welcome:not(.hidden)) .level-choice-pill {
    min-width: 152px !important;
    max-width: 210px !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Défi v1.20.3 — Accueil inversé
   Le mode Défi devient l'entrée principale.
   Le mode classique reste disponible comme option secondaire.
   ───────────────────────────────────────────────────────────── */

.home-landing {
  display: block !important;
}

.home-hero {
  width: min(100%, 860px);
  max-width: 860px;
  margin: 0 auto;
  padding: 22px 24px;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(180deg, rgba(255, 252, 232, .96), rgba(242, 232, 185, .94));
  border-top: 0;
}

.home-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #dceecf;
  border: 2px solid rgba(82, 153, 59, .55);
  color: #34742f;
  font-weight: 950;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.home-hero h2 {
  margin: 0;
  color: #2a160d;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: .98;
}

.home-intro {
  max-width: 720px;
  margin: 10px 0 18px;
  color: #4a2a17;
  font-weight: 750;
  line-height: 1.35;
}

.home-primary-grid {
  display: grid;
  grid-template-columns: 1.25fr .95fr .95fr;
  gap: 12px;
}

.home-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 116px;
  padding: 16px 16px;
  border: 3px solid rgba(124, 63, 25, .72);
  border-radius: 15px;
  background: rgba(255, 250, 232, .92);
  color: #2a160d;
  text-decoration: none;
  box-shadow: 0 3px 0 rgba(0,0,0,.13);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.home-card:hover,
.home-card:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 5px 0 rgba(0,0,0,.15);
  border-color: #5ca83c;
  outline: none;
}

.home-card-main {
  background: linear-gradient(135deg, #e4f5d0, #fff7df);
  border-color: #559d38;
}

.home-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.74);
  border: 2px solid rgba(124, 63, 25, .22);
  font-size: 1.45rem;
}

.home-card-content strong {
  display: block;
  margin-bottom: 5px;
  font-size: 1.1rem;
  line-height: 1.05;
  color: #2d180f;
}

.home-card-main .home-card-content strong {
  color: #2d7d2e;
  font-size: 1.22rem;
}

.home-card-content small {
  display: block;
  color: #57341f;
  font-weight: 750;
  line-height: 1.28;
}

.home-card-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #5da63e;
  color: #fff;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.home-secondary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin-top: 14px;
}

.home-classic-toggle,
.home-mini-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 9px;
  border: 2px solid rgba(124, 63, 25, .58);
  background: rgba(255, 247, 223, .88);
  color: #3b2416;
  text-decoration: none;
  font-weight: 900;
  line-height: 1.1;
  box-shadow: none;
}

.home-classic-toggle {
  cursor: pointer;
}

.home-classic-toggle:hover,
.home-mini-link:hover {
  background: #efe5b9;
  transform: none;
}

.classic-anchor {
  height: 1px;
}

.classic-home-panel {
  width: min(100%, 860px);
  max-width: 860px;
  margin: 14px auto 0;
}

.classic-home-panel .welcome-form {
  border-radius: 12px !important;
}

/* Le panneau classique étant secondaire, on le rend un peu moins dominant. */
.classic-home-panel .contribute-box {
  display: none;
}

@media (max-width: 900px) {
  .home-primary-grid {
    grid-template-columns: 1fr;
  }

  .home-card {
    min-height: 96px;
  }
}

@media (max-width: 700px),
       (max-width: 950px) and (max-height: 620px) and (orientation: landscape) {
  .home-hero {
    width: 100%;
    max-width: 100%;
    padding: 14px 14px 15px;
    border-width: 2px;
    border-radius: 0 0 11px 11px;
  }

  .home-kicker {
    margin-bottom: 7px;
    padding: 4px 8px;
    font-size: .68rem;
    border-width: 1.5px;
  }

  .home-hero h2 {
    font-size: 1.55rem;
    line-height: 1.02;
  }

  .home-intro {
    margin: 8px 0 11px;
    font-size: .86rem;
    line-height: 1.24;
  }

  .home-primary-grid {
    gap: 8px;
  }

  .home-card {
    min-height: 76px;
    padding: 10px 11px;
    gap: 9px;
    border-width: 2px;
    border-radius: 11px;
    box-shadow: 0 2px 0 rgba(0,0,0,.12);
  }

  .home-card-icon {
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
    border-width: 1.5px;
  }

  .home-card-content strong,
  .home-card-main .home-card-content strong {
    margin-bottom: 2px;
    font-size: .98rem;
  }

  .home-card-content small {
    font-size: .75rem;
    line-height: 1.16;
  }

  .home-card-arrow {
    width: 28px;
    height: 28px;
    font-size: 1.55rem;
  }

  .home-secondary-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 10px;
  }

  .home-classic-toggle {
    grid-column: 1 / -1;
  }

  .home-classic-toggle,
  .home-mini-link {
    min-height: 32px;
    padding: 6px 8px;
    border-width: 1.5px;
    border-radius: 8px;
    font-size: .74rem;
  }

  .classic-home-panel {
    width: 100%;
    max-width: 100%;
    margin-top: 10px;
  }
}

@media (max-width: 380px) {
  .home-hero h2 {
    font-size: 1.38rem;
  }

  .home-card-content small {
    display: none;
  }

  .home-card {
    min-height: 58px;
  }
}

/* ─────────────────────────────────────────────────────────────
   Défi v1.20.4 — Accueil optimisé
   Objectif : rendre l'accueil plus clair, moins serré et plus hiérarchisé.
   ───────────────────────────────────────────────────────────── */

.home-hero-optimized {
  border-radius: 0 0 14px 14px !important;
  padding: 24px 26px !important;
}

.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(280px, .78fr);
  gap: 18px;
  align-items: stretch;
}

.home-main-zone {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.home-main-zone .home-kicker {
  margin-bottom: 10px;
}

.home-main-zone h2 {
  max-width: 620px;
  font-size: clamp(2.05rem, 4.6vw, 3.35rem) !important;
  letter-spacing: -.03em;
}

.home-main-zone .home-intro {
  max-width: 620px;
  margin: 12px 0 14px !important;
  font-size: 1.02rem;
  line-height: 1.38;
}

.home-feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 18px;
}

.home-feature-pills span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1.5px solid rgba(82, 153, 59, .46);
  background: rgba(220, 238, 207, .78);
  color: #2e702a;
  font-size: .82rem;
  font-weight: 950;
  line-height: 1;
}

.home-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.home-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 3px solid rgba(79, 140, 42, .88);
  text-decoration: none;
  font-weight: 950;
  line-height: 1.05;
  box-shadow: 0 3px 0 rgba(0,0,0,.16);
}

.home-cta:hover,
.home-cta:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.home-cta-primary {
  background: linear-gradient(180deg, #64b744, #408e2f);
  color: #fff;
  border-color: #357d28;
  font-size: 1.08rem;
}

.home-cta-secondary {
  background: rgba(255, 247, 223, .95);
  color: #3b2416;
  border-color: rgba(124, 63, 25, .58);
}

.home-side-zone {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
}

.home-side-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  gap: 5px 10px;
  align-items: center;
  min-height: 112px;
  padding: 16px 16px;
  border-radius: 15px;
  border: 3px solid rgba(124, 63, 25, .66);
  background: rgba(255, 250, 232, .92);
  color: #2a160d;
  text-decoration: none;
  box-shadow: 0 3px 0 rgba(0,0,0,.13);
}

.home-side-card:hover,
.home-side-card:focus-visible {
  border-color: #5ca83c;
  transform: translateY(-1px);
  outline: none;
}

.home-side-encyclo {
  background: linear-gradient(135deg, rgba(255, 250, 232, .98), rgba(229, 244, 213, .9));
}

.home-side-title {
  display: block;
  color: #2d180f;
  font-size: 1.2rem;
  font-weight: 950;
  line-height: 1.05;
}

.home-side-text {
  display: block;
  grid-column: 1 / -1;
  color: #57341f;
  font-size: .88rem;
  font-weight: 760;
  line-height: 1.28;
}

.home-side-arrow {
  grid-column: 2;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #5da63e;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 950;
  line-height: 1;
}

.home-secondary-row-optimized {
  margin-top: 16px !important;
  padding-top: 12px;
  border-top: 1px solid rgba(124, 63, 25, .22);
}

.home-secondary-row-optimized .home-classic-toggle,
.home-secondary-row-optimized .home-mini-link {
  min-height: 34px;
  font-size: .86rem;
}

@media (max-width: 900px) {
  .home-hero-grid {
    grid-template-columns: 1fr;
  }

  .home-side-zone {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  .home-side-card {
    min-height: 96px;
  }
}

@media (max-width: 700px),
       (max-width: 950px) and (max-height: 620px) and (orientation: landscape) {
  .home-hero-optimized {
    padding: 13px 13px 14px !important;
    border-radius: 0 0 11px 11px !important;
  }

  .home-hero-grid {
    gap: 10px;
  }

  .home-main-zone .home-kicker {
    margin-bottom: 6px;
  }

  .home-main-zone h2 {
    font-size: 1.72rem !important;
    line-height: .98 !important;
  }

  .home-main-zone .home-intro {
    margin: 8px 0 10px !important;
    font-size: .84rem !important;
    line-height: 1.22 !important;
  }

  .home-feature-pills {
    gap: 5px;
    margin-bottom: 11px;
  }

  .home-feature-pills span {
    min-height: 23px;
    padding: 4px 8px;
    font-size: .68rem;
  }

  .home-cta-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .home-cta {
    min-height: 40px;
    padding: 9px 10px;
    border-width: 2px;
    border-radius: 10px;
    font-size: .92rem;
  }

  .home-side-zone {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .home-side-card {
    min-height: 62px;
    padding: 9px 10px;
    gap: 3px 8px;
    border-width: 2px;
    border-radius: 10px;
    box-shadow: 0 2px 0 rgba(0,0,0,.1);
  }

  .home-side-title {
    font-size: .96rem;
  }

  .home-side-text {
    font-size: .72rem;
    line-height: 1.16;
  }

  .home-side-arrow {
    width: 27px;
    height: 27px;
    font-size: 1.45rem;
  }

  .home-secondary-row-optimized {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 7px !important;
    margin-top: 10px !important;
    padding-top: 9px;
  }

  .home-secondary-row-optimized .home-classic-toggle {
    grid-column: 1 / -1;
  }

  .home-secondary-row-optimized .home-classic-toggle,
  .home-secondary-row-optimized .home-mini-link {
    min-height: 30px;
    padding: 6px 7px;
    font-size: .70rem;
  }
}

@media (max-width: 380px) {
  .home-main-zone h2 {
    font-size: 1.5rem !important;
  }

  .home-main-zone .home-intro {
    font-size: .78rem !important;
  }

  .home-feature-pills span:nth-child(n+4) {
    display: none;
  }

  .home-side-text {
    display: none;
  }

  .home-side-card {
    min-height: 48px;
  }
}


/* ─────────────────────────────────────────────────────────────
   Défi v1.20.5 — En-tête d'accueil simplifié
   Objectif : supprimer le texte descriptif serré sous le titre,
   garder un bandeau plus lisible et laisser le bloc principal présenter le site.
   ───────────────────────────────────────────────────────────── */

body:has(#welcome:not(.hidden)) .topbar .subtitle,
body:has(#welcome:not(.hidden)) .topbar .credits {
  display: none !important;
}

body:has(#welcome:not(.hidden)) .topbar .brand {
  align-items: center !important;
}

body:has(#welcome:not(.hidden)) .topbar .brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

body:has(#welcome:not(.hidden)) .topbar h1 {
  margin: 0 !important;
  line-height: 1.02 !important;
}

@media (min-width: 701px) {
  body:has(#welcome:not(.hidden)) .topbar {
    min-height: 96px;
  }

  body:has(#welcome:not(.hidden)) .topbar .brand {
    gap: 12px !important;
  }

  body:has(#welcome:not(.hidden)) .topbar .header-logo {
    width: 62px !important;
    max-width: 62px !important;
  }

  body:has(#welcome:not(.hidden)) .topbar h1 {
    font-size: clamp(1.55rem, 2.45vw, 2.05rem) !important;
    white-space: nowrap;
  }
}

@media (max-width: 700px) {
  body:has(#welcome:not(.hidden)) .topbar h1 {
    font-size: 1.32rem !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Défi v1.20.6 — Accueil propre + mode classique séparé
   Objectifs :
   - en-tête robuste sur deux lignes pour supprimer les chevauchements ;
   - page index.php réservée à l'accueil moderne ;
   - mode classique déplacé vers classique.php.
   ───────────────────────────────────────────────────────────── */

body:has(#welcome:not(.hidden)) .topbar.app-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: center !important;
  min-height: 0 !important;
  padding: 14px 18px !important;
}

body:has(#welcome:not(.hidden)) .topbar.app-header .brand {
  width: 100% !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
}

body:has(#welcome:not(.hidden)) .topbar.app-header .header-logo {
  width: 50px !important;
  max-width: 50px !important;
  flex: 0 0 50px !important;
}

body:has(#welcome:not(.hidden)) .topbar.app-header .brand-text {
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

body:has(#welcome:not(.hidden)) .topbar.app-header h1 {
  max-width: 100% !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  font-size: clamp(1.35rem, 2.8vw, 2.05rem) !important;
  line-height: 1.02 !important;
}

body:has(#welcome:not(.hidden)) .topbar.app-header .header-actions {
  width: 100% !important;
  margin-left: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 10px !important;
}

body:has(#welcome:not(.hidden)) .topbar.app-header .header-link {
  flex: 0 1 auto !important;
  min-width: 132px !important;
  min-height: 38px !important;
  padding: 8px 14px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

/* La page d'accueil n'a plus de panneau classique déroulant. */
.home-classic-toggle[href] {
  text-decoration: none;
}

.classic-landing {
  width: min(100%, 860px) !important;
  max-width: 860px !important;
  margin: 0 auto !important;
  display: block !important;
}

.classic-start-panel {
  border-radius: 0 0 14px 14px !important;
}

.classic-kicker {
  margin-bottom: 10px;
}

.classic-backline {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(124, 63, 25, .22);
}

.classic-backline a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 9px;
  border: 2px solid rgba(124, 63, 25, .58);
  background: rgba(255, 247, 223, .88);
  color: #3b2416;
  text-decoration: none;
  font-weight: 900;
  line-height: 1.1;
}

@media (min-width: 701px) {
  body:has(#welcome:not(.hidden)) .topbar.app-header {
    min-height: 0 !important;
  }
}

@media (max-width: 700px) {
  body:has(#welcome:not(.hidden)) .topbar.app-header {
    gap: 9px !important;
    padding: 10px 11px !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .header-logo {
    width: 38px !important;
    max-width: 38px !important;
    flex-basis: 38px !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header h1 {
    font-size: 1.24rem !important;
    line-height: 1.03 !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .header-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .header-link {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 32px !important;
    padding: 6px 8px !important;
    font-size: .78rem !important;
  }

  .classic-backline {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }
}

@media (max-width: 950px) and (max-height: 620px) and (orientation: landscape) {
  body:has(#welcome:not(.hidden)) .topbar.app-header {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: 8px 12px !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .brand {
    grid-column: 1;
    width: auto !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .header-actions {
    grid-column: 2;
    width: auto !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .header-link {
    min-width: 0 !important;
    padding: 5px 8px !important;
    font-size: .72rem !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Défi v1.21.1 — Accueil d'origine amélioré
   Ajout discret des meilleurs scores du mode Défi.
   ───────────────────────────────────────────────────────────── */

.home-scoreboard {
  margin-top: 18px;
  padding: 15px 16px 14px;
  border-radius: 15px;
  border: 3px solid rgba(74, 130, 48, .52);
  background:
    linear-gradient(135deg, rgba(255, 250, 232, .96), rgba(229, 244, 213, .74));
  box-shadow: 0 3px 0 rgba(0, 0, 0, .11);
}

.home-scoreboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.home-scoreboard-kicker {
  display: inline-flex;
  margin-bottom: 3px;
  color: #34742f;
  font-size: .76rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.home-scoreboard h3 {
  margin: 0;
  color: #2a160d;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  line-height: 1.06;
}

.home-scoreboard-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 2px solid rgba(124, 63, 25, .48);
  background: rgba(255, 247, 223, .9);
  color: #3b2416;
  font-size: .78rem;
  font-weight: 950;
  line-height: 1.05;
  text-align: center;
  text-decoration: none;
}

.home-scoreboard-action:hover,
.home-scoreboard-action:focus-visible {
  border-color: #5ca83c;
  background: #f4edc8;
  outline: none;
}

.home-score-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-score-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 43px;
  padding: 7px 9px;
  border-radius: 12px;
  border: 1.5px solid rgba(124, 63, 25, .2);
  background: rgba(255, 255, 255, .45);
  color: #2a160d;
}

.home-score-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f3df9b;
  border: 2px solid rgba(124, 63, 25, .28);
  color: #5a351e;
  font-weight: 950;
  font-size: .95rem;
}

.home-score-item:nth-child(1) .home-score-rank {
  background: linear-gradient(180deg, #ffe793, #e7b83f);
}

.home-score-item:nth-child(2) .home-score-rank {
  background: linear-gradient(180deg, #f4f0df, #c9c0a6);
}

.home-score-item:nth-child(3) .home-score-rank {
  background: linear-gradient(180deg, #f2c89d, #bf7641);
  color: #fff7df;
}

.home-score-player {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.home-score-player strong {
  overflow: hidden;
  color: #2a160d;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-score-player small {
  overflow: hidden;
  color: #5d3a24;
  font-size: .72rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-score-points,
.home-score-time {
  color: #2a160d;
  font-weight: 950;
  white-space: nowrap;
}

.home-score-time {
  color: #5b3a22;
  font-variant-numeric: tabular-nums;
}

.home-score-empty {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  border: 1.5px dashed rgba(124, 63, 25, .38);
  background: rgba(255, 255, 255, .34);
  color: #4a2a17;
  font-weight: 800;
}

.home-score-empty span {
  font-size: .88rem;
  font-weight: 720;
}

@media (min-width: 901px) {
  .home-hero-optimized {
    width: min(100%, 920px) !important;
    max-width: 920px !important;
  }
}

@media (max-width: 700px),
       (max-width: 950px) and (max-height: 620px) and (orientation: landscape) {
  .home-scoreboard {
    margin-top: 11px;
    padding: 11px;
    border-width: 2px;
    border-radius: 12px;
  }

  .home-scoreboard-header {
    display: grid;
    gap: 7px;
    margin-bottom: 8px;
  }

  .home-scoreboard-action {
    width: 100%;
    min-height: 32px;
    padding: 6px 8px;
    border-width: 1.5px;
    font-size: .74rem;
  }

  .home-score-list {
    gap: 6px;
  }

  .home-score-item {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 7px;
    min-height: 38px;
    padding: 6px 7px;
    border-radius: 10px;
  }

  .home-score-rank {
    width: 26px;
    height: 26px;
    font-size: .82rem;
  }

  .home-score-player small {
    display: none;
  }

  .home-score-points {
    font-size: .83rem;
  }

  .home-score-time {
    display: none;
  }
}

/* ─────────────────────────────────────────────────────────────
   Défi v1.21.2 — ajustements accueil original
   - logo plus présent dans le bandeau ;
   - score enrichi avec une zone visuelle ;
   - vert légèrement plus sobre pour mieux dialoguer avec le marron.
   ───────────────────────────────────────────────────────────── */

@media (min-width: 701px) {
  body:has(#welcome:not(.hidden)) .topbar.app-header {
    grid-template-columns: auto minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    column-gap: 16px !important;
    row-gap: 8px !important;
    align-items: center !important;
    padding: 16px 20px 14px !important;
  }

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

  body:has(#welcome:not(.hidden)) .topbar.app-header .header-logo {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 76px !important;
    max-width: 76px !important;
    flex-basis: 76px !important;
    align-self: center !important;
    filter: drop-shadow(0 2px 0 rgba(0,0,0,.18));
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .brand-text {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: end !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header h1 {
    font-size: clamp(1.65rem, 3vw, 2.25rem) !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .header-actions {
    grid-column: 2 !important;
    grid-row: 2 !important;
    justify-content: flex-start !important;
    align-self: start !important;
    gap: 10px !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .header-link {
    min-width: 126px !important;
    min-height: 36px !important;
    padding: 7px 13px !important;
  }
}

/* Vert plus doux que le vert franc : meilleur accord avec le brun/cuir. */
.home-kicker,
.home-scoreboard-kicker,
.home-feature-pills span {
  color: #2f6b35 !important;
}

.home-kicker,
.home-feature-pills span {
  background: rgba(220, 236, 202, .86) !important;
  border-color: rgba(78, 132, 64, .48) !important;
}

.home-cta-primary,
.home-side-arrow {
  background: linear-gradient(180deg, #5fa44b, #3f7f35) !important;
  border-color: #336c2d !important;
}

.home-scoreboard {
  border-color: rgba(78, 132, 64, .48) !important;
  background:
    linear-gradient(135deg, rgba(255, 250, 232, .97), rgba(226, 239, 207, .72)) !important;
}

.home-scoreboard-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
  gap: 12px;
  align-items: stretch;
}

.home-scoreboard-listwrap {
  min-width: 0;
}

.home-score-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 110px;
  padding: 15px 15px 15px 78px;
  border: 2px solid rgba(124, 63, 25, .25);
  border-radius: 14px;
  background:
    radial-gradient(circle at 22% 46%, rgba(224, 181, 79, .32) 0 34px, transparent 35px),
    linear-gradient(135deg, rgba(255, 247, 223, .86), rgba(231, 240, 211, .78));
  color: #3b2416;
}

.home-score-visual::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -26px;
  width: 112px;
  height: 82px;
  border-radius: 48% 52% 42% 58%;
  border: 3px solid rgba(124, 63, 25, .18);
  background: rgba(124, 63, 25, .07);
  transform: rotate(-14deg);
}

.home-score-visual-medal {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid rgba(124, 63, 25, .35);
  background: linear-gradient(180deg, #ffe793, #e1ad38);
  color: #5a351e;
  font-size: 1.45rem;
  font-weight: 950;
  box-shadow: 0 3px 0 rgba(0,0,0,.11);
}

.home-score-visual-title {
  display: block;
  color: #2f6b35;
  font-size: 1.1rem;
  font-weight: 950;
  line-height: 1.05;
}

.home-score-visual-text {
  display: block;
  margin-top: 5px;
  color: #5b3a22;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.25;
}

@media (max-width: 900px) {
  .home-scoreboard-body {
    grid-template-columns: 1fr;
  }

  .home-score-visual {
    min-height: 76px;
    padding: 12px 14px 12px 68px;
  }

  .home-score-visual-medal {
    left: 15px;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

@media (max-width: 700px),
       (max-width: 950px) and (max-height: 620px) and (orientation: landscape) {
  .home-score-visual {
    display: none;
  }
}


/* ─────────────────────────────────────────────────────────────
   Défi v1.21.3 — accueil : scores simplifiés
   - on affiche le Top 3 du mode Défi ;
   - suppression de la carte visuelle à droite, qui alourdissait le bloc ;
   - les lignes de score utilisent toute la largeur disponible.
   ───────────────────────────────────────────────────────────── */

.home-scoreboard-body-simple,
.home-scoreboard-body {
  grid-template-columns: 1fr !important;
}

.home-scoreboard-body-simple .home-scoreboard-listwrap {
  width: 100%;
}

.home-scoreboard-body-simple .home-score-list {
  gap: 8px;
}

.home-scoreboard-body-simple .home-score-item {
  grid-template-columns: 36px minmax(0, 1fr) minmax(92px, auto) minmax(52px, auto);
  min-height: 47px;
  padding: 8px 11px;
}

.home-scoreboard-body-simple .home-score-visual {
  display: none !important;
}

@media (min-width: 701px) {
  .home-scoreboard-header {
    align-items: center;
  }
}

@media (max-width: 700px),
       (max-width: 950px) and (max-height: 620px) and (orientation: landscape) {
  .home-scoreboard-body-simple .home-score-item {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    min-height: 39px;
    padding: 6px 7px;
  }
}

/* ─────────────────────────────────────────────────────────────
   Défi v1.21.4 — accueil : race à l'honneur du jour
   - Top 3 à gauche ;
   - photo réelle et crédit contributeur à droite ;
   - sélection quotidienne côté PHP.
   ───────────────────────────────────────────────────────────── */

.home-scoreboard-body-featured {
  display: grid !important;
  grid-template-columns: minmax(0, .96fr) minmax(210px, .64fr) !important;
  gap: 12px !important;
  align-items: stretch !important;
}

.home-scoreboard-body-featured.home-scoreboard-body-no-featured {
  grid-template-columns: 1fr !important;
}

.home-scoreboard-body-featured .home-score-list {
  gap: 7px;
}

.home-scoreboard-body-featured .home-score-item {
  grid-template-columns: 34px minmax(0, 1fr) minmax(78px, auto) minmax(48px, auto);
  min-height: 45px;
  padding: 7px 9px;
}

.home-featured-race {
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(112px, 1fr) auto;
  min-width: 0;
  border: 2px solid rgba(124, 63, 25, .35);
  border-radius: 14px;
  background: rgba(255, 247, 223, .88);
  box-shadow: 0 2px 0 rgba(0,0,0,.08);
}

.home-featured-race-photo {
  position: relative;
  display: block;
  min-height: 112px;
  overflow: hidden;
  background: rgba(226, 239, 207, .75);
  text-decoration: none;
}

.home-featured-race-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 58%, rgba(42, 22, 13, .28));
  pointer-events: none;
}

.home-featured-race-photo img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 112px;
  object-fit: cover;
  object-position: center;
  transition: transform .18s ease;
}

.home-featured-race:hover .home-featured-race-photo img,
.home-featured-race:focus-within .home-featured-race-photo img {
  transform: scale(1.03);
}

.home-featured-race-content {
  display: grid;
  gap: 3px;
  padding: 10px 12px 11px;
  color: #2a160d;
}

.home-featured-race-kicker {
  color: #2f6b35;
  font-size: .70rem;
  font-weight: 950;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.home-featured-race h4 {
  margin: 0;
  color: #2a160d;
  font-size: 1.18rem;
  line-height: 1.05;
}

.home-featured-race-details,
.home-featured-race-credit {
  margin: 0;
  color: #5b3a22;
  font-size: .76rem;
  font-weight: 760;
  line-height: 1.18;
}

.home-featured-race-credit a {
  color: #2f6b35;
  font-weight: 950;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.home-featured-race-link {
  justify-self: start;
  margin-top: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 2px solid rgba(78, 132, 64, .48);
  background: rgba(220, 236, 202, .82);
  color: #2f6b35;
  font-size: .75rem;
  font-weight: 950;
  line-height: 1;
  text-decoration: none;
}

.home-featured-race-link:hover,
.home-featured-race-link:focus-visible {
  background: #edf6df;
  border-color: #3f7f35;
  outline: none;
}

@media (max-width: 900px) {
  .home-scoreboard-body-featured {
    grid-template-columns: 1fr !important;
  }

  .home-featured-race {
    grid-template-columns: minmax(110px, 34%) minmax(0, 1fr);
    grid-template-rows: auto;
  }

  .home-featured-race-photo,
  .home-featured-race-photo img {
    min-height: 115px;
    height: 100%;
  }
}

@media (max-width: 700px),
       (max-width: 950px) and (max-height: 620px) and (orientation: landscape) {
  .home-scoreboard-body-featured .home-score-item {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    min-height: 39px;
    padding: 6px 7px;
  }

  .home-featured-race {
    grid-template-columns: 92px minmax(0, 1fr);
    border-width: 1.5px;
    border-radius: 11px;
  }

  .home-featured-race-photo,
  .home-featured-race-photo img {
    min-height: 92px;
  }

  .home-featured-race-content {
    padding: 8px 9px;
  }

  .home-featured-race h4 {
    font-size: .98rem;
  }

  .home-featured-race-details {
    display: none;
  }

  .home-featured-race-credit {
    font-size: .68rem;
  }

  .home-featured-race-link {
    padding: 4px 8px;
    font-size: .68rem;
  }
}

/* ─────────────────────────────────────────────────────────────
   Défi v1.21.5 — accueil : Top 5 + race du jour plus équilibrée
   - classement plus compact ;
   - titre “Race à l’honneur du jour” à la place du bouton ;
   - colonne image mieux intégrée à droite.
   ───────────────────────────────────────────────────────────── */

.home-scoreboard-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 2px solid rgba(78, 132, 64, .38);
  background: rgba(220, 236, 202, .78);
  color: #2f6b35;
  font-size: .78rem;
  font-weight: 950;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .035em;
  white-space: nowrap;
}

.home-scoreboard-body-featured {
  grid-template-columns: minmax(0, .62fr) minmax(230px, .38fr) !important;
  gap: 14px !important;
}

.home-scoreboard-body-featured .home-score-list {
  gap: 6px !important;
}

.home-scoreboard-body-featured .home-score-item {
  grid-template-columns: 32px minmax(0, 1fr) minmax(82px, auto) minmax(48px, auto) !important;
  min-height: 39px !important;
  padding: 6px 9px !important;
  border-radius: 11px !important;
}

.home-scoreboard-body-featured .home-score-rank {
  width: 27px !important;
  height: 27px !important;
  font-size: .84rem !important;
}

.home-scoreboard-body-featured .home-score-player strong {
  font-size: .92rem !important;
  line-height: 1.02 !important;
}

.home-scoreboard-body-featured .home-score-player small {
  font-size: .66rem !important;
  line-height: 1.05 !important;
}

.home-scoreboard-body-featured .home-score-points,
.home-scoreboard-body-featured .home-score-time {
  font-size: .88rem !important;
}

.home-featured-race {
  grid-template-rows: minmax(136px, 1fr) auto !important;
  border-color: rgba(78, 132, 64, .36) !important;
  background: rgba(255, 249, 229, .9) !important;
}

.home-featured-race-photo,
.home-featured-race-photo img {
  min-height: 136px !important;
}

.home-featured-race-content {
  padding: 10px 12px 12px !important;
}

.home-featured-race-kicker {
  color: #2f6b35 !important;
  font-size: .66rem !important;
}

.home-featured-race h4 {
  font-size: 1.12rem !important;
}

.home-featured-race-details,
.home-featured-race-credit {
  font-size: .72rem !important;
}

@media (max-width: 900px) {
  .home-scoreboard-badge {
    justify-self: start;
    white-space: normal;
  }

  .home-scoreboard-body-featured {
    grid-template-columns: 1fr !important;
  }

  .home-featured-race {
    grid-template-columns: minmax(116px, 35%) minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
  }
}

@media (max-width: 700px),
       (max-width: 950px) and (max-height: 620px) and (orientation: landscape) {
  .home-scoreboard-badge {
    width: 100%;
    min-height: 30px;
    padding: 6px 8px;
    font-size: .68rem;
  }

  .home-scoreboard-body-featured .home-score-item {
    grid-template-columns: 28px minmax(0, 1fr) auto !important;
    min-height: 36px !important;
    padding: 5px 7px !important;
  }

  .home-scoreboard-body-featured .home-score-rank {
    width: 24px !important;
    height: 24px !important;
    font-size: .76rem !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Défi v1.21.6 — accueil : race du jour plus compacte
   - photo non tronquée : object-fit: contain ;
   - colonne droite réduite ;
   - commune ajoutée dans les scores quand elle existe.
   ───────────────────────────────────────────────────────────── */

@media (min-width: 901px) {
  .home-scoreboard-body-featured {
    grid-template-columns: minmax(0, .68fr) minmax(190px, .32fr) !important;
    gap: 12px !important;
  }

  .home-featured-race {
    align-self: start !important;
    grid-template-rows: auto auto !important;
    max-width: 280px !important;
    justify-self: end !important;
  }
}

.home-featured-race-photo {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 0 !important;
  height: 118px !important;
  padding: 5px !important;
  background:
    linear-gradient(135deg, rgba(255, 250, 232, .98), rgba(226, 239, 207, .7)) !important;
}

.home-featured-race-photo::after {
  display: none !important;
}

.home-featured-race-photo img {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 108px !important;
  object-fit: contain !important;
  object-position: center center !important;
  border-radius: 9px !important;
  background: rgba(255, 247, 223, .65) !important;
}

.home-featured-race:hover .home-featured-race-photo img,
.home-featured-race:focus-within .home-featured-race-photo img {
  transform: none !important;
}

.home-featured-race-content {
  gap: 2px !important;
  padding: 8px 11px 10px !important;
}

.home-featured-race-kicker {
  font-size: .62rem !important;
  letter-spacing: .045em !important;
}

.home-featured-race h4 {
  font-size: 1.05rem !important;
  line-height: 1.02 !important;
}

.home-featured-race-details,
.home-featured-race-credit {
  font-size: .69rem !important;
  line-height: 1.13 !important;
}

.home-featured-race-link {
  margin-top: 4px !important;
  padding: 4px 9px !important;
  font-size: .70rem !important;
}

.home-scoreboard-body-featured .home-score-player small {
  color: #6a4328 !important;
  font-weight: 780 !important;
}

@media (max-width: 900px) {
  .home-featured-race-photo {
    height: auto !important;
    min-height: 104px !important;
    padding: 5px !important;
  }

  .home-featured-race-photo img {
    max-height: 112px !important;
  }
}

@media (max-width: 700px),
       (max-width: 950px) and (max-height: 620px) and (orientation: landscape) {
  .home-featured-race-photo {
    min-height: 88px !important;
    padding: 4px !important;
  }

  .home-featured-race-photo img {
    max-height: 86px !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Défi v1.21.7 — accueil : Top 3 + race du jour plus lisible
   - retour à 3 scores pour éviter le grand vide ;
   - carte race du jour plus large ;
   - photo non rognée, plus visible ;
   - texte sous la photo sur moins de lignes ;
   - suppression de la répétition “Race à l’honneur”.
   ───────────────────────────────────────────────────────────── */

@media (min-width: 901px) {
  .home-scoreboard-body-featured {
    grid-template-columns: minmax(0, .58fr) minmax(270px, .42fr) !important;
    gap: 16px !important;
    align-items: start !important;
  }

  .home-featured-race {
    max-width: 330px !important;
    width: 100% !important;
    justify-self: end !important;
  }
}

.home-scoreboard-badge {
  padding-inline: 14px !important;
}

.home-scoreboard-body-featured .home-score-list {
  gap: 8px !important;
}

.home-scoreboard-body-featured .home-score-item {
  min-height: 47px !important;
  padding: 8px 10px !important;
}

.home-featured-race {
  grid-template-rows: auto auto !important;
  overflow: hidden !important;
}

.home-featured-race-photo {
  height: 150px !important;
  padding: 6px !important;
}

.home-featured-race-photo img {
  max-height: 138px !important;
  object-fit: contain !important;
  object-position: center center !important;
}

.home-featured-race-content {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 4px 10px !important;
  align-items: center !important;
  padding: 9px 11px 10px !important;
}

.home-featured-race-kicker,
.home-featured-race-details,
.home-featured-race-credit {
  display: none !important;
}

.home-featured-race h4 {
  grid-column: 1 / -1 !important;
  margin: 0 !important;
  font-size: 1.12rem !important;
  line-height: 1.02 !important;
}

.home-featured-race-meta {
  grid-column: 1 !important;
  margin: 0 !important;
  color: #5b3a22 !important;
  font-size: .72rem !important;
  font-weight: 780 !important;
  line-height: 1.16 !important;
}

.home-featured-race-meta span {
  display: inline !important;
}

.home-featured-race-meta span + span::before {
  content: " · ";
  color: rgba(91, 58, 34, .75);
}

.home-featured-race-meta a {
  color: #2f6b35 !important;
  font-weight: 950 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
}

.home-featured-race-link {
  grid-column: 2 !important;
  grid-row: 2 !important;
  align-self: center !important;
  justify-self: end !important;
  margin-top: 0 !important;
  white-space: nowrap !important;
}

@media (max-width: 900px) {
  .home-featured-race {
    grid-template-columns: minmax(130px, 38%) minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
  }

  .home-featured-race-photo {
    height: auto !important;
    min-height: 118px !important;
  }

  .home-featured-race-photo img {
    max-height: 126px !important;
  }

  .home-featured-race-content {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .home-featured-race-link {
    grid-column: 1 !important;
    grid-row: auto !important;
    justify-self: start !important;
    margin-top: 4px !important;
  }
}

@media (max-width: 700px),
       (max-width: 950px) and (max-height: 620px) and (orientation: landscape) {
  .home-featured-race-photo {
    min-height: 92px !important;
    padding: 4px !important;
  }

  .home-featured-race-photo img {
    max-height: 90px !important;
  }

  .home-featured-race-meta {
    font-size: .67rem !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Défi v1.21.8 — accueil : Top 5 + race du jour resserrée
   - retour au Top 5 ;
   - photo plus large, toujours non tronquée ;
   - bouton supprimé : photo et nom de race cliquables ;
   - crédit robuste avec noms d'auteurs longs.
   ───────────────────────────────────────────────────────────── */

@media (min-width: 901px) {
  .home-scoreboard-body-featured {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 350px) !important;
    gap: 10px !important;
    align-items: start !important;
  }

  .home-scoreboard-listwrap {
    min-width: 0 !important;
  }

  .home-featured-race {
    width: 100% !important;
    max-width: 350px !important;
    justify-self: end !important;
  }
}

.home-scoreboard-body-featured .home-score-list {
  gap: 6px !important;
}

.home-scoreboard-body-featured .home-score-item {
  grid-template-columns: 30px minmax(0, 1fr) minmax(82px, max-content) minmax(46px, max-content) !important;
  gap: 8px !important;
  min-height: 38px !important;
  padding: 6px 9px !important;
  border-radius: 10px !important;
}

.home-scoreboard-body-featured .home-score-rank {
  width: 26px !important;
  height: 26px !important;
  font-size: .80rem !important;
}

.home-scoreboard-body-featured .home-score-player strong {
  font-size: .88rem !important;
  line-height: 1.03 !important;
}

.home-scoreboard-body-featured .home-score-player small {
  font-size: .62rem !important;
  line-height: 1.05 !important;
}

.home-scoreboard-body-featured .home-score-points,
.home-scoreboard-body-featured .home-score-time {
  font-size: .84rem !important;
}

.home-featured-race {
  align-self: start !important;
  grid-template-rows: auto auto !important;
  border-color: rgba(78, 132, 64, .42) !important;
  background: rgba(255, 249, 229, .93) !important;
}

.home-featured-race-photo {
  height: 168px !important;
  padding: 6px !important;
  background: linear-gradient(135deg, rgba(255, 250, 232, .98), rgba(226, 239, 207, .72)) !important;
}

.home-featured-race-photo img {
  width: 100% !important;
  height: 100% !important;
  max-height: 156px !important;
  object-fit: contain !important;
  object-position: center center !important;
  border-radius: 9px !important;
  background: rgba(255, 247, 223, .58) !important;
}

.home-featured-race-content {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 2px !important;
  padding: 8px 11px 10px !important;
}

.home-featured-race-name {
  display: block !important;
  min-width: 0 !important;
  overflow: hidden !important;
  color: #2a160d !important;
  font-size: 1.08rem !important;
  font-weight: 950 !important;
  line-height: 1.05 !important;
  text-decoration: none !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.home-featured-race-name:hover,
.home-featured-race-name:focus-visible {
  color: #2f6b35 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
  outline: none !important;
}

.home-featured-race-meta {
  display: flex !important;
  align-items: baseline !important;
  gap: 4px !important;
  min-width: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  color: #5b3a22 !important;
  font-size: .70rem !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
}

.home-featured-race-meta span + span::before {
  content: none !important;
}

.home-featured-race-details-inline,
.home-featured-race-separator {
  flex: 0 0 auto !important;
}

.home-featured-race-credit-inline {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.home-featured-race-credit-inline a {
  color: #2f6b35 !important;
  font-weight: 950 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
}

.home-featured-race-link {
  display: none !important;
}

@media (max-width: 900px) {
  .home-scoreboard-body-featured {
    grid-template-columns: 1fr !important;
  }

  .home-featured-race {
    grid-template-columns: minmax(130px, 38%) minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
    max-width: none !important;
  }

  .home-featured-race-photo {
    height: auto !important;
    min-height: 120px !important;
  }

  .home-featured-race-photo img {
    max-height: 126px !important;
  }

  .home-featured-race-content {
    align-content: center !important;
    padding: 8px 10px !important;
  }

  .home-featured-race-meta {
    flex-wrap: wrap !important;
    white-space: normal !important;
  }
}

@media (max-width: 700px),
       (max-width: 950px) and (max-height: 620px) and (orientation: landscape) {
  .home-scoreboard-body-featured .home-score-item {
    grid-template-columns: 28px minmax(0, 1fr) auto !important;
    min-height: 36px !important;
    padding: 5px 7px !important;
  }

  .home-scoreboard-body-featured .home-score-rank {
    width: 24px !important;
    height: 24px !important;
    font-size: .74rem !important;
  }

  .home-featured-race {
    grid-template-columns: 108px minmax(0, 1fr) !important;
  }

  .home-featured-race-photo {
    min-height: 92px !important;
    padding: 4px !important;
  }

  .home-featured-race-photo img {
    max-height: 90px !important;
  }

  .home-featured-race-name {
    font-size: .98rem !important;
  }

  .home-featured-race-meta {
    font-size: .66rem !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Défi v1.21.9 — accueil : race du jour en bandeau compact
   - photo plus large sans rognage (ratio naturel 3/2 privilégié) ;
   - texte dans un bandeau compact sous la photo ;
   - adaptation mobile en carte horizontale pour limiter la hauteur.
   ───────────────────────────────────────────────────────────── */

@media (min-width: 901px) {
  .home-scoreboard-body-featured {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 365px) !important;
    gap: 14px !important;
    align-items: start !important;
  }

  .home-featured-race {
    max-width: 365px !important;
    border-radius: 13px !important;
    overflow: hidden !important;
  }
}

.home-featured-race {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 0 !important;
  padding: 0 !important;
  background: rgba(255, 249, 229, .96) !important;
}

.home-featured-race-photo {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 3 / 2 !important;
  padding: 6px 6px 0 !important;
  border-radius: 0 !important;
  background: linear-gradient(135deg, rgba(255, 250, 232, .98), rgba(226, 239, 207, .72)) !important;
}

.home-featured-race-photo img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center center !important;
  border-radius: 9px 9px 0 0 !important;
  background: rgba(255, 247, 223, .62) !important;
  box-shadow: none !important;
}

.home-featured-race-content {
  padding: 7px 10px 9px !important;
  background: rgba(255, 249, 229, .98) !important;
  border-top: 1px solid rgba(111, 83, 49, .16) !important;
}

.home-featured-race-name {
  font-size: 1.08rem !important;
  line-height: 1.05 !important;
  margin: 0 0 2px !important;
}

.home-featured-race-meta {
  font-size: .69rem !important;
  line-height: 1.12 !important;
  max-width: 100% !important;
}

.home-featured-race-credit-inline a {
  display: inline-block !important;
  max-width: 12.5em !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  vertical-align: bottom !important;
  white-space: nowrap !important;
}

@media (max-width: 900px) {
  .home-scoreboard-body-featured {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .home-featured-race {
    grid-template-columns: minmax(132px, 42%) minmax(0, 1fr) !important;
    align-items: stretch !important;
    max-width: none !important;
    min-height: 108px !important;
  }

  .home-featured-race-photo {
    height: 100% !important;
    min-height: 108px !important;
    aspect-ratio: auto !important;
    padding: 5px !important;
  }

  .home-featured-race-photo img {
    border-radius: 9px !important;
  }

  .home-featured-race-content {
    align-content: center !important;
    padding: 8px 10px !important;
    border-top: 0 !important;
    border-left: 1px solid rgba(111, 83, 49, .13) !important;
  }

  .home-featured-race-meta {
    display: block !important;
    white-space: normal !important;
  }

  .home-featured-race-separator {
    display: none !important;
  }

  .home-featured-race-details-inline,
  .home-featured-race-credit-inline {
    display: block !important;
  }

  .home-featured-race-credit-inline a {
    max-width: 100% !important;
  }
}

@media (max-width: 520px) {
  .home-featured-race {
    grid-template-columns: 116px minmax(0, 1fr) !important;
    min-height: 96px !important;
  }

  .home-featured-race-photo {
    min-height: 96px !important;
    padding: 4px !important;
  }

  .home-featured-race-name {
    font-size: .98rem !important;
  }

  .home-featured-race-meta {
    font-size: .64rem !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Défi v1.21.10 — accueil : scores allongés + race du jour équilibrée
   - colonne classement élargie ;
   - colonne race du jour réduite pour limiter la hauteur de la photo ;
   - alignement visuel plus proche entre le bas du Top 5 et le bas de la carte.
   ───────────────────────────────────────────────────────────── */

@media (min-width: 901px) {
  .home-scoreboard-body-featured {
    grid-template-columns: minmax(0, 1fr) minmax(290px, 320px) !important;
    gap: 12px !important;
    align-items: start !important;
  }

  .home-featured-race {
    width: 100% !important;
    max-width: 320px !important;
    justify-self: end !important;
  }

  .home-scoreboard-body-featured .home-score-item {
    grid-template-columns: 30px minmax(0, 1fr) minmax(80px, max-content) minmax(44px, max-content) !important;
    gap: 7px !important;
  }

  .home-featured-race-photo {
    aspect-ratio: 3 / 2 !important;
    padding: 6px 6px 0 !important;
  }

  .home-featured-race-content {
    padding: 7px 10px 8px !important;
  }

  .home-featured-race-name {
    font-size: 1.04rem !important;
  }

  .home-featured-race-meta {
    font-size: .66rem !important;
  }

  .home-featured-race-credit-inline a {
    max-width: 10.5em !important;
  }
}

@media (min-width: 1050px) {
  .home-scoreboard-body-featured {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 325px) !important;
  }

  .home-featured-race {
    max-width: 325px !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Défi v1.21.11 — accueil : race du jour avec légende sur photo
   - nom de la race sur la photo ;
   - pays remplacé par un drapeau ;
   - crédit seul sous la photo ;
   - photo cliquable vers la fiche encyclopédie ;
   - lignes de score un peu plus respirantes.
   ───────────────────────────────────────────────────────────── */

@media (min-width: 901px) {
  .home-scoreboard-body-featured {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 355px) !important;
    gap: 14px !important;
    align-items: start !important;
  }

  .home-featured-race {
    width: 100% !important;
    max-width: 355px !important;
    justify-self: end !important;
  }
}

.home-scoreboard-body-featured .home-score-list {
  gap: 7px !important;
}

.home-scoreboard-body-featured .home-score-item {
  grid-template-columns: 34px minmax(0, 1fr) minmax(88px, max-content) minmax(48px, max-content) !important;
  gap: 8px !important;
  min-height: 45px !important;
  padding: 7px 10px !important;
  border-radius: 12px !important;
}

.home-scoreboard-body-featured .home-score-rank {
  width: 28px !important;
  height: 28px !important;
  font-size: .84rem !important;
}

.home-scoreboard-body-featured .home-score-player strong {
  font-size: .92rem !important;
  line-height: 1.05 !important;
}

.home-scoreboard-body-featured .home-score-player small {
  font-size: .63rem !important;
  line-height: 1.08 !important;
}

.home-scoreboard-body-featured .home-score-points,
.home-scoreboard-body-featured .home-score-time {
  font-size: .86rem !important;
}

.home-featured-race {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-color: rgba(78, 132, 64, .42) !important;
  background: rgba(255, 249, 229, .96) !important;
  box-shadow: 0 3px 0 rgba(79, 51, 28, .12) !important;
}

.home-featured-race-photo {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 3 / 2 !important;
  padding: 6px 6px 0 !important;
  border-radius: 0 !important;
  background: linear-gradient(135deg, rgba(255, 250, 232, .98), rgba(226, 239, 207, .72)) !important;
  text-decoration: none !important;
}

.home-featured-race-photo::after {
  display: none !important;
}

.home-featured-race-photo img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center center !important;
  border-radius: 10px 10px 0 0 !important;
  background: rgba(255, 247, 223, .62) !important;
  box-shadow: none !important;
  transform: none !important;
}

.home-featured-race:hover .home-featured-race-photo img,
.home-featured-race:focus-within .home-featured-race-photo img {
  transform: none !important;
}

.home-featured-race-overlay {
  position: absolute !important;
  left: 14px !important;
  bottom: 10px !important;
  z-index: 2 !important;
  display: grid !important;
  gap: 2px !important;
  max-width: calc(100% - 28px) !important;
  padding: 8px 11px 9px !important;
  border-radius: 13px !important;
  background: rgba(43, 28, 15, .74) !important;
  color: #fff8df !important;
  box-shadow: 0 8px 22px rgba(43, 28, 15, .22) !important;
  backdrop-filter: blur(2px) !important;
}

.home-featured-race-name {
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  color: #fff8df !important;
  font-size: 1.15rem !important;
  font-weight: 950 !important;
  line-height: 1.02 !important;
  text-decoration: none !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.home-featured-race-details {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  color: rgba(255, 248, 223, .94) !important;
  font-size: .74rem !important;
  font-weight: 850 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.home-featured-race-flag {
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  font-size: 1rem !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}

.home-featured-race-credit {
  display: block !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 7px 10px 9px !important;
  border-top: 1px solid rgba(111, 83, 49, .14) !important;
  background: rgba(255, 249, 229, .98) !important;
  color: #5b3a22 !important;
  font-size: .74rem !important;
  font-weight: 820 !important;
  line-height: 1.12 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.home-featured-race-credit a {
  display: inline-block !important;
  max-width: 13em !important;
  overflow: hidden !important;
  color: #2f6b35 !important;
  font-weight: 950 !important;
  text-decoration: underline !important;
  text-overflow: ellipsis !important;
  text-underline-offset: 2px !important;
  vertical-align: bottom !important;
  white-space: nowrap !important;
}

@media (max-width: 900px) {
  .home-scoreboard-body-featured {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .home-featured-race {
    max-width: none !important;
  }
}

@media (max-width: 700px),
       (max-width: 950px) and (max-height: 620px) and (orientation: landscape) {
  .home-scoreboard-body-featured .home-score-list {
    gap: 6px !important;
  }

  .home-scoreboard-body-featured .home-score-item {
    grid-template-columns: 28px minmax(0, 1fr) auto !important;
    min-height: 38px !important;
    padding: 6px 7px !important;
  }

  .home-scoreboard-body-featured .home-score-rank {
    width: 24px !important;
    height: 24px !important;
    font-size: .74rem !important;
  }

  .home-scoreboard-body-featured .home-score-points {
    font-size: .78rem !important;
  }

  .home-scoreboard-body-featured .home-score-time {
    display: none !important;
  }

  .home-featured-race {
    grid-template-columns: 1fr !important;
    min-height: 0 !important;
  }

  .home-featured-race-photo {
    aspect-ratio: 3 / 2 !important;
    padding: 5px 5px 0 !important;
  }

  .home-featured-race-overlay {
    left: 10px !important;
    bottom: 8px !important;
    max-width: calc(100% - 20px) !important;
    padding: 7px 9px !important;
    border-radius: 11px !important;
  }

  .home-featured-race-name {
    font-size: 1rem !important;
  }

  .home-featured-race-details,
  .home-featured-race-credit {
    font-size: .66rem !important;
  }

  .home-featured-race-credit a {
    max-width: 12em !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Défi v1.21.12 — accueil : équilibrage final scores / race du jour
   - colonne classement légèrement élargie pour mieux afficher les communes ;
   - carte “À découvrir aujourd’hui” un peu réduite ;
   - légende photo plus compacte ;
   - objectif : aligner au mieux le bas du Top 5 avec le bas de la race mise en avant.
   ───────────────────────────────────────────────────────────── */

@media (min-width: 901px) {
  .home-scoreboard-body-featured {
    grid-template-columns: minmax(0, 1fr) minmax(292px, 322px) !important;
    gap: 12px !important;
    align-items: start !important;
  }

  .home-featured-race {
    max-width: 322px !important;
    width: 100% !important;
    justify-self: end !important;
  }

  .home-scoreboard-body-featured .home-score-item {
    grid-template-columns: 34px minmax(0, 1fr) minmax(96px, max-content) minmax(50px, max-content) !important;
    gap: 9px !important;
    min-height: 45px !important;
    padding: 7px 10px !important;
  }

  .home-scoreboard-body-featured .home-score-points,
  .home-scoreboard-body-featured .home-score-time {
    justify-self: end !important;
    text-align: right !important;
  }

  .home-scoreboard-body-featured .home-score-player small {
    max-width: none !important;
  }

  .home-featured-race-photo {
    aspect-ratio: 3 / 2 !important;
    padding: 6px 6px 0 !important;
  }

  .home-featured-race-overlay {
    left: 12px !important;
    bottom: 9px !important;
    max-width: calc(100% - 24px) !important;
    padding: 7px 10px 8px !important;
    gap: 1px !important;
    border-radius: 12px !important;
  }

  .home-featured-race-name {
    font-size: 1.02rem !important;
    line-height: 1.02 !important;
  }

  .home-featured-race-details {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: .70rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .home-featured-race-flag {
    width: 18px !important;
    height: 13px !important;
  }

  .home-featured-race-credit {
    padding: 6px 10px 8px !important;
    font-size: .70rem !important;
  }

  .home-featured-race-credit a {
    max-width: 11.5em !important;
  }
}

@media (min-width: 1120px) {
  .home-scoreboard-body-featured {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 328px) !important;
  }

  .home-featured-race {
    max-width: 328px !important;
  }
}

@media (max-width: 900px) {
  .home-featured-race-overlay {
    padding: 7px 9px !important;
    gap: 1px !important;
  }

  .home-featured-race-name {
    font-size: 1rem !important;
  }

  .home-featured-race-details {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    white-space: nowrap !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Défi v1.21.14 — retour aux proportions v1.21.12
   - garder l'équilibre vertical précédent ;
   - élargir légèrement la zone niveau/ville ;
   - réduire un peu la colonne score ;
   - cartouche photo plus discret, aligné à gauche, sur une seule ligne si possible.
   ───────────────────────────────────────────────────────────── */

@media (min-width: 901px) {
  .home-scoreboard-body-featured {
    grid-template-columns: minmax(0, 1fr) minmax(292px, 322px) !important;
    gap: 12px !important;
  }

  .home-featured-race {
    max-width: 322px !important;
  }

  .home-scoreboard-body-featured .home-score-item {
    grid-template-columns: 34px minmax(0, 1fr) minmax(82px, max-content) minmax(48px, max-content) !important;
    gap: 8px !important;
    min-height: 45px !important;
    padding: 7px 10px !important;
  }

  .home-scoreboard-body-featured .home-score-player small {
    font-size: .625rem !important;
    line-height: 1.05 !important;
    letter-spacing: -0.01em !important;
  }

  .home-featured-race-overlay {
    left: 12px !important;
    right: auto !important;
    bottom: 9px !important;
    display: inline-flex !important;
    align-items: baseline !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    text-align: left !important;
    padding: 6px 9px 7px !important;
    border-radius: 11px !important;
  }

  .home-featured-race-name {
    font-size: .97rem !important;
    line-height: 1 !important;
  }

  .home-featured-race-details {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: .64rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .home-featured-race-details::before {
    content: '—' !important;
    margin-right: 1px !important;
    color: rgba(255, 248, 223, .92) !important;
    font-weight: 900 !important;
  }

  .home-featured-race-flag {
    width: 17px !important;
    height: 12px !important;
  }
}

@media (max-width: 900px) {
  .home-scoreboard-body-featured .home-score-item {
    grid-template-columns: 30px minmax(0, 1fr) minmax(74px, max-content) minmax(44px, max-content) !important;
    gap: 6px !important;
  }

  .home-scoreboard-body-featured .home-score-player small {
    font-size: .63rem !important;
    line-height: 1.05 !important;
    letter-spacing: -0.01em !important;
  }

  .home-featured-race-overlay {
    display: inline-flex !important;
    align-items: baseline !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    text-align: left !important;
    padding: 6px 8px !important;
  }

  .home-featured-race-name {
    font-size: .94rem !important;
    line-height: 1 !important;
  }

  .home-featured-race-details {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: .62rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .home-featured-race-details::before {
    content: '—' !important;
    margin-right: 1px !important;
    color: rgba(255, 248, 223, .92) !important;
    font-weight: 900 !important;
  }
}

/* Défi v1.21.15 — réduction légère de la taille du nom de race */
@media (min-width: 901px) {
  .home-featured-race-name {
    font-size: .91rem !important;
  }
}

@media (max-width: 900px) {
  .home-featured-race-name {
    font-size: .90rem !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Défi v1.21.31 — accueil : classement filtré par niveau
   - petits ronds de sélection à côté de “Classement” ;
   - ne modifie pas les proportions du bloc scores / race du jour.
   ───────────────────────────────────────────────────────────── */
.home-scoreboard-kicker-line {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}

.home-score-level-switch {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.home-score-level-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(47, 107, 53, .42) !important;
  background: rgba(255, 250, 232, .82) !important;
  color: #2f6b35 !important;
  font-size: .72rem !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65) !important;
}

.home-score-level-pill:hover,
.home-score-level-pill:focus-visible,
.home-score-level-pill.is-active {
  background: #47783f !important;
  border-color: #47783f !important;
  color: #fff8df !important;
  outline: none !important;
}

@media (max-width: 700px) {
  .home-scoreboard-kicker-line {
    gap: 6px !important;
  }

  .home-score-level-pill {
    width: 24px !important;
    height: 24px !important;
    font-size: .72rem !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Défi v1.21.32 — finition haut de page accueil
   Attention : aucune règle ci-dessous ne modifie la zone
   Classement / Race à découvrir, volontairement stabilisée.
   ───────────────────────────────────────────────────────────── */

body:has(#welcome:not(.hidden)) .topbar.app-header .header-link {
  background: rgba(255, 248, 223, .82) !important;
  border-color: rgba(111, 83, 49, .34) !important;
  color: #4a2a17 !important;
  box-shadow: 0 2px 0 rgba(43, 28, 15, .08) !important;
}

body:has(#welcome:not(.hidden)) .topbar.app-header .header-link:hover,
body:has(#welcome:not(.hidden)) .topbar.app-header .header-link:focus-visible {
  border-color: rgba(95, 157, 70, .72) !important;
  background: rgba(239, 246, 221, .92) !important;
}

.home-main-zone .home-kicker {
  display: none !important;
}

.home-feature-pills {
  margin-top: 2px !important;
  margin-bottom: 17px !important;
}

.home-feature-pills span {
  min-height: 30px !important;
  padding: 6px 11px !important;
  border: 1px solid rgba(95, 157, 70, .34) !important;
  background: rgba(236, 245, 221, .72) !important;
  color: #355f2b !important;
  font-size: .78rem !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
}

.home-hero-optimized {
  border-color: rgba(124, 63, 25, .58) !important;
  box-shadow: 0 3px 0 rgba(43, 28, 15, .10) !important;
}

.home-cta,
.home-side-card,
.home-classic-toggle,
.home-mini-link {
  border-radius: 12px !important;
}

.home-side-zone {
  grid-template-rows: minmax(132px, 1.08fr) minmax(122px, .92fr) !important;
  gap: 13px !important;
}

.home-side-card {
  min-height: 122px !important;
  padding: 17px 17px !important;
  border-width: 2px !important;
  border-color: rgba(124, 63, 25, .48) !important;
  box-shadow: 0 2px 0 rgba(43, 28, 15, .09) !important;
}

.home-side-encyclo {
  min-height: 136px !important;
  border-color: rgba(95, 157, 70, .48) !important;
}

.home-side-title {
  font-size: 1.25rem !important;
}

.home-side-text {
  font-size: .91rem !important;
  line-height: 1.32 !important;
}

.home-side-arrow {
  background: #5f9d46 !important;
  box-shadow: none !important;
}

@media (max-width: 900px) {
  .home-side-zone {
    grid-template-rows: none !important;
  }

  .home-side-card,
  .home-side-encyclo {
    min-height: 94px !important;
  }
}

@media (max-width: 700px),
       (max-width: 950px) and (max-height: 620px) and (orientation: landscape) {
  .home-feature-pills {
    gap: 5px !important;
    margin-bottom: 13px !important;
  }

  .home-feature-pills span {
    min-height: 25px !important;
    padding: 5px 8px !important;
    font-size: .68rem !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .header-link[href$="defi.php"] {
    box-shadow: 0 2px 0 rgba(43, 28, 15, .14) !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Défi v1.21.44 — accueil : libellé Race du jour
   - ne modifie pas la zone score/race ;
   - centre seulement le libellé par rapport à la carte photo sur écran large.
   ───────────────────────────────────────────────────────────── */
@media (min-width: 901px) {
  .home-scoreboard-header:has(.home-scoreboard-badge) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(292px, 322px) !important;
    gap: 12px !important;
    align-items: center !important;
  }

  .home-scoreboard-header .home-scoreboard-badge {
    justify-self: center !important;
    text-align: center !important;
    white-space: nowrap !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Accueil mobile applicatif — sans impact sur la version PC
   ───────────────────────────────────────────────────────────── */
.home-mobile-nav,
.home-intro-mobile,
.home-side-text-mobile,
.home-side-icon {
  display: none;
}

@media (max-width: 700px) {
  body:has(#welcome:not(.hidden)) .app {
    padding: 8px 8px 24px !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header {
    position: relative;
    min-height: 68px;
    margin: 0 auto 8px !important;
    padding: 9px 58px 9px 12px !important;
    border-radius: 18px 18px 0 0;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .brand {
    justify-content: flex-start !important;
    gap: 10px !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header .header-logo {
    width: 54px !important;
    max-width: 54px !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header h1 {
    font-size: clamp(1.28rem, 5.6vw, 1.65rem) !important;
    line-height: 1.08 !important;
    white-space: nowrap !important;
  }

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

  .home-mobile-nav {
    display: block;
    position: absolute;
    z-index: 40;
    top: 17px;
    right: 18px;
  }

  .home-mobile-menu-button {
    width: 42px;
    height: 42px;
    border: 2px solid rgba(77, 36, 15, .55);
    border-radius: 12px;
    background: rgba(255, 248, 225, .94);
    color: #3d1f12;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 2px 0 rgba(77, 36, 15, .2);
  }

  .home-mobile-menu-button span:first-child {
    font-size: 1.35rem;
    line-height: 1;
  }

  .home-mobile-menu-button span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .home-mobile-menu {
    position: absolute;
    right: 0;
    top: 50px;
    width: min(250px, calc(100vw - 32px));
    padding: 8px;
    border: 2px solid #9a5a2e;
    border-radius: 14px;
    background: #fff8df;
    box-shadow: 0 12px 30px rgba(61, 31, 18, .28);
  }

  .home-mobile-menu[hidden] {
    display: none !important;
  }

  .home-mobile-menu a {
    display: block;
    padding: 12px 13px;
    border-radius: 10px;
    color: #3d1f12;
    font-weight: 800;
    text-decoration: none;
  }

  .home-mobile-menu a + a {
    border-top: 1px solid rgba(154, 90, 46, .22);
  }

  body:has(#welcome:not(.hidden)) .welcome-layout {
    margin-top: 0 !important;
  }

  body:has(#welcome:not(.hidden)) .home-hero-optimized {
    padding: 18px 14px 14px !important;
    border-radius: 0 0 18px 18px;
  }

  body:has(#welcome:not(.hidden)) .home-hero-grid {
    display: block !important;
  }

  body:has(#welcome:not(.hidden)) .home-main-zone h2 {
    font-size: clamp(1.75rem, 8vw, 2.35rem) !important;
    line-height: 1.05;
    margin-bottom: 8px !important;
  }

  .home-intro-desktop,
  .home-side-text-desktop {
    display: none !important;
  }

  .home-intro-mobile,
  .home-side-text-mobile {
    display: inline !important;
  }

  body:has(#welcome:not(.hidden)) .home-intro {
    font-size: 1rem !important;
    line-height: 1.35 !important;
    margin: 0 0 12px !important;
  }

  body:has(#welcome:not(.hidden)) .home-feature-pills {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px !important;
    margin: 10px 0 14px !important;
  }

  body:has(#welcome:not(.hidden)) .home-feature-pills span {
    min-width: 0 !important;
    padding: 7px 5px !important;
    font-size: .75rem !important;
    text-align: center;
    white-space: nowrap;
  }

  body:has(#welcome:not(.hidden)) .home-feature-pills span:nth-child(4) {
    display: none !important;
  }

  body:has(#welcome:not(.hidden)) .home-cta-row {
    display: grid !important;
    gap: 8px !important;
  }

  body:has(#welcome:not(.hidden)) .home-cta {
    min-height: 52px !important;
    padding: 12px 14px !important;
    border-radius: 14px !important;
    font-size: 1.05rem !important;
  }

  body:has(#welcome:not(.hidden)) .home-side-zone {
    display: block !important;
    margin-top: 12px !important;
  }

  body:has(#welcome:not(.hidden)) .home-side-encyclo {
    display: none !important;
  }

  body:has(#welcome:not(.hidden)) .home-side-class {
    min-height: 76px !important;
    display: grid !important;
    grid-template-columns: 46px minmax(0, 1fr) 38px;
    align-items: center;
    gap: 10px;
    padding: 11px 12px !important;
    border-color: #cf9b45 !important;
    background: linear-gradient(135deg, #fff7da, #f4dfaa) !important;
  }

  .home-side-icon {
    display: grid !important;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #4e963d;
    font-size: 1.25rem;
  }

  .home-side-content {
    min-width: 0;
  }

  body:has(#welcome:not(.hidden)) .home-side-class .home-side-title {
    font-size: 1.15rem !important;
    margin: 0 0 2px !important;
  }

  body:has(#welcome:not(.hidden)) .home-side-class .home-side-text {
    display: block !important;
    font-size: .82rem !important;
    line-height: 1.25 !important;
  }

  body:has(#welcome:not(.hidden)) .home-side-class .home-side-arrow {
    position: static !important;
    width: 34px !important;
    height: 34px !important;
    font-size: 1.75rem !important;
  }

  body:has(#welcome:not(.hidden)) .home-scoreboard {
    margin-top: 14px !important;
  }
}

@media (max-width: 380px) {
  body:has(#welcome:not(.hidden)) .topbar.app-header h1 {
    font-size: 1.18rem !important;
  }

  body:has(#welcome:not(.hidden)) .home-feature-pills span {
    font-size: .68rem !important;
  }
}

/* Le conteneur ajouté autour du texte ne modifie pas la mise en page PC. */
.home-side-content {
  display: contents;
}

@media (max-width: 700px) {
  .home-side-content {
    display: block;
  }
}


/* ─────────────────────────────────────────────────────────────
   v1.21.56 — correctif accueil mobile compact
   - en-tête mobile plus cohérent avec la charte
   - carte Mode classe sans pictogramme système
   - texte correctement aligné sur toute la largeur
   ───────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  body:has(#welcome:not(.hidden)) .topbar.app-header {
    background: linear-gradient(135deg, #8a431d 0%, #a75a25 100%) !important;
    border-color: #6e3217 !important;
    box-shadow: 0 3px 0 rgba(82, 36, 15, .24) !important;
  }

  body:has(#welcome:not(.hidden)) .topbar.app-header h1 {
    color: #fff8df !important;
    text-shadow: 0 1px 1px rgba(61, 25, 9, .35) !important;
  }

  .home-mobile-menu-button {
    background: #fff7dc !important;
    border-color: #6e3217 !important;
    color: #4a2413 !important;
  }

  body:has(#welcome:not(.hidden)) .home-side-class {
    min-height: 88px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 38px !important;
    grid-template-areas: "content arrow" !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 14px 14px 14px 16px !important;
    text-align: left !important;
    overflow: hidden !important;
  }

  body:has(#welcome:not(.hidden)) .home-side-class .home-side-content {
    grid-area: content !important;
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    justify-self: stretch !important;
  }

  body:has(#welcome:not(.hidden)) .home-side-class .home-side-title,
  body:has(#welcome:not(.hidden)) .home-side-class .home-side-text {
    position: static !important;
    inset: auto !important;
    width: auto !important;
    max-width: none !important;
    text-align: left !important;
    transform: none !important;
  }

  body:has(#welcome:not(.hidden)) .home-side-class .home-side-title {
    display: block !important;
    font-size: 1.2rem !important;
    line-height: 1.1 !important;
    margin: 0 0 5px !important;
  }

  body:has(#welcome:not(.hidden)) .home-side-class .home-side-text {
    display: block !important;
    font-size: .88rem !important;
    line-height: 1.28 !important;
  }

  body:has(#welcome:not(.hidden)) .home-side-class .home-side-arrow {
    grid-area: arrow !important;
    position: static !important;
    inset: auto !important;
    justify-self: end !important;
    align-self: center !important;
    margin: 0 !important;
    transform: none !important;
  }

  .home-side-icon {
    display: none !important;
  }
}

@media (max-width: 380px) {
  body:has(#welcome:not(.hidden)) .home-side-class {
    grid-template-columns: minmax(0, 1fr) 34px !important;
    padding-left: 13px !important;
  }

  body:has(#welcome:not(.hidden)) .home-side-class .home-side-title {
    font-size: 1.08rem !important;
  }

  body:has(#welcome:not(.hidden)) .home-side-class .home-side-text {
    font-size: .8rem !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Défi v1.21.57 — accueil raccordé au bandeau mobile commun
   Ces règles neutralisent uniquement l'ancien menu spécifique.
   ───────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  body:has(#welcome:not(.hidden)) .topbar.app-header {
    min-height: 0 !important;
    margin: 0 auto 8px !important;
    padding: 8px 10px !important;
    border-radius: 14px 14px 0 0 !important;
    background: linear-gradient(135deg, #d5a24a 0%, #c88c35 100%) !important;
    border-color: #8a4c24 !important;
    box-shadow: 0 3px 0 rgba(97, 53, 23, .18) !important;
  }

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

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

  .home-mobile-nav,
  .home-mobile-menu,
  .home-mobile-menu-button {
    display: none !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Défi v1.21.76 — accueil : drapeau de la race du jour
   La vignette du drapeau est imbriquée dans .home-featured-race-photo.
   Les anciennes règles visant tous les <img> de ce bloc lui donnaient
   les dimensions de la photo principale. Les deux images sont désormais
   distinguées explicitement.
   ───────────────────────────────────────────────────────────── */
.home-featured-race-photo > .home-featured-race-main-image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center center !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 10px 10px 0 0 !important;
  background: rgba(255, 247, 223, .62) !important;
  box-shadow: none !important;
  transform: none !important;
}

.home-featured-race-photo .home-featured-race-flag {
  position: static !important;
  display: inline-block !important;
  flex: 0 0 18px !important;
  width: 18px !important;
  height: 12px !important;
  min-width: 18px !important;
  min-height: 0 !important;
  max-width: 18px !important;
  max-height: 12px !important;
  aspect-ratio: 3 / 2 !important;
  object-fit: cover !important;
  object-position: center !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid rgba(255, 248, 223, .72) !important;
  border-radius: 2px !important;
  background: transparent !important;
  box-shadow: 0 1px 2px rgba(43, 28, 15, .22) !important;
  transform: none !important;
  vertical-align: middle !important;
}

.home-featured-race:hover .home-featured-race-photo .home-featured-race-flag,
.home-featured-race:focus-within .home-featured-race-photo .home-featured-race-flag {
  transform: none !important;
}

@media (max-width: 700px),
       (max-width: 950px) and (max-height: 620px) and (orientation: landscape) {
  .home-featured-race-photo .home-featured-race-flag {
    flex-basis: 17px !important;
    width: 17px !important;
    height: 12px !important;
    min-width: 17px !important;
    max-width: 17px !important;
    max-height: 12px !important;
  }
}
