/* =================================================================
   LIQUID HOME — Jeu "Devine le Mot"
   Charte graphique officielle :
     - Bleu profond : #11398A
     - Jaune orangé : #FF8C00
     - Violet       : #6B3FA0
     - Bronze       : #C77A3D
   Police : Dosis (Google Fonts, substitut visuel de Terminal Dosis)
   ================================================================= */

/* ============================= VARIABLES ============================= */
:root {
  /* Couleurs de marque */
  --c-blue-deep: #11398A;        /* Bleu profond logo */
  --c-blue-deep-dark: #0A2A6E;
  --c-blue-deep-light: #1F4FA8;
  --c-amber: #FF8C00;            /* Jaune orangé vif */
  --c-amber-bright: #FFB300;
  --c-amber-soft: #F59E0B;
  --c-amber-dark: #E07700;
  --c-bronze: #C77A3D;           /* Ton intermédiaire */
  --c-purple: #6B3FA0;

  /* Neutres */
  --c-bg: #F5F7FB;
  --c-bg-alt: #FFFFFF;
  --c-text: #1B2540;
  --c-text-soft: #4A5675;
  --c-text-muted: #8A93AE;
  --c-border: #E4E8F1;
  --c-success: #16A34A;
  --c-warning: #F59E0B;
  --c-danger: #DC2626;

  /* Dégradés (bleu profond → jaune orangé, diagonal) */
  --g-brand: linear-gradient(135deg, #11398A 0%, #6B3FA0 30%, #C77A3D 65%, #FF8C00 100%);
  --g-brand-soft: linear-gradient(135deg, rgba(17, 57, 138, 0.10) 0%, rgba(255, 140, 0, 0.10) 100%);
  /* Dégradé bouton principal : bleu profond → jaune orangé */
  --g-brand-button: linear-gradient(135deg, #11398A 0%, #2D4FA0 35%, #C77A3D 70%, #FF8C00 100%);
  --g-brand-button-hover: linear-gradient(135deg, #1F4FA8 0%, #3D5FB0 35%, #D88A4D 70%, #FFA028 100%);
  --g-deep: linear-gradient(135deg, #0A2A6E 0%, #11398A 100%);
  /* Dégradé texte (titres hero, scores) */
  --g-text: linear-gradient(120deg, #11398A 0%, #6B3FA0 35%, #C77A3D 70%, #FF8C00 100%);

  /* Rayons */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* Ombres */
  --sh-sm: 0 1px 2px rgba(17, 57, 138, 0.10);
  --sh-md: 0 6px 16px rgba(17, 57, 138, 0.12);
  --sh-lg: 0 14px 40px rgba(17, 57, 138, 0.20);
  --sh-brand: 0 14px 40px rgba(255, 140, 0, 0.30);

  /* Police */
  --font-base: 'Dosis', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Transitions */
  --t-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 0.45s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --maxw: 1100px;
  --header-h: 72px;
  --footer-h: 96px;
}

/* ============================= RESET ============================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-base);
  font-weight: 400;
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* ============================= LAYOUT GÉNÉRAL ============================= */
.lh-header { flex: 0 0 auto; }
.lh-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px 20px 48px;
}
/* S'assurer que les éléments interactifs ne sont pas masqués par le header sticky */
.lh-screen { scroll-margin-top: calc(var(--header-h) + 12px); }
.lh-card, .lh-game, .lh-hero { scroll-margin-top: calc(var(--header-h) + 12px); }
.lh-footer { flex: 0 0 auto; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* ============================= HEADER ============================= */
.lh-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--c-border);
}
.lh-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.lh-logo { display: inline-flex; align-items: center; }
.lh-logo__img {
  height: 38px;
  width: auto;
  transition: transform var(--t-base);
}
.lh-logo:hover .lh-logo__img { transform: scale(1.04); }

.lh-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--c-bg);
  padding: 4px;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-border);
}
.lh-nav__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--c-text-soft);
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--r-pill);
  transition: all var(--t-fast);
}
.lh-nav__btn:hover { color: var(--c-amber); background: rgba(255, 140, 0, 0.08); }
.lh-nav__btn.is-active {
  background: var(--g-brand-button);
  color: #fff;
  box-shadow: var(--sh-sm);
}
.lh-nav__icon { font-size: 14px; }
.lh-nav__label { font-size: 13px; }

@media (max-width: 640px) {
  .lh-nav__label { display: none; }
  .lh-nav__btn { padding: 10px 14px; }
  .lh-nav__icon { font-size: 18px; }
  .lh-logo__img { height: 32px; }
  .lh-header__inner { padding: 0 14px; height: 60px; }
  :root { --header-h: 60px; }
}

/* ============================= SCREENS ============================= */
.lh-screen {
  display: none;
  animation: lh-fade-up 0.5s var(--t-base) both;
}
.lh-screen--active {
  display: block;
  animation: lh-fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes lh-fade-up {
  from { opacity: 0; transform: translateY(20px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* ============================= HERO ============================= */
.lh-hero {
  text-align: center;
  padding: 30px 0 20px;
  max-width: 760px;
  margin: 0 auto;
  position: relative;
}
.lh-hero::before {
  content: '';
  position: absolute;
  inset: -40px -20px 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(17, 57, 138, 0.08), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(255, 140, 0, 0.10), transparent 40%);
  z-index: -1;
  pointer-events: none;
}

/* Ondes Wi-Fi animées (SVG décoratif) */
.lh-hero__art {
  width: 220px;
  max-width: 72%;
  height: auto;
  margin: 2px auto 8px;
  display: block;
  overflow: visible;
}
.lh-hero__wave {
  opacity: 0.25;
  animation: lh-wave 2.6s ease-in-out infinite;
}
.lh-hero__wave--2 { animation-delay: 0.5s; opacity: 0.45; }
.lh-hero__wave--3 { animation-delay: 1.0s; opacity: 0.65; }
@keyframes lh-wave {
  0%, 100% { opacity: 0.2; transform: translateY(0); }
  50% { opacity: 0.75; transform: translateY(-3px); }
}

.lh-hero__badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--g-brand-soft);
  color: var(--c-amber-dark);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.lh-hero__title {
  margin: 0 0 12px;
  font-size: clamp(36px, 7vw, 64px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  background: var(--g-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: lh-shine 4s ease-in-out infinite;
  background-size: 200% auto;
  filter: drop-shadow(0 2px 6px rgba(17, 57, 138, 0.18));
}
@keyframes lh-shine {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.lh-hero__subtitle {
  margin: 0 auto 30px;
  max-width: 540px;
  font-size: clamp(15px, 2.4vw, 18px);
  color: var(--c-text-soft);
  font-weight: 500;
}
.lh-hero__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 0 auto 28px;
  max-width: 640px;
}
.lh-hero__card {
  padding: 22px 14px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  transition: transform var(--t-base), box-shadow var(--t-base);
}
.lh-hero__card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-md);
  border-color: var(--c-amber);
}
.lh-hero__card-icon { font-size: 30px; margin-bottom: 6px; }
.lh-hero__card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--c-blue-deep);
  line-height: 1.1;
}
.lh-hero__card-text {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--c-text-muted);
  font-weight: 500;
}

/* Record personnel (appareil uniquement) */
.lh-hero__record {
  margin: -8px 0 20px;
  font-size: 14px;
  color: var(--c-text-soft);
  font-weight: 600;
}
.lh-hero__record b { color: var(--c-blue-deep); }

/* Podium du top 3 (source : base de données) */
.lh-home-top {
  max-width: 520px;
  margin: 0 auto 28px;
  padding: 16px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}
.lh-home-top__title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-muted);
  margin-bottom: 10px;
}
.lh-home-top__list { display: grid; gap: 8px; }
.lh-home-top__row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  background: var(--c-bg);
  border-radius: var(--r-md);
  font-size: 14px;
  animation: lh-slide-in 0.4s var(--t-base) both;
}
.lh-home-top__medal {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  background: var(--c-text-muted);
}
.lh-home-top__row.is-1 .lh-home-top__medal { background: linear-gradient(135deg, #FFD700, #FFA500); color: #fff; }
.lh-home-top__row.is-2 .lh-home-top__medal { background: linear-gradient(135deg, #C0C0C0, #909090); }
.lh-home-top__row.is-3 .lh-home-top__medal { background: linear-gradient(135deg, #CD7F32, #8B4513); }
.lh-home-top__name {
  font-weight: 700;
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lh-home-top__score {
  font-weight: 800;
  color: var(--c-blue-deep);
  background: var(--g-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Comment jouer */
.lh-howto {
  max-width: 520px;
  margin: 26px auto 0;
  padding: 18px 20px;
  text-align: left;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}
.lh-howto__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-blue-deep);
  margin-bottom: 10px;
}
.lh-howto__list { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 8px; }
.lh-howto__list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13.5px;
  color: var(--c-text-soft);
  font-weight: 500;
}
.lh-howto__list li span { flex: 0 0 auto; font-size: 16px; }

/* ============================= BOUTONS ============================= */
.lh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-base), background var(--t-base), color var(--t-base);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
}
.lh-btn:active { transform: translateY(1px) scale(0.99); }
.lh-btn--primary {
  background: var(--g-brand-button);
  background-size: 200% auto;
  color: #fff;
  box-shadow: var(--sh-brand);
  border: 1px solid rgba(255, 255, 255, 0.15);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.lh-btn--primary:hover {
  transform: translateY(-2px);
  background: var(--g-brand-button-hover);
  background-size: 200% auto;
  box-shadow: 0 18px 44px rgba(255, 140, 0, 0.40), 0 0 0 4px rgba(255, 140, 0, 0.10);
}
.lh-btn--primary:active { transform: translateY(0); }
.lh-btn--ghost {
  background: transparent;
  color: var(--c-text-soft);
  border-color: var(--c-border);
}
.lh-btn--ghost:hover { background: var(--c-bg-alt); border-color: var(--c-amber); color: var(--c-amber-dark); }
.lh-btn--soft {
  background: var(--c-bg-alt);
  color: var(--c-blue-deep);
  border-color: var(--c-border);
  box-shadow: var(--sh-sm);
}
.lh-btn--soft:hover { border-color: var(--c-blue-deep); color: var(--c-blue-deep); transform: translateY(-2px); }
.lh-btn--soft:disabled,
.lh-btn--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: var(--sh-sm);
}
.lh-btn--xl { padding: 16px 32px; font-size: 17px; }
.lh-btn--sm { padding: 8px 14px; font-size: 12px; gap: 6px; }

/* Barre de contrôle pendant la partie */
.lh-game-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 8px 0 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--c-border);
}
.lh-btn__arrow { transition: transform var(--t-base); }
.lh-btn:hover .lh-btn__arrow { transform: translateX(4px); }
.lh-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--c-amber);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* ============================= CARD ============================= */
.lh-card {
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md);
  max-width: 620px;
  margin: 0 auto;
  overflow: hidden;
  animation: lh-pop 0.4s var(--t-base) both;
}
@keyframes lh-pop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.lh-card__header {
  padding: 28px 28px 18px;
  text-align: center;
  background: var(--g-brand-soft);
  border-bottom: 1px solid var(--c-border);
}
.lh-card__title {
  margin: 0 0 6px;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  color: var(--c-blue-deep);
}
.lh-card__subtitle {
  margin: 0;
  color: var(--c-text-soft);
  font-size: 14px;
  font-weight: 500;
}
.lh-card__actions {
  padding: 18px 28px 26px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================= FORM ============================= */
.lh-form { padding: 24px 28px 8px; }
.lh-form__row { margin-bottom: 18px; }
.lh-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--c-text);
  letter-spacing: 0.02em;
}
.lh-required { color: var(--c-amber-dark); }
.lh-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  font-size: 15px;
  font-family: inherit;
  background: var(--c-bg-alt);
  color: var(--c-text);
  transition: all var(--t-fast);
}
.lh-input:focus {
  outline: none;
  border-color: var(--c-amber);
  box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.18);
}
.lh-input::placeholder { color: var(--c-text-muted); }
.lh-input.is-error { border-color: var(--c-danger); }
.lh-hint, .lh-error {
  margin: 6px 0 0;
  font-size: 12px;
}
.lh-hint { color: var(--c-text-muted); }
.lh-error { color: var(--c-danger); font-weight: 600; }
.lh-form__actions {
  padding: 8px 0 22px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* Consentement (case à cocher) */
.lh-consent { margin-top: 4px; }
.lh-checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color var(--t-fast);
}
.lh-checkbox:hover { border-color: var(--c-amber); }
.lh-checkbox input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--c-amber-dark);
  cursor: pointer;
}
.lh-checkbox span {
  font-size: 13px;
  color: var(--c-text-soft);
  line-height: 1.45;
}
.lh-checkbox.is-error { border-color: var(--c-danger); background: rgba(220, 38, 38, 0.05); }

/* ============================= LEADERBOARD ============================= */
.lh-card--leaderboard .lh-leaderboard__icon {
  font-size: 40px;
  margin-bottom: 4px;
}
.lh-leaderboard {
  padding: 12px 18px 4px;
  max-height: 480px;
  overflow-y: auto;
}
.lh-leaderboard__loading {
  text-align: center;
  padding: 28px 12px;
  color: var(--c-text-muted);
  font-size: 14px;
}
.lh-leaderboard__empty {
  text-align: center;
  padding: 30px 12px;
  color: var(--c-text-muted);
  font-size: 14px;
}
.lh-leaderboard__error {
  text-align: center;
  padding: 26px 14px;
  color: var(--c-text-soft);
  font-size: 14px;
}
.lh-leaderboard__error-actions { margin-top: 14px; }
.lh-leaderboard__row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--r-md);
  margin-bottom: 6px;
  background: var(--c-bg);
  border: 1px solid transparent;
  transition: all var(--t-base);
  animation: lh-slide-in 0.4s var(--t-base) both;
}
.lh-leaderboard__row:hover {
  background: var(--c-bg-alt);
  border-color: var(--c-border);
  transform: translateX(2px);
}
.lh-leaderboard__row.is-self {
  background: var(--g-brand-soft);
  border-color: var(--c-amber);
}
.lh-leaderboard__rank {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: var(--c-bg-alt);
  color: var(--c-text-soft);
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--c-border);
}
.lh-leaderboard__row.is-rank-1 .lh-leaderboard__rank { background: linear-gradient(135deg, #FFD700, #FFA500); color: #fff; border: none; }
.lh-leaderboard__row.is-rank-2 .lh-leaderboard__rank { background: linear-gradient(135deg, #C0C0C0, #909090); color: #fff; border: none; }
.lh-leaderboard__row.is-rank-3 .lh-leaderboard__rank { background: linear-gradient(135deg, #CD7F32, #8B4513); color: #fff; border: none; }
.lh-leaderboard__name {
  font-weight: 700;
  font-size: 15px;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.lh-leaderboard__name .lh-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--g-brand-button);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.lh-leaderboard__meta {
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: 2px;
  font-weight: 500;
}
.lh-leaderboard__score {
  font-weight: 800;
  font-size: 18px;
  background: var(--g-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lh-leaderboard__score small {
  display: block;
  font-size: 10px;
  color: var(--c-text-muted);
  font-weight: 600;
  -webkit-text-fill-color: var(--c-text-muted);
  text-align: right;
}
@keyframes lh-slide-in {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================= GAME ============================= */
.lh-game {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 4px 0;
}

/* HUD */
.lh-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 12px;
  margin-bottom: 20px;
  box-shadow: var(--sh-sm);
}
.lh-hud__item {
  text-align: center;
  padding: 6px 4px;
  border-radius: var(--r-md);
  background: var(--c-bg);
  transition: all var(--t-base);
}
.lh-hud__item--timer.is-warning { background: rgba(245, 158, 11, 0.15); }
.lh-hud__item--timer.is-danger {
  background: rgba(220, 38, 38, 0.18);
  animation: lh-pulse-danger 0.9s ease-in-out infinite;
}
@keyframes lh-pulse-danger {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.lh-hud__label {
  display: block;
  font-size: 10px;
  color: var(--c-text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}
.lh-hud__value {
  font-size: 22px;
  font-weight: 800;
  color: var(--c-blue-deep);
  line-height: 1;
}
.lh-hud__suffix {
  font-size: 12px;
  color: var(--c-text-muted);
  font-weight: 600;
  margin-left: 2px;
}
@media (max-width: 480px) {
  .lh-hud { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .lh-hud__value { font-size: 18px; }
}

/* Indice */
.lh-clue {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(17, 57, 138, 0.10), rgba(255, 140, 0, 0.10));
  border: 1px solid rgba(17, 57, 138, 0.25);
  border-radius: var(--r-md);
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--c-blue-deep);
  font-weight: 600;
  animation: lh-clue-in 0.4s var(--t-base) both;
}
@keyframes lh-clue-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.lh-clue__icon { font-size: 18px; }

/* Mot en construction */
.lh-answer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  min-height: 72px;
  padding: 14px 8px;
  margin-bottom: 18px;
}
.lh-answer__slot {
  width: 52px;
  height: 60px;
  border: 2px dashed var(--c-border);
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: var(--c-blue-deep);
  background: var(--c-bg);
  transition: all var(--t-fast);
}
.lh-answer__slot.is-filled {
  border-style: solid;
  border-color: var(--c-blue-deep);
  background: var(--c-bg-alt);
  cursor: pointer;
  animation: lh-drop-in 0.25s var(--t-base) both;
}
.lh-answer__slot.is-filled:hover {
  border-color: var(--c-amber);
  color: var(--c-amber-dark);
  transform: translateY(-2px);
}
.lh-answer__slot.is-correct {
  border-color: var(--c-success);
  background: rgba(22, 163, 74, 0.1);
  color: var(--c-success);
  animation: lh-bounce-correct 0.6s var(--t-base);
}
.lh-answer__slot.is-reveal {
  /* Réponse révélée après expiration du temps */
  border-color: var(--c-amber);
  background: rgba(255, 140, 0, 0.12);
  color: var(--c-amber-dark);
  animation: lh-reveal 0.5s var(--t-base);
}
@keyframes lh-reveal {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}
.lh-answer__slot.is-wrong {
  border-color: var(--c-danger);
  background: rgba(220, 38, 38, 0.08);
  color: var(--c-danger);
  animation: lh-shake 0.4s ease;
}
@keyframes lh-drop-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.7); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes lh-bounce-correct {
  0% { transform: translateY(0); }
  35% { transform: translateY(-12px) scale(1.08); }
  60% { transform: translateY(0) scale(0.96); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes lh-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
@media (max-width: 480px) {
  .lh-answer__slot { width: 38px; height: 48px; font-size: 20px; }
}

/* Tuiles de lettres */
.lh-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  min-height: 72px;
  margin-bottom: 18px;
  padding: 14px;
  background: var(--g-brand-soft);
  border-radius: var(--r-lg);
  border: 1px dashed var(--c-border);
}
.lh-tile {
  width: 54px;
  height: 62px;
  border-radius: var(--r-md);
  border: none;
  background: linear-gradient(180deg, #FFFFFF 0%, #F0F4FB 100%);
  color: var(--c-blue-deep);
  font-size: 26px;
  font-weight: 800;
  font-family: inherit;
  box-shadow: 0 3px 0 var(--c-border), var(--sh-sm);
  transition: transform var(--t-fast), box-shadow var(--t-fast), color var(--t-fast), opacity var(--t-base);
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  animation: lh-tile-pop 0.35s var(--t-base) both;
}
.lh-tile:nth-child(2) { animation-delay: 0.04s; }
.lh-tile:nth-child(3) { animation-delay: 0.08s; }
.lh-tile:nth-child(4) { animation-delay: 0.12s; }
.lh-tile:nth-child(5) { animation-delay: 0.16s; }
.lh-tile:nth-child(6) { animation-delay: 0.20s; }
.lh-tile:nth-child(7) { animation-delay: 0.24s; }
.lh-tile:nth-child(8) { animation-delay: 0.28s; }
.lh-tile:nth-child(9) { animation-delay: 0.32s; }
.lh-tile:nth-child(10) { animation-delay: 0.36s; }
@keyframes lh-tile-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.7); }
  to   { opacity: 1; transform: translateY(0)   scale(1);   }
}
.lh-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 7px 0 var(--c-blue-deep), var(--sh-md);
  color: var(--c-blue-deep);
}
.lh-tile:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--c-blue-deep), var(--sh-sm);
}
.lh-tile.is-used {
  /* Tuile vraiment masquée : libère l'espace visuel */
  opacity: 0;
  pointer-events: none;
  transform: scale(0.4);
  visibility: hidden;
  max-width: 0;
  max-height: 0;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden;
  border: 0;
  transition: transform 0.20s ease-out, opacity 0.20s ease-out, max-width 0.20s ease-out, max-height 0.20s ease-out, margin 0.20s ease-out;
}
.lh-tile.is-moving {
  /* Pendant l'animation FLIP : on garde l'opacité contrôlée par JS */
  pointer-events: none;
}
@media (max-width: 480px) {
  .lh-tile { width: 40px; height: 50px; font-size: 20px; }
}

/* Barre de progression temps */
.lh-progress {
  width: 100%;
  height: 6px;
  background: var(--c-bg);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--c-border);
}
.lh-progress__bar {
  height: 100%;
  width: 100%;
  background: var(--g-brand);
  border-radius: var(--r-pill);
  transition: width 1s linear, background var(--t-base);
}
.lh-progress__bar.is-warning { background: linear-gradient(90deg, #F59E0B, #FF8C00); }
.lh-progress__bar.is-danger { background: linear-gradient(90deg, #DC2626, #F59E0B); }

/* Actions */
.lh-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.lh-game__hint {
  text-align: center;
  font-size: 12px;
  color: var(--c-text-muted);
  margin: 8px 0 0;
  font-weight: 500;
}

/* ============================= RÉSULTAT ============================= */
.lh-card--result { text-align: center; }
.lh-result__icon {
  font-size: 64px;
  margin-top: 28px;
  animation: lh-pop 0.6s var(--t-base) both;
}
.lh-result__score {
  margin: 8px 28px 18px;
  padding: 22px 18px;
  background: var(--g-brand-soft);
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
}
.lh-result__score-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text-muted);
  font-weight: 700;
  margin-bottom: 6px;
}
.lh-result__score-value {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  background: var(--g-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: lh-score-pop 0.7s var(--t-base) both;
}
@keyframes lh-score-pop {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

/* Statistiques de fin de partie */
.lh-result__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 28px 18px;
}
.lh-stat {
  padding: 12px 8px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}
.lh-stat__value {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--c-blue-deep);
  line-height: 1.1;
}
.lh-stat__label {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--c-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
@media (max-width: 480px) {
  .lh-result__stats { grid-template-columns: 1fr; gap: 8px; }
  .lh-stat { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 14px; }
}

.lh-result__rank {
  margin: 0 28px 20px;
  padding: 12px 16px;
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.25);
  border-radius: var(--r-md);
  font-size: 14px;
  color: var(--c-success);
  font-weight: 700;
}

/* ============================= FOOTER ============================= */
.lh-footer {
  flex-shrink: 0;
  width: 100%;
  text-align: center;
  padding: 26px 20px 28px;
  /* Fond : bleu profond (haut-gauche) → jaune orangé (bas-droite) */
  background: linear-gradient(135deg, #0A2A6E 0%, #11398A 25%, #6B3FA0 50%, #C77A3D 75%, #FF8C00 100%);
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
  border-top: 3px solid var(--c-amber);
}
.lh-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 30%, rgba(255, 255, 255, 0.06), transparent 50%),
              radial-gradient(circle at 85% 70%, rgba(255, 255, 255, 0.10), transparent 50%);
  pointer-events: none;
}
.lh-footer__inner {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.lh-footer__logo {
  height: 28px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.92;
  margin-bottom: 4px;
}
.lh-footer__text { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.02em; }
.lh-footer__sub { margin: 0; font-size: 12px; opacity: 0.72; font-weight: 500; }
.lh-footer__links {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
}
.lh-footer__links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color var(--t-fast);
}
.lh-footer__links a:hover { color: #fff; text-decoration: underline; }

/* Modale « Confidentialité » (politique courte) */
.lh-modal__privacy {
  text-align: left;
  font-size: 13px;
  color: var(--c-text-soft);
  line-height: 1.6;
  margin: 0 0 18px;
}
.lh-modal__privacy ul { margin: 8px 0 0; padding-left: 18px; }
.lh-modal__privacy li { margin-bottom: 4px; }

/* ============================= TOAST ============================= */
.lh-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  padding: 12px 22px;
  background: var(--c-blue-deep-dark);
  color: #fff;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--sh-lg);
  z-index: 200;
  opacity: 0;
  transition: opacity var(--t-base), transform var(--t-base);
  max-width: calc(100% - 32px);
  text-align: center;
}
.lh-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.lh-toast--success { background: var(--c-success); }
.lh-toast--error { background: var(--c-danger); }
.lh-toast--warning { background: var(--c-warning); color: #1B2540; }

/* ============================= MODALE ============================= */
.lh-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(10, 24, 60, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.22s ease-out;
}
.lh-modal.is-visible { opacity: 1; }

.lh-modal__card {
  background: var(--c-bg-alt);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  max-width: 460px;
  width: 100%;
  padding: 28px 26px 22px;
  text-align: center;
  transform: scale(0.92);
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-top: 4px solid var(--c-amber);
}
.lh-modal.is-visible .lh-modal__card { transform: scale(1); }

.lh-modal__title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--c-blue-deep);
}
.lh-modal__message {
  margin: 0 0 22px;
  font-size: 14px;
  color: var(--c-text-soft);
  line-height: 1.5;
}
.lh-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ============================= CONFETTI ============================= */
.lh-confetti {
  position: fixed;
  top: -10px;
  width: 10px;
  height: 14px;
  z-index: 150;
  pointer-events: none;
  border-radius: 2px;
  animation: lh-confetti-fall linear forwards;
}
@keyframes lh-confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ============================= ACCESSIBILITÉ ============================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
:focus-visible {
  outline: 3px solid var(--c-amber);
  outline-offset: 2px;
  border-radius: 4px;
}
