/* =========================
   RULES — FULL CSS (REPLACE ALL)
   ========================= */

:root{
  --bg: #0a0a1a;
  --panel: rgba(255,255,255,.03);
  --panel2: rgba(0,0,0,.18);
  --border: rgba(0,255,255,.18);
  --border2: rgba(0,255,255,.12);
  --glow: rgba(0,255,255,.12);
  --accent: #0ff;
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.72);
}

/* Page wrapper */
.rules-page{
  padding-top: 120px;
  max-width: 1300px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.rules-top{
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

.rules-title{
  margin: 30px;
  font-size: 2.2rem;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent), 0 0 24px rgba(0,255,255,.35);
}

/* Search */
.rules-search{
  position: relative;
  max-width: 760px;
}

#rulesSearchInput{
  width: 100%;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0,255,255,.25);
  background: rgba(255,255,255,.03);
  color: #fff;
  outline: none;
  box-shadow: 0 0 14px rgba(0,255,255,.10);
}

#rulesSearchInput:focus{
  border-color: rgba(0,255,255,.45);
  box-shadow: 0 0 18px rgba(0,255,255,.18);
}

.search-dropdown{
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  border-radius: 14px;
  background: rgba(10,10,26,.92);
  border: 1px solid rgba(0,255,255,.22);
  box-shadow: 0 0 18px rgba(0,255,255,.12);
  overflow: hidden;
  z-index: 50;
}
.search-dropdown.hidden{ display: none; }

.search-group-title{
  padding: 10px 12px;
  font-weight: 900;
  color: rgba(255,255,255,.85);
  border-bottom: 1px solid rgba(0,255,255,.12);
}

.search-item{
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.search-item:hover{ background: rgba(0,255,255,.06); }

.search-item .k{ font-weight: 900; color: var(--accent); }
.search-item .v{ color: rgba(255,255,255,.85); font-size: .95rem; }

/* Layout */
.rules-layout{
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  align-items: start;
}

.rules-content{ min-width: 0; }

.rules-list{
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Section */
.rule-section{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 0 14px rgba(0,255,255,.10);
  position: relative;
  overflow: hidden;
}

.rule-section::after{
  content: "";
  position: absolute;
  inset: -40px;
  background: radial-gradient(circle at 22% 18%, rgba(0,255,255,.09), transparent 58%);
  pointer-events: none;
}

.section-head{
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,255,255,.10);
}

.section-head h2{
  margin: 0;
  font-size: 1.45rem;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(0,255,255,.55);
}

.section-tag{
  font-size: .95rem;
  color: rgba(255,255,255,.72);
}

/* =========================
   SUBRULES — compact inline
   ========================= */

/* proche (moins d'écart) */
.subrules{
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* plus de grosses cartes séparées :
   on garde une ligne avec un fond léger */
.subrule{
  display: grid;
  grid-template-columns: 54px 1fr 26px; /* code | texte | icône */
  gap: 10px;
  align-items: start;

  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,.14);
  border: 1px solid rgba(0,255,255,.08); /* très léger */
}

/* hover très discret */
.subrule:hover{
  border-color: rgba(0,255,255,.16);
  background: rgba(0,255,255,.04);
}

/* Num (1a...) */
.subrule-code{
  font-weight: 900;
  color: var(--accent);
  font-size: 1.05rem;
  text-align: left;
  line-height: 1.35;
}

/* Texte */
.subrule-text{
  color: var(--text);
  font-size: .98rem;
  line-height: 1.45;
  white-space: pre-line; /* conserve retours ligne */
}

/* zone actions */
.subrule-actions{
  display: flex;
  justify-content: flex-end;
  align-items: start;
}

/* Copier = une petite icône, presque invisible */
.copy-btn{
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;

  opacity: .22;
  transition: opacity .15s ease, transform .15s ease;
}

/* on la voit au hover de la ligne */
.subrule:hover .copy-btn{
  opacity: .95;
}

.copy-btn:hover{
  transform: scale(1.06);
}

/* icône (si tu utilises <svg class="copy-ico">) */
.copy-ico{
  width: 18px;
  height: 18px;
  fill: var(--accent);
  display: block;
  margin: 4px auto 0;
}

/* Si tu n'as PAS d’icône svg et que ton bouton contient du texte "Copier" :
   on le masque en mode icône */
.copy-btn{
  font-size: 0;
}

/* =========================
   Sidebar
   ========================= */

.rules-sidebar{
  position: fixed;
  top: 180px;
  left: 75%;
  width: 280px;
}

.sidebar-card{
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(0,255,255,.18);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 0 14px rgba(0,255,255,.08);
  margin-bottom: 14px;
}

.sidebar-title{
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 10px;
  text-shadow: 0 0 10px rgba(0,255,255,.45);
}

.sidebar-nav{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-btn{
  text-align: left;
  border: 1px solid rgba(0,255,255,.16);
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.92);
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
}
.nav-btn:hover{ background: rgba(0,255,255,.06); }
.nav-btn.active{
  border-color: rgba(0,255,255,.45);
  color: var(--accent);
  box-shadow: 0 0 14px rgba(0,255,255,.10);
}

.sidebar-note{
  margin-top: 12px;
  font-size: .92rem;
  color: rgba(255,255,255,.75);
  line-height: 1.4;
}

/* Action button */
.btn-asile{
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0,255,255,.22);
  cursor: pointer;
  font-weight: 800;
}
.btn-secondary{
  background: rgba(255,255,255,.06);
  color: #fff;
}

/* Toast */
.toast{
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(0,0,0,.75);
  border: 1px solid rgba(0,255,255,.22);
  color: rgba(255,255,255,.95);
  box-shadow: 0 0 18px rgba(0,255,255,.14);
  z-index: 9999;
}
.toast.hidden{ display: none; }

/* Responsive */
@media (max-width: 980px){
  .rules-layout{ grid-template-columns: 1fr; }
  .rules-sidebar{ position: static; }
}

/* Highlight subrule (2a, 2b...) */
.subrule.rule-highlight {
  border: 2px solid #00e5ff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.55);
  border-radius: 10px;
}