/* ============================================================
   BIT TOWN — RULES SITE
   Premium / Luxury theme (Mercedes-Benz inspired)
   ============================================================ */

:root {
  --bg: #07080a;
  --bg-2: #0b0d10;
  --panel: #101318;
  --panel-2: #14181f;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --silver: #c9ccd4;
  --silver-dim: #8a8f9a;
  --text: #e8eaee;
  --muted: #9aa0ab;
  --teal: #35e0d6;
  --teal-soft: rgba(53, 224, 214, 0.12);
  --gold: #f5c451;
  --red: #ff2d3f;
  --red-soft: rgba(255, 45, 63, 0.12);
  --chrome: linear-gradient(180deg, #ffffff 0%, #d9dde3 35%, #9aa1ad 55%, #e8ebef 75%, #7f8694 100%);
  --radius: 18px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Prompt", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

/* ---- Ambient background ---- */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(53, 224, 214, 0.07), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(53, 224, 214, 0.05), transparent 60%),
    linear-gradient(180deg, #0a0c0f 0%, #07080a 100%);
}
.bg-fx::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 70%);
}

body.theme-police .bg-fx {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255, 45, 63, 0.08), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(255, 45, 63, 0.05), transparent 60%),
    linear-gradient(180deg, #0a0c0f 0%, #07080a 100%);
}

/* ---- Navigation ---- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(7, 8, 10, 0.72);
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
  height: 76px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  margin-right: auto;
}
.brand img { height: 44px; width: auto; display: block; }
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-text .t1 {
  font-family: "Press Start 2P", monospace;
  font-size: 14px;
  background: linear-gradient(180deg, #d8fffb 0%, #35e0d6 55%, #0e9c94 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-text .t2 {
  font-size: 9px;
  letter-spacing: 0.32em;
  color: var(--gold);
  font-weight: 600;
  margin-top: 4px;
}
.brand-text .t2.red { color: var(--red); }
.brand img { border-radius: 50%; }

nav.links { display: flex; align-items: center; gap: 4px; }
nav.links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 400;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.25s ease;
  white-space: nowrap;
}
nav.links a:hover { color: var(--text); background: rgba(255,255,255,0.05); }
nav.links a.active {
  color: var(--text);
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
}

.nav-toggle { display: none; }

/* ---- Hero ---- */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 96px 28px 56px;
  text-align: center;
  position: relative;
}

.hero .badge-img {
  display: block;
  width: 190px;
  height: auto;
  margin: 0 auto 28px;
  filter: drop-shadow(0 18px 50px rgba(0,0,0,0.6));
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--silver-dim);
  font-weight: 500;
  margin-bottom: 22px;
}
.kicker::before, .kicker::after {
  content: "";
  width: 46px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--silver-dim));
}
.kicker::after { background: linear-gradient(90deg, var(--silver-dim), transparent); }

h1.chrome {
  font-size: clamp(44px, 7vw, 84px);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.05;
  background: linear-gradient(180deg, #ffffff 0%, #dfe3e9 30%, #98a0ac 52%, #eef1f4 68%, #767e8c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 0 rgba(255,255,255,0.04);
}

.hero .sub {
  margin-top: 18px;
  font-size: clamp(15px, 2vw, 19px);
  color: var(--muted);
  font-weight: 300;
}
.hero .sub b { color: var(--teal); font-weight: 500; }
body.theme-police .hero .sub b { color: var(--red); }

.hero-rule {
  width: 120px;
  height: 1px;
  margin: 36px auto 0;
  background: linear-gradient(90deg, transparent, var(--silver), transparent);
  position: relative;
}
.hero-rule::after {
  content: "◆";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--silver);
}

/* ---- Sections / cards ---- */
.wrap {
  max-width: 1460px;
  margin: 0 auto;
  padding: 24px 28px 90px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin: 48px 0 26px;
}
.section-head h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text);
  white-space: nowrap;
}
.section-head .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}
.section-head .tag {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--silver-dim);
  text-transform: uppercase;
  white-space: nowrap;
}

.rules { display: grid; gap: 14px; }

.rule {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  padding: 24px 28px;
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.rule::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--teal), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.rule:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.rule:hover::before { opacity: 1; }
body.theme-police .rule::before { background: linear-gradient(180deg, transparent, var(--red), transparent); }

.rule .num {
  font-size: 30px;
  font-weight: 200;
  line-height: 1;
  min-width: 54px;
  color: transparent;
  background: linear-gradient(180deg, #f2f4f7, #7f8694);
  -webkit-background-clip: text;
  background-clip: text;
  font-variant-numeric: tabular-nums;
}
.rule .body { flex: 1; }
.rule .body h3 {
  font-size: 16.5px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}
.rule .body p {
  font-size: 14.5px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.75;
}
.rule .body p b { color: var(--silver); font-weight: 500; }
.rule .body .note {
  margin-top: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--teal-soft);
  border: 1px solid rgba(53, 224, 214, 0.22);
  color: #b8f3ee;
  font-size: 13.5px;
  font-weight: 300;
  line-height: 1.7;
}
body.theme-police .rule .body .note {
  background: var(--red-soft);
  border-color: rgba(255, 45, 63, 0.25);
  color: #ffc2c8;
}

/* ---- Recruitment banner (F1 style) ---- */
.banner {
  margin: 6px 0 26px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  position: relative;
}
.banner .b-img { display: block; width: 100%; height: auto; }
.banner .b-fallback { display: none; }
.banner.no-img .b-fallback {
  display: block;
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.025) 0 2px, transparent 2px 6px),
    radial-gradient(700px 300px at 85% 20%, rgba(255, 45, 63, 0.22), transparent 60%),
    linear-gradient(105deg, #0b0d12 55%, #161a24 55.2%, #10131b 75%, #0b0d12 75.2%);
}
.b-stripes {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, transparent 58%, rgba(255,45,63,0.9) 58.2%, rgba(255,45,63,0.9) 60%, transparent 60.2%),
    linear-gradient(105deg, transparent 62%, rgba(232,234,238,0.85) 62.2%, rgba(232,234,238,0.85) 63.2%, transparent 63.4%),
    linear-gradient(105deg, transparent 66%, rgba(255,45,63,0.5) 66.2%, rgba(255,45,63,0.5) 66.8%, transparent 67%);
  pointer-events: none;
}
.b-check {
  height: 12px;
  background:
    repeating-linear-gradient(90deg, #e8eaee 0 12px, #0b0d12 12px 24px);
  opacity: 0.85;
}
.b-check.top {
  clip-path: polygon(0 0, 100% 0, 98% 100%, 0 100%);
  background:
    repeating-linear-gradient(90deg, #ff2d3f 0 12px, #0b0d12 12px 24px);
}
.b-content {
  position: relative;
  padding: 44px 48px 46px;
}
.b-kicker {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: #ff9aa3;
  font-weight: 600;
  padding: 7px 16px;
  border: 1px solid rgba(255,45,63,0.4);
  border-radius: 4px;
  background: rgba(255,45,63,0.08);
  transform: skewX(-8deg);
  margin-bottom: 18px;
}
.b-title {
  font-size: clamp(30px, 5vw, 54px);
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.03em;
  line-height: 1.12;
  background: linear-gradient(180deg, #ffffff 0%, #dfe3e9 40%, #98a0ac 60%, #eef1f4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-transform: none;
}
.b-title span {
  display: block;
  background: linear-gradient(180deg, #ff8d96 0%, #ff2d3f 55%, #a80f1b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 45, 63, 0.35));
}
.b-sub {
  margin-top: 14px;
  font-size: 14.5px;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: 0.02em;
}
@media (max-width: 900px) {
  .b-content { padding: 30px 24px 34px; }
}

/* ---- Toolbar: search + TOC ---- */
.toolbar {
  position: sticky;
  top: 88px;
  z-index: 50;
  display: flex;
  gap: 12px;
  margin: 4px 0 10px;
}
.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  height: 54px;
  background: rgba(16, 19, 24, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.search-box:focus-within {
  border-color: rgba(255, 45, 63, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 45, 63, 0.12);
}
.search-box .s-icon { font-size: 16px; opacity: 0.7; }
.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 300;
}
.search-box input::placeholder { color: var(--silver-dim); }
.toc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  height: 54px;
  background: rgba(16, 19, 24, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
}
.toc-toggle:hover { border-color: rgba(255, 45, 63, 0.55); }
.toc-toggle.on {
  background: linear-gradient(180deg, rgba(255, 45, 63, 0.18), rgba(255, 45, 63, 0.08));
  border-color: rgba(255, 45, 63, 0.55);
}

/* ---- Layout: sidebar + content ---- */
.layout {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}
.side {
  position: sticky;
  top: 96px;
}
.toc-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.toc-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background:
    radial-gradient(300px 80px at 20% 0%, rgba(255,45,63,0.12), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
  border-bottom: 1px solid var(--line);
}
.toc-head .th-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: #fff;
  font-size: 15px;
  background: linear-gradient(180deg, #ff5560, #c1121f);
  box-shadow: 0 6px 18px rgba(255,45,63,0.35);
}
.toc-head .th-text { display: flex; flex-direction: column; line-height: 1.2; }
.toc-head .th-title { font-size: 17px; font-weight: 600; letter-spacing: 0.05em; color: var(--text); }
.toc-head .th-sub { margin-top: 3px; font-size: 8.5px; letter-spacing: 0.3em; color: var(--silver-dim); }
.toc-progress {
  height: 3px;
  background: rgba(255,255,255,0.05);
}
.toc-progress .bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff5560, #c1121f);
  box-shadow: 0 0 10px rgba(255,45,63,0.6);
  transition: width 0.15s linear;
}
.toc-list {
  padding: 12px;
  display: grid;
  gap: 6px;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}
.toc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 300;
  transition: all 0.22s ease;
}
.toc-item:hover { color: var(--text); background: rgba(255,255,255,0.04); transform: translateX(3px); }
.toc-item .t-ico {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.toc-item.active .t-ico {
  background: rgba(255,45,63,0.15);
  border-color: rgba(255,45,63,0.4);
}
.toc-item .t-num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--silver-dim);
  font-variant-numeric: tabular-nums;
}
.toc-item .t-name { flex: 1; line-height: 1.4; }
.toc-item .t-count {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--silver-dim);
  font-variant-numeric: tabular-nums;
}
.toc-item.active {
  border-color: rgba(255, 45, 63, 0.55);
  background: linear-gradient(180deg, rgba(255,45,63,0.12), rgba(255,45,63,0.05));
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--red);
}
.toc-item.active .t-num { color: var(--red); }
.toc-item.active .t-count { background: rgba(255,45,63,0.18); color: #ff9aa3; }
.toc-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--silver-dim);
  text-align: center;
}

/* flash target after TOC jump */
.flash { border-color: rgba(255, 45, 63, 0.65) !important; box-shadow: 0 0 0 3px rgba(255, 45, 63, 0.15); }

.no-results {
  margin-top: 26px;
  padding: 60px 30px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--silver-dim);
  font-weight: 300;
}

/* ---- Rule sub-lists ---- */
.rule .body ul.pts {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.rule .body ul.pts li {
  position: relative;
  padding-left: 22px;
  font-size: 14.5px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.75;
}
.rule .body ul.pts li::before {
  content: "◆";
  position: absolute;
  left: 0;
  top: 2px;
  font-size: 9px;
  color: var(--red);
  opacity: 0.85;
}
.rule .body ul.pts li b { color: var(--silver); font-weight: 500; }
.rule .body ul.pts li .sub {
  display: block;
  margin-top: 6px;
  padding-left: 14px;
  border-left: 2px solid rgba(255,255,255,0.1);
  color: var(--silver-dim);
  font-size: 13.5px;
}

/* ---- Fines ---- */
.fines { display: grid; gap: 10px; }
.fine {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 18px 22px;
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.fine:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.fine .f-name {
  flex: 1;
  min-width: 220px;
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
}
.fine .f-name small {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 300;
  color: var(--silver-dim);
  line-height: 1.65;
}
.fine .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  border: 1px solid;
}
.chip.money {
  color: var(--gold);
  border-color: rgba(245, 196, 81, 0.3);
  background: rgba(245, 196, 81, 0.07);
}
.chip.jail {
  color: #ff9aa3;
  border-color: rgba(255, 45, 63, 0.3);
  background: rgba(255, 45, 63, 0.08);
}
.chip.info {
  color: var(--silver);
  border-color: var(--line-strong);
  background: rgba(255,255,255,0.04);
}

.fines.red-case .fine { border-color: rgba(255, 45, 63, 0.22); }
.fines.red-case .fine:hover { border-color: rgba(255, 45, 63, 0.45); }

.section-note {
  margin-top: 18px;
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  color: var(--silver-dim);
  font-size: 13.5px;
  font-weight: 300;
  line-height: 1.7;
  text-align: center;
}

/* ---- Vehicle cards ---- */
.cars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.car {
  padding: 24px;
  text-align: center;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.car:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.car .c-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #ffffff, #a7aeba);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.car .c-rank {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.6;
}
.car .c-img {
  display: block;
  width: 100%;
  max-width: 240px;
  height: 96px;
  margin: 2px auto 10px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.5));
}
.car:hover .c-img { transform: translateY(-2px); transition: transform 0.3s ease; }
.car .c-tag {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--red);
  text-transform: uppercase;
}

/* Anchor offset for sticky header */
[id] { scroll-margin-top: 96px; }

/* ---- Verdict banner ---- */
.verdict {
  margin-top: 44px;
  padding: 34px 30px;
  text-align: center;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(600px 200px at 50% 0%, rgba(255,255,255,0.05), transparent 70%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  position: relative;
  overflow: hidden;
}
.verdict::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 55%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--silver), transparent);
}
.verdict .v-kicker {
  font-size: 10.5px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--silver-dim);
  margin-bottom: 12px;
}
.verdict p {
  font-size: clamp(16px, 2.4vw, 20px);
  font-weight: 500;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #ffffff, #a7aeba);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Placeholder / coming soon ---- */
.placeholder {
  margin-top: 26px;
  padding: 70px 30px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.015), transparent);
}
.placeholder .icon { font-size: 34px; margin-bottom: 16px; opacity: 0.85; }
.placeholder h3 {
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: var(--silver);
  margin-bottom: 8px;
}
.placeholder p { color: var(--muted); font-weight: 300; font-size: 14px; }

/* ---- Footer ---- */
footer {
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.35);
}
.foot {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
}
.foot .f-brand {
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  background: linear-gradient(180deg, #d8fffb, #35e0d6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.foot .f-note { font-size: 12.5px; color: var(--silver-dim); font-weight: 300; letter-spacing: 0.05em; }
.socials { display: flex; gap: 10px; }
.socials a {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  transition: all 0.25s ease;
}
.socials a:hover { color: var(--teal); border-color: var(--teal); transform: translateY(-2px); }

/* ---- Reveal animation ---- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .nav { height: auto; flex-wrap: wrap; padding: 14px 20px; gap: 12px; }
  .nav-toggle {
    display: grid;
    place-items: center;
    width: 42px; height: 42px;
    background: none;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
  }
  nav.links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 8px;
  }
  nav.links.open { display: flex; }
  nav.links a { text-align: center; }
  .hero { padding: 64px 22px 40px; }
  .rule { flex-direction: column; gap: 10px; padding: 22px; }
  .rule .num { font-size: 24px; }
  .toolbar { position: static; flex-wrap: wrap; }
  .toc-toggle { flex: 1; justify-content: center; }
  .section-head { flex-wrap: wrap; gap: 10px; }
  .section-head h2 { white-space: normal; font-size: 20px; }
  .section-head .line { display: none; }
  .fine { flex-direction: column; align-items: flex-start; }
}

/* ---- Sidebar responsive (must come after .side base rules) ---- */
@media (min-width: 1001px) {
  .toc-toggle { display: none; }
}
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .side {
    display: none;
    position: fixed;
    top: 90px;
    left: 16px;
    right: 16px;
    z-index: 200;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  }
  .side.open { display: block; }
  .toc-list { max-height: 50vh; }
}

/* ---- Promo banner carousel ---- */
.promo-strip {
  position: relative;
  margin-bottom: 10px;
}
.p-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
}
.p-track::-webkit-scrollbar { display: none; }
.p-slide {
  position: relative;
  flex: 0 0 100%;
  scroll-snap-align: center;
  aspect-ratio: 21 / 8;
  overflow: hidden;
  background: var(--panel);
}
.p-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.p-slide .p-fallback { display: none; }
.p-slide.no-img .p-fallback {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: absolute;
  inset: 0;
}
.pf-body { padding: 24px 44px; position: relative; }
.pf-kicker {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: #ff9aa3;
  font-weight: 600;
  padding: 6px 14px;
  border: 1px solid rgba(255,45,63,0.4);
  border-radius: 4px;
  background: rgba(255,45,63,0.08);
  transform: skewX(-8deg);
  margin-bottom: 14px;
}
.pf-title {
  font-size: clamp(22px, 3.4vw, 40px);
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.03em;
  line-height: 1.12;
  background: linear-gradient(180deg, #ffffff 0%, #dfe3e9 40%, #98a0ac 60%, #eef1f4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pf-title span {
  display: block;
  background: linear-gradient(180deg, #ff8d96 0%, #ff2d3f 55%, #a80f1b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 16px rgba(255,45,63,0.35));
}
.pf-title-px {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(18px, 3vw, 34px);
  line-height: 1.3;
  background: linear-gradient(180deg, #d8fffb 0%, #35e0d6 55%, #0e9c94 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 16px rgba(53,224,214,0.3));
}
.pf-sub {
  margin-top: 12px;
  font-size: 13.5px;
  font-weight: 300;
  color: var(--muted);
}
.pf-check {
  height: 10px;
  background: repeating-linear-gradient(90deg, #ff2d3f 0 10px, #0b0d12 10px 20px);
  opacity: 0.85;
}
.pf-recruit {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0 2px, transparent 2px 6px),
    linear-gradient(105deg, transparent 60%, rgba(255,45,63,0.85) 60.2%, rgba(255,45,63,0.85) 62%, transparent 62.2%),
    linear-gradient(105deg, transparent 65%, rgba(232,234,238,0.8) 65.2%, rgba(232,234,238,0.8) 66%, transparent 66.2%),
    radial-gradient(600px 260px at 85% 15%, rgba(255,45,63,0.2), transparent 60%),
    linear-gradient(180deg, #0c0e13, #10131b);
}
.pf-town {
  background:
    linear-gradient(rgba(53,224,214,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53,224,214,0.05) 1px, transparent 1px),
    radial-gradient(600px 260px at 80% 20%, rgba(53,224,214,0.14), transparent 60%),
    linear-gradient(180deg, #0a0f12, #0d1418);
  background-size: 40px 40px, 40px 40px, auto, auto;
}
.pf-town .pf-kicker {
  color: #8ff0ea;
  border-color: rgba(53,224,214,0.35);
  background: rgba(53,224,214,0.07);
}
.pf-discord {
  background:
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.015) 0 3px, transparent 3px 9px),
    radial-gradient(700px 280px at 20% 80%, rgba(255,45,63,0.16), transparent 60%),
    linear-gradient(180deg, #0d0d14, #12101c);
}
.p-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(10, 12, 16, 0.8);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.25s ease;
  display: grid;
  place-items: center;
  padding-bottom: 4px;
}
.p-nav:hover { border-color: rgba(255,45,63,0.6); color: #ff9aa3; }
.p-nav.prev { left: 14px; }
.p-nav.next { right: 14px; }
.p-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.p-dot {
  width: 26px;
  height: 5px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,0.12);
  cursor: pointer;
  transition: all 0.3s ease;
}
.p-dot.on {
  background: linear-gradient(90deg, #ff5560, #c1121f);
  box-shadow: 0 0 10px rgba(255,45,63,0.5);
}
@media (max-width: 900px) {
  .p-slide { aspect-ratio: 16 / 9; }
  .pf-body { padding: 18px 22px; }
  .p-nav { width: 36px; height: 36px; font-size: 20px; }
}

/* ---- Horizontal TOC bar (overrides sidebar styles) ---- */
.toc-bar {
  position: sticky;
  top: 80px;
  z-index: 60;
  display: flex;
  align-items: stretch;
  margin: 4px 0 14px;
  background: rgba(13, 15, 20, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  overflow: hidden;
}
.toc-bar .tb-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(200px 60px at 30% 0%, rgba(255,45,63,0.14), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
  flex-shrink: 0;
}
.toc-bar .th-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(180deg, #ff5560, #c1121f);
  box-shadow: 0 5px 14px rgba(255,45,63,0.35);
}
.toc-bar .th-icon svg { width: 16px; height: 16px; }
.toc-bar .tb-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text);
  white-space: nowrap;
}
.toc-bar .toc-list {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  max-height: none;
  scrollbar-width: none;
  flex: 1;
}
.toc-bar .toc-list::-webkit-scrollbar { display: none; }
.toc-bar .toc-item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px 8px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  transform: none;
}
.toc-bar .toc-item:hover { transform: none; }
.toc-bar .toc-item .t-ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--silver);
}
.toc-bar .toc-item .t-ico svg { width: 15px; height: 15px; }
.toc-bar .toc-item .t-name { white-space: nowrap; font-size: 13.5px; }
.toc-bar .toc-item.active { box-shadow: none; }
.toc-bar .toc-item.active .t-ico { color: #ff9aa3; }
.toc-bar .toc-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}
@media (max-width: 900px) {
  .toc-bar { top: 74px; }
  .toc-bar .tb-text { display: none; }
  .toc-bar .tb-label { padding: 10px 14px; }
}
