/**
 * PercoMind — styles globaux (jeux + auth + hub + classement + admin).
 * Les pages mobile ajoutent mobile-games.css en complément.
 */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400..700;1,9..40,400..700&family=Press+Start+2P&display=swap");

:root {
  --bg-deep: #0b1020;
  --bg-gradient: radial-gradient(120% 90% at 50% -20%, rgba(56, 189, 248, 0.18), transparent),
    radial-gradient(80% 60% at 100% 0%, rgba(167, 139, 250, 0.12), transparent),
    linear-gradient(180deg, #0b1020 0%, #060b14 100%);
  --panel: rgba(255, 255, 255, 0.06);
  --panel-strong: rgba(255, 255, 255, 0.1);
  --border: rgba(56, 189, 248, 0.35);
  --border-soft: rgba(255, 255, 255, 0.1);
  --text: #e8eefc;
  --muted: #95a3bf;
  --accent: #22d3ee;
  --accent-hover: #67e8f9;
  --violet: #a78bfa;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  /* Barre jeu : bloc « Temps » + actions (ex. Nouvelle partie) — même colonne sur toutes les pages */
  --game-toolbar-time-width: 12.75rem;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  --font-ui: "DM Sans", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-arcade: "Press Start 2P", ui-monospace, monospace;
  /* Titres des pages jeu (bandeau) */
  --game-title-gradient: linear-gradient(
    115deg,
    #5eead4 0%,
    #22d3ee 22%,
    #818cf8 52%,
    #c4b5fd 78%,
    #fde047 100%
  );
  --game-title-gradient-pacman: linear-gradient(
    168deg,
    #fffbeb 0%,
    #fcd34d 38%,
    #f59e0b 72%,
    #ea580c 100%
  );
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-deep);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
}

body.page-home {
  text-align: left;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
}

/* --- Enveloppes --- */
.wrap {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.wrap-narrow {
  width: min(440px, calc(100% - 2rem));
}

.wrap {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding-inline: clamp(1rem, 3vw, 2rem);
  padding-block: clamp(1.25rem, 2.5vw, 2rem);
}

.page-auth .wrap {
  text-align: center;
  margin-top: calc(clamp(1.75rem, 6vw, 3.25rem) + env(safe-area-inset-top, 0px));
  margin-inline: auto;
}

/* --- Logo & marque --- */
.site-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.site-brand__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  border-radius: var(--radius-sm);
  outline-offset: 3px;
}

.site-brand__logo {
  height: clamp(52px, 12vw, 72px);
  width: auto;
  display: block;
  filter: drop-shadow(0 6px 20px rgba(34, 211, 238, 0.25));
}

.site-brand--back .site-brand__link--back {
  width: 44px;
  height: 44px;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
}

.site-brand__back-glyph {
  display: flex;
}

.site-footer-brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-footer-brand__perco {
  color: #f1f5f9;
}

.site-footer-brand__mind {
  background: linear-gradient(90deg, #22d3ee, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Bandeau compte --- */
.site-panel {
  margin: -0.25rem -0.35rem 1.25rem;
}

.site-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.45rem 0.65rem;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border-soft);
  border-bottom-color: transparent;
  border-radius: var(--radius-sm);
}

/* Dans le bandeau : sans marge pied (prévu pour logo centré en page), logo plus compact */
.site-top .site-brand {
  margin-bottom: 0;
}

.site-top .site-brand__logo {
  height: clamp(42px, 6.25vw, 56px);
}

.site-top__brand {
  flex: 0 0 auto;
}

.site-top__title {
  flex: 1 1 auto;
  min-width: 0;
}

.site-top--has-title {
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.75rem clamp(0.75rem, 2.5vw, 1.35rem);
}

.site-top--has-title .site-top__brand {
  flex-shrink: 0;
}

.site-top--has-title .site-top__title {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.55rem 0.7rem;
  flex-wrap: nowrap;
  min-width: 0;
}

.site-top--has-title .site-top-game-thumb--img {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  object-fit: contain;
  align-self: center;
}

.site-top__title .site-panel__page-title {
  margin: 0;
}

.site-top-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  min-width: 0;
}

/* Retour cours : flèche devant le titre (le logo reste à gauche) */
.site-top-title-back {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  text-decoration: none;
  outline-offset: 3px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.site-top-title-back:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent, #e0f2fe);
}

.site-top-title-back__glyph {
  display: flex;
}

.site-top-title-back__glyph svg {
  display: block;
}

.site-top--has-title .site-top-title-row {
  flex: 0 1 auto;
}

.site-panel__page-title {
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
  body.page-game:not(.page-admin) .site-top--has-title .site-panel__page-title {
    background-image: var(--game-title-gradient);
    background-size: 135% 100%;
    background-repeat: no-repeat;
    background-position: 50% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 10px rgba(34, 211, 238, 0.22));
  }
}

.site-top-game-thumb {
  flex-shrink: 0;
}

.site-top-game-thumb--img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.04);
}

.user-bar {
  flex: 0 0 auto;
}

.user-bar--guest,
.user-bar--logged {
  min-width: 0;
}

.user-bar-hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.user-bar-hint--desktop-only {
  flex: 1 0 100%;
}

.user-bar__auth--compact {
  display: flex;
  align-items: center;
}

.user-bar__session--compact {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  position: relative;
}

.user-bar__signin-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(34, 211, 238, 0.1);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.user-bar__signin-btn:hover {
  background: rgba(34, 211, 238, 0.2);
}

.user-bar__avatar-btn {
  appearance: none;
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  background: linear-gradient(145deg, rgba(167, 139, 250, 0.35), rgba(34, 211, 238, 0.25));
}

.user-bar__avatar-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.user-bar__admin-menu {
  position: relative;
}

.user-bar__admin-summary,
.user-bar__admin-link {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.1rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.42);
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.28), rgba(99, 102, 241, 0.24));
  color: #e0f2fe;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

.user-bar__admin-summary::-webkit-details-marker {
  display: none;
}

.user-bar__admin-summary:hover,
.user-bar__admin-link:hover {
  border-color: rgba(125, 211, 252, 0.7);
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.38), rgba(99, 102, 241, 0.32));
}

.user-bar__admin-dropdown {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.45rem);
  right: 0;
  min-width: 12rem;
  padding: 0.4rem;
  border-radius: 12px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
}

.user-bar__admin-dropdown a {
  display: block;
  padding: 0.48rem 0.6rem;
  border-radius: 9px;
  color: #dbeafe;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.user-bar__admin-dropdown a:hover {
  background: rgba(14, 165, 233, 0.16);
  color: #f8fafc;
}

/* --- Zones de contenu --- */
.site {
  margin-bottom: 1.75rem;
}

.site p {
  color: var(--muted);
}

.site strong {
  color: var(--text);
}

.site h1 {
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 800;
  margin: 0 0 0.65rem;
  letter-spacing: -0.02em;
}

footer.site {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

/* --- Hub — onglets (radios hors écran + :has sur .wrap recommandé) --- */
.hub-tab-state {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  overflow: hidden;
}

.site--home-hub {
  text-align: center;
}

body.page-home .site--home-hub {
  position: relative;
  margin-bottom: 0.65rem;
}

.site-home__title--hub {
  margin-bottom: 0.5rem;
}

.perc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.site-top--hub-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem clamp(0.5rem, 2vw, 1rem);
}

.site-top--hub-nav .site-top__brand {
  justify-self: start;
}

.site-top--hub-nav .site-top__hub {
  grid-column: 2;
  justify-self: stretch;
  min-width: 0;
  max-width: none;
  width: 100%;
}

.site-top--hub-nav .site-top__hub .hub-mode-switch {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.site-top__hub .hub-mode-switch__text {
  min-width: clamp(56px, 14vw, 110px);
  padding: 0.48rem 0.62rem;
  font-size: clamp(0.88rem, 2vw, 1.06rem);
}

.site-top__hub .hub-mode-switch--five .hub-mode-switch__text {
  min-width: 0;
  padding: 0.65rem 0.5rem;
  font-size: clamp(0.85rem, 2.5vmin, 1.05rem);
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-align: center;
}

.hub-mode-switch--five .hub-mode-switch__text {
  min-width: 0;
  padding: 0.62rem 0.55rem;
  font-size: clamp(0.9rem, 2.75vmin, 1.12rem);
  line-height: 1.22;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-align: center;
}

.site-top--hub-nav .user-bar {
  justify-self: end;
  grid-column: 3;
}

@media (max-width: 900px) {
  .site-top--hub-nav {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    row-gap: 0.65rem;
    column-gap: 0.75rem;
  }

  .site-top--hub-nav .site-top__brand {
    grid-column: 1;
    grid-row: 1;
  }

  .site-top--hub-nav .user-bar {
    grid-column: 2;
    grid-row: 1;
  }

  .site-top--hub-nav .site-top__hub {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.hub-mode-switch {
  position: relative;
  display: inline-flex;
  gap: 0;
  padding: 4px;
  border-radius: 999px;
  background: linear-gradient(155deg, rgba(15, 23, 42, 0.95), rgba(6, 8, 20, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(34, 211, 238, 0.08),
    0 14px 44px rgba(0, 0, 0, 0.5),
    0 0 50px -18px rgba(129, 140, 248, 0.4);
}

.hub-mode-switch.hub-mode-switch--five {
  display: flex;
  width: 100%;
}

.hub-mode-switch--five.hub-mode-switch--classement {
  max-width: min(100%, 56rem);
  margin-inline: auto;
}

.hub-mode-switch__track {
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: linear-gradient(135deg, #22d3ee, #2dd4bf);
  border: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    0 5px 24px rgba(34, 211, 238, 0.5),
    0 0 40px rgba(45, 212, 191, 0.3);
  transition:
    transform 0.32s cubic-bezier(0.34, 1.22, 0.64, 1),
    background 0.32s ease,
    box-shadow 0.32s ease;
  pointer-events: none;
}

.hub-mode-switch--five .hub-mode-switch__track {
  width: calc(20% - 4px);
}

.wrap:has(#hub-tab-puzzles:checked) .hub-mode-switch__track {
  transform: translateX(0%);
  background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 40%, #2dd4bf 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 6px 28px rgba(34, 211, 238, 0.6),
    0 0 48px rgba(6, 182, 212, 0.35);
}

.wrap:has(#hub-tab-exos:checked) .hub-mode-switch__track {
  transform: translateX(100%);
  background: linear-gradient(135deg, #a78bfa 0%, #c084fc 42%, #f472b6 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    0 6px 28px rgba(192, 132, 252, 0.55),
    0 0 48px rgba(244, 114, 182, 0.38);
}

.wrap:has(#hub-tab-jeux:checked) .hub-mode-switch__track {
  transform: translateX(200%);
  background: linear-gradient(135deg, #fde047 0%, #fb923c 38%, #f97316 72%, #ef4444 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 6px 28px rgba(249, 115, 22, 0.58),
    0 0 52px rgba(253, 224, 71, 0.45);
}

.wrap:has(#hub-tab-cours:checked) .hub-mode-switch__track {
  transform: translateX(300%);
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 45%, #16a34a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 6px 28px rgba(34, 197, 94, 0.5),
    0 0 48px rgba(74, 222, 128, 0.35);
}

.wrap:has(#hub-tab-enigmes:checked) .hub-mode-switch__track {
  transform: translateX(400%);
  background: linear-gradient(135deg, #93c5fd 0%, #60a5fa 40%, #818cf8 85%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 6px 28px rgba(96, 165, 250, 0.55),
    0 0 48px rgba(129, 140, 248, 0.4);
}

.hub-mode-switch__opt {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hub-mode-switch__text {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-width: clamp(108px, 22vw, 140px);
  padding: 0.65rem 0.95rem;
  font-size: clamp(1.02rem, 2.4vw, 1.2rem);
  font-weight: 600;
  line-height: 1.1;
  color: var(--muted);
  border-radius: 999px;
  transition: color 0.2s ease;
}

.hub-mode-switch__opt:hover .hub-mode-switch__text {
  color: var(--text);
}

.wrap:has(#hub-tab-puzzles:checked)
  .hub-mode-switch__opt[for="hub-tab-puzzles"]
  .hub-mode-switch__text,
.wrap:has(#hub-tab-exos:checked) .hub-mode-switch__opt[for="hub-tab-exos"] .hub-mode-switch__text,
.wrap:has(#hub-tab-jeux:checked) .hub-mode-switch__opt[for="hub-tab-jeux"] .hub-mode-switch__text,
.wrap:has(#hub-tab-cours:checked) .hub-mode-switch__opt[for="hub-tab-cours"] .hub-mode-switch__text,
.wrap:has(#hub-tab-enigmes:checked) .hub-mode-switch__opt[for="hub-tab-enigmes"] .hub-mode-switch__text {
  color: #fff;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(255, 255, 255, 0.35);
}

.games-hub .games-section:not(.games-section--meta) {
  display: none;
}

.wrap:has(#hub-tab-puzzles:checked)
  .games-hub
  .games-section.games-section--hub-puzzles,
.wrap:has(#hub-tab-exos:checked)
  .games-hub
  .games-section.games-section--hub-exos,
.wrap:has(#hub-tab-jeux:checked) .games-hub .games-section.games-section--hub-jeux,
.wrap:has(#hub-tab-cours:checked) .games-hub .games-section.games-section--hub-cours,
.wrap:has(#hub-tab-enigmes:checked) .games-hub .games-section.games-section--hub-enigmes {
  display: block;
}

.games-hub .games-section--meta {
  display: block;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border-soft);
}

.games-section__classement {
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.games-section__classement-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.18);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.games-section__classement-link:hover {
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
  color: var(--accent-hover);
}

.games-section__classement-thumb .game-card__art {
  width: 42px;
  height: 42px;
}

.games-section__classement-thumb .game-card__art--img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.games-section__classement-label {
  color: var(--text);
}

/* --- Enigmes (hub + fiche) --- */
.game-card--enigme .enigme-card__championnat {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.25rem 0 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-card--enigme .enigme-card__meta {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0.2rem 0 0;
}

.game-card--enigme .enigme-card__teaser {
  font-size: 0.9rem;
  color: var(--text);
  margin: 0.45rem 0 0;
  line-height: 1.35;
}

.game-card__art-wrap--enigme {
  display: block;
  margin: 0.65rem auto 0;
}

.game-card--enigme .game-card__art--enigme {
  object-fit: contain;
  max-height: 140px;
  width: auto;
  max-width: 100%;
}

.games-section__lead--enigmes-empty .enigme-code {
  font-size: 0.88em;
}

.enigme-detail {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 0.5rem 2rem;
}

.enigme-detail__back {
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.enigme-detail__back-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.enigme-detail__back-link:hover {
  text-decoration: underline;
}

.enigme-detail__back-hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.enigme-detail__head {
  margin-bottom: 1rem;
}

.enigme-detail__meta {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
  line-height: 1.35;
}

.enigme-detail__title {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  margin: 0;
  line-height: 1.2;
}

.enigme-detail__lead {
  color: var(--muted);
}

.enigme-detail__figure {
  margin: 1rem 0;
  padding: 0;
  text-align: center;
}

.enigme-detail__img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
}

.enigme-detail__enonce {
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--text);
}

/* Page classement : onglets hub (même logique que l’accueil) */
.classement-hub-head {
  text-align: center;
  margin: 0 0 1rem;
}

.classement-hub-head .hub-mode-switch--five {
  justify-content: stretch;
}

.page-classement .classement-hub .games-section {
  display: none;
}

.page-classement .wrap:has(#classement-tab-puzzles:checked) .classement-hub .games-section.games-section--hub-puzzles,
.page-classement .wrap:has(#classement-tab-exos:checked) .classement-hub .games-section.games-section--hub-exos,
.page-classement .wrap:has(#classement-tab-jeux:checked) .classement-hub .games-section.games-section--hub-jeux,
.page-classement .wrap:has(#classement-tab-cours:checked) .classement-hub .games-section.games-section--hub-cours,
.page-classement .wrap:has(#classement-tab-enigmes:checked) .classement-hub .games-section.games-section--hub-enigmes {
  display: block;
}

.page-classement .wrap:has(#classement-tab-puzzles:checked) .classement-hub-head .hub-mode-switch__track {
  transform: translateX(0%);
  background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 40%, #2dd4bf 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 6px 28px rgba(34, 211, 238, 0.6),
    0 0 48px rgba(6, 182, 212, 0.35);
}

.page-classement .wrap:has(#classement-tab-exos:checked) .classement-hub-head .hub-mode-switch__track {
  transform: translateX(100%);
  background: linear-gradient(135deg, #a78bfa 0%, #c084fc 42%, #f472b6 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    0 6px 28px rgba(192, 132, 252, 0.55),
    0 0 48px rgba(244, 114, 182, 0.38);
}

.page-classement .wrap:has(#classement-tab-jeux:checked) .classement-hub-head .hub-mode-switch__track {
  transform: translateX(200%);
  background: linear-gradient(135deg, #fde047 0%, #fb923c 38%, #f97316 72%, #ef4444 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 6px 28px rgba(249, 115, 22, 0.58),
    0 0 52px rgba(253, 224, 71, 0.45);
}

.page-classement .wrap:has(#classement-tab-cours:checked) .classement-hub-head .hub-mode-switch__track {
  transform: translateX(300%);
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 45%, #16a34a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 6px 28px rgba(34, 197, 94, 0.5),
    0 0 48px rgba(74, 222, 128, 0.35);
}

.page-classement .wrap:has(#classement-tab-enigmes:checked) .classement-hub-head .hub-mode-switch__track {
  transform: translateX(400%);
  background: linear-gradient(135deg, #93c5fd 0%, #60a5fa 40%, #818cf8 85%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 6px 28px rgba(96, 165, 250, 0.55),
    0 0 48px rgba(129, 140, 248, 0.4);
}

.page-classement .wrap:has(#classement-tab-puzzles:checked)
  .classement-hub-head
  .hub-mode-switch__opt[for="classement-tab-puzzles"]
  .hub-mode-switch__text,
.page-classement .wrap:has(#classement-tab-exos:checked)
  .classement-hub-head
  .hub-mode-switch__opt[for="classement-tab-exos"]
  .hub-mode-switch__text,
.page-classement .wrap:has(#classement-tab-jeux:checked)
  .classement-hub-head
  .hub-mode-switch__opt[for="classement-tab-jeux"]
  .hub-mode-switch__text,
.page-classement .wrap:has(#classement-tab-cours:checked)
  .classement-hub-head
  .hub-mode-switch__opt[for="classement-tab-cours"]
  .hub-mode-switch__text,
.page-classement .wrap:has(#classement-tab-enigmes:checked)
  .classement-hub-head
  .hub-mode-switch__opt[for="classement-tab-enigmes"]
  .hub-mode-switch__text {
  color: #fff;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(255, 255, 255, 0.35);
}

.games-section__title {
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  margin: 0 0 0.35rem;
}

.games-section__lead {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.97rem;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.games-grid--meta {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.game-card {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

/* Accueil : pas de plaque grise sous la carte — le contour néon suffit */
body.page-home .games-grid .game-card {
  background: transparent;
}

.game-card:not(.game-card--disabled):hover {
  transform: translateY(-3px);
  border-color: var(--border);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.game-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1rem 1rem 1.15rem;
  text-decoration: none;
  color: inherit;
}

/* Vignette jeu : sans cadre ni pastille façon « sous-bouton » (image seule dans la carte). */
.game-card__art--img {
  display: block;
  width: auto;
  max-width: min(148px, 72%);
  height: auto;
  margin: 0 auto 0.85rem;
  border-radius: 10px;
}

.game-card__art--badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.65rem;
  font-size: 2rem;
  line-height: 1;
  color: var(--muted);
}

.game-card h2 {
  margin: 0 0 0.45rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.game-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  flex: 1 1 auto;
}

.game-card--disabled {
  opacity: 0.55;
  pointer-events: none;
}

.game-card--disabled .game-card__link {
  cursor: default;
}

/* --- Accueil : cartes-jeu & Connexion façon touches colorées néon --- */
body.page-home .user-bar__signin-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.35), rgba(167, 139, 250, 0.4));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 8px 28px rgba(34, 211, 238, 0.22),
    0 0 32px rgba(167, 139, 250, 0.2);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

body.page-home .user-bar__signin-btn:hover {
  filter: brightness(1.08) saturate(1.12);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 12px 36px rgba(34, 211, 238, 0.35),
    0 0 40px rgba(244, 114, 182, 0.25);
}

body.page-home .games-grid .game-card .game-card__link:focus-visible {
  outline: 2px solid #22d3ee;
  outline-offset: 3px;
}

body.page-home .games-grid .game-card:not(.game-card--disabled) {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  /* Fallback si une carte sans .game-card--* : cyan. Couleurs par jeu : même bloc
     que .games-grid .game-card + .game-card--nom (voir plus bas — spécificité !). */
  --gc-rail: linear-gradient(135deg, #22d3ee, #818cf8, #22d3ee);
  --gc-glow: rgba(34, 211, 238, 0.48);
  /* Pas de fond : seulement le liséré. */
  --gc-fill: transparent;
  border-radius: 18px;
  border: 4px solid transparent;
  background-color: transparent;
  background-image: var(--gc-fill), var(--gc-rail);
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 14px 40px rgba(0, 0, 0, 0.4),
    0 0 16px var(--gc-glow),
    0 0 44px var(--gc-glow);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    filter 0.22s ease;
}

body.page-home .games-grid .game-card .game-card__link {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: transparent;
}

body.page-home .games-grid .game-card:not(.game-card--enigme) .game-card__link > :first-child {
  flex: 0 0 7.75rem;
  height: 7.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.35rem;
}

body.page-home .games-grid .game-card .game-card__link > h2 {
  flex-shrink: 0;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

body.page-home .games-grid .game-card .game-card__link > p {
  flex: 1 1 auto;
  margin: 0;
  text-align: left;
  line-height: 1.5;
}

body.page-home .games-grid .game-card .game-card__art--img {
  margin-bottom: 0;
  max-height: 100%;
  width: auto;
  max-width: min(148px, 78%);
  object-fit: contain;
  object-position: center;
}

body.page-home .games-grid .game-card .game-card__art--badge {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0;
  font-size: clamp(1.85rem, 5.5vw, 2.65rem);
  line-height: 1;
}

body.page-home .games-grid .game-card:not(.game-card--disabled):hover {
  transform: translateY(-5px) scale(1.012);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 22px 52px rgba(0, 0, 0, 0.48),
    0 0 22px var(--gc-glow),
    0 0 52px var(--gc-glow),
    0 0 0 1px rgba(255, 255, 255, 0.12);
}

body.page-home .games-grid .game-card.game-card--disabled {
  display: flex;
  flex-direction: column;
  opacity: 0.78;
  border-radius: 16px;
  border-style: dashed;
  border-color: rgba(100, 116, 139, 0.35);
  background-color: transparent;
  background-image: none;
  box-shadow: none;
}

body.page-home .games-grid .game-card:not(.game-card--disabled) h2 {
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #f8fafc;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

body.page-home .games-grid .game-card:not(.game-card--disabled) .game-card__art--img {
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4));
}

/* Même spécificité que la règle .games-grid .game-card:not(.disabled) + 1 classe jeu
   (sinon --gc-rail / --gc-glow des variantes sont ignorés → tout en cyan). */
body.page-home .games-grid .game-card.game-card--briques:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #ff2d76, #ff9f1c, #ff5e57, #ff2d76);
  --gc-glow: rgba(255, 45, 118, 0.55);
}

body.page-home .games-grid .game-card.game-card--mines:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #00f0ff, #38bdf8, #a5f3fc, #00f0ff);
  --gc-glow: rgba(0, 240, 255, 0.52);
}

body.page-home .games-grid .game-card.game-card--kakkuru:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #a855f7, #e879f9, #c026d3, #a855f7);
  --gc-glow: rgba(232, 121, 249, 0.55);
}

body.page-home .games-grid .game-card.game-card--grades:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #2563eb, #3b82f6, #0ea5e9, #2563eb);
  --gc-glow: rgba(37, 99, 235, 0.5);
}

body.page-home .games-grid .game-card.game-card--skyscrapers:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #38bdf8, #6366f1, #22d3ee, #38bdf8);
  --gc-glow: rgba(99, 102, 241, 0.5);
}

body.page-home .games-grid .game-card.game-card--battleship:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #2dd4bf, #0ea5e9, #14b8a6, #2dd4bf);
  --gc-glow: rgba(20, 184, 166, 0.5);
}

body.page-home .games-grid .game-card.game-card--str:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #fde047, #eab308, #f59e0b, #fde047);
  --gc-glow: rgba(234, 179, 8, 0.55);
}

body.page-home .games-grid .game-card.game-card--sudoku:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #34d399, #10b981, #5eead4, #34d399);
  --gc-glow: rgba(52, 211, 153, 0.52);
}

body.page-home .games-grid .game-card.game-card--taquin:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #f472b6, #e879f9, #f9a8d4, #f472b6);
  --gc-glow: rgba(244, 114, 182, 0.52);
}

body.page-home .games-grid .game-card.game-card--lights:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #f97316, #ea580c, #fcd34d, #fb923c, #f97316);
  --gc-glow: rgba(249, 115, 22, 0.55);
}

body.page-home .games-grid .game-card.game-card--memory:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #c084fc, #22d3ee, #e879f9, #c084fc);
  --gc-glow: rgba(168, 85, 247, 0.5);
}

body.page-home .games-grid .game-card.game-card--numberlink:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #22d3ee, #38bdf8, #818cf8, #c084fc, #22d3ee);
  --gc-glow: rgba(56, 189, 248, 0.52);
}

body.page-home .games-grid .game-card.game-card--reveil-mental:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #fde047, #f97316, #fbbf24, #fde047);
  --gc-glow: rgba(251, 191, 36, 0.55);
}

body.page-home .games-grid .game-card.game-card--calcul:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #4ade80, #22d3ee, #86efac, #4ade80);
  --gc-glow: rgba(74, 222, 128, 0.52);
}

body.page-home .games-grid .game-card.game-card--equation:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #60a5fa, #a78bfa, #818cf8, #60a5fa);
  --gc-glow: rgba(96, 165, 250, 0.52);
}

body.page-home .games-grid .game-card.game-card--mathsixeme:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #fb923c, #ef4444, #fbbf24, #fb923c);
  --gc-glow: rgba(239, 68, 68, 0.5);
}

body.page-home .games-grid .game-card.game-card--casse-brique:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #f87171, #dc2626, #fb7185, #f87171);
  --gc-glow: rgba(248, 113, 113, 0.55);
}

body.page-home .games-grid .game-card.game-card--pacman:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #fffc00, #fdba74, #f97316, #fffc00);
  --gc-glow: rgba(255, 252, 0, 0.52);
}

body.page-home .games-grid .game-card.game-card--classement:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #5eead4, #fcd34d, #fbbf24, #14b8a6, #5eead4);
  --gc-glow: rgba(20, 184, 166, 0.48);
}

body.page-home .games-grid .game-card.game-card--admin:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #f87171, #fda4af, #fb7185, #f87171);
  --gc-glow: rgba(251, 113, 133, 0.52);
}

/* --- Hub Cours : niveaux & bandeau « À venir » --- */
.games-grid--cours-niveaux {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

body.page-home .games-grid .game-card.game-card--cours-6e:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #38bdf8, #6366f1, #a78bfa, #22d3ee, #38bdf8);
  --gc-glow: rgba(99, 102, 241, 0.52);
}

body.page-home .games-grid .game-card.game-card--cours-6e-generic:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #34d399, #22d3ee, #6366f1, #34d399);
  --gc-glow: rgba(34, 211, 238, 0.5);
}

body.page-home .games-grid .game-card.game-card--cours-soon:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #64748b, #475569, #94a3b8, #64748b);
  --gc-glow: rgba(148, 163, 184, 0.35);
  pointer-events: none;
  cursor: default;
}

body.page-home .games-grid .game-card.game-card--cours-soon:not(.game-card--disabled):hover {
  transform: none;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 14px 38px rgba(0, 0, 0, 0.4),
    0 0 18px var(--gc-glow),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

body.page-home .games-grid .game-card .game-card__block {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 1rem 1rem 1.15rem;
  box-sizing: border-box;
}

body.page-home .games-grid .game-card:not(.game-card--enigme) .game-card__block > .game-card__art--badge:first-child {
  flex: 0 0 7.75rem;
  height: 7.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.35rem;
}

body.page-home .games-grid .game-card .game-card__block > h2 {
  flex-shrink: 0;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

body.page-home .games-grid .game-card .game-card__block > p {
  flex: 1 1 auto;
  margin: 0;
  text-align: left;
  line-height: 1.5;
}

body.page-home .games-grid .game-card.game-card--cours-soon .cours-soon-ribbon {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  width: 155%;
  max-width: none;
  margin: 0;
  transform: translate(-50%, -50%) rotate(-12deg);
  transform-origin: center;
  text-align: center;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(220, 38, 38, 0.88) 18%,
    rgba(220, 38, 38, 0.95) 50%,
    rgba(220, 38, 38, 0.88) 82%,
    transparent 100%
  );
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.35),
    0 0 20px rgba(220, 38, 38, 0.35);
  padding: 0.42rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

body.page-home .games-grid .game-card.game-card--cours-soon .cours-soon-ribbon__text {
  display: block;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: #fff;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.55),
    0 0 12px rgba(0, 0, 0, 0.35);
}

/* Page programme 6e */
.page-cours-program .site--cours-program {
  margin-bottom: 0.5rem;
}

.cours-program-nav__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  color: #7dd3fc;
  text-decoration: none;
  margin-bottom: 0.75rem;
}

.cours-program-nav__back:hover {
  color: #e0f2fe;
  text-decoration: underline;
}

.cours-program-lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 52rem;
}

.cours-program {
  margin: 0 0 2rem;
}

.cours-program-inner {
  --cours-mark-size: 2.35rem;
  --cours-mark-gap: 0.65rem;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 960px) {
  .cours-program-inner {
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    align-items: start;
    column-gap: 1.75rem;
  }
}

.cours-toc {
  position: sticky;
  top: 0.75rem;
  padding: 1rem 1.05rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.22);
}

.cours-toc__heading {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #e2e8f0;
}

.cours-toc__hint {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}

.cours-toc__hint strong {
  color: #94a3b8;
  font-weight: 600;
}

.cours-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cours-toc__item {
  display: grid;
  grid-template-columns: minmax(var(--cours-mark-size), max-content) minmax(0, 1fr);
  column-gap: var(--cours-mark-gap);
  align-items: start;
}

.cours-toc__mark,
.cours-chapitre__mark {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--cours-mark-size);
  width: max(var(--cours-mark-size), fit-content);
  height: var(--cours-mark-size);
  padding: 0 0.32rem;
  flex-shrink: 0;
  margin: 0;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  color: #f8fafc;
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.55), rgba(99, 102, 241, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 4px 14px rgba(0, 0, 0, 0.28);
}

.cours-toc__link {
  display: block;
  padding-top: 0.28rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #7dd3fc;
  text-decoration: none;
  word-break: break-word;
  hyphens: auto;
}

.cours-toc__link:hover {
  color: #bae6fd;
  text-decoration: underline;
}

.cours-chapitres {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cours-chapitre {
  padding: 1.15rem 1.2rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.18);
  scroll-margin-top: 1rem;
}

.cours-chapitre__head {
  display: grid;
  grid-template-columns: minmax(var(--cours-mark-size), max-content) minmax(0, 1fr);
  column-gap: var(--cours-mark-gap);
  align-items: start;
  margin: 0 0 1rem;
}

.cours-chapitre__title {
  margin: 0;
  padding-top: 0.12rem;
  font-size: 1.12rem;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.cours-bloc {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 650;
  color: #cbd5e1;
}

.cours-bloc--accent {
  margin-bottom: 0.85rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(99, 102, 241, 0.2));
  border: 1px solid rgba(125, 211, 252, 0.25);
  color: #e0f2fe;
}

.cours-bloc--suite {
  margin-top: 0.85rem;
  margin-bottom: 0.35rem;
  font-weight: 600;
  color: #94a3b8;
}

.cours-objectif {
  margin-bottom: 0.95rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px dashed rgba(100, 116, 139, 0.35);
}

.cours-objectif:last-of-type {
  border-bottom: none;
  margin-bottom: 0.35rem;
  padding-bottom: 0;
}

.cours-objectif__title {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1.4;
}

.cours-objectif__steps-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.45rem 0.5rem;
  margin: 0.15rem 0 0;
}

.cours-objectif__step-link {
  flex: 1 1 auto;
  min-width: min(100%, 9.5rem);
  padding: 0.42rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.cours-objectif__step-link--cherchons {
  color: #ecfeff;
  border: 1px solid rgba(34, 211, 238, 0.45);
  background: linear-gradient(145deg, rgba(6, 182, 212, 0.35), rgba(59, 130, 246, 0.4));
}

.cours-objectif__step-link--cherchons:hover {
  border-color: rgba(34, 211, 238, 0.7);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 6px 20px rgba(6, 182, 212, 0.25);
}

.cours-objectif__step-link--cours {
  color: #faf5ff;
  border: 1px solid rgba(192, 132, 252, 0.45);
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.35), rgba(167, 139, 250, 0.38));
}

.cours-objectif__step-link--cours:hover {
  border-color: rgba(196, 181, 253, 0.7);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 6px 20px rgba(139, 92, 246, 0.28);
}

.cours-objectif__step-link--auto {
  color: #fff7ed;
  border: 1px solid rgba(251, 146, 60, 0.45);
  background: linear-gradient(145deg, rgba(234, 88, 12, 0.32), rgba(245, 158, 11, 0.36));
}

.cours-objectif__step-link--auto:hover {
  border-color: rgba(253, 186, 116, 0.65);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 6px 20px rgba(234, 88, 12, 0.22);
}

.cours-objectif__step-link:hover {
  transform: translateY(-1px);
}

/* Programme 6e générique */
.cours-generic-layout {
  display: grid;
  gap: 1.35rem;
}

@media (min-width: 980px) {
  .cours-generic-layout {
    grid-template-columns: minmax(270px, 330px) minmax(0, 1fr);
    align-items: start;
  }
}

.cours-generic-sidebar {
  position: sticky;
  top: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(34, 211, 238, 0.2);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.58)),
    rgba(0, 0, 0, 0.18);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
}

.cours-generic-sidebar__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 800;
  color: #e0f2fe;
}

.cours-generic-sidebar__hint {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

.cours-generic-menu {
  margin: 0 0 1rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid rgba(71, 85, 105, 0.45);
}

.cours-generic-menu:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.cours-generic-menu__title {
  margin: 0 0 0.55rem;
  font-size: 0.9rem;
  line-height: 1.35;
  font-weight: 800;
  color: #f1f5f9;
}

.cours-generic-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.cours-generic-menu__item {
  padding: 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(71, 85, 105, 0.42);
  background: rgba(15, 23, 42, 0.42);
}

.cours-generic-menu__item.is-current {
  border-color: rgba(34, 211, 238, 0.42);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(99, 102, 241, 0.12));
}

.cours-generic-menu__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.55rem;
}

.cours-generic-menu__link {
  color: #bae6fd;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}

.cours-generic-menu__link:hover {
  color: #ecfeff;
  text-decoration: underline;
}

.cours-generic-menu__link--parent {
  color: #e2e8f0;
}

.cours-generic-subchapters {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.cours-generic-subchapter {
  padding: 0.55rem;
  border-radius: 9px;
  border: 1px solid rgba(71, 85, 105, 0.45);
  background: rgba(2, 6, 23, 0.25);
}

.cours-generic-subchapter.is-current {
  border-color: rgba(125, 211, 252, 0.32);
}

.cours-generic-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.8rem;
  padding: 0.18rem 0.42rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  background: rgba(15, 23, 42, 0.62);
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.cours-generic-note.has-note {
  border-color: rgba(74, 222, 128, 0.48);
  background: linear-gradient(145deg, rgba(22, 163, 74, 0.28), rgba(15, 23, 42, 0.72));
  color: #bbf7d0;
}

.cours-generic-menu__actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.cours-generic-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0.3rem 0.35rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.25;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.cours-generic-pill--cours {
  color: #ecfeff;
  background: rgba(14, 165, 233, 0.24);
  border-color: rgba(56, 189, 248, 0.42);
}

.cours-generic-pill--memo {
  color: #f5f3ff;
  background: rgba(124, 58, 237, 0.22);
  border-color: rgba(167, 139, 250, 0.44);
}

.cours-generic-pill--exercice {
  color: #fff7ed;
  background: rgba(234, 88, 12, 0.22);
  border-color: rgba(251, 146, 60, 0.42);
}

.cours-generic-pill--evaluation {
  color: #f0fdf4;
  background: rgba(22, 163, 74, 0.22);
  border-color: rgba(74, 222, 128, 0.42);
}

.cours-generic-pill.is-active {
  color: #0f172a;
  background: linear-gradient(145deg, #f8fafc, #bae6fd);
  border-color: rgba(226, 232, 240, 0.9);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.16), 0 8px 22px rgba(14, 165, 233, 0.2);
}

.cours-generic-pill:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.cours-generic-content {
  min-width: 0;
}

.cours-generic-panel[hidden] {
  display: none;
}

.cours-generic-panel__title {
  margin: 0 0 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(99, 102, 241, 0.35);
  font-size: 1.08rem;
  font-weight: 850;
  color: #f8fafc;
}

.cours-generic-hero,
.cours-generic-card {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: rgba(15, 23, 42, 0.5);
}

.cours-generic-hero {
  margin: 0 0 1rem;
  padding: clamp(1rem, 2.4vw, 1.35rem);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(34, 211, 238, 0.22), transparent 55%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.62));
}

.cours-generic-hero__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #67e8f9;
}

.cours-generic-hero__title {
  margin: 0 0 0.45rem;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.16;
  color: #f8fafc;
  letter-spacing: -0.03em;
}

.cours-generic-hero__lead {
  margin: 0;
  max-width: 42rem;
  color: #cbd5e1;
}

.cours-generic-card {
  margin: 0 0 1rem;
  padding: clamp(0.95rem, 2vw, 1.2rem);
  scroll-margin-top: 1rem;
}

.cours-generic-card h2 {
  margin: 0 0 0.65rem;
  font-size: 1.02rem;
  line-height: 1.35;
  color: #e0e7ff;
}

.cours-generic-card .cours-generic-panel__title {
  margin: 0 0 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(99, 102, 241, 0.35);
  font-size: 1.08rem;
  font-weight: 850;
  color: #f8fafc;
}

.cours-generic-card h3 {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  line-height: 1.35;
  color: #f1f5f9;
}

.cours-generic-card p {
  margin: 0 0 0.65rem;
  color: #cbd5e1;
  font-size: 0.9rem;
  line-height: 1.58;
}

.cours-generic-card p:last-child {
  margin-bottom: 0;
}

:is(#generique-cours-decimaux, #generique-cours-grands-nombres, #generique-cours-nombres-decimaux, #generique-cours-demi-droite-decimaux, #generique-cours-fractions, #generique-cours-algebre, #generique-cours-longueurs, #generique-cours-aires, #generique-cours-volumes, #generique-cours-temps-durees, #generique-cours-configurations-planes, #generique-cours-vision-espace, #generique-cours-gestion-donnees, #generique-cours-probabilites, #generique-cours-proportionnalite, #generique-cours-pensee-informatique) {
  counter-reset: cours-generic-step;
}

:is(#generique-cours-decimaux, #generique-cours-grands-nombres, #generique-cours-nombres-decimaux, #generique-cours-demi-droite-decimaux, #generique-cours-fractions, #generique-cours-algebre, #generique-cours-longueurs, #generique-cours-aires, #generique-cours-volumes, #generique-cours-temps-durees, #generique-cours-configurations-planes, #generique-cours-vision-espace, #generique-cours-gestion-donnees, #generique-cours-probabilites, #generique-cours-proportionnalite, #generique-cours-pensee-informatique) .cours-generic-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(125, 211, 252, 0.28);
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(56, 189, 248, 0.12), transparent 52%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.72), rgba(30, 41, 59, 0.54));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 14px 34px rgba(0, 0, 0, 0.18);
}

:is(#generique-cours-decimaux, #generique-cours-grands-nombres, #generique-cours-nombres-decimaux, #generique-cours-demi-droite-decimaux, #generique-cours-fractions, #generique-cours-algebre, #generique-cours-longueurs, #generique-cours-aires, #generique-cours-volumes, #generique-cours-temps-durees, #generique-cours-configurations-planes, #generique-cours-vision-espace, #generique-cours-gestion-donnees, #generique-cours-probabilites, #generique-cours-proportionnalite, #generique-cours-pensee-informatique) .cours-generic-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.32rem;
  background: linear-gradient(180deg, #38bdf8, #6366f1);
}

:is(#generique-cours-decimaux, #generique-cours-grands-nombres, #generique-cours-nombres-decimaux, #generique-cours-demi-droite-decimaux, #generique-cours-fractions, #generique-cours-algebre, #generique-cours-longueurs, #generique-cours-aires, #generique-cours-volumes, #generique-cours-temps-durees, #generique-cours-configurations-planes, #generique-cours-vision-espace, #generique-cours-gestion-donnees, #generique-cours-probabilites, #generique-cours-proportionnalite, #generique-cours-pensee-informatique) .cours-generic-card:nth-of-type(3n + 1)::before {
  background: linear-gradient(180deg, #38bdf8, #22d3ee);
}

:is(#generique-cours-decimaux, #generique-cours-grands-nombres, #generique-cours-nombres-decimaux, #generique-cours-demi-droite-decimaux, #generique-cours-fractions, #generique-cours-algebre, #generique-cours-longueurs, #generique-cours-aires, #generique-cours-volumes, #generique-cours-temps-durees, #generique-cours-configurations-planes, #generique-cours-vision-espace, #generique-cours-gestion-donnees, #generique-cours-probabilites, #generique-cours-proportionnalite, #generique-cours-pensee-informatique) .cours-generic-card:nth-of-type(3n + 2)::before {
  background: linear-gradient(180deg, #a78bfa, #ec4899);
}

:is(#generique-cours-decimaux, #generique-cours-grands-nombres, #generique-cours-nombres-decimaux, #generique-cours-demi-droite-decimaux, #generique-cours-fractions, #generique-cours-algebre, #generique-cours-longueurs, #generique-cours-aires, #generique-cours-volumes, #generique-cours-temps-durees, #generique-cours-configurations-planes, #generique-cours-vision-espace, #generique-cours-gestion-donnees, #generique-cours-probabilites, #generique-cours-proportionnalite, #generique-cours-pensee-informatique) .cours-generic-card:nth-of-type(3n)::before {
  background: linear-gradient(180deg, #fbbf24, #f97316);
}

:is(#generique-cours-decimaux, #generique-cours-grands-nombres, #generique-cours-nombres-decimaux, #generique-cours-demi-droite-decimaux, #generique-cours-fractions, #generique-cours-algebre, #generique-cours-longueurs, #generique-cours-aires, #generique-cours-volumes, #generique-cours-temps-durees, #generique-cours-configurations-planes, #generique-cours-vision-espace, #generique-cours-gestion-donnees, #generique-cours-probabilites, #generique-cours-proportionnalite, #generique-cours-pensee-informatique) .cours-generic-card > h3 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  color: #f8fafc;
}

:is(#generique-cours-decimaux, #generique-cours-grands-nombres, #generique-cours-nombres-decimaux, #generique-cours-demi-droite-decimaux, #generique-cours-fractions, #generique-cours-algebre, #generique-cours-longueurs, #generique-cours-aires, #generique-cours-volumes, #generique-cours-temps-durees, #generique-cours-configurations-planes, #generique-cours-vision-espace, #generique-cours-gestion-donnees, #generique-cours-probabilites, #generique-cours-proportionnalite, #generique-cours-pensee-informatique) .cours-generic-card > h3::before {
  counter-increment: cours-generic-step;
  content: counter(cours-generic-step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  color: #0f172a;
  font-size: 0.86rem;
  font-weight: 900;
  background: linear-gradient(145deg, #fef3c7, #67e8f9);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.24);
}

:is(#generique-cours-decimaux, #generique-cours-grands-nombres, #generique-cours-nombres-decimaux, #generique-cours-demi-droite-decimaux, #generique-cours-fractions, #generique-cours-algebre, #generique-cours-longueurs, #generique-cours-aires, #generique-cours-volumes, #generique-cours-temps-durees, #generique-cours-configurations-planes, #generique-cours-vision-espace, #generique-cours-gestion-donnees, #generique-cours-probabilites, #generique-cours-proportionnalite, #generique-cours-pensee-informatique) .cours-generic-card strong {
  color: #fde68a;
}

:is(#generique-cours-decimaux, #generique-cours-grands-nombres, #generique-cours-nombres-decimaux, #generique-cours-demi-droite-decimaux, #generique-cours-fractions, #generique-cours-algebre, #generique-cours-longueurs, #generique-cours-aires, #generique-cours-volumes, #generique-cours-temps-durees, #generique-cours-configurations-planes, #generique-cours-vision-espace, #generique-cours-gestion-donnees, #generique-cours-probabilites, #generique-cours-proportionnalite, #generique-cours-pensee-informatique) .cours-lecon__table-wrap {
  border-color: rgba(125, 211, 252, 0.42);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.08), 0 10px 26px rgba(14, 165, 233, 0.12);
}

:is(#generique-cours-decimaux, #generique-cours-grands-nombres, #generique-cours-nombres-decimaux, #generique-cours-demi-droite-decimaux, #generique-cours-fractions, #generique-cours-algebre, #generique-cours-longueurs, #generique-cours-aires, #generique-cours-volumes, #generique-cours-temps-durees, #generique-cours-configurations-planes, #generique-cours-vision-espace, #generique-cours-gestion-donnees, #generique-cours-probabilites, #generique-cours-proportionnalite, #generique-cours-pensee-informatique) .cours-lecon__table thead th {
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.36), rgba(99, 102, 241, 0.32));
  color: #f8fafc;
}

:is(#generique-cours-decimaux, #generique-cours-grands-nombres, #generique-cours-nombres-decimaux, #generique-cours-demi-droite-decimaux, #generique-cours-fractions, #generique-cours-algebre, #generique-cours-longueurs, #generique-cours-aires, #generique-cours-volumes, #generique-cours-temps-durees, #generique-cours-configurations-planes, #generique-cours-vision-espace, #generique-cours-gestion-donnees, #generique-cours-probabilites, #generique-cours-proportionnalite, #generique-cours-pensee-informatique) .cours-lecon__table tbody td {
  background: rgba(15, 23, 42, 0.52);
}

:is(#generique-cours-decimaux, #generique-cours-grands-nombres, #generique-cours-nombres-decimaux, #generique-cours-demi-droite-decimaux, #generique-cours-fractions, #generique-cours-algebre, #generique-cours-longueurs, #generique-cours-aires, #generique-cours-volumes, #generique-cours-temps-durees, #generique-cours-configurations-planes, #generique-cours-vision-espace, #generique-cours-gestion-donnees, #generique-cours-probabilites, #generique-cours-proportionnalite, #generique-cours-pensee-informatique) .cours-lecon__list {
  margin-top: 0.85rem;
  padding: 0.8rem 0.95rem 0.8rem 1.55rem;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(15, 23, 42, 0.38));
}

.cours-generic-fraction-demo {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  margin: 0.8rem 0 1rem;
}

.cours-generic-fraction-pizza {
  width: 7.5rem;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid rgba(251, 191, 36, 0.82);
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.9) 2px, transparent 2px),
    linear-gradient(0deg, rgba(15, 23, 42, 0.9) 2px, transparent 2px),
    conic-gradient(#f97316 0 270deg, rgba(30, 41, 59, 0.9) 270deg 360deg);
  box-shadow: 0 0 0 5px rgba(251, 191, 36, 0.08), 0 14px 28px rgba(0, 0, 0, 0.22);
}

.cours-generic-fraction-visuals,
.cours-generic-memo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.7rem;
  margin: 0.85rem 0 1rem;
}

.cours-generic-fraction-visuals span,
.cours-generic-memo-grid article {
  border-radius: 12px;
  border: 1px solid rgba(125, 211, 252, 0.26);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(30, 41, 59, 0.48));
  padding: 0.7rem 0.8rem;
  color: #e2e8f0;
  font-size: 0.88rem;
}

.cours-generic-fraction-bar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  overflow: hidden;
  min-height: 2.8rem;
  margin: 0.75rem 0;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.5);
}

.cours-generic-fraction-bar span {
  min-width: 2.5rem;
  border-right: 1px solid rgba(15, 23, 42, 0.78);
  background: rgba(30, 41, 59, 0.74);
}

.cours-generic-fraction-bar span:last-child {
  border-right: 0;
}

.cours-generic-fraction-bar .is-filled {
  background: linear-gradient(145deg, #38bdf8, #6366f1);
}

.cours-generic-fraction-bars {
  display: grid;
  gap: 0.45rem;
  margin: 0.6rem 0 0.85rem;
}

.cours-generic-fraction-bars .cours-generic-fraction-bar {
  margin: 0;
}

.cours-generic-number-line {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  margin: 0.9rem 0 !important;
  padding-top: 0.85rem;
  border-top: 2px solid rgba(125, 211, 252, 0.55);
  font-weight: 800;
  color: #e0f2fe !important;
}

@media (max-width: 640px) {
  .cours-generic-fraction-demo {
    grid-template-columns: 1fr;
  }
}

.cours-generic-algebra-tiles,
.cours-generic-sequence,
.cours-generic-patterns {
  display: grid;
  gap: 0.7rem;
  margin: 0.85rem 0 1rem;
}

.cours-generic-algebra-tiles {
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
}

.cours-generic-algebra-tiles span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  border-radius: 14px;
  border: 1px solid rgba(167, 139, 250, 0.34);
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.22), rgba(14, 165, 233, 0.12));
  color: #f8fafc;
  font-weight: 850;
}

.cours-generic-sequence {
  grid-template-columns: repeat(5, minmax(3rem, 1fr));
  align-items: center;
}

.cours-generic-sequence span {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.18);
  color: #e0f2fe;
  font-weight: 900;
}

.cours-generic-sequence span:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -0.72rem;
  color: #fbbf24;
  font-weight: 900;
}

.cours-generic-patterns {
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
}

.cours-generic-patterns > div {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  padding: 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  background: rgba(15, 23, 42, 0.44);
}

.cours-generic-patterns strong {
  color: #f8fafc !important;
}

.cours-generic-patterns em {
  color: #cbd5e1;
  font-style: normal;
  font-size: 0.82rem;
}

.cours-generic-square-grid {
  display: grid;
  gap: 3px;
  width: 5rem;
  aspect-ratio: 1;
  align-content: center;
  justify-content: center;
}

.cours-generic-square-grid.is-1 {
  grid-template-columns: repeat(1, 1.25rem);
}

.cours-generic-square-grid.is-2 {
  grid-template-columns: repeat(2, 1.25rem);
}

.cours-generic-square-grid.is-3 {
  grid-template-columns: repeat(3, 1.25rem);
}

.cours-generic-square-grid i {
  display: block;
  width: 1.25rem;
  aspect-ratio: 1;
  border-radius: 5px;
  background: linear-gradient(145deg, #fbbf24, #f97316);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.cours-generic-equation {
  display: inline-flex;
  align-items: center;
  margin: 0.55rem 0 0.8rem !important;
  padding: 0.65rem 0.9rem;
  border-radius: 13px;
  border: 1px solid rgba(251, 191, 36, 0.36);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.13), rgba(15, 23, 42, 0.48));
  color: #fef3c7 !important;
  font-size: 1.05rem !important;
  font-variant-numeric: tabular-nums;
}

.cours-generic-length-tiles,
.cours-generic-conversion-row,
.cours-generic-side-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.7rem;
  margin: 0.85rem 0 1rem;
}

.cours-generic-length-tiles span,
.cours-generic-conversion-row span,
.cours-generic-side-list span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: 0.5rem;
  border-radius: 14px;
  border: 1px solid rgba(45, 212, 191, 0.34);
  background: linear-gradient(145deg, rgba(20, 184, 166, 0.18), rgba(14, 165, 233, 0.12));
  color: #ecfeff;
  font-weight: 850;
  text-align: center;
}

.cours-generic-unit-ladder {
  display: grid;
  grid-template-columns: repeat(7, minmax(3rem, 1fr));
  gap: 0.35rem;
  margin: 0.9rem 0 1rem;
  overflow-x: auto;
}

.cours-generic-unit-ladder span {
  position: relative;
  min-width: 3rem;
  padding: 0.6rem 0.35rem;
  border-radius: 10px;
  border: 1px solid rgba(125, 211, 252, 0.38);
  background: rgba(15, 23, 42, 0.62);
  color: #f8fafc;
  font-weight: 900;
  text-align: center;
}

.cours-generic-unit-ladder span:not(:last-child)::after {
  content: "×10";
  position: absolute;
  right: -1.05rem;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  color: #fbbf24;
  font-size: 0.68rem;
  font-weight: 900;
}

.cours-generic-circle-demo {
  width: min(11rem, 62vw);
  aspect-ratio: 1;
  margin: 0.85rem 0 1rem;
  border-radius: 50%;
  border: 3px solid rgba(56, 189, 248, 0.82);
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(251, 191, 36, 0.9) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    radial-gradient(circle at 50% 50%, #fbbf24 0 4px, transparent 5px),
    rgba(14, 165, 233, 0.09);
  box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.08), 0 12px 28px rgba(0, 0, 0, 0.2);
}

.cours-generic-shape-demo {
  margin: 0.8rem 0 1rem;
  border: 3px solid rgba(251, 191, 36, 0.86);
  background: rgba(251, 191, 36, 0.08);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.35);
}

.cours-generic-shape-demo--square {
  width: 7rem;
  aspect-ratio: 1;
}

.cours-generic-shape-demo--rectangle {
  width: min(13rem, 72vw);
  aspect-ratio: 2 / 1;
}

.cours-generic-area-compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin: 0.85rem 0 1rem;
}

.cours-generic-area-compare span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.4rem;
  padding: 0.65rem;
  border-radius: 14px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.15), rgba(14, 165, 233, 0.1));
  color: #fef3c7;
  font-weight: 850;
  text-align: center;
}

.cours-generic-area-grid {
  display: grid;
  grid-template-columns: repeat(4, 2.2rem);
  gap: 4px;
  width: max-content;
  margin: 0.85rem 0 1rem;
  padding: 0.45rem;
  border-radius: 12px;
  border: 1px solid rgba(125, 211, 252, 0.36);
  background: rgba(15, 23, 42, 0.54);
}

.cours-generic-area-grid span {
  display: block;
  width: 2.2rem;
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.72);
}

.cours-generic-area-grid .is-filled {
  border-color: rgba(45, 212, 191, 0.55);
  background: linear-gradient(145deg, #2dd4bf, #0ea5e9);
}

.cours-generic-area-square,
.cours-generic-area-rectangle {
  margin: 0.85rem 0 1rem;
  border: 3px solid rgba(45, 212, 191, 0.8);
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.5) 1px, transparent 1px),
    linear-gradient(0deg, rgba(15, 23, 42, 0.5) 1px, transparent 1px),
    linear-gradient(145deg, rgba(45, 212, 191, 0.22), rgba(14, 165, 233, 0.16));
  background-size: 25% 25%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 12px 26px rgba(0, 0, 0, 0.18);
}

.cours-generic-area-square {
  width: 8rem;
  aspect-ratio: 1;
}

.cours-generic-area-rectangle {
  width: min(14rem, 76vw);
  aspect-ratio: 8 / 3;
}

.cours-generic-volume-solids {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.8rem;
  margin: 0.9rem 0 1rem;
}

.cours-generic-volume-solids span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.5rem;
  border-radius: 16px;
  border: 1px solid rgba(167, 139, 250, 0.38);
  color: #f8fafc;
  font-weight: 850;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 24px rgba(0, 0, 0, 0.16);
}

.cours-generic-volume-solids .is-cube,
.cours-generic-volume-solids .is-box {
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.34), rgba(14, 165, 233, 0.16));
}

.cours-generic-volume-solids .is-cylinder {
  border-radius: 999px / 32px;
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.14), rgba(45, 212, 191, 0.34), rgba(14, 165, 233, 0.14));
}

.cours-generic-volume-solids .is-sphere {
  border-radius: 999px;
  background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.36), rgba(168, 85, 247, 0.36) 42%, rgba(59, 130, 246, 0.18));
}

.cours-generic-volume-cube,
.cours-generic-volume-box {
  position: relative;
  width: 8rem;
  height: 5.8rem;
  margin: 1.15rem 0 1.35rem;
  border-radius: 12px;
  border: 2px solid rgba(125, 211, 252, 0.58);
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.26), rgba(99, 102, 241, 0.18));
  box-shadow: 1rem -0.8rem 0 rgba(14, 165, 233, 0.13), 0 14px 28px rgba(0, 0, 0, 0.2);
}

.cours-generic-volume-cube::before,
.cours-generic-volume-box::before {
  content: "";
  position: absolute;
  inset: -0.78rem -1rem auto auto;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  border: 2px solid rgba(125, 211, 252, 0.34);
  pointer-events: none;
}

.cours-generic-volume-box {
  width: min(13rem, 76vw);
  height: 5.4rem;
}

.cours-generic-volume-cubes {
  display: grid;
  grid-template-columns: repeat(4, 2rem);
  gap: 5px;
  width: max-content;
  margin: 0.9rem 0 1rem;
  padding: 0.5rem;
  border-radius: 13px;
  border: 1px solid rgba(125, 211, 252, 0.34);
  background: rgba(15, 23, 42, 0.54);
}

.cours-generic-volume-cubes span {
  display: block;
  width: 2rem;
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px solid rgba(125, 211, 252, 0.46);
  background: linear-gradient(145deg, #38bdf8, #6366f1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cours-generic-time-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.75rem;
  margin: 0.85rem 0 1rem;
}

.cours-generic-time-tiles span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.4rem;
  padding: 0.6rem;
  border-radius: 14px;
  border: 1px solid rgba(251, 191, 36, 0.34);
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.14), rgba(99, 102, 241, 0.16));
  color: #fef3c7;
  font-weight: 850;
  text-align: center;
}

.cours-generic-clock {
  position: relative;
  width: 8.5rem;
  aspect-ratio: 1;
  margin: 0.9rem 0 1rem;
  border-radius: 50%;
  border: 4px solid rgba(125, 211, 252, 0.72);
  background:
    radial-gradient(circle at 50% 50%, #fbbf24 0 5px, transparent 6px),
    repeating-conic-gradient(from 0deg, rgba(226, 232, 240, 0.85) 0deg 2deg, transparent 2deg 30deg),
    radial-gradient(circle, rgba(15, 23, 42, 0.92) 0 64%, rgba(14, 165, 233, 0.2) 65% 100%);
  box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.08), 0 14px 28px rgba(0, 0, 0, 0.22);
}

.cours-generic-clock__hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 4px;
  border-radius: 999px;
  transform-origin: 50% 100%;
  background: #f8fafc;
}

.cours-generic-clock__hand--hour {
  height: 2.5rem;
  transform: translateX(-50%) rotate(255deg);
}

.cours-generic-clock__hand--minute {
  height: 3.4rem;
  transform: translateX(-50%) rotate(180deg);
  background: #fbbf24;
}

.cours-generic-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1.65rem);
  gap: 4px;
  width: max-content;
  margin: 0.85rem 0 1rem;
  padding: 0.65rem;
  border-radius: 14px;
  border: 1px solid rgba(125, 211, 252, 0.35);
  background: rgba(15, 23, 42, 0.55);
}

.cours-generic-calendar span {
  display: block;
  width: 1.65rem;
  aspect-ratio: 1;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.cours-generic-calendar .is-marked {
  background: linear-gradient(145deg, #fbbf24, #f97316);
  border-color: rgba(251, 191, 36, 0.6);
}


.cours-generic-geometry-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.75rem;
  margin: 0.85rem 0 1rem;
}

.cours-generic-geometry-tiles span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.4rem;
  padding: 0.6rem;
  border-radius: 14px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.2), rgba(14, 165, 233, 0.12));
  color: #f8fafc;
  font-weight: 850;
  text-align: center;
}

.cours-generic-segment-demo {
  display: grid;
  grid-template-columns: auto minmax(8rem, 14rem) auto;
  align-items: center;
  gap: 0.6rem;
  width: fit-content;
  margin: 0.85rem 0 1rem;
  color: #f8fafc;
  font-weight: 900;
}

.cours-generic-segment-demo i {
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #38bdf8, #fbbf24);
  position: relative;
}

.cours-generic-segment-demo i::before,
.cours-generic-segment-demo i::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0.7rem;
  aspect-ratio: 1;
  border-radius: 999px;
  background: #fbbf24;
  transform: translateY(-50%);
}

.cours-generic-segment-demo i::before {
  left: -0.35rem;
}

.cours-generic-segment-demo i::after {
  right: -0.35rem;
}

.cours-generic-geo-circle {
  width: 9rem;
  aspect-ratio: 1;
  margin: 0.85rem 0 1rem;
  border-radius: 50%;
  border: 3px solid rgba(56, 189, 248, 0.82);
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(251, 191, 36, 0.95) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    radial-gradient(circle at 50% 50%, #fbbf24 0 5px, transparent 6px),
    rgba(14, 165, 233, 0.08);
  box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.08), 0 12px 26px rgba(0, 0, 0, 0.2);
}

.cours-generic-symmetry-demo {
  position: relative;
  width: min(16rem, 82vw);
  height: 7rem;
  margin: 0.9rem 0 1rem;
  border-radius: 14px;
  border: 1px solid rgba(125, 211, 252, 0.32);
  background: rgba(15, 23, 42, 0.48);
  overflow: hidden;
}

.cours-generic-symmetry-demo::before {
  content: "";
  position: absolute;
  inset: 0 50% 0 auto;
  width: 2px;
  background: linear-gradient(180deg, transparent, #fbbf24, transparent);
}

.cours-generic-symmetry-demo::after {
  content: "";
  position: absolute;
  top: 1.7rem;
  left: 2.2rem;
  width: 3.6rem;
  height: 3.6rem;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: linear-gradient(145deg, #38bdf8, #6366f1);
  filter: drop-shadow(7.9rem 0 0 rgba(56, 189, 248, 0.72));
}


.cours-generic-space-dimensions,
.cours-generic-views-demo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.75rem;
  margin: 0.85rem 0 1rem;
}

.cours-generic-space-dimensions span,
.cours-generic-views-demo span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.4rem;
  padding: 0.6rem;
  border-radius: 14px;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: linear-gradient(145deg, rgba(45, 212, 191, 0.16), rgba(99, 102, 241, 0.16));
  color: #ecfeff;
  font-weight: 850;
  text-align: center;
}

.cours-generic-views-demo span:nth-child(1) {
  border-radius: 10px;
}

.cours-generic-views-demo span:nth-child(2) {
  transform: skewX(-12deg);
}

.cours-generic-views-demo span:nth-child(3) {
  min-height: 4.4rem;
  max-width: 5rem;
}


.cours-generic-data-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.75rem;
  margin: 0.85rem 0 1rem;
}

.cours-generic-data-tiles span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.4rem;
  padding: 0.6rem;
  border-radius: 14px;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: linear-gradient(145deg, rgba(45, 212, 191, 0.16), rgba(14, 165, 233, 0.12));
  color: #ecfeff;
  font-weight: 850;
  text-align: center;
}

.cours-generic-bar-chart {
  display: grid;
  grid-template-columns: repeat(3, 4.5rem);
  align-items: end;
  gap: 0.75rem;
  height: 9rem;
  width: max-content;
  margin: 0.9rem 0 1rem;
  padding: 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(125, 211, 252, 0.35);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.3), rgba(15, 23, 42, 0.68));
}

.cours-generic-bar-chart span {
  display: flex;
  align-items: end;
  justify-content: center;
  height: var(--bar-h);
  min-height: 2.1rem;
  padding: 0.35rem;
  border-radius: 10px 10px 6px 6px;
  background: linear-gradient(180deg, #38bdf8, #6366f1);
  color: #f8fafc;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.cours-generic-pie-chart {
  width: 9rem;
  aspect-ratio: 1;
  margin: 0.9rem 0 1rem;
  border-radius: 50%;
  border: 3px solid rgba(226, 232, 240, 0.28);
  background: conic-gradient(#38bdf8 0 50%, #fbbf24 50% 75%, #a78bfa 75% 100%);
  box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.08), 0 14px 28px rgba(0, 0, 0, 0.22);
}

.cours-generic-line-chart {
  width: min(18rem, 86vw);
  height: 9rem;
  margin: 0.9rem 0 1rem;
  border-radius: 14px;
  border: 1px solid rgba(125, 211, 252, 0.35);
  background:
    linear-gradient(135deg, transparent 15%, #38bdf8 15% 16.5%, transparent 16.5% 34%, #38bdf8 34% 35.5%, transparent 35.5% 56%, #38bdf8 56% 57.5%, transparent 57.5% 78%, #38bdf8 78% 79.5%, transparent 79.5%),
    linear-gradient(90deg, rgba(148, 163, 184, 0.16) 1px, transparent 1px),
    linear-gradient(0deg, rgba(148, 163, 184, 0.16) 1px, transparent 1px),
    rgba(15, 23, 42, 0.55);
  background-size: 100% 100%, 20% 100%, 100% 25%, 100% 100%;
}


.cours-generic-probability-tiles,
.cours-generic-dice-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr));
  gap: 0.75rem;
  margin: 0.85rem 0 1rem;
}

.cours-generic-probability-tiles span,
.cours-generic-dice-row span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.4rem;
  padding: 0.6rem;
  border-radius: 14px;
  border: 1px solid rgba(251, 191, 36, 0.36);
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.16), rgba(99, 102, 241, 0.14));
  color: #fef3c7;
  font-weight: 850;
  text-align: center;
}

.cours-generic-dice-row span {
  min-height: 3rem;
  max-width: 3.5rem;
  aspect-ratio: 1;
  border-radius: 12px;
  background: linear-gradient(145deg, #f8fafc, #bae6fd);
  color: #0f172a;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

.cours-generic-probability-scale {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(20rem, 100%);
  margin: 0.9rem 0 1rem;
  padding-top: 1rem;
  border-top: 8px solid;
  border-image: linear-gradient(90deg, #ef4444, #fbbf24, #22c55e) 1;
  color: #f8fafc;
  font-weight: 900;
}


.cours-generic-proportional-flow {
  display: grid;
  grid-template-columns: minmax(5rem, 1fr) auto minmax(5rem, 1fr);
  align-items: center;
  gap: 0.75rem;
  width: min(24rem, 100%);
  margin: 0.9rem 0 1rem;
}

.cours-generic-proportional-flow span,
.cours-generic-proportional-flow strong {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: 0.55rem;
  border-radius: 14px;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: linear-gradient(145deg, rgba(45, 212, 191, 0.16), rgba(14, 165, 233, 0.12));
  color: #ecfeff !important;
  font-weight: 900;
  text-align: center;
}

.cours-generic-proportional-flow strong {
  min-width: 4rem;
  border-color: rgba(251, 191, 36, 0.4);
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.16), rgba(249, 115, 22, 0.12));
}


.cours-generic-code-tiles,
.cours-generic-code-steps,
.cours-generic-io-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.75rem;
  margin: 0.85rem 0 1rem;
}

.cours-generic-code-tiles span,
.cours-generic-code-steps span,
.cours-generic-io-grid article {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.3rem;
  padding: 0.65rem;
  border-radius: 14px;
  border: 1px solid rgba(99, 102, 241, 0.38);
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.18), rgba(14, 165, 233, 0.12));
  color: #f8fafc;
  font-weight: 850;
  text-align: center;
}

.cours-generic-code-steps {
  counter-reset: code-step;
}

.cours-generic-code-steps span::before {
  counter-increment: code-step;
  content: counter(code-step) ". ";
  color: #fbbf24;
  font-weight: 900;
  margin-right: 0.25rem;
}

.cours-generic-io-grid article {
  display: block;
  min-height: auto;
}

.cours-generic-io-grid h3 {
  margin: 0 0 0.35rem;
  color: #fef3c7;
}

.cours-generic-io-grid p {
  margin: 0;
}

.cours-generic-place-value {
  display: grid;
  grid-template-columns: repeat(4, minmax(4.3rem, 1fr)) auto repeat(3, minmax(4.3rem, 1fr));
  gap: 0.35rem;
  align-items: stretch;
  margin: 0.7rem 0 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
}

.cours-generic-place-value span:not(.is-comma) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 4.2rem;
  padding: 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(71, 85, 105, 0.55);
  background: rgba(15, 23, 42, 0.58);
}

.cours-generic-place-value span:nth-child(1):not(.is-comma) {
  border-color: rgba(168, 85, 247, 0.5);
  background: rgba(88, 28, 135, 0.28);
}

.cours-generic-place-value span:nth-child(2):not(.is-comma) {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(30, 64, 175, 0.26);
}

.cours-generic-place-value span:nth-child(3):not(.is-comma) {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(22, 101, 52, 0.26);
}

.cours-generic-place-value .is-unit {
  border-color: rgba(251, 191, 36, 0.62);
  background: rgba(146, 64, 14, 0.3);
}

.cours-generic-place-value span:nth-child(6):not(.is-comma) {
  border-color: rgba(236, 72, 153, 0.52);
  background: rgba(157, 23, 77, 0.26);
}

.cours-generic-place-value span:nth-child(7):not(.is-comma) {
  border-color: rgba(249, 115, 22, 0.52);
  background: rgba(154, 52, 18, 0.26);
}

.cours-generic-place-value span:nth-child(8):not(.is-comma) {
  border-color: rgba(16, 185, 129, 0.52);
  background: rgba(6, 95, 70, 0.26);
}

.cours-generic-place-value strong {
  font-size: 1.35rem;
  color: #f8fafc;
  line-height: 1;
}

.cours-generic-place-value em {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  font-style: normal;
  color: #94a3b8;
}

.cours-generic-place-value .is-comma {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  font-weight: 800;
  color: #67e8f9;
}

.cours-generic-split-number {
  display: inline-flex;
  align-items: stretch;
  gap: 0.35rem;
  margin: 0.45rem 0 0.75rem;
  padding: 0.45rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(71, 85, 105, 0.55);
}

.cours-generic-split-number__part {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 5.4rem;
  padding: 0.55rem 0.7rem;
  border-radius: 9px;
  background: rgba(30, 41, 59, 0.72);
}

.cours-generic-split-number__part:first-child {
  border: 1px solid rgba(56, 189, 248, 0.42);
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.22), rgba(30, 41, 59, 0.72));
}

.cours-generic-split-number__part:last-child {
  border: 1px solid rgba(236, 72, 153, 0.42);
  background: linear-gradient(145deg, rgba(236, 72, 153, 0.18), rgba(30, 41, 59, 0.72));
}

.cours-generic-split-number__part strong {
  font-size: 1.35rem;
  color: #f8fafc;
  line-height: 1;
}

.cours-generic-split-number__part em {
  margin-top: 0.28rem;
  font-size: 0.72rem;
  font-style: normal;
  color: #94a3b8;
}

.cours-generic-split-number__comma {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 900;
  color: #67e8f9;
}

.cours-generic-two-cols {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 720px) {
  .cours-generic-two-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cours-generic-two-cols > div {
  padding: 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(71, 85, 105, 0.55);
  background: rgba(15, 23, 42, 0.42);
}

.cours-generic-two-cols > div:first-child {
  border-color: rgba(236, 72, 153, 0.38);
  background: linear-gradient(145deg, rgba(236, 72, 153, 0.13), rgba(15, 23, 42, 0.46));
}

.cours-generic-two-cols > div:last-child {
  border-color: rgba(34, 211, 238, 0.38);
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.12), rgba(15, 23, 42, 0.46));
}

.cours-generic-bars {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 0.18rem;
}

.cours-generic-bars span,
.cours-generic-hundred-grid span {
  display: block;
  border-radius: 3px;
  background: rgba(71, 85, 105, 0.72);
}

.cours-generic-bars span {
  height: 1.8rem;
}

.cours-generic-bars span.is-active,
.cours-generic-hundred-grid span.is-active {
  background: linear-gradient(145deg, #67e8f9, #6366f1);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.3);
}

.cours-generic-hundred-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.14rem;
}

.cours-generic-hundred-grid span {
  aspect-ratio: 1;
}

.cours-generic-card--tip {
  border-color: rgba(251, 191, 36, 0.34);
  background:
    radial-gradient(90% 100% at 100% 0%, rgba(251, 191, 36, 0.18), transparent 56%),
    linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(15, 23, 42, 0.5));
}

:is(#generique-cours-decimaux, #generique-cours-grands-nombres, #generique-cours-nombres-decimaux, #generique-cours-demi-droite-decimaux) .cours-generic-card--intro > h3::before {
  counter-increment: none;
  content: "6e";
  width: 2.15rem;
  background: linear-gradient(145deg, #86efac, #67e8f9);
}

.cours-generic-operation {
  margin: 0.75rem 0 0;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(125, 211, 252, 0.34);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.86), rgba(30, 41, 59, 0.7)),
    radial-gradient(90% 120% at 100% 0%, rgba(34, 211, 238, 0.12), transparent 60%);
  color: #e0f2fe;
  font: 800 0.98rem/1.35 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.cours-generic-direction {
  display: grid;
  gap: 0.6rem;
}

@media (min-width: 720px) {
  .cours-generic-direction {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cours-generic-direction p {
  margin: 0;
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.48);
  border: 1px solid rgba(71, 85, 105, 0.45);
}

.cours-generic-direction--remember {
  margin-top: 0.85rem;
}

.cours-generic-direction--remember p {
  border-color: rgba(251, 191, 36, 0.34);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(15, 23, 42, 0.5));
}

.cours-generic-exercises {
  display: grid;
  gap: 0.75rem;
  counter-reset: cours-generic-exo;
}

.cours-generic-exercises article {
  position: relative;
  padding: 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  background:
    radial-gradient(110% 120% at 100% 0%, rgba(34, 211, 238, 0.12), transparent 52%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.72), rgba(30, 41, 59, 0.5));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 12px 28px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.cours-generic-exercises article::before {
  counter-increment: cours-generic-exo;
  content: counter(cours-generic-exo);
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 900;
  background: linear-gradient(145deg, #fef3c7, #67e8f9);
}

.cours-generic-exercises article:nth-child(3n + 1) {
  border-color: rgba(56, 189, 248, 0.36);
}

.cours-generic-exercises article:nth-child(3n + 2) {
  border-color: rgba(167, 139, 250, 0.36);
  background:
    radial-gradient(110% 120% at 100% 0%, rgba(167, 139, 250, 0.14), transparent 52%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.72), rgba(30, 41, 59, 0.5));
}

.cours-generic-exercises article:nth-child(3n) {
  border-color: rgba(251, 146, 60, 0.36);
  background:
    radial-gradient(110% 120% at 100% 0%, rgba(251, 146, 60, 0.14), transparent 52%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.72), rgba(30, 41, 59, 0.5));
}

.cours-generic-exercises h3 {
  padding-right: 2.1rem;
  color: #f8fafc;
}

.cours-generic-exercises ol,
.cours-generic-exercises ul {
  margin: 0.4rem 0 0;
  padding-left: 1.25rem;
  color: #cbd5e1;
  font-size: 0.88rem;
  line-height: 1.58;
}

.cours-generic-exercises li::marker {
  color: #fbbf24;
}

.cours-generic-card--summary {
  border-color: rgba(34, 197, 94, 0.36);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(15, 23, 42, 0.5));
}

.cours-generic-big-number-table {
  min-width: 760px;
}

.cours-generic-big-number-table tbody tr:last-child td {
  font-size: 1.15rem;
  font-weight: 900;
  color: #fef3c7;
}

.cours-generic-number-compare {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.cours-generic-number-compare p {
  margin: 0;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(71, 85, 105, 0.45);
  background: rgba(15, 23, 42, 0.46);
}

.cours-generic-number-compare span {
  display: inline-block;
  min-width: 8rem;
  margin-right: 0.5rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.cours-generic-number-compare .is-wrong {
  color: #fca5a5;
}

.cours-generic-number-compare .is-correct {
  color: #86efac;
}

.cours-generic-memo__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(99, 102, 241, 0.35);
}

.cours-generic-memo__head .cours-generic-panel__title {
  margin: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.cours-generic-memo__nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cours-generic-memo__button {
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.44);
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.26), rgba(14, 165, 233, 0.2));
  color: #f5f3ff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
}

.cours-generic-memo__button:disabled {
  opacity: 0.45;
  cursor: default;
}

.cours-generic-memo__figure {
  margin: 0;
}

.cours-generic-memo__figure[hidden] {
  display: none;
}

.cours-generic-memo__image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(71, 85, 105, 0.55);
  background: #fff;
}

.cours-generic-card.cours-generic-memo .cours-generic-memo__image + .cours-generic-memo__image {
  margin-top: 1.25rem;
}

@media (max-width: 640px) {
  .cours-generic-memo__head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.cours-generic-card--soon {
  border-style: dashed;
  color: var(--muted);
}

.cours-generic-evaluation__head {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}

.cours-generic-evaluation__status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
  align-items: stretch;
}

.cours-generic-evaluation__head .cours-generic-panel__title {
  margin-bottom: 0.45rem;
}

.cours-generic-score,
.cours-generic-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 9rem;
  padding: 0.7rem 0.95rem;
  border-radius: 14px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 10px 26px rgba(0, 0, 0, 0.18);
}

.cours-generic-score {
  border: 1px solid rgba(125, 211, 252, 0.46);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(34, 211, 238, 0.24), transparent 52%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.86), rgba(30, 41, 59, 0.74));
  color: #e0f2fe;
}

.cours-generic-level {
  border: 1px solid rgba(251, 191, 36, 0.42);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(251, 191, 36, 0.24), transparent 52%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.86), rgba(30, 41, 59, 0.74));
  color: #fde68a;
}

.cours-generic-progress {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  background: rgba(14, 165, 233, 0.12);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #bfdbfe;
}

.cours-generic-question {
  margin: 0 0 0.8rem;
  padding: 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(34, 211, 238, 0.12), transparent 54%),
    rgba(15, 23, 42, 0.54);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 14px 34px rgba(0, 0, 0, 0.16);
}

.cours-generic-question:last-child {
  margin-bottom: 0;
}

.cours-generic-question legend {
  padding: 0 0.25rem;
  font-size: 0.98rem;
  font-weight: 850;
  line-height: 1.4;
  color: #f8fafc;
}

.cours-generic-question label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.5rem 0 0;
  padding: 0.62rem 0.72rem;
  border-radius: 10px;
  border: 1px solid rgba(71, 85, 105, 0.58);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.58));
  color: #e2e8f0;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.cours-generic-question label:hover {
  border-color: rgba(125, 211, 252, 0.45);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(30, 41, 59, 0.72));
  transform: translateY(-1px);
}

.cours-generic-question input[type="radio"] {
  accent-color: #38bdf8;
}

.cours-generic-question.is-correct {
  border-color: rgba(74, 222, 128, 0.62);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(34, 197, 94, 0.18), transparent 54%),
    rgba(20, 83, 45, 0.18);
}

.cours-generic-question.is-wrong {
  border-color: rgba(248, 113, 113, 0.62);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(248, 113, 113, 0.16), transparent 54%),
    rgba(127, 29, 29, 0.18);
}

.cours-generic-question.is-wrong label.is-correct-answer {
  border-color: rgba(74, 222, 128, 0.72);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.24), rgba(20, 83, 45, 0.28));
  color: #dcfce7;
}

.cours-generic-feedback {
  min-height: 1.4rem;
  margin: 0.8rem 0 0;
  font-size: 0.88rem;
  font-weight: 750;
}

.cours-generic-feedback.is-correct {
  color: #86efac;
}

.cours-generic-feedback.is-wrong {
  color: #fca5a5;
}

.cours-generic-next {
  margin-top: 0.8rem;
  padding: 0.62rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.42);
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.58), rgba(99, 102, 241, 0.46));
  color: #ecfeff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.18);
}

.cours-generic-next:disabled {
  opacity: 0.45;
  cursor: default;
}

@media (max-width: 720px) {
  .cours-generic-sidebar {
    position: static;
  }

  .cours-generic-place-value {
    grid-template-columns: repeat(7, minmax(4.25rem, 1fr));
  }
}

/* Cherchons ensemble — chapitre 1 */
.page-cours-cherchons-ch1 .cherchons-main {
  max-width: 100%;
}

.cherchons-ch1 {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.cherchons-lead {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: rgba(15, 23, 42, 0.35);
  font-size: 0.9rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.cherchons-obj {
  scroll-margin-top: 1rem;
  padding: 0;
}

.cherchons-obj__title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.cherchons-act {
  margin-bottom: 1.35rem;
  padding: 1rem 1.1rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(71, 85, 105, 0.5);
  background: rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.cherchons-act:last-child {
  margin-bottom: 0;
}

.cherchons-act__title {
  margin: 0 0 0.65rem;
  font-size: 0.98rem;
  font-weight: 750;
  color: #e2e8f0;
}

.cherchons-act__fig {
  margin: 0 -1.1rem 0.9rem;
  width: calc(100% + 2.2rem);
  max-width: none;
  border-radius: 0;
  overflow: hidden;
  border: none;
  border-bottom: 1px solid rgba(71, 85, 105, 0.45);
  background: rgba(15, 23, 42, 0.45);
  box-shadow: none;
}

.cherchons-act__media {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  line-height: 0;
  box-sizing: border-box;
  background: transparent;
}

.cherchons-act__media img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  /* Ratio intrinsèque conservé : pas de crop CSS, pas d’étirement */
}

.cherchons-act__cap {
  margin: 0;
  padding: 0.45rem 1.1rem;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
  background: rgba(15, 23, 42, 0.75);
  border-top: 1px solid rgba(51, 65, 85, 0.55);
}

.cherchons-act p {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  line-height: 1.58;
  color: #cbd5e1;
}

.cherchons-tag {
  margin: 1rem 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a5b4fc;
}

.cherchons-ol {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.cherchons-ol li {
  margin-bottom: 0.35rem;
}

.cherchons-note {
  margin: 0.5rem 0 0.65rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
  color: #94a3b8;
  border-left: 3px solid rgba(56, 189, 248, 0.45);
  background: rgba(30, 41, 59, 0.4);
}

.cherchons-note--compact {
  margin-top: 0.35rem;
  margin-bottom: 0.75rem;
  font-size: 0.76rem;
}

.cherchons-regle {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #e2e8f0;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(99, 102, 241, 0.14));
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 10px;
}

/* Exercice : données à gauche, visuel carré à droite, énoncé en dessous */
.cherchons-exo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 38%);
  gap: 1rem 1.25rem;
  align-items: start;
  margin: 0.6rem 0 1rem;
}

.cherchons-exo-layout__data {
  min-width: 0;
}

.cherchons-table-wrap--exo-split {
  margin: 0;
}

.cherchons-note--in-exo-split {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.cherchons-exo-layout__fig {
  margin: 0;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(71, 85, 105, 0.55);
  /* Transparence PNG visible (fond = carte / page) */
  background: transparent;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.cherchons-exo-layout__media {
  display: block;
  width: 100%;
  line-height: 0;
  background: transparent;
}

.cherchons-exo-layout__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

@media (max-width: 720px) {
  .cherchons-exo-layout {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .cherchons-exo-layout__fig {
    max-width: 360px;
    margin-inline: auto;
    width: 100%;
  }
}

.cherchons-cible-official {
  margin: 0.85rem auto 1rem;
  max-width: 22rem;
  text-align: center;
}

.cherchons-cible-official--after-banner {
  margin-top: 0.5rem;
}

.cherchons-cible-official picture {
  display: inline-block;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(125, 211, 252, 0.4);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 16px 40px rgba(0, 0, 0, 0.45);
  line-height: 0;
}

.cherchons-cible-official img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

.cherchons-cible-official__cap {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}

.cherchons-table-wrap--points {
  margin-top: 0.15rem;
  margin-bottom: 0.5rem;
}

.cherchons-table--points .cherchons-couleur-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cherchons-table--points .cherchons-swatch {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35) inset,
    0 1px 3px rgba(0, 0, 0, 0.35);
}

.cherchons-table--points .cherchons-swatch--jaune {
  background: linear-gradient(145deg, #fde047, #ca8a04);
}

.cherchons-table--points .cherchons-swatch--rouge {
  background: linear-gradient(145deg, #f87171, #b91c1c);
}

.cherchons-table--points .cherchons-swatch--vert {
  background: linear-gradient(145deg, #4ade80, #15803d);
}

.cherchons-table--points .cherchons-swatch--noir {
  background: linear-gradient(145deg, #475569, #020617);
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 1px 3px rgba(0, 0, 0, 0.45);
}

.cherchons-table--points .cherchons-swatch--bleu {
  background: linear-gradient(145deg, #7dd3fc, #0369a1);
}

.cherchons-table--points .cherchons-swatch--blanc {
  background: #f8fafc;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.35) inset,
    0 0 0 1px rgba(148, 163, 184, 0.75);
}

.cherchons-table--points .cherchons-points-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  border-left: 3px solid transparent;
}

.cherchons-table--points .cherchons-points-cell--jaune {
  background: rgba(234, 179, 8, 0.14);
  border-left-color: #eab308;
  color: #fef9c3;
}

.cherchons-table--points .cherchons-points-cell--rouge {
  background: rgba(220, 38, 38, 0.14);
  border-left-color: #ef4444;
  color: #fecaca;
}

.cherchons-table--points .cherchons-points-cell--vert {
  background: rgba(22, 163, 74, 0.14);
  border-left-color: #22c55e;
  color: #bbf7d0;
}

.cherchons-table--points .cherchons-points-cell--noir {
  background: rgba(51, 65, 85, 0.35);
  border-left-color: #64748b;
  color: #e2e8f0;
}

.cherchons-table--points .cherchons-points-cell--bleu {
  background: rgba(14, 165, 233, 0.14);
  border-left-color: #38bdf8;
  color: #e0f2fe;
}

.cherchons-table--points .cherchons-points-cell--blanc {
  background: rgba(248, 250, 252, 0.1);
  border-left-color: #cbd5e1;
  color: #f8fafc;
}

.cherchons-table-wrap {
  overflow-x: auto;
  margin: 0.65rem 0;
  border-radius: 10px;
  border: 1px solid rgba(71, 85, 105, 0.55);
}

.cherchons-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #e2e8f0;
}

.cherchons-table th,
.cherchons-table td {
  padding: 0.45rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid rgba(51, 65, 85, 0.65);
}

.cherchons-table th {
  background: rgba(30, 41, 59, 0.85);
  font-weight: 700;
  color: #f1f5f9;
}

.cherchons-table tbody tr:last-child th,
.cherchons-table tbody tr:last-child td {
  border-bottom: none;
}

.cherchons-math {
  white-space: nowrap;
}

.cherchons-frac {
  font-style: italic;
  color: #bae6fd;
}

.cherchons-cible {
  margin: 0.75rem 0;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.4);
}

.cherchons-cible__rings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.cherchons-cible__z {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: 0.32rem 0.5rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #0f172a;
}

.cherchons-cible__z--jaune { background: #facc15; }
.cherchons-cible__z--rouge { background: #ef4444; color: #fff; }
.cherchons-cible__z--noir { background: #1e293b; color: #f8fafc; border: 1px solid #475569; }
.cherchons-cible__z--vert { background: #22c55e; color: #052e16; }
.cherchons-cible__z--bleu { background: #3b82f6; color: #fff; }
.cherchons-cible__z--blanc {
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #94a3b8;
}

.cherchons-cible__cap {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}

.page-cours-bientot .cours-bientot-main {
  margin: 0 0 2rem;
}

.cours-bientot-card {
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.18);
}

.cours-bientot-card__meta {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  color: #e2e8f0;
  line-height: 1.5;
}

.cours-bientot-card__text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Leçon « Cours » (HTML structuré, ch. 1) */
.cours-lecon {
  margin: 0;
  padding: 0;
}

.cours-lecon__main-title {
  margin: 0 0 1.1rem;
  font-size: 1.02rem;
  font-weight: 800;
  color: #f1f5f9;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.cours-lecon__obj-heading {
  margin: 0 0 1rem;
  font-size: 0.98rem;
  font-weight: 800;
  color: #e0e7ff;
  line-height: 1.35;
  letter-spacing: -0.02em;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(99, 102, 241, 0.35);
}

.cours-lecon__suite {
  height: 0;
  margin: 2rem 0;
  border: none;
  border-top: 2px solid rgba(99, 102, 241, 0.45);
}

.cours-lecon__ex-block {
  margin: 0.5rem 0 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 2px solid rgba(56, 189, 248, 0.4);
  background: rgba(14, 116, 144, 0.1);
}

.cours-lecon__ex-block > :last-child {
  margin-bottom: 0;
}

.cours-lecon__ex-intro {
  margin: 0 0 0.65rem;
  font-size: 0.86rem;
  color: #94a3b8;
  line-height: 1.5;
}

.cours-lecon__list--tight {
  margin-top: 0.25rem;
}

.cours-lecon__list--tight li {
  margin-bottom: 0.45rem;
}

.cours-lecon__table--encadre th,
.cours-lecon__table--encadre td {
  font-size: 0.78rem;
  line-height: 1.35;
  vertical-align: middle;
}

.cours-lecon__figure {
  margin: 0 0 1.35rem;
  padding: 0;
}

.cours-lecon__figure--intro {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(71, 85, 105, 0.55);
  /* Pas de fond : les PNG à transparence s’affichent sur le fond de la page */
  background: transparent;
  line-height: 0;
}

.cours-lecon__intro-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.cours-lecon__section {
  margin: 0 0 1.5rem;
  padding: 0 0 1.25rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.55);
}

.cours-lecon__section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.cours-lecon__h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 750;
  color: #e0e7ff;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cours-lecon__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0 0.35rem;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.82rem;
  color: #0f172a;
  background: linear-gradient(145deg, #7dd3fc, #6366f1);
}

.cours-lecon__section p {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  line-height: 1.58;
  color: #cbd5e1;
}

.cours-lecon__section p:last-child {
  margin-bottom: 0;
}

.cours-lecon__def {
  margin: 0.65rem 0 0.9rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.08));
}

.cours-lecon__def-label {
  margin: 0 0 0.4rem !important;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fcd34d !important;
}

.cours-lecon__def p:last-child {
  margin-bottom: 0 !important;
}

.cours-lecon__rmq {
  margin: 0.75rem 0;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(14, 116, 144, 0.12);
}

.cours-lecon__rmq-label {
  margin: 0 0 0.4rem !important;
  font-size: 0.72rem;
  font-weight: 800;
  color: #7dd3fc !important;
}

.cours-lecon__ex-label {
  margin: 0.85rem 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
}

.cours-lecon__ex-label:first-child {
  margin-top: 0;
}

.cours-lecon__list {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.cours-lecon__list li {
  margin-bottom: 0.35rem;
}

.cours-lecon__formula,
.cours-lecon__decomp {
  margin: 0.5rem 0 !important;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  color: #e2e8f0 !important;
}

.cours-lecon__frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin: 0 0.15rem;
  font-size: 0.85em;
}

.cours-lecon__frac-num {
  border-bottom: 1px solid currentColor;
  padding: 0 0.2rem 0.05rem;
  line-height: 1.1;
}

.cours-lecon__frac-den {
  padding-top: 0.1rem;
  line-height: 1.1;
}

.cours-lecon__frac--inline {
  margin: 0 0.12rem;
}

/* Séquences d’exercices (automatismes) — même ambiance que .cours-lecon */
.cours-auto-page .cours-auto__intro {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #cbd5e1;
}
.cours-auto__block {
  margin: 1.35rem 0 1.75rem;
  padding: 0;
  border: none;
  border-top: 1px solid rgba(71, 85, 105, 0.45);
  padding-top: 1.25rem;
}
.cours-auto__block:first-of-type {
  border-top: none;
  padding-top: 0;
}
.cours-auto__h3 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: #f8fafc;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: linear-gradient(105deg, rgba(34, 197, 94, 0.22), rgba(59, 130, 246, 0.14));
  border: 1px solid rgba(34, 197, 94, 0.32);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}
.cours-auto__exo {
  margin: 0 0 1.1rem;
  padding: 0.75rem 0.85rem 0.95rem;
  border-radius: 10px;
  border: 1px solid rgba(51, 65, 85, 0.65);
  background: rgba(15, 23, 42, 0.45);
}
/* En-tête commun : pastille numéro + étiquette (Exercice / Automatismes / …) */
.cours-auto__exo-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin: 0 0 0.15rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(71, 85, 105, 0.45);
}
.cours-auto__exo-num-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  height: 2.35rem;
  padding: 0 0.35rem;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #f8fafc;
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.32), rgba(59, 130, 246, 0.22));
  border: 1px solid rgba(34, 197, 94, 0.38);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}
.cours-auto__exo-num-wrap--label {
  min-width: unset;
  height: auto;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 750;
  text-transform: none;
  letter-spacing: 0;
}
.cours-auto__exo-head .cours-auto__exo-num {
  margin: 0;
  font: inherit;
  color: inherit;
}
.cours-auto__pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.02em;
  border-radius: 7px;
  line-height: 1.3;
}
.cours-auto__pill--accent {
  background: rgba(34, 197, 94, 0.22);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.38);
}
.cours-auto__pill--soft {
  background: rgba(99, 102, 241, 0.22);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.42);
}
.cours-auto__pill--neutral {
  background: rgba(71, 85, 105, 0.45);
  color: #e2e8f0;
  border: 1px solid rgba(100, 116, 139, 0.55);
}
.cours-auto__exo-desc {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #e2e8f0;
}
.cours-auto__exo-head + .cours-auto__exo-desc {
  margin-top: 0.55rem;
}
.cours-auto__exo-head + .cours-auto__ol {
  margin-top: 0.55rem;
}
.cours-auto__exo-note {
  margin: 0.5rem 0 0.15rem;
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}
.cours-auto__ol {
  margin: 0.35rem 0 0;
  padding-left: 1.35rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #cbd5e1;
}
.cours-auto__ol li {
  margin-bottom: 0.4rem;
}
.cours-auto__ol--nested {
  margin-top: 0.35rem;
}
.cours-auto__list {
  margin: 0.35rem 0 0.65rem;
  padding-left: 1.2rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #cbd5e1;
}
.cours-auto__list li {
  margin-bottom: 0.35rem;
}
.cours-auto__list--stats {
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  columns: 1;
}
@media (min-width: 640px) {
  .cours-auto__list--stats {
    columns: 2;
    column-gap: 1.5rem;
  }
}
.cours-auto__wordgrid {
  margin: 0.65rem 0 0;
  border-collapse: collapse;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.65rem, 2.8vw, 0.85rem);
  letter-spacing: 0.08em;
  border: 1px solid rgba(71, 85, 105, 0.7);
  border-radius: 8px;
  overflow: hidden;
}
.cours-auto__wordgrid td {
  width: 1.8em;
  height: 1.8em;
  text-align: center;
  vertical-align: middle;
  border: 1px solid rgba(51, 65, 85, 0.55);
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.5);
}
.cours-auto__exo code {
  font-size: 0.85em;
  padding: 0.08rem 0.28rem;
  border-radius: 4px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(71, 85, 105, 0.55);
  color: #fde68a;
}
.cours-auto__more {
  margin-top: 1.25rem;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px dashed rgba(56, 189, 248, 0.35);
  font-size: 0.86rem;
  color: #bae6fd;
}
.cours-auto__more p {
  margin: 0;
}

.cours-lecon__muted {
  font-weight: 500;
  font-size: 0.88em;
  color: #94a3b8;
}

.cours-lecon__th-small {
  font-weight: 650;
  font-size: 0.72rem;
  line-height: 1.3;
}

.cours-lecon__table-wrap {
  overflow-x: auto;
  margin: 0.75rem 0;
  border-radius: 10px;
  border: 1px solid rgba(71, 85, 105, 0.55);
}

.cours-lecon__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  color: #e2e8f0;
}

.cours-lecon__table th,
.cours-lecon__table td {
  padding: 0.45rem 0.55rem;
  text-align: center;
  border: 1px solid rgba(51, 65, 85, 0.65);
}

.cours-lecon__table thead th {
  background: rgba(30, 41, 59, 0.85);
  font-weight: 700;
}

.cours-lecon__table tbody tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.35);
}

.cours-lecon__th-comma,
.cours-lecon__td-comma {
  width: 1.25rem;
  padding: 0.35rem 0.15rem !important;
  font-weight: 800;
  background: rgba(56, 189, 248, 0.12) !important;
}

.cours-lecon__numberline-wrap {
  margin: 0.85rem 0;
  padding: 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.4);
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
}

.cours-lecon__numberline {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

@media (max-width: 720px) {
  .cours-lecon__table {
    font-size: 0.76rem;
  }

  .cours-lecon__table th,
  .cours-lecon__table td {
    padding: 0.35rem 0.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cours-objectif__step-link:hover {
    transform: none;
  }
}

.cours-info-bloc {
  margin-bottom: 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(71, 85, 105, 0.45);
}

.cours-info-bloc:last-child {
  margin-bottom: 0;
}

.cours-info-bloc__title {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
}

.cours-info-bloc__list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.55;
}

@media (prefers-reduced-motion: reduce) {
  body.page-home .games-grid .game-card:not(.game-card--disabled),
  body.page-home .games-grid .game-card:not(.game-card--disabled):hover {
    transition: none;
    transform: none;
  }

  body.page-home .user-bar__signin-btn {
    transition: none;
  }

  body.page-home .user-bar__signin-btn:hover {
    transform: none;
  }
}

/* --- Pages jeu — mise en page + toolbar --- */
.game-page-with-lb {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.75rem);
  align-items: start;
}

@media (min-width: 1100px) {
  .game-page-with-lb:not(.game-page-with-lb--solo) {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  }
}

.game-page-with-lb__main {
  min-width: 0;
}

.game-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}

/* Picker + métadonnées regroupés : le bloc chrono/actions reste à droite sur une même ligne que cette zone (évite le passage du temps sous les cartes de niveau quand la barre est un peu étroite). */
.game-toolbar__primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  /* base 0 + grow : la colonne gauche prend le reste sans imposer une largeur max-content qui repousse le chrono */
  flex: 1 1 0;
  min-width: 0;
}

.game-toolbar__primary .diff-picker {
  /* Grandir pour occuper l’espace avant le chrono : cartes de niveau plus larges, moins de retours à la ligne. */
  flex: 1 1 400px;
  min-width: min(360px, 100%);
  max-width: 100%;
}

.game-toolbar .actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Module temps (type Briques) : chrono + actions — même largeur partout (--game-toolbar-time-width) */
.game-toolbar .game-toolbar__time-block,
.sudoku-toolbar .game-toolbar__time-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  margin-left: auto;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: min(var(--game-toolbar-time-width), 100%);
}

.game-toolbar .game-toolbar__time-block .actions,
.sudoku-toolbar .game-toolbar__time-block .actions {
  margin-left: 0;
  width: 100%;
}

.game-toolbar .game-toolbar__time-block .actions .btn,
.sudoku-toolbar .game-toolbar__time-block .actions .btn {
  width: 100%;
  justify-content: center;
}

.btn.briques-admin-fill {
  border-color: rgba(251, 191, 36, 0.4);
  color: #fcd34d;
  font-size: 0.86rem;
}

body.page-game .briques-chrono {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  width: 100%;
  margin: 0;
  padding: 0.48rem 0.75rem 0.52rem;
  border-radius: 11px;
  background:
    linear-gradient(165deg, rgba(15, 23, 42, 0.92) 0%, rgba(2, 6, 23, 0.96) 100%);
  border: 1px solid rgba(103, 232, 249, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 20px rgba(34, 211, 238, 0.06);
  box-sizing: border-box;
}

body.page-game .briques-chrono__label {
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.95);
}

body.page-game .briques-chrono__value {
  font-size: 1.42rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: #e0f2fe;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
  line-height: 1.1;
}

.meta {
  font-size: 0.92rem;
  color: var(--muted);
}

.meta strong {
  color: var(--text);
}

/* --- Calcul rapide + équations (carte jeu, équation mise en valeur) --- */
.calcul-toolbar-tail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  margin-left: auto;
}

.calcul-meta-round__hint {
  font-weight: 400;
  color: var(--muted);
}

body.page-equation .equation-shell .calcul-progress,
body.page-calcul .calcul-shell .calcul-progress,
body.page-reveil-mental .equation-shell .calcul-progress {
  margin-bottom: 0.65rem;
}

body.page-equation .equation-shell .equation-board-meta,
body.page-calcul .calcul-shell .calcul-board-meta,
body.page-reveil-mental .equation-shell .equation-board-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem 1.35rem;
  margin: 0 0 1.1rem;
  text-align: center;
}

body.page-calcul .game-center,
body.page-equation .game-center,
body.page-mathsixeme .game-center,
body.page-reveil-mental .game-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.page-calcul .calcul-shell,
body.page-equation .equation-shell,
body.page-mathsixeme .equation-shell,
body.page-reveil-mental .equation-shell {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 1.85rem);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background:
    radial-gradient(ellipse 92% 70% at 50% -5%, rgba(34, 211, 238, 0.1), transparent 52%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(6, 10, 20, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 52px rgba(0, 0, 0, 0.38);
}

.calcul-progress {
  margin: 0 0 1.35rem;
}

.calcul-progress__track {
  height: 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.calcul-progress__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0891b2, #7c3aed);
  transition: width 0.28s ease;
}

.calcul-progress__fill--done {
  background: linear-gradient(90deg, #34d399, #22d3ee);
}

.calcul-progress__fill--fail {
  background: linear-gradient(90deg, #f97316, #dc2626);
}

.calcul-prompt {
  margin: 0 0 1.35rem;
  padding: clamp(1rem, 2.8vw, 1.35rem) clamp(0.75rem, 2vw, 1rem);
  text-align: center;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.calcul-prompt-inner {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.2em 0.45em;
  max-width: 100%;
  font-size: clamp(1.45rem, 4.25vw + 0.55rem, 2.2rem);
  font-weight: 600;
  line-height: 1.35;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: 0.03em;
  color: var(--text);
}

.calcul-op {
  color: rgba(226, 232, 246, 0.58);
  font-weight: 500;
  font-size: 0.78em;
  padding: 0 0.12em;
  user-select: none;
}

.calcul-num {
  padding: 0.08em 0.04em;
  min-width: 1ch;
  text-align: center;
}

.calcul-hole {
  min-width: 2em;
  min-height: 1.45em;
  padding: 0.12em 0.42em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  border: 2px dashed rgba(34, 211, 238, 0.5);
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(0, 0, 0, 0.12);
}

.calcul-buffer-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0 0 1.05rem;
  padding: 0.72rem 1rem;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
  color: var(--muted);
}

.calcul-buffer-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.72rem;
  color: rgba(149, 163, 191, 0.88);
}

.calcul-buffer-strong {
  font-size: clamp(1.22rem, 3.2vw, 1.5rem);
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  min-width: 2ch;
  text-shadow: 0 0 28px rgba(34, 211, 238, 0.12);
}

.calcul-keys {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.calcul-key {
  min-height: 3rem;
  font-size: 1.08rem;
  font-weight: 700;
}

.calcul-key--wide {
  grid-column: span 2;
}

.calcul-send.btn {
  width: 100%;
}

.equation-prompt {
  margin: 0 0 1.35rem;
  padding: clamp(1rem, 2.8vw, 1.35rem) clamp(0.75rem, 2vw, 1rem);
  text-align: center;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.equation-prompt-inner {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.22em 0.45em;
  max-width: 100%;
  font-size: clamp(1.42rem, 4.1vw + 0.55rem, 2.05rem);
  font-weight: 600;
  line-height: 1.42;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: 0.025em;
  color: var(--text);
}

.reveil-mental-prompt-inner {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: 100%;
  font-size: clamp(1.1rem, 3.2vw + 0.45rem, 1.55rem);
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
}

.reveil-mental-prompt-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.15em 0.3em;
  margin: 0;
}

.reveil-mental-prompt-line--question {
  color: #fde047;
  font-size: 1.08em;
}

.reveil-mental-board-meta {
  margin-bottom: 1rem;
}

.reveil-mental-item {
  display: inline-flex;
  align-items: center;
  gap: 0.06em;
  vertical-align: middle;
}

.reveil-mental-item__qty {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.reveil-mental-item__icon {
  font-size: 1.55em;
  line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.reveil-mental-txt {
  white-space: pre;
}

.equation-xterm {
  display: inline-flex;
  align-items: baseline;
  gap: 0.06em;
}

.equation-op {
  color: rgba(226, 232, 246, 0.58);
  font-weight: 500;
  font-size: 0.78em;
  padding: 0 0.1em;
  user-select: none;
}

.equation-num {
  padding: 0.06em 0.03em;
  min-width: 1ch;
  text-align: center;
}

.equation-var {
  color: #c4b5fd;
  font-style: italic;
  font-weight: 750;
  padding: 0 0.04em;
}

/* QCM math 6e : énoncés parfois longs — bloc lisible (pas inline-flex équation structurée). */
.mathsix-prompt-text {
  display: block;
  margin: 0;
  width: 100%;
  max-width: 100%;
  text-align: center;
  font-size: clamp(1.18rem, 3.35vw + 0.52rem, 1.92rem);
  font-weight: 600;
  line-height: 1.42;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: 0.015em;
  color: var(--text);
  overflow-wrap: anywhere;
}

.equation-qcm-label {
  margin: 0 0 0.65rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.equation-qcm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.52rem;
}

.equation-choice {
  min-height: 2.9rem;
  font-size: 1.06rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* --- Sélecteur de difficulté --- */
.diff-picker__native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.diff-picker {
  flex: 1 1 280px;
  min-width: min(320px, 100%);
}

.diff-picker__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.diff-picker__legend {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.diff-picker__hint-global {
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.85;
}

.diff-picker__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.diff-picker__choice {
  cursor: pointer;
}

.diff-picker__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.diff-picker__card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  height: 100%;
  padding: 0.55rem 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

/* Non sélectionné : neutre (bordure / fond gris). Couleurs uniquement pour la carte active. */
.diff-picker__choice:not(.diff-picker__choice--active):hover .diff-picker__card {
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.045);
}

.diff-picker__choice--easy.diff-picker__choice--active .diff-picker__card,
.diff-picker__choice--easy.diff-picker__choice--active:hover .diff-picker__card {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.14);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35);
}

.diff-picker__choice--medium.diff-picker__choice--active .diff-picker__card,
.diff-picker__choice--medium.diff-picker__choice--active:hover .diff-picker__card {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.38);
}

.diff-picker__choice--hard.diff-picker__choice--active .diff-picker__card,
.diff-picker__choice--hard.diff-picker__choice--active:hover .diff-picker__card {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.14);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.38);
}

/* --- Plateau de jeu : pourtour = couleur du niveau (Facile / Moyen / Difficile) --- */
.perc-game-board--diff-easy {
  outline: 2px solid rgba(34, 197, 94, 0.68);
  outline-offset: 6px;
  transition: outline-color 0.2s ease;
}

.perc-game-board--diff-medium {
  outline: 2px solid rgba(245, 158, 11, 0.72);
  outline-offset: 6px;
  transition: outline-color 0.2s ease;
}

.perc-game-board--diff-hard {
  outline: 2px solid rgba(239, 68, 68, 0.7);
  outline-offset: 6px;
  transition: outline-color 0.2s ease;
}

.diff-picker__stars {
  display: inline-flex;
  align-items: center;
  gap: 0.22em;
  font-size: 1.02rem;
  line-height: 1;
  letter-spacing: 0;
  font-family: "Georgia", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-feature-settings: normal;
}

.diff-picker__star {
  display: inline-block;
  color: rgba(100, 116, 139, 0.5);
  transform: translateY(-0.03em);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.diff-picker__choice:hover .diff-picker__star:not(.diff-picker__star--lit) {
  color: rgba(148, 163, 184, 0.65);
}

/* Étoiles remplies : toujours or / jaune, relief léger */
.diff-picker__star--lit {
  --diff-star-gold-mid: #e8b923;
  color: var(--diff-star-gold-mid);
  background: linear-gradient(
    168deg,
    #fffbeb 0%,
    #fde047 22%,
    var(--diff-star-gold-mid) 52%,
    #b45309 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 1px rgba(120, 53, 15, 0.35))
    drop-shadow(0 0 6px rgba(250, 204, 21, 0.28));
  text-shadow: none; /* inactif avec clip ; fallback ci-dessous */
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .diff-picker__star--lit {
    color: #facc15;
    background: none;
    -webkit-text-fill-color: unset;
    filter: drop-shadow(0 1px 1px rgba(120, 53, 15, 0.4));
  }
}

.diff-picker__choice:hover .diff-picker__star--lit {
  transform: translateY(-0.03em) scale(1.06);
  filter: drop-shadow(0 1px 2px rgba(120, 53, 15, 0.42))
    drop-shadow(0 0 8px rgba(250, 204, 21, 0.35));
}

.diff-picker__title {
  font-weight: 700;
  font-size: 0.92rem;
}

.diff-picker__desc {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
}

/* --- Encadré « règles du jeu » (dépliant) --- */
.briques-rules {
  --rules-accent: #38bdf8;
  --rules-accent-dim: rgba(56, 189, 248, 0.22);
  margin-top: 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.72) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 12px 32px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.briques-rules:hover {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 12px 36px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(56, 189, 248, 0.12);
}

.briques-rules[open] {
  border-color: rgba(56, 189, 248, 0.4);
}

.briques-rules__summary {
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.65rem;
  padding: 0.7rem 0.95rem;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  list-style: none;
  color: rgba(248, 250, 252, 0.96);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.briques-rules__teaser {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  line-height: 1.45;
  color: var(--muted);
  text-align: left;
}

.briques-rules__teaser strong {
  color: var(--text);
  font-weight: 700;
}

.briques-rules[open] > .briques-rules__summary .briques-rules__teaser {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.briques-rules__summary::-webkit-details-marker,
.briques-rules__summary::marker {
  display: none;
}

.briques-rules__summary:focus-visible {
  outline: 2px solid var(--rules-accent);
  outline-offset: 2px;
}

.briques-rules__summary-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-top: 0.12rem;
  border-radius: 50%;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  font-family: ui-sans-serif, system-ui, sans-serif;
  color: #0c1222;
  background: linear-gradient(160deg, #7dd3fc 0%, #38bdf8 45%, #0ea5e9 100%);
  box-shadow:
    0 2px 8px rgba(14, 165, 233, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}

.briques-rules__summary-icon::before {
  content: "?";
  transform: translateY(-0.04em);
}

.briques-rules__summary::after {
  content: "";
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  margin-left: auto;
  margin-top: 0.38rem;
  margin-right: 0.1rem;
  border-right: 2px solid rgba(148, 163, 184, 0.75);
  border-bottom: 2px solid rgba(148, 163, 184, 0.75);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.25s ease, border-color 0.2s ease;
}

.briques-rules[open] > .briques-rules__summary::after {
  transform: rotate(225deg) translateY(2px);
  border-color: var(--rules-accent);
}

@media (prefers-reduced-motion: reduce) {
  .briques-rules,
  .briques-rules__summary::after {
    transition: none;
  }
}

.briques-rules__body {
  padding: 0 0.85rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, transparent 48%);
}

.briques-rules__list {
  list-style: none;
  margin: 0.85rem 0 0.75rem;
  padding: 0;
  counter-reset: rules-li;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: rgba(226, 232, 240, 0.92);
  font-size: 0.905rem;
  line-height: 1.45;
}

.briques-rules__list li {
  counter-increment: rules-li;
  position: relative;
  margin: 0;
  padding: 0.62rem 0.75rem 0.62rem 2.55rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.55);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.briques-rules__list li::before {
  content: counter(rules-li);
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 0.28rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--rules-accent);
  background: var(--rules-accent-dim);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.briques-rules__legend {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(203, 213, 225, 0.95);
  background: rgba(56, 189, 248, 0.08);
  border: 1px dashed rgba(56, 189, 248, 0.28);
}

.briques-rules__legend strong:first-child {
  color: #7dd3fc;
}

.briques-rules__dialog-open {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: #7dd3fc;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  cursor: pointer;
}

.briques-rules__dialog-open:hover {
  color: #bae6fd;
}

.briques-rules__dialog-open:focus-visible {
  outline: 2px solid var(--rules-accent);
  outline-offset: 2px;
}

/* Variante mobile : dépliant plus compact */
.briques-rules--compact {
  margin-top: 0.55rem;
  border-radius: 12px;
}

.briques-rules--compact .briques-rules__summary {
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
}

.briques-rules--compact .briques-rules__summary-icon {
  width: 1.72rem;
  height: 1.72rem;
  font-size: 0.92rem;
  margin-top: 0.08rem;
}

.briques-rules--compact .briques-rules__summary::after {
  margin-top: 0.28rem;
}

.briques-rules--compact .briques-rules__body {
  padding: 0 0.7rem 0.85rem;
}

.briques-rules--compact .briques-rules__list {
  font-size: 0.84rem;
  gap: 0.42rem;
}

.briques-rules--compact .briques-rules__list li {
  padding: 0.52rem 0.65rem 0.52rem 2.35rem;
}

.briques-rules--compact .briques-rules__list li::before {
  left: 0.45rem;
  min-width: 1.28rem;
  height: 1.28rem;
  font-size: 0.68rem;
}

.briques-rules--compact .briques-rules__legend {
  font-size: 0.82rem;
  padding: 0.55rem 0.65rem;
}

/* --- Briques : grille 6×6, traits briques + pavé --- */
.briques-layout {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(140px, 220px);
  gap: 1rem 1.35rem;
  align-items: start;
}

.briques-layout .status-bar {
  grid-column: 1 / -1;
  margin-top: 0;
}

.briques-stack {
  min-width: 0;
}

.briques-wrap {
  --brique-cell: clamp(2.35rem, 11vw, 3.35rem);
  --brique-thick: 3px;
  --brique-thick-soft: 2px;
  /* Cadre global de la grille ; traits entre briques = une seule couleur (cyan). */
  --brique-frame: rgba(251, 191, 36, 0.94);
  --brique-inner-line: rgba(226, 232, 240, 0.78);
  --brique-inner-glow: rgba(148, 163, 184, 0.35);
  --brique-inner-glow-soft: rgba(148, 163, 184, 0.18);
  position: relative;
  display: flex;
  flex-direction: column;
  width: calc(6 * var(--brique-cell));
  max-width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background:
    radial-gradient(ellipse 120% 80% at 50% 20%, rgba(94, 234, 212, 0.09), transparent 55%),
    radial-gradient(ellipse 100% 60% at 50% 100%, rgba(45, 212, 191, 0.07), transparent 50%),
    linear-gradient(165deg, #0f172a 0%, #020617 48%, #0c1929 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 0 48px rgba(45, 212, 191, 0.04),
    0 0 0 2px rgba(15, 118, 110, 0.35),
    0 0 32px rgba(45, 212, 191, 0.14),
    0 14px 42px rgba(0, 0, 0, 0.45);
}

/* Fines lignes CRT / borne — au-dessus de la grille, sans bloquer les clics */
.briques-wrap::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.055) 2px,
    rgba(0, 0, 0, 0.055) 3px
  );
  opacity: 0.85;
}

.briques-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  height: var(--brique-cell);
}

/* Traits épais entre briques : même couleur sur toutes les lignes */
.briques-row--split-a,
.briques-row--split-b {
  --brique-stroke: rgba(34, 211, 238, 1);
  --brique-neon-glow: rgba(34, 211, 238, 0.48);
  --brique-neon-glow-soft: rgba(103, 232, 249, 0.26);
}

.briques-cell-wrap {
  width: var(--brique-cell);
  height: var(--brique-cell);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.briques-cell {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  position: relative;
  background:
    linear-gradient(to bottom, rgba(236, 254, 255, 0.08) 0, transparent 38%),
    rgba(255, 255, 255, 0.028);
  border: none;
  border-radius: 0;
  /* Halo néon autour des traits (les bordures dessinent la forme visible) */
  filter: drop-shadow(0 0 5px var(--brique-neon-glow-soft));
}

/* Contour de brique : tubes néon ; halage via filter sur .briques-cell */
.briques-cell--edge-t {
  border-top: var(--brique-thick) solid var(--brique-stroke);
}

.briques-cell--edge-b {
  border-bottom: var(--brique-thick) solid var(--brique-stroke);
}

/* Contour extérieur de la grille : couleur unique, lisible face aux lignes internes. */
.briques-row:first-child .briques-cell--edge-t {
  border-top-color: var(--brique-frame);
}

.briques-row:last-child .briques-cell--edge-b {
  border-bottom-color: var(--brique-frame);
}

.briques-cell--outer-l {
  border-left: var(--brique-thick) solid var(--brique-frame);
}

.briques-cell--outer-r {
  border-right: var(--brique-thick) solid var(--brique-frame);
}

.briques-cell--sep-v {
  border-right: var(--brique-thick) solid var(--brique-stroke);
}

.briques-cell--inner-v {
  /* Trait « data bus » en segments plutôt qu’un tiret CSS */
  border-right: none;
}

.briques-cell--inner-v::after {
  content: "";
  pointer-events: none;
  position: absolute;
  top: 12%;
  bottom: 12%;
  right: 0;
  width: var(--brique-thick-soft);
  border-radius: 1px;
  /* Trait interne : gris clair, distinct du trait épais entre briques. */
  background: repeating-linear-gradient(
    to bottom,
    var(--brique-inner-line) 0 4px,
    transparent 4px 8px
  );
  box-shadow:
    0 0 5px var(--brique-inner-glow-soft),
    0 0 10px var(--brique-inner-glow);
}

.briques-input {
  width: 100%;
  height: 100%;
  border: none;
  margin: 0;
  padding: 0;
  background: transparent;
  color: #ffffff;
  font-family: inherit;
  font-size: clamp(0.95rem, 3.5vw, 1.3rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.briques-row--split-a .briques-cell-wrap:not(.briques-cell-wrap--given) .briques-input,
.briques-row--split-b .briques-cell-wrap:not(.briques-cell-wrap--given) .briques-input {
  text-shadow:
    0 0 16px rgba(34, 211, 238, 0.55),
    0 0 6px rgba(125, 211, 252, 0.45);
}

.briques-input:focus {
  outline: none;
}

.briques-input:disabled {
  cursor: default;
  opacity: 0.92;
}

.briques-cell-wrap--given .briques-input {
  color: #f59e0b;
  font-weight: 700;
  text-shadow:
    0 0 18px rgba(245, 158, 11, 0.65),
    0 0 6px rgba(217, 119, 6, 0.4);
}

.briques-cell-wrap.briques-cell--picked {
  box-shadow:
    inset 0 0 0 2px rgba(253, 224, 71, 0.95),
    0 0 20px rgba(250, 204, 21, 0.35);
  z-index: 6;
}

.briques-cell-wrap.briques-cell--picked .briques-cell {
  background: rgba(250, 204, 21, 0.1);
}

/* Pavé numérique (Briques, etc.) */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  align-content: start;
}

.numpad__btn {
  min-height: 2.45rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.numpad__erase {
  grid-column: 1 / -1;
  font-size: 0.88rem;
  font-weight: 600;
}

/* Pavé numérique Briques / Kakkuru — touches néon assorties à la grille */
body.page-briques .briques-layout .numpad,
body.page-kakkuru .game-center .numpad {
  gap: 0.55rem;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.92) 0%, rgba(2, 6, 23, 0.96) 100%);
  border: 1px solid rgba(103, 232, 249, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 8px 28px rgba(0, 0, 0, 0.35);
}

body.page-briques .briques-layout .numpad .numpad__btn,
body.page-kakkuru .game-center .numpad .numpad__btn {
  position: relative;
  min-height: 2.65rem;
  padding: 0.45rem 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 11px;
  border-width: 1px;
  border-style: solid;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 100%),
    rgba(15, 23, 42, 0.75);
  color: #f1f5f9;
  text-shadow: 0 0 14px rgba(103, 232, 249, 0.35);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease,
    filter 0.15s ease;
}

body.page-briques .briques-layout .numpad .numpad__btn:not(.numpad__erase),
body.page-kakkuru .game-center .numpad .numpad__btn:not(.numpad__erase) {
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow:
    0 0 16px rgba(34, 211, 238, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-shadow: 0 0 14px rgba(103, 232, 249, 0.35);
}

body.page-briques .briques-layout .numpad .numpad__btn:not(:disabled):hover,
body.page-kakkuru .game-center .numpad .numpad__btn:not(:disabled):hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

body.page-briques .briques-layout .numpad .numpad__btn:not(.numpad__erase):not(:disabled):hover,
body.page-kakkuru .game-center .numpad .numpad__btn:not(.numpad__erase):not(:disabled):hover {
  border-color: rgba(103, 232, 249, 0.85);
  box-shadow:
    0 0 22px rgba(34, 211, 238, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body.page-briques .briques-layout .numpad .numpad__erase,
body.page-kakkuru .game-center .numpad .numpad__erase {
  margin-top: 0.1rem;
  min-height: 2.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-color: rgba(251, 191, 36, 0.55);
  color: #fde68a;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
  background:
    linear-gradient(180deg, rgba(251, 191, 36, 0.12) 0%, rgba(15, 23, 42, 0.85) 100%);
  box-shadow:
    0 0 18px rgba(251, 191, 36, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.page-briques .briques-layout .numpad .numpad__erase:not(:disabled):hover,
body.page-kakkuru .game-center .numpad .numpad__erase:not(:disabled):hover {
  border-color: rgba(253, 224, 71, 0.9);
  box-shadow:
    0 0 24px rgba(251, 191, 36, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.page-briques .briques-layout .numpad .numpad__btn:focus-visible,
body.page-kakkuru .game-center .numpad .numpad__btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(15, 23, 42, 0.95),
    0 0 0 4px rgba(250, 204, 21, 0.75);
}

body.page-briques .briques-layout .numpad .numpad__btn:not(.numpad__erase):focus-visible,
body.page-kakkuru .game-center .numpad .numpad__btn:not(.numpad__erase):focus-visible {
  box-shadow:
    0 0 0 2px rgba(15, 23, 42, 0.95),
    0 0 0 4px rgba(34, 211, 238, 0.65),
    0 0 16px rgba(34, 211, 238, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.page-briques .briques-layout .numpad .numpad__erase:focus-visible,
body.page-kakkuru .game-center .numpad .numpad__erase:focus-visible {
  box-shadow:
    0 0 0 2px rgba(15, 23, 42, 0.95),
    0 0 0 4px rgba(251, 191, 36, 0.8),
    0 0 18px rgba(251, 191, 36, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.page-briques .briques-layout .numpad .numpad__btn:disabled,
body.page-kakkuru .game-center .numpad .numpad__btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.2);
}

body.page-briques .briques-layout .numpad .numpad__btn:active:not(:disabled),
body.page-kakkuru .game-center .numpad .numpad__btn:active:not(:disabled) {
  transform: translateY(1px);
}

@media (prefers-reduced-motion: reduce) {
  .briques-cell {
    filter: none;
  }

  .briques-cell--inner-v::after {
    box-shadow: none;
  }

  .briques-row--split-a .briques-cell-wrap:not(.briques-cell-wrap--given) .briques-input,
  .briques-row--split-b .briques-cell-wrap:not(.briques-cell-wrap--given) .briques-input,
  .briques-cell-wrap--given .briques-input {
    text-shadow: none;
  }

  body.page-game .briques-chrono__value {
    text-shadow: none;
  }

  body.page-briques .briques-layout .numpad .numpad__btn,
  body.page-kakkuru .game-center .numpad .numpad__btn {
    transition: none;
  }

  body.page-briques .briques-layout .numpad .numpad__btn:not(:disabled):hover,
  body.page-briques .briques-layout .numpad .numpad__btn:active:not(:disabled),
  body.page-kakkuru .game-center .numpad .numpad__btn:not(:disabled):hover,
  body.page-kakkuru .game-center .numpad .numpad__btn:active:not(:disabled) {
    transform: none;
  }
}

@media (max-width: 640px) {
  .briques-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .briques-layout .numpad {
    width: 100%;
    max-width: 20rem;
  }

  body.page-game.page-kakkuru .game-center .numpad {
    width: 100%;
    max-width: 20rem;
  }

  .sudoku-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    width: 100%;
  }

  .sudoku-layout .numpad {
    width: 100%;
    max-width: 20rem;
  }
}

/* --- Sudoku — grille 9×9 + pavé --- */
body.page-sudoku .game-page-with-lb__main {
  min-width: 0;
}

.sudoku-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}

.sudoku-toolbar .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sudoku-layout {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(140px, 220px);
  gap: 1rem 1.35rem;
  align-items: start;
  width: fit-content;
  max-width: 100%;
  border-radius: var(--radius-sm);
}

.sudoku-layout .status-bar {
  grid-column: 1 / -1;
  margin-top: 0;
}

.sudoku-board {
  --sud-cell: clamp(1.85rem, 5vmin, 2.75rem);
  display: grid;
  grid-template-columns: repeat(9, var(--sud-cell));
  grid-template-rows: repeat(9, var(--sud-cell));
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: clamp(0.55rem, 2vmin, 1rem);
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background:
    radial-gradient(ellipse 95% 75% at 50% -25%, rgba(34, 211, 238, 0.15), transparent 52%),
    radial-gradient(ellipse 65% 50% at 100% 100%, rgba(167, 139, 250, 0.11), transparent 48%),
    linear-gradient(168deg, rgba(15, 23, 42, 0.93), rgba(7, 10, 20, 0.97));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 52px rgba(0, 0, 0, 0.44),
    0 0 64px rgba(34, 211, 238, 0.06);
  box-sizing: content-box;
}

.sudoku-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.035);
  border-right: 1px solid rgba(100, 116, 139, 0.45);
  border-bottom: 1px solid rgba(100, 116, 139, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    background 0.14s ease,
    box-shadow 0.14s ease;
}

.sudoku-board > .sudoku-cell:nth-child(9n + 1) {
  border-left: 1px solid rgba(100, 116, 139, 0.45);
}

.sudoku-board > .sudoku-cell:nth-child(-n + 9) {
  border-top: 1px solid rgba(100, 116, 139, 0.45);
}

.sudoku-board > .sudoku-cell:nth-child(9n) {
  border-right: none;
}

.sudoku-board > .sudoku-cell:nth-child(n + 73) {
  border-bottom: none;
}

.sudoku-cell.box-r {
  border-right: 3px solid rgba(252, 211, 77, 0.9);
}

.sudoku-cell.box-b {
  border-bottom: 3px solid rgba(252, 211, 77, 0.9);
}

.sudoku-cell.fixed {
  background: rgba(253, 230, 138, 0.07);
}

.sudoku-cell:not(.fixed):hover {
  background: rgba(34, 211, 238, 0.09);
}

.sudoku-cell.selected {
  z-index: 2;
  box-shadow:
    inset 0 0 0 2px rgba(34, 211, 238, 0.92),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  background: rgba(34, 211, 238, 0.11);
}

.sudoku-cell input {
  width: 100%;
  height: 100%;
  border: none;
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: clamp(0.82rem, 3vmin, 1.22rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 3px;
}

.sudoku-cell input:focus {
  outline: none;
}

.sudoku-cell input:disabled {
  cursor: default;
}

.sudoku-cell.fixed input {
  color: #fde68a;
  font-weight: 700;
  cursor: default;
}

.sudoku-layout .numpad button {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  transition:
    filter 0.12s ease,
    transform 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.sudoku-layout .numpad button:not(:disabled):hover {
  filter: brightness(1.08);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 16px rgba(34, 211, 238, 0.12);
}

.sudoku-layout .numpad button:not(:disabled):active {
  transform: translateY(1px);
}

.sudoku-layout .numpad .clear {
  grid-column: 1 / -1;
  font-size: 0.88rem;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .sudoku-cell,
  .sudoku-layout .numpad button {
    transition: none;
  }

  .sudoku-layout .numpad button:not(:disabled):active {
    transform: none;
  }
}

/* --- Taquin — plateau coulissant --- */
body.page-taquin .game-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.taquin-toolbar-tail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-left: auto;
}

.taquin-board-shell {
  width: min(100%, 400px);
  margin: 0 auto;
  padding: clamp(0.65rem, 2vmin, 1.15rem);
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background:
    radial-gradient(ellipse 95% 75% at 50% -22%, rgba(167, 139, 250, 0.16), transparent 52%),
    radial-gradient(ellipse 72% 50% at 100% 100%, rgba(34, 211, 238, 0.12), transparent 48%),
    linear-gradient(168deg, rgba(15, 23, 42, 0.93), rgba(7, 10, 20, 0.97));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 52px rgba(0, 0, 0, 0.44),
    0 0 64px rgba(34, 211, 238, 0.06);
  box-sizing: border-box;
}

.taquin-board {
  display: grid;
  width: 100%;
  max-width: 100%;
  margin: 0;
  aspect-ratio: 1;
  gap: clamp(5px, 1.35vmin, 8px);
  padding: clamp(4px, 1vmin, 8px);
  box-sizing: border-box;
}

.taquin-tile {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  width: auto;
  height: auto;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.05rem, 4.8vmin, 1.85rem);
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1),
    0 3px 12px rgba(0, 0, 0, 0.32);
  transition:
    transform 0.14s ease,
    filter 0.14s ease,
    box-shadow 0.14s ease;
}

.taquin-tile:not(:disabled):hover {
  filter: brightness(1.09) saturate(1.03);
  transform: scale(1.035);
  z-index: 2;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 4px 18px rgba(0, 0, 0, 0.38),
    0 0 22px rgba(34, 211, 238, 0.16);
}

.taquin-tile:focus {
  outline: none;
}

.taquin-tile:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.9);
  outline-offset: 2px;
  z-index: 3;
}

.taquin-empty {
  cursor: default;
  pointer-events: none;
  background: rgba(3, 6, 14, 0.45);
  box-shadow:
    inset 0 2px 10px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(100, 116, 139, 0.28);
  border: 1px dashed rgba(100, 116, 139, 0.4);
}

.taquin-tile:disabled:not(.taquin-empty) {
  cursor: default;
  opacity: 0.9;
}

@media (prefers-reduced-motion: reduce) {
  .taquin-tile {
    transition: none;
  }

  .taquin-tile:not(:disabled):hover {
    transform: none;
  }
}

/* --- Memory — paires (pictogrammes) --- */
body.page-memory .game-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.memory-toolbar-tail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-left: auto;
}

.memory-board-shell {
  width: min(100%, 640px);
  margin: 0 auto;
  padding: clamp(0.65rem, 2vmin, 1.15rem);
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background:
    radial-gradient(ellipse 95% 75% at 50% -22%, rgba(167, 139, 250, 0.16), transparent 52%),
    radial-gradient(ellipse 72% 50% at 100% 100%, rgba(34, 211, 238, 0.12), transparent 48%),
    linear-gradient(168deg, rgba(15, 23, 42, 0.93), rgba(7, 10, 20, 0.97));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 52px rgba(0, 0, 0, 0.44),
    0 0 64px rgba(34, 211, 238, 0.06);
  box-sizing: border-box;
}

.memory-board {
  display: grid;
  width: 100%;
  margin: 0;
  gap: clamp(8px, 1.5vmin, 12px);
  padding: clamp(6px, 1.5vmin, 12px);
  box-sizing: border-box;
}

.memory-card {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  min-width: 0;
  min-height: clamp(42px, 10vmin, 68px);
  width: auto;
  height: auto;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  line-height: 1;
  color: var(--text);
  transition:
    transform 0.14s ease,
    filter 0.14s ease,
    box-shadow 0.14s ease,
    opacity 0.14s ease;
}

.memory-card:focus {
  outline: none;
}

.memory-card:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.9);
  outline-offset: 2px;
  z-index: 2;
}

.memory-card--back {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.1), transparent 42%),
    linear-gradient(152deg, rgba(71, 85, 105, 0.6), rgba(30, 41, 59, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 3px 14px rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(100, 116, 139, 0.35);
}

.memory-card__hint {
  font-size: clamp(1.05rem, 4.8vmin, 1.95rem);
  font-weight: 800;
  color: rgba(226, 232, 240, 0.8);
}

.memory-card--face {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12),
    0 3px 14px rgba(0, 0, 0, 0.36);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.memory-card--matched.memory-card--face {
  opacity: 0.9;
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(52, 211, 153, 0.25),
    0 4px 18px rgba(34, 197, 94, 0.15);
}

.memory-card:not(:disabled):hover {
  filter: brightness(1.07);
}

.memory-card:active:not(.memory-card--matched) {
  transform: translateY(1px);
}

.memory-card--face .memory-card__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: clamp(4px, 6%, 10px);
  box-sizing: border-box;
}

.memory-card--face .memory-card__mark--glyph {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: clamp(2rem, 12vmin, 4.65rem);
  line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
  .memory-card {
    transition: none;
  }

  .memory-card:active:not(.memory-card--matched) {
    transform: none;
  }
}

/* --- Lights Out — grille 5×5 --- */
body.page-lights .game-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lights-board-shell {
  width: min(100%, 420px);
  margin: 0 auto;
  padding: clamp(0.65rem, 2vmin, 1.15rem);
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background:
    radial-gradient(ellipse 95% 75% at 50% -22%, rgba(251, 191, 36, 0.1), transparent 52%),
    radial-gradient(ellipse 72% 50% at 100% 100%, rgba(34, 211, 238, 0.13), transparent 48%),
    linear-gradient(168deg, rgba(15, 23, 42, 0.93), rgba(7, 10, 20, 0.97));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 52px rgba(0, 0, 0, 0.44),
    0 0 64px rgba(34, 211, 238, 0.06);
  box-sizing: border-box;
}

.lights-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  width: 100%;
  margin: 0;
  aspect-ratio: 1;
  gap: clamp(5px, 1.35vmin, 8px);
  padding: clamp(4px, 1vmin, 8px);
  box-sizing: border-box;
}

.lights-cell {
  margin: 0;
  padding: 0;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(71, 85, 105, 0.55);
  border-radius: 10px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  background: linear-gradient(165deg, rgba(24, 32, 48, 0.95), rgba(10, 14, 24, 0.98));
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 2px 8px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.13s ease,
    filter 0.13s ease,
    box-shadow 0.13s ease,
    border-color 0.13s ease,
    background 0.13s ease;
}

.lights-cell:hover {
  filter: brightness(1.12);
  transform: scale(1.04);
  z-index: 2;
}

.lights-cell:focus {
  outline: none;
}

.lights-cell:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.92);
  outline-offset: 2px;
  z-index: 3;
}

.lights-cell.on {
  border-color: rgba(251, 191, 36, 0.55);
  background:
    radial-gradient(circle at 38% 32%, rgba(254, 252, 232, 0.95) 0%, rgba(251, 191, 36, 0.55) 38%, rgba(34, 197, 194, 0.35) 78%, rgba(15, 23, 42, 0.2) 100%);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.45),
    inset 0 -6px 12px rgba(234, 179, 8, 0.25),
    0 0 22px rgba(34, 211, 238, 0.35),
    0 0 32px rgba(251, 191, 36, 0.25),
    0 3px 10px rgba(0, 0, 0, 0.3);
}

.lights-cell.on:hover {
  filter: brightness(1.06);
}

@media (prefers-reduced-motion: reduce) {
  .lights-cell {
    transition: none;
  }

  .lights-cell:hover {
    transform: none;
  }
}

/* --- Numberlink — chemins qui remplissent la grille --- */
body.page-numberlink .game-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.nl-board-shell {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: clamp(0.55rem, 1.8vmin, 1rem);
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background:
    radial-gradient(ellipse 90% 72% at 50% -24%, rgba(56, 189, 248, 0.09), transparent 52%),
    radial-gradient(ellipse 70% 52% at 100% 105%, rgba(129, 140, 248, 0.14), transparent 50%),
    linear-gradient(172deg, rgba(15, 23, 42, 0.94), rgba(7, 10, 22, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 18px 48px rgba(0, 0, 0, 0.42),
    0 0 52px rgba(34, 211, 238, 0.06);
  box-sizing: border-box;
}

.nl-board-wrap {
  position: relative;
  width: 100%;
  --nl-w: 5;
  --nl-h: 5;
  aspect-ratio: var(--nl-w) / var(--nl-h);
}

.nl-board__lines {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
  display: block;
}

.nl-board {
  --nl-w: 5;
  --nl-h: 5;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(var(--nl-w), minmax(0, 1fr));
  grid-template-rows: repeat(var(--nl-h), minmax(0, 1fr));
  margin: 0;
  gap: clamp(3px, 0.9vmin, 6px);
  padding: clamp(3px, 0.9vmin, 7px);
  box-sizing: border-box;
  touch-action: none;
  user-select: none;
  z-index: 2;
}

.nl-cell {
  margin: 0;
  padding: 0;
  min-width: 0;
  min-height: 0;
  border-radius: 11px;
  border: 1px dashed rgba(100, 116, 139, 0.45);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  font-weight: 700;
  font-size: clamp(0.88rem, 2.6vmin, 1.2rem);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(248, 250, 252, 0.95);
  background: linear-gradient(168deg, rgba(18, 26, 41, 0.96), rgba(8, 11, 22, 0.99));
  transition:
    transform 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.nl-cell.nl-cell--filled {
  border-style: solid;
  border-color: color-mix(in srgb, var(--nl-pair) 55%, rgba(51, 65, 85, 0.85));
  background: color-mix(in srgb, var(--nl-pair) 38%, rgba(15, 23, 42, 0.92));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 -2px 10px rgba(0, 0, 0, 0.32);
}

.nl-cell.nl-cell--endpoint.nl-cell--filled {
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75);
}

.nl-cell.nl-cell--endpoint:not(.nl-cell--filled) {
  border-style: solid;
  border-color: rgba(226, 232, 240, 0.5);
}

.nl-cell.nl-cell--active-pair {
  outline: 2px solid rgba(34, 211, 238, 0.75);
  outline-offset: 1px;
  z-index: 2;
}

.nl-cell.nl-cell--to-n {
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
}
.nl-cell.nl-cell--to-s {
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}
.nl-cell.nl-cell--to-w {
  border-bottom-left-radius: 5px;
  border-top-left-radius: 5px;
}
.nl-cell.nl-cell--to-e {
  border-bottom-right-radius: 5px;
  border-top-right-radius: 5px;
}

.nl-cell:hover {
  filter: brightness(1.08);
}

.nl-cell:active {
  transform: scale(0.96);
}

.nl-cell:focus {
  outline: none;
}

.nl-cell:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.85);
  outline-offset: 2px;
  z-index: 3;
}

@media (prefers-reduced-motion: reduce) {
  .nl-cell:active {
    transform: none;
  }
}

/* --- Gratte-ciel (skyscrapers) — grille + indices + pavé --- */
body.page-skyscrapers .game-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.skyscrapers-toolbar-tail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-left: auto;
}

.skyscrapers-board-shell {
  width: min(100%, 560px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.skyscrapers-frame {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background:
    radial-gradient(circle at 30% -10%, rgba(56, 189, 248, 0.12), transparent 55%),
    rgba(15, 23, 42, 0.88);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.06), 0 14px 40px rgba(0, 0, 0, 0.38);
  box-sizing: border-box;
  justify-content: center;
}

.skyscrapers-corner {
  min-width: 0;
  min-height: 0;
}

.skyscrapers-clue {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: clamp(0.82rem, 3vw, 1rem);
  color: var(--muted);
  user-select: none;
}

.skyscrapers-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  min-width: 0;
  min-height: 0;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.skyscrapers-cell--fixed {
  background: rgba(253, 230, 138, 0.08);
  box-shadow: inset 0 0 0 1px rgba(253, 230, 138, 0.22);
}

.skyscrapers-cell--selected {
  box-shadow: inset 0 0 0 2px rgba(34, 211, 238, 0.95);
  z-index: 1;
  background: rgba(34, 211, 238, 0.12);
}

.skyscrapers-input {
  width: 100%;
  height: 100%;
  border: none;
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: clamp(0.95rem, 3.5vw, 1.35rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  border-radius: inherit;
}

.skyscrapers-input:focus {
  outline: none;
}

.skyscrapers-input:disabled {
  cursor: default;
  opacity: 0.9;
}

.skyscrapers-cell--fixed .skyscrapers-input {
  color: #fde68a;
  font-weight: 700;
  cursor: default;
}

.skyscrapers-numpad {
  width: 100%;
  max-width: min(100%, 22rem);
  grid-template-columns: repeat(var(--skyscrapers-n, 4), minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.92) 0%, rgba(2, 6, 23, 0.96) 100%);
  border: 1px solid rgba(103, 232, 249, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 8px 28px rgba(0, 0, 0, 0.35);
}

body.page-skyscrapers .skyscrapers-numpad button {
  min-height: 2.55rem;
  padding: 0.4rem 0.5rem;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  border-radius: 11px;
  border: 1px solid rgba(34, 211, 238, 0.45);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 100%),
    rgba(15, 23, 42, 0.75);
  color: #f1f5f9;
  text-shadow: 0 0 12px rgba(103, 232, 249, 0.3);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease,
    filter 0.15s ease;
  box-shadow:
    0 0 14px rgba(34, 211, 238, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  -webkit-appearance: none;
  appearance: none;
}

body.page-skyscrapers .skyscrapers-numpad button:not(:disabled):hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  border-color: rgba(103, 232, 249, 0.85);
  box-shadow:
    0 0 22px rgba(34, 211, 238, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body.page-skyscrapers .skyscrapers-numpad button:not(:disabled):active {
  transform: translateY(1px);
}

body.page-skyscrapers .skyscrapers-numpad button:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.95);
  outline-offset: 2px;
}

body.page-skyscrapers .skyscrapers-numpad .clear {
  grid-column: 1 / -1;
  margin-top: 0.15rem;
  min-height: 2.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-color: rgba(148, 163, 184, 0.45);
  color: #e2e8f0;
  text-shadow: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%),
    rgba(30, 41, 59, 0.85);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 12px rgba(0, 0, 0, 0.2);
}

body.page-skyscrapers .skyscrapers-numpad .clear:not(:disabled):hover {
  border-color: rgba(203, 213, 225, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 18px rgba(148, 163, 184, 0.15);
}

@media (prefers-reduced-motion: reduce) {
  body.page-skyscrapers .skyscrapers-numpad button {
    transition: none;
  }

  body.page-skyscrapers .skyscrapers-numpad button:not(:disabled):hover,
  body.page-skyscrapers .skyscrapers-numpad button:not(:disabled):active {
    transform: none;
  }
}

/* --- Star (str) — grille régions & étoiles --- */
body.page-str .game-toolbar__primary .diff-picker {
  flex: 1 1 280px;
  min-width: min(260px, 100%);
}

body.page-str .str-play-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(0.65rem, 2vw, 1.15rem);
  width: fit-content;
  max-width: 100%;
}

body.page-str .str-play-row .str-board-shell {
  margin-left: 0;
  margin-right: 0;
  flex: 0 1 auto;
}

body.page-str .str-board-side-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  justify-content: center;
}

body.page-str .str-board-side-actions .btn {
  min-width: 9rem;
}

body.page-str .game-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.str-toolbar-tail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-left: auto;
}

.str-board-shell {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: clamp(0.75rem, 2.2vmin, 1.25rem);
  border-radius: 14px;
  border: 1px solid rgba(88, 28, 135, 0.35);
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(168, 85, 247, 0.12), transparent 55%),
    radial-gradient(ellipse 55% 45% at 100% 100%, rgba(34, 211, 238, 0.06), transparent 50%),
    linear-gradient(165deg, #07080f 0%, #04050a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 20px 56px rgba(0, 0, 0, 0.55),
    0 0 48px rgba(139, 92, 246, 0.08);
  box-sizing: border-box;
}

.str-board-root {
  margin: 0 auto;
  width: fit-content;
  max-width: 100%;
}

.str-board-root.str-board-frame {
  display: grid;
  margin: 0 auto;
  justify-content: center;
  gap: 0;
  width: fit-content;
  max-width: 100%;
  padding: 3px;
  border-radius: 10px;
  border: 2px solid rgba(192, 132, 252, 0.65);
  background: #05060b;
  box-shadow:
    0 0 12px rgba(168, 85, 247, 0.45),
    0 0 36px rgba(139, 92, 246, 0.25),
    0 0 64px rgba(124, 58, 237, 0.12),
    inset 0 0 24px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

.str-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  border-radius: 0;
  /* Fond par région défini en JS (REGION_FILLS) ; valeur par défaut si besoin */
  background: rgba(14, 16, 24, 0.92);
  transition:
    transform 0.14s ease,
    filter 0.14s ease,
    box-shadow 0.14s ease;
  box-shadow: none;
}

.str-cell:not(:disabled):hover {
  filter: brightness(1.14);
  z-index: 2;
  box-shadow:
    inset 0 0 18px rgba(250, 204, 21, 0.08),
    0 0 20px rgba(56, 189, 248, 0.12);
}

.str-cell:focus {
  outline: none;
}

.str-cell:focus-visible {
  outline: 2px solid rgba(168, 85, 247, 0.9);
  outline-offset: -2px;
  z-index: 3;
}

.str-cell:disabled {
  cursor: default;
}

.str-cell__star {
  display: block;
  line-height: 1;
  pointer-events: none;
  font-size: clamp(1.15rem, 4.2vmin, 1.65rem);
  color: transparent;
  transition:
    transform 0.15s ease,
    color 0.15s ease,
    filter 0.15s ease,
    text-shadow 0.15s ease;
}

.str-cell--star .str-cell__star {
  color: #ffeb3b;
  text-shadow:
    0 0 8px rgba(255, 235, 59, 0.95),
    0 0 18px rgba(250, 204, 21, 0.75),
    0 0 28px rgba(234, 179, 8, 0.45),
    0 1px 3px rgba(0, 0, 0, 0.75);
  transform: scale(1.04);
  filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.7));
}

.str-cell--fixed {
  box-shadow:
    inset 0 0 0 2px rgba(56, 189, 248, 0.9),
    0 0 14px rgba(56, 189, 248, 0.45),
    0 0 28px rgba(14, 165, 233, 0.22);
  z-index: 1;
}

.str-cell--conflict {
  animation: str-conflict-glow 0.65s ease-in-out infinite alternate;
}

.str-cell--conflict .str-cell__star {
  color: #fecaca;
  text-shadow:
    0 0 12px rgba(248, 113, 113, 0.65),
    0 2px 5px rgba(0, 0, 0, 0.55);
  filter: drop-shadow(0 0 4px rgba(248, 113, 113, 0.55));
}

@keyframes str-conflict-glow {
  from {
    box-shadow:
      0 0 0 rgba(244, 63, 94, 0);
  }

  to {
    box-shadow:
      0 0 22px rgba(244, 63, 94, 0.55),
      inset 0 0 12px rgba(244, 63, 94, 0.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .str-cell,
  .str-cell__star {
    transition: none;
  }

  .str-cell--conflict {
    animation: none;
    box-shadow:
      0 0 18px rgba(244, 63, 94, 0.4),
      inset 0 0 10px rgba(244, 63, 94, 0.1);
  }
}

/* --- Panneau mini-classement (jeu) --- */
.game-lb-panel {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.22);
  padding: 1rem 1rem 0.85rem;
}

.game-lb-panel__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.game-lb-panel__game-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.game-lb-panel__tier {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.game-lb-mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.game-lb-mini th,
.game-lb-mini td {
  padding: 0.35rem 0.4rem;
  text-align: left;
}

.game-lb-mini th {
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-soft);
}

.game-lb-mini__score {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.game-lb-panel__foot {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
}

.game-lb-panel__empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Étoiles ★ difficulté — toujours dorées (panneau jeu, page Classement, pastilles de filtre) */
.lb-diff-stars {
  color: #fbbf24;
  -webkit-text-fill-color: #fbbf24;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.28);
}

.lb-diff-toc__link .lb-diff-stars,
.lb-diff-toc__link:hover .lb-diff-stars,
.lb-diff-toc__link:focus-visible .lb-diff-stars,
.lb-diff-toc__link--current .lb-diff-stars {
  color: #fcd34d !important;
  -webkit-text-fill-color: #fcd34d !important;
}

@media (prefers-reduced-motion: reduce) {
  .lb-diff-stars {
    text-shadow: none;
  }
}

/* --- Classement (page dédiée) --- */
.lb-game-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.lb-game-toc__btn {
  appearance: none;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.4rem 0.85rem;
  font: inherit;
  cursor: pointer;
}

.lb-game-toc__btn:hover {
  border-color: var(--border);
}

.lb-game-stack {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.lb-game-tier {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
}

.lb-game-section__wrap {
  overflow-x: auto;
}

.lb-game-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.lb-game-table th,
.lb-game-table td {
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid var(--border-soft);
}

.lb-diff-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}

.lb-diff-toc__link {
  text-decoration: none;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  font-size: 0.85rem;
}

.leaderboard-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
}

/* --- Boutons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.52rem 1.1rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, #0891b2, #7c3aed);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-soft);
  color: var(--text);
}

body.page-admin .btn-ghost,
body.page-admin .btn-secondary {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.16), rgba(124, 58, 237, 0.18));
  border-color: rgba(125, 211, 252, 0.3);
  color: #dbeafe;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.07) inset;
}

body.page-admin .btn-ghost:hover,
body.page-admin .btn-secondary:hover {
  border-color: rgba(125, 211, 252, 0.58);
  filter: brightness(1.08);
}

.btn--icon-left .btn__icon {
  width: 22px;
  height: 22px;
}

/* --- Compte à rebours --- */
.perc-board-shell,
.briques-board-shell,
.pm-shell,
.calcul-shell,
.equation-shell,
.sudoku-layout,
[class$="-board-shell"] {
  position: relative;
}

.perc-countdown-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: clamp(2.5rem, 10vw, 4.5rem);
  color: #fff;
  text-shadow: 0 8px 32px rgba(0, 0, 0, 0.75);
  background: radial-gradient(circle at 50% 40%, rgba(34, 211, 238, 0.2), rgba(0, 0, 0, 0.55));
  z-index: 5;
  border-radius: inherit;
}

.perc-countdown-overlay[hidden] {
  display: none !important;
}

/* --- Tetris (aire de jeu + panneau droite) --- */
.page-tetris .tetris-shell {
  padding: clamp(1rem, 2.2vw, 1.35rem);
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(148deg, rgba(18, 26, 46, 0.78), rgba(6, 10, 22, 0.92));
  border: 1px solid rgba(34, 211, 238, 0.28);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 28px 56px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.page-tetris .tetris-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(184px, 228px);
  gap: clamp(1rem, 2.8vw, 1.65rem);
  align-items: start;
}

@media (max-width: 760px) {
  .page-tetris .tetris-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .page-tetris .tetris-side {
    width: 100%;
    max-width: 22rem;
  }
}

.page-tetris .tetris-canvas-wrap {
  justify-self: stretch;
  width: 100%;
  max-width: min(720px, 100%);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.layout-mobile.page-tetris .tetris-canvas-wrap {
  max-width: none;
}

.page-tetris #tetris-canvas {
  display: block;
  vertical-align: middle;
  border-radius: 14px;
  box-shadow:
    0 0 40px rgba(34, 211, 238, 0.14),
    0 12px 36px rgba(0, 0, 0, 0.55),
    inset 0 0 0 2px rgba(0, 0, 0, 0.42);
}

.page-tetris .tetris-side {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.page-tetris .tetris-panel {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(168deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.page-tetris .tetris-panel--score {
  text-align: center;
  border-color: rgba(34, 211, 238, 0.38);
  background: linear-gradient(
    155deg,
    rgba(34, 211, 238, 0.16),
    rgba(124, 58, 237, 0.09),
    rgba(10, 18, 36, 0.65)
  );
}

.page-tetris .tetris-panel__eyebrow {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(149, 163, 191, 0.95);
}

.page-tetris .tetris-panel__hero-num {
  display: block;
  font-family: var(--font-arcade);
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  line-height: 1.4;
  margin: 0.45rem 0 0;
  letter-spacing: 0.04em;
  background: var(--game-title-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 14px rgba(34, 211, 238, 0.28));
}

.page-tetris .tetris-panel__title {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(167, 139, 250, 0.95);
  margin-bottom: 0.55rem;
}

.page-tetris .tetris-panel--stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.page-tetris .tetris-stat-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.38rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.page-tetris .tetris-stat-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.page-tetris .tetris-stat-row__label {
  font-size: 0.88rem;
  color: var(--muted);
}

.page-tetris .tetris-stat-row__value {
  font-family: var(--font-arcade);
  font-size: 0.72rem;
  color: #e8eefc;
  letter-spacing: 0.06em;
}

.page-tetris .tetris-next-queue {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.page-tetris .tetris-next-queue__slot {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.45rem;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(34, 211, 238, 0.12);
}

.page-tetris .tetris-next-queue__rank {
  font-family: var(--font-arcade);
  font-size: 0.52rem;
  color: rgba(149, 163, 191, 0.85);
  width: 1.35rem;
  text-align: center;
  opacity: 0.9;
}

.page-tetris .tetris-next-canvas {
  display: block;
  justify-self: end;
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.page-tetris .tetris-panel--keys {
  padding-bottom: 0.95rem;
}

.page-tetris .tetris-keys-hint {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--muted);
}

.page-tetris .tetris-keys-hint li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.page-tetris .tetris-keys-hint kbd {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.42rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(36, 44, 64, 0.95), rgba(14, 18, 30, 0.98));
  color: #e8eefc;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

.page-tetris .status-bar {
  margin-top: 1rem;
}
.cb-game-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.cb-game-hud strong {
  color: var(--text);
}

.layout-mobile .cb-game-hud {
  margin-bottom: 0.35rem;
  gap: 0.65rem 1rem;
}

/* --- Barre de statut jeux --- */
.status-bar {
  margin-top: 0.75rem;
  min-height: 1.4em;
  font-size: 0.92rem;
  color: var(--muted);
}

.status-bar--ok {
  color: #6ee7b7;
}

.status-bar.warning {
  color: #fcd34d;
}

/* --- Auth --- */
.auth-intro {
  text-align: left;
  margin: 0.5rem 0 1rem;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.auth-label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.93rem;
  letter-spacing: 0.02em;
  color: var(--text);
}

.auth-input {
  min-height: 2.8125rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.65rem 0.95rem;
  font: inherit;
  font-size: 1rem;
  line-height: 1.35;
  background: linear-gradient(180deg, rgba(12, 18, 34, 0.75), rgba(6, 10, 20, 0.85));
  color: var(--text);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.28);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.auth-input::placeholder {
  color: rgba(149, 163, 191, 0.75);
}

.auth-input:hover {
  border-color: rgba(56, 189, 248, 0.28);
}

.auth-input:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.28),
    0 0 0 3px rgba(34, 211, 238, 0.18);
  background: linear-gradient(180deg, rgba(14, 22, 42, 0.88), rgba(8, 12, 24, 0.92));
}

.auth-input:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.55);
  outline-offset: 2px;
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.28), inset 0 0 0 100px rgba(10, 16, 32, 0.95);
  transition: background-color 5000s ease-in-out;
}

/* Mot de passe : bouton œil à l’intérieur du champ */
.auth-input-wrap {
  position: relative;
  align-self: stretch;
  width: 100%;
}

.auth-input--password {
  width: 100%;
  box-sizing: border-box;
  padding-right: 2.75rem;
}

.auth-password-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.auth-password-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.auth-password-toggle:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.45);
  outline-offset: 2px;
}

.auth-password-toggle__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.auth-password-toggle__icon--when-visible {
  display: none;
}

.auth-password-toggle[aria-pressed="true"] .auth-password-toggle__icon--when-hidden {
  display: none;
}

.auth-password-toggle[aria-pressed="true"] .auth-password-toggle__icon--when-visible {
  display: flex;
}

.auth-password-toggle__svg {
  display: block;
}

.form-error {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.auth-alt {
  margin-top: 1.25rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.auth-nav-home {
  margin-top: 1.5rem;
}

/* --- Dialogue déconnexion --- */
.percot-dialog {
  border: none;
  padding: 0;
  background: transparent;
  max-width: calc(100% - 2rem);
}

.percot-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.percot-dialog__surface {
  background: #111827;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  max-width: 400px;
}

.admin-dialog .percot-dialog__surface {
  width: min(520px, calc(100vw - 2rem));
  max-width: none;
}

.percot-dialog__title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.percot-dialog__text {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.percot-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* --- Administration --- */
.admin-meta {
  color: var(--muted);
}

.admin-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  justify-content: flex-end;
  margin: 0 0 1rem;
}

.admin-users-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.admin-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.admin-nav__link {
  padding: 0.46rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.3);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.16), rgba(124, 58, 237, 0.18));
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  color: #dbeafe;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.07) inset;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, transform 0.16s ease;
}

.admin-nav__link:hover {
  border-color: rgba(125, 211, 252, 0.58);
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.admin-nav__link--active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, #0891b2, #7c3aed);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 10px 26px rgba(8, 145, 178, 0.18);
}

.admin-overview-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.admin-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.22);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.admin-tile:hover {
  border-color: var(--border);
  transform: translateY(-2px);
}

.admin-tile__accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--violet));
}

.admin-tile__title {
  margin: 0.35rem 0 0.5rem;
  font-size: 1.1rem;
}

.admin-tile__desc {
  margin: 0 0 1rem;
  flex: 1;
  font-size: 0.88rem;
  color: var(--muted);
}

.admin-tile__cta {
  align-self: flex-start;
}

.admin-flash {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-weight: 600;
}

.admin-flash--ok {
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #a7f3d0;
}

.admin-flash--err {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.admin-meta--footnote {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
}

.admin-head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 0.15rem;
  border-bottom: 1px solid var(--border-soft);
}

.admin-head--sub .admin-meta {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.admin-backup-block {
  margin-top: 1.25rem;
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.22);
}

.admin-backup-block h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.admin-backup-block .admin-tile__desc {
  margin-bottom: 1rem;
}

.admin-empty {
  margin: 0;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
  color: var(--muted);
  font-size: 0.92rem;
}

.admin-map-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.admin-map-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.admin-schools-map {
  min-height: 360px;
  height: min(68vh, 560px);
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
}

.admin-map-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-map-list__item + .admin-map-list__item {
  margin-top: 0.25rem;
}

.admin-map-list__item--muted {
  color: rgba(248, 113, 113, 0.9);
}

.admin-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem 1.35rem;
}

.admin-logs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem 1.35rem;
}

.admin-filter label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.admin-table-wrap {
  overflow-x: auto;
  margin: 0 -0.2rem;
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}

.admin-table-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 0.65rem;
}

.admin-table-search {
  display: inline-flex;
  min-width: min(100%, 15rem);
}

.admin-logs-search {
  margin-left: auto;
}

.admin-table-search__input {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
}

.admin-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.admin-table thead {
  background: rgba(0, 0, 0, 0.38);
}

.admin-table th,
.admin-table td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-soft);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover {
  background: rgba(34, 211, 238, 0.07);
}

.admin-table th {
  font-weight: 700;
  color: var(--text);
}

.admin-table__empty-cell {
  color: var(--muted);
  text-align: center;
}

.admin-table code {
  font-size: 0.86em;
}

.admin-table--users {
  min-width: 1120px;
}

.admin-table--users td {
  vertical-align: middle;
}

.admin-table--users th,
.admin-table--users td {
  white-space: nowrap;
}

.admin-table__datetime {
  white-space: nowrap;
  line-height: 1.25;
}

.admin-table__datetime-date {
  display: block;
  font-weight: 600;
}

.admin-table__datetime-time {
  display: block;
  font-size: 0.82em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.admin-table__log-detail {
  max-width: 32rem;
  word-break: break-word;
  font-size: 0.85rem;
  color: var(--muted);
}

.admin-table__mini-link {
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
}

.admin-table--backups code {
  white-space: nowrap;
}

.admin-backup-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.2rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.admin-backup-badge--code {
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.18);
  border: 1px solid rgba(125, 211, 252, 0.32);
}

.admin-backup-badge--sql {
  color: #ddd6fe;
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid rgba(196, 181, 253, 0.35);
}

.admin-backup-delete-form {
  display: inline-flex;
  margin: 0;
}

.admin-backup-delete-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 999px;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.42);
  font: inherit;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.admin-backup-delete-btn:hover,
.admin-backup-delete-btn:focus-visible {
  color: #fff;
  background: rgba(220, 38, 38, 0.78);
  border-color: rgba(254, 202, 202, 0.75);
}

.admin-table-sort {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
  border-radius: 6px;
  padding: 0.12rem 0.25rem;
  margin: -0.12rem -0.25rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
}

.admin-table-sort:hover,
.admin-table-sort:focus-visible {
  color: var(--accent-hover);
  background: rgba(34, 211, 238, 0.1);
}

.admin-table-sort:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.55);
  outline-offset: 2px;
}

.admin-table-sort--active {
  color: var(--accent);
}

.admin-table-sort__indicator {
  font-size: 0.72em;
  opacity: 0.9;
}

.admin-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.admin-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin-user-role-form {
  margin: 0;
}

.admin-user-identity-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
}

.admin-user-identity-form label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.admin-user-identity-form--split {
  gap: 0.35rem;
}

.admin-user-identity-form--tail {
  flex-direction: row;
  align-items: center;
  min-width: 18rem;
  max-width: none;
}

.admin-user-identity-form--tail input[type="password"] {
  flex: 0 0 10.5rem;
}

.admin-user-identity-form--tail .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.admin-table .admin-user-identity-form input[type="text"],
.admin-table .admin-user-identity-form input[type="password"],
.admin-filter select,
.admin-user-role-select {
  width: 100%;
  max-width: 100%;
  min-height: 2.35rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.45rem 0.75rem;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.35;
  /* Fond opaque obligatoire : sans lui, certains navigateurs appliquent un fond système clair
     tout en gardant color / --text clair → texte illisible (effet « blanc sur blanc »). */
  background-color: #080d18;
  background-image: linear-gradient(180deg, rgba(12, 18, 34, 0.92), rgba(6, 10, 20, 0.96));
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  color-scheme: dark;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.28);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.admin-filter select option,
.admin-user-role-select option {
  background-color: #0f172a;
  color: var(--text);
}

.admin-table .admin-user-identity-form input[type="text"]::placeholder,
.admin-table .admin-user-identity-form input[type="password"]::placeholder {
  color: rgba(149, 163, 191, 0.7);
}

.admin-table .admin-user-identity-form input[type="text"]:hover,
.admin-table .admin-user-identity-form input[type="password"]:hover,
.admin-filter select:hover,
.admin-user-role-select:hover {
  border-color: rgba(56, 189, 248, 0.28);
}

.admin-table .admin-user-identity-form input[type="text"]:focus,
.admin-table .admin-user-identity-form input[type="password"]:focus,
.admin-filter select:focus,
.admin-user-role-select:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.28),
    0 0 0 3px rgba(34, 211, 238, 0.16);
}

.admin-user-role-select {
  min-width: 9rem;
  max-width: 15rem;
  cursor: pointer;
}

.btn--sm {
  padding: 0.38rem 0.75rem;
  font-size: 0.82rem;
}

.admin-charts {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

/* Grille : métriques pleine largeur, puis paires de graphiques sur écran large */
.admin-charts--grid {
  display: grid;
  gap: 1.35rem;
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .admin-charts--grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-chart-card--span-2 {
    grid-column: span 2;
  }
}

.admin-charts-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1.1rem;
  margin: 0 0 0.35rem;
}

.admin-charts-toolbar__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(149, 163, 191, 0.85);
}

.admin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.admin-chips__link {
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.22);
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

.admin-chips__link:hover {
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.32);
}

.admin-chips__link--active {
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.55);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(129, 140, 248, 0.14));
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.12),
    0 12px 32px rgba(0, 0, 0, 0.35);
}

.admin-chart-card {
  position: relative;
  overflow: hidden;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(168deg, rgba(15, 23, 42, 0.52) 0%, rgba(6, 10, 20, 0.78) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 20px 50px rgba(0, 0, 0, 0.38);
}

.admin-chart-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #22d3ee, #818cf8 45%, #c4b5fd);
  opacity: 0.92;
  pointer-events: none;
}

.admin-chart-card__inner {
  padding: 1.2rem 1.35rem 1.35rem;
}

.admin-chart-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
  .admin-chart-card h2 {
    background-image: var(--game-title-gradient);
    background-size: 120% 100%;
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 8px rgba(34, 211, 238, 0.16));
  }
}

.admin-chart-caption {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}

.admin-chart-caption code {
  font-size: 0.84em;
}

.admin-chart-canvas-wrap {
  position: relative;
  height: 260px;
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  border-radius: 10px;
  background: radial-gradient(120% 80% at 50% 0%, rgba(56, 189, 248, 0.06), transparent 55%),
    rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.admin-chart-canvas-wrap--compact {
  height: 240px;
}

.admin-chart-canvas-wrap--tall {
  height: 340px;
}

.admin-math-six-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-math-six-toolbar.game-toolbar {
  margin-bottom: 0;
}

.admin-math-six-shell.game-center {
  width: 100%;
}

/* --- Démineur (desktop + base ; mobile affine dans mobile-games.css) --- */
body.page-mines .game-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Grille + colonne mines / drapeau à droite */
body.page-mines .ms-play-row {
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem 1.25rem;
  width: 100%;
  max-width: 100%;
}

body.page-mines .ms-play-row .ms-board-shell {
  flex: 0 1 auto;
  margin: 0;
}

body.page-mines .ms-board-side {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  min-width: min(11.5rem, 100%);
}

body.page-mines .ms-board-side .meta {
  margin: 0;
  text-align: center;
}

body.page-mines .ms-board-side .btn-toggle {
  width: 100%;
  justify-content: center;
}

.ms-board-shell {
  width: min(520px, 100%);
  margin: 0 auto;
  aspect-ratio: var(--ms-aspect, 1);
  min-height: 0;
}

.ms-board {
  position: relative;
  display: grid;
  grid-auto-rows: 1fr;
  gap: clamp(3px, 1vmin, 5px);
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: clamp(8px, 2vmin, 12px);
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background:
    radial-gradient(circle at 30% -10%, rgba(56, 189, 248, 0.12), transparent 55%),
    rgba(15, 23, 42, 0.88);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.06), 0 14px 40px rgba(0, 0, 0, 0.38);
  isolation: isolate;
}

.ms-cell {
  appearance: none;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: clamp(0.68rem, min(4.2vw, 4.2vmin), 1rem);
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  color: var(--text);
  transition:
    transform 80ms ease,
    filter 0.12s ease,
    box-shadow 0.12s ease,
    background 0.15s ease;
}

.ms-cell:disabled {
  cursor: default;
}

.ms-board .ms-cell:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.65);
  outline-offset: 1px;
  z-index: 1;
}

.ms-cell.hidden {
  background: linear-gradient(158deg, rgba(148, 163, 184, 0.28), rgba(51, 65, 85, 0.55));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.14),
    inset 0 -2px 0 rgba(0, 0, 0, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.4);
}

.ms-cell.hidden:not(:disabled):hover {
  filter: brightness(1.1);
}

.ms-cell.hidden:not(:disabled):active {
  transform: translateY(1px);
  filter: brightness(0.95);
}

.ms-cell.hidden.flagged {
  position: relative;
}

.ms-cell.hidden.flagged::after {
  content: "⚑";
  font-size: clamp(0.9em, min(6vmin, 1.15rem), 1.3rem);
  line-height: 1;
  color: #f87171;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.ms-cell.revealed {
  background: rgba(30, 41, 59, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.ms-cell.revealed.mine {
  background: radial-gradient(circle at 32% 28%, rgba(254, 202, 202, 0.35), rgba(127, 29, 29, 0.65));
  color: #fecaca;
  font-size: clamp(0.62rem, min(3.8vw, 3.8vmin), 0.92rem);
}

.ms-cell.ms-cell--blast-origin {
  z-index: 2;
  box-shadow:
    0 0 0 3px rgba(248, 113, 113, 0.95),
    0 0 22px rgba(248, 113, 113, 0.55);
}

.ms-num {
  display: inline-block;
  font-weight: 800;
  line-height: 1;
}

.ms-num.n1 {
  color: #60a5fa;
}
.ms-num.n2 {
  color: #4ade80;
}
.ms-num.n3 {
  color: #f87171;
}
.ms-num.n4 {
  color: #a78bfa;
}
.ms-num.n5 {
  color: #f97316;
}
.ms-num.n6 {
  color: #2dd4bf;
}
.ms-num.n7 {
  color: #e2e8f0;
}
.ms-num.n8 {
  color: #94a3b8;
}

.ms-board--boom::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(
    circle at var(--ms-blast-x, 50%) var(--ms-blast-y, 50%),
    rgba(248, 113, 113, 0.38) 0%,
    rgba(248, 113, 113, 0.12) 38%,
    transparent 68%
  );
  animation: ms-blast-ring 1.5s ease-out forwards;
}

@keyframes ms-blast-ring {
  from {
    opacity: 0.95;
    transform: scale(0.88);
  }
  55% {
    opacity: 0.55;
  }
  to {
    opacity: 0;
    transform: scale(1.15);
  }
}

.ms-board--boom .ms-cell.mine.revealed {
  animation: ms-mine-reveal 0.48s cubic-bezier(0.34, 1.3, 0.64, 1) var(--kaboom-delay, 0ms) both;
}

@keyframes ms-mine-reveal {
  from {
    opacity: 0;
    transform: scale(0.35);
    filter: brightness(1.8);
  }
  70% {
    opacity: 1;
    transform: scale(1.08);
    filter: brightness(1.3);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: brightness(1);
  }
}

.ms-board--win-burst .ms-cell.revealed:not(.mine) {
  animation: ms-win-cell 0.72s ease var(--win-wave-delay, 0ms) both;
}

@keyframes ms-win-cell {
  0% {
    filter: brightness(1);
    box-shadow: inset 0 0 0 0 rgba(52, 211, 153, 0);
  }
  40% {
    filter: brightness(1.25);
    box-shadow:
      inset 0 0 0 2px rgba(52, 211, 153, 0.45),
      0 0 12px rgba(52, 211, 153, 0.2);
  }
  100% {
    filter: brightness(1);
    box-shadow: inset 0 0 0 0 rgba(52, 211, 153, 0);
  }
}

.ms-board-won-overlay,
.ms-board-lost-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  pointer-events: none;
  border-radius: inherit;
}

.ms-board-won-overlay {
  background: radial-gradient(
    circle at var(--ms-win-x, 50%) var(--ms-win-y, 50%),
    rgba(52, 211, 153, 0.28) 0%,
    rgba(52, 211, 153, 0.08) 52%,
    transparent 74%
  );
}

.ms-board-lost-overlay {
  background: radial-gradient(
    circle at var(--ms-blast-x, 50%) var(--ms-blast-y, 50%),
    rgba(248, 113, 113, 0.14) 0%,
    rgba(248, 113, 113, 0.04) 62%,
    transparent 74%
  );
}

.ms-board-won-text {
  padding: 0.45rem 1.05rem;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.03em;
  font-size: clamp(0.92rem, 3.8vw, 1.08rem);
  color: #d1fae5;
  background: rgba(6, 78, 59, 0.75);
  border: 1px solid rgba(52, 211, 153, 0.42);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4);
}

.ms-board-lost-text {
  padding: 0.45rem 1.05rem;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.03em;
  font-size: clamp(0.92rem, 3.8vw, 1.08rem);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.65);
  border: 1px solid rgba(248, 113, 113, 0.42);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4);
}

.ms-board.ms-board--won::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  z-index: 2;
  box-shadow: inset 0 0 40px rgba(52, 211, 153, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .ms-board--boom::before,
  .ms-board--boom .ms-cell.mine.revealed,
  .ms-board--win-burst .ms-cell.revealed:not(.mine) {
    animation: none !important;
  }

  .ms-board--boom::before {
    opacity: 0.35;
  }
}

/* --- Bataille navale (grille + indices ; mobile affine dans mobile-games.css) --- */
body.page-battleship .game-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.page-game.page-battleship .battleship-board-shell {
  width: min(560px, 100%);
  margin: 0 auto;
  border-radius: var(--radius-sm);
}

body.page-game.page-battleship .battleship-frame {
  display: grid;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: clamp(6px, 1.4vmin, 10px);
  gap: clamp(2px, 0.45vmin, 4px);
  border-radius: var(--radius-sm);
  border: 2px solid rgba(34, 211, 238, 0.42);
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(56, 189, 248, 0.14), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(14, 116, 144, 0.22), transparent 45%),
    linear-gradient(165deg, rgba(12, 74, 110, 0.55) 0%, rgba(15, 23, 42, 0.92) 48%, rgba(8, 47, 73, 0.88) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -12px 28px rgba(0, 0, 0, 0.35),
    0 16px 42px rgba(0, 0, 0, 0.42);
  box-sizing: border-box;
}

body.page-game.page-battleship .battleship-corner {
  min-width: 2rem;
  min-height: 2rem;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(20, 83, 45, 0.55), rgba(6, 78, 59, 0.72));
  border: 1px dashed rgba(74, 222, 128, 0.38);
  box-shadow: inset 0 1px 0 rgba(240, 253, 244, 0.08);
}

body.page-game.page-battleship .battleship-clue {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: clamp(0.78rem, min(2.8vw, 2.8vmin), 1rem);
  line-height: 1;
  color: #d1fae5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  background: linear-gradient(155deg, rgba(22, 101, 52, 0.62) 0%, rgba(6, 78, 59, 0.78) 100%);
  border: 1px solid rgba(52, 211, 153, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(240, 253, 244, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}

body.page-game.page-battleship .battleship-clue--warn {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.42);
  border-color: rgba(248, 113, 113, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 12px rgba(248, 113, 113, 0.22);
}

body.page-game.page-battleship .battleship-cell {
  appearance: none;
  margin: 0;
  padding: 0;
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  min-width: 0;
  min-height: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border: none;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(30, 58, 138, 0.38), rgba(15, 23, 42, 0.72));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.28);
  transition:
    transform 75ms ease,
    box-shadow 0.15s ease,
    filter 0.15s ease,
    background 0.15s ease;
}

body.page-game.page-battleship .battleship-cell:not(:disabled):hover {
  filter: brightness(1.12);
}

body.page-game.page-battleship .battleship-cell:not(:disabled):active {
  transform: scale(0.97);
}

body.page-game.page-battleship .battleship-cell:disabled {
  cursor: default;
  filter: saturate(0.88);
  opacity: 0.92;
}

body.page-game.page-battleship .battleship-cell:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.75);
  outline-offset: 2px;
  z-index: 2;
}

body.page-game.page-battleship .battleship-cell--selected {
  box-shadow:
    inset 0 0 0 2px rgba(34, 211, 238, 0.95),
    0 0 0 2px rgba(34, 211, 238, 0.35),
    0 0 18px rgba(34, 211, 238, 0.28);
  z-index: 1;
}

body.page-game.page-battleship .battleship-cell--fixed {
  box-shadow:
    inset 0 0 0 1px rgba(167, 139, 250, 0.35),
    inset 0 2px 8px rgba(0, 0, 0, 0.25);
}

body.page-game.page-battleship .battleship-cell--water {
  background: linear-gradient(160deg, rgba(8, 145, 178, 0.42), rgba(12, 74, 110, 0.55));
}

body.page-game.page-battleship .battleship-water {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  user-select: none;
}

body.page-game.page-battleship .battleship-water .battleship-wave-icon {
  width: clamp(1.05rem, min(4.8vmin, 4.5vw), 1.5rem);
  height: auto;
  flex-shrink: 0;
  color: rgba(186, 230, 253, 0.92);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}

body.page-game.page-battleship .battleship-cell--ship {
  padding: 2px;
  background: rgba(2, 12, 28, 0.88);
  box-shadow:
    inset 0 0 0 1px rgba(34, 211, 238, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 2px 6px rgba(0, 0, 0, 0.28);
}

body.page-game.page-battleship .battleship-hull-imgwrap {
  position: relative;
  flex: 1 1 0;
  align-self: stretch;
  min-width: 0;
  min-height: 1.75rem;
  width: 100%;
  overflow: hidden;
  border-radius: 6px;
  pointer-events: none;
}

body.page-game.page-battleship .battleship-hull-img {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
}

/* Sprites prévus pour l’horizontal (avant à gauche) ; navire vertical : rotation */
body.page-game.page-battleship .battleship-hull-imgwrap--v .battleship-hull-img {
  transform: rotate(90deg);
  transform-origin: center center;
  width: 118%;
  height: 118%;
  left: -9%;
  top: -9%;
}

body.page-game.page-battleship .battleship-fleet-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0.85rem 0 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: rgba(8, 47, 73, 0.22);
}

body.page-game.page-battleship .battleship-fleet-label {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--muted);
}

body.page-game.page-battleship .battleship-fleet-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

body.page-game.page-battleship .battleship-fleet-ship-inner {
  display: inline-flex;
  align-items: stretch;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.45);
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.32),
    0 0 12px rgba(56, 189, 248, 0.22);
}

body.page-game.page-battleship .battleship-fleet-ship-inner--sprites {
  gap: 0;
  line-height: 0;
}

body.page-game.page-battleship .battleship-fleet-hull-imgwrap {
  position: relative;
  flex: 0 0 auto;
  display: block;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.35);
}

body.page-game.page-battleship .battleship-fleet-hull-imgwrap--seg {
  width: clamp(0.78rem, 2.95vmin, 1.05rem);
  height: clamp(1.12rem, 4vmin, 1.5rem);
}

body.page-game.page-battleship .battleship-fleet-hull-imgwrap--single {
  width: clamp(1.12rem, 4.1vmin, 1.48rem);
  height: clamp(1.12rem, 4.1vmin, 1.48rem);
}

body.page-game.page-battleship .battleship-fleet-hull-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: auto;
  object-fit: contain;
  pointer-events: none;
}

body.page-game.page-battleship .battleship-numpad {
  margin-top: 0.85rem;
  gap: clamp(0.45rem, 1.5vmin, 0.65rem);
  padding: 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.28);
  background:
    radial-gradient(ellipse 100% 90% at 50% 0%, rgba(56, 189, 248, 0.12), transparent 55%),
    rgba(8, 47, 73, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 8px 22px rgba(0, 0, 0, 0.28);
}

body.page-game.page-battleship .battleship-pad-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  appearance: none;
  margin: 0;
  padding: 0.55rem 0.72rem;
  min-height: 2.95rem;
  font: inherit;
  font-weight: 650;
  text-align: left;
  color: #e0f2fe;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.32);
  background: linear-gradient(155deg, rgba(30, 58, 138, 0.55) 0%, rgba(15, 23, 42, 0.88) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -2px 8px rgba(0, 0, 0, 0.25),
    0 2px 8px rgba(0, 0, 0, 0.22);
  transition:
    transform 75ms ease,
    box-shadow 0.15s ease,
    filter 0.15s ease,
    border-color 0.15s ease;
}

body.page-game.page-battleship .battleship-pad-btn:hover:not(:disabled) {
  filter: brightness(1.1);
  border-color: rgba(103, 232, 249, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 0 1px rgba(34, 211, 238, 0.2),
    0 4px 14px rgba(34, 211, 238, 0.12);
}

body.page-game.page-battleship .battleship-pad-btn:active:not(:disabled) {
  transform: scale(0.98);
}

body.page-game.page-battleship .battleship-pad-btn:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.85);
  outline-offset: 2px;
}

body.page-game.page-battleship .battleship-pad-btn:disabled {
  cursor: default;
  opacity: 0.55;
  filter: saturate(0.75);
}

body.page-game.page-battleship .battleship-pad-btn--water {
  border-color: rgba(56, 189, 248, 0.38);
  background: linear-gradient(160deg, rgba(8, 145, 178, 0.42) 0%, rgba(12, 74, 110, 0.75) 100%);
}

body.page-game.page-battleship .battleship-pad-btn--ship {
  border-color: rgba(125, 211, 252, 0.4);
  background: linear-gradient(160deg, rgba(71, 85, 105, 0.75) 0%, rgba(30, 41, 59, 0.92) 100%);
}

body.page-game.page-battleship .battleship-pad-btn--clear {
  border-color: rgba(148, 163, 184, 0.38);
  color: #cbd5e1;
  background: linear-gradient(160deg, rgba(51, 65, 85, 0.65) 0%, rgba(15, 23, 42, 0.9) 100%);
}

body.page-game.page-battleship .battleship-pad-iconwrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Même lecture qu’une case « navire » : fond case + bat1 (pas position:absolute des cases grille). */
body.page-game.page-battleship .battleship-pad-iconwrap--ship {
  position: relative;
  padding: 3px;
  background: rgba(2, 12, 28, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(34, 211, 238, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 2px 6px rgba(0, 0, 0, 0.28);
}

body.page-game.page-battleship .battleship-pad-ship-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
}

body.page-game.page-battleship .battleship-hull-img--pad {
  position: static;
  left: auto;
  top: auto;
  right: auto;
  bottom: auto;
  width: 1.85rem;
  height: 1.85rem;
  max-width: none;
  max-height: none;
  flex-shrink: 0;
  object-fit: contain;
}

body.page-game.page-battleship .battleship-pad-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

body.page-game.page-battleship .battleship-pad-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  min-width: 0;
  line-height: 1.15;
}

body.page-game.page-battleship .battleship-pad-title {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

body.page-game.page-battleship .battleship-pad-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(186, 230, 253, 0.72);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

body.page-game.page-battleship .battleship-pad-btn--clear .battleship-pad-sub {
  color: rgba(203, 213, 225, 0.65);
}

body.page-game.page-battleship .battleship-pad-btn--ship .battleship-pad-sub {
  color: rgba(186, 230, 253, 0.68);
}

body.page-game.page-battleship .battleship-pad-btn--active {
  box-shadow:
    inset 0 0 0 2px rgba(34, 211, 238, 0.95),
    0 0 0 2px rgba(34, 211, 238, 0.35),
    0 0 18px rgba(34, 211, 238, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 4px 14px rgba(0, 0, 0, 0.2);
}

body.page-game.page-battleship .battleship-pad-btn--active:hover:not(:disabled) {
  filter: brightness(1.1);
  border-color: rgba(103, 232, 249, 0.5);
  box-shadow:
    inset 0 0 0 2px rgba(34, 211, 238, 0.98),
    0 0 0 2px rgba(34, 211, 238, 0.4),
    0 0 22px rgba(34, 211, 238, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 4px 14px rgba(0, 0, 0, 0.2);
}

/* --- Kakkuru (desktop ; mobile affine dans mobile-games.css) --- */
body.page-kakkuru .game-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.page-kakkuru .game-center .numpad {
  width: min(480px, 100%);
  margin-top: 0.75rem;
  box-sizing: border-box;
}

body.page-game.page-kakkuru .kakkuru-board-shell {
  width: min(480px, 100%);
  margin: 0 auto;
}

body.page-game.page-kakkuru .kakkuru-board {
  display: grid;
  gap: clamp(6px, 1.2vmin, 9px);
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: clamp(10px, 2vmin, 14px);
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background:
    radial-gradient(circle at 28% -8%, rgba(56, 189, 248, 0.1), transparent 52%),
    rgba(15, 23, 42, 0.88);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.05), 0 14px 40px rgba(0, 0, 0, 0.38);
  box-sizing: border-box;
}

body.page-game.page-kakkuru .kakkuru-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: clamp(2.65rem, 8vw, 3.35rem);
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  box-sizing: border-box;
}

body.page-game.page-kakkuru .kakkuru-cell--clue {
  font-family: inherit;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1rem, min(3.5vw, 3.5vmin), 1.35rem);
  line-height: 1;
  color: #1c1410;
  background: linear-gradient(155deg, #fde68a, #f59e0b 45%, #d97706);
  border-color: rgba(180, 83, 9, 0.55);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(120, 53, 15, 0.25);
}

body.page-game.page-kakkuru .kakkuru-cell--white {
  background: rgba(248, 250, 252, 0.96);
  border-color: rgba(56, 189, 248, 0.28);
}

body.page-game.page-kakkuru .kakkuru-cell--white.kakkuru-cell--picked {
  box-shadow:
    inset 0 0 0 2px rgba(253, 224, 71, 0.95),
    0 0 20px rgba(250, 204, 21, 0.35);
  border-color: rgba(250, 204, 21, 0.65);
  background: rgba(254, 249, 195, 0.98);
  z-index: 2;
}

body.page-game.page-kakkuru .kakkuru-input {
  width: 100%;
  height: 100%;
  min-height: 2.4rem;
  margin: 0;
  padding: 0.2rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.05rem, min(3.6vw, 3.6vmin), 1.35rem);
  text-align: center;
  box-sizing: border-box;
  appearance: textfield;
  -moz-appearance: textfield;
  cursor: pointer;
}

body.page-game.page-kakkuru .kakkuru-input::-webkit-outer-spin-button,
body.page-game.page-kakkuru .kakkuru-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

body.page-game.page-kakkuru .kakkuru-input:focus {
  outline: none;
}

body.page-game.page-kakkuru .kakkuru-cell--white:focus-within {
  border-color: rgba(34, 211, 238, 0.75);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.22);
}

body.page-game.page-kakkuru .kakkuru-input:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.75);
  outline-offset: 1px;
}

body.page-game.page-kakkuru .kakkuru-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.45rem;
  height: 2.45rem;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.15s ease, border-color 0.15s ease;
}

body.page-game.page-kakkuru .kakkuru-help-btn:hover {
  filter: brightness(1.08);
  border-color: rgba(34, 211, 238, 0.45);
}

body.page-game.page-kakkuru .kakkuru-help-btn__glyph {
  font-size: 1.1rem;
  line-height: 1;
}

/* --- Pac-Man : thème arcade (conserve le rendu jeu) --- */
body.page-pacman {
  text-align: center;
}

body.page-pacman .site p,
body.page-pacman .briques-rules__teaser,
body.page-pacman .briques-rules__list,
body.page-pacman .briques-rules__legend {
  color: rgba(226, 232, 240, 0.88);
}

body.page-pacman .briques-rules__teaser strong {
  color: rgba(248, 250, 252, 0.95);
}

body.page-pacman .site-panel__page-title {
  font-family: var(--font-arcade);
  font-size: clamp(0.85rem, 2.8vw, 1.05rem);
  line-height: 1.5;
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
  body.page-pacman.page-game:not(.page-admin) .site-top--has-title .site-panel__page-title {
    background-image: var(--game-title-gradient-pacman);
    background-size: 100% 100%;
    filter: drop-shadow(0 1px 8px rgba(245, 158, 11, 0.35));
  }
}

#pm-canvas-wrap {
  border: 4px solid #fcd34d;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  vertical-align: top;
  box-sizing: border-box;
  background: #000;
  border-radius: 4px;
}

#pm-canvas-wrap canvas {
  display: block;
  box-sizing: border-box;
}

/* Donkey Kong : canvas logique 480×480 — occupe toute la largeur de la colonne (évite le bloc figé ~480px) */
html:has(body.page-donkey-kong) {
  overscroll-behavior: none;
}

body.page-donkey-kong {
  overscroll-behavior: none;
}

.page-donkey-kong .dk-shell {
  width: 100%;
}

.page-donkey-kong .dk-canvas-wrap {
  width: 100%;
  box-sizing: border-box;
  border: 4px solid #fcd34d;
  border-radius: 4px;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  touch-action: none;
}

.page-donkey-kong #dk-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  touch-action: none;
}

.page-donkey-kong #dk-canvas:focus {
  outline: none;
}

.page-donkey-kong #dk-canvas:focus-visible {
  outline: 2px solid rgba(252, 211, 77, 0.45);
  outline-offset: 3px;
}

/* Bande score / pastilles / vies dans le cadre jaune (hors barre difficulté) */
.pm-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.92rem;
  color: rgba(226, 232, 240, 0.88);
  border-bottom: 1px solid rgba(252, 211, 77, 0.35);
}

.pm-hud__item strong {
  color: #fef08a;
}

.layout-mobile .pm-hud {
  gap: 0.4rem 0.9rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.88rem;
}

.pm-dpad {
  margin-top: 1rem;
  display: grid;
  grid-template-areas: ". up ." "left mid right" ". down .";
  grid-template-columns: repeat(3, 50px);
  grid-template-rows: repeat(3, 50px);
  justify-content: center;
  gap: 5px;
}

.pm-dpad__btn {
  background: #fcd34d;
  border: none;
  padding: 10px;
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: 8px;
  color: #000;
}

.pm-dpad__btn--up {
  grid-area: up;
}

.pm-dpad__mid {
  grid-area: mid;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* --- Fin de partie plein écran (PercotGameResult) : même entrée pour gagné / perdu --- */
@keyframes perc-game-fx-glow-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes perc-game-fx-badge-approach {
  0% {
    opacity: 0;
    transform: perspective(720px) translateZ(-140px) scale(0.55);
    filter: blur(6px);
  }
  55% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: perspective(720px) translateZ(0) scale(1);
    filter: blur(0);
  }
}

#perc-game-fx-root.perc-game-fx {
  --perc-fx-win-glow: rgba(52, 211, 153, 0.42);
  --perc-fx-win-glow-soft: rgba(16, 185, 129, 0.12);
  --perc-fx-lose-glow: rgba(248, 113, 113, 0.48);
  --perc-fx-lose-glow-soft: rgba(239, 68, 68, 0.14);
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  pointer-events: none;
  perspective: 900px;
}

#perc-game-fx-root.perc-game-fx[hidden] {
  display: none !important;
}

.perc-game-fx__glow {
  position: absolute;
  inset: 0;
  animation: perc-game-fx-glow-in 0.45s ease-out both;
}

.perc-game-fx--win .perc-game-fx__glow {
  background:
    radial-gradient(ellipse 85% 65% at 50% 48%, var(--perc-fx-win-glow-soft) 0%, transparent 62%),
    radial-gradient(circle at 50% 50%, var(--perc-fx-win-glow) 0%, transparent 55%),
    rgba(6, 24, 18, 0.22);
}

.perc-game-fx--lose .perc-game-fx__glow {
  background:
    radial-gradient(ellipse 85% 65% at 50% 48%, var(--perc-fx-lose-glow-soft) 0%, transparent 62%),
    radial-gradient(circle at 50% 50%, var(--perc-fx-lose-glow) 0%, transparent 58%),
    rgba(48, 10, 10, 0.2);
}

.perc-game-fx__badge {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0.55rem 1.35rem;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: clamp(1rem, 3.6vw, 1.35rem);
  line-height: 1.2;
  text-align: center;
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  animation: perc-game-fx-badge-approach 0.88s cubic-bezier(0.2, 0.9, 0.28, 1) both;
}

.perc-game-fx--win .perc-game-fx__badge {
  color: #d1fae5;
  background: linear-gradient(165deg, rgba(6, 95, 70, 0.92) 0%, rgba(4, 47, 46, 0.94) 100%);
  border: 1px solid rgba(52, 211, 153, 0.48);
  text-shadow: 0 0 24px rgba(52, 211, 153, 0.35);
}

.perc-game-fx--lose .perc-game-fx__badge {
  color: #fecaca;
  background: linear-gradient(165deg, rgba(127, 29, 29, 0.92) 0%, rgba(69, 10, 10, 0.94) 100%);
  border: 1px solid rgba(248, 113, 113, 0.48);
  text-shadow: 0 0 24px rgba(248, 113, 113, 0.32);
}

.perc-game-fx--no-badge .perc-game-fx__glow {
  animation-duration: 0.35s;
}

.perc-game-fx--reduce .perc-game-fx__glow,
.perc-game-fx--reduce .perc-game-fx__badge {
  animation: none !important;
}

.perc-game-fx--reduce .perc-game-fx__glow {
  opacity: 1;
}

.perc-game-fx--reduce .perc-game-fx__badge {
  opacity: 1;
  transform: none;
  filter: none;
}

/* --- Grades : s’adapte à la largeur/hauteur utiles (colonne principale + viewport) --- */
body.page-grades .game-page-with-lb__main {
  min-width: 0;
}

body.page-grades .game-center {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

body.page-game.page-grades .game-toolbar--grades .game-toolbar__time-block--solo-chrono {
  width: auto;
  min-width: 5.5rem;
}

body.page-game.page-grades .grades-play-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: clamp(0.65rem, 2vmin, 1.15rem);
  width: 100%;
  max-width: min(100%, 96vw, 1000px);
  margin: 0 auto;
  min-width: 0;
  box-sizing: border-box;
}

body.page-game.page-grades .grades-board-shell {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-sizing: border-box;
}

body.page-game.page-grades .grades-side-panel {
  flex: 0 0 clamp(10.75rem, 26vw, 13rem);
  min-width: 9.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(0.5rem, 1.5vmin, 0.85rem);
  padding: clamp(8px, 1.5vmin, 14px);
  box-sizing: border-box;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background:
    linear-gradient(165deg, rgba(37, 99, 235, 0.1), transparent 40%),
    rgba(15, 23, 42, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 28px rgba(0, 0, 0, 0.32);
}

body.page-game.page-grades .grades-side-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

body.page-game.page-grades .grades-side-actions .btn {
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
}

body.page-game.page-grades .grades-play-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: clamp(6px, 1.4vmin, 14px);
  box-sizing: border-box;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background:
    linear-gradient(165deg, rgba(37, 99, 235, 0.08), transparent 45%),
    rgba(15, 23, 42, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 14px 36px rgba(0, 0, 0, 0.35);
  max-height: min(92vh, calc(100vh - 10.5rem));
  max-height: min(92dvh, calc(100dvh - 10.5rem));
  overflow: hidden;
}

.grades-board-mount {
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0 0 2px;
  box-sizing: border-box;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.grades-frame {
  display: grid;
  gap: clamp(2px, 0.5vmin, 4px);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: clamp(6px, 1.3vmin, 12px);
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background:
    linear-gradient(165deg, rgba(37, 99, 235, 0.08), transparent 45%),
    rgba(15, 23, 42, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 14px 36px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

body.page-game.page-grades .grades-play-panel .grades-frame {
  border-color: rgba(148, 163, 184, 0.32);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.35);
  background: rgba(15, 23, 42, 0.72);
}

.grades-frame-pad {
  min-width: 0;
}

.grades-clue {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.65rem, min(2.8vmin, 3.2vw), 0.92rem);
  font-weight: 700;
  color: #93c5fd;
  text-align: center;
  line-height: 1.15;
  padding: clamp(1px, 0.35vmin, 4px) clamp(2px, 0.5vmin, 4px);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.55);
  box-sizing: border-box;
  transition: color 0.15s ease, background 0.15s ease;
}

.grades-clue--bad {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.35);
}

.grades-cell-wrap {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  min-width: 0;
  min-height: clamp(1.35rem, min(6vmin, 8vw), 2.95rem);
  border-radius: 6px;
  background: rgba(248, 250, 252, 0.96);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.22);
}

.grades-cell-wrap--bad {
  box-shadow: inset 0 0 0 2px rgba(239, 68, 68, 0.75);
}

.grades-cell-input {
  width: 100%;
  min-width: 0;
  margin: 0;
  border: none;
  background: transparent;
  text-align: center;
  font-size: clamp(0.78rem, min(4vmin, 5vw), 1.22rem);
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  padding: clamp(2px, 0.6vmin, 6px) clamp(1px, 0.35vmin, 3px);
  box-sizing: border-box;
  cursor: pointer;
  caret-color: transparent;
}

.grades-cell-input:focus {
  outline: none;
}

.grades-cell-input--sel {
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.9);
  border-radius: 4px;
  background: rgba(219, 234, 254, 0.55);
}

.grades-cell-input--bad {
  color: #b91c1c;
}

.grades-cell-input--mark {
  position: relative;
  color: transparent;
}

.grades-cell-input--mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.38rem;
  height: 0.38rem;
  margin: -0.19rem 0 0 -0.19rem;
  border-radius: 50%;
  background: #64748b;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.15);
}

body.page-game.page-grades .grades-side-panel .grades-mark-btn {
  font-size: 0.88rem;
}

body.page-game.page-grades .grades-side-panel .numpad {
  width: 100%;
  margin-top: 0;
  margin-bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.3rem, 1.2vmin, 0.45rem);
  box-sizing: border-box;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  flex: 0 0 auto;
}

body.page-game.page-grades .grades-side-panel .numpad .numpad__btn {
  min-height: clamp(2rem, min(7vmin, 10vw), 2.65rem);
  font-weight: 700;
  font-size: clamp(0.82rem, min(3.2vmin, 4vw), 1rem);
}

body.page-game.page-grades .grades-side-panel .numpad .numpad__erase {
  grid-column: 1 / -1;
}

@media (max-width: 760px) {
  body.page-game.page-grades:not(.layout-mobile) .grades-play-row {
    flex-direction: column;
    align-items: stretch;
    max-width: 100%;
  }

  body.page-game.page-grades:not(.layout-mobile) .grades-board-shell {
    flex: none;
    width: 100%;
  }

  body.page-game.page-grades:not(.layout-mobile) .grades-side-panel {
    flex: none;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body.page-game.page-grades:not(.layout-mobile) .grades-side-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  body.page-game.page-grades:not(.layout-mobile) .grades-side-actions .btn {
    width: auto;
    flex: 1 1 auto;
    min-width: min(100%, 8.5rem);
  }

  body.page-game.page-grades:not(.layout-mobile) .grades-side-panel .numpad {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  body.page-game.page-grades:not(.layout-mobile) .grades-side-panel .numpad .numpad__erase {
    grid-column: span 2;
  }
}

/* Démineur : pastilles Gagné / Perdu — même mouvement que PercotGameResult */
.ms-board-won-text,
.ms-board-lost-text {
  animation: perc-game-fx-badge-approach 0.88s cubic-bezier(0.2, 0.9, 0.28, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .ms-board-won-text,
  .ms-board-lost-text {
    animation: none !important;
  }
}

/* Petits écrans : hub & diff picker */
@media (max-width: 520px) {
  .diff-picker__grid {
    grid-template-columns: 1fr;
  }

  .hub-mode-switch:not(.hub-mode-switch--five) .hub-mode-switch__text {
    min-width: 0;
    padding: 0.58rem 0.5rem;
    font-size: clamp(0.95rem, 3.8vw, 1.05rem);
  }

  .site-top__hub .hub-mode-switch--five .hub-mode-switch__text {
    padding: 0.58rem 0.4rem;
    font-size: clamp(0.78rem, 3.6vw, 0.98rem);
    line-height: 1.15;
  }

  .hub-mode-switch--five .hub-mode-switch__text {
    padding: 0.56rem 0.42rem;
    font-size: clamp(0.82rem, 3.7vw, 1.02rem);
  }
}

/* --- Doughnut (torus loop puzzle) --- */
body.page-home .games-grid .game-card.game-card--doughnut:not(.game-card--disabled) {
  --gc-rail: linear-gradient(135deg, #fb923c, #f97316, #fdba74, #fb923c);
  --gc-glow: rgba(251, 146, 60, 0.55);
}

body.page-doughnut .game-center {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

body.page-game.page-doughnut .doughnut-play-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: clamp(0.65rem, 2vmin, 1.15rem);
  width: 100%;
  max-width: min(100%, 96vw, 920px);
  margin: 0 auto;
  min-width: 0;
  box-sizing: border-box;
}

body.page-game.page-doughnut .doughnut-board-shell {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}

body.page-game.page-doughnut .doughnut-side-panel {
  flex: 0 0 clamp(10.5rem, 26vw, 12.5rem);
  min-width: 9.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  padding: clamp(8px, 1.5vmin, 14px);
  box-sizing: border-box;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background:
    linear-gradient(165deg, rgba(251, 146, 60, 0.12), transparent 42%),
    rgba(15, 23, 42, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 28px rgba(0, 0, 0, 0.32);
}

body.page-game.page-doughnut .doughnut-side-panel .btn {
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
}

@media (max-width: 760px) {
  body.page-game.page-doughnut:not(.layout-mobile) .doughnut-play-row {
    flex-direction: column;
    align-items: stretch;
    max-width: 100%;
  }

  body.page-game.page-doughnut:not(.layout-mobile) .doughnut-board-shell {
    flex: none;
    width: 100%;
  }

  body.page-game.page-doughnut:not(.layout-mobile) .doughnut-side-panel {
    flex: none;
    width: 100%;
    min-width: 0;
    flex-direction: row;
    flex-wrap: wrap;
  }

  body.page-game.page-doughnut:not(.layout-mobile) .doughnut-side-panel .btn {
    flex: 1 1 auto;
    min-width: min(100%, 9rem);
    width: auto;
  }
}

body.page-doughnut .doughnut-board-wrap {
  position: relative;
  width: 100%;
  /* Même rapport que la grille 4×4/5×5/6×6 + viewBox SVG — évite le rendu « une ligne » du tracé étiré */
  aspect-ratio: 1 / 1;
}

body.page-doughnut .doughnut-path-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

body.page-doughnut .doughnut-path-line {
  stroke: rgba(250, 204, 21, 0.95);
  stroke-width: 1.8;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgba(250, 204, 21, 0.4));
}

body.page-doughnut .doughnut-path-line--result {
  stroke: rgba(103, 232, 249, 0.98);
  stroke-width: 2.1;
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.45));
}

body.page-doughnut .doughnut-board {
  position: relative;
  z-index: 2;
  display: grid;
  grid-auto-flow: row;
  align-content: stretch;
  justify-content: stretch;
  gap: clamp(6px, 1.2vmin, 9px);
  width: 100%;
  height: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding: clamp(10px, 2vmin, 14px);
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background:
    radial-gradient(circle at 28% -8%, rgba(251, 146, 60, 0.12), transparent 52%),
    rgba(15, 23, 42, 0.88);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.05), 0 14px 40px rgba(0, 0, 0, 0.38);
}

body.page-doughnut .doughnut-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  min-width: 0;
  min-height: clamp(2.2rem, 7vw, 2.75rem);
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: rgba(248, 250, 252, 0.96);
  color: #0f172a;
  cursor: pointer;
  font: inherit;
  transition:
    box-shadow 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease;
}

body.page-doughnut .doughnut-cell:hover {
  border-color: rgba(251, 146, 60, 0.55);
}

body.page-doughnut .doughnut-cell:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.75);
  outline-offset: 2px;
}

body.page-doughnut .doughnut-cell__clue {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: clamp(0.95rem, min(3.2vw, 3.2vmin), 1.2rem);
  color: #431407;
  background: linear-gradient(155deg, #fde68a, #f59e0b 50%, #d97706);
  border-radius: 8px;
  padding: 0.15rem 0.38rem;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

body.page-doughnut .doughnut-cell--path {
  background: rgba(254, 243, 199, 0.98);
  border-color: rgba(251, 191, 36, 0.65);
}

body.page-doughnut .doughnut-cell--tail {
  box-shadow:
    inset 0 0 0 2px rgba(250, 204, 21, 0.95),
    0 0 18px rgba(250, 204, 21, 0.35);
  border-color: rgba(250, 204, 21, 0.85);
  z-index: 3;
}

/* ===== Casse-brique — mode plein écran / pleine page =====
   Repli « position: fixed » pour les appareils sans API Fullscreen (iOS Safari),
   et mise en page immersive commune avec l'API native (bureau, Android). */
body.cb-fullscreen-lock {
  overflow: hidden;
}

.cb-shell.cb-fullscreen-active {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #000;
  overflow: hidden;
  box-sizing: border-box;
}

.cb-shell.cb-fullscreen-active .cb-canvas-wrap {
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.cb-shell.cb-fullscreen-active canvas {
  display: block;
  margin: 0 auto;
}

/* Score/vies et compte à rebours restent superposés au-dessus du canvas. */
.cb-shell.cb-fullscreen-active .cb-game-hud {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  flex-direction: row;
  gap: 18px;
  pointer-events: none;
}

.cb-shell.cb-fullscreen-active .status-bar {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  z-index: 2;
  text-align: center;
  pointer-events: none;
}

.cb-shell.cb-fullscreen-active .perc-countdown-overlay {
  z-index: 3;
}

/* Bouton flottant : quitter le plein écran sans perdre la partie en cours */
.cb-exit-fullscreen-btn {
  position: absolute;
  top: max(10px, env(safe-area-inset-top, 0px));
  right: max(10px, env(safe-area-inset-right, 0px));
  z-index: 5;
  margin: 0;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  touch-action: manipulation;
}

.cb-exit-fullscreen-btn:hover {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(250, 204, 21, 0.55);
}

.cb-exit-fullscreen-btn:focus-visible {
  outline: 2px solid rgba(250, 204, 21, 0.75);
  outline-offset: 2px;
}

.cb-exit-fullscreen-btn[hidden] {
  display: none !important;
}

.layout-mobile .cb-exit-fullscreen-btn {
  font-size: 0.82rem;
  padding: 0.4rem 0.72rem;
}

/* ===== Jeux arcade — plein écran / pleine page (module percot-fullscreen.js) ===== */
body.perc-fsx-lock {
  overflow: hidden;
}

.perc-fsx-active {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #000;
  box-sizing: border-box;
  overflow: hidden;
  touch-action: manipulation;
}

/* Coquilles de jeu : occuper l’espace sans décorations qui débordent */
.perc-fsx-active[class$="-shell"],
.perc-fsx-active .pm-shell,
.perc-fsx-active .tetris-shell,
.perc-fsx-active .si-shell,
.perc-fsx-active .dk-shell,
.perc-fsx-active .cb-shell {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.perc-fsx-active.game-center {
  gap: 0;
}

.perc-fsx-active .tetris-layout,
.perc-fsx-active .tetris-mobile-layout,
.perc-fsx-active .si-layout,
.perc-fsx-active .si-mobile-layout {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page-tetris .perc-fsx-active .tetris-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(148px, 188px);
  align-items: center;
  justify-items: center;
  gap: 0.65rem;
  padding: 0.35rem;
  box-sizing: border-box;
  flex: 1 1 0;
  min-height: 0;
  max-height: 100%;
  height: 100%;
  overflow: hidden;
}

@media (max-width: 760px) {
  .page-tetris .perc-fsx-active .tetris-layout {
    grid-template-columns: 1fr;
  }
}

.perc-fsx-active .tetris-stats-mobile,
.perc-fsx-active .si-stats-mobile {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.25rem 0.4rem;
}

.perc-fsx-active .tetris-controls-mobile,
.perc-fsx-active .si-controls-mobile {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.25rem 0 0.35rem;
}

.perc-fsx-active .tetris-side {
  max-height: 100%;
  overflow: hidden;
}

.perc-fsx-active [id$="-canvas-wrap"],
.perc-fsx-active .pm-canvas-wrap,
.perc-fsx-active .cb-canvas-wrap,
.perc-fsx-active .dk-canvas-wrap,
.perc-fsx-active .si-canvas-wrap,
.perc-fsx-active .tetris-canvas-wrap {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
}

.perc-fsx-active .pm-hud {
  flex: 0 0 auto;
}

.perc-fsx-active #pm-canvas-wrap,
.perc-fsx-active .pm-canvas-wrap {
  border-width: 3px;
}

.perc-fsx-active .si-canvas-wrap {
  max-width: 100% !important;
  aspect-ratio: auto !important;
}

.perc-fsx-active canvas {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 100%;
}

.perc-fsx-active .status-bar {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.2rem 0.5rem 0.35rem;
  text-align: center;
  pointer-events: none;
  font-size: 0.85rem;
  line-height: 1.25;
}

.perc-fsx-active .perc-countdown-overlay {
  z-index: 3;
}
