:root {
  --bg: #eef0f6;
  --surface: #ffffff;
  --surface-sunken: #f1f2f8;
  --border: #dadde9;
  --text: #11131c;
  --text-muted: #5b6074;
  --accent: #6d28d9;
  --accent2: #0891b2;
  --accent-strong: #5b21b6;
  --accent-contrast: #ffffff;
  --accent-soft: #ded2fb;
  --warn-bg: #fdf2db;
  --warn-text: #92580b;
  --warn-border: #f0d49a;
  --error-bg: #fbe4e9;
  --error-text: #a3123f;
  --error-border: #f3c0cf;
  --ok: #0f9d68;
  --running: #b45309;
  --idle: #797f93;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 8px 24px -12px rgb(0 0 0 / 0.14);
  --shadow-lift: 0 4px 10px -2px rgb(0 0 0 / 0.1), 0 16px 32px -14px rgb(0 0 0 / 0.2);
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Rajdhani", Inter, sans-serif;
  --portal-gradient: linear-gradient(90deg, #8b5cf6, #22d3ee, #f472b6, #facc15);
  --blob-1: 262 83% 60%;
  --blob-2: 189 85% 45%;
  --blob-3: 330 81% 58%;
  --blob-4: 45 93% 50%;
  --blob-alpha: 0.15;
  --glow-alpha: 0.4;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c12;
    --surface: #131620;
    --surface-sunken: #0d0f17;
    --border: #262c3c;
    --text: #edf0fa;
    --text-muted: #8890a8;
    --accent: #8b5cf6;
    --accent2: #22d3ee;
    --accent-strong: #a78bfa;
    --accent-contrast: #0a0c12;
    --accent-soft: #352566;
    --warn-bg: #2e2412;
    --warn-text: #f0c069;
    --warn-border: #543f17;
    --error-bg: #2e141c;
    --error-text: #ff7a93;
    --error-border: #5c1f30;
    --ok: #34e7a6;
    --running: #ffcf4d;
    --idle: #8891a6;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px -12px rgb(0 0 0 / 0.6);
    --shadow-lift: 0 4px 10px -2px rgb(0 0 0 / 0.45), 0 20px 44px -16px rgb(0 0 0 / 0.7);
    --blob-alpha: 0.28;
    --glow-alpha: 0.6;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0c12;
  --surface: #131620;
  --surface-sunken: #0d0f17;
  --border: #262c3c;
  --text: #edf0fa;
  --text-muted: #8890a8;
  --accent: #8b5cf6;
  --accent2: #22d3ee;
  --accent-strong: #a78bfa;
  --accent-contrast: #0a0c12;
  --accent-soft: #352566;
  --warn-bg: #2e2412;
  --warn-text: #f0c069;
  --warn-border: #543f17;
  --error-bg: #2e141c;
  --error-text: #ff7a93;
  --error-border: #5c1f30;
  --ok: #34e7a6;
  --running: #ffcf4d;
  --idle: #8891a6;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px -12px rgb(0 0 0 / 0.6);
  --shadow-lift: 0 4px 10px -2px rgb(0 0 0 / 0.45), 0 20px 44px -16px rgb(0 0 0 / 0.7);
  --blob-alpha: 0.20;
  --glow-alpha: 0.55;
}

* { box-sizing: border-box; }

html, body { margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

#create, #join-panel { scroll-margin-top: 1.5rem; }

[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
}

/* Fond décoratif : des portails de couleur, un par univers de jeu fusionné,
   fixes derrière le contenu, plus un quadrillage très discret façon HUD. */
.bg-deco {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(560px 420px at 88% -6%, hsl(var(--blob-1) / var(--blob-alpha)), transparent 70%),
    radial-gradient(480px 380px at -4% 12%, hsl(var(--blob-2) / var(--blob-alpha)), transparent 70%),
    radial-gradient(520px 420px at 96% 70%, hsl(var(--blob-3) / var(--blob-alpha)), transparent 70%),
    radial-gradient(420px 360px at 6% 94%, hsl(var(--blob-4) / var(--blob-alpha)), transparent 70%),
    repeating-linear-gradient(0deg, hsl(0 0% 50% / 0.025) 0px, transparent 1px, transparent 32px),
    repeating-linear-gradient(90deg, hsl(0 0% 50% / 0.025) 0px, transparent 1px, transparent 32px);
  animation: drift 50s ease-in-out infinite alternate;
}

.particles-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

@keyframes drift {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  to { background-position: -3% 2%, 2% -3%, -2% -2%, 3% 2%, 0 0, 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-deco { animation: none; }
}

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 0.75rem 1.25rem;
  padding: 0.7rem clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

.brand-mark {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent);
  filter: drop-shadow(0 0 7px hsl(var(--blob-1) / var(--glow-alpha)));
}
.brand-mark svg { width: 100%; height: 100%; }

.brand-dot { color: var(--accent2); }

.nav-links { flex: 1; display: flex; align-items: center; gap: 0.5rem 1rem; min-width: 0; }
.nav-main { display: flex; align-items: center; gap: 0.15rem; margin: 0 auto; }
.nav-side { display: flex; align-items: center; gap: 0.15rem; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-link svg { width: 1.05rem; height: 1.05rem; flex-shrink: 0; }
.nav-link:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.nav-link[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.nav-link-icon .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nav-link-icon { padding: 0.5rem; }

.nav-toggle {
  display: none; margin-left: auto; padding: 0.45rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.nav-toggle svg { width: 1.3rem; height: 1.3rem; display: block; }

/* Écran étroit : le menu se replie derrière un bouton, en liste verticale. */
@media (max-width: 1180px) {
  .topbar { flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; }
  .nav-links { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0.5rem; padding: 0.5rem 0 0.25rem; }
  .topbar.is-open .nav-links { display: flex; }
  .nav-main, .nav-side { flex-direction: column; align-items: stretch; margin: 0; }
  .nav-link { padding: 0.65rem 0.8rem; font-size: 0.9rem; }
  .nav-link-icon .nav-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .nav-link-icon { padding: 0.65rem 0.8rem; }
  .nav-links .discord-account { padding: 0.25rem 0.8rem; }
}

.tagline {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
  font-weight: 500;
}

.app {
  padding: 1rem clamp(1rem, 4vw, 3rem) 4rem;
  max-width: 1180px;
  margin: 0 auto;
  position: relative;
}

h1 {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
  letter-spacing: 0.005em;
}

h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.01em;
}
h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.h-icon { width: 1.25rem; height: 1.25rem; color: var(--accent); flex-shrink: 0; filter: drop-shadow(0 0 5px hsl(var(--blob-1) / var(--glow-alpha))); }
.h-icon-sm { width: 1.05rem; height: 1.05rem; color: var(--accent); flex-shrink: 0; }

.muted { color: var(--text-muted); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  padding-top: calc(1.5rem + 3px);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--portal-gradient);
  background-size: 200% 100%;
  opacity: 0.8;
  animation: portal-shimmer 7s linear infinite;
}

.panel-narrow { max-width: 480px; margin: 2rem auto; }

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

.hero-mark {
  width: 3.4rem;
  height: 3.4rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-sunken);
  color: var(--accent);
  position: relative;
}
.hero-mark::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  padding: 2px;
  background: var(--portal-gradient);
  background-size: 300% 100%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: portal-shimmer-wide 5s linear infinite;
}
.hero-mark svg { width: 1.8rem; height: 1.8rem; filter: drop-shadow(0 0 6px hsl(var(--blob-1) / var(--glow-alpha))); }
.hero-mark-ok { color: var(--ok); }
.hero-mark-ok svg { filter: drop-shadow(0 0 6px hsl(165 70% 45% / var(--glow-alpha))); }

.panel-hero .field, .panel-hero form { text-align: left; }

/* --------------------------------------------------------------------- accueil */

.hero {
  text-align: center;
  max-width: 640px;
  margin: clamp(1.5rem, 5vw, 4rem) auto 3rem;
  padding: 0 0.5rem;
}

.hero-mark-xl {
  width: 4.6rem;
  height: 4.6rem;
  margin-bottom: 1.3rem;
}
.hero-mark-xl svg { width: 2.4rem; height: 2.4rem; }

.hero-title {
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  line-height: 1.1;
  margin: 0 0 1rem;
}

.hero-accent {
  background: var(--portal-gradient);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: portal-shimmer-wide 6s linear infinite;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 46ch;
  margin: 0 auto 1.8rem;
}

.hero-cta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2rem;
}
.hero-cta .btn { width: auto; }

.hero-stats {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.hero-stats li { display: flex; align-items: center; gap: 0.4rem; }
.hero-stats svg, .hero-stats .icon { width: 1rem; height: 1rem; color: var(--accent); }
.hero-stats strong { color: var(--text); font-family: var(--font); font-weight: 700; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  max-width: 980px;
  margin: 0 auto 3rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.3rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.feature-card:hover { transform: translateY(-2px); border-color: var(--accent); }

.feature-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  margin-bottom: 0.8rem;
}
.feature-icon svg { width: 1.4rem; height: 1.4rem; }

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  margin: 0 0 0.4rem;
}

.feature-card p { font-size: 0.88rem; color: var(--text-muted); margin: 0; }

@media (max-width: 600px) {
  .hero-cta .btn { width: 100%; }
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  margin-top: 1.25rem;
}

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

.stack { display: flex; flex-direction: column; gap: 0.9rem; }

.field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; }
.field > span { font-weight: 600; }
.field .hint { font-weight: 400; color: var(--text-muted); }
.field-inline { flex-direction: row; align-items: center; gap: 0.5rem; }
.field-inline > span { white-space: nowrap; }

input, select, button {
  font-family: inherit;
  font-size: 0.95rem;
}

input:not([type="checkbox"]), select {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.55rem 0.7rem;
  color: var(--text);
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

input:not([type="checkbox"]):focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.btn {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 0.6rem 1.1rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: filter 0.1s ease, transform 0.08s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.btn svg { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }

.btn:active { transform: translateY(1px) scale(0.99); }

.btn-lg { padding: 0.75rem 1.4rem; font-size: 1.05rem; width: 100%; }

.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  color: var(--accent-contrast);
  box-shadow: 0 2px 14px -4px hsl(var(--blob-1) / 0.55);
}
.btn-primary:hover { filter: brightness(1.1) saturate(1.1); transform: translateY(-1px); box-shadow: 0 8px 20px -6px hsl(var(--blob-1) / 0.65); }

.btn-secondary {
  background: var(--surface-sunken);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--accent); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.btn-danger { color: var(--error-text); border-color: var(--error-border); background: var(--error-bg); }

.callout {
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.callout-warn { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-border); }
.callout-error { background: var(--error-bg); color: var(--error-text); border-color: var(--error-border); }

.hidden { display: none !important; }

.copy-row { display: flex; gap: 0.5rem; }
.copy-row input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }
.copy-row-compact { max-width: 420px; width: 100%; }

.room-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.badges { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.4rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge svg, .badge .icon { width: 0.85em; height: 0.85em; }

.badge-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); box-shadow: 0 0 10px -4px color-mix(in srgb, var(--ok) 60%, transparent); }
.badge-running { color: var(--running); border-color: color-mix(in srgb, var(--running) 45%, var(--border)); box-shadow: 0 0 10px -4px color-mix(in srgb, var(--running) 60%, transparent); }
.badge-running svg { animation: spin 1.6s linear infinite; }
.badge-error { color: var(--error-text); border-color: var(--error-border); background: var(--error-bg); }
.badge-idle { color: var(--idle); }

.icon { display: inline-flex; width: 1em; height: 1em; vertical-align: -0.15em; }
.icon svg { width: 100%; height: 100%; }

.hint { font-size: 0.82rem; color: var(--text-muted); font-weight: 400; }

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

.player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.player:hover { border-color: var(--accent); transform: translateX(2px); }

.player-info { display: flex; align-items: center; gap: 0.7rem; }

.avatar {
  flex-shrink: 0;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  text-shadow: 0 1px 1px rgb(0 0 0 / 0.2);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px color-mix(in srgb, var(--accent) 50%, transparent);
}

.player-name { font-weight: 700; }
.player-game { color: var(--text-muted); font-size: 0.85rem; }

.state-line { font-size: 0.9rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem; }

.inline-form { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

.tracker { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tracker th { text-align: left; color: var(--text-muted); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; padding-bottom: 0.5rem; }
.tracker td { padding: 0.55rem 0.5rem 0.55rem 0; border-top: 1px solid var(--border); }

.progress {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  overflow: hidden;
  min-width: 120px;
  display: inline-block;
  vertical-align: middle;
}
.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--portal-gradient);
  background-size: 300% 100%;
  box-shadow: 0 0 8px -1px hsl(var(--blob-1) / 0.7);
  transition: width 0.5s cubic-bezier(.3,.8,.4,1);
  animation: portal-shimmer-wide 5s linear infinite;
}

.progress-pct { font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: 0.85rem; margin-left: 0.5rem; }

.empty { color: var(--text-muted); font-size: 0.9rem; padding: 0.5rem 0; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-top: 1rem; }
.admin-table th { text-align: left; color: var(--text-muted); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; padding-bottom: 0.5rem; }
.admin-table td { padding: 0.6rem 0.4rem 0.6rem 0; border-top: 1px solid var(--border); vertical-align: top; }
.admin-table code { background: var(--surface-sunken); border-radius: 5px; padding: 0.1rem 0.4rem; font-size: 0.85em; }

input[type="file"] {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 220px;
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes portal-shimmer { to { background-position: -200% 0; } }
@keyframes portal-shimmer-wide { to { background-position: -300% 0; } }

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px -4px var(--glow-color, transparent); }
  50% { box-shadow: 0 0 16px 0px var(--glow-color, transparent); }
}

.badge-ok { --glow-color: color-mix(in srgb, var(--ok) 65%, transparent); animation: pulse-glow 2.6s ease-in-out infinite; }
.badge-running { --glow-color: color-mix(in srgb, var(--running) 65%, transparent); animation: pulse-glow 1.6s ease-in-out infinite; }

.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
  .badge-running svg, .spinner { animation: none; }
  .progress > span { transition: none; }
  .btn, .player { transition: none; }
  .panel::before, .stat-tile::before, .hero-mark::before, .progress > span,
  .badge-ok, .badge-running, .hero-accent { animation: none; }
  .feature-card { transition: none; }
}

/* --------------------------------------------------------------------- guide */

.guide { max-width: 760px; }

.guide-intro h1 { font-size: 1.9rem; }

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  margin: 1.5rem 0;
  padding: 0;
}

.toc a {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.32rem 0.8rem;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.toc a:hover { color: var(--accent); border-color: var(--accent); }

.guide-body h2 { font-size: 1.3rem; }
.guide-body .panel { scroll-margin-top: 1rem; }
.guide-body p, .guide-body li { font-size: 0.95rem; }
.guide-body ul { padding-left: 1.2rem; margin: 0.5rem 0; }
.guide-body li + li { margin-top: 0.3rem; }
.guide-body code { background: var(--surface-sunken); border-radius: 5px; padding: 0.1rem 0.4rem; font-size: 0.85em; }
.guide-body a:not(.btn) { color: var(--accent-strong); }

/* --------------------------------------------------------------------- stats */

.stats-page h1 { display: flex; align-items: center; gap: 0.55rem; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
  position: relative;
  overflow: hidden;
}
.stat-tile::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--portal-gradient);
  background-size: 200% 100%;
  opacity: 0.8;
  animation: portal-shimmer 7s linear infinite;
}

.stat-tile-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-tile-head svg, .stat-tile-head .icon { width: 1rem; height: 1rem; color: var(--accent); flex-shrink: 0; }

/* Chiffre clé : police courante (jamais la display), graisse semi-grasse,
   chiffres proportionnels (pas tabular-nums : ce n'est pas une colonne alignée). */
.stat-tile-value {
  font-family: var(--font);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.15;
  margin-top: 0.3rem;
  letter-spacing: -0.01em;
}

.stat-tile-sub { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.2rem; }

.stats-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* Barre empilée (part-to-whole, couleurs de statut réservées) : un écart de 2px
   en couleur de surface sépare chaque segment, jamais de contour. */
.stacked-bar {
  display: flex;
  gap: 2px;
  height: 20px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
}
.stacked-bar > span { display: block; height: 100%; }

.status-legend {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.status-legend li { display: flex; align-items: center; gap: 0.35rem; }
.status-legend svg, .status-legend .icon { width: 0.9rem; height: 0.9rem; }
.status-legend strong { color: var(--text); font-weight: 700; margin-left: 0.1rem; }

.legend-swatch {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Classement (magnitude) : une seule teinte, longueur = valeur, étiquette
   directe au bout de la barre — jamais une teinte par rang. */
.bar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }

.bar-row { display: grid; grid-template-columns: 9rem 1fr auto; align-items: center; gap: 0.6rem; }

.bar-row-label {
  font-size: 0.85rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row-track { position: relative; height: 14px; }

.bar-fill {
  display: block;
  height: 100%;
  min-width: 3px;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 8px -1px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: width 0.5s cubic-bezier(.3,.8,.4,1);
}

.bar-row-value {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 1.6rem;
  text-align: right;
}

.table-toggle { margin-top: 1rem; }
.table-toggle summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.table-toggle table { margin-top: 0.75rem; }

@media (max-width: 760px) {
  .stats-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 6.5rem 1fr auto; }
}

/* --------------------------------------------------------------------- salon : aide aux débutants */

.room > .panel { margin-top: 1.25rem; }

.panel-desc { color: var(--text-muted); font-size: 0.92rem; margin: -0.25rem 0 1.1rem; max-width: 62ch; }

.invite-box { display: flex; flex-direction: column; gap: 0.35rem; max-width: 460px; width: 100%; }
.invite-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.btn-row .btn { flex: 1 1 auto; }
.stack-sm { display: flex; flex-direction: column; gap: 0.7rem; }
.field-help { font-size: 0.82rem; color: var(--text-muted); font-weight: 400; min-height: 2.4em; }

.callout-info {
  background: color-mix(in srgb, var(--accent2) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--accent2) 35%, var(--border));
  color: var(--text);
  line-height: 1.55;
}

.table-scroll { overflow-x: auto; }

/* Étapes numérotées (hôte et inscription) */

.step-num {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-contrast);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 12px -3px hsl(var(--blob-1) / 0.6);
}

h3.step-title {
  font-size: 1.2rem;
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--text);
  margin: 0.15rem 0 0.25rem;
}

.step-desc { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 0.9rem; max-width: 68ch; }

.host-step { display: flex; gap: 0.9rem; padding: 1rem 0; border-top: 1px solid var(--border); }
.host-step:first-of-type { border-top: 0; padding-top: 0.25rem; }
.host-step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.host-step-body .step-desc { margin: 0; }
.host-step .state-line {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  color: var(--text);
  white-space: pre-line;   /* le journal d'une partie arrêtée garde ses lignes */
  overflow-wrap: anywhere;
}

/* Inscription */

.join-panel { padding: clamp(1.25rem, 3vw, 2.25rem); padding-top: calc(clamp(1.25rem, 3vw, 2.25rem) + 3px); }
.join-head h2 { font-size: 1.8rem; }
.join-intro { color: var(--text-muted); font-size: 1rem; max-width: 70ch; margin: 0 0 1.5rem; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }

.step {
  display: flex;
  gap: 1.1rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}
.step:first-child { border-top: 0; padding-top: 0.5rem; }
.step-body { flex: 1; min-width: 0; }

.input-lg:not([type="checkbox"]) { font-size: 1.05rem; padding: 0.75rem 0.9rem; max-width: 420px; }

.search-box { position: relative; display: flex; align-items: center; max-width: 420px; width: 100%; }
.search-box svg { position: absolute; left: 0.75rem; width: 1.05rem; height: 1.05rem; color: var(--text-muted); pointer-events: none; }
.search-box input:not([type="checkbox"]) { padding-left: 2.3rem; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.6rem;
  margin-top: 0.9rem;
  max-height: 420px;
  overflow-y: auto;
  padding: 0.2rem 0.3rem 0.2rem 0.1rem;
}

.game-card {
  font: inherit;
  text-align: left;
  color: var(--text);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.game-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }
.game-card[aria-checked="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.game-card-name { font-weight: 700; font-size: 0.95rem; line-height: 1.3; }
.game-card-meta { display: flex; align-items: center; gap: 0.45rem; font-size: 0.78rem; color: var(--text-muted); }

.tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
}
.tag-officiel { color: var(--accent-strong); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.tag-apworld { color: var(--accent2); border-color: color-mix(in srgb, var(--accent2) 40%, var(--border)); }

.game-picked {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  max-width: 640px;
}
.game-picked-check {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ok);
  color: #fff;
  flex-shrink: 0;
}
.game-picked-check .icon { width: 1.1rem; height: 1.1rem; }
.game-picked-text { display: flex; flex-direction: column; line-height: 1.25; margin-right: auto; }
.game-picked-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.game-picked-text strong { font-size: 1.1rem; }

/* Options */

.options-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin: 1.1rem 0 1rem;
}
.options-toolbar .search-box { flex: 1 1 240px; }
.options-count { font-size: 0.88rem; font-weight: 600; color: var(--text-muted); }
.options-count.is-modified { color: var(--accent-strong); }

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 0.9rem;
  align-items: start;
}

.opt {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.opt.is-modified {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-sunken));
}
.opt.is-modified::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(var(--accent), var(--accent2));
}

.opt-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.opt-label { font-weight: 700; font-size: 1rem; line-height: 1.3; }
.opt-kind {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.opt-help {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.opt.is-expanded .opt-help { -webkit-line-clamp: unset; display: block; }
.opt-help-empty { font-style: italic; opacity: 0.8; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-strong);
  cursor: pointer;
  align-self: flex-start;
}
.link-btn:hover { text-decoration: underline; }

.opt-control { margin-top: 0.15rem; }

.opt-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
  padding-top: 0.55rem;
  margin-top: 0.1rem;
}
.opt-default strong { color: var(--text); font-weight: 600; }
.opt-reset { visibility: hidden; align-self: center; }
.opt.is-modified .opt-reset { visibility: visible; }

/* Réglage mis en avant (Death Link) : occupe toute la largeur, en tête de liste. */
.opt-featured { grid-column: 1 / -1; border-color: color-mix(in srgb, var(--accent2) 45%, var(--border)); }

/* Aléatoire : le contrôle normal est grisé, Archipelago tirera la valeur. */
.opt-random { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; }
.random-btn { display: inline-flex; align-items: center; gap: 0.35rem; }
.random-btn .icon, .random-btn svg { width: 1rem; height: 1rem; }
.random-btn[aria-pressed="true"] { border-color: var(--accent2); color: var(--accent2); background: color-mix(in srgb, var(--accent2) 14%, var(--surface)); }
.random-note, .random-flavors { display: none; }
.random-note { font-size: 0.75rem; color: var(--text-muted); }
.opt.is-random .random-note { display: inline; }
.opt.is-random .random-flavors { display: flex; flex-basis: 100%; }
.opt.is-random .opt-control { opacity: 0.4; }
.opt.is-random.is-modified { border-color: var(--accent2); }

.player-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.25rem; }
.ptag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.ptag .icon, .ptag svg { width: 0.85rem; height: 0.85rem; }
.ptag-death { color: var(--error-text); border-color: var(--error-border); }
.ptag-random { color: var(--accent2); border-color: color-mix(in srgb, var(--accent2) 45%, var(--border)); }
.player-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }

/* Interrupteur */

.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: none;
  border: 0;
  padding: 0.2rem 0;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.switch-track {
  width: 2.9rem;
  height: 1.6rem;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  transition: background 0.18s ease;
  flex-shrink: 0;
}
.switch-thumb {
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
  transition: transform 0.18s ease;
}
.switch[aria-checked="true"] .switch-track { background: linear-gradient(120deg, var(--accent), var(--accent2)); }
.switch[aria-checked="true"] .switch-thumb { transform: translateX(1.3rem); }
.switch[aria-checked="false"] .switch-text { color: var(--text-muted); }

/* Boutons segmentés */

.segmented { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.segmented button {
  flex: 1 1 auto;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.segmented button:hover { border-color: var(--accent); color: var(--text); }
.segmented button[aria-checked="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--text);
}

/* Curseur + nombre */

.range-row { display: flex; align-items: center; gap: 0.75rem; }
input.range-num { max-width: 6.5rem; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
input.range-num.is-invalid { border-color: var(--error-text); }

input[type="range"] {
  flex: 1;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2)) 0 / var(--fill, 0%) 100% no-repeat, var(--border);
  cursor: pointer;
}
input[type="range"]:focus { box-shadow: none; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.3);
}
input[type="range"]::-moz-range-thumb {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.3);
}

.range-scale { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text-muted); margin-top: 0.3rem; padding-right: 7.25rem; }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-top: 0.6rem; }
.chips-label { font-size: 0.75rem; color: var(--text-muted); margin-right: 0.15rem; }
.chip {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.chip span { color: var(--text-muted); font-weight: 500; margin-left: 0.15rem; }
.chip:hover { border-color: var(--accent); }
.chip.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }

/* Aperçu YAML */

.yaml-preview { margin-top: 1.25rem; }
.yaml-preview summary { cursor: pointer; font-size: 0.88rem; font-weight: 600; color: var(--accent-strong); }
.yaml-preview .hint { margin: 0.5rem 0; }
.yaml-preview pre {
  margin: 0;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  overflow: auto;
  max-height: 360px;
}

.join-submit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.join-submit .btn-lg { max-width: 420px; font-size: 1.15rem; padding: 0.9rem 1.6rem; }

@media (max-width: 600px) {
  .step { gap: 0.75rem; }
  .step-num { width: 1.8rem; height: 1.8rem; font-size: 0.95rem; }
  .join-head h2 { font-size: 1.5rem; }
  .game-grid { grid-template-columns: 1fr 1fr; max-height: 360px; }
}

@media (prefers-reduced-motion: reduce) {
  .switch-thumb, .switch-track, .game-card, .opt { transition: none; }
}

/* Sans espace hôte, la liste des joueurs prend toute la largeur. */
.grid:has(> #host-panel[hidden]) { grid-template-columns: 1fr; }

/* Bibliothèque de jeux */

.library-page h1 { display: flex; align-items: center; gap: 0.55rem; }
.lib-toolbar { margin: 1rem 0 1.5rem; }
.lib-toolbar-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.9rem 1.25rem; }
.lib-toolbar-row .search-box { flex: 1 1 260px; }
.lib-control { display: flex; flex-direction: column; gap: 0.3rem; }
.lib-control-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.lib-control .segmented button { flex: 0 0 auto; padding: 0.42rem 0.75rem; }

.lib-group { margin-bottom: 2rem; }
.lib-group-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.lib-group-brand { font-size: 0.8rem; font-weight: 600; color: var(--accent2); }
.lib-count { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.lib-sub { margin: 0 0 1.1rem; }
.lib-sub-title { font-size: 1rem; margin: 0 0 0.5rem; display: flex; align-items: baseline; gap: 0.5rem; }

.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 0.9rem; }
.lib-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.lib-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-lift); }

/* Jaquette : l'image entière (contain) sur un fond flou tiré d'elle-même, si bien que
   les formats variés (boîte SNES à l'italienne, jaquette GameCube, bannière Steam)
   remplissent tous la même vignette 3:4 sans être rognés. */
.lib-cover { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--surface-sunken); }
.lib-cover-bg {
  position: absolute; inset: -12%; width: 124%; height: 124%;
  object-fit: cover; filter: blur(16px) saturate(1.3); opacity: 0.6;
}
.lib-cover-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; padding: 0.55rem;
  filter: drop-shadow(0 8px 14px rgb(0 0 0 / 0.4));
  transition: transform 0.25s ease;
}
.lib-card:hover .lib-cover-img { transform: scale(1.04); }
.lib-cover.is-empty img { display: none; }
.lib-cover-fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem;
  background: linear-gradient(150deg, hsl(var(--hue) 65% 50%), hsl(calc(var(--hue) + 45) 70% 28%));
  color: #fff;
}
.lib-cover-initials {
  font-family: var(--font-display); font-size: 2.8rem; font-weight: 700; line-height: 1;
  text-shadow: 0 2px 12px rgb(0 0 0 / 0.35);
}
.lib-cover-console { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; }

.lib-card-body { padding: 0.65rem 0.75rem 0.75rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.lib-card-name { margin: 0; font-size: 0.92rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.lib-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.lib-console { font-size: 0.78rem; font-weight: 600; color: var(--text); }
.lib-card-foot { font-size: 0.75rem; color: var(--text-muted); margin-top: auto; }

@media (max-width: 600px) {
  .lib-grid { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .lib-control { width: 100%; }
  .lib-cover-initials { font-size: 2.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .lib-card, .lib-cover-img { transition: none; }
  .lib-card:hover, .lib-card:hover .lib-cover-img { transform: none; }
}

/* ---------------------------------------------------------------- connexion Discord */
.discord-account { display: inline-flex; align-items: center; }
.btn-discord {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.45rem 0.9rem; border: 0; border-radius: 999px;
  background: #5865f2; color: #fff; cursor: pointer;
  font: 600 0.82rem var(--font); text-transform: uppercase; letter-spacing: 0.04em;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn-discord svg { width: 1.05rem; height: 1.05rem; }
.btn-discord:hover { background: #4752c4; transform: translateY(-1px); }
.btn-discord:disabled { opacity: 0.7; cursor: wait; }
.discord-user { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; }
.discord-profile { display: inline-flex; align-items: center; gap: 0.45rem; text-decoration: none; border-radius: 999px; }
.discord-profile:hover .discord-name { color: var(--accent); }
.discord-avatar { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #5865f2; object-fit: cover; background: var(--surface-sunken); }
.discord-name { font-weight: 700; color: var(--text); transition: color 0.15s ease; }
.discord-logout {
  border: 1px solid var(--border); background: transparent; color: var(--text-muted);
  border-radius: 999px; padding: 0.25rem 0.7rem; font: 600 0.75rem var(--font); cursor: pointer;
}
.discord-logout:hover { color: var(--accent); border-color: var(--accent); }
.discord-error { margin-bottom: 1rem; }

.admin-cover { width: 42px; height: 56px; object-fit: contain; border-radius: 4px; background: var(--surface-sunken); display: block; }

/* --------------------------------------------------------------------- profil */

.profile-head { display: flex; align-items: center; gap: 1.25rem; margin-top: 0.5rem; }
.profile-head h1 { margin: 0; }
.profile-head p { margin: 0.25rem 0 0; }
.profile-avatar {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: var(--surface-sunken);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 3px var(--accent), var(--shadow);
}

.history-list { list-style: none; margin: 0; padding: 0; }
.history-item {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.8rem 0; border-top: 1px solid var(--border);
}
.history-item:first-child { border-top: 0; padding-top: 0.2rem; }
.history-main { min-width: 0; }
.history-title { font-weight: 700; overflow-wrap: anywhere; }
.history-title a { color: var(--accent-strong); text-decoration: none; }
.history-title a:hover { text-decoration: underline; }
.history-detail { font-size: 0.85rem; margin-top: 0.15rem; overflow-wrap: anywhere; }
.history-side { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 0.4rem; flex-shrink: 0; }
.history-date { font-size: 0.8rem; white-space: nowrap; }
.history-status, .history-tag {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.15rem 0.55rem; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap;
}
.history-tag { color: var(--text-muted); border-color: var(--border); }
.status-online { color: var(--ok); }
.status-played { color: var(--accent-strong); }
.status-generated { color: var(--accent2); }
.status-preparing { color: var(--running); }
.status-deleted { color: var(--idle); }

@media (max-width: 600px) {
  .profile-head { gap: 0.9rem; }
  .profile-avatar { width: 64px; height: 64px; }
  .history-item { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .history-side { justify-content: flex-start; }
}

/* --------------------------------------------------------------------- émulateurs */

.emulators-page h1 { display: flex; align-items: center; gap: 0.55rem; }
.emu-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 1.25rem; margin-top: 1.25rem; }
.emu-card { display: flex; flex-direction: column; }
.emu-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.6rem; }
.emu-card-head h2 { margin: 0; }
.emu-meta { font-size: 0.82rem; color: var(--text-muted); margin: 0 0 1rem; }
.emu-card .btn-row { margin-top: auto; }
.emu-section { margin-top: 2rem; }
.emu-section > h2 { display: flex; align-items: center; gap: 0.5rem; }
.emu-section .emu-list { margin-top: 0.75rem; }

/* Suppression du salon, dans l'espace hôte */
.host-step-danger .step-num { background: var(--error-bg); color: var(--error-text); border: 1px solid var(--error-border); box-shadow: none; }

/* --------------------------------------------------------------------- paramètres */

/* Couleurs d'accent (le violet d'origine reste la valeur par défaut). */
:root[data-accent="ocean"]   { --accent: #0369a1; --accent2: #0d9488; --accent-strong: #075985; --blob-1: 199 89% 48%; --blob-2: 173 80% 40%; }
:root[data-accent="emerald"] { --accent: #047857; --accent2: #65a30d; --accent-strong: #065f46; --blob-1: 160 84% 39%; --blob-2: 84 81% 44%; }
:root[data-accent="sunset"]  { --accent: #c2410c; --accent2: #db2777; --accent-strong: #9a3412; --blob-1: 21 90% 48%; --blob-2: 330 81% 50%; }
:root[data-accent="ruby"]    { --accent: #be123c; --accent2: #9333ea; --accent-strong: #9f1239; --blob-1: 347 77% 50%; --blob-2: 271 81% 56%; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-accent="ocean"]   { --accent: #38bdf8; --accent2: #2dd4bf; --accent-strong: #7dd3fc; }
  :root:not([data-theme="light"])[data-accent="emerald"] { --accent: #34d399; --accent2: #a3e635; --accent-strong: #6ee7b7; }
  :root:not([data-theme="light"])[data-accent="sunset"]  { --accent: #fb923c; --accent2: #f472b6; --accent-strong: #fdba74; }
  :root:not([data-theme="light"])[data-accent="ruby"]    { --accent: #fb7185; --accent2: #c084fc; --accent-strong: #fda4af; }
}
:root[data-theme="dark"][data-accent="ocean"]   { --accent: #38bdf8; --accent2: #2dd4bf; --accent-strong: #7dd3fc; }
:root[data-theme="dark"][data-accent="emerald"] { --accent: #34d399; --accent2: #a3e635; --accent-strong: #6ee7b7; }
:root[data-theme="dark"][data-accent="sunset"]  { --accent: #fb923c; --accent2: #f472b6; --accent-strong: #fdba74; }
:root[data-theme="dark"][data-accent="ruby"]    { --accent: #fb7185; --accent2: #c084fc; --accent-strong: #fda4af; }
:root[data-accent] { --accent-soft: color-mix(in srgb, var(--accent) 22%, var(--surface)); }

:root[data-text-size="large"] { font-size: 112.5%; }

:root[data-particles="off"] .particles-canvas { display: none; }
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

.nav-settings { background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }

.settings-dialog {
  width: min(520px, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lift);
}
.settings-dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.settings-head, .settings-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 1rem 1.25rem; }
.settings-head { border-bottom: 1px solid var(--border); }
.settings-foot { border-top: 1px solid var(--border); }
.settings-head h2 { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 1.3rem; }
.settings-head h2 svg { width: 1.2rem; height: 1.2rem; color: var(--accent); }
.settings-close { background: none; border: 0; color: var(--text-muted); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0.1rem 0.4rem; border-radius: 6px; }
.settings-close:hover { color: var(--text); background: var(--surface-sunken); }
.settings-body { padding: 0.5rem 1.25rem 1rem; overflow-y: auto; }
.settings-group { padding: 0.75rem 0; }
.settings-group + .settings-group { border-top: 1px solid var(--border); }
.settings-group h3 { margin: 0 0 0.6rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.setting-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.4rem 0; }
.setting-row > span { font-weight: 600; font-size: 0.92rem; }
.setting-toggle { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.45rem 0; cursor: pointer; }
.setting-toggle input { width: 1.05rem; height: 1.05rem; margin-top: 0.15rem; accent-color: var(--accent); flex-shrink: 0; }
.setting-toggle-text { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.92rem; }
.setting-toggle-text small { color: var(--text-muted); font-size: 0.8rem; }
.setting-sub { margin-left: 1.65rem; }
.setting-sub .btn { margin-top: 0.4rem; }
.accent-swatches { display: flex; gap: 0.5rem; }
.accent-swatch { width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; }
.accent-swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--text); }
.accent-violet  { background: linear-gradient(135deg, #8b5cf6, #22d3ee); }
.accent-ocean   { background: linear-gradient(135deg, #0ea5e9, #14b8a6); }
.accent-emerald { background: linear-gradient(135deg, #10b981, #84cc16); }
.accent-sunset  { background: linear-gradient(135deg, #f97316, #ec4899); }
.accent-ruby    { background: linear-gradient(135deg, #e11d48, #a855f7); }

/* Bouton en cours d'action : le spinner prend la place de l'icône. */
.is-busy > svg { display: none; }

/* ------------------------------------------------------------------ suivi en direct (/suivi) */

.suivi-page { max-width: 1360px; }
.suivi-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 0.5rem; }
.suivi-head h1 { display: flex; align-items: center; gap: 0.55rem; overflow-wrap: anywhere; }
.suivi-head p { margin: 0; }
.suivi-head-side { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

.suivi-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.5rem; align-items: start; }
.suivi-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.suivi-toolbar h2 { margin: 0; }
.suivi-sort { font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem; }
.suivi-sort select {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.3rem 0.5rem;
}

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

.suivi-card {
  display: grid; grid-template-columns: 104px minmax(0, 1fr);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.suivi-card.is-playing { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }
.suivi-card.is-goal { border-color: color-mix(in srgb, #facc15 60%, var(--border)); box-shadow: var(--shadow), 0 0 22px -10px #facc15; }

.suivi-cover { position: relative; overflow: hidden; background: var(--surface-sunken); min-height: 100%; }
.suivi-cover-fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, hsl(var(--hue) 65% 50%), hsl(calc(var(--hue) + 45) 70% 28%));
  color: #fff; font-family: var(--font-display); font-size: 2rem; font-weight: 700;
  text-shadow: 0 2px 12px rgb(0 0 0 / 0.35);
}
.suivi-cover-bg { position: absolute; inset: -15%; width: 130%; height: 130%; object-fit: cover; filter: blur(14px) saturate(1.3); opacity: 0.7; }
.suivi-cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 0.4rem; filter: drop-shadow(0 6px 10px rgb(0 0 0 / 0.4)); }
.suivi-card.is-offline .suivi-cover img { filter: grayscale(0.6) drop-shadow(0 6px 10px rgb(0 0 0 / 0.4)); }

.suivi-card-body { padding: 0.85rem 1rem 0.8rem; display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.suivi-card-head { display: flex; align-items: flex-start; gap: 0.55rem; }
.suivi-rank { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--text-muted); line-height: 1.3; }
.suivi-who { flex: 1; min-width: 0; }
.suivi-name { margin: 0; font-family: var(--font-display); font-size: 1.2rem; text-transform: none; letter-spacing: 0; color: var(--text); overflow-wrap: anywhere; }
.suivi-game { margin: 0; font-size: 0.82rem; color: var(--text-muted); overflow-wrap: anywhere; }

.suivi-pill {
  display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap;
  font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--idle);
}
.suivi-pill .icon, .suivi-pill svg { width: 0.85rem; height: 0.85rem; }
.suivi-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; display: inline-block; }
.suivi-pill.is-playing { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.suivi-pill.is-playing .suivi-dot { animation: suivi-blink 1.8s ease-in-out infinite; box-shadow: 0 0 6px currentColor; }
.suivi-pill.is-goal { color: #b7791f; border-color: color-mix(in srgb, #facc15 60%, var(--border)); background: color-mix(in srgb, #facc15 14%, var(--surface)); }
@keyframes suivi-blink { 50% { opacity: 0.35; } }

.suivi-progress .progress { width: 100%; height: 12px; display: block; }
.suivi-progress-text { display: block; margin-top: 0.3rem; font-size: 0.82rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.suivi-progress-text strong { color: var(--text); }

.suivi-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
.suivi-stat { background: var(--surface-sunken); border: 1px solid var(--border); border-radius: 10px; padding: 0.4rem 0.5rem; text-align: center; cursor: help; }
.suivi-stat-value { display: block; font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.suivi-stat-value small { font-weight: 500; color: var(--text-muted); font-size: 0.75rem; }
.suivi-stat-label { display: block; font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.suivi-activity { margin: 0; display: flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; color: var(--text-muted); }
.suivi-activity .icon, .suivi-activity svg { width: 0.9rem; height: 0.9rem; }

.suivi-feed-panel { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); display: flex; flex-direction: column; }
.suivi-filters { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; }
.suivi-feed-note { font-size: 0.88rem; margin: 0.25rem 0; }
.suivi-feed { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.suivi-feed-item {
  display: grid; grid-template-columns: 1.4rem minmax(0, 1fr) auto; gap: 0.5rem; align-items: start;
  padding: 0.5rem 0.25rem; border-top: 1px solid var(--border); font-size: 0.86rem; line-height: 1.4;
  animation: suivi-in 0.35s ease;
}
.suivi-feed-item:first-child { border-top: 0; }
.suivi-feed-icon { color: var(--text-muted); }
.suivi-feed-icon .icon, .suivi-feed-icon svg { width: 1rem; height: 1rem; display: block; margin-top: 0.1rem; }
.suivi-feed-text { overflow-wrap: anywhere; }
.suivi-feed-time { font-size: 0.75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.suivi-feed-item.is-key .suivi-feed-icon { color: var(--accent); }
.suivi-feed-item.is-death .suivi-feed-icon { color: var(--error-text); }
.suivi-feed-item.is-goal { background: color-mix(in srgb, #facc15 10%, transparent); border-radius: 8px; }
.suivi-feed-item.is-goal .suivi-feed-icon { color: #b7791f; }
.suivi-item { font-weight: 600; }
.suivi-item.is-key { color: var(--accent); }
.suivi-item.is-useful { color: color-mix(in srgb, #2563eb 80%, var(--text)); }
.suivi-item.is-trap { color: var(--error-text); }
@keyframes suivi-in { from { opacity: 0; transform: translateY(-4px); } }

@media (max-width: 1000px) {
  .suivi-layout { grid-template-columns: 1fr; }
  .suivi-feed-panel { position: static; max-height: 70vh; }
}
@media (max-width: 600px) {
  .suivi-players { grid-template-columns: 1fr; }
  .suivi-card { grid-template-columns: 76px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .suivi-feed-item, .suivi-pill.is-playing .suivi-dot { animation: none; }
}
.tracker-open { margin-left: auto; font-family: var(--font); font-size: 0.85rem; padding: 0.35rem 0.8rem; }

/* Joueur déjà inscrit : il peut ajouter un deuxième jeu (ou il a atteint le maximum). */
.join-second {
  margin: -0.75rem 0 1.5rem; padding: 0.75rem 1rem; max-width: 70ch;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface)); font-size: 0.92rem;
}
.suivi-also { margin: 0; display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-muted); }
.suivi-also .icon, .suivi-also svg { width: 0.9rem; height: 0.9rem; color: var(--accent); }

/* ------------------------------------------------------------------ page Salons */
.salons-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 1rem 0 0.5rem; }
.salons-head p { margin: 0; }
.salons-section { margin: 1.75rem 0; }
.salons-section h2 { margin-bottom: 0.9rem; }
.salon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.salon-card {
  display: flex; flex-direction: column; gap: 0.6rem; padding: 1rem 1.1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.salon-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.salon-card.is-online { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.salon-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.salon-name { margin: 0; font-size: 1.15rem; text-transform: none; letter-spacing: 0; color: var(--text); overflow-wrap: anywhere; }
.salon-name a { color: inherit; text-decoration: none; }
.salon-name a:hover { color: var(--accent); }
.salon-meta { margin: 0; font-size: 0.85rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.salon-games { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.salon-game { font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.55rem; border-radius: 999px; background: var(--surface-sunken); border: 1px solid var(--border); }
.salon-more { color: var(--text-muted); }
.salon-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: auto; }
@media (prefers-reduced-motion: reduce) { .salon-card { transition: none; } .salon-card:hover { transform: none; } }

/* Case à cocher avec un titre et une explication. */
.check-field { display: flex; align-items: flex-start; gap: 0.6rem; cursor: pointer; text-align: left; }
.check-field input { margin-top: 0.25rem; width: 1.05rem; height: 1.05rem; accent-color: var(--accent); flex-shrink: 0; }
.check-field .hint { display: block; font-weight: 400; }
.host-public { margin: 0 0 1.25rem; padding: 0.75rem 0.9rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-sunken); }
.on-behalf { margin-top: 0.75rem; }

/* ------------------------------------------------------------------ accueil */
.home-page .hero { max-width: 720px; }
.home-title { justify-content: center; text-align: center; margin: 3rem 0 1.25rem; }
.home-section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.home-section-head h2 { margin: 0; }
.home-live { max-width: 980px; margin: 0 auto 2rem; }
.live-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: suivi-blink 1.8s ease-in-out infinite; }
.feature-link { display: inline-flex; align-items: center; gap: 0.3rem; margin-top: 0.5rem; font-size: 0.85rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.feature-link svg { width: 0.95rem; height: 0.95rem; }
.feature-link:hover { text-decoration: underline; }

.how-steps { list-style: none; margin: 0 auto 3rem; padding: 0; max-width: 980px; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.how-steps li { display: flex; gap: 0.75rem; align-items: flex-start; padding: 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.how-steps h3 { margin: 0 0 0.3rem; font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--text); }
.how-steps p { margin: 0; font-size: 0.88rem; color: var(--text-muted); }
.how-num {
  flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; color: var(--accent-contrast); background: var(--accent);
}

/* ------------------------------------------------------------------ pages à venir */
.soon-page .hero .badge { margin-top: 0.5rem; }
.soon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; max-width: 980px; margin: 0 auto; }
.soon-card { padding: 1.1rem 1.2rem; border-radius: var(--radius); background: var(--surface); border: 1px dashed var(--border); }
.soon-card h3 { margin: 0 0 0.4rem; color: var(--text); }
.soon-card p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.soon-note { text-align: center; max-width: 640px; margin: 2rem auto 0; }

/* ------------------------------------------------------------------ personnalisation */
.custom-page h1 { margin-top: 1rem; }
.custom-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; margin-top: 1.25rem; }
.settings-panel { padding: 0.5rem 0 0; }
.settings-panel .settings-foot { justify-content: flex-end; }
.custom-slots { display: grid; gap: 0.6rem; margin-top: 1rem; }
.custom-slot { display: flex; justify-content: space-between; align-items: center; padding: 0.7rem 0.9rem; border: 1px dashed var(--border); border-radius: 10px; }
.custom-slot-label { font-weight: 600; }
.custom-slot-empty { color: var(--text-muted); font-size: 0.88rem; }
@media (max-width: 860px) { .custom-layout { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ guide (questions dépliables) */
.guide-head { margin: 1rem 0 1.5rem; }
.guide-head p { margin: 0 0 1rem; }
.guide-search { max-width: 520px; }
.guide-search input { width: 100%; padding: 0.7rem 0.9rem 0.7rem 2.3rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.faq-group { margin: 2rem 0; }
.faq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0.85rem; align-items: start; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color 0.2s ease; }
.faq-item:hover, .faq-item[open] { border-color: var(--accent); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 1rem 1.1rem; cursor: pointer; list-style: none; font-weight: 600; line-height: 1.35;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-chevron { width: 1.1rem; height: 1.1rem; flex-shrink: 0; color: var(--accent); transition: transform 0.2s ease; }
.faq-item[open] .faq-chevron { transform: rotate(180deg); }
.faq-answer { padding: 0 1.1rem 1rem; color: var(--text); font-size: 0.92rem; line-height: 1.55; }
.faq-answer p { margin: 0 0 0.6rem; }
.faq-answer ul, .faq-answer ol { margin: 0 0 0.6rem; padding-left: 1.2rem; }
.faq-answer li { margin-bottom: 0.3rem; }
.faq-answer a { color: var(--accent); }
@media (max-width: 600px) { .faq-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .faq-chevron { transition: none; } }

/* ------------------------------------------------------------------ administration : incidents */
.incident-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; max-height: 420px; overflow-y: auto; }
.incident { border: 1px solid var(--border); border-radius: 10px; padding: 0.6rem 0.75rem; }
.incident-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.88rem; }
.incident-head a { font-weight: 700; color: var(--text); }
.incident-detail { margin: 0.5rem 0 0; white-space: pre-wrap; font-size: 0.78rem; color: var(--text-muted); max-height: 7.5em; overflow: auto; }

/* ------------------------------------------------------------------ classements */
.stats-page h1 { margin-top: 1rem; }
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.board h2 { font-size: 1.2rem; }
.board h2 .icon, .board h2 svg { width: 1.15rem; height: 1.15rem; color: var(--accent); }
.board-hint { margin: -0.4rem 0 0.75rem; font-size: 0.82rem; }
.board-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.board-row { display: grid; grid-template-columns: 1.8rem 32px minmax(0, 1fr) auto; align-items: center; gap: 0.6rem; padding: 0.4rem 0.5rem; border-radius: 10px; }
.board-row.is-top { background: var(--surface-sunken); }
.board-rank { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; text-align: center; color: var(--text-muted); }
.is-top-1 .board-rank { color: #d4a017; }
.is-top-2 .board-rank { color: #9aa3b5; }
.is-top-3 .board-rank { color: #b8733a; }
.board-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--surface-sunken); }
.board-who { display: flex; flex-direction: column; min-width: 0; }
.board-who a { font-weight: 700; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-who a:hover { color: var(--accent); }
.board-who .muted { font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-value { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 0.9rem; white-space: nowrap; }
.boards-games { margin-top: 1rem; }

/* ------------------------------------------------------------------ compagnon et bouton Jouer */
.btn-play { font-weight: 700; }
.play-hint { margin-top: 0.75rem; }
.companion-page .hero-cta { flex-direction: column; align-items: center; }
.companion-games, .companion-facts { margin: 0 0 0.75rem; padding-left: 1.2rem; line-height: 1.6; }
.companion-license { font-size: 0.82rem; }
.emu-games { margin: 0 0 0.6rem; font-size: 0.88rem; }
.emu-notes { font-size: 0.85rem; margin: 0 0 0.6rem; }

/* ------------------------------------------------------------------ émulateurs à télécharger (cartes compactes) */
.emu-dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 0.9rem; margin-top: 1.25rem; }
.emu-dl {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.emu-dl:hover { border-color: var(--accent); transform: translateY(-2px); }
.emu-consoles {
  display: flex; align-items: center; justify-content: center; gap: 0.35rem; height: 92px; padding: 0.6rem;
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--accent) 10%, var(--surface-sunken)), var(--surface-sunken));
  border-bottom: 1px solid var(--border);
}
.emu-consoles img { flex: 1 1 0; min-width: 0; max-width: 33%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.25)); }
.emu-consoles.is-single img { max-width: 70%; }
.emu-more { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; cursor: help; }
.emu-body { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.7rem 0.85rem 0.85rem; flex: 1; }
.emu-name { margin: 0; font-size: 1.05rem; text-transform: none; letter-spacing: 0; color: var(--text); }
.emu-name .muted { font-size: 0.78rem; font-weight: 500; }
.emu-platforms { margin: 0; font-size: 0.75rem; color: var(--text-muted); }
.emu-ap { margin: 0.2rem 0 0; font-size: 0.8rem; line-height: 1.45; padding: 0.45rem 0.55rem; border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border)); }
.emu-ap strong { color: var(--accent); }
.emu-games { margin: 0; font-size: 0.75rem; color: var(--text-muted); }
.emu-actions { margin-top: auto; padding-top: 0.4rem; }
.emu-actions .btn { width: 100%; justify-content: center; padding: 0.45rem 0.8rem; font-size: 0.85rem; }
@media (prefers-reduced-motion: reduce) { .emu-dl { transition: none; } .emu-dl:hover { transform: none; } }
.emu-credits { font-size: 0.75rem; margin: 1rem 0 0; }
.emu-summary { margin: 0; font-size: 0.82rem; line-height: 1.4; }
.emu-client { margin: 0.15rem 0 0; display: flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; color: var(--text-muted); }
.emu-client .icon, .emu-client svg { width: 0.95rem; height: 0.95rem; color: var(--accent); flex-shrink: 0; }
.emu-client strong { color: var(--text); }
.emu-dl.is-featured { border-color: var(--accent); box-shadow: var(--shadow), 0 0 0 1px var(--accent); }
.emu-ap-logo { max-height: 70px; filter: drop-shadow(0 0 8px hsl(var(--blob-1) / 0.5)); }
.companion-logo { display: block; margin: 0 auto 1rem; width: 112px; height: 112px; border-radius: 26px; box-shadow: 0 12px 32px -10px hsl(var(--blob-1) / 0.7); }

/* --------------------------------------------------------------------------- administration : cartes et fenêtres */

.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.admin-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.admin-card[hidden] { display: none; }
.admin-card:hover, .admin-card:focus-visible { transform: translateY(-2px); border-color: var(--accent); }
.admin-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.admin-card .feature-icon { margin-bottom: 0.5rem; }
.admin-card-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; }
.admin-card-desc { font-size: 0.85rem; color: var(--text-muted); }
.admin-card-summary { font-size: 0.85rem; font-weight: 600; color: var(--accent); margin-top: 0.4rem; min-height: 1.2em; }
.admin-card-summary.is-alert { color: var(--error-text); }

.admin-dialog {
  width: min(720px, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -20px rgb(0 0 0 / 0.55);
}
.admin-dialog-wide { width: min(1100px, calc(100vw - 2rem)); }
.admin-dialog[open] { display: flex; flex-direction: column; }
.admin-dialog::backdrop { background: rgb(5 6 12 / 0.6); backdrop-filter: blur(3px); }
.admin-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.3rem;
  border-bottom: 1px solid var(--border);
}
.admin-dialog-head h2 { margin: 0; }
.admin-dialog-body { padding: 1.1rem 1.3rem 1.4rem; overflow: auto; }
.admin-dialog-body > .muted:first-child { margin-top: 0; }
.btn-icon { padding: 0.45rem; }
.btn-icon .icon, .btn-icon svg { width: 1.1rem; height: 1.1rem; }

.check-inline { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.9rem; cursor: pointer; }
.admin-user { display: flex; align-items: center; gap: 0.6rem; }
.admin-user img { width: 2rem; height: 2rem; border-radius: 50%; flex-shrink: 0; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; }
.admin-codex-row > td { background: rgba(232, 194, 90, 0.04); }
.admin-codex h4 { margin: 0.8rem 0 0.4rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted, #9fb0c8); }
.admin-codex-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.admin-codex-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap;
  padding: 0.35rem 0.6rem; border-radius: 8px; background: rgba(255, 255, 255, 0.03); }
.admin-codex-form { margin-top: 0.9rem; }
.admin-codex-form input[name="game"] { flex: 1; min-width: 14rem; }
.admin-table-compact { font-size: 0.8rem; }
.admin-table-compact td { white-space: nowrap; max-width: 18rem; overflow: hidden; text-overflow: ellipsis; }

.danger-zone {
  margin: 1.2rem 0;
  padding: 1rem 1.2rem;
  border: 1px solid var(--error-border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--error-bg) 45%, transparent);
}
.danger-zone h3 { margin-top: 0; color: var(--error-text); }

/* --------------------------------------------------------------------------- bibliothèque : onglets, fiches */

.lib-tabs { margin: 0.4rem 0 1rem; }
.lib-tabs button { font-size: 1rem; padding-inline: 1.4rem; }
.lib-tabs button[aria-selected="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--text);
}
.lib-card[role="button"] { cursor: pointer; }
.lib-card[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.1rem 0.8rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.player-card:hover, .player-card:focus-visible { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.player-card img { width: 4rem; height: 4rem; border-radius: 50%; }
.player-card-name { font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.player-card-stats { display: flex; gap: 0.8rem; font-size: 0.82rem; color: var(--text-muted); }
.player-card-stats span { display: inline-flex; align-items: center; gap: 0.25rem; }
.player-card-stats .icon svg { width: 0.95rem; height: 0.95rem; color: var(--accent); }
.player-sheet-head { margin-bottom: 1rem; }
.player-sheet-head img { width: 3.5rem; height: 3.5rem; }

.game-sheet { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.3rem; margin-bottom: 1.2rem; }
.game-sheet-cover .lib-cover { border-radius: 10px; overflow: hidden; }
.game-sheet-desc p { margin: 0.7rem 0 0; line-height: 1.55; }
.game-prefs-bar { justify-content: space-between; margin-bottom: 0.8rem; }
.game-prefs-bar .muted { flex: 1 1 18rem; }
@media (max-width: 640px) {
  .game-sheet { grid-template-columns: 1fr; }
  .game-sheet-cover { max-width: 220px; }
}

/* --------------------------------------------------------------------------- suivi : chat, indices, objets */

.suivi-tabs { display: flex; margin-bottom: 0.75rem; }
.suivi-tabs button { flex: 1; position: relative; }
.suivi-tabs button[aria-selected="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--text);
}
.suivi-tab-count {
  display: inline-block;
  min-width: 1.3rem;
  padding: 0 0.35rem;
  margin-left: 0.3rem;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.3rem;
  background: var(--accent);
  color: var(--accent-contrast);
}
.suivi-tab-count[hidden] { display: none; }
.suivi-pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.suivi-pane[hidden] { display: none; }
.suivi-chat { overflow-y: auto; }

.suivi-composer { display: flex; gap: 0.4rem; margin-top: 0.6rem; flex-wrap: wrap; }
.suivi-composer input { flex: 1 1 10rem; min-width: 0; }
.suivi-composer select { flex-basis: 100%; }
.suivi-composer-note { font-size: 0.82rem; margin: 0.6rem 0 0; }
.suivi-composer-note[hidden] { display: none; }
.suivi-feed-item.is-reply { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 8px; }
.suivi-feed-item.is-reply .suivi-feed-icon { color: var(--accent); }

.suivi-hint-points { font-size: 0.82rem; margin: 0 0 0.5rem; }
.suivi-feed-item.is-ask .suivi-feed-icon { color: var(--text-muted); }
.suivi-feed-item.is-reply.is-error { background: var(--error-bg); }
.suivi-feed-item.is-reply.is-error .suivi-feed-icon { color: var(--error-text); }
.suivi-hint-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: 0.1em;
}
.suivi-hint-badge.is-priority { color: var(--accent); border-color: var(--accent); }
.suivi-hint-badge.is-found { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, var(--border)); }
.suivi-pin-btn {
  font: inherit; font-size: 0.72rem; font-weight: 700; cursor: pointer;
  padding: 0.05rem 0.45rem; margin-left: 0.25rem; border-radius: 999px; vertical-align: 0.1em;
  border: 1px solid var(--accent); background: transparent; color: var(--accent);
}
.suivi-pin-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.suivi-pin-btn:disabled { opacity: 0.5; cursor: progress; }
.suivi-pins {
  margin: 0 0 0.6rem; padding: 0.5rem 0.6rem; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  max-height: 14rem; overflow-y: auto;
}
.suivi-pins[hidden] { display: none; }
.suivi-pins-title { margin: 0 0 0.3rem; font-size: 0.82rem; font-weight: 700; text-transform: none; letter-spacing: 0; }
.suivi-pins-list { list-style: none; margin: 0; padding: 0; }
.suivi-pin {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.4rem;
  padding: 0.35rem 0; border-top: 1px solid var(--border); font-size: 0.82rem; line-height: 1.4;
}
.suivi-pin:first-child { border-top: 0; }
.suivi-pin-text { overflow-wrap: anywhere; min-width: 0; }
.suivi-pin.is-mine { font-weight: 500; }
.suivi-pin.is-mine .suivi-pin-text::before { content: "➜ "; color: var(--accent); font-weight: 700; }
.suivi-pin.is-found { opacity: 0.6; }
.suivi-hint-force { font-size: 0.82rem; margin-top: 0.5rem; }
.suivi-hint-force[hidden] { display: none; }

.suivi-give { margin-bottom: 0.9rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--border); }
.suivi-give[hidden] { display: none; }
.suivi-give-title { font-weight: 700; font-size: 0.9rem; margin: 0 0 0.3rem; }
.suivi-give .suivi-composer { margin-top: 0.3rem; }
.suivi-give .suivi-composer select { flex-basis: 100%; }
.suivi-give-amount { flex: 0 0 4.5rem; }
.suivi-give-note { font-size: 0.78rem; margin: 0.4rem 0 0; }
.suivi-give-replies { max-height: 9rem; }

/* ------------------------------------------------------------------ récompenses */

.reward-icon { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -0.2em; margin-right: 0.35em; }
.reward-icon-lg { width: 3rem; height: 3rem; margin: 0; }
.profile-title { margin-top: 0.3rem; }

/* Un titre : une pastille, stylée selon la récompense. */
.reward-title {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-sunken);
  color: var(--text);
}
.reward-title-faucheur-de-bugs {
  background: #140508;
  border-color: #d4101f;
  color: #ff4d4d;
  text-shadow: 1px 0 #8a0018, -1px 0 #ff9a8a;
  box-shadow: 0 0 12px -3px #ff1a2e;
  animation: title-glitch 4.5s steps(1) infinite;
}
@keyframes title-glitch {
  0%, 90%, 100% { text-shadow: 1px 0 #8a0018, -1px 0 #ff9a8a; transform: none; }
  91% { text-shadow: -2px 0 #ff1a2e, 2px 0 #00f0ff; transform: translateX(1px); }
  93% { text-shadow: 3px 0 #ffffff, -2px 0 #ff1a2e; transform: translateX(-1px) skewX(-10deg); }
  95% { text-shadow: -1px 0 #00f0ff, 2px 0 #ff1a2e; clip-path: inset(10% 0 40% 0); }
  97% { text-shadow: 2px 0 #ff1a2e, -2px 0 #8a0018; clip-path: none; }
}
:root[data-motion="reduce"] .reward-title-faucheur-de-bugs { animation: none; }
@media (prefers-reduced-motion: reduce) { .reward-title-faucheur-de-bugs { animation: none; } }

.player-card .reward-title { font-size: 0.7rem; }
.player-sheet-head .reward-title { margin: 0.2rem 0; }

/* Page Récompenses : un bloc par succès. */
.rewards-status { text-align: center; }
.achievement-list { display: grid; gap: 1rem; max-width: 820px; margin: 0 auto; }
.achievement-card {
  padding: 1.3rem 1.4rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.achievement-card.is-locked { border-style: dashed; }
.achievement-card.is-locked .reward-preview { filter: grayscale(1); opacity: 0.55; }
.achievement-card header { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; }
.achievement-card h2 { margin: 0; font-family: var(--font-display); }
.achievement-card > p { margin: 0.4rem 0 1rem; }
.achievement-alpha.is-unlocked {
  border-color: #7c3aed;
  background:
    linear-gradient(135deg, color-mix(in srgb, #7c3aed 12%, transparent), transparent 60%),
    var(--surface);
  box-shadow: 0 0 24px -12px #7c3aed;
}
.reward-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.7rem; }
.reward-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; min-height: 6.5rem;
  padding: 0.8rem; border-radius: 10px; background: var(--surface-sunken); border: 1px solid var(--border); text-align: center;
}
.reward-kind { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.reward-preview { display: flex; align-items: center; justify-content: center; min-height: 3rem; }
.reward-bg-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }

/* Personnalisation : choix des récompenses équipées. */
.custom-slot { flex-wrap: wrap; gap: 0.6rem; border-style: solid; }
.reward-choices { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; }
.reward-choice {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font: inherit; font-size: 0.85rem; font-weight: 600;
  padding: 0.4rem 0.7rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); cursor: pointer;
}
.reward-choice .reward-icon { margin: 0; }
/* l'aperçu d'un cosmétique du monde : la première image de sa planche, en gros pixels */
.cosmetique-apercu { display: inline-block; vertical-align: middle; margin-right: 0.4rem; background-repeat: no-repeat;
  background-position: 0 0; image-rendering: pixelated; }
.reward-choice:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.reward-choice[aria-checked="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--text); }
.reward-choice:disabled { cursor: not-allowed; opacity: 0.5; filter: grayscale(1); }
.reward-lock { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* Suivi en direct : vue « Plateau 3D » (plateau.js) */

.suivi-view { flex-wrap: nowrap; margin-right: auto; }
.suivi-view button { flex: 0 0 auto; padding: 0.38rem 0.8rem; font-size: 0.82rem; }
.suivi-board {
  position: relative; height: clamp(420px, 68vh, 760px); border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border); background: #07080d;
}
.suivi-board-note { margin-top: 0.5rem; }
.board-host canvas { display: block; width: 100% !important; height: 100% !important; }
.board-host .board-labels { position: absolute !important; inset: 0; }
.board-host:fullscreen { height: 100vh; border-radius: 0; }

.board-label {
  text-align: center; pointer-events: none; padding: 0.2rem 0.55rem;
  border-radius: 8px; background: rgba(10, 12, 20, 0.78); border: 1px solid rgba(139, 92, 246, 0.35);
  color: #edf0fa; font: 500 0.72rem/1.25 Inter, sans-serif; white-space: nowrap; backdrop-filter: blur(4px);
}
.board-label-name { font: 700 0.85rem/1.2 Rajdhani, Inter, sans-serif; letter-spacing: 0.02em; }
.board-label-game { color: #8890a8; max-width: 11rem; overflow: hidden; text-overflow: ellipsis; }
.board-label-stats { color: #22d3ee; font-weight: 600; }

.board-bubble {
  max-width: 15rem; padding: 0.4rem 0.65rem; border-radius: 12px 12px 12px 4px; pointer-events: none;
  background: rgba(23, 26, 38, 0.95); border: 1px solid rgba(139, 92, 246, 0.55); color: #edf0fa;
  font: 500 0.78rem/1.3 Inter, sans-serif; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); transition: opacity 0.4s;
  overflow-wrap: anywhere; animation: board-pop 0.25s ease-out;
}
.board-bubble.is-death { border-color: #ff4d6d; background: rgba(60, 14, 26, 0.95); }
.board-bubble.is-goal { border-color: #ffc94d; background: rgba(58, 44, 10, 0.95); color: #ffe9b0; font-weight: 700; }
.board-bubble.is-join { border-color: #34e7a6; }
.board-bubble.is-part { border-color: #5b6275; color: #b9bfd0; }
/* « scale » et non « transform » : CSS2DRenderer place la bulle par son transform. */
@keyframes board-pop { from { scale: 0.6; opacity: 0; } to { scale: 1; opacity: 1; } }

.board-item-tag {
  padding: 0.12rem 0.45rem; border-radius: 999px; pointer-events: none; white-space: nowrap;
  font: 700 0.68rem/1.3 Inter, sans-serif; color: #0a0c12; background: #c084fc;
}
.board-item-tag.is-trap { background: #ff4d6d; color: #fff; }
.board-core-label {
  position: absolute; top: 0.75rem; left: 0.75rem; z-index: 2;
  padding: 0.25rem 0.7rem; border-radius: 999px; pointer-events: none; white-space: nowrap;
  background: rgba(139, 92, 246, 0.22); border: 1px solid rgba(139, 92, 246, 0.6); color: #edf0fa;
  font: 700 0.8rem/1.3 Rajdhani, Inter, sans-serif; letter-spacing: 0.03em;
}

.board-tools { position: absolute; top: 0.75rem; right: 0.75rem; display: flex; gap: 0.4rem; flex-wrap: wrap; z-index: 2; }
.board-tool {
  font: 600 0.78rem/1 Inter, sans-serif; padding: 0.45rem 0.7rem; border-radius: 8px; cursor: pointer;
  color: #edf0fa; background: rgba(23, 26, 38, 0.85); border: 1px solid #2a2f42;
}
.board-tool:hover { border-color: #8b5cf6; }
.board-legend {
  position: absolute; left: 0.75rem; bottom: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.35rem 0.8rem; z-index: 2;
  max-width: calc(100% - 1.5rem); padding: 0.4rem 0.65rem; border-radius: 8px; pointer-events: none;
  background: rgba(10, 12, 20, 0.72); color: #b9bfd0; font: 500 0.72rem/1.3 Inter, sans-serif;
}
.board-legend i { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; margin-right: 0.3rem;
  background: var(--c); box-shadow: 0 0 6px var(--c); vertical-align: -0.05rem; }
@media (max-width: 600px) {
  .suivi-board { height: 72vh; }
  .board-legend { display: none; }
}

/* Plateau 3D : mode « Explorer » */

.board-host:focus { outline: none; }
.board-host:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.board-tool.is-active { border-color: #22d3ee; color: #22d3ee; }
.board-me-tag {
  padding: 0.1rem 0.45rem; border-radius: 999px; pointer-events: none; white-space: nowrap;
  background: rgba(34, 211, 238, 0.18); border: 1px solid #22d3ee; color: #e6fbff;
  font: 700 0.7rem/1.3 Inter, sans-serif;
}
.board-prompt {
  display: flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.7rem; border-radius: 10px; cursor: pointer;
  background: rgba(10, 12, 20, 0.92); border: 1px solid #22d3ee; color: #edf0fa; white-space: nowrap;
  font: 600 0.8rem/1.2 Inter, sans-serif; box-shadow: 0 0 16px rgba(34, 211, 238, 0.35); pointer-events: auto;
}
.board-prompt kbd {
  display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; border-radius: 6px;
  background: #22d3ee; color: #0a0c12; font: 800 0.78rem/1 Inter, sans-serif;
}
.board-door-label {
  padding: 0.2rem 0.6rem; border-radius: 999px; pointer-events: none; white-space: nowrap;
  background: rgba(34, 211, 238, 0.2); border: 1px solid #22d3ee; color: #e6fbff; font: 700 0.74rem/1.3 Inter, sans-serif;
}
.board-door-label.is-off { background: rgba(91, 98, 117, 0.3); border-color: #5b6275; color: #b9bfd0; }
.board-help {
  position: absolute; left: 50%; bottom: 0.75rem; transform: translateX(-50%); z-index: 2; pointer-events: none;
  max-width: calc(100% - 32rem) !important;
  padding: 0.35rem 0.75rem; border-radius: 8px; background: rgba(10, 12, 20, 0.8); color: #b9bfd0;
  font: 500 0.72rem/1.3 Inter, sans-serif; white-space: nowrap; max-width: calc(100% - 1.5rem); overflow: hidden; text-overflow: ellipsis;
}
.board-host:has(.board-help:not([hidden])) .board-legend { display: none; }
/* La boîte de dialogue des messages privés (dialogue.js, d'après Design/img_4.png) : le
   personnage de l'autre en grand à gauche, la boîte sombre en bas, son nom sur un filet. */
.dialogue { position: absolute; left: 0; right: 0; bottom: 0; height: 62%; z-index: 6; pointer-events: none; }
.dialogue[hidden] { display: none; }
.board-host:has(.dialogue:not([hidden])) :is(.board-help, .board-chat) { display: none; }
.dialogue-portrait {
  position: absolute; left: 1.5%; bottom: 0; height: 100%; max-width: 40%;
  background-repeat: no-repeat; background-position: 0 0; image-rendering: pixelated;
  filter: drop-shadow(0 0 18px rgba(10, 20, 40, 0.55));
  animation: dialogue-entree 0.25s ease-out;
}
/* le buste (128 × 160) : posé sur le bas de l'écran, la boîte de texte le coupe à la taille */
.dialogue-portrait.is-buste { height: 92%; max-width: 34%; }
.dialogue-box {
  position: absolute; left: clamp(150px, 21%, 380px); right: 3%; bottom: 4%; pointer-events: auto;
  padding: 0.9rem 1.6rem 0.8rem; border-radius: 4px; color: #f4f6fb;
  background: linear-gradient(90deg, rgba(16, 30, 56, 0.94), rgba(16, 30, 56, 0.86) 65%, rgba(16, 30, 56, 0.55));
  box-shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.7);
  animation: dialogue-entree 0.2s ease-out;
}
.dialogue-name {
  padding-bottom: 0.35rem; margin-bottom: 0.55rem; font: 700 1.45rem/1.1 var(--font-display); letter-spacing: 0.03em;
  border-bottom: 1px solid; border-image: linear-gradient(90deg, rgba(165, 243, 252, 0.8), rgba(165, 243, 252, 0)) 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.dialogue-close { position: absolute; top: 0.6rem; right: 0.8rem; border: 0; background: none; color: #b9c6dc; font-size: 1.1rem; cursor: pointer; }
.dialogue-close:hover { color: #fff; }
.dialogue-older { margin: 0 0 0.3rem; padding: 0; list-style: none; font: 400 0.9rem/1.4 var(--font); color: #9fb0c8; }
.dialogue-older .is-mine, .dialogue-text.is-mine { color: #a5f3fc; }
.dialogue-text { min-height: 1.6em; font: 500 1.3rem/1.45 var(--font); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); overflow-wrap: anywhere; }
.dialogue-form { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.6rem; }
.dialogue .dialogue-input {
  flex: 1; min-width: 0; padding: 0.45rem 0.1rem; border: 0; border-bottom: 1px solid rgba(165, 243, 252, 0.35);
  background: transparent; color: #fff; font: 400 1rem/1.3 var(--font); outline: none;
}
.dialogue .dialogue-input:focus { border-bottom-color: #22d3ee; box-shadow: none; }
.dialogue-hint { font: 400 0.75rem/1 var(--font); color: #8796ad; white-space: nowrap; }
@keyframes dialogue-entree { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 700px) {
  .dialogue { height: 48%; }
  .dialogue-portrait { opacity: 0.35; }
  .dialogue-box { left: 3%; }
  .dialogue-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { .dialogue-portrait, .dialogue-box { animation: none; } }
/* Le HUD du monde (hud.js, d'après Design/img_5.png) : en bas à droite, la barre de boutons
   ronds et les éclats ; ses fenêtres (collection, boutique) dans le style du menu principal. */
.hud { position: absolute; right: 0.75rem; bottom: 0.75rem; z-index: 4; display: grid; justify-items: end; gap: 0.4rem; }
.board-host:has(.monde-menu:not([hidden])) :is(.hud, .hud-window, .hud-vendor) { display: none; }
.hud-bar { display: flex; gap: 0.35rem; padding: 0.3rem 0.45rem; border-radius: 999px;
  background: rgba(13, 15, 23, 0.72); border: 1px solid rgba(232, 194, 90, 0.35); }
.hud-btn {
  width: 2.5rem; height: 2.5rem; border-radius: 50%; cursor: pointer; font-size: 1.1rem; line-height: 1; color: #fff;
  background: radial-gradient(circle at 35% 30%, #a3443a, #5c1d1a 70%); border: 2px solid #d9b45a;
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.25), 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.12s, box-shadow 0.12s;
}
.hud-btn:hover, .hud-btn:focus-visible { transform: translateY(-2px); box-shadow: 0 0 14px rgba(232, 194, 90, 0.6); outline: none; }
.hud-eclats, .hud-window-eclats {
  display: inline-flex; align-items: baseline; gap: 0.35rem; padding: 0.3rem 0.8rem; border-radius: 999px;
  background: rgba(13, 15, 23, 0.8); border: 1px solid rgba(232, 194, 90, 0.45); color: #f6e7b8;
  font: 600 0.8rem/1 var(--font);
}
.hud-eclats b, .hud-window-eclats b { font: 700 1.05rem/1 var(--font-display); color: #fff3c4; }
.hud-eclat-icone { color: #6fe3ff; text-shadow: 0 0 6px #22d3ee; }
.hud-window {
  position: absolute; z-index: 15; left: 50%; top: 7%; transform: translateX(-50%);
  width: min(620px, calc(100% - 2rem)); max-height: 80%; overflow: auto; color: #edf0fa;
}
.hud-window[hidden], .hud-vendor[hidden] { display: none; }
.hud-shop { top: 4%; max-height: 54%; }
.hud-window-head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.8rem; padding-right: 1.8rem; position: relative; }
.hud-window-head .monde-menu-heading { margin: 0; flex: 1; }
.hud-window-head .dialogue-close { top: 0; right: 0; }
.hud-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.5rem; }
.hud-card {
  display: grid; justify-items: center; align-content: start; gap: 0.35rem; padding: 0.7rem 0.5rem; border-radius: 10px;
  background: #171a26; border: 1px solid #2a2f42; color: #edf0fa; font: inherit; text-align: center; cursor: pointer;
}
button.hud-card:hover:not(:disabled) { border-color: #8b5cf6; }
.hud-card.is-equipped { border-color: #22d3ee; background: rgba(34, 211, 238, 0.1); }
.hud-card.is-locked { opacity: 0.6; cursor: default; }
.hud-card.is-locked .hud-apercu { filter: grayscale(1) brightness(0.7); }
.hud-card:disabled { cursor: default; }
.hud-apercu { min-height: 72px; display: grid; place-items: center; margin: 0; }
.hud-aucun { width: 48px; font-size: 1.6rem; color: #5b6275; }
.hud-card-name { font: 600 0.85rem/1.2 var(--font); }
.hud-card-state { font: 500 0.72rem/1.3 var(--font); color: #9fb0c8; }
.hud-card.is-equipped .hud-card-state { color: #22d3ee; }
.hud-buy { width: 100%; }
.hud-buy:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
/* Le codex : les jaquettes des jeux terminés, un sceau doré ; les autres grisés. */
.hud-window.hud-codex { width: min(820px, calc(100% - 2rem)); max-width: none; }
.codex-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.codex-resume { margin: 0 0 0.8rem; font: 600 0.95rem/1.3 var(--font); color: #f6e7b8; }
.codex-titre { margin: 1.1rem 0 0.6rem; font: 600 0.9rem/1.2 var(--font); color: #9fb0c8; text-transform: uppercase; letter-spacing: 0.06em; }
.codex-jeu { cursor: default; }
.codex-jeu.is-fini { border-color: rgba(232, 194, 90, 0.55); background: linear-gradient(180deg, rgba(232, 194, 90, 0.12), #171a26 60%); }
.codex-cover {
  position: relative; width: 100%; aspect-ratio: 3 / 4; border-radius: 6px; overflow: hidden; display: grid; place-items: center;
  background: #0f1119; font: 700 2rem/1 var(--font-display); color: #5b6275;
}
.codex-cover img { width: 100%; height: 100%; object-fit: cover; }
.codex-jeu.is-locked .codex-cover img { filter: grayscale(1) brightness(0.6); }
.codex-sceau {
  position: absolute; right: 0.3rem; bottom: 0.3rem; padding: 0.15rem 0.45rem; border-radius: 999px;
  background: rgba(13, 15, 23, 0.85); border: 1px solid #d9b45a; color: #ffe08a; font: 700 0.75rem/1.2 var(--font);
}
.codex-console { font: 500 0.7rem/1.2 var(--font); color: #8b93a8; }
@media (max-width: 700px) { .hud-btn { width: 2.2rem; height: 2.2rem; } .hud-shop { max-height: 46%; } }
/* Le menu principal du monde (menu.js) : le titre et ses boutons sur l'île survolée. */
.monde-menu {
  position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 1rem;
  background: radial-gradient(ellipse at center, rgba(10, 12, 20, 0.15), rgba(10, 12, 20, 0.6));
}
.monde-menu[hidden], .monde-menu [hidden] { display: none !important; }
.monde-menu-card { width: min(760px, 100%); max-height: calc(100% - 2rem); overflow: auto; color: #edf0fa; }
.board-host:has(.monde-menu:not([hidden])) :is(.board-help, .board-tools, .board-chat) { display: none; }
.monde-menu-home { display: grid; gap: 0.7rem; justify-items: center; text-align: center; }
.monde-menu-title {
  margin: 0; font: 700 clamp(3rem, 11vw, 5.5rem)/1.1 var(--font-display); letter-spacing: 0.06em; padding: 0 0.2em; text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 10%, #a5f3fc 55%, #8b5cf6 100%); -webkit-background-clip: text; background-clip: text;
  color: transparent; filter: drop-shadow(0 4px 18px rgba(34, 211, 238, 0.45)) drop-shadow(0 2px 2px rgba(10, 12, 20, 0.6));
}
.monde-menu-sub { margin-bottom: 1.2rem; font: 600 1rem/1.3 var(--font-display); letter-spacing: 0.12em; text-transform: uppercase;
  color: #e6fbff; text-shadow: 0 1px 6px rgba(10, 12, 20, 0.8); }
.monde-menu-btn {
  width: min(280px, 100%); padding: 0.8rem 1rem; border-radius: 12px; cursor: pointer;
  font: 700 1.15rem/1 var(--font-display); letter-spacing: 0.08em; text-transform: uppercase;
  color: #edf0fa; background: rgba(13, 15, 23, 0.82); border: 1px solid rgba(165, 243, 252, 0.35);
  box-shadow: 0 6px 20px -8px rgba(0, 0, 0, 0.6); transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.monde-menu-btn:hover, .monde-menu-btn:focus-visible { transform: translateY(-1px); border-color: #22d3ee;
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.35); outline: none; }
.monde-menu-btn.is-primary { background: linear-gradient(135deg, #8b5cf6, #22d3ee); border-color: transparent; color: #0a0c12; }
.monde-menu-btn.is-small { width: auto; padding: 0.55rem 0.9rem; font-size: 0.95rem; }
.monde-menu-note { max-width: 340px; padding: 0.6rem 0.8rem; border-radius: 10px; background: rgba(13, 15, 23, 0.88);
  font: 500 0.85rem/1.4 var(--font); color: #e6fbff; }
.monde-menu-settings { max-width: 460px; margin: 0 auto; padding: 1.1rem 1.2rem; border-radius: 16px; background: rgba(13, 15, 23, 0.92);
  border: 1px solid rgba(165, 243, 252, 0.25); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8); }
.monde-menu-heading { margin: 0 0 0.8rem; font: 700 1.6rem/1 var(--font-display); letter-spacing: 0.05em; text-transform: uppercase; }
.monde-menu-tabs { display: flex; gap: 0.4rem; margin-bottom: 0.8rem; }
.monde-menu-tab { flex: 1; padding: 0.5rem; border-radius: 8px; cursor: pointer; font: 600 0.9rem/1 var(--font);
  color: #b9bfd0; background: transparent; border: 1px solid #2a2f42; }
.monde-menu-tab[aria-selected="true"] { color: #edf0fa; border-color: #22d3ee; background: rgba(34, 211, 238, 0.12); }
.monde-menu-pane { display: grid; gap: 0.35rem; }
.monde-menu-row { display: flex; align-items: center; gap: 0.6rem; min-height: 2.3rem; }
.monde-menu-label { flex: 1; font: 500 0.9rem/1.2 var(--font); }
.monde-menu-key { min-width: 7.5rem; padding: 0.4rem 0.6rem; border-radius: 8px; cursor: pointer;
  font: 700 0.85rem/1.1 var(--font); color: #edf0fa; background: #171a26; border: 1px solid #2a2f42; }
.monde-menu-key:hover { border-color: #8b5cf6; }
.monde-menu-key.is-waiting { border-color: #22d3ee; color: #22d3ee; max-width: 12rem; }
.monde-menu-choices { display: flex; flex-wrap: wrap; gap: 0.3rem; justify-content: flex-end; }
.monde-menu-choice { padding: 0.4rem 0.6rem; border-radius: 8px; cursor: pointer; font: 600 0.8rem/1.1 var(--font);
  color: #b9bfd0; background: #171a26; border: 1px solid #2a2f42; }
.monde-menu-choice:hover { border-color: #8b5cf6; }
.monde-menu-choice[aria-checked="true"] { color: #edf0fa; border-color: #22d3ee; background: rgba(34, 211, 238, 0.14); }
.monde-menu-range { flex: 1.3; accent-color: #22d3ee; min-width: 0; }
.monde-menu-value { width: 3rem; text-align: right; font: 600 0.85rem/1 var(--font); color: #b9bfd0; }
.monde-menu-hint { margin-top: 0.3rem; font: 400 0.8rem/1.4 var(--font); color: #8890a8; }
.monde-menu-actions { display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 1rem; }
/* « Jouer » : un éclair, et l'on est dans le hall */
.monde-menu-flash { position: absolute; inset: 0; z-index: 19; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at center, #ffffff, #a5f3fc 45%, rgba(139, 92, 246, 0.6)); }
.monde-menu-flash.is-on { animation: monde-flash 0.9s ease-out; }
@keyframes monde-flash { 0% { opacity: 0; } 18% { opacity: 0.95; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .monde-menu-flash.is-on { animation-duration: 0.01s; } }
/* Le chat du hall : les derniers messages en bas à gauche, la saisie sous eux (Entrée). */
.board-chat { position: absolute; left: 0.75rem; bottom: 2.6rem; z-index: 2; width: min(440px, calc(100% - 1.5rem));
  display: flex; flex-direction: column; gap: 0.4rem; pointer-events: none; }
.board-chat-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.board-chat-log li { align-self: flex-start; max-width: 100%; padding: 0.35rem 0.65rem; border-radius: 10px;
  background: rgba(10, 12, 20, 0.78); color: #edf0fa; font: 500 0.85rem/1.35 Inter, sans-serif; overflow-wrap: anywhere;
  transition: opacity 1.5s; }
.board-chat-log li b { color: #a5f3fc; }
.board-chat-log li.is-mine b { color: #fde68a; }
.board-chat-log li.is-old { opacity: 0; }
.board-chat-form { pointer-events: auto; }
.board-chat-input { width: 100%; padding: 0.55rem 0.75rem; border-radius: 10px; border: 1px solid #22d3ee;
  background: rgba(10, 12, 20, 0.92); color: #edf0fa; font: 500 0.9rem Inter, sans-serif; outline: none; }
.board-toast {
  position: absolute; left: 50%; top: 3.4rem; transform: translateX(-50%); z-index: 3; padding: 0.5rem 0.9rem;
  border-radius: 10px; background: rgba(23, 26, 38, 0.95); border: 1px solid #8b5cf6; color: #edf0fa;
  font: 600 0.82rem/1.3 Inter, sans-serif; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); max-width: 80%;
}

.board-panel {
  position: absolute; top: 3.4rem; right: 0.75rem; bottom: 0.75rem; z-index: 3; width: min(360px, calc(100% - 1.5rem));
  display: flex; flex-direction: column; border-radius: 14px; overflow: hidden;
  background: rgba(15, 17, 27, 0.96); border: 1px solid rgba(139, 92, 246, 0.6); color: #edf0fa;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55); font: 500 0.84rem/1.4 Inter, sans-serif; backdrop-filter: blur(6px);
}
.board-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem;
  padding: 0.8rem 0.9rem; border-bottom: 1px solid #262c3c; }
.board-panel-head h3 { margin: 0; font: 700 1.15rem/1.2 Rajdhani, Inter, sans-serif; }
.board-panel-head p { margin: 0.1rem 0 0; }
.board-close { background: none; border: 1px solid #2a2f42; color: #b9bfd0; border-radius: 8px; width: 2rem; height: 2rem;
  cursor: pointer; font-size: 0.9rem; }
.board-close:hover { border-color: #ff7a93; color: #ff7a93; }
.board-panel-body { overflow-y: auto; padding: 0.4rem 0.9rem 0.9rem; }
.board-section { padding: 0.6rem 0; border-bottom: 1px solid #1f2333; }
.board-section:last-child { border-bottom: 0; }
.board-section h4 { margin: 0 0 0.4rem; font: 700 0.78rem/1.3 Inter, sans-serif; color: #a78bfa; text-transform: uppercase;
  letter-spacing: 0.04em; }
.board-muted { color: #8890a8; font-size: 0.78rem; margin: 0.2rem 0; }
.board-note { color: #ffc94d; font-size: 0.78rem; margin: 0.4rem 0; }
.board-hints { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.board-hint { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.4rem 0.5rem;
  border-radius: 8px; background: #171a26; border: 1px solid #262c3c; }
.board-hint.is-found { opacity: 0.6; }
.board-hint-text { min-width: 0; overflow-wrap: anywhere; font-size: 0.8rem; }
.board-chip { display: inline-block; padding: 0 0.4rem; border-radius: 6px; font-weight: 700; color: #0a0c12; background: #9aa3b8; }
.board-chip.is-key { background: #c084fc; }
.board-chip.is-useful { background: #22d3ee; }
.board-chip.is-trap { background: #ff4d6d; color: #fff; }
.board-badge { flex: none; font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 999px; border: 1px solid #34e7a6; color: #34e7a6; }
.board-btn {
  flex: none; font: 600 0.75rem/1 Inter, sans-serif; padding: 0.42rem 0.6rem; border-radius: 8px; cursor: pointer;
  background: #1f2333; color: #edf0fa; border: 1px solid #2a2f42; white-space: nowrap;
}
.board-btn:hover:not(:disabled) { border-color: #8b5cf6; }
.board-btn.is-primary { background: #8b5cf6; border-color: #8b5cf6; color: #fff; }
.board-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.board-form { display: flex; gap: 0.4rem; }
.board-input, .board-select {
  flex: 1; min-width: 0; font: inherit; font-size: 0.82rem; padding: 0.42rem 0.55rem; border-radius: 8px;
  background: #0d0f17; color: #edf0fa; border: 1px solid #2a2f42;
}
.board-input:focus, .board-select:focus { outline: none; border-color: #8b5cf6; }
.board-row { display: flex; align-items: center; gap: 0.4rem; padding-top: 0.5rem; font-size: 0.8rem; color: #b9bfd0; }
.board-replies { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.35rem; font-size: 0.8rem; }
.board-replies li { padding: 0.4rem 0.5rem; border-radius: 8px; background: #171a26; border: 1px solid #262c3c; }
.board-replies li.is-found { border-color: #8b5cf6; }
.board-replies li.is-error { border-color: #ff4d6d; color: #ff9aae; }
@media (max-width: 600px) {
  .board-panel { top: auto; height: 62%; left: 0.5rem; right: 0.5rem; width: auto; }
  .board-help { display: none; }
  .board-chat { bottom: 0.75rem; }
}

/* Plateau Unity (bêta) : le canvas du build, et son chargement */
.board-unity { outline: none; }
.board-unity-canvas { outline: none; background: #07080d; }
.board-unity-loading { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 0.8rem; background: #07080d; color: #a5f3fc; text-align: center; padding: 1rem; }
.board-unity-loading-text { font-weight: 600; max-width: 32rem; }
.board-unity-bar { width: min(320px, 80%); height: 8px; border-radius: 4px; background: rgba(34, 211, 238, 0.15); overflow: hidden; }
.board-unity-bar::after { content: ""; display: block; height: 100%; width: var(--p, 0%);
  background: linear-gradient(90deg, #8b5cf6, #22d3ee); transition: width 0.2s; }

/* Après avoir rejoint un salon : direction le plateau 3D */
.board-invite { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.9rem 1rem; margin-bottom: 1rem; border-radius: 12px; border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent); }
.board-invite p { margin: 0; flex: 1; min-width: 14rem; }

/* Créer un salon : il faut être connecté avec Discord (le compte reste l'hôte) */
.create-login { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.create-login .btn-discord { flex: none; }

/* Plateau 3D : éditeur (hôte) et terminal */

.board-terminal-label {
  padding: 0.1rem 0.5rem; border-radius: 6px; pointer-events: none; white-space: nowrap;
  background: rgba(4, 18, 26, 0.85); border: 1px solid #22d3ee; color: #a5f3fc; font: 700 0.68rem/1.3 ui-monospace, monospace;
}
.board-editor { width: min(340px, calc(100% - 1.5rem)); }
.board-palette { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.board-swatch {
  font: 600 0.76rem/1.2 Inter, sans-serif; padding: 0.4rem 0.6rem; border-radius: 8px; cursor: pointer;
  background: #171a26; color: #edf0fa; border: 1px solid #2a2f42; border-left: 4px solid var(--c, #2a2f42);
}
.board-swatch:hover:not(:disabled) { border-color: #8b5cf6; }
.board-swatch.is-active { border-color: #22d3ee; background: rgba(34, 211, 238, 0.12); }
.board-swatch:disabled { opacity: 0.45; cursor: not-allowed; }
.board-editor-foot { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0.7rem 0.9rem; border-top: 1px solid #262c3c; }

.board-terminal {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4;
  width: min(680px, calc(100% - 1.5rem)); height: min(420px, calc(100% - 4rem));
  display: flex; flex-direction: column; border-radius: 12px; overflow: hidden;
  background: rgba(3, 10, 16, 0.97); border: 1px solid #22d3ee; box-shadow: 0 0 40px rgba(34, 211, 238, 0.25);
  font: 500 0.84rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; color: #a5f3fc;
}
.board-terminal-head { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(34, 211, 238, 0.35); background: rgba(34, 211, 238, 0.08); }
.board-terminal-title { font-weight: 700; letter-spacing: 0.04em; }
.board-terminal-out { list-style: none; margin: 0; padding: 0.6rem 0.8rem; overflow-y: auto; flex: 1; white-space: pre-wrap;
  overflow-wrap: anywhere; }
.board-terminal-out li { margin: 0.05rem 0; }
.board-terminal-out .is-cmd { color: #e0f2fe; font-weight: 700; margin-top: 0.4rem; }
.board-terminal-out .is-info { color: #67e8f9; opacity: 0.85; }
.board-terminal-out .is-help { color: #bae6fd; }
.board-terminal-out .is-ok { color: #34e7a6; }
.board-terminal-out .is-warn { color: #ffc94d; }
.board-terminal-out .is-error { color: #ff7a93; }
.board-terminal-form { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.8rem; border-top: 1px solid rgba(34, 211, 238, 0.35); }
.board-terminal-sign { color: #22d3ee; font-weight: 800; }
.board-terminal .board-terminal-input { flex: 1; width: auto; min-width: 0; padding: 0.2rem 0; background: transparent; border: 0;
  border-radius: 0; box-shadow: none; outline: none; color: #e0f2fe; font: inherit; }
/* Le bureau : des icônes, chacune ouvre une application */
.board-desk { height: min(580px, calc(100% - 4rem)); width: min(760px, calc(100% - 1.5rem)); }
.board-desk .board-terminal-head { gap: 0.6rem; }
.board-desk .board-terminal-title { flex: 1; }
.board-desk-back { background: none; border: 1px solid rgba(34, 211, 238, 0.45); color: #a5f3fc; border-radius: 8px;
  padding: 0.25rem 0.6rem; font: inherit; cursor: pointer; }
.board-desk-back:hover { border-color: #22d3ee; color: #e0f2fe; }
.board-desk-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0.7rem; padding: 0.9rem 1rem;
  overflow-y: auto; background: radial-gradient(ellipse at 50% 0%, rgba(34, 211, 238, 0.08), transparent 70%); }
.board-desk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.7rem; }
.board-desk-icon { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; padding: 0.8rem 0.4rem;
  border-radius: 12px; cursor: pointer; background: rgba(34, 211, 238, 0.05); border: 1px solid rgba(34, 211, 238, 0.2);
  color: #e0f2fe; font: inherit; transition: background 0.15s, border-color 0.15s, transform 0.15s; }
.board-desk-icon:hover, .board-desk-icon:focus-visible { background: rgba(34, 211, 238, 0.14); border-color: #22d3ee;
  transform: translateY(-2px); outline: none; }
.board-desk-glyph { font-size: 2rem; line-height: 1; }
.board-desk-name { font-weight: 700; font-size: 0.8rem; }
.board-desk-who { margin-top: auto; font-size: 0.75rem; color: #67e8f9; opacity: 0.8; }
.board-desk-help { color: #bae6fd; font-size: 0.8rem; }
.board-desk-note { color: #ffc94d; }
.board-desk-form, .board-desk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.board-desk .board-desk-input { flex: 1; width: auto; min-width: 8rem; font-size: 0.84rem; background: rgba(3, 10, 16, 0.9); color: #e0f2fe; font: inherit;
  border: 1px solid rgba(34, 211, 238, 0.35); border-radius: 8px; padding: 0.4rem 0.6rem; }
.board-desk .board-desk-input:focus { box-shadow: none; outline: none; border-color: #22d3ee; }
.board-desk .board-desk-num { flex: none; width: 4.5rem; min-width: 0; }
.board-desk-unit { color: #67e8f9; }
.board-desk .btn { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.board-desk .btn.is-armed { border-color: #ff7a93; color: #ff7a93; }
.board-desk-section { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.7rem; border-radius: 10px;
  border: 1px solid rgba(34, 211, 238, 0.2); }
.board-desk-section-title { font-weight: 700; color: #e0f2fe; }
.board-desk-log { flex: 1; min-height: 4rem; padding: 0.4rem 0; }
.board-desk .board-terminal-form { margin: 0 -1rem -0.9rem; }
.board-desk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.6rem; }
.board-desk-card { padding: 0.7rem; border-radius: 10px; border: 1px solid rgba(34, 211, 238, 0.2); background: rgba(34, 211, 238, 0.05); }
.board-desk-card.is-big { grid-column: 1 / -1; }
.board-desk-card-value { font-size: 1.15rem; font-weight: 800; color: #e0f2fe; }
.board-desk-card.is-big .board-desk-card-value { font-size: 1.8rem; }
.board-desk-card-label { font-size: 0.72rem; color: #67e8f9; text-transform: uppercase; letter-spacing: 0.05em; }
.board-desk-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: rgba(34, 211, 238, 0.15); overflow: hidden; }
.board-desk-bar::after { content: ""; display: block; height: 100%; width: var(--p, 0%); background: linear-gradient(90deg, #22d3ee, #34e7a6); }
.board-desk-players { display: flex; flex-direction: column; gap: 0.35rem; }
.board-desk-player { border-radius: 8px; border: 1px solid rgba(34, 211, 238, 0.18); }
.board-desk-player.is-open { border-color: #22d3ee; }
.board-desk-player-main { width: 100%; display: grid; grid-template-columns: 1fr 1fr 90px 4.5rem 5.5rem; align-items: center;
  gap: 0.6rem; padding: 0.45rem 0.6rem; background: none; border: 0; color: #e0f2fe; font: inherit; text-align: left; cursor: pointer; }
.board-desk-player-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-desk-player-game { color: #bae6fd; font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-desk-player .board-desk-bar { grid-column: auto; }
.board-desk-player-pct { text-align: right; }
.board-desk-player-status { font-size: 0.75rem; color: #9aa3b8; }
.board-desk-player.is-playing .board-desk-player-status { color: #34e7a6; }
.board-desk-player.is-goal .board-desk-player-status { color: #ffc94d; }
.board-desk-detail { padding: 0 0.6rem 0.5rem; color: #bae6fd; font-size: 0.78rem; }
@media (max-width: 560px) {
  .board-desk-player-main { grid-template-columns: 1fr 70px 4rem; }
  .board-desk-player-game, .board-desk-player-status { display: none; }
}
/* Les étiquettes de la scène restent sous les panneaux et la barre d'outils (CSS2DRenderer
   donne à chacune son propre z-index : on les enferme dans un contexte d'empilement). */
.board-host .board-labels { z-index: 1; }
.board-tools { left: 17rem; justify-content: flex-end; }
@media (max-width: 760px) {
  .board-tools { left: 0.75rem; top: 2.9rem; justify-content: flex-start; }
}

/* --------------------------------------------------------------------------- le monde
   suivi.html : le plateau Unity en plein écran (hall ou table d'un salon), les pages du site
   en fenêtres par-dessus (fenetres.js), le fil de la partie dans une fenêtre à droite. */
html.monde, html.monde body { height: 100%; overflow: hidden; background: #07080d; }
.monde .app.suivi-page { max-width: none; padding: 0; margin: 0; }
.monde .suivi-head, .monde .kpi-row, .monde .suivi-toolbar, .monde .suivi-players { display: none !important; }
.monde .suivi-layout { display: block !important; }
.monde .suivi-board { display: block !important; position: fixed; inset: 0; height: auto; border: 0; border-radius: 0; }
.monde #suivi-status:not([hidden]), .monde .suivi-board-note:not([hidden]) {
  position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; gap: 0.5rem; margin: 0; padding: 1rem;
  text-align: center; color: #a5f3fc; background: #07080d; }
.monde .suivi-feed-panel { display: none; position: absolute; right: 1rem; top: 3.6rem; bottom: 1rem; z-index: 6; margin: 0;
  width: min(420px, calc(100% - 2rem)); max-height: none; flex-direction: column; overflow: hidden;
  background: rgba(3, 10, 16, 0.96); border: 1px solid #22d3ee; box-shadow: 0 0 40px rgba(34, 211, 238, 0.2); }
.monde .suivi-feed-panel.is-open { display: flex; }
.monde .suivi-feed-panel .suivi-feed { overflow-y: auto; }
.suivi-feed-head { display: none; }
.monde .suivi-feed-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  margin-bottom: 0.6rem; font-weight: 700; color: #a5f3fc; }
.board-desk-section { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #67e8f9; opacity: 0.8; }

/* les fenêtres */
.fenetre { position: absolute; display: flex; flex-direction: column; min-width: 320px; min-height: 220px; resize: both;
  overflow: hidden; border-radius: 12px; background: rgba(3, 10, 16, 0.97); border: 1px solid rgba(34, 211, 238, 0.45);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6); }
.fenetre.is-front { border-color: #22d3ee; box-shadow: 0 0 40px rgba(34, 211, 238, 0.25), 0 18px 60px rgba(0, 0, 0, 0.6); }
.fenetre.is-max { left: 8px !important; top: 8px !important; width: calc(100% - 16px) !important; height: calc(100% - 16px) !important;
  resize: none; }
.fenetre-head { display: flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.5rem 0.4rem 0.9rem; cursor: grab;
  background: rgba(34, 211, 238, 0.08); border-bottom: 1px solid rgba(34, 211, 238, 0.35); color: #a5f3fc; font-weight: 700;
  user-select: none; touch-action: none; }
.fenetre-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fenetre-btn { flex: none; width: 2rem; height: 1.8rem; border-radius: 8px; cursor: pointer; background: none;
  border: 1px solid rgba(34, 211, 238, 0.45); color: #a5f3fc; }
.fenetre-btn:hover { border-color: #22d3ee; color: #e0f2fe; }
.fenetre-close:hover { border-color: #ff4d6d; color: #ff8fa3; }
.fenetre-home { width: auto; padding: 0 0.6rem; font-weight: 700; white-space: nowrap; }
.fenetre-frame { flex: 1; width: 100%; border: 0; background: var(--bg); }
.fenetres-drag .fenetre-frame { pointer-events: none; }
@media (max-width: 600px) {
  .fenetre { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; resize: none; }
}

/* une page du site dans une fenêtre du monde (nav.js) */
html.en-fenetre .topbar { display: none !important; }
html.en-fenetre .app { padding-top: 1rem; }

/* le fond d'écran du bureau : le fond animé des paramètres (particles.js), sous les icônes */
.board-desk .fond-bureau { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.board-desk > .board-terminal-head, .board-desk > .board-desk-body { position: relative; z-index: 1; }
.board-desk:has(.fond-bureau) .board-desk-body { background: none; }
.board-desk:has(.fond-bureau) .board-desk-icon { background: rgba(3, 10, 16, 0.62); backdrop-filter: blur(3px); }
.board-desk:has(.fond-bureau) .board-desk-who, .board-desk:has(.fond-bureau) .board-desk-section,
.board-desk:has(.fond-bureau) .board-desk-help { text-shadow: 0 1px 3px #000, 0 0 8px #000; }
