/* EdensGate: crimson & black, ARK: Survival Ascended community */
:root {
  --bg: #070405;
  --bg-2: #0c0607;
  --panel: #110909;
  --panel-2: #170c0e;
  --panel-3: #211113;
  --line: rgba(255, 64, 86, 0.16);
  --line-soft: rgba(255, 255, 255, 0.07);
  --text: #f5ecec;
  --muted: #b9a1a3;
  --dim: #7f6567;
  --bone: #ecdcc6;
  --crimson: #dc143c;
  --crimson-hi: #ff3557;
  --crimson-lo: #8e0b24;
  --blood: #3d0610;
  --ok: #3ee08a;
  --warn: #f0b443;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.8);
  --glow: 0 0 0 1px rgba(255, 53, 87, 0.35), 0 10px 40px -8px rgba(220, 20, 60, 0.55);
  --f-display: 'Cinzel', 'Times New Roman', serif;
  --f-ui: 'Oxanium', 'Segoe UI', sans-serif;
  --f-body: 'Barlow', 'Segoe UI', system-ui, sans-serif;
  --wrap: 1200px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--crimson-hi); text-decoration: none; }
a:hover { color: #ff6a82; }
::selection { background: var(--crimson); color: #fff; }
:focus-visible { outline: 2px solid var(--crimson-hi); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
p { margin: 0; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Background texture: faint crimson haze + grain */
.bg-fx {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(220, 20, 60, 0.13), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(142, 11, 36, 0.12), transparent 60%),
    linear-gradient(var(--bg), var(--bg-2));
}
.bg-fx::after {
  content: ''; position: absolute; inset: 0; opacity: 0.07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- buttons ---------- */
.btn {
  --b: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  min-height: 44px; padding: 0 1.25rem;
  border: 1px solid var(--b); border-radius: 10px;
  background: rgba(255, 255, 255, 0.03); color: var(--text);
  font: 600 0.95rem/1 var(--f-ui); letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap;
  transition: transform 0.15s, background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.btn:hover { color: #fff; border-color: rgba(255, 53, 87, 0.5); background: rgba(220, 20, 60, 0.1); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn-primary {
  border-color: transparent; color: #fff;
  background: linear-gradient(180deg, var(--crimson-hi), var(--crimson) 55%, var(--crimson-lo));
  box-shadow: var(--glow);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  border-radius: 0;
}
.btn-primary:hover { background: linear-gradient(180deg, #ff5873, var(--crimson-hi) 55%, var(--crimson)); color: #fff; }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 36px; padding: 0 0.85rem; font-size: 0.8rem; }
.btn-xs { min-height: 30px; padding: 0 0.65rem; font-size: 0.72rem; border-radius: 8px; }
.btn-danger:hover { border-color: var(--crimson-hi); background: rgba(220, 20, 60, 0.25); }
.btn.is-on { border-color: var(--crimson-hi); background: rgba(220, 20, 60, 0.22); color: #fff; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 4, 5, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}
.site-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--crimson), transparent);
  opacity: 0.55;
}
.nav { display: flex; align-items: center; gap: 1.25rem; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); flex: none; }
.brand:hover { color: #fff; }
.brand-mark { width: 34px; height: 38px; filter: drop-shadow(0 0 10px rgba(220, 20, 60, 0.55)); }
.brand-name { font: 900 1.28rem/1 var(--f-display); letter-spacing: 0.08em; }
.brand-name b { color: var(--crimson-hi); font-weight: 900; }
.nav-links { display: flex; align-items: center; gap: 0.15rem; margin-left: 0.75rem; }
.nav-links a {
  position: relative; padding: 0.55rem 0.75rem; color: var(--muted);
  font: 600 0.82rem/1 var(--f-ui); letter-spacing: 0.08em; text-transform: uppercase;
  border-radius: 8px;
}
.nav-links a:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.nav-links a[aria-current='page'] { color: #fff; }
.nav-links a[aria-current='page']::after {
  content: ''; position: absolute; left: 0.75rem; right: 0.75rem; bottom: -0.2rem; height: 2px;
  background: var(--crimson-hi); box-shadow: 0 0 10px var(--crimson);
}
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }
.nav-toggle { display: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); background: transparent; border-radius: 10px; color: var(--text); cursor: pointer; }
.nav-toggle svg { width: 22px; height: 22px; margin: auto; }

.user-chip {
  display: inline-flex; align-items: center; gap: 0.55rem; min-height: 44px;
  padding: 0.25rem 0.75rem 0.25rem 0.3rem; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03);
  color: var(--text); font: 600 0.85rem var(--f-ui); cursor: pointer;
}
.user-chip img { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--crimson-lo); }
.user-chip span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu { position: relative; }
.user-menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 0.4rem;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.user-menu-pop a, .user-menu-pop button {
  display: flex; width: 100%; align-items: center; gap: 0.6rem; padding: 0.65rem 0.75rem;
  color: var(--text); background: none; border: 0; border-radius: 8px; font: 500 0.92rem var(--f-body); text-align: left; cursor: pointer;
}
.user-menu-pop a:hover, .user-menu-pop button:hover { background: rgba(220, 20, 60, 0.14); color: #fff; }
.user-menu-pop hr { border: 0; border-top: 1px solid var(--line-soft); margin: 0.3rem 0; }

@media (max-width: 1060px) {
  .nav-toggle { display: grid; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem 16px 1rem;
    background: rgba(9, 5, 6, 0.97); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.95rem 0.5rem; border-bottom: 1px solid var(--line-soft); border-radius: 0; font-size: 0.9rem; }
  .nav-links a[aria-current='page']::after { left: 0; right: auto; top: 0.8rem; bottom: 0.8rem; width: 2px; height: auto; }
  .nav-links a[aria-current='page'] { padding-left: 0.9rem; }
}
@media (max-width: 560px) {
  .nav { gap: 0.6rem; }
  .brand-name { font-size: 1.05rem; }
  .nav-discord span, .user-chip span { display: none; }
  .nav-discord { width: 44px; padding: 0; }
  .user-chip { padding-right: 0.3rem; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(92vh, 860px);
  display: flex; align-items: center;
  border-bottom: 1px solid var(--line);
}
.hero-art { position: absolute; inset: 0; z-index: -2; }
.hero-art svg { width: 100%; height: 100%; display: block; }
.hero-embers { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(7, 4, 5, 0.92) 0%, rgba(7, 4, 5, 0.7) 38%, rgba(7, 4, 5, 0) 68%),
    linear-gradient(0deg, var(--bg) 0%, transparent 22%);
}
.hero-inner { padding: 7rem 0 6rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--crimson-hi); font: 600 0.78rem/1 var(--f-ui); letter-spacing: 0.24em; text-transform: uppercase;
}
.eyebrow::before { content: ''; width: 28px; height: 2px; background: currentColor; box-shadow: 0 0 10px var(--crimson); }
.hero h1 {
  margin: 1.1rem 0 0.35rem;
  font: 900 clamp(3.1rem, 10vw, 7.4rem)/0.92 var(--f-display);
  letter-spacing: 0.035em;
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.7);
}
.hero h1 b { color: var(--crimson-hi); font-weight: 900; text-shadow: 0 0 34px rgba(220, 20, 60, 0.75); }
.hero-sub { font: 600 clamp(1.05rem, 2.4vw, 1.4rem)/1.3 var(--f-display); color: var(--bone); letter-spacing: 0.06em; }
.hero-lede { max-width: 540px; margin-top: 1.1rem; color: var(--muted); font-size: 1.1rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.hero-cta .btn { min-height: 52px; padding: 0 1.6rem; }

.stat-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 3rem; max-width: 640px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(10, 5, 6, 0.65); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.stat { padding: 1rem 1.1rem; border-left: 1px solid var(--line-soft); }
.stat:first-child { border-left: 0; }
.stat-value { display: flex; align-items: center; gap: 0.45rem; font: 700 1.6rem/1.1 var(--f-ui); color: #fff; font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 0.3rem; color: var(--dim); font: 600 0.7rem/1.2 var(--f-ui); letter-spacing: 0.14em; text-transform: uppercase; }
@media (max-width: 640px) {
  .hero-inner { padding: 4.5rem 0 4rem; }
  .hero::before { background: linear-gradient(180deg, rgba(7, 4, 5, 0.55), rgba(7, 4, 5, 0.85) 60%, var(--bg)); }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line-soft); }
  .hero-cta .btn { flex: 1 1 100%; }
}

/* ---------- status dots / pills ---------- */
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.online { background: var(--ok); box-shadow: 0 0 0 0 rgba(62, 224, 138, 0.6); animation: pulse 2s infinite; }
.dot.offline { background: var(--crimson-hi); }
.dot.unknown, .dot.unlinked { background: var(--warn); }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(62, 224, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(62, 224, 138, 0); } }
.pill {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.28rem 0.6rem; border-radius: 999px;
  font: 600 0.68rem/1 var(--f-ui); letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--line); color: var(--muted); background: rgba(255, 255, 255, 0.03); white-space: nowrap;
}
.pill.red { color: #fff; background: rgba(220, 20, 60, 0.22); border-color: rgba(255, 53, 87, 0.45); }
.pill.green { color: var(--ok); border-color: rgba(62, 224, 138, 0.35); background: rgba(62, 224, 138, 0.08); }
.pill.amber { color: var(--warn); border-color: rgba(240, 180, 67, 0.35); background: rgba(240, 180, 67, 0.08); }

/* ---------- sections ---------- */
.section { padding: 5.5rem 0; position: relative; }
.section.tight { padding: 3.5rem 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2.25rem; }
.section-head h2, .page-hero h1 { margin-top: 0.75rem; font: 800 clamp(1.9rem, 4.4vw, 2.9rem)/1.1 var(--f-display); letter-spacing: 0.03em; }
.section-head p { margin-top: 0.75rem; color: var(--muted); max-width: 560px; }
.claw-divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }

.page-hero { position: relative; padding: 4.5rem 0 3rem; border-bottom: 1px solid var(--line-soft); overflow: hidden; }
.page-hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 260px at 80% 0%, rgba(220, 20, 60, 0.22), transparent 70%),
    repeating-linear-gradient(115deg, transparent 0 46px, rgba(255, 53, 87, 0.035) 46px 48px);
}
.page-hero p { margin-top: 0.9rem; max-width: 640px; color: var(--muted); font-size: 1.08rem; }
.page-hero .actions { margin-top: 1.6rem; display: flex; gap: 0.7rem; flex-wrap: wrap; }

/* ---------- cards & grids ---------- */
.grid { display: grid; gap: 1.1rem; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.card {
  position: relative; padding: 1.4rem;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.card::before {
  content: ''; position: absolute; left: 1.4rem; right: 1.4rem; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--crimson), transparent); opacity: 0.6;
}
.card.hover:hover { border-color: var(--line); transform: translateY(-3px); box-shadow: var(--shadow); }
.card h3 { font: 700 1.2rem/1.25 var(--f-display); letter-spacing: 0.02em; }
.card .meta { color: var(--dim); font: 500 0.8rem var(--f-ui); letter-spacing: 0.04em; }
.card p { color: var(--muted); }

.feature-icon {
  width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 1rem;
  border: 1px solid rgba(255, 53, 87, 0.4); border-radius: 12px; color: var(--crimson-hi);
  background: radial-gradient(circle at 30% 20%, rgba(220, 20, 60, 0.35), rgba(220, 20, 60, 0.05));
}
.feature-icon svg { width: 24px; height: 24px; }
.feature p { margin-top: 0.5rem; }

/* server cards */
.server-card { display: flex; flex-direction: column; gap: 0.9rem; overflow: hidden; }
.server-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.server-map { font: 600 0.72rem var(--f-ui); color: var(--crimson-hi); letter-spacing: 0.16em; text-transform: uppercase; }
.server-card h3 { margin-top: 0.35rem; }
.server-players { display: flex; align-items: baseline; gap: 0.35rem; font: 700 1.45rem var(--f-ui); font-variant-numeric: tabular-nums; }
.server-players small { color: var(--dim); font-size: 0.85rem; font-weight: 500; }
.meter { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--crimson-lo), var(--crimson-hi)); box-shadow: 0 0 12px var(--crimson); transition: width 0.8s ease; }
.server-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: auto; padding-top: 0.9rem; border-top: 1px dashed var(--line-soft); }
.copy-name { display: flex; align-items: center; gap: 0.4rem; min-width: 0; color: var(--muted); font: 500 0.82rem var(--f-ui); }
.copy-name code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--bone); }
.server-glyph { position: absolute; right: -18px; bottom: -26px; width: 140px; height: 140px; opacity: 0.06; color: var(--crimson-hi); pointer-events: none; }

/* rates */
.rates { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 0.8rem; }
.rate { padding: 1.1rem 1.2rem; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(255, 255, 255, 0.02); }
.rate-value { font: 700 1.7rem/1.1 var(--f-ui); color: #fff; }
.rate-label { margin-top: 0.35rem; color: var(--dim); font: 600 0.72rem var(--f-ui); letter-spacing: 0.12em; text-transform: uppercase; }

/* news + events */
.feed { display: grid; gap: 0.9rem; }
.news-item .tag-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; flex-wrap: wrap; }
.news-item h3 { font-size: 1.15rem; }
.news-item .body { margin-top: 0.55rem; color: var(--muted); white-space: pre-line; }
.event-card { display: grid; grid-template-columns: 78px 1fr; gap: 1.1rem; align-items: start; }
.event-date {
  display: grid; place-items: center; text-align: center; padding: 0.7rem 0.3rem;
  border: 1px solid rgba(255, 53, 87, 0.35); border-radius: 12px; background: rgba(220, 20, 60, 0.08);
}
.event-date b { display: block; font: 800 1.85rem/1 var(--f-display); color: #fff; }
.event-date span { font: 600 0.7rem var(--f-ui); color: var(--crimson-hi); letter-spacing: 0.16em; text-transform: uppercase; }
.event-card .body { margin-top: 0.45rem; color: var(--muted); white-space: pre-line; }
.event-actions { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-top: 1rem; }
.countdown { font: 600 0.82rem var(--f-ui); color: var(--bone); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.countdown.live { color: var(--ok); }
@media (max-width: 480px) { .event-card { grid-template-columns: 1fr; } .event-date { justify-self: start; display: flex; gap: 0.5rem; padding: 0.5rem 0.8rem; } .event-date b { font-size: 1.3rem; } }

/* steps */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 1.1rem; }
.step { counter-increment: step; }
.step::after {
  content: counter(step, decimal-leading-zero); position: absolute; right: 1.1rem; top: 0.6rem;
  font: 900 2.6rem var(--f-display); color: rgba(255, 53, 87, 0.13);
}
.step h3 { font-size: 1.05rem; padding-right: 3rem; }
.step p { margin-top: 0.5rem; font-size: 0.95rem; }

/* CTA band */
.cta-band {
  position: relative; overflow: hidden; padding: 3.5rem 2rem; text-align: center;
  border: 1px solid rgba(255, 53, 87, 0.35); border-radius: 20px;
  background:
    radial-gradient(500px 220px at 50% 120%, rgba(220, 20, 60, 0.5), transparent 70%),
    linear-gradient(180deg, var(--panel-2), #0b0506);
}
.cta-band h2 { font: 900 clamp(1.9rem, 5vw, 3.1rem)/1.1 var(--f-display); letter-spacing: 0.04em; }
.cta-band p { margin: 0.9rem auto 1.8rem; max-width: 540px; color: var(--muted); }
.cta-band .claws { position: absolute; width: 240px; right: -40px; top: -30px; opacity: 0.12; color: var(--crimson-hi); }

/* tribes / market */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.who { display: flex; align-items: center; gap: 0.55rem; color: var(--muted); font-size: 0.88rem; min-width: 0; }
.who img { width: 26px; height: 26px; border-radius: 50%; flex: none; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tribe-card .row, .listing-card .row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.tribe-card p, .listing-card p { margin-top: 0.7rem; white-space: pre-line; overflow-wrap: anywhere; }
.tribe-card .tags, .listing-card .tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.9rem; }
.tribe-card .row:last-child, .listing-card .row:last-child { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px dashed var(--line-soft); }
.price { font: 700 1rem var(--f-ui); color: var(--bone); }

.empty {
  padding: 3rem 1.5rem; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, 0.015);
}
.empty b { display: block; margin-bottom: 0.4rem; color: var(--text); font: 700 1.15rem var(--f-display); }
.empty .btn { margin-top: 1.2rem; }

/* rules */
.rules-layout { display: grid; grid-template-columns: 240px 1fr; gap: 2.5rem; align-items: start; }
.rules-toc { position: sticky; top: 92px; display: grid; gap: 0.2rem; }
.rules-toc a { padding: 0.55rem 0.8rem; border-left: 2px solid var(--line-soft); color: var(--muted); font: 600 0.85rem var(--f-ui); letter-spacing: 0.05em; text-transform: uppercase; }
.rules-toc a:hover { color: #fff; border-color: var(--crimson-hi); }
.rule-section { scroll-margin-top: 92px; }
.rule-section + .rule-section { margin-top: 1.2rem; }
.rule-section h2 { display: flex; align-items: center; gap: 0.8rem; font: 800 1.45rem var(--f-display); margin-bottom: 1rem; }
.rule-section h2 span { font: 700 0.8rem var(--f-ui); color: var(--crimson-hi); letter-spacing: 0.1em; }
.rule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.rule-list li { display: grid; grid-template-columns: 46px 1fr; gap: 0.6rem; color: var(--muted); }
.rule-list li b { font: 700 0.85rem var(--f-ui); color: var(--crimson-hi); padding-top: 0.15rem; }
@media (max-width: 820px) { .rules-layout { grid-template-columns: 1fr; } .rules-toc { position: static; display: flex; flex-wrap: wrap; } .rules-toc a { border: 1px solid var(--line-soft); border-radius: 999px; } }

/* FAQ */
.faq { display: grid; gap: 0.6rem; }
.faq details { border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(255, 255, 255, 0.02); }
.faq summary { cursor: pointer; list-style: none; padding: 1rem 1.2rem; font: 600 1rem var(--f-body); display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--crimson-hi); font: 700 1.2rem var(--f-ui); line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { padding: 0 1.2rem 1.1rem; color: var(--muted); }

/* ---------- forms ---------- */
.form { display: grid; gap: 1rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 1rem; }
label.field { display: grid; gap: 0.4rem; }
.field > span { font: 600 0.74rem var(--f-ui); color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
input, select, textarea {
  width: 100%; min-height: 46px; padding: 0.7rem 0.9rem;
  color: var(--text); background: #0a0506; border: 1px solid var(--line-soft); border-radius: 10px;
  font: 400 1rem var(--f-body);
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--crimson-hi); box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.2); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--crimson-hi) 50%), linear-gradient(135deg, var(--crimson-hi) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.2rem; }
.check { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); cursor: pointer; }
.check input { width: 20px; min-height: 20px; height: 20px; accent-color: var(--crimson); }
.form-actions { display: flex; gap: 0.7rem; justify-content: flex-end; flex-wrap: wrap; }
.hint { color: var(--dim); font-size: 0.85rem; }

/* dialog */
dialog.modal {
  width: min(620px, 100% - 24px); max-height: min(88vh, 900px); padding: 0;
  color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8);
}
dialog.modal.wide { width: min(820px, 100% - 24px); }
dialog.modal::backdrop { background: rgba(5, 2, 3, 0.72); backdrop-filter: blur(4px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.4rem; border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { font: 800 1.3rem var(--f-display); }
.modal-close { width: 40px; height: 40px; border: 1px solid var(--line-soft); background: none; color: var(--muted); border-radius: 10px; cursor: pointer; font-size: 1.3rem; }
.modal-close:hover { color: #fff; border-color: var(--crimson-hi); }
.modal-body { padding: 1.4rem; overflow: auto; }

/* thread */
.thread { display: grid; gap: 0.8rem; margin: 1rem 0; }
.msg { padding: 0.9rem 1rem; border-radius: 12px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.02); }
.msg.staff { border-color: rgba(255, 53, 87, 0.4); background: rgba(220, 20, 60, 0.08); }
.msg-head { display: flex; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.4rem; font: 600 0.8rem var(--f-ui); color: var(--muted); }
.msg p { white-space: pre-line; overflow-wrap: anywhere; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { padding: 0.8rem 1rem; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { font: 600 0.7rem var(--f-ui); color: var(--dim); letter-spacing: 0.12em; text-transform: uppercase; background: rgba(255, 255, 255, 0.02); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(220, 20, 60, 0.05); }
td .actions { display: flex; gap: 0.4rem; justify-content: flex-end; flex-wrap: wrap; }

/* admin */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; align-items: start; padding: 2.5rem 0 5rem; }
.admin-nav { position: sticky; top: 92px; display: grid; gap: 0.25rem; }
.admin-nav button {
  display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0.9rem;
  color: var(--muted); background: none; border: 1px solid transparent; border-radius: 10px;
  font: 600 0.85rem var(--f-ui); letter-spacing: 0.06em; text-transform: uppercase; text-align: left; cursor: pointer;
}
.admin-nav button:hover { color: #fff; background: rgba(255, 255, 255, 0.03); }
.admin-nav button.active { color: #fff; border-color: var(--line); background: rgba(220, 20, 60, 0.12); }
.admin-nav .count { min-width: 22px; padding: 0.15rem 0.4rem; border-radius: 999px; background: var(--crimson); color: #fff; font-size: 0.7rem; text-align: center; }
.admin-panel h2 { font: 800 1.6rem var(--f-display); }
.admin-panel .section-head { margin-bottom: 1.4rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 0.8rem; }
.editor-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.6rem; align-items: center; }
.editor-list { display: grid; gap: 0.6rem; }
@media (max-width: 860px) {
  .admin-layout { grid-template-columns: 1fr; padding-top: 1.5rem; }
  .admin-nav { position: static; display: flex; overflow-x: auto; padding-bottom: 0.4rem; }
  .admin-nav button { flex: none; }
}
@media (max-width: 520px) { .editor-row { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { margin-top: 4rem; border-top: 1px solid var(--line-soft); background: linear-gradient(180deg, transparent, rgba(61, 6, 16, 0.25)); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(2, 1fr); gap: 2rem; padding: 3.5rem 0 2.5rem; }
.footer-grid h4 { font: 600 0.75rem var(--f-ui); letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); margin-bottom: 1rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.footer-grid a { color: var(--muted); }
.footer-grid a:hover { color: #fff; }
.footer-grid p { color: var(--muted); max-width: 360px; margin-top: 0.9rem; }
.footer-legal { padding: 1.4rem 0 2rem; border-top: 1px solid var(--line-soft); color: var(--dim); font-size: 0.82rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* toast */
#toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 0.5rem; width: min(420px, 100% - 32px); pointer-events: none; }
.toast {
  padding: 0.85rem 1.1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-3); box-shadow: var(--shadow);
  font-weight: 500; animation: toast-in 0.25s ease; pointer-events: auto;
}
.toast.error { border-color: var(--crimson-hi); }
.toast.ok { border-color: rgba(62, 224, 138, 0.5); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
.skeleton { min-height: 180px; background: linear-gradient(100deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%); background-size: 300% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); border: 1px solid var(--line-soft); }
@keyframes shimmer { to { background-position: -100% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
