/* Règlements BagzNetwork (GMod RP et Rust) : document officiel, design 2026 */
.rg { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }

.rg-hero { position: relative; margin-top: 32px; padding: clamp(36px, 5vw, 64px) clamp(24px, 4vw, 56px) clamp(30px, 4vw, 44px); border: 1px solid var(--line-2); border-radius: var(--r); background: radial-gradient(900px 380px at 100% 0%, rgba(47,140,255,.14), transparent 60%), radial-gradient(700px 360px at 0% 120%, rgba(255,207,74,.07), transparent 60%), var(--panel); overflow: hidden; isolation: isolate; }
.rg-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 64px 64px; mask-image: radial-gradient(ellipse 70% 80% at 80% 0%, #000 20%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse 70% 80% at 80% 0%, #000 20%, transparent 70%); opacity: .6; }
.rg-hero .script { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.rg-hero .script::before { content: ""; width: 24px; height: 1px; background: var(--yellow); }
.rg-hero h1 { margin-top: 18px; font-family: var(--display); font-size: clamp(58px, 10vw, 132px); line-height: .86; text-transform: uppercase; }
.rg-hero h1 span { color: var(--yellow); }
.rg-sub { display: block; margin-top: 18px; font-size: 13px; color: var(--fg-3); }
.rg-stats { display: flex; flex-wrap: wrap; gap: 0; margin: 26px 0 0; border: 1px solid var(--line); border-radius: var(--r-sm); width: fit-content; max-width: 100%; }
.rg-stats div { min-width: 132px; padding: 12px 20px; }
.rg-stats div + div { border-left: 1px solid var(--line); }
.rg-stats dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.rg-stats dd { margin: 4px 0 0; font-family: var(--display); font-size: 36px; line-height: 1; }
.rg-tools { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.rg-search { flex: 1 1 380px; display: flex; align-items: center; max-width: 660px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: rgba(8,8,11,.7); transition: border-color .2s; }
.rg-search:focus-within { border-color: var(--yellow); }
.rg-search input { flex: 1; min-width: 0; height: 52px; padding: 0 16px 0 46px; border: 0; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ffcf4a' stroke-width='2.2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") no-repeat 16px 50%; color: var(--white); font: inherit; font-size: 16px; outline: none; }
.rg-search input::placeholder { color: var(--fg-3); }
.rg-results { padding-right: 16px; font-size: 12px; color: var(--yellow); white-space: nowrap; }
.rg-print { height: 54px; }
.rg-other { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; font-weight: 700; font-size: 14.5px; color: var(--yellow); }
.rg-other:hover { color: var(--white); }

/* l'essentiel */
.rg-golden { margin-top: 56px; }
.rg-golden header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 22px; }
.rg-golden h2 { font-family: var(--display); font-size: clamp(38px, 5vw, 60px); text-transform: uppercase; }
.rg-golden header p { color: var(--fg-2); }
.rg-golden ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--line); overflow: hidden; }
.rg-golden li { position: relative; padding: 24px 22px 24px; background: var(--panel); transition: background-color .25s; }
.rg-golden li:hover { background: var(--panel-2); }
.rg-g-n { display: block; font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: .1em; color: var(--yellow); }
.rg-golden h3 { margin-top: 14px; font-family: var(--display); font-size: 22px; letter-spacing: .02em; text-transform: uppercase; }
.rg-golden p { margin-top: 8px; color: var(--fg-2); font-size: 14.5px; }
@media (max-width: 1080px) { .rg-golden ol { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .rg-golden ol { grid-template-columns: minmax(0, 1fr); } }

/* sommaire + document */
.rg-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 56px; }
.rg-toc { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow-y: auto; scrollbar-width: none; }
.rg-toc::-webkit-scrollbar { display: none; }
.rg-toc nav { display: grid; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.rg-toc-title { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 12px; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.rg-toc-title em { font-style: normal; color: var(--yellow); letter-spacing: 0; }
.rg-toc-bar { display: block; height: 2px; background: var(--line); }
.rg-toc-bar i { display: block; height: 100%; width: 0; background: var(--yellow); transition: width .2s linear; }
.rg-toc a { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: baseline; gap: 6px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--fg-2); transition: background-color .15s, color .15s; }
.rg-toc a i { font-style: normal; font-family: var(--mono); font-size: 11.5px; color: var(--fg-4); }
.rg-toc a b { font-weight: 500; font-family: var(--mono); font-size: 11.5px; color: var(--fg-3); }
.rg-toc a:hover { background: rgba(255,255,255,.04); color: var(--white); }
.rg-toc a.on { background: rgba(255,207,74,.08); color: var(--white); box-shadow: inset 2px 0 0 var(--yellow); }
.rg-toc a.on i { color: var(--yellow); }
.rg-toc a.dim { opacity: .35; }

.rg-ch { margin-bottom: 56px; scroll-margin-top: 92px; }
.rg-ch-head { position: relative; padding: 0 0 20px; border-bottom: 1px solid var(--line-2); }
.rg-ch-n { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--yellow); }
.rg-ch-head h2 { margin-top: 10px; font-family: var(--display); font-size: clamp(36px, 4.4vw, 56px); line-height: .95; text-transform: uppercase; }
.rg-ch-head p { margin-top: 10px; color: var(--fg-2); font-size: 16px; max-width: 680px; }
.rg-ch-count { position: absolute; top: 2px; right: 0; font-size: 11.5px; color: var(--fg-3); }
.rg-ch-body { margin-top: 8px; }
.rg-group h3 { display: flex; align-items: center; gap: 14px; padding: 26px 0 6px; font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.rg-group h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.rg-art { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 20px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 96px; transition: background-color .2s; }
.rg-art:target { background: linear-gradient(90deg, rgba(255,207,74,.08), transparent 70%); box-shadow: inset 2px 0 0 var(--yellow); padding-left: 14px; }
.rg-num { font-family: var(--mono); font-size: 15px; font-weight: 600; line-height: 1.6; color: var(--yellow); }
.rg-num:hover { color: var(--white); }
.rg-body h4 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 21px; letter-spacing: .03em; text-transform: uppercase; line-height: 1.25; }
.rg-body > p { margin-top: 6px; color: var(--fg-2); font-size: 15.5px; }
.rg-ex { display: grid; gap: 8px; margin-top: 12px; }
.rg-ex p { padding: 9px 14px; border-radius: var(--r-sm); font-size: 14.5px; color: var(--fg-2); }
.rg-ex b { margin-right: 10px; font-family: var(--mono); font-weight: 600; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.rg-ex .ok { background: rgba(79,209,122,.07); border: 1px solid rgba(79,209,122,.2); }
.rg-ex .ok b { color: var(--green); }
.rg-ex .ko { background: rgba(240,90,79,.07); border: 1px solid rgba(240,90,79,.22); }
.rg-ex .ko b { color: #ff8a80; }
.rg-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.rg-sanction { max-width: 210px; padding: 4px 10px; border: 1px solid rgba(240,90,79,.3); border-radius: 999px; background: rgba(240,90,79,.08); color: #ff9a90; font-size: 12px; font-weight: 700; text-align: right; line-height: 1.4; }
.rg-copy { padding: 3px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--fg-3); font-size: 12px; font-weight: 700; cursor: pointer; opacity: 0; transition: opacity .15s, background-color .15s, color .15s; }
.rg-art:hover .rg-copy, .rg-copy:focus-visible, .rg-copy.done { opacity: 1; }
.rg-copy:hover { background: var(--white); color: #000; }
.rg-copy.done { background: var(--green); color: #04130a; border-color: var(--green); }

.rg-lexique { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin: 0; }
.rg-term { padding: 16px 0; border-bottom: 1px solid var(--line); }
.rg-term dt { font-family: var(--display); font-size: 18px; letter-spacing: .04em; text-transform: uppercase; color: var(--yellow); }
.rg-term dd { margin: 4px 0 0; color: var(--fg-2); font-size: 14.5px; }
.rg-table { margin-top: 20px; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow-x: auto; }
.rg-table table { width: 100%; border-collapse: collapse; }
.rg-table th { padding: 12px 16px; background: var(--panel-2); color: var(--fg-3); font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; text-align: left; }
.rg-table td { padding: 12px 16px; border-top: 1px solid var(--line); color: var(--fg-2); vertical-align: top; }
.rg-table td:first-child { font-weight: 700; color: var(--white); white-space: nowrap; }
.rg-recours { margin: 18px 0 0; padding: 0 0 0 18px; color: var(--fg-2); display: grid; gap: 8px; }
.rg-empty { padding: 20px 22px; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--fg-2); margin-bottom: 20px; }
.rg-end { margin-top: 8px; font-size: 12px; color: var(--fg-3); }
mark.rg-hit { background: var(--yellow); color: #000; padding: 0 2px; }

/* variante Rust */
.rg-rust .rg-hero { background: radial-gradient(900px 380px at 100% 0%, rgba(206,66,43,.2), transparent 60%), radial-gradient(700px 360px at 0% 120%, rgba(255,159,69,.07), transparent 60%), var(--panel); }
.rg-rust .rg-hero h1 span, .rg-rust .rg-ch-n, .rg-rust .rg-num, .rg-rust .rg-g-n, .rg-rust .rg-term dt { color: var(--orange); }
.rg-rust .rg-toc a.on { box-shadow: inset 2px 0 0 var(--orange); background: rgba(255,159,69,.08); }
.rg-rust .rg-toc-bar i { background: var(--orange); }

@media (max-width: 960px) {
  .rg-layout { grid-template-columns: minmax(0, 1fr); }
  .rg-toc { position: static; max-height: none; }
  .rg-toc nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rg-toc-title, .rg-toc-bar { grid-column: 1 / -1; }
  .rg-toc a:nth-of-type(odd) { border-right: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .rg-toc nav { grid-template-columns: minmax(0, 1fr); }
  .rg-toc a:nth-of-type(odd) { border-right: 0; }
  .rg-stats { width: 100%; }
  .rg-stats div { flex: 1 1 0; min-width: 0; padding: 10px 12px; }
  .rg-stats dd { font-size: 28px; }
  .rg-print { width: 100%; }
  .rg-art { grid-template-columns: 48px minmax(0, 1fr); }
  .rg-meta { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
  .rg-copy { opacity: 1; }
  .rg-sanction { text-align: left; max-width: none; }
  .rg-ch-count { position: static; display: block; margin-top: 10px; }
  .rg-lexique { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  html, body { background: #fff !important; color: #000 !important; }
  .top, .foot, .rg-toc, .rg-tools, .rg-other, .kg, .km, .progress, .rg-copy, .skip { display: none !important; }
  .rg-layout { display: block; margin-top: 16px; }
  .rg-hero, .rg-golden ol, .rg-golden li { background: #fff !important; border: 1px solid #000 !important; }
  .rg-hero::after { display: none; }
  .rg-hero h1, .rg-ch-head h2, .rg-hero h1 span, .rg-num, .rg-g-n, .rg-ch-n, .rg-term dt, .rg-body h4, .rg-golden h3 { color: #000 !important; }
  .rg-sub, .rg-body > p, .rg-golden p, .rg-term dd, .rg-ex p, .rg-table td, .rg-recours, .rg-ch-head p, .rg-stats dd { color: #000 !important; }
  .rg-art { break-inside: avoid; }
}
