/* D.Majin — Forum des marins (ambiance vivante) */

/* === Icônes : Lucide (SVG) + coffre artefacts (pixel) === */
.forum-lucide {
  display: block;
  flex-shrink: 0;
  color: var(--turquoise);
  stroke: currentColor;
  filter: drop-shadow(0 0 6px rgba(0, 245, 212, 0.35));
}
.forum-lucide svg {
  display: block;
  width: 100%;
  height: 100%;
}
.forum-lucide--xs { width: 16px; height: 16px; }
.forum-lucide--sm { width: 20px; height: 20px; }
.forum-lucide--lg { width: 48px; height: 48px; }
.forum-lucide--xl { width: 44px; height: 44px; }
.forum-lucide--gold { color: var(--jaune); filter: drop-shadow(0 0 8px rgba(254, 228, 64, 0.4)); }
.forum-lucide--purple { color: #c4a0ff; filter: drop-shadow(0 0 8px rgba(180, 123, 255, 0.4)); }
.forum-lucide--muted { color: rgba(255, 255, 255, 0.45); opacity: 0.75; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35)); }
.forum-lucide--sidebar { filter: drop-shadow(0 0 12px rgba(0, 245, 212, 0.5)); }
.forum-lucide--lock { color: var(--turquoise); filter: drop-shadow(0 0 10px rgba(0, 245, 212, 0.5)); }

/* Pixel art — uniquement coffre artefacts */
.forum-ic-img {
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
  flex-shrink: 0;
}
.forum-ic-img--xs { width: 16px; height: 16px; }
.forum-ic-img--sm { width: 22px; height: 22px; }
.forum-ic-img--lg { width: 48px; height: 48px; }
.forum-ic-img--xl { width: 52px; height: 52px; }
.forum-ic-img--gold {
  filter: drop-shadow(0 0 10px rgba(180, 123, 255, 0.5)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}
.forum-sidebar-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  animation: forumFloat 3.5s ease-in-out infinite;
}
.forum-ic-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}
.forum-create-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.forum-cat-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* === Page & fond === */
.forum-page {
  background: #06080c;
  min-height: 100vh;
}
.forum-page .page-content { position: relative; z-index: 2; }

#forumCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.forum-fx-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.5) 100%);
  opacity: 0.7;
}
.forum-fx-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.35;
  mix-blend-mode: overlay;
}
.forum-grid-floor {
  position: fixed;
  left: -15%;
  right: -15%;
  bottom: -5%;
  height: 42vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(0, 245, 212, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 245, 212, 0.09) 1px, transparent 1px);
  background-size: 36px 36px;
  transform: perspective(280px) rotateX(68deg);
  -webkit-mask: linear-gradient(transparent, #000 55%);
  mask: linear-gradient(transparent, #000 55%);
  animation: forumGridMove 8s linear infinite;
}
@keyframes forumGridMove {
  from { background-position: 0 0; }
  to { background-position: 0 36px; }
}

/* === Section === */
.section-forum {
  position: relative;
  overflow: hidden;
  padding-bottom: 4rem;
}
.section-forum::before {
  content: "";
  position: absolute;
  inset: -25% -15%;
  background:
    radial-gradient(ellipse 55% 42% at 12% 18%, rgba(0, 245, 212, 0.16), transparent 58%),
    radial-gradient(ellipse 48% 38% at 88% 72%, rgba(180, 123, 255, 0.14), transparent 55%),
    radial-gradient(ellipse 35% 28% at 50% 100%, rgba(254, 228, 64, 0.09), transparent 52%);
  pointer-events: none;
  animation: forumAurora 16s ease-in-out infinite alternate;
}
@keyframes forumAurora {
  0% { transform: translate(0, 0) scale(1); opacity: 0.8; }
  100% { transform: translate(2.5%, -1.5%) scale(1.04); opacity: 1; }
}
.container-forum { position: relative; z-index: 1; max-width: 1180px; }

/* === Hero === */
.forum-hero {
  text-align: center;
  margin-bottom: 1.25rem;
}
.forum-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--turquoise);
  margin-bottom: 0.6rem;
  animation: forumFadeUp 0.55s ease backwards;
}
.forum-kicker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--turquoise);
  box-shadow: 0 0 12px var(--turquoise-glow);
  animation: forumPulse 2.2s infinite;
}
.forum-title {
  background: linear-gradient(100deg, #00f5d4 0%, #b9fff4 16%, #00f5d4 34%, #fee440 50%, #00f5d4 68%, #b47bff 86%, #00f5d4 100%);
  background-size: 280% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(0, 245, 212, 0.45));
  animation: forumTitleShimmer 7s linear infinite, forumFadeUp 0.65s ease 0.05s backwards;
}
@keyframes forumTitleShimmer { to { background-position: 280% 0; } }
.forum-intro {
  max-width: 560px;
  margin: 0.75rem auto 1.1rem;
  animation: forumFadeUp 0.7s ease 0.1s backwards;
}
.forum-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 0.85rem;
  animation: forumFadeUp 0.75s ease 0.15s backwards;
}
.forum-hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 245, 212, 0.22);
  background: rgba(0, 245, 212, 0.06);
  font-size: 0.78rem;
  color: var(--blanc);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.forum-hud-pill .ic { font-size: 0.95rem; }
.forum-hud-live--pill {
  width: 6px;
  height: 6px;
  margin-right: 2px;
}
.forum-hud-pill--live {
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.08);
}
button.forum-hud-pill--link {
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
button.forum-hud-pill--link:hover {
  border-color: rgba(0, 245, 212, 0.45);
  background: rgba(0, 245, 212, 0.12);
  transform: translateY(-1px);
}
button.forum-hud-pill--link:focus-visible {
  outline: 2px solid rgba(0, 245, 212, 0.55);
  outline-offset: 2px;
}
.forum-hud-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.7);
  animation: forumPulse 1.8s infinite;
}
.forum-ticker-wrap {
  overflow: hidden;
  max-width: 100%;
  -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  opacity: 0.55;
}
.forum-ticker {
  display: flex;
  gap: 1.5rem;
  white-space: nowrap;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(0, 245, 212, 0.65);
  animation: forumTicker 28s linear infinite;
}
@keyframes forumTicker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes forumPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.82); }
}
@keyframes forumFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* === Shell cards (HUD corners) === */
.forum-shell {
  position: relative;
  background: linear-gradient(155deg, rgba(16, 18, 24, 0.94), rgba(8, 10, 14, 0.9));
  border: 1px solid rgba(0, 245, 212, 0.2);
  border-radius: 20px;
  padding: 1rem 1.15rem;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 0 40px rgba(0, 245, 212, 0.03);
  transition: border-color 0.3s, box-shadow 0.3s;
  overflow: hidden;
}
.forum-shell:hover {
  border-color: rgba(0, 245, 212, 0.32);
}
.forum-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  z-index: 2;
}
.forum-corner.tl { top: 8px; left: 8px; border-top: 2px solid rgba(0, 245, 212, 0.55); border-left: 2px solid rgba(0, 245, 212, 0.55); }
.forum-corner.tr { top: 8px; right: 8px; border-top: 2px solid rgba(0, 245, 212, 0.55); border-right: 2px solid rgba(0, 245, 212, 0.55); }
.forum-corner.bl { bottom: 8px; left: 8px; border-bottom: 2px solid rgba(180, 123, 255, 0.45); border-left: 2px solid rgba(180, 123, 255, 0.45); }
.forum-corner.br { bottom: 8px; right: 8px; border-bottom: 2px solid rgba(180, 123, 255, 0.45); border-right: 2px solid rgba(180, 123, 255, 0.45); }

/* === Layout === */
.forum-layout {
  display: grid;
  grid-template-columns: minmax(270px, 330px) 1fr;
  gap: 1.35rem;
  margin-top: 1.25rem;
  min-height: 64vh;
}
@media (max-width: 900px) {
  .forum-layout { grid-template-columns: 1fr; }
  .forum-sidebar.forum-sidebar--hide-mobile { display: none !important; }
  .forum-main.forum-main--hide-mobile { display: none !important; }
  .forum-main.forum-main--full { grid-column: 1 / -1; }
}

/* === Sidebar === */
.forum-sidebar-accent {
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 3px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, rgba(0, 245, 212, 0.15), rgba(0, 245, 212, 0.65), rgba(180, 123, 255, 0.5), rgba(0, 245, 212, 0.15));
  pointer-events: none;
  z-index: 1;
  animation: forumAccentPulse 3s ease-in-out infinite;
}
@keyframes forumAccentPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
.forum-sidebar-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  position: relative;
  z-index: 1;
}
.forum-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.forum-sidebar-brand strong {
  display: block;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  color: var(--blanc);
}
.forum-sidebar-sub {
  font-size: 0.68rem;
  color: var(--gris);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.forum-sidebar-icon {
  width: 38px;
  height: 38px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 0 10px rgba(0, 245, 212, 0.45));
  animation: forumFloat 3.5s ease-in-out infinite;
}
.forum-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 245, 212, 0.35);
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.18), rgba(0, 245, 212, 0.06));
  color: var(--turquoise);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 0 18px rgba(0, 245, 212, 0.12);
}
.forum-new-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 26px rgba(0, 245, 212, 0.22);
}
.forum-new-btn .plus {
  font-size: 1.1rem;
  line-height: 1;
}

.forum-search-wrap {
  position: relative;
  margin-bottom: 0.8rem;
}
.forum-search-ic {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.55;
  pointer-events: none;
  z-index: 1;
}
.forum-search {
  width: 100%;
  padding: 0.7rem 0.9rem 0.7rem 2.35rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.38);
  color: var(--blanc);
  font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.forum-search:focus {
  outline: none;
  border-color: rgba(0, 245, 212, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.1);
}

/* Categories */
.forum-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0.9rem;
}
.forum-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--gris);
  font-size: 0.76rem;
  cursor: pointer;
  transition: 0.2s;
}
.forum-cat:hover, .forum-cat.is-active {
  color: var(--turquoise);
  border-color: rgba(0, 245, 212, 0.42);
  background: rgba(0, 245, 212, 0.09);
  box-shadow: 0 0 16px rgba(0, 245, 212, 0.14);
}
.forum-cat--artefacts.is-active { color: #c4a0ff; border-color: rgba(180, 123, 255, 0.45); background: rgba(180, 123, 255, 0.1); }
.forum-cat--equipage.is-active { color: #7dd3fc; border-color: rgba(56, 189, 248, 0.4); background: rgba(56, 189, 248, 0.08); }
.forum-cat--aide.is-active { color: var(--jaune); border-color: rgba(254, 228, 64, 0.4); background: rgba(254, 228, 64, 0.08); }
.forum-cat--annonces.is-active { color: #fcd34d; border-color: rgba(252, 211, 77, 0.45); background: rgba(252, 211, 77, 0.1); }

/* Thread list */
.forum-thread-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 4px;
  position: relative;
  z-index: 1;
}
.forum-thread-item {
  text-align: left;
  width: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  cursor: pointer;
  animation: forumFadeUp 0.45s ease backwards;
  transition: transform 0.15s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.forum-thread-item::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 38%, rgba(255, 255, 255, 0.12) 50%, transparent 62%);
  transform: translateX(-130%);
}
.forum-thread-item:hover {
  transform: translateX(4px);
  border-color: rgba(0, 245, 212, 0.3);
  background: rgba(0, 245, 212, 0.06);
  box-shadow: 0 4px 20px rgba(0, 245, 212, 0.08);
}
.forum-thread-item:hover::after { animation: forumCardShine 0.65s ease; }
@keyframes forumCardShine {
  from { transform: translateX(-130%); }
  to { transform: translateX(130%); }
}
.forum-thread-item.is-active {
  border-color: rgba(0, 245, 212, 0.48);
  background: rgba(0, 245, 212, 0.11);
  box-shadow: inset 3px 0 0 var(--turquoise), 0 0 24px rgba(0, 245, 212, 0.1);
}
.forum-thread-item .t-title {
  font-weight: 600;
  font-size: 0.93rem;
  line-height: 1.35;
  margin-bottom: 5px;
  color: var(--blanc);
}
.forum-thread-item .t-meta {
  font-size: 0.71rem;
  color: var(--gris);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.forum-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(0, 245, 212, 0.12);
  color: var(--turquoise);
  border: 1px solid rgba(0, 245, 212, 0.22);
}
.forum-badge--pin {
  background: rgba(254, 228, 64, 0.12);
  color: var(--jaune);
  border-color: rgba(254, 228, 64, 0.3);
}
.forum-badge--staff {
  background: rgba(254, 228, 64, 0.14);
  color: var(--jaune);
  border-color: rgba(254, 228, 64, 0.35);
}
.forum-staff-notice {
  flex-shrink: 0;
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(254, 228, 64, 0.28);
  background: rgba(254, 228, 64, 0.08);
  color: #f5e6a8;
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: center;
}

/* Skeleton & empty */
.forum-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.forum-skel-row {
  height: 58px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 0%, rgba(0,245,212,0.08) 50%, rgba(255,255,255,0.03) 100%);
  background-size: 200% 100%;
  animation: forumShimmer 1.4s ease infinite;
}
.forum-skel-row:nth-child(2) { animation-delay: 0.15s; }
.forum-skel-row:nth-child(3) { animation-delay: 0.3s; }
.forum-skel-row:nth-child(4) { animation-delay: 0.45s; }
@keyframes forumShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.forum-empty {
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: 16px;
  border: 1px dashed rgba(0, 245, 212, 0.25);
  background: rgba(0, 245, 212, 0.04);
}
.forum-empty-icon {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: forumFloat 3s ease-in-out infinite;
}
.forum-empty-icon .forum-ic-img {
  filter: drop-shadow(0 0 14px rgba(0, 245, 212, 0.4)) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}
.forum-empty h3 {
  font-family: var(--font-display);
  color: var(--turquoise);
  margin: 0 0 0.4rem;
  letter-spacing: 0.04em;
}
.forum-empty p {
  font-size: 0.82rem;
  color: var(--gris);
  margin: 0 0 0.85rem;
}
.forum-empty-btn {
  margin-top: 0.25rem;
}

/* === Main panel === */
.forum-main {
  display: flex;
  flex-direction: column;
  min-height: 440px;
  animation: forumShellBreath 8s ease-in-out infinite;
}
@keyframes forumShellBreath {
  0%, 100% { box-shadow: 0 16px 48px rgba(0,0,0,0.42), inset 0 0 40px rgba(0,245,212,0.03); }
  50% { box-shadow: 0 20px 56px rgba(0,0,0,0.48), inset 0 0 52px rgba(180,123,255,0.05); }
}
.forum-main-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(115deg, transparent 32%, rgba(0,245,212,0.05) 46%, rgba(255,255,255,0.04) 50%, transparent 64%);
  transform: translateX(-120%);
  animation: forumSheen 9s ease-in-out infinite;
}
@keyframes forumSheen {
  0%, 70% { transform: translateX(-120%); }
  88% { transform: translateX(120%); }
  100% { transform: translateX(120%); }
}
.forum-main > *:not(.forum-corner):not(.forum-main-sheen) { position: relative; z-index: 1; }

.forum-main-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.forum-thread-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(0, 245, 212, 0.1);
  border: 1px solid rgba(0, 245, 212, 0.25);
  color: var(--turquoise);
}
.forum-main-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--blanc);
}
.forum-main-sub { font-size: 0.82rem; color: var(--gris); margin-top: 4px; }
.forum-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Welcome */
.forum-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.25rem;
  gap: 0.85rem;
}
.forum-welcome-scene {
  position: relative;
  width: 200px;
  height: 180px;
  margin-bottom: 0.5rem;
}

/* Hub discussion : bulles + ondes de transmission */
.forum-chat-hub {
  position: relative;
  width: 100%;
  height: 100%;
}
.forum-chat-pulse {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 88px;
  height: 88px;
  margin: -44px 0 0 -44px;
  border-radius: 50%;
  border: 1px solid rgba(0, 245, 212, 0.28);
  pointer-events: none;
  animation: forumChatPulse 3.2s ease-out infinite;
}
.forum-chat-pulse--2 { animation-delay: 1.05s; }
.forum-chat-pulse--3 { animation-delay: 2.1s; }
@keyframes forumChatPulse {
  0% { transform: scale(0.75); opacity: 0.7; }
  70% { opacity: 0.15; }
  100% { transform: scale(1.85); opacity: 0; }
}

.forum-chat-main {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  width: 96px;
  height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 22px 22px 22px 8px;
  background: linear-gradient(145deg, rgba(0, 245, 212, 0.18), rgba(180, 123, 255, 0.12));
  border: 1px solid rgba(0, 245, 212, 0.35);
  box-shadow: 0 8px 28px rgba(0, 245, 212, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: forumChatBob 3.5s ease-in-out infinite;
}
@keyframes forumChatBob {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, calc(-50% - 7px)); }
}
.forum-chat-icon,
.forum-chat-main .forum-ic-img {
  filter: drop-shadow(0 0 14px rgba(0, 245, 212, 0.5));
}
.forum-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 10px;
}
.forum-typing i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0, 245, 212, 0.85);
  animation: forumTypingDot 1.2s ease-in-out infinite;
}
.forum-typing i:nth-child(2) { animation-delay: 0.15s; }
.forum-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes forumTypingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.forum-chat-float {
  position: absolute;
  width: 38px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px 14px 14px 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--turquoise);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.forum-chat-float span { line-height: 1; }
.forum-chat-float--a {
  left: 4%;
  top: 18%;
  color: var(--jaune);
  border-color: rgba(254, 228, 64, 0.28);
  animation: forumFloatDrift 4.2s ease-in-out infinite;
}
.forum-chat-float--b {
  right: 2%;
  top: 28%;
  animation: forumFloatDrift 5s ease-in-out infinite reverse;
  animation-delay: 0.6s;
}
.forum-chat-float--c {
  left: 18%;
  bottom: 6%;
  color: #c4a0ff;
  border-color: rgba(180, 123, 255, 0.3);
  animation: forumFloatDrift 4.6s ease-in-out infinite;
  animation-delay: 1.2s;
}
@keyframes forumFloatDrift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(5px, -6px) rotate(2deg); }
  66% { transform: translate(-4px, 4px) rotate(-2deg); }
}
.forum-welcome-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  color: var(--blanc);
  letter-spacing: 0.05em;
  margin: 0;
}
.forum-welcome-text {
  max-width: 420px;
  font-size: 0.88rem;
  color: var(--gris);
  line-height: 1.55;
  margin: 0;
}
.forum-feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0.35rem 0 0.5rem;
}
.forum-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid rgba(180, 123, 255, 0.28);
  background: rgba(180, 123, 255, 0.08);
  color: #d4b8ff;
}
.forum-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 0.5rem;
}
.forum-quick-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--turquoise);
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.forum-quick-link:hover { opacity: 1; text-decoration: underline; }
@keyframes forumFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

.forum-cta-glow {
  animation: forumBtnGlow 2.8s ease-in-out infinite;
}
@keyframes forumBtnGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 245, 212, 0.2), 0 4px 20px rgba(0, 245, 212, 0.15); }
  50% { box-shadow: 0 0 0 6px rgba(0, 245, 212, 0.08), 0 6px 28px rgba(0, 245, 212, 0.25); }
}

/* Posts */
.forum-thread-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.forum-posts {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0.25rem 0.15rem 1rem;
  max-height: 48vh;
}
.forum-post {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: forumFadeUp 0.4s ease backwards;
}
.forum-post--me:not(:has(.forum-vote)) { flex-direction: row-reverse; }
.forum-post-avatar-wrap { position: relative; flex: 0 0 auto; }
.forum-post-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 245, 212, 0.08);
  border: 1px solid rgba(0, 245, 212, 0.2);
  cursor: pointer;
  transition: box-shadow 0.2s;
  background-repeat: no-repeat;
  background-position: center bottom;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  flex-shrink: 0;
}
.forum-post-avatar--empty {
  background-image: none !important;
}
.forum-post-avatar:hover { box-shadow: 0 0 14px rgba(0, 245, 212, 0.3); }
.forum-post-avatar img, .forum-post-avatar canvas { width: 100%; height: 100%; object-fit: contain; }
.forum-post-bubble {
  max-width: min(78%, 520px);
  padding: 0.75rem 0.95rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.forum-post--me .forum-post-bubble {
  background: rgba(0, 245, 212, 0.1);
  border-color: rgba(0, 245, 212, 0.3);
  box-shadow: 0 4px 20px rgba(0, 245, 212, 0.08);
}
.forum-post-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.78rem;
}
.forum-post-author {
  background: none;
  border: none;
  padding: 0;
  color: var(--turquoise);
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: inherit;
}
.forum-post-author:hover { text-decoration: underline; }
.forum-post-time { color: var(--gris); font-size: 0.72rem; }
.forum-post-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.forum-mention {
  color: var(--jaune);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
}
.forum-mention:hover { text-decoration: underline; }

/* Compose */
.forum-compose {
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}
.forum-compose-glow {
  position: absolute;
  inset: 8px 0 0;
  border-radius: 16px;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(0,245,212,0.08), transparent);
  pointer-events: none;
  opacity: 0.6;
}
.forum-compose-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  position: relative;
  z-index: 1;
}
.forum-compose textarea {
  flex: 1;
  min-height: 72px;
  max-height: 160px;
  resize: vertical;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.38);
  color: var(--blanc);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.forum-compose textarea:focus {
  outline: none;
  border-color: rgba(0, 245, 212, 0.42);
  box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.1);
}
.forum-send-btn span { position: relative; z-index: 1; }
.forum-compose-hint { font-size: 0.72rem; color: var(--gris); margin-top: 6px; position: relative; z-index: 1; }

.forum-mention-pop {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  background: rgba(12, 14, 18, 0.98);
  border: 1px solid rgba(0, 245, 212, 0.25);
  border-radius: 12px;
  max-height: 180px;
  overflow-y: auto;
  z-index: 20;
  display: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.forum-mention-pop.show { display: block; animation: forumFadeUp 0.2s ease; }
.forum-mention-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--blanc);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
}
.forum-mention-opt:hover, .forum-mention-opt.is-focus {
  background: rgba(0, 245, 212, 0.1);
}

/* Create form */
.forum-create {
  display: none;
  flex-direction: column;
  gap: 0.9rem;
  flex: 1;
  padding: 0.5rem 0;
}
.forum-create.show { display: flex; animation: forumFadeUp 0.35s ease; }
.forum-create-title {
  font-family: var(--font-display);
  color: var(--turquoise);
  letter-spacing: 0.05em;
  margin: 0;
}
.forum-field label {
  font-size: 0.78rem;
  color: var(--gris);
  display: block;
  margin-bottom: 4px;
}
.forum-create input, .forum-create select, .forum-create textarea,
.forum-field input, .forum-field select, .forum-field textarea {
  width: 100%;
  padding: 0.68rem 0.88rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.38);
  color: var(--blanc);
  font-family: var(--font-body);
  transition: border-color 0.2s;
}
.forum-create input:focus, .forum-create select:focus, .forum-create textarea:focus,
.forum-field input:focus, .forum-field select:focus, .forum-field textarea:focus {
  outline: none;
  border-color: rgba(0, 245, 212, 0.4);
}
.forum-create-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Guest */
.forum-guest {
  text-align: center;
  padding: 3rem 1.5rem;
  margin-top: 1rem;
}
.forum-guest-visual { margin-bottom: 1rem; }
.forum-chat-locked {
  position: relative;
  width: 110px;
  height: 100px;
  margin: 0 auto;
}
.forum-chat-locked-bubble {
  width: 88px;
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  border-radius: 20px 20px 20px 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  filter: grayscale(0.4) opacity(0.75);
  animation: forumFloat 3.5s ease-in-out infinite;
}
.forum-chat-locked-lock {
  position: absolute;
  right: 4px;
  bottom: 2px;
  width: 28px;
  height: 28px;
  animation: forumLockBounce 2.4s ease-in-out infinite;
}
@keyframes forumLockBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.forum-guest h2 {
  font-family: var(--font-display);
  color: var(--turquoise);
  letter-spacing: 0.05em;
}

/* Status & mobile */
.forum-status {
  min-height: 1.2em;
  font-size: 0.82rem;
  color: var(--gris);
  margin-bottom: 0.5rem;
  text-align: center;
}
.forum-status.is-error { color: #f87171; }
.forum-back-mobile { display: none; }

.forum-online-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--turquoise);
}

/* === Mobile : app conversations plein écran === */
@media (max-width: 900px) {
  .forum-page .page-content {
    padding-left: 0;
    padding-right: 0;
  }
  .section-forum {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
  .container-forum {
    padding-left: max(0.65rem, env(safe-area-inset-left));
    padding-right: max(0.65rem, env(safe-area-inset-right));
    max-width: 100%;
  }

  .forum-hero {
    margin-bottom: 0.65rem;
    padding: 0 0.15rem;
  }
  .forum-kicker { font-size: 0.62rem; margin-bottom: 0.35rem; }
  .forum-title { font-size: clamp(1.45rem, 7.5vw, 1.85rem); line-height: 1.05; }
  .forum-intro {
    font-size: 0.82rem;
    line-height: 1.45;
    margin: 0.45rem auto 0.65rem;
    padding: 0 0.25rem;
  }
  .forum-ticker-wrap { display: none; }
  .forum-hud {
    gap: 6px;
    margin-bottom: 0.5rem;
  }
  .forum-hud-pill {
    font-size: 0.68rem;
    padding: 0.38rem 0.62rem;
  }
  .forum-ic-wrap { width: 18px; height: 18px; }

  .forum-layout {
    margin-top: 0.35rem;
    min-height: 0;
    gap: 0;
  }

  .forum-shell {
    border-radius: 16px;
    padding: 0.8rem 0.85rem;
  }
  .forum-corner { width: 11px; height: 11px; }

  /* Liste conversations — écran principal mobile */
  .forum-sidebar {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 220px);
    max-height: none;
  }
  .forum-sidebar-head {
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
  }
  .forum-sidebar-brand { flex: 1; min-width: 0; }
  .forum-sidebar-brand strong { font-size: 0.95rem; }
  .forum-new-btn {
    flex-shrink: 0;
    padding: 0.45rem 0.7rem;
    font-size: 0.74rem;
  }

  .forum-cats {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 5px;
    margin-bottom: 0.65rem;
    padding-bottom: 2px;
  }
  .forum-cats::-webkit-scrollbar { display: none; }
  .forum-cat {
    flex-shrink: 0;
    font-size: 0.72rem;
    padding: 0.34rem 0.62rem;
  }

  .forum-thread-list {
    flex: 1;
    max-height: none;
    min-height: 180px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Fil / création — plein écran */
  .forum-main.forum-main--full {
    min-height: calc(100dvh - 168px);
    max-height: calc(100dvh - 148px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: none;
  }
  .forum-main.forum-main--full .forum-main-sheen { display: none; }

  .forum-back-mobile {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-bottom: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 245, 212, 0.22);
    background: rgba(0, 245, 212, 0.06);
    font-size: 0.82rem;
    color: var(--turquoise);
  }

  .forum-welcome { display: none !important; }

  .forum-thread-view {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .forum-main-head {
    flex-shrink: 0;
    margin-bottom: 0.65rem;
    padding-bottom: 0.65rem;
  }
  .forum-main-head h2 {
    font-size: 1.2rem;
    line-height: 1.2;
    word-break: break-word;
  }
  .forum-main-sub { font-size: 0.76rem; }
  .forum-head-actions { width: 100%; }
  .forum-head-actions .btn { width: 100%; justify-content: center; }

  .forum-posts {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
  }
  .forum-post-bubble { max-width: 86%; }
  .forum-post-avatar { width: 36px; height: 36px; border-radius: 10px; }

  .forum-compose {
    flex-shrink: 0;
    position: static;
    margin-top: 0;
    padding-top: 0.65rem;
    padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 10, 14, 0.96);
  }
  .forum-compose-glow { display: none; }
  .forum-compose-toolbar {
    margin-bottom: 8px;
  }
  .forum-compose-toolbar .forum-flair-select {
    width: 100%;
    max-width: none;
    margin: 0;
  }
  .forum-compose-row {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
  }
  .forum-compose textarea {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    max-height: 120px;
    font-size: 16px;
    padding: 0.65rem 0.8rem;
  }
  .forum-send-btn {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
    box-shadow: 0 0 12px rgba(0, 245, 212, 0.25);
  }
  .forum-compose-hint { font-size: 0.68rem; }

  /* Messages Reddit — pleine largeur, votes sous la bulle */
  .forum-post:has(.forum-vote) .forum-post-row {
    flex-direction: column;
    gap: 4px;
  }
  .forum-post:has(.forum-vote) .forum-vote {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 2px 0 4px;
    margin: 0;
    background: none;
    border: none;
    order: 2;
    align-self: flex-start;
  }
  .forum-post:has(.forum-vote) .forum-vote-btn {
    font-size: 1rem;
    padding: 6px 10px;
  }
  .forum-post:has(.forum-vote) .forum-vote-score {
    font-size: 0.85rem;
    min-width: 1.2em;
    text-align: center;
  }
  .forum-post:has(.forum-vote) .forum-post-body {
    order: 1;
    width: 100%;
  }
  .forum-post:has(.forum-vote) .forum-post-bubble {
    max-width: none !important;
    width: 100%;
  }
  .forum-post:has(.forum-vote) .forum-post-avatar {
    width: 34px;
    height: 34px;
  }
  .forum-post-children {
    margin: 8px 0 0 8px;
    padding-left: 10px;
  }
  .forum-post:has(.forum-vote).forum-post--comment {
    margin-left: calc(var(--forum-depth, 0) * 10px);
  }
  .forum-post-actions {
    gap: 10px;
    margin-top: 8px;
  }
  .forum-action-btn {
    font-size: 0.78rem;
    padding: 4px 0;
  }
  .forum-sort-bar--comments {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px 10px;
    margin-bottom: 6px;
  }
  .forum-sort-bar--comments::-webkit-scrollbar { display: none; }
  .forum-sort-btn {
    flex-shrink: 0;
    font-size: 0.7rem;
    padding: 5px 11px;
  }
  .forum-head-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }
  .forum-head-actions .btn {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
  }

  /* === Fil ouvert mobile : chat fixe, une seule zone de scroll === */
  html.forum-lock-scroll,
  html.forum-lock-scroll body {
    overflow: hidden;
    height: 100%;
    overscroll-behavior: none;
  }
  .forum-page--thread-open .forum-hero,
  .forum-page--thread-open .forum-status,
  .forum-page--thread-open #forumCanvas,
  .forum-page--thread-open .forum-fx-overlay,
  .forum-page--thread-open .forum-grid-floor,
  .forum-page--thread-open .forum-corner,
  .forum-page--thread-open .forum-main-sheen {
    display: none !important;
  }
  .forum-page--thread-open .page-content {
    padding-top: calc(var(--dmajin-nav-inset) + var(--dmajin-nav-inner-h) + 0.25rem);
    padding-bottom: 0;
    height: 100dvh;
    overflow: hidden;
    box-sizing: border-box;
  }
  .forum-page--thread-open .section-forum,
  .forum-page--thread-open .container-forum,
  .forum-page--thread-open .forum-layout {
    height: 100%;
    margin: 0;
    padding-bottom: 0;
    overflow: hidden;
    min-height: 0;
  }
  .forum-page--thread-open .container-forum {
    padding-left: max(0.35rem, env(safe-area-inset-left));
    padding-right: max(0.35rem, env(safe-area-inset-right));
  }
  .forum-page--thread-open .forum-main.forum-main--full {
    height: 100%;
    min-height: 0;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: none !important;
    transform: none !important;
    padding: 0.4rem 0.5rem 0.35rem;
    border-radius: 10px;
  }
  .forum-page--thread-open .forum-back-mobile {
    position: static;
    flex-shrink: 0;
    margin-bottom: 0.4rem;
    padding: 0.45rem 0.55rem;
    background: rgba(0, 245, 212, 0.06);
    border: 1px solid rgba(0, 245, 212, 0.18);
    border-radius: 10px;
  }
  .forum-page--thread-open .forum-thread-view {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .forum-page--thread-open .forum-main-head {
    flex-shrink: 0;
    margin-bottom: 0.35rem;
    padding-bottom: 0.4rem;
    gap: 0.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  .forum-page--thread-open .forum-main-head h2 {
    font-size: 0.95rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .forum-page--thread-open .forum-main-sub {
    display: none;
  }
  .forum-page--thread-open .forum-thread-cat-badge {
    font-size: 0.58rem;
    padding: 2px 7px;
    margin-bottom: 3px;
  }
  .forum-page--thread-open .forum-head-actions {
    width: auto;
    flex-shrink: 0;
    gap: 6px;
  }
  .forum-page--thread-open .forum-save-btn .forum-save-label {
    display: none;
  }
  .forum-page--thread-open .forum-save-btn {
    flex: 0 0 auto;
    min-width: 40px;
    min-height: 40px;
    padding: 0.35rem 0.5rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
  }
  .forum-page--thread-open .forum-online-live {
    font-size: 0.65rem;
    padding: 0.3rem 0.5rem;
    border-radius: 999px;
    background: rgba(0, 245, 212, 0.08);
    border: 1px solid rgba(0, 245, 212, 0.2);
    max-width: 9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .forum-page--thread-open #forumCommentSort,
  .forum-page--thread-open .forum-sort-select-mobile {
    display: none !important;
  }
  .forum-page--thread-open .forum-posts {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0.25rem 0 0.5rem;
  }
  .forum-page--thread-open .forum-post {
    animation: none !important;
  }
  .forum-page--thread-open .forum-post:has(.forum-vote) .forum-post-body {
    display: contents;
  }
  .forum-page--thread-open .forum-post:has(.forum-vote) .forum-post-row {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 6px 8px;
    align-items: start;
  }
  .forum-page--thread-open .forum-post-avatar-wrap {
    grid-column: 1;
    grid-row: 1 / 3;
  }
  .forum-page--thread-open .forum-post:has(.forum-vote) .forum-post-avatar {
    width: 32px;
    height: 32px;
  }
  .forum-page--thread-open .forum-post:has(.forum-vote) .forum-post-bubble {
    grid-column: 2;
    grid-row: 1;
    padding: 0.6rem 0.75rem;
    border-radius: 12px;
    max-width: none !important;
  }
  .forum-page--thread-open .forum-post:has(.forum-vote) .forum-vote {
    grid-column: 2;
    grid-row: 2;
    flex-direction: row;
    gap: 6px;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
  }
  .forum-page--thread-open .forum-vote-btn {
    min-width: 40px;
    min-height: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  .forum-page--thread-open .forum-post-actions {
    gap: 6px;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
  .forum-page--thread-open .forum-action-btn {
    font-size: 0.74rem;
    padding: 6px 10px;
    min-height: 34px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  .forum-page--thread-open .forum-post-children {
    margin: 4px 0 0 2px;
    padding-left: 6px;
    border-left-width: 1px;
  }
  .forum-page--thread-open .forum-post:has(.forum-vote).forum-post--comment {
    margin-left: calc(min(var(--forum-depth, 0), 2) * 6px);
  }
  .forum-page--thread-open .forum-compose {
    flex-shrink: 0;
    position: static;
    margin-top: 0;
    padding: 0.45rem 0  max(0.4rem, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(0, 245, 212, 0.12);
    background: rgba(8, 10, 14, 0.98);
    box-shadow: none;
  }
  .forum-page--thread-open .forum-compose-toolbar {
    display: none !important;
  }
  .forum-page--thread-open .forum-compose-row {
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
  }
  .forum-page--thread-open .forum-compose textarea {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    max-height: 100px;
    border-radius: 12px;
    font-size: 16px;
  }
  .forum-page--thread-open .forum-send-btn {
    width: auto;
    min-width: 48px;
    min-height: 44px;
    padding: 0.45rem 0.75rem;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: none;
  }
  .forum-page--thread-open .forum-send-btn span {
    display: inline !important;
  }
  .forum-page--thread-open .forum-send-btn::after {
    display: none !important;
  }
  .forum-page--thread-open .forum-compose-hint {
    display: none;
  }
  .forum-page--thread-open .forum-staff-notice {
    flex-shrink: 0;
    font-size: 0.72rem;
    margin-bottom: 0.35rem;
  }

  /* Liste conversations : header compact */
  .forum-page--list-open .forum-intro,
  .forum-page--list-open .forum-kicker {
    display: none;
  }
  .forum-page--list-open .forum-title {
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
  }
  .forum-page--list-open .forum-hud {
    margin-bottom: 0.35rem;
  }

  .forum-sort-select-mobile {
    display: none;
  }

  .forum-create {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .forum-create input,
  .forum-create select,
  .forum-create textarea,
  .forum-field input,
  .forum-field select,
  .forum-field textarea {
    font-size: 16px;
  }
  .forum-create-actions {
    flex-direction: column;
  }
  .forum-create-actions .btn { width: 100%; justify-content: center; }

  .forum-empty { padding: 1.1rem 0.75rem; }
  .forum-guest { padding: 2rem 1rem; }

  .forum-grid-floor { opacity: 0.18; height: 24vh; }
  #forumCanvas { opacity: 0.65; }
}

@media (max-width: 480px) {
  .forum-hero { margin-bottom: 0.5rem; }
  .forum-intro { display: none; }
  .forum-hud-pill span:not(.forum-hud-live):not(.forum-ic-wrap) { font-size: 0.65rem; }
  .forum-sidebar { min-height: calc(100dvh - 195px); }
  .forum-main.forum-main--full {
    min-height: calc(100dvh - 150px);
    max-height: calc(100dvh - 130px);
  }
  .forum-shell { padding: 0.7rem 0.75rem; border-radius: 14px; }
  .forum-feature-pills,
  .forum-quick-links { display: none; }
  .forum-main-head h2 { font-size: 1.05rem; }
  .forum-main-sub { font-size: 0.72rem; }
  .forum-send-btn span { display: none; }
  .forum-send-btn::after {
    content: '➤';
    font-size: 1.05rem;
    line-height: 1;
  }
  .forum-send-btn {
    min-width: 44px;
    padding: 0.5rem 0.65rem;
  }
}

/* Toast */
.forum-toast {
  position: fixed;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 200;
  padding: 0.7rem 1.2rem;
  border-radius: 14px;
  background: rgba(12, 16, 22, 0.96);
  border: 1px solid rgba(0, 245, 212, 0.35);
  color: var(--blanc);
  font-size: 0.85rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
  pointer-events: none;
}
.forum-toast.show { transform: translateX(-50%) translateY(0); }

/* === Desktop : deux colonnes confortables === */
@media (min-width: 901px) {
  .forum-layout {
    align-items: stretch;
  }
  .forum-sidebar {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 220px);
    position: sticky;
    top: 88px;
  }
  .forum-thread-list {
    flex: 1;
    min-height: 0;
    max-height: none;
  }
  .forum-main {
    min-height: calc(100vh - 220px);
    max-height: calc(100vh - 180px);
  }
  .forum-thread-view {
    flex: 1;
    min-height: 0;
  }
  .forum-posts {
    flex: 1;
    min-height: 0;
    max-height: none;
  }
  .forum-back-mobile { display: none !important; }
  .forum-welcome { display: flex; }
}

/* Tilt desktop */
@media (min-width: 900px) and (hover: hover) {
  .forum-main {
    transform: perspective(1200px) rotateX(var(--forum-rx, 0deg)) rotateY(var(--forum-ry, 0deg));
    transition: transform 0.28s ease;
    transform-style: preserve-3d;
  }
}

@media (prefers-reduced-motion: reduce) {
  .forum-page *, .forum-page *::before, .forum-page *::after {
    animation: none !important;
    transition: none !important;
  }
  .forum-main { transform: none !important; }
}

/* --- Reddit layer --- */
.forum-sort-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid rgba(0, 245, 212, 0.12);
}
.forum-sort-bar--comments {
  padding: 10px 12px;
  margin-bottom: 4px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
}
.forum-sort-label { font-size: 0.75rem; color: rgba(255,255,255,0.55); align-self: center; margin-right: 4px; }
.forum-sort-btn {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.75);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  cursor: pointer;
}
.forum-sort-btn.is-active {
  border-color: rgba(0, 245, 212, 0.45);
  background: rgba(0, 245, 212, 0.12);
  color: #9fffea;
}
.forum-thread-item {
  display: flex !important;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
}
.forum-thread-score {
  min-width: 2rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  padding-top: 2px;
}
.forum-thread-score.is-pos { color: #ff8b6a; }
.forum-thread-score.is-neg { color: #8b9cff; }
.forum-thread-item-main { flex: 1; min-width: 0; }
.forum-vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 32px;
  padding: 6px 4px 4px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.forum-vote-btn {
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.55);
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
}
.forum-vote-btn:hover { color: #ff8b6a; }
.forum-vote-down:hover { color: #8b9cff; }
.forum-vote-btn.is-active.forum-vote-up { color: #ff8b6a; }
.forum-vote-btn.is-active.forum-vote-down { color: #8b9cff; }
.forum-vote-score { font-size: 0.78rem; font-weight: 700; color: rgba(255,255,255,0.7); }
.forum-vote-score.is-pos { color: #ff8b6a; }
.forum-vote-score.is-neg { color: #8b9cff; }
/* Fil Reddit : colonne verticale, votes à gauche, réponses en dessous */
.forum-post:has(.forum-vote) {
  display: block;
  width: 100%;
}
.forum-post-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
}
.forum-post:has(.forum-vote) .forum-post-body {
  display: flex;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.forum-post:has(.forum-vote).forum-post--comment {
  margin-left: calc(var(--forum-depth, 0) * 16px);
}
.forum-post:has(.forum-vote) .forum-post-bubble {
  max-width: none;
  flex: 1;
}
.forum-post-children {
  margin: 10px 0 0 42px;
  padding-left: 12px;
  border-left: 2px solid rgba(0, 245, 212, 0.18);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.forum-op-badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #0a0e12;
  background: linear-gradient(135deg, #00f5d4, #7afcff);
  border-radius: 4px;
  padding: 1px 5px;
}
.forum-flair {
  font-size: 0.62rem;
  font-weight: 600;
  border-radius: 4px;
  padding: 1px 6px;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8);
}
.forum-flair--question { border-color: rgba(96,165,250,0.5); color: #93c5fd; }
.forum-flair--spoiler { border-color: rgba(248,113,113,0.5); color: #fca5a5; }
.forum-flair--artefact { border-color: rgba(251,191,36,0.5); color: #fcd34d; }
.forum-post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.forum-action-btn, .forum-collapse-btn {
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0;
}
.forum-action-btn:hover, .forum-collapse-btn:hover { color: #00f5d4; }
.forum-action-btn--reply { color: #9fffea !important; font-weight: 600; }
.forum-action-btn--report { color: rgba(255,255,255,0.45) !important; }
.forum-action-btn--report:hover { color: #fca5a5 !important; }
.forum-child-count { font-size: 0.68rem; color: rgba(255,255,255,0.4); }
.forum-save-btn.is-saved { color: #fcd34d; }
.forum-save-btn .forum-save-icon { line-height: 1; }
.forum-save-label { margin-left: 4px; }
.forum-flair-select {
  border: 1px solid rgba(0,245,212,0.25);
  background: rgba(0,0,0,0.35);
  color: #fff;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.75rem;
  max-width: 200px;
}
.forum-compose-toolbar {
  position: relative;
  z-index: 1;
  margin-bottom: 6px;
}
.forum-compose-toolbar .forum-flair-select {
  width: 100%;
  max-width: none;
}
.forum-compose-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.forum-reply-banner {
  font-size: 0.78rem;
  color: #9fffea;
  margin: 0 0 8px;
  padding: 6px 10px;
  background: rgba(0,245,212,0.08);
  border-radius: 8px;
}
.forum-reply-banner.hidden { display: none; }
.forum-reply-cancel {
  border: none;
  background: transparent;
  color: #fff;
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
}
.forum-badge--saved { color: #fcd34d; }
.forum-report-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.forum-report-modal.hidden { display: none; }
.forum-report-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
}
.forum-report-panel {
  position: relative;
  width: min(420px, 92vw);
  background: #12161d;
  border: 1px solid rgba(0,245,212,0.25);
  border-radius: 14px;
  padding: 1rem;
  z-index: 1;
}
.forum-report-panel h3 { margin: 0 0 10px; }
.forum-report-panel textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.35);
  color: #fff;
  padding: 8px;
  resize: vertical;
}
.forum-report-actions { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }
