/* Ghost in the Shell — library skin for Rules and Equipment (on top of gits_world.css).
   Pages: includes/gits/rules_page.php, includes/gits/equipment_page.php. Scope: .gr-page */

.gr-page {
  --tbl-line: rgba(94, 234, 212, 0.13);
  --tbl-line-strong: rgba(94, 234, 212, 0.28);
  --tbl-head: #0f1b2b;
  --tbl-stripe: rgba(94, 234, 212, 0.025);
  --tbl-hover: rgba(94, 234, 212, 0.07);
  --tbl-group: rgba(244, 114, 182, 0.10);
}

/* Hero crop: the cover's circuitry around the gun hand. */
.gr-hero .gw-hero-art { background-position: 30% 38%; background-size: 150% auto; }
.ge-hero .gw-hero-art { background-position: 6% 30%; background-size: 210% auto; }

/* ───────── Sections ───────── */
.gr-page .section { margin-bottom: 42px; }
.gr-page .section > h2 {
  border: 0;
  padding: 0 0 0 14px;
  margin: 0 0 12px;
  font-size: 1.45rem;
  font-weight: 750;
  color: #eef6ff;
  position: relative;
}
.gr-page .section > h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(var(--gw-cyan), var(--gw-mag));
}
.gr-page .section > h2 .muted { font-size: 0.9rem; font-weight: 500; }
.gr-page .section > p,
.gr-page .section > ul,
.gr-page .section > ol {
  max-width: 76ch;
  color: #c9d6e6;
  font-size: 1rem;
}
.gr-page .section > p.muted { color: var(--text-muted); font-size: 0.92rem; }
.gr-page .section h3 {
  margin: 22px 0 10px;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gw-cyan);
}
.gr-page .section > ul,
.gr-page .card ul {
  list-style: none;
  padding-left: 0;
}
.gr-page .section > ul > li,
.gr-page .card ul > li {
  position: relative;
  padding: 0 0 7px 20px;
}
.gr-page .section > ul > li::before,
.gr-page .card ul > li::before {
  content: "›";
  position: absolute;
  left: 4px;
  color: var(--gw-mag);
  font-weight: 700;
}
.gr-page kbd {
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #0b1522;
  font-family: var(--mono);
  font-size: 0.8em;
}

/* ───────── Cards ───────── */
.gr-page .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 14px;
}
.gr-page .card {
  position: relative;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--gw-panel);
  padding: 16px 18px;
  margin-bottom: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.gr-page .card-grid > .card { margin-bottom: 0; }
.gr-page .card::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: -1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gw-cyan), transparent);
  opacity: 0.5;
}
.gr-page .card:hover { border-color: rgba(94, 234, 212, 0.3); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
.gr-page .card p { color: #c3d0e0; }
.gr-page .card-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #f1f6fd;
  margin-bottom: 8px;
}
.gr-page .rule-key {
  border: 1px solid rgba(94, 234, 212, 0.3);
  border-left: 4px solid var(--gw-cyan);
  border-radius: 0 10px 10px 0;
  background: linear-gradient(90deg, rgba(94, 234, 212, 0.08), rgba(94, 234, 212, 0.02));
  color: #d6e3f1;
}
.gr-page .rule-example {
  border-left-color: var(--gw-gold);
  border-radius: 0 10px 10px 0;
}

/* ───────── Tables ───────── */
.gr-page .table-wrap {
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  overflow: auto;
  margin: 10px 0 16px;
}
.gr-page .content table,
.gr-page table.data-table {
  margin: 0;
  border: 0;
}
.gr-page table.data-table thead th {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gw-cyan);
  border-bottom: 1px solid var(--tbl-line-strong);
}
.gr-page table.data-table tbody td:first-child { color: #eef5fd; font-weight: 600; }
.gr-page table.eq-table tr.eq-stats td.cell-name { color: #f3f8fe; font-weight: 700; }
.gr-page table.eq-table td.num { font-family: var(--mono); color: var(--gw-gold); }
.gr-page table.eq-table .eq-desc-inner { color: #aebdd0; font-style: italic; }
.gr-page table.eq-table td.eq-effect { color: #c9d6e6; font-size: 0.86rem; }
.gr-page tr.tbl-group td {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gw-mag);
}

/* ───────── Quick reference strip ───────── */
.gr-quick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 26px;
}
.gr-quick-card {
  position: relative;
  padding: 16px 18px 12px;
  border-radius: 14px;
  border: 1px solid var(--gw-line);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(94, 234, 212, 0.08), transparent 55%),
    var(--gw-panel);
  display: flex;
  flex-direction: column;
}
.gr-quick-card h3 {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gw-cyan);
}
.gr-quick-more {
  margin: auto 0 0;
  padding-top: 10px;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.gr-quick-more a { color: var(--gw-cyan); text-decoration: none; }
.gr-quick-more a:hover { text-decoration: underline; }
.gr-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: gr;
}
.gr-steps li {
  counter-increment: gr;
  position: relative;
  padding: 0 0 9px 32px;
  font-size: 0.9rem;
  color: #c9d6e6;
}
.gr-steps li::before {
  content: counter(gr);
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 0.72rem var(--mono);
  color: #08111c;
  background: linear-gradient(135deg, var(--gw-cyan), var(--gw-mag));
}
.gr-steps strong { color: #f1f6fd; }
.gr-ladder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.gr-ladder li {
  --i: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 0.86rem;
  color: #d4e0ee;
  background: linear-gradient(90deg, rgba(94, 234, 212, calc(0.04 + var(--i) * 0.02)), rgba(244, 114, 182, calc(var(--i) * 0.035)));
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.gr-ladder strong { font-family: var(--mono); color: var(--gw-gold); }
.gr-figure { width: 100%; max-height: 220px; display: block; }
.gr-figure .gr-part rect,
.gr-figure .gr-part circle {
  fill: rgba(94, 234, 212, 0.08);
  stroke: rgba(94, 234, 212, 0.65);
  stroke-width: 1.4;
  transition: fill 0.2s;
}
.gr-figure .gr-part:hover rect,
.gr-figure .gr-part:hover circle { fill: rgba(244, 114, 182, 0.22); stroke: var(--gw-mag); }
.gr-figure .gr-roll { fill: #f1f6fd; font: 700 12px var(--mono); }
.gr-figure .gr-hp { fill: var(--gw-gold); font: 10px var(--mono); }
.gr-figure .gr-side { fill: var(--text-dim); font: 10px var(--mono); letter-spacing: 0.2em; text-transform: uppercase; }

/* ───────── Equipment page ───────── */
.ge-named { display: flex; flex-wrap: wrap; gap: 6px; }
.ge-named a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px 2px 3px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: #dbe7f5;
  text-decoration: none;
  background: rgba(244, 114, 182, 0.08);
  border: 1px solid rgba(244, 114, 182, 0.28);
  white-space: nowrap;
}
.ge-named a:hover { border-color: var(--gw-mag); color: #fff; }
.ge-named img, .ge-named .ge-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: #0b1522;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.ge-named .ge-dot { display: grid; place-items: center; font: 700 0.62rem var(--mono); color: var(--gw-gold); }
.ge-jump {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
  gap: 10px;
  margin: 0 0 26px;
}
.ge-jump a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--gw-panel);
  color: #eef5fd;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.ge-jump a:hover { border-color: rgba(94, 234, 212, 0.4); }
html[data-motion="full"] .ge-jump a:hover { transform: translateY(-2px); }
.ge-jump strong { font-size: 0.98rem; }
.ge-jump span { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); }
.ge-jump .ge-k { font-size: 1.3rem; color: rgba(244, 114, 182, 0.6); font-family: inherit; letter-spacing: 0; text-transform: none; }

@media (max-width: 1100px) {
  .gr-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gr-body-card { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .gr-quick { grid-template-columns: minmax(0, 1fr); }
  .gr-page .section > h2 { font-size: 1.25rem; }
}

/* Sticky library headers (≥1200px, style.css) need the viewport as their scroll container:
   clip the rounded wrapper instead of making it scroll. Wide tables keep their own scroll. */
@media (min-width: 1200px) {
  .gr-page .table-wrap:not(.is-wide),
  .gw-body .gw-table-wrap:not(.is-wide) { overflow: clip; }
}
