/* ==========================================================================
   Vortex — Règlement RP
   Feuille de style unique (aucune dépendance : pas de Tailwind, pas de build).

   Sommaire
     1. Police Inter
     2. Reset
     3. Variables de couleur
     4. Base (body, scrollbar, utilitaires)
     5. Composants du règlement (.rs-*)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Police Inter

   Par défaut la police est chargée depuis Google Fonts (voir config.php,
   option 'google_fonts'). Pour l'auto-héberger (recommandé RGPD) :
     - mettez 'google_fonts' => false dans config.php
     - téléchargez inter-latin-wght-normal.woff2 (paquet npm
       @fontsource-variable/inter) dans assets/fonts/
     - décommentez le bloc ci-dessous
   -------------------------------------------------------------------------- */
/*
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
*/

/* --------------------------------------------------------------------------
   2. Reset (équivalent du « preflight » de Tailwind utilisé à l'origine)
   -------------------------------------------------------------------------- */
*,
::after,
::before,
::backdrop,
::file-selector-button {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

a {
  color: inherit;
  text-decoration: inherit;
}

b,
strong {
  font-weight: bolder;
}

code,
kbd,
samp,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1em;
}

small {
  font-size: 80%;
}

ol,
ul,
menu {
  list-style: none;
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  vertical-align: middle;
}

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

button,
input,
select,
optgroup,
textarea,
::file-selector-button {
  font: inherit;
  font-feature-settings: inherit;
  font-variation-settings: inherit;
  letter-spacing: inherit;
  color: inherit;
  border-radius: 0;
  background-color: transparent;
  opacity: 1;
}

::-webkit-search-decoration {
  -webkit-appearance: none;
}

[hidden]:where(:not([hidden="until-found"])) {
  display: none !important;
}

/* --------------------------------------------------------------------------
   3. Variables de couleur
   -------------------------------------------------------------------------- */
:root {
  --background: 216 20% 7%;
  --foreground: 38 24% 93%;
  --muted-foreground: 216 10% 61%;

  /* courbe d'animation du menu mobile */
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   4. Base
   -------------------------------------------------------------------------- */
html {
  background: hsl(var(--background));
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: "Inter Variable", "Inter", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: hsl(var(--muted-foreground) / 0.22);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--muted-foreground) / 0.34);
}

/* Texte réservé aux lecteurs d'écran */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border-width: 0;
}

/* --------------------------------------------------------------------------
   5. Composants du règlement
   -------------------------------------------------------------------------- */
.rs-app-shell {
  --rs-ink: hsl(216 22% 5.5%);
  --rs-panel: hsl(216 18% 10%);
  --rs-panel-raised: hsl(216 16% 13%);
  --rs-line: hsl(216 14% 20%);
  --rs-line-strong: hsl(216 14% 28%);
  --rs-amber: hsl(144.79 71.6% 66.86%);
  --rs-red: var(--rs-amber);
  --rs-text: hsl(38 24% 93%);
  --rs-muted: hsl(216 10% 61%);
  min-height: 100%;
  background: hsl(var(--background));
  color: var(--rs-text);
}

.rs-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--rs-line);
  background: color-mix(in srgb, var(--rs-ink) 92%, transparent);
  backdrop-filter: blur(18px);
}

.rs-topbar-inner {
  display: flex;
  min-height: 4.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 1.5rem;
}

.rs-brand,
.rs-category-button,
.rs-article-link,
.rs-menu-button,
.rs-clear-button,
.rs-next-button,
.rs-result-card,
.rs-text-button {
  font: inherit;
}

.rs-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  border: 0;
  background: transparent;
  color: var(--rs-text);
  cursor: pointer;
  text-align: left;
}

.rs-brand-mark {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  place-items: center;
  border: 1px solid var(--rs-amber);
  color: var(--rs-amber);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.rs-brand-copy {
  display: grid;
  gap: 0.15rem;
}

.rs-brand-copy strong {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
}

.rs-brand-copy small,
.rs-topbar-status,
.rs-discord-link,
.rs-menu-button {
  color: var(--rs-muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.rs-brand-copy small {
  font-size: 0.5rem;
  letter-spacing: 0.2em;
}

.rs-topbar-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}

.rs-live-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--rs-amber);
  box-shadow: 0 0 0 4px hsl(144.79 71.6% 66.86% / 0.1), 0 0 12px hsl(144.79 71.6% 66.86% / 0.55);
}

.rs-topbar-divider {
  width: 1px;
  height: 0.8rem;
  background: var(--rs-line-strong);
}

.rs-topbar-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.rs-discord-link {
  color: var(--rs-amber);
  text-decoration: none;
  transition: color 160ms ease;
}

.rs-discord-link:hover,
.rs-discord-link:focus-visible {
  color: var(--rs-text);
}

.rs-menu-button {
  display: none;
  border: 1px solid var(--rs-line-strong);
  padding: 0.55rem 0.7rem;
  background: transparent;
  color: var(--rs-text);
  cursor: pointer;
}

.rs-layout {
  display: grid;
  min-height: calc(100vh - 4.25rem);
  grid-template-columns: 18rem minmax(0, 1fr);
}

.rs-sidebar {
  position: sticky;
  top: 4.25rem;
  height: calc(100vh - 4.25rem);
  border-right: 1px solid var(--rs-line);
  background: var(--rs-ink);
}

.rs-sidebar-scroll {
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.55rem 0.8rem 1rem;
}

.rs-sidebar-heading,
.rs-article-topline,
.rs-rule-panel-head,
.rs-section-label,
.rs-result-card-top,
.rs-note-mark,
.rs-sidebar-footer,
.rs-panel-status {
  font-size: 0.6rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.rs-sidebar-heading {
  display: flex;
  justify-content: space-between;
  padding: 0 0.7rem 1rem;
  color: var(--rs-muted);
}

.rs-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 0.35rem 1.2rem;
  border: 1px solid var(--rs-line);
  background: hsl(216 18% 8%);
}

.rs-search-wrap:focus-within {
  border-color: var(--rs-amber);
  box-shadow: 0 0 0 3px hsl(144.79 71.6% 66.86% / 0.1);
}

.rs-search-prefix,
.rs-search-shortcut {
  color: var(--rs-muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.rs-search-prefix {
  padding-left: 0.7rem;
  color: var(--rs-amber);
}

.rs-search-shortcut {
  padding-right: 0.65rem;
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.rs-search {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0.72rem 0.55rem;
  background: transparent;
  color: var(--rs-text);
  font-size: 0.75rem;
}

.rs-search::placeholder {
  color: hsl(216 10% 47%);
}

.rs-search::-webkit-search-cancel-button {
  filter: invert(1);
}

.rs-category-list {
  display: grid;
  gap: 0.18rem;
}

.rs-category-block {
  min-width: 0;
}

.rs-category-button,
.rs-article-link {
  display: flex;
  width: 100%;
  align-items: center;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.rs-category-button {
  gap: 0.6rem;
  padding: 0.72rem 0.7rem;
  background: transparent;
  color: var(--rs-muted);
  transition: background-color 160ms ease, color 160ms ease;
}

.rs-category-button:hover,
.rs-category-button:focus-visible,
.rs-category-button-active {
  background: hsl(216 16% 12%);
  color: var(--rs-text);
}

.rs-category-number {
  color: var(--rs-amber);
  font-size: 0.62rem;
  font-weight: 800;
}

.rs-category-label {
  min-width: 0;
  overflow: hidden;
  flex: 1;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rs-category-count {
  color: hsl(216 10% 43%);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

.rs-article-list {
  display: grid;
  gap: 0.08rem;
  padding: 0.15rem 0 0.65rem 1.6rem;
}

.rs-article-link {
  position: relative;
  gap: 0.55rem;
  padding: 0.48rem 0.55rem;
  color: hsl(216 10% 56%);
  font-size: 0.68rem;
  line-height: 1.3;
  transition: color 160ms ease, background-color 160ms ease;
}

.rs-article-link:hover,
.rs-article-link:focus-visible {
  background: hsl(216 16% 10%);
  color: var(--rs-text);
}

.rs-article-link-active {
  color: var(--rs-amber);
}

.rs-article-number {
  width: 1.05rem;
  flex: 0 0 auto;
  color: var(--rs-amber);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.rs-article-marker {
  width: 0.3rem;
  height: 0.3rem;
  flex: 0 0 auto;
  border: 1px solid currentColor;
}

.rs-article-link-active .rs-article-marker {
  background: var(--rs-amber);
  border-color: var(--rs-amber);
}

.rs-sidebar-footer {
  display: grid;
  gap: 0.45rem;
  margin: auto 0.7rem 0;
  padding-top: 1.25rem;
  color: hsl(216 10% 43%);
  font-size: 0.52rem;
  line-height: 1.3;
}

.rs-sidebar-footer-line {
  width: 2rem;
  height: 2px;
  background: var(--rs-red);
}

.rs-main {
  min-width: 0;
  background: hsl(var(--background));
}

.rs-main-inner {
  width: min(100%, 75rem);
  margin: 0 auto;
  padding: 2.3rem clamp(1.25rem, 4vw, 4rem) 4rem;
}

.rs-article,
.rs-search-results {
  margin-top: 2.8rem;
}

.rs-article-topline,
.rs-rule-panel-head,
.rs-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.rs-article-topline {
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rs-line);
  color: var(--rs-muted);
}

.rs-article-topline span:first-child {
  color: var(--rs-amber);
}

.rs-article-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.1rem 0 1.75rem;
}

.rs-section-label {
  display: block;
  color: var(--rs-red);
}

.rs-article-heading h2,
.rs-section-heading h2 {
  margin: 0.55rem 0 0;
  color: var(--rs-text);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 740;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.rs-article-heading p {
  max-width: 40rem;
  margin: 0.85rem 0 0;
  color: var(--rs-muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.rs-rule-panel {
  border: 1px solid var(--rs-line);
  background: var(--rs-panel);
}

.rs-rule-panel-head {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--rs-line);
  color: var(--rs-muted);
}

.rs-panel-status {
  color: var(--rs-red);
}

.rs-rule-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rs-rule-list li {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: 1.1rem;
  padding: 1.2rem 1.2rem 1.25rem;
  border-bottom: 1px solid hsl(216 14% 20% / 0.72);
  color: hsl(38 24% 86%);
  font-size: 0.9rem;
  line-height: 1.65;
}

.rs-rule-list li:last-child {
  border-bottom: 0;
}

.rs-rule-index {
  color: var(--rs-amber);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.65;
}

.rs-rule-list code {
  border: 1px solid hsl(144.79 71.6% 66.86% / 0.35);
  padding: 0.15rem 0.35rem;
  background: hsl(144.79 71.6% 66.86% / 0.08);
  color: var(--rs-amber);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
}

.rs-article-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.9rem;
  margin: 0 1.2rem 1.2rem;
  border-left: 2px solid var(--rs-red);
  padding: 0.85rem 1rem;
  background: hsl(144.79 71.6% 66.86% / 0.08);
}

.rs-note-mark {
  color: var(--rs-red);
}

.rs-article-note p {
  margin: 0;
  color: var(--rs-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.rs-article-nav {
  display: flex;
  justify-content: flex-end;
  padding-top: 1rem;
}

.rs-next-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.15rem;
  min-width: min(100%, 24rem);
  border: 1px solid var(--rs-line);
  padding: 0.85rem 1rem;
  background: transparent;
  color: var(--rs-text);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.rs-next-button:hover,
.rs-next-button:focus-visible {
  border-color: var(--rs-amber);
  background: hsl(144.79 71.6% 66.86% / 0.05);
}

.rs-next-button span:first-child {
  color: var(--rs-amber);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.rs-next-button strong {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rs-next-button span:last-child {
  color: var(--rs-amber);
  font-size: 1.1rem;
}

.rs-section-heading {
  align-items: flex-end;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rs-line);
}

.rs-section-heading h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.rs-clear-button,
.rs-text-button {
  border: 0;
  background: transparent;
  color: var(--rs-amber);
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rs-clear-button:hover,
.rs-clear-button:focus-visible,
.rs-text-button:hover,
.rs-text-button:focus-visible {
  color: var(--rs-text);
}

.rs-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  padding-top: 1rem;
}

.rs-result-card {
  display: grid;
  gap: 0.75rem;
  min-height: 9.5rem;
  border: 1px solid var(--rs-line);
  padding: 1.1rem 1.2rem;
  background: var(--rs-panel);
  color: var(--rs-text);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.rs-result-card:hover,
.rs-result-card:focus-visible {
  border-color: var(--rs-amber);
  background: var(--rs-panel-raised);
  transform: translateY(-2px);
}

.rs-result-card-top {
  display: flex;
  justify-content: space-between;
  color: var(--rs-red);
}

.rs-result-card strong {
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.rs-result-card > span:last-child {
  color: var(--rs-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.rs-empty-state {
  display: grid;
  gap: 0.8rem;
  justify-items: start;
  margin-top: 1rem;
  border: 1px dashed var(--rs-line-strong);
  padding: 2rem 1.2rem;
}

.rs-empty-code {
  color: var(--rs-red);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.rs-empty-state strong {
  font-size: 0.95rem;
}

.rs-nav-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .rs-topbar-status {
    display: none;
  }

  .rs-menu-button {
    display: block;
  }

  .rs-layout {
    display: block;
  }

  .rs-sidebar {
    position: fixed;
    top: 4.25rem;
    bottom: 0;
    left: 0;
    z-index: 25;
    width: min(20rem, calc(100vw - 2.5rem));
    height: auto;
    transform: translateX(-102%);
    transition: transform 220ms var(--ease-drawer);
  }

  .rs-sidebar-open {
    transform: translateX(0);
  }

  .rs-nav-backdrop {
    position: fixed;
    inset: 4.25rem 0 0;
    z-index: 20;
    display: block;
    border: 0;
    background: hsl(216 30% 3% / 0.74);
    cursor: pointer;
  }

  .rs-main-inner {
    padding-top: 1.5rem;
  }
}

@media (max-width: 640px) {
  .rs-topbar-inner {
    min-height: 3.8rem;
    padding: 0 1rem;
  }

  .rs-brand-mark {
    width: 2rem;
    height: 2rem;
  }

  .rs-brand-copy strong {
    font-size: 0.65rem;
  }

  .rs-brand-copy small,
  .rs-discord-link {
    display: none;
  }

  .rs-menu-button {
    font-size: 0.56rem;
  }

  .rs-sidebar {
    top: 3.8rem;
  }

  .rs-nav-backdrop {
    top: 3.8rem;
  }

  .rs-main-inner {
    padding: 1rem 0.9rem 2.5rem;
  }

  .rs-article,
  .rs-search-results {
    margin-top: 2rem;
  }

  .rs-article-heading {
    display: grid;
    gap: 1.25rem;
    padding: 1.6rem 0 1.35rem;
  }

  .rs-article-heading h2,
  .rs-section-heading h2 {
    font-size: 2rem;
  }

  .rs-article-heading p {
    font-size: 0.84rem;
  }

  .rs-rule-panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .rs-rule-list li {
    grid-template-columns: 2rem minmax(0, 1fr);
    gap: 0.6rem;
    padding: 1rem;
    font-size: 0.83rem;
    line-height: 1.6;
  }

  .rs-article-note {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    margin: 0 1rem 1rem;
  }

  .rs-next-button {
    grid-template-columns: 1fr auto;
    gap: 0.35rem 0.8rem;
  }

  .rs-next-button span:first-child {
    grid-column: 1 / -1;
  }

  .rs-results-grid {
    grid-template-columns: 1fr;
  }

  .rs-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.9rem;
  }
}
