/* ================================================================
   PRISM 11 — La Cour de PRISM
   Couche visuelle commune aux espaces membres et jeux.
   Conçue pour compléter les feuilles existantes sans toucher au métier.
   ================================================================ */

:root {
  --court-ink: #070608;
  --court-ink-soft: #0e0b10;
  --court-panel: rgba(18, 14, 18, .88);
  --court-panel-soft: rgba(28, 21, 25, .72);
  --court-wine: #4c1725;
  --court-wine-bright: #7a2940;
  --court-gold: #c9a24d;
  --court-gold-bright: #f0d58a;
  --court-gold-pale: #fff0bd;
  --court-ivory: #f5efe3;
  --court-parchment: #d8cdbb;
  --court-muted: #aaa092;
  --court-line: rgba(230, 199, 121, .20);
  --court-line-strong: rgba(240, 213, 138, .42);
  --court-shadow: 0 32px 90px rgba(0, 0, 0, .52);
  --court-shadow-soft: 0 18px 50px rgba(0, 0, 0, .34);
  --court-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --court-text: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --court-radius: 12px;
}

html {
  color-scheme: dark;
  background: var(--court-ink);
}

body,
body.p8,
body.p8-games,
body.royal-app {
  color: var(--court-ivory) !important;
  font-family: var(--court-text) !important;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(148, 101, 36, .19), transparent 42rem),
    radial-gradient(circle at 5% 35%, rgba(91, 25, 42, .17), transparent 30rem),
    radial-gradient(circle at 96% 76%, rgba(91, 25, 42, .13), transparent 32rem),
    linear-gradient(150deg, #050406 0%, #0d090c 48%, #070608 100%) !important;
  background-attachment: fixed !important;
}

body::before,
body.p8::before,
body.p8-games::before,
body.royal-app::before {
  content: "" !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: -1 !important;
  pointer-events: none !important;
  opacity: .34 !important;
  background-image:
    linear-gradient(90deg, transparent 0 49.8%, rgba(233, 201, 123, .055) 50%, transparent 50.2%),
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .10) 1px, transparent 1.2px) !important;
  background-size: 100% 100%, 46px 46px !important;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.5) 60%, transparent 100%) !important;
}

body::after,
body.p8::after,
body.p8-games::after,
body.royal-app::after {
  content: "" !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 10000 !important;
  pointer-events: none !important;
  border: 1px solid rgba(238, 210, 137, .10) !important;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, .44) !important;
  background: none !important;
  animation: none !important;
}

::selection {
  color: #130e08;
  background: var(--court-gold-bright);
}

:focus-visible {
  outline: 2px solid var(--court-gold-bright) !important;
  outline-offset: 4px !important;
}

h1, h2, h3,
.brand span,
.p8-brand span,
.profile-name-row h1,
.profile-identity h1,
.game-card__body h3,
.games-section__head h2,
.menu-hero h1,
.lobby-header h1,
.modal-header h2,
.outcome-screen h2 {
  font-family: var(--court-display) !important;
  color: var(--court-ivory);
  font-weight: 500 !important;
  letter-spacing: -.025em !important;
  text-wrap: balance;
}

p, li, label, input, textarea, select, button, a {
  font-family: var(--court-text);
}

.kicker,
.eyebrow,
.profile-kicker,
.games-kicker,
.game-card__eyebrow,
.game-card__reward small,
.player-level small,
.player-xp__head span,
.panel-section > h2,
.lobby-header .eyebrow {
  color: var(--court-gold-bright) !important;
  font-size: .72rem !important;
  font-weight: 760 !important;
  letter-spacing: .22em !important;
  text-transform: uppercase;
}

/* Navigation cérémonielle -------------------------------------- */
.top,
.p8-header,
.topbar,
.royal-topbar {
  border: 1px solid var(--court-line) !important;
  border-radius: 0 0 14px 14px !important;
  background:
    linear-gradient(180deg, rgba(19, 14, 17, .96), rgba(8, 7, 9, .93)),
    radial-gradient(circle at 50% 0%, rgba(201, 162, 77, .13), transparent 45%) !important;
  box-shadow: 0 16px 50px rgba(0,0,0,.38), inset 0 -1px rgba(240,213,138,.08) !important;
  backdrop-filter: blur(22px) saturate(120%) !important;
}

.top::after,
.p8-header::after,
.topbar::after,
.royal-topbar::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 9px;
  height: 9px;
  transform: translateX(-50%) rotate(45deg);
  border: 1px solid rgba(240,213,138,.36);
  background: #110d10;
  box-shadow: 0 0 18px rgba(201,162,77,.18);
}

.brand img,
.p8-brand img,
.brand-mark img {
  filter: drop-shadow(0 0 14px rgba(240, 213, 138, .23)) !important;
}

.brand span,
.p8-brand span {
  color: var(--court-ivory) !important;
  font-size: clamp(1.45rem, 2.8vw, 2rem) !important;
  letter-spacing: .20em !important;
  text-shadow: 0 0 24px rgba(240,213,138,.12) !important;
}

.nav a,
.nav button,
.p8-nav a,
.topbar-actions a,
.topbar-actions button,
.royal-topbar__actions a,
.royal-topbar__actions button {
  position: relative;
  border-radius: 4px !important;
  border-color: transparent !important;
  background: transparent !important;
  color: var(--court-parchment) !important;
  font-size: .74rem !important;
  font-weight: 760 !important;
  letter-spacing: .095em !important;
  text-transform: uppercase;
  box-shadow: none !important;
}

.nav a:hover,
.nav button:hover,
.p8-nav a:hover,
.p8-nav a.is-active,
.topbar-actions a:hover,
.topbar-actions button:hover,
.royal-topbar__actions a:hover,
.royal-topbar__actions button:hover {
  color: var(--court-gold-pale) !important;
  border-color: rgba(240,213,138,.20) !important;
  background: rgba(240,213,138,.055) !important;
}

.p8-nav .p8-nav-cta,
.nav .primary,
.nav .btn.primary {
  color: #171006 !important;
  border: 1px solid rgba(255,238,184,.55) !important;
  border-radius: 4px !important;
  background: linear-gradient(135deg, #9c7130, #d3ad58 48%, #f1d68b) !important;
  box-shadow: 0 10px 28px rgba(124,84,29,.25), inset 0 1px rgba(255,255,255,.45) !important;
}

/* Panneaux, cartes et modales ---------------------------------- */
.card,
.p8-card,
.game-card,
.player-banner,
.games-hero,
.profile-card,
.friend-hub,
.game-panel,
.network-card,
.mode-card,
.join-card,
.role-builder,
.lobby-settings,
.lobby-roster-panel,
.chronicle-card,
.action-card,
.modal,
.abandon-modal,
.audio-panel {
  position: relative;
  border: 1px solid var(--court-line) !important;
  border-radius: var(--court-radius) !important;
  background:
    linear-gradient(145deg, rgba(24, 18, 22, .91), rgba(10, 8, 11, .84)),
    radial-gradient(circle at 14% 0%, rgba(201,162,77,.065), transparent 32%) !important;
  box-shadow: var(--court-shadow) !important;
}

.card::before,
.game-card::before,
.player-banner::before,
.profile-card::before,
.friend-hub::before,
.game-panel::before,
.network-card::before,
.mode-card::before,
.join-card::before,
.role-builder::before,
.lobby-settings::before,
.lobby-roster-panel::before,
.chronicle-card::before,
.action-card::before,
.modal::before {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: 0;
  pointer-events: none;
  border: 1px solid rgba(240,213,138,.075);
  border-radius: calc(var(--court-radius) - 5px);
}

.card > *,
.game-card > *,
.player-banner > *,
.profile-card > *,
.friend-hub > *,
.game-panel > *,
.network-card > *,
.mode-card > *,
.join-card > *,
.role-builder > *,
.lobby-settings > *,
.lobby-roster-panel > *,
.chronicle-card > *,
.action-card > *,
.modal > * {
  position: relative;
  z-index: 1;
}

.game-card:hover,
.mode-card:hover,
.card:hover {
  transform: translateY(-4px) !important;
  border-color: var(--court-line-strong) !important;
  box-shadow: 0 36px 100px rgba(0,0,0,.58), 0 0 44px rgba(117,76,26,.08) !important;
}

.game-card__glow,
.mode-card__halo {
  opacity: .55 !important;
  background: radial-gradient(circle, rgba(174,124,47,.22), rgba(86,24,40,.09) 48%, transparent 72%) !important;
}

.game-card--werewolf,
.menu-hero,
.lobby-view {
  background:
    linear-gradient(118deg, rgba(30,18,24,.96), rgba(9,9,12,.89)),
    radial-gradient(circle at 85% 20%, rgba(181,137,55,.11), transparent 44%) !important;
}

.game-card__body h3 {
  color: var(--court-ivory) !important;
  font-size: clamp(2.45rem, 4.2vw, 4rem) !important;
  line-height: 1 !important;
}

.game-card__body > p:last-child,
.meta,
.bio-box,
.profile-card p,
.mode-card p,
.network-card p,
.join-card p,
.panel-section p,
.game-meta-row,
.player-xp__foot {
  color: var(--court-muted) !important;
  line-height: 1.72;
}

/* Boutons ------------------------------------------------------ */
.btn,
.button,
.play-button,
.primary-button,
.round-button,
.icon-button,
.friendship-button,
button[type="submit"] {
  border-radius: 5px !important;
  border: 1px solid rgba(240,213,138,.20) !important;
  background: linear-gradient(180deg, rgba(46,34,37,.92), rgba(18,14,17,.92)) !important;
  color: var(--court-ivory) !important;
  font-weight: 760 !important;
  letter-spacing: .055em !important;
  box-shadow: inset 0 1px rgba(255,255,255,.05), 0 12px 26px rgba(0,0,0,.24) !important;
}

.btn:hover,
.button:hover,
.play-button:hover,
.primary-button:hover,
.round-button:hover,
.icon-button:hover,
.friendship-button:hover,
button[type="submit"]:hover {
  border-color: var(--court-line-strong) !important;
  color: var(--court-gold-pale) !important;
  transform: translateY(-2px);
}

.btn.primary,
.button--primary,
.play-button,
.play-button--royal,
.primary-button,
.primary-button--gold,
button[type="submit"] {
  color: #160f07 !important;
  border-color: rgba(255,239,186,.52) !important;
  background: linear-gradient(135deg, #986a29 0%, #d0a950 48%, #f2d88e 100%) !important;
  box-shadow: 0 15px 36px rgba(112,72,23,.28), inset 0 1px rgba(255,255,255,.52) !important;
}

.btn.danger,
.button--danger {
  color: #ffdfe4 !important;
  border-color: rgba(166,61,82,.45) !important;
  background: linear-gradient(180deg, rgba(100,31,48,.76), rgba(44,16,25,.88)) !important;
}

/* Formulaires -------------------------------------------------- */
input,
textarea,
select {
  border: 1px solid rgba(240,213,138,.16) !important;
  border-radius: 5px !important;
  background: rgba(7,6,8,.78) !important;
  color: var(--court-ivory) !important;
  box-shadow: inset 0 1px 10px rgba(0,0,0,.22) !important;
}

input::placeholder,
textarea::placeholder {
  color: #766d64 !important;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--court-line-strong) !important;
  box-shadow: 0 0 0 3px rgba(201,162,77,.10) !important;
  outline: none;
}

/* Identité membre --------------------------------------------- */
.profile-hero {
  min-height: 270px;
  overflow: hidden;
}

.profile-hero::after,
.profile-cover::after {
  background: radial-gradient(circle, rgba(201,162,77,.16), transparent 70%) !important;
}

.avatar,
.avatar-fallback,
.profile-avatar,
.player-avatar,
.member-pill__avatar,
.faceoff-avatar {
  border: 1px solid rgba(240,213,138,.32) !important;
  border-radius: 50% !important;
  box-shadow: 0 0 0 5px rgba(12,9,11,.86), 0 0 0 6px rgba(240,213,138,.11), 0 20px 50px rgba(0,0,0,.42) !important;
}

.avatar-fallback,
.player-avatar {
  color: #1a1107 !important;
  background: linear-gradient(145deg, #8f6428, #e0bc69) !important;
}

.badge,
.availability-badge,
.game-card__tags span,
.member-chip,
.member-pill,
.role-card {
  border-color: rgba(240,213,138,.16) !important;
  border-radius: 4px !important;
  background: rgba(236,203,123,.045) !important;
  color: var(--court-parchment) !important;
}

.profile-stats,
.profile-card__stats,
.player-banner__progress {
  border-color: rgba(240,213,138,.14) !important;
}

.progress-track,
.player-xp__track {
  overflow: hidden;
  border: 1px solid rgba(240,213,138,.13) !important;
  border-radius: 2px !important;
  background: rgba(0,0,0,.52) !important;
}

.progress-track > span,
.player-xp__track > span {
  background: linear-gradient(90deg, #7b4b25, #c79b46 52%, #f0d58a) !important;
  box-shadow: 0 0 18px rgba(201,162,77,.35) !important;
}

/* Jeux de plateau --------------------------------------------- */
.app-shell,
.royal-app {
  position: relative;
}

.board-frame,
.board-stage,
.go-board-frame,
.connect4-board-stage {
  border-radius: 8px !important;
  border-color: rgba(240,213,138,.23) !important;
  box-shadow: 0 32px 90px rgba(0,0,0,.58), 0 0 0 5px rgba(7,6,8,.62), 0 0 0 6px rgba(240,213,138,.08) !important;
}

.modal-backdrop {
  background: rgba(3,2,4,.80) !important;
  backdrop-filter: blur(14px) !important;
}

.modal-symbol,
.outcome-emblem,
.announcement-crest,
.menu-hero__emblem {
  color: var(--court-gold-bright) !important;
  filter: drop-shadow(0 0 22px rgba(201,162,77,.25));
}

/* Responsive --------------------------------------------------- */
@media (max-width: 860px) {
  .top,
  .p8-header,
  .topbar,
  .royal-topbar {
    border-radius: 0 0 10px 10px !important;
  }

  .nav,
  .p8-nav {
    border: 1px solid var(--court-line) !important;
    border-radius: 8px !important;
    background: rgba(9,7,9,.97) !important;
    box-shadow: var(--court-shadow-soft) !important;
  }

  .nav a,
  .nav button,
  .p8-nav a,
  .p8-nav .p8-nav-cta {
    width: 100%;
    min-height: 46px;
  }

  .card,
  .game-card,
  .player-banner,
  .profile-card,
  .friend-hub,
  .game-panel,
  .mode-card,
  .join-card,
  .modal {
    border-radius: 9px !important;
  }

  .profile-hero {
    text-align: center;
  }

  .profile-name-row,
  .profile-actions {
    justify-content: center;
  }
}

@media (max-width: 560px) {
  body::after,
  body.p8::after,
  body.p8-games::after,
  body.royal-app::after {
    display: none !important;
  }

  .game-card__body h3 {
    font-size: 2.55rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ================================================================
   11.1 — Refonte architecturale visible
   Cette section transforme aussi la composition, pas seulement la palette.
   ================================================================ */

body.p8-public,
body.p8-games {
  --court-page: min(1440px, calc(100% - 48px));
  background:
    linear-gradient(90deg, rgba(201,162,77,.055) 1px, transparent 1px) center / min(8vw, 110px) 100%,
    radial-gradient(ellipse at 50% -12%, rgba(153,101,36,.28), transparent 38rem),
    radial-gradient(circle at 7% 44%, rgba(94,22,42,.25), transparent 34rem),
    linear-gradient(145deg, #030304, #0d080b 48%, #050405) !important;
}

body.p8-public .p8-header,
body.p8-games .p8-header {
  width: var(--court-page) !important;
  min-height: 86px !important;
  margin: 18px auto 0 !important;
  padding: 12px 22px !important;
  border: 1px solid rgba(240,213,138,.32) !important;
  border-radius: 2px !important;
  background: linear-gradient(180deg, rgba(27,18,22,.98), rgba(7,6,8,.96)) !important;
  box-shadow: 0 26px 70px rgba(0,0,0,.52), inset 0 0 0 4px rgba(240,213,138,.035) !important;
}

body.p8-public .p8-header::before,
body.p8-games .p8-header::before {
  content: "◆";
  position: absolute;
  left: 50%;
  bottom: -17px;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  transform: translateX(-50%) rotate(45deg);
  border: 1px solid rgba(240,213,138,.42);
  background: #110c0f;
  color: var(--court-gold-bright);
  font-size: .56rem;
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
}

body.p8-public .p8-header::before,
body.p8-games .p8-header::before { line-height: 1; }

body.p8-public .p8-page,
body.p8-games .games-page {
  width: var(--court-page) !important;
  max-width: none !important;
}

/* Accueil : grande scène éditoriale, blasonnée et asymétrique. */
body.p8-public .p8-page {
  padding-top: 34px !important;
}

body.p8-public .p8-hero-home {
  min-height: min(740px, calc(100vh - 145px));
  display: grid !important;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .72fr) !important;
  align-items: stretch !important;
  gap: 0 !important;
  overflow: hidden;
  padding: 0 !important;
  border: 1px solid rgba(240,213,138,.38) !important;
  border-radius: 2px !important;
  background: linear-gradient(115deg, rgba(27,17,21,.98) 0 56%, rgba(8,7,9,.93) 56%) !important;
  box-shadow: 0 45px 130px rgba(0,0,0,.66), inset 0 0 0 6px rgba(240,213,138,.035) !important;
}

body.p8-public .p8-hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(54px, 7vw, 112px) clamp(34px, 6.6vw, 104px) !important;
}

body.p8-public .p8-hero-copy::before {
  content: "✦  MAISON COMMUNAUTAIRE • EST. 2023  ✦";
  width: fit-content;
  margin-bottom: 28px;
  color: var(--court-gold-bright);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .24em;
}

body.p8-public .p8-hero-copy::after {
  content: "";
  position: absolute;
  top: 38px;
  bottom: 38px;
  left: 28px;
  width: 1px;
  background: linear-gradient(transparent, rgba(240,213,138,.48), transparent);
}

body.p8-public .p8-hero-copy h1 {
  max-width: 850px;
  margin: 0 0 26px !important;
  font-size: clamp(4rem, 7.2vw, 8.4rem) !important;
  line-height: .86 !important;
  letter-spacing: -.055em !important;
}

body.p8-public .p8-neon-gradient {
  display: block;
  color: transparent !important;
  background: linear-gradient(110deg, #8f6428, #f3d991 48%, #b98138) !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  text-shadow: none !important;
}

body.p8-public .p8-lead {
  max-width: 720px;
  color: #c5b9a7 !important;
  font-size: clamp(1rem, 1.3vw, 1.22rem) !important;
  line-height: 1.85 !important;
}

body.p8-public .p8-actions {
  margin-top: 34px !important;
}

body.p8-public .p8-chip-row {
  margin-top: 38px !important;
  padding-top: 22px;
  border-top: 1px solid rgba(240,213,138,.12);
}

body.p8-public .p8-chip-row span {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--court-parchment) !important;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

body.p8-public .p8-hero-visual {
  min-height: 100%;
  margin: 0 !important;
  border: 0 !important;
  border-left: 1px solid rgba(240,213,138,.25) !important;
  border-radius: 0 !important;
  clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%);
}

body.p8-public .p8-hero-visual img {
  width: 100%;
  height: 100%;
  min-height: 620px;
  object-fit: cover;
  filter: saturate(.62) sepia(.15) contrast(1.06) brightness(.70);
}

body.p8-public .p8-hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(19,12,16,.82), transparent 42%), linear-gradient(0deg, rgba(4,3,4,.72), transparent 48%);
}

body.p8-public .p8-hero-note {
  z-index: 2;
  right: 28px !important;
  bottom: 28px !important;
  left: 28px !important;
  border: 1px solid rgba(240,213,138,.27) !important;
  border-radius: 2px !important;
  background: rgba(8,6,8,.84) !important;
  backdrop-filter: blur(16px);
}

body.p8-public .p8-cards {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 1px !important;
  margin: 32px 0 !important;
  padding: 1px;
  border: 1px solid rgba(240,213,138,.18);
  background: rgba(240,213,138,.18);
}

body.p8-public .p8-card {
  min-height: 300px;
  justify-content: flex-end;
  padding: 38px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: linear-gradient(150deg, rgba(27,19,22,.98), rgba(8,7,9,.98)) !important;
}

body.p8-public .p8-card > span {
  position: absolute;
  top: 28px;
  right: 30px;
  color: rgba(240,213,138,.35) !important;
  font: 500 3.8rem/1 var(--court-display) !important;
}

body.p8-public .p8-welcome {
  padding: clamp(38px, 6vw, 88px) !important;
  border-radius: 2px !important;
}

/* Catalogue : galerie de Cour, cartes larges et hiérarchie monumentale. */
body.p8-games .games-page {
  padding-top: 48px !important;
}

body.p8-games .player-banner {
  min-height: 190px;
  padding: 42px 48px !important;
  border-radius: 2px !important;
}

body.p8-games .games-section::before {
  content: "LES DIVERTISSEMENTS DE LA COUR";
  display: block;
  margin: 74px auto 18px;
  color: rgba(240,213,138,.62);
  text-align: center;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .30em;
}

body.p8-games .games-section__head {
  justify-content: center !important;
  text-align: center;
}

body.p8-games .games-section__head h2 {
  margin-bottom: 42px !important;
  font-size: clamp(3.6rem, 7vw, 7.2rem) !important;
  line-height: .9 !important;
}

body.p8-games .games-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 18px !important;
}

body.p8-games .game-card {
  min-height: 540px;
  padding: 42px !important;
  border-radius: 2px !important;
  overflow: hidden;
}

body.p8-games .game-card:nth-child(5) {
  grid-column: 1 / -1;
  min-height: 430px;
}

body.p8-games .game-card__body h3 {
  font-size: clamp(4rem, 7vw, 7.4rem) !important;
}

body.p8-games .game-card__footer {
  padding-top: 28px !important;
  border-top: 1px solid rgba(240,213,138,.12);
}

/* Membre et annuaire : panneaux carrés et lecture de registre royal. */
body:not(.p8) .page,
body:not(.p8) .page-shell {
  max-width: 1320px !important;
}

body:not(.p8) .directory-head,
body:not(.p8) .profile-hero {
  position: relative;
  padding: clamp(34px, 5vw, 72px) !important;
  border: 1px solid rgba(240,213,138,.28) !important;
  border-radius: 2px !important;
  background: linear-gradient(135deg, rgba(28,18,23,.94), rgba(8,7,9,.91)) !important;
  box-shadow: 0 34px 100px rgba(0,0,0,.55) !important;
}

body:not(.p8) .directory-head h1,
body:not(.p8) .profile-hero h1 {
  font-size: clamp(3.6rem, 7vw, 7.3rem) !important;
  line-height: .9 !important;
}

body:not(.p8) .members-list,
body:not(.p8) .friend-hub,
body:not(.p8) .profile-card,
body:not(.p8) .network-card,
body:not(.p8) .card {
  border-radius: 2px !important;
}

@media (max-width: 980px) {
  body.p8-public,
  body.p8-games { --court-page: min(100% - 24px, 1440px); }

  body.p8-public .p8-hero-home {
    grid-template-columns: 1fr !important;
  }

  body.p8-public .p8-hero-visual {
    min-height: 440px;
    border-top: 1px solid rgba(240,213,138,.2) !important;
    border-left: 0 !important;
    clip-path: none;
  }

  body.p8-public .p8-hero-visual img { min-height: 440px; }
  body.p8-games .games-grid { grid-template-columns: 1fr !important; }
  body.p8-games .game-card:nth-child(5) { grid-column: auto; }
}

@media (max-width: 640px) {
  body.p8-public,
  body.p8-games { --court-page: calc(100% - 16px); }

  body.p8-public .p8-header,
  body.p8-games .p8-header {
    min-height: 68px !important;
    margin-top: 8px !important;
  }

  body.p8-public .p8-hero-copy {
    padding: 58px 24px 42px !important;
  }

  body.p8-public .p8-hero-copy::after { display: none; }
  body.p8-public .p8-hero-copy h1 { font-size: clamp(3.3rem, 18vw, 5.2rem) !important; }
  body.p8-public .p8-cards { grid-template-columns: 1fr !important; }
  body.p8-public .p8-card { min-height: 240px; }
  body.p8-games .player-banner { padding: 28px 22px !important; }
  body.p8-games .game-card { min-height: 460px; padding: 28px 24px !important; }
}

/* ================================================================
   PRISM 11.2 — Extension complète de la Cour
   Connexion, soutien, Code PRISM et catalogue de mini-jeux compact.
   ================================================================ */

/* Connexion : véritable portail de Cour, malgré son CSS embarqué. */
body.court-auth .top {
  position: relative;
  width: min(1320px, calc(100% - 32px));
  margin-top: 16px;
  border-radius: 2px !important;
}

body.court-auth .page {
  width: min(1180px, calc(100% - 32px));
  margin: 46px auto 72px;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, .72fr);
  gap: 18px;
}

body.court-auth .card {
  min-width: 0;
  padding: clamp(28px, 4vw, 52px) !important;
  border-radius: 2px !important;
}

body.court-auth .card:first-child::after {
  content: "✦";
  position: absolute;
  top: 26px;
  right: 30px;
  color: rgba(240, 213, 138, .34);
  font: 400 2.2rem/1 var(--court-display);
}

body.court-auth h1 {
  max-width: 760px;
  font-size: clamp(2.7rem, 5.5vw, 5.4rem) !important;
  line-height: .94;
}

body.court-auth h2 {
  font-size: clamp(2rem, 3.4vw, 3rem) !important;
}

body.court-auth .tabs {
  margin: 28px 0 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(240, 213, 138, .13);
}

body.court-auth .tab {
  border-radius: 3px !important;
  background: rgba(240, 213, 138, .035) !important;
}

body.court-auth .tab.active {
  color: #160f07 !important;
  background: linear-gradient(135deg, #986a29, #d0a950 48%, #f2d88e) !important;
}

body.court-auth .quick {
  display: grid;
  gap: 1px;
  padding: 1px;
  border: 1px solid rgba(240, 213, 138, .14);
  background: rgba(240, 213, 138, .12);
}

body.court-auth .quick a {
  border: 0 !important;
  border-radius: 0 !important;
  background: rgba(10, 8, 11, .94) !important;
}

body.court-auth .footer {
  color: var(--court-muted);
}

/* Soutien : même architecture, avec une chaleur plus rassurante. */
body.p8-support .p8-header {
  position: relative;
  width: min(1320px, calc(100% - 32px));
  margin: 16px auto 0;
  border-radius: 2px !important;
}

body.p8-support .support-public-wrap {
  width: min(1180px, calc(100% - 32px)) !important;
  padding: 42px 0 72px !important;
}

body.p8-support .support-public-hero {
  min-height: 360px;
  padding: clamp(32px, 5vw, 64px) !important;
  border: 1px solid var(--court-line) !important;
  border-radius: 2px !important;
  background: linear-gradient(118deg, rgba(31, 19, 24, .96), rgba(9, 8, 11, .90)) !important;
  box-shadow: var(--court-shadow) !important;
}

body.p8-support .support-public-hero h1 {
  max-width: 800px;
  margin: 0 0 20px;
  font-size: clamp(3rem, 6vw, 6.2rem) !important;
  line-height: .92;
}

body.p8-support .support-public-hero .prism-lead {
  max-width: 710px;
  color: var(--court-parchment) !important;
  font-size: 1.05rem;
  line-height: 1.82;
}

body.p8-support .prism-hero-logo {
  filter: sepia(.18) saturate(.72) brightness(.83) drop-shadow(0 28px 60px rgba(0,0,0,.5));
}

body.p8-support .support-public-card,
body.p8-support .support-trust-item,
body.p8-support .support-meta,
body.p8-support .support-ticket-card,
body.p8-support .support-inline-form {
  border-color: var(--court-line) !important;
  border-radius: 2px !important;
  background: linear-gradient(145deg, rgba(24, 18, 22, .91), rgba(10, 8, 11, .84)) !important;
}

body.p8-support #root {
  padding: clamp(24px, 4vw, 42px) !important;
}

body.p8-support .support-tabs button,
body.p8-support .support-pill,
body.p8-support .support-badge,
body.p8-support .support-live-state,
body.p8-support .support-emergency,
body.p8-support .support-ok {
  border-radius: 3px !important;
}

/* Code PRISM : registre royal, dense et lisible. */
body.court-code .site-header {
  position: sticky;
  top: 0;
  padding: 0 !important;
  border: 0 !important;
  background: rgba(7, 6, 8, .88) !important;
  backdrop-filter: blur(20px);
}

body.court-code .topbar.wrap {
  position: relative;
  width: min(1320px, calc(100% - 32px)) !important;
  min-height: 82px;
  margin: 0 auto;
  padding: 12px 18px !important;
  border: 1px solid var(--court-line) !important;
  border-top: 0 !important;
  border-radius: 0 0 2px 2px !important;
}

body.court-code .brand span strong {
  color: var(--court-ivory) !important;
  font-family: var(--court-display) !important;
  font-size: 1.5rem !important;
  font-weight: 500 !important;
  letter-spacing: .02em !important;
}

body.court-code .brand span small {
  color: var(--court-muted) !important;
}

body.court-code .main-nav a {
  border-radius: 3px !important;
  color: var(--court-parchment) !important;
  font-size: .72rem;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body.court-code .main-nav a:hover,
body.court-code .main-nav a.active {
  color: var(--court-gold-pale) !important;
  border-color: var(--court-line) !important;
  background: rgba(240, 213, 138, .055) !important;
}

body.court-code .hero.wrap,
body.court-code main.wrap,
body.court-code section.wrap,
body.court-code .footer.wrap {
  width: min(1240px, calc(100% - 32px)) !important;
}

body.court-code .hero {
  padding-top: 52px;
}

body.court-code .official-card,
body.court-code .hero-card,
body.court-code .footer-card,
body.court-code .article-card,
body.court-code .search-box,
body.court-code .result-card,
body.court-code .level-card,
body.court-code .sidebar {
  position: relative;
  border: 1px solid var(--court-line) !important;
  border-radius: 2px !important;
  background: linear-gradient(145deg, rgba(24, 18, 22, .93), rgba(10, 8, 11, .88)) !important;
  box-shadow: var(--court-shadow-soft) !important;
}

body.court-code .hero-card {
  padding: clamp(34px, 5vw, 64px) !important;
}

body.court-code .hero-card h1,
body.court-code .page-title-card h1 {
  font-size: clamp(3rem, 6vw, 6.4rem) !important;
  line-height: .92;
}

body.court-code .page-title-card h1 {
  font-size: clamp(2.7rem, 5vw, 5.2rem) !important;
}

body.court-code .level-card,
body.court-code .toc-card,
body.court-code .book-card,
body.court-code .article-card,
body.court-code .search-result-card {
  border-radius: 2px !important;
  background: rgba(240, 213, 138, .035) !important;
}

body.court-code .btn,
body.court-code .article-actions a,
body.court-code .article-actions button {
  border-radius: 3px !important;
}

/* Mini-jeux : cartes plus compactes, sans hauteurs artificielles. */
body.p8-games .games-section::before {
  margin-top: 56px;
}

body.p8-games .games-section__head h2 {
  margin-bottom: 28px !important;
  font-size: clamp(2.8rem, 5vw, 5.4rem) !important;
}

body.p8-games .games-grid {
  align-items: stretch;
  gap: 16px !important;
}

body.p8-games .game-card,
body.p8-games .game-card:nth-child(5) {
  display: flex !important;
  min-height: 0 !important;
  padding: 30px !important;
  flex-direction: column;
  gap: 20px;
}

body.p8-games .game-card__body {
  align-self: auto;
  padding: 8px 0 0 !important;
}

body.p8-games .game-card__body h3 {
  font-size: clamp(2.8rem, 4.5vw, 4.5rem) !important;
}

body.p8-games .game-card__body > p:last-child {
  margin-top: 12px;
}

body.p8-games .game-card__tags {
  align-self: auto;
  margin: 0 !important;
}

body.p8-games .game-card__footer {
  margin-top: auto;
  padding-top: 20px !important;
}

body.p8-games .game-card:nth-child(5) {
  min-height: 0 !important;
}

@media (max-width: 860px) {
  body.court-auth .page { grid-template-columns: 1fr; }
  body.p8-support .support-public-hero { min-height: 0; }
  body.court-code .main-nav {
    border: 1px solid var(--court-line) !important;
    border-radius: 3px !important;
    background: rgba(9, 7, 9, .98) !important;
  }
  body.court-code .main-nav a { width: 100%; }
}

@media (max-width: 640px) {
  body.court-auth .top,
  body.court-auth .page,
  body.p8-support .p8-header,
  body.p8-support .support-public-wrap,
  body.court-code .topbar.wrap,
  body.court-code .hero.wrap,
  body.court-code main.wrap,
  body.court-code section.wrap,
  body.court-code .footer.wrap {
    width: calc(100% - 16px) !important;
  }

  body.court-auth .card,
  body.p8-support .support-public-hero,
  body.p8-support #root,
  body.court-code .hero-card {
    padding: 26px 22px !important;
  }

  body.court-auth h1,
  body.p8-support .support-public-hero h1,
  body.court-code .hero-card h1,
  body.court-code .page-title-card h1 {
    font-size: clamp(2.6rem, 13vw, 4rem) !important;
  }

  body.p8-support .prism-hero-logo { width: min(260px, 80vw); }
  body.p8-games .game-card,
  body.p8-games .game-card:nth-child(5) { min-height: 0 !important; padding: 24px 22px !important; }
}
