/* ============================================================
   PIT SITE — stylesheet
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

/* ---------- Design tokens (light) ---------- */
body {
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);

  --bg:       #f0f0f7;
  --surface:  #fff;
  --surface2: #f5f5fb;
  --surface3: #eaeaf4;
  --text:     #18181b;
  --muted:    #71717a;
  --border:   #dedee8;

  --red:    #dc2626; --red-b:    #fca5a5; --red-bg:    #fff1f1;
  --blue:   #2563eb; --blue-b:   #93c5fd; --blue-bg:   #eff6ff;
  --green:  #16a34a; --green-b:  #86efac; --green-bg:  #f0fdf4;
  --amber:  #d97706; --amber-b:  #fcd34d; --amber-bg:  #fffbeb;
  --teal:   #0d9488; --teal-b:   #5eead4; --teal-bg:   #f0fdfa;
  --yellow: #ca8a04; --yellow-b: #fde047; --yellow-bg: #fefce8;
  --purple: #9333ea; --purple-b: #d8b4fe; --purple-bg: #faf5ff;

  --photo-overlay:      rgba(255, 255, 255, .55);
}

/* ---------- Design tokens (dark) ---------- */
body.dark {
  --bg:       #0d0d1a;
  --surface:  #141426;
  --surface2: #1a1a2e;
  --surface3: #222238;
  --text:     #e4e4ef;
  --muted:    #8890a4;
  --border:   #272742;

  --red:    #f87171; --red-b:    #7f1d1d; --red-bg:    #1c0606;
  --blue:   #60a5fa; --blue-b:   #1e3a5f; --blue-bg:   #06111e;
  --green:  #4ade80; --green-b:  #14532d; --green-bg:  #020e06;
  --amber:  #fbbf24; --amber-b:  #78350f; --amber-bg:  #150a00;
  --teal:   #2dd4bf; --teal-b:   #134e4a; --teal-bg:   #010e0d;
  --yellow: #facc15; --yellow-b: #713f12; --yellow-bg: #130900;
  --purple: #c084fc; --purple-b: #4a1d96; --purple-bg: #0d0418;

  --photo-overlay:      rgba(7, 7, 22, .82);
}

/* =============================================================
   NAV
   ============================================================= */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  transition: background .3s, border-color .3s;
}

.nav-logo-img {
  height: 36px; width: 36px;
  object-fit: contain;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.nav-link {
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  border: none;
  background: none;
  font-family: inherit;
  transition: all .15s;
}
.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: var(--surface2);
}

.theme-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  transition: all .15s;
  flex-shrink: 0;
}
.theme-btn:hover { color: var(--text); background: var(--surface2); }

.ico-moon, .ico-sun { width: 18px; height: 18px; display: block; }
body.dark     .ico-moon { display: none; }
body:not(.dark) .ico-sun  { display: none; }

/* =============================================================
   SCROLL SNAP
   ============================================================= */
#snap-wrap {
  height: 100vh;
  height: 100dvh;
  padding-top: 52px;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-padding-top: 52px;
}

.snap-sec {
  scroll-snap-align: start;
  height: calc(100vh - 52px);
  height: calc(100dvh - 52px);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* =============================================================
   SCROLL-REVEAL ANIMATION
   ============================================================= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .65s cubic-bezier(.16,1,.3,1), transform .65s cubic-bezier(.16,1,.3,1);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Per-row stagger for the feature cards as the section reveals */
.features-inner:not(.in-view) .feature-card { opacity: 0; transform: translateY(16px); }
.features-inner.in-view .feature-card {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .5s ease, transform .5s ease, background .15s ease;
}
.features-inner.in-view .feature-card:nth-child(4n+1) { transition-delay: 0ms; }
.features-inner.in-view .feature-card:nth-child(4n+2) { transition-delay: 70ms; }
.features-inner.in-view .feature-card:nth-child(4n+3) { transition-delay: 140ms; }
.features-inner.in-view .feature-card:nth-child(4n+4) { transition-delay: 210ms; }

/* Shared background layer for photo sections. Height is set explicitly in
   pixels by JS (matching the section's real scrollHeight) because CSS-only
   sizing inside a scrollable container is unreliable across mobile browsers
   when content is taller than one screen. */
.sec-bg {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 0;
  pointer-events: none;
}

/* =============================================================
   SECTION 1 — LAWS
   ============================================================= */
#sec-laws {
  background: url('./Light_back.webp') center / cover no-repeat;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
body.dark #sec-laws { background-image: url('./Dark_back.webp'); }

#sec-laws::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .65);
  pointer-events: none;
}
body.dark #sec-laws::before { background: rgba(0, 0, 0, .6); }

.laws-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 960px;
  padding: 16px 16px 24px;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero-logo {
  height: 100px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, .4));
}

.hero > p {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

/* Topic grid */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  width: 100%;
}

.tc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border-radius: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-top: 3px solid var(--accent, var(--border));
  cursor: pointer;
  transition: all .15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.tc:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
  border-color: var(--accent, var(--blue));
  border-top-color: var(--accent, var(--blue));
}
.tc:active {
  transform: scale(.97);
}
.tc-svg svg {
  width: 28px; height: 28px;
  stroke: var(--accent, currentColor);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tc-name { font-size: 13px; font-weight: 700; color: var(--text); text-align: center; }
.tc-sub  { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.3; }

/* Community links */
.community {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.social {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.social:hover { opacity: .88; }
.social svg   { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.discord { background: #5865f2; color: #fff; }
.youtube { background: #ff0000; color: #fff; }

/* =============================================================
   SECTION 2 — STATS
   ============================================================= */
.s-stats {
  align-items: center;
  justify-content: safe center;
  overflow-y: auto;
}
.s-stats .sec-bg {
  background-image: linear-gradient(var(--photo-overlay), var(--photo-overlay)), url('./back_2.jpg');
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}

.stats-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 920px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stats-eyebrow {
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 700;
  margin-bottom: 6px;
}

.stats-h {
  font-size: clamp(20px, 5vw, 34px);
  font-weight: 900;
  color: var(--text);
  margin-bottom: 20px;
  text-align: center;
  line-height: 1.2;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  transition: all .2s;
}
.stat-box:hover { background: var(--surface2); transform: translateY(-2px); }

.stat-box .sv {
  font-size: clamp(16px, 3.5vw, 28px);
  font-weight: 900;
  line-height: 1;
  margin-bottom: 3px;
}
.stat-box .su {
  font-size: 10px;
  color: var(--blue);
  font-weight: 700;
  letter-spacing: .5px;
  margin-bottom: 4px;
  display: block;
}
.stat-box .sl {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
}

/* Stat box color variants */
.sred  .sv { color: var(--red); }
.sblue .sv { color: var(--blue); }
.sgreen .sv { color: var(--green); }
.samber .sv { color: var(--amber); }
.spurple .sv { color: var(--purple); }
.steal .sv { color: var(--teal); }

.stats-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 12px;
  text-align: center;
}

/* =============================================================
   SECTION 3 — WHY US
   ============================================================= */
.s-features {
  align-items: center;
  justify-content: safe center;
  overflow-y: auto;
}
.s-features .sec-bg {
  background-image: linear-gradient(var(--photo-overlay), var(--photo-overlay)), url('./back_3.jpg');
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}

.features-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 960px;
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.features-eyebrow {
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 700;
  margin-bottom: 6px;
}

.features-h {
  font-size: clamp(20px, 5vw, 34px);
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
  text-align: center;
  line-height: 1.2;
}

.features-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
  text-align: center;
  max-width: 520px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent, var(--muted));
  border-radius: 12px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  transition: all .15s;
}
.feature-card:hover {
  transform: translateY(-2px);
  background: var(--surface2);
}
.feature-icon { color: var(--accent, var(--blue)); margin-bottom: 2px; }
.feature-name { font-size: 13px; font-weight: 700; color: var(--text); }
.feature-desc { font-size: 11.5px; color: var(--muted); line-height: 1.4; }

/* =============================================================
   SECTION 4 — TEAM
   ============================================================= */
.s-team {
  align-items: center;
  justify-content: safe center;
  overflow-y: auto;
}
.s-team .sec-bg {
  background-image: linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.85)), url('./back_4.webp');
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}
body.dark .s-team .sec-bg {
  background-image: linear-gradient(rgba(7,7,22,.92), rgba(7,7,22,.92)), url('./back_4.webp');
}

.team-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 960px;
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.team-eyebrow {
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 700;
  margin-bottom: 6px;
}

.team-h {
  font-size: clamp(20px, 5vw, 34px);
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
  text-align: center;
  line-height: 1.2;
}

.team-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 22px;
  text-align: center;
  max-width: 520px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  margin-bottom: 30px;
}

.team-card {
  background: linear-gradient(135deg, var(--teal-bg), var(--surface));
  border: 1.5px solid var(--teal-b);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  transition: all .15s;
}
.team-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
}
.tm-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tm-avatar {
  width: 72px; height: 72px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.tm-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.tm-name { font-size: 13px; font-weight: 800; color: var(--text); }
.tm-role { font-size: 11px; color: var(--muted); font-weight: 600; }
.tm-link {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text);
  text-decoration: none;
  margin-top: 4px;
  opacity: .75;
}
.tm-link:hover { opacity: 1; text-decoration: underline; }
.tm-link svg { width: 14px; height: 14px; }

.team-tier-label {
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 4px 0 14px;
  padding: 6px 12px;
  background: var(--surface2);
  border-radius: 8px;
  border-left: 3px solid var(--blue);
  color: var(--text);
}
.team-tier-label[data-tier="lead"] { border-left-color: var(--blue);  color: var(--blue); }
.team-tier-label[data-tier="mods"]    { border-left-color: var(--teal);   color: var(--teal);   }
.team-tier-label[data-tier="contrib"] { border-left-color: var(--purple); color: var(--purple); }

.leader-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  margin-bottom: 26px;
}

.leader-card {
  background: linear-gradient(135deg, var(--blue-bg), var(--surface));
  border: 1.5px solid var(--blue-b);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all .15s;
}
.leader-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 0, 0, .12); }

.tm-avatar.lg { width: 68px; height: 68px; }

.leader-info { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; }
.leader-info .tm-name { font-size: 15px; }
.leader-info .tm-role { font-size: 11.5px; }
.leader-info .tm-link { margin-top: 4px; }


.credits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  padding: 0 48px;
}
/* Zigzag: cards 1+3 on right, card 2 on left */
.credits-grid .credit-card:nth-child(1) { grid-column: 2; grid-row: 1; margin-left:  -24px; }
.credits-grid .credit-card:nth-child(2) { grid-column: 1; grid-row: 2; margin-right: -24px; }
.credits-grid .credit-card:nth-child(3) { grid-column: 2; grid-row: 3; margin-left:  -24px; }

.credit-card {
  background: linear-gradient(135deg, var(--amber-bg), var(--surface));
  border: 1.5px solid var(--amber-b);
  border-radius: 14px;
  padding: 14px 76px 14px 16px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  min-height: 90px;
  position: relative;
  overflow: visible;
  transition: all .15s;
}
.credit-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
}
/* Left-column card: space for avatar on LEFT, avatar overflows LEFT */
.credits-grid .credit-card:nth-child(2) {
  padding-left: 76px;
  padding-right: 16px;
}
.credits-grid .credit-card:nth-child(2) .cr-avatar {
  left: -40px;
  right: auto;
}
.cr-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.cr-body .cr-name,
.cr-body .cr-desc { text-align: left; }
.cr-body .cr-links { margin-top: 6px; }
.credit-card .cr-body { order: 1; }
.credit-card .cr-avatar {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: 80px; height: 80px;
  border-radius: 0;
  border: none;
  overflow: visible;
  box-shadow: none;
}
.credit-card .cr-avatar img {
  object-fit: contain;
  border-radius: 0;
}

.cr-avatar {
  width: 64px; height: 64px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.cr-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cr-name { font-size: 15px; font-weight: 800; color: var(--teal); }
.cr-desc { font-size: 11.5px; color: var(--muted); line-height: 1.4; margin-bottom: 4px; }
.cr-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-start; }
.cr-links a {
  display: flex; align-items: center; justify-content: center;
  padding: 2px;
  background: none;
  transition: opacity .15s, transform .15s;
}
.cr-links a:hover { opacity: .7; transform: scale(1.15); background: none; }
.cr-links a[aria-label="GitHub"]  { color: var(--text); }
.cr-links a[aria-label="Discord"] { color: #5865f2; }
.cr-links a[aria-label="YouTube"] { color: #ff0000; }
.cr-links svg { width: 18px; height: 18px; }

/* =============================================================
   SECTION 5 — ABOUT
   ============================================================= */
.s-about {
  align-items: center;
  justify-content: safe center;
  overflow-y: auto;
}
.s-about .sec-bg {
  background-image: linear-gradient(130deg, rgba(5,5,20,.93) 40%, rgba(25,5,5,.88) 100%), url('./Dark_back.webp');
  background-size: cover, cover;
  background-position: center, center 35%;
  background-repeat: no-repeat, no-repeat;
}
body:not(.dark) .s-about .sec-bg {
  background-image: linear-gradient(130deg, rgba(255,255,255,.85) 40%, rgba(255,232,232,.8) 100%), url('./Light_back.webp');
}

.about-inner {
  position: relative;
  z-index: 1;
  max-width: 680px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px;
}

.about-logo {
  height: 80px; width: 80px;
  object-fit: contain;
  filter: drop-shadow(0 4px 24px rgba(248, 113, 113, .45));
  margin-bottom: 14px;
}

.about-title {
  font-size: clamp(22px, 6vw, 36px);
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.2;
}

.about-tagline {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 18px;
}

.about-text {
  font-size: clamp(13px, 3.5vw, 16px);
  color: var(--text);
  opacity: .82;
  line-height: 1.8;
  margin-bottom: 22px;
  text-wrap: pretty;
  max-width: 560px;
}

.about-links {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* =============================================================
   MODAL
   ============================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }

.modal-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  justify-content: center;
}

.modal-card {
  position: relative;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .5);
}

.modal-head {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

.m-title {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.m-close {
  background: none;
  border: none;
  cursor: pointer;
  min-width: 32px; height: 32px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.m-close:hover { background: var(--surface2); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px;
}

.modal-nav {
  padding: 10px;
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.mnav-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.dot.on {
  background: var(--blue);
  width: 20px;
  border-radius: 4px;
}

/* Side nav arrows — hidden on mobile (swipe gestures not implemented, dots suffice) */
.side-nav {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  width: 40px; height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
}
.side-nav:hover { background: var(--surface2); }
.side-nav svg {
  width: 18px; height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =============================================================
   MODAL CONTENT — shared components
   ============================================================= */
.topic-content         { display: none; }
.topic-content.active  { display: block; }

.page-sub { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

/* Role tabs */
.role-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.role-tabs::-webkit-scrollbar { display: none; }

.rtab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--tc-b, var(--border));
  color: var(--tc-t, var(--muted));
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  white-space: nowrap;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.rtab.active { background: var(--tc-bg, var(--surface2)); }

.rpanel        { display: none; }
.rpanel.active { display: block; }

/* Role card */
.role-card   { border-radius: 12px; border: 1.5px solid var(--border); overflow: hidden; margin-top: 4px; }
.role-header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.rh-icon     { font-size: 24px; }
.rh-name     { font-size: 16px; font-weight: 800; }
.rh-sub      { font-size: 12px; color: var(--muted); }
.role-body   { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }

/* Section rows */
.sec      { display: flex; flex-direction: column; gap: 6px; }
.sec-head { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--muted); }
.sec-icon { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }
.sec-title { color: var(--text); }

/* Stat bands */
.stat-band { display: flex; gap: 6px; flex-wrap: wrap; }
.stat-cell {
  flex: 1;
  min-width: 70px;
  background: var(--surface2);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}
.stat-val { font-size: 16px; font-weight: 800; }
.stat-lbl { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Row types */
.neutral-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: var(--surface2);
  border-radius: 7px;
  font-size: 13px;
}
.allowed {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: var(--green-bg);
  color: var(--green);
  border-radius: 7px;
  font-size: 13px;
}
.forbidden {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: var(--red-bg);
  color: var(--red);
  border-radius: 7px;
  font-size: 13px;
}

/* Info bars */
.info-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12.5px;
}
.bar-icon { display: flex; flex-shrink: 0; }
.info-red   { background: var(--red-bg);   color: var(--red);   }
.info-blue  { background: var(--blue-bg);  color: var(--blue);  }
.info-green { background: var(--green-bg); color: var(--green); }
.info-amber { background: var(--amber-bg); color: var(--amber); }
.info-teal  { background: var(--teal-bg);  color: var(--teal);  }

/* Penalty box */
.penalty-box {
  border: 1.5px solid var(--red-b);
  border-radius: 8px;
  padding: 10px;
  background: var(--red-bg);
}
.pb-title {
  display: flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 13px;
  color: var(--red);
  margin-bottom: 7px;
}
.penalty-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 7px;
  border: 1px solid var(--red-b);
  border-radius: 6px;
  font-size: 11px;
  color: var(--red);
  margin: 2px 3px;
}

/* Steps */
.steps    { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.step-item {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface2);
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 12.5px;
}
.step-num {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.step-arr { width: 12px; height: 2px; background: var(--border); flex-shrink: 0; }

/* Rule chips */
.rule-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rule-chip  { padding: 4px 9px; border: 1.5px solid currentColor; border-radius: 20px; font-size: 12px; }

/* Data table — scrollable on small screens */
.data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 320px; }
.data-table th,
.data-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th  { background: var(--surface2); font-weight: 700; color: var(--muted); font-size: 11px; }
.data-table tr.hl td { background: var(--blue-bg); color: var(--blue); font-weight: 700; }

/* Power-up grid */
.pu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }

/* Simple card */
.simple-card { background: var(--surface2); border-radius: 10px; padding: 12px; border: 1.5px solid var(--border); }
.sc-icon     { font-size: 22px; margin-bottom: 6px; }
.sc-title    { font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.howto       { padding-left: 14px; font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }

/* Player indicator list */
.pi-list { display: flex; flex-direction: column; gap: 6px; }
.pi-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pi-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Performance image */
.lead-img-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 10px; }
.lead-img { height: auto; border-radius: 8px; border: 1px solid var(--border); display: block; }

/* Rank grid */
.rank-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.rank-card { background: var(--surface2); border-radius: 10px; padding: 10px 6px; text-align: center; border: 1.5px solid var(--border); }
.rank-num  {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800;
  margin: 0 auto 6px;
}
.rank-name { font-size: 11px; font-weight: 600; color: var(--text); }

/* HUD grid */
.hud-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.hud-item { background: var(--surface2); border-radius: 8px; padding: 8px; border: 1px solid var(--border); }
.hud-icon { font-size: 18px; color: var(--blue); margin-bottom: 4px; display: flex; align-items: center; gap: 2px; }
.hud-name { font-size: 11px; font-weight: 700; }
.hud-desc { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* Hidden items */
.hidden-list { display: flex; flex-direction: column; gap: 10px; }
.hidden-item { background: var(--surface2); border-radius: 10px; padding: 12px; border: 1.5px solid var(--border); }
.hi-top  { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.hi-icon {
  width: 32px; height: 32px;
  background: var(--blue-bg);
  color: var(--blue);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hi-name { font-size: 13px; font-weight: 700; }
.hi-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Keybind list */
.plain-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.plain-list li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  padding: 6px 10px;
  background: var(--surface2);
  border-radius: 7px;
}
.keys-img { width: 100%; margin-top: 12px; border-radius: 8px; border: 1px solid var(--border); }

/* Rules grid */
.rules-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.rule-cell  { background: var(--surface2); border-radius: 10px; padding: 12px; text-align: center; border: 1.5px solid var(--border); }
.rule-emoji { font-size: 22px; margin-bottom: 8px; display: flex; align-items: center; justify-content: center; }
.rule-name  { font-size: 13px; font-weight: 700; }
.rule-note  { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* Tip row */
.tip-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px;
  background: var(--surface2);
  border-radius: 8px;
  font-size: 13px;
}

/* Footer */
footer { font-size: 12px; color: var(--muted); text-align: center; padding: 8px; margin-top: 12px; }

/* =============================================================
   UTILITIES
   ============================================================= */
.lnk  { color: var(--blue); text-decoration: none; }
.lnk:hover { text-decoration: underline; }

.dotc {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c);
  vertical-align: middle;
}

.mpvc-logo { display: block; height: 56px; object-fit: contain; margin: 0 auto 10px; }

.lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  display: block;
  margin-bottom: 4px;
}

/* Icon size helpers */
.ic {
  width: 16px; height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -.2em;
  flex-shrink: 0;
}
.ic-bob { width: 22px; height: 22px; }
.ic-fill { fill: currentColor; stroke: none; }


/* ============================================================
   ICON LIVELINESS
   Gentle idle float on the "hero" icons (feature cards, role
   headers, power-up cards, rule cards, homepage topic grid) plus
   a little extra wiggle on hover for the clickable ones. Pure CSS,
   zero network requests, works for every icon already in the page.
   Respects prefers-reduced-motion.
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  @keyframes icon-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-3px); }
  }
  @keyframes icon-wiggle {
    0%, 100% { transform: rotate(0deg); }
    25%      { transform: rotate(-10deg); }
    75%      { transform: rotate(10deg); }
  }

  .ic-bob,
  .rule-emoji svg,
  .tc-svg svg {
    animation: icon-float 2.6s ease-in-out infinite;
  }

  /* stagger so a grid of icons doesn't all bob in perfect unison */
  .feature-card:nth-child(4n+2) .ic-bob, .tc:nth-child(4n+2) .tc-svg svg { animation-delay: .3s; }
  .feature-card:nth-child(4n+3) .ic-bob, .tc:nth-child(4n+3) .tc-svg svg { animation-delay: .6s; }
  .feature-card:nth-child(4n+4) .ic-bob, .tc:nth-child(4n+4) .tc-svg svg { animation-delay: .9s; }

  /* a little extra delight on hover for the clickable cards */
  .tc:hover .tc-svg svg,
  .feature-card:hover .ic-bob {
    animation: icon-wiggle .5s ease-in-out;
  }
}

/* Placeholder elements */
.ph-logo {
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
}
.ph-logo.sm { width: 36px; height: 36px; font-size: 14px; }
.ph-logo.lg { width: 68px; height: 68px; font-size: 20px; }
.ph-logo.md { width: 84px; height: 84px; font-size: 26px; }


.img-ph {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--surface2);
  border-radius: 8px;
  padding: 16px;
  border: 2px dashed var(--border);
  text-align: center;
}
.img-ph-ico  { font-size: 24px; }
.img-ph-name { font-size: 12px; color: var(--muted); font-weight: 600; }

/* =============================================================
   MOBILE — up to 700px
   ============================================================= */
@media (max-width: 700px) {

  /* Nav */
  nav { padding: 0 10px; gap: 4px; }
  .nav-link { padding: 5px 8px; font-size: 12px; }

  /* Section 1 — Laws */
  .laws-content { gap: 12px; padding: 12px 12px 20px; }
  .hero-logo { height: 80px; }
  .hero > p { font-size: 12px; }

  .topic-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  /* 10th card (Server Rules) — full-width row */
  .tc:last-child { grid-column: 1 / -1; flex-direction: row; padding: 11px 14px; gap: 12px; }
  .tc:last-child .tc-svg { flex-shrink: 0; }
  .tc:last-child .tc-name,
  .tc:last-child .tc-sub { text-align: left; }
  .tc-svg svg { width: 24px; height: 24px; }
  .tc { padding: 12px 8px; gap: 5px; }
  .tc-name { font-size: 12.5px; }
  .tc-sub  { font-size: 10.5px; }

  /* Stats */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Why Us */
  .features-inner { padding: 72px 16px 28px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }

  /* Modal — full-width bottom sheet */
  .modal-backdrop { align-items: flex-end; }
  .modal-card {
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    width: 100%;
    max-width: 100%;
  }

  /* Hide side nav arrows on mobile */
  .side-nav { display: none; }
  .modal-wrap { gap: 0; }

  /* Power-ups */
  .pu-grid { grid-template-columns: 1fr; }

  /* Ranks */
  .rank-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .rank-card:last-child { grid-column: 1 / -1; }
  /* Team */
  .team-inner { padding: 72px 16px 28px; }
  .leader-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }

  /* Credits mobile */
  .credits-grid { grid-template-columns: 1fr; padding: 0; }
  .credits-grid .credit-card:nth-child(1),
  .credits-grid .credit-card:nth-child(2),
  .credits-grid .credit-card:nth-child(3) { grid-column: 1; grid-row: auto; margin-left: 0; margin-right: 0; }
  .credits-grid .credit-card:nth-child(2) { padding-left: 16px; padding-right: 52px; }
  .credits-grid .credit-card:nth-child(2) .cr-avatar { left: auto; right: 8px; }
  .credit-card { padding-right: 52px; padding-left: 16px; min-height: 72px; }
  .credit-card .cr-avatar { right: 8px; left: auto; width: 48px; height: 48px; transform: translateY(-50%); }


  /* HUD */
  .hud-grid { grid-template-columns: repeat(2, 1fr); }

  /* Steps — stack vertically */
  .steps { flex-direction: column; align-items: flex-start; }
  .step-arr { width: 2px; height: 12px; align-self: center; }

  /* Stat band — min 2 per row */
  .stat-cell { min-width: 60px; }

  /* Role tabs — horizontal scroll already handled above */

  /* Table wrap */
  .data-table-wrap { margin: 0 -2px; }
}

/* =============================================================
   MOBILE — up to 400px (very small phones)
   ============================================================= */
@media (max-width: 400px) {
  .nav-link { padding: 5px 6px; font-size: 11.5px; }
  .topic-grid { gap: 6px; }
  .tc { padding: 12px 8px; }
  .modal-body { padding: 12px 10px; }
  .hud-grid { grid-template-columns: 1fr 1fr; }
  .rank-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-band { gap: 5px; }
}