/* SkyVoids — clean minimal dark, civdb-inspired */

:root {
  --bg:       #09090b;
  --surface:  #111114;
  --surface2: #18181c;
  --surface3: #212126;
  --border:   #27272a;
  --border2:  #3f3f46;
  --text:     #fafafa;
  --text-2:   #a1a1aa;
  --text-3:   #71717a;
  --accent:   #8b5cf6;
  --accent-2: #38bdf8;
  --green:    #22c55e;
  --red:      #ef4444;
  --radius:   8px;
  --radius-lg: 12px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.25);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
p { color: var(--text-2); }
h1,h2,h3,h4 { font-weight: 600; letter-spacing: -0.02em; }
img { display: block; }

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9,9,11,.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 56px;
}

/* Banner shown below nav on every page — centered logo only */
.site-banner {
  padding: 56px 20px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.site-banner.has-bg { border-bottom: 1px solid var(--border); }
.banner-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.banner-logo {
  border-radius: 18px;
  object-fit: cover;
  display: block;
}
.banner-logo-default {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
}
@media (max-width: 600px) {
  .site-banner { padding: 32px 20px; }
  .banner-logo { border-radius: 14px; }
}
.header-inner {
  display: flex;
  align-items: center;
  height: 56px;
  gap: 4px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-right: 8px;
  flex-shrink: 0;
}
.logo-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  flex-shrink: 0;
}
img.logo-icon.logo-img { background: transparent; object-fit: cover; }
.header-nav {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.header-nav::-webkit-scrollbar { display: none; }
.header-nav a {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: color .12s, background .12s;
  white-space: nowrap;
}
.header-nav a:hover { color: var(--text); background: var(--surface2); }
.header-nav a.active { color: var(--text); background: var(--surface2); }
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.header-ip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color .12s, color .12s;
  font-family: var(--mono);
}
.header-ip:hover { border-color: var(--border2); color: var(--text); }
.header-ip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.header-ip .dot.on { background: var(--green); box-shadow: 0 0 6px var(--green); }
.panel-link {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface2);
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: all .12s;
}
.panel-link:hover { color: var(--text); border-color: var(--border2); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font);
  transition: all .12s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, white); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border2); }
.btn-outline:hover { background: var(--surface2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--surface2); }
.btn-danger { background: transparent; color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--red) 12%, transparent); }
.btn-discord { background: #5865f2; color: #fff; border-color: #5865f2; }
.btn-discord:hover { background: #4752c4; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-lg { padding: 10px 20px; font-size: 14.5px; }
.btn-block { width: 100%; justify-content: center; }

/* ── Hero (home) ── */
.hero {
  padding: 80px 0 72px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent);
  pointer-events: none;
}
.hero-content { position: relative; text-align: center; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(40px, 8vw, 72px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
  margin-bottom: 16px;
}
.hero-sub {
  font-size: 16px;
  color: var(--text-2);
  max-width: 480px;
  margin: 0 auto 36px;
}
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}
.hero-stat {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-2);
}
.hero-stat .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.hero-stat .dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.hero-divider { width: 1px; height: 14px; background: var(--border2); }

/* ── Section ── */
.section { padding: 56px 0; }
.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-3);
  margin-bottom: 16px;
}
.section-title { font-size: 20px; margin-bottom: 6px; }
.section-head { margin-bottom: 28px; }
.page-title { font-size: 24px; margin-bottom: 6px; }

/* ── Articles ── */
.articles-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}
.articles-featured .feat-img {
  background: var(--surface2);
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.articles-featured .feat-img img { width: 100%; height: 100%; object-fit: cover; }
.feat-img-placeholder { font-size: 3rem; opacity: .25; }
.articles-featured .feat-body {
  background: var(--surface);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.feat-body .art-meta { font-size: 12px; color: var(--text-3); display: flex; gap: 8px; align-items: center; }
.feat-body h2 { font-size: 22px; letter-spacing: -0.03em; color: var(--text); }
.feat-body p { font-size: 13.5px; color: var(--text-2); margin: 0; }
.feat-body .read-more,
.feat-body a.read-more { font-size: 13px; color: var(--accent-2); font-weight: 500; margin-top: 4px; }
.feat-body .read-more:hover,
.feat-body a.read-more:hover { text-decoration: underline; }
a.articles-featured { text-decoration: none; color: inherit; }
a.articles-featured:hover .feat-body h2 { color: var(--accent-2); }

.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.art-card { background: var(--surface); padding: 20px; display: flex; flex-direction: column; gap: 8px; transition: background .12s; }
.art-card:hover { background: var(--surface2); }
.art-card h3 { font-size: 14px; color: var(--text); letter-spacing: -0.01em; }
.art-card h3 a { color: inherit; }
.art-card h3 a:hover { color: var(--accent-2); }
.art-card p { font-size: 12.5px; color: var(--text-2); margin: 0; flex: 1; }
.art-meta { font-size: 11.5px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.art-author { font-weight: 500; }
.art-cover { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; }
.art-cover-full { width: 100%; max-height: 400px; object-fit: cover; border-radius: var(--radius); margin: 20px 0; }
.article-single { max-width: 720px; padding: 40px 0; }
.article-single h1 { font-size: 28px; margin-bottom: 8px; }
.article-content { font-size: 14.5px; line-height: 1.75; color: var(--text-2); margin-top: 24px; }
.article-content p { margin-bottom: 16px; }
.back-link { font-size: 12.5px; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; margin-bottom: 20px; }
.back-link:hover { color: var(--text-2); }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; margin-top: auto; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-brand { font-size: 13px; font-weight: 600; color: var(--text); }
.footer-copy { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { font-size: 12.5px; color: var(--text-3); }
.footer-links a:hover { color: var(--text-2); }

/* ── Staff ── */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.tab-btn { background: none; border: none; color: var(--text-3); font-size: 13.5px; font-weight: 500; padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: var(--font); transition: color .1s; }
.tab-btn:hover { color: var(--text-2); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.rank-group { margin-bottom: 36px; }
.rank-label { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); border-left: 3px solid; padding: 2px 0 2px 10px; margin-bottom: 14px; }

/* Isolated staff cards — each sits on its own, click to open modal */
.staff-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.staff-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color .12s, transform .12s, background .12s;
  width: 260px;
  text-align: left;
  font-family: var(--font);
  color: inherit;
}
.staff-card:hover { border-color: var(--border2); background: var(--surface2); transform: translateY(-1px); }
.staff-card:active { transform: translateY(0); }
.staff-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.skin-head { width: 44px; height: 44px; border-radius: 8px; image-rendering: pixelated; background: var(--surface2); flex-shrink: 0; }
.skin-head-sm { width: 20px; height: 20px; border-radius: 3px; image-rendering: pixelated; vertical-align: middle; margin-right: 5px; }
.staff-name { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-rank-badge { font-size: 11px; font-weight: 600; }

/* Staff profile page */
.staff-profile-wrap {
  max-width: 640px;
  padding-top: 24px;
  padding-bottom: 60px;
}
.staff-profile-wrap .back-link { margin-bottom: 20px; }
.staff-profile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: var(--shadow);
}
.staff-profile-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.staff-profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  image-rendering: pixelated;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.staff-profile-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.staff-profile-rank {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.staff-profile-bio {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
  text-align: center;
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.info-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  min-width: 0;
}
.info-card-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-bottom: 4px;
}
.info-card-value {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.staff-profile-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-bottom: 8px;
}
.staff-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.staff-history-list li {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text-2);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.staff-history-list time {
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  font-size: 11.5px;
  font-family: var(--mono);
}
.rank-transition { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.staff-history-list .muted { margin-left: auto; font-size: 11.5px; }

.changes-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.changes-table thead th { padding: 8px 12px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); border-bottom: 1px solid var(--border); }
.changes-table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.changes-table tbody tr:last-child td { border-bottom: none; }
.changes-table tbody tr:hover td { background: var(--surface2); }

/* Staff-changes timeline (public staff page) */
.timeline-list {
  position: relative;
  padding-left: 28px;
  margin-top: 4px;
}
.timeline-list::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
  border-radius: 2px;
}
.timeline-day { margin-bottom: 28px; position: relative; }
.timeline-day:last-child { margin-bottom: 0; }
.timeline-date {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  position: relative;
}
.timeline-dot {
  position: absolute;
  left: -28px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
  flex-shrink: 0;
}
.timeline-date time {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.timeline-count {
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}
.timeline-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.timeline-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  transition: border-color .12s, transform .12s, background .12s;
}
.timeline-card:hover { border-color: var(--border2); background: var(--surface2); }
.timeline-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  image-rendering: pixelated;
  background: var(--surface2);
  flex-shrink: 0;
}
.timeline-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.timeline-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timeline-transition {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rank-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid;
  background: var(--surface2);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.timeline-arrow { color: var(--text-3); font-size: 13px; }
.timeline-notes {
  font-size: 12px;
  color: var(--text-3);
  font-style: italic;
}

/* ── Play ── */
.play-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; margin: 28px 0; }
.ip-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ip-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: 5px; }
.ip-value { font-family: var(--mono); font-size: 20px; font-weight: 600; color: var(--text); flex: 1; min-width: 200px; }
.server-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-top: 20px; }
.s-stat { background: var(--surface2); padding: 14px 16px; }
.s-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; }
.s-stat-value { font-size: 18px; font-weight: 700; color: var(--text); margin-top: 2px; }
.play-steps { margin-top: 36px; }
.play-steps h2 { font-size: 16px; margin-bottom: 14px; }
.play-steps ol { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.play-steps li { color: var(--text-2); font-size: 13.5px; }

/* ── Vote ── */
.vote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-top: 24px; }
.vote-card { background: var(--surface); padding: 20px; display: flex; flex-direction: column; gap: 8px; transition: background .12s; }
.vote-card:hover { background: var(--surface2); }
.vote-name { font-size: 14px; font-weight: 600; color: var(--text); }
.vote-desc { font-size: 12.5px; color: var(--text-2); }
.vote-cta { font-size: 12px; color: var(--accent-2); font-weight: 500; margin-top: auto; }

/* ── Rules ── */
.rules-tier { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 16px; }
.rules-tier-hd { padding: 10px 16px; font-size: 13px; font-weight: 600; color: #fff; }
.rules-table-wrap { overflow-x: auto; }
.rules-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rules-table th { background: var(--surface2); color: var(--text-3); padding: 8px 12px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); white-space: nowrap; }
.rules-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
.rules-table tr:last-child td { border-bottom: none; }
.rules-table td:last-child { border-right: none; }
.rule-name-cell { font-weight: 500; color: var(--text); background: var(--surface) !important; }
.rule-cell { text-align: center; font-weight: 600; font-size: 12px; }

/* ── Support ── */
.support-layout { display: grid; grid-template-columns: 1fr 280px; gap: 24px; margin-top: 28px; }
@media (max-width: 720px) { .support-layout { grid-template-columns: 1fr; } }
.faq-list { display: flex; flex-direction: column; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.faq-item { background: var(--surface); }
.faq-item summary { padding: 14px 16px; cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--text); list-style: none; display: flex; justify-content: space-between; align-items: center; transition: background .1s; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { background: var(--surface2); }
.faq-item summary::after { content: '+'; color: var(--text-3); font-size: 16px; line-height: 1; flex-shrink: 0; }
.faq-item[open] summary::after { content: '−'; }
.faq-answer { padding: 0 16px 14px; font-size: 13px; color: var(--text-2); line-height: 1.65; }
.faq-answer code { font-family: var(--mono); background: var(--surface3); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.support-aside .aside-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; position: sticky; top: 72px; }
.aside-card h3 { font-size: 14px; margin-bottom: 8px; }
.aside-card p { font-size: 13px; color: var(--text-2); margin-bottom: 16px; }

/* ── Error ── */
.error-page { padding: 80px 0; }
.error-page h1 { font-size: 28px; margin-bottom: 8px; }
.error-page p { font-size: 14px; color: var(--text-2); margin-bottom: 24px; }

/* ── Misc ── */
.empty { padding: 40px; text-align: center; color: var(--text-3); font-size: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.badge { display: inline-flex; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
code { font-family: var(--mono); }
.muted { color: var(--text-3); font-size: 12px; }
.mono { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.small { font-size: 11.5px; }

/* ─────────── ADMIN PANEL ─────────── */

.admin-login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.admin-login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px 32px; max-width: 380px; width: 100%; text-align: center; }
.admin-login-card .logo-icon { width: 40px; height: 40px; border-radius: 10px; margin: 0 auto 20px; }
.admin-login-card h1 { font-size: 18px; margin-bottom: 6px; }
.admin-login-card p { font-size: 13px; color: var(--text-2); margin-bottom: 24px; }
.admin-login-card .back-link { display: inline-block; margin-top: 16px; font-size: 12.5px; color: var(--text-3); }
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 12.5px; margin-bottom: 14px; text-align: left; }
.alert.error { background: color-mix(in srgb, var(--red) 12%, transparent); color: #fca5a5; border: 1px solid color-mix(in srgb, var(--red) 25%, transparent); }

/* admin layout — flex-direction: row is essential */
.admin-body {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  background: var(--bg);
}
.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; font-size: 13.5px; text-decoration: none; padding: 6px 8px; margin-bottom: 12px; letter-spacing: -0.02em; }
.admin-user { display: flex; align-items: center; gap: 9px; padding: 9px 10px; background: var(--surface2); border-radius: var(--radius); margin-bottom: 12px; border: 1px solid var(--border); }
.admin-user img { width: 30px; height: 30px; border-radius: 6px; image-rendering: pixelated; }
.admin-user-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.admin-user-rank { font-size: 11px; font-weight: 600; }
.admin-nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.admin-nav a { color: var(--text-3); padding: 7px 10px; border-radius: 6px; font-size: 13px; text-decoration: none; font-weight: 500; transition: all .1s; }
.admin-nav a:hover { background: var(--surface2); color: var(--text-2); }
.admin-nav a.active { background: var(--surface2); color: var(--text); }
.admin-nav-heading { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin: 12px 10px 3px; }
.logout-btn { background: none; border: none; color: var(--text-3); padding: 7px 10px; text-align: left; cursor: pointer; font-size: 13px; font-family: var(--font); border-radius: 6px; width: 100%; transition: all .1s; }
.logout-btn:hover { background: var(--surface2); color: var(--red); }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { padding: 14px 24px; border-bottom: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; gap: 12px; }
.admin-topbar h1 { font-size: 15px; font-weight: 600; margin: 0; }
.admin-content { padding: 24px; max-width: 1060px; }
.admin-page-header { display: flex; justify-content: flex-end; margin-bottom: 18px; }

/* Admin stat cards */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 20px; }
.stat-card { background: var(--surface); padding: 14px 18px; }
.stat-card-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); font-weight: 600; }
.stat-card-value { font-size: 28px; font-weight: 800; color: var(--text); margin-top: 2px; }

/* Admin panels */
.admin-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 14px; }
.admin-panel h2 { font-size: 15px; margin: 0 0 12px; }
.admin-panel > p.muted { font-size: 13px; color: var(--text-2); margin: 0 0 12px; }
.admin-panel > section + section,
.admin-panel > form + form,
.admin-panel > form + details,
.admin-panel > details + form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }

/* Collapsible panel — looks like a button when closed, expands to full panel when open */
.admin-panel.collapsible { padding: 0; overflow: hidden; }
.admin-panel.collapsible > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .1s, color .1s;
  user-select: none;
}
.admin-panel.collapsible > summary::-webkit-details-marker { display: none; }
.admin-panel.collapsible > summary::before {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--surface2);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  transition: transform .15s, background .1s;
}
.admin-panel.collapsible > summary:hover { background: var(--surface2); color: var(--text); }
.admin-panel.collapsible[open] > summary {
  color: var(--text);
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.admin-panel.collapsible[open] > summary::before { content: '×'; transform: rotate(0); background: var(--surface3); color: var(--text); }
.admin-panel.collapsible > :not(summary) { padding: 18px; }

.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.panel-header h2 { font-size: 15px; margin: 0; }
.panel-header .muted { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

/* Admin forms */
.admin-form { display: flex; flex-direction: column; gap: 14px; }
.admin-form h3 { font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.field input, .field textarea, .field select { background: var(--surface2); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 10px; font-size: 13px; font-family: var(--font); transition: border-color .1s; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field input[type="color"] { padding: 2px; height: 36px; cursor: pointer; }
.field textarea { font-family: var(--mono); font-size: 12.5px; resize: vertical; }
.checkbox { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.checkbox input { accent-color: var(--accent); width: 14px; height: 14px; }
.toggle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin: 8px 0 16px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sticky-actions {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding: 14px 18px;
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 -4px 16px rgba(0,0,0,.35);
  z-index: 5;
}

.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.admin-table thead th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); border-bottom: 1px solid var(--border); background: var(--surface2); }
.admin-table tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: var(--surface2); }
.admin-table a { color: var(--text); font-weight: 500; }
.admin-table a:hover { color: var(--accent-2); }
.admin-table input, .admin-table select { padding: 5px 8px; font-size: 12.5px; background: var(--surface2); border: 1px solid var(--border); color: var(--text); border-radius: 5px; width: 100%; font-family: var(--font); }
.row-actions { display: flex; gap: 5px; }
.inline { display: inline-block; margin: 0; }
.inline-row { display: contents; }

.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px 10px;
  margin: 10px 0 4px;
  padding: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.perm-grid .checkbox { padding: 3px 0; font-size: 12.5px; }

/* ================ Rules editor (slimline) ================ */
.rules-tier {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
  overflow: hidden;
}
.rules-tier-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(to right, color-mix(in srgb, var(--tier-color, var(--accent)) 18%, var(--surface)), var(--surface) 60%);
  border-bottom: 1px solid var(--border);
}
.rules-tier-swatch {
  width: 10px; height: 10px; border-radius: 50%;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tier-color, var(--accent)) 30%, transparent);
  flex-shrink: 0;
}
.rules-tier-name { font-size: 14px; font-weight: 700; margin: 0; color: var(--text); }
.rules-tier-meta { font-size: 11.5px; color: var(--text-3); margin-left: auto; }

.rules-tier-settings { margin-left: 6px; }
.rules-tier-settings > summary {
  list-style: none; cursor: pointer;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--text-3);
  font-size: 14px;
  user-select: none;
  transition: background .1s, color .1s;
}
.rules-tier-settings > summary::-webkit-details-marker { display: none; }
.rules-tier-settings > summary:hover { background: var(--surface2); color: var(--text); }
.rules-tier-settings[open] > summary { background: var(--surface2); color: var(--accent); }
.rules-tier-form {
  padding: 12px 14px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.rules-tier-settings { position: static; }
.rules-tier-settings[open] .rules-tier-form {
  margin: 10px -14px -10px;
  border-top: 1px solid var(--border);
}

.rules-list { padding: 6px 8px; }
.rules-empty { padding: 14px; font-size: 12.5px; color: var(--text-3); text-align: center; }

.rule-row {
  border-radius: var(--radius);
  transition: background .1s;
}
.rule-row + .rule-row { border-top: 1px solid var(--border); }
.rule-row[open] { background: var(--surface2); border: 1px solid var(--border); margin: 4px 0; }
.rule-row[open] + .rule-row { border-top: none; }

.rule-summary {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px;
  cursor: pointer; list-style: none;
  user-select: none;
  font-size: 13px;
  transition: background .1s;
}
.rule-summary::-webkit-details-marker { display: none; }
.rule-summary:hover { background: var(--surface2); border-radius: var(--radius); }
.rule-row[open] > .rule-summary {
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.rule-name { flex: 1; font-weight: 600; color: var(--text); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rule-offence-preview { display: flex; gap: 3px; flex-shrink: 0; }
.rule-offence-chip {
  width: 14px; height: 14px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: transparent;
}
.rule-chevron {
  color: var(--text-3);
  font-size: 18px;
  line-height: 1;
  transition: transform .15s;
  flex-shrink: 0;
}
.rule-row[open] .rule-chevron { transform: rotate(90deg); }

.rule-edit-form {
  padding: 14px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.offence-grid { display: grid; gap: 6px; margin: 10px 0 4px; }
.offence-cell {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 7px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px;
  align-items: center;
}
.offence-cell label {
  grid-column: 1 / -1;
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
}
.offence-cell input[type="text"],
.offence-cell input:not([type]),
.offence-cell input[name="offence_text"] {
  font-size: 12px;
  padding: 4px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  font-family: var(--font);
  min-width: 0;
}
.offence-cell input[type="color"] {
  width: 26px;
  height: 26px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
}
.offence-cell input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.offence-cell input[type="color"]::-webkit-color-swatch { border: none; border-radius: 3px; }

.inline-new-rule { padding: 0 8px 10px; }
.inline-new-rule > summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--accent-2);
  list-style: none;
  padding: 6px 10px;
  border: 1px dashed color-mix(in srgb, var(--accent-2) 30%, var(--border));
  border-radius: var(--radius);
  font-weight: 500;
  display: inline-block;
  transition: background .1s, border-color .1s;
  user-select: none;
}
.inline-new-rule > summary::-webkit-details-marker { display: none; }
.inline-new-rule > summary:hover { background: color-mix(in srgb, var(--accent-2) 6%, transparent); border-color: color-mix(in srgb, var(--accent-2) 50%, var(--border)); }
.inline-new-rule[open] > summary { margin-bottom: 10px; }
.inline-new-rule[open] { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin: 4px 8px 10px; }

.timeline { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.timeline li { padding: 8px 12px; background: var(--surface2); border-radius: var(--radius); border-left: 2px solid var(--accent); font-size: 13px; color: var(--text-2); }

.member-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.member-head .skin-head { width: 40px; height: 40px; }
.member-name { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.2; }
.member-head .mono { font-size: 11px; margin-top: 2px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .articles-featured { grid-template-columns: 1fr; }
  .articles-featured .feat-img { min-height: 180px; }
  .header-ip { display: none; }
}
@media (max-width: 768px) {
  .admin-body { flex-direction: column; }
  .admin-sidebar { width: 100%; position: static; height: auto; max-height: none; border-right: none; border-bottom: 1px solid var(--border); }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-nav-heading { width: 100%; margin: 8px 10px 0; }
  .admin-content { padding: 16px; }
  .server-stats { grid-template-columns: 1fr 1fr; }
  .sticky-actions { margin: 16px -16px -16px; }
}
/* ================ Admin dashboard ================ */
.dash-hero {
  display: flex; align-items: center; gap: 18px;
  padding: 20px 22px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.dash-hero::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--accent-2) 25%, transparent), transparent 55%);
  pointer-events: none;
}
.dash-hero-avatar {
  width: 72px; height: 72px;
  image-rendering: pixelated;
  border-radius: 12px;
  background: var(--surface2);
  border: 2px solid color-mix(in srgb, var(--accent) 50%, var(--border));
  flex-shrink: 0;
  position: relative; z-index: 1;
}
.dash-hero-text { flex: 1; min-width: 0; position: relative; z-index: 1; }
.dash-hero-greet { font-size: 22px; font-weight: 700; color: var(--text); }
.dash-hero-greet strong { color: var(--accent); }
.dash-hero-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; font-size: 13px; }
.dash-hero-rank {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: color-mix(in srgb, currentColor 10%, transparent);
}
.dash-hero-actions { display: flex; gap: 8px; position: relative; z-index: 1; }

.dash-section { margin-bottom: 24px; }
.dash-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dash-section-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 700; margin: 0; }
.dash-section-link { font-size: 12px; color: var(--text-3); text-decoration: none; }
.dash-section-link:hover { color: var(--accent); }

/* Quick actions */
.dash-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.dash-quick {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  transition: border-color .12s, transform .12s, background .12s;
}
.dash-quick:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  transform: translateY(-1px);
}
.dash-quick-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface2));
  border-radius: 10px;
  font-size: 18px;
  flex-shrink: 0;
}
.dash-quick-text { display: flex; flex-direction: column; min-width: 0; }
.dash-quick-label { font-size: 13.5px; font-weight: 600; }
.dash-quick-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

/* Stats */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.dash-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex; flex-direction: column;
  transition: border-color .12s;
}
.dash-stat:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.dash-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); font-weight: 600; }
.dash-stat-value { font-size: 28px; font-weight: 800; color: var(--text); margin-top: 4px; line-height: 1.1; }
.dash-stat-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* Split feeds */
.dash-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.dash-split .dash-section { margin-bottom: 0; }

.dash-feed {
  list-style: none; padding: 0; margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.dash-feed-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}
.dash-feed-item:last-child { border-bottom: none; }
.dash-feed-avatar {
  width: 34px; height: 34px;
  image-rendering: pixelated;
  border-radius: 6px;
  background: var(--surface2);
  flex-shrink: 0;
}
.dash-feed-main { flex: 1; min-width: 0; }
.dash-feed-title {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
a.dash-feed-title:hover { color: var(--accent); }
.dash-feed-sub {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11.5px; margin-top: 3px;
}

/* Generic pill (published/draft etc) */
.pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-3);
}
.pill-ok { color: #4ade80; border-color: color-mix(in srgb, #4ade80 40%, var(--border)); background: color-mix(in srgb, #4ade80 10%, var(--surface2)); }
.pill-mute { color: var(--text-3); }

@media (max-width: 900px) {
  .dash-split { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .container { padding: 0 14px; }
  .hero { padding: 52px 0 48px; }
  .hero-title { font-size: 38px; }
  .section { padding: 40px 0; }
  .header-nav a { padding: 4px 7px; font-size: 12.5px; }
  .server-stats { grid-template-columns: 1fr; }
  .admin-content { padding: 14px; }
  .admin-panel { padding: 14px; }
  .admin-panel.collapsible > :not(summary) { padding: 14px; }
  .panel-header { flex-direction: column; align-items: flex-start; }
  .dash-hero { flex-direction: column; align-items: flex-start; text-align: left; }
  .dash-hero-actions { width: 100%; }
  .dash-hero-greet { font-size: 19px; }
  .event-grid { grid-template-columns: 1fr; }
  .event-stream-frame { padding-bottom: 56.25%; }
}

/* ================ Events ================ */
.event-live-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border: 1px solid color-mix(in srgb, #ef4444 50%, var(--border));
  background: linear-gradient(to right, color-mix(in srgb, #ef4444 14%, var(--surface)), var(--surface));
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  font-size: 13.5px;
  transition: transform .12s, border-color .12s;
}
.event-live-banner:hover { transform: translateY(-1px); border-color: #ef4444; }
.event-live-banner .event-live-arrow { margin-left: auto; color: #ef4444; font-weight: 700; }
.event-live-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 #ef4444;
  animation: event-pulse 1.6s infinite;
  flex-shrink: 0;
  display: inline-block;
}
@keyframes event-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, #ef4444 70%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.event-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  margin-bottom: 12px;
  transition: border-color .12s, transform .12s;
}
.event-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); transform: translateY(-1px); }
.event-card.is-live { border-color: color-mix(in srgb, #ef4444 50%, var(--border)); }
.event-card.is-past { opacity: .82; }
.event-card-cover {
  background-size: cover; background-position: center;
  background-color: var(--surface2);
  min-height: 120px;
}
.event-card-cover-default {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 30%, var(--surface2)), color-mix(in srgb, var(--accent-2) 30%, var(--surface2)));
}
.event-card-body { padding: 14px 16px 14px 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.event-card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.event-card-title { font-size: 16px; font-weight: 700; margin: 2px 0; color: var(--text); }
.event-card-meta { display: flex; gap: 14px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.event-card-desc { font-size: 13px; color: var(--text-2); margin: 4px 0 0; line-height: 1.45; }

.event-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text-3);
}
.event-tag-live { color: #ef4444; border-color: color-mix(in srgb, #ef4444 50%, var(--border)); background: color-mix(in srgb, #ef4444 10%, var(--surface2)); }
.event-tag-opening { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 50%, var(--border)); background: color-mix(in srgb, var(--accent-2) 10%, var(--surface2)); }
.event-tag-past { color: var(--text-3); }

/* Single-event page */
.event-header { margin-bottom: 18px; }
.event-header-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.event-title { font-size: 30px; font-weight: 800; margin: 0 0 6px; }
.event-when { font-size: 13.5px; color: var(--text-2); margin-bottom: 8px; }
.event-description { font-size: 14px; color: var(--text-2); line-height: 1.55; max-width: 720px; }

.event-stream { margin-bottom: 18px; }
.event-stream-frame {
  position: relative; width: 100%;
  padding-bottom: 56.25%;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.event-stream-frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.event-stream-meta {
  display: flex; align-items: center; gap: 10px;
  margin-top: 8px;
  font-size: 12.5px; color: var(--text-2);
}
.event-stream-meta a { color: var(--accent-2); margin-left: auto; }
.event-stream-fallback {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; margin-bottom: 18px;
  background: color-mix(in srgb, #ef4444 8%, var(--surface));
  border: 1px solid color-mix(in srgb, #ef4444 35%, var(--border));
  border-radius: var(--radius-lg);
  font-size: 13px;
}
.event-stream-fallback a { color: var(--accent-2); margin-left: auto; }

/* Event-level reactions bar */
.event-reactions-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.event-reactions-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); font-weight: 700; margin-bottom: 8px; }

/* Reaction chips */
.reaction-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; position: relative; }
.reaction-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color .12s, background .12s, transform .08s;
  font-family: inherit;
}
.reaction-chip:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); background: var(--surface); }
.reaction-chip:active { transform: scale(.94); }
.reaction-chip.is-mine {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface2));
  color: var(--text);
}
.reaction-emoji { font-size: 14px; line-height: 1; }
.reaction-count { font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.reaction-chip.is-mine .reaction-count { color: var(--text); }

.reaction-add {
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 999px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  color: var(--text-3);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.reaction-add:hover { color: var(--accent); border-color: var(--accent); }

.reaction-picker {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  margin-top: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  gap: 4px;
  z-index: 5;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.reaction-row.show-picker .reaction-picker { display: flex; }
.reaction-pick {
  background: transparent;
  border: none;
  font-size: 18px;
  width: 30px; height: 30px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .1s;
}
.reaction-pick:hover { background: var(--surface2); }

/* Live commentary feed */
.event-commentary { margin-top: 4px; }
.event-commentary-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.event-commentary-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 700; margin: 0; }
.event-commentary-status { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); }

.commentary-post-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.commentary-post-box textarea {
  width: 100%;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  font: inherit;
  resize: vertical;
}
.commentary-post-box textarea:focus { outline: none; border-color: var(--accent); }
.commentary-post-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; justify-content: flex-end; }

.commentary-list { display: flex; flex-direction: column; gap: 10px; }

.commentary-item {
  display: flex; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  position: relative;
  transition: border-color .15s, background .15s;
}
.commentary-item.is-pinned {
  border-color: color-mix(in srgb, var(--accent-2) 50%, var(--border));
  background: color-mix(in srgb, var(--accent-2) 6%, var(--surface));
}
.commentary-item.is-new {
  animation: commentary-flash 1.2s ease-out;
}
@keyframes commentary-flash {
  0% { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
  100% { }
}
.commentary-avatar {
  width: 36px; height: 36px;
  image-rendering: pixelated;
  border-radius: 6px;
  background: var(--surface2);
  flex-shrink: 0;
}
.commentary-body { flex: 1; min-width: 0; }
.commentary-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-3);
  margin-bottom: 4px;
}
.commentary-author { color: var(--text); font-weight: 600; font-size: 13px; }
.commentary-rank {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 1px 7px; border: 1px solid; border-radius: 999px;
  background: color-mix(in srgb, currentColor 8%, transparent);
}
.commentary-pin { font-size: 11px; color: var(--accent-2); }
.commentary-time { color: var(--text-3); margin-left: auto; }
.commentary-text {
  font-size: 13.5px; color: var(--text);
  white-space: pre-wrap; word-wrap: break-word;
  margin-bottom: 6px;
  line-height: 1.45;
}
.reaction-row-sm .reaction-chip { padding: 2px 8px; font-size: 12px; }
.reaction-row-sm .reaction-emoji { font-size: 13px; }

/* Admin event list */
.pill-live { color: #ef4444; border-color: color-mix(in srgb, #ef4444 40%, var(--border)); background: color-mix(in srgb, #ef4444 12%, var(--surface2)); }

.admin-commentary-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.admin-commentary-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.admin-commentary-item.is-pinned { border-color: color-mix(in srgb, var(--accent-2) 50%, var(--border)); }
.admin-commentary-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.admin-commentary-body { font-size: 13px; color: var(--text); white-space: pre-wrap; margin-bottom: 6px; }
.admin-commentary-actions { display: flex; gap: 6px; }

@media (max-width: 700px) {
  .event-card { grid-template-columns: 1fr; }
  .event-card-cover { min-height: 140px; }
  .event-card-body { padding: 14px 16px; }
  .event-title { font-size: 24px; }
}

/* ================ Stats page ================ */
.key-reveal { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 8px; }
.key-reveal input { font-family: var(--mono); font-size: 12.5px; }

.stats-scope-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.stats-scope-avatar { width: 48px; height: 48px; image-rendering: pixelated; border-radius: 8px; background: var(--surface2); }
.stats-scope-name { font-size: 17px; font-weight: 700; color: var(--text); }
.stats-scope-head > a { margin-left: auto; }

.range-picker {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-top: 4px;
}
.range-presets { display: flex; gap: 4px; flex-wrap: wrap; }
.range-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
  font-family: inherit;
}
.range-btn:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.range-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.range-custom { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.range-custom input[type="date"] {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
}
.range-custom input[type="date"]:focus { outline: none; border-color: var(--accent); }

.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stats-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex; flex-direction: column;
}
.stats-card-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); font-weight: 600; }
.stats-card-value { font-size: 26px; font-weight: 800; color: var(--text); margin-top: 4px; line-height: 1.1; }
.stats-card-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.stats-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

/* Heatmap */
.heatmap-wrap { display: flex; flex-direction: column; gap: 8px; }
.heatmap {
  --heatmap-gap: 3px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  grid-template-rows: 14px 1fr;
  column-gap: 6px;
  row-gap: 4px;
  overflow: hidden;
}
.heatmap-month-row {
  grid-column: 2 / 3; grid-row: 1 / 2;
  display: grid;
  grid-template-columns: repeat(53, 1fr);
  font-size: 10px;
  color: var(--text-3);
}
.heatmap-month { white-space: nowrap; }
.heatmap-day-row {
  grid-column: 1 / 2; grid-row: 2 / 3;
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  gap: var(--heatmap-gap);
  align-items: center;
  font-size: 10px;
  color: var(--text-3);
  padding-top: 0;
}
.heatmap-grid {
  grid-column: 2 / 3; grid-row: 2 / 3;
  display: grid;
  gap: var(--heatmap-gap);
  min-width: 0;
}
.heatmap-col {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  gap: var(--heatmap-gap);
}
.heatmap-cell {
  width: 100%; aspect-ratio: 1;
  min-width: 0;
  border-radius: 2px;
  background: var(--surface2);
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.heatmap-l0 { background: var(--surface2); }
.heatmap-l1 { background: #c4b5fd; border-color: transparent; }
.heatmap-l2 { background: #a7f3d0; border-color: transparent; }
.heatmap-l3 { background: #6ee7b7; border-color: transparent; }
.heatmap-l4 { background: #4ade80; border-color: transparent; }

.heatmap-legend { display: flex; align-items: center; gap: 4px; }
.heatmap-legend .heatmap-cell { width: 11px; height: 11px; aspect-ratio: 1; flex-shrink: 0; }

/* Top commands list */
.top-commands { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.top-commands li { display: grid; grid-template-columns: 140px 1fr 60px; gap: 10px; align-items: center; }
.top-commands .cmd-name { font-family: var(--mono); font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-commands .cmd-bar { background: var(--surface2); border-radius: 999px; height: 8px; overflow: hidden; }
.top-commands .cmd-bar-fill { height: 100%; background: linear-gradient(to right, var(--accent), var(--accent-2)); }
.top-commands .cmd-count { text-align: right; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* Staff leaderboard */
.staff-leaderboard { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; }
.staff-leaderboard li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.staff-leaderboard li:last-child { border-bottom: none; }
.lb-avatar { width: 28px; height: 28px; image-rendering: pixelated; border-radius: 5px; background: var(--surface2); flex-shrink: 0; }
.lb-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.lb-name a { color: var(--text); text-decoration: none; }
.lb-name a:hover { color: var(--accent); }
.lb-value { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text-2); }

/* Recent commands */
.recent-commands { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; max-height: 460px; overflow-y: auto; }
.recent-commands li {
  display: grid;
  grid-template-columns: 110px 90px 120px 1fr;
  gap: 10px;
  padding: 5px 0;
  font-size: 12.5px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.recent-commands li:last-child { border-bottom: none; }
.rc-server { color: var(--accent-2); }
.rc-user { color: var(--text); font-weight: 600; }
.rc-cmd { font-family: var(--mono); font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 800px) {
  .stats-split { grid-template-columns: 1fr; }
  .key-reveal { grid-template-columns: 1fr; }
  .recent-commands li { grid-template-columns: 1fr; gap: 2px; padding: 8px 0; }
}

/* Stats refinements */
.stats-summary {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stats-card {
  padding: 12px 14px;
}
.stats-card-value {
  font-size: 23px;
}
.stats-activity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.stats-split .admin-panel canvas {
  min-height: 180px;
  max-height: 220px;
}
.staff-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.staff-stat-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  color: var(--text);
  text-decoration: none;
  transition: border-color .12s, background .12s, transform .12s;
}
.staff-stat-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface2));
  transform: translateY(-1px);
}
.staff-stat-avatar {
  width: 42px;
  height: 42px;
  image-rendering: pixelated;
  border-radius: 6px;
  background: var(--surface3);
  grid-row: span 2;
}
.staff-stat-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.staff-stat-name {
  font-size: 13.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.staff-stat-metrics {
  grid-column: 2;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text-3);
  font-size: 11.5px;
}
.staff-stat-metrics strong {
  color: var(--text-2);
  font-weight: 700;
}
.heatmap-panel {
  overflow: hidden;
}
.heatmap-wrap {
  gap: 6px;
}
.heatmap {
  --heatmap-gap: 2px;
  grid-template-columns: 18px minmax(0, 1fr);
  grid-template-rows: 12px 1fr;
  gap: 3px;
}
.heatmap-month-row,
.heatmap-day-row {
  font-size: 9px;
}
.heatmap-day-row {
  padding-top: 0;
}
.heatmap-grid {
  min-width: 0;
}
.heatmap-cell {
  min-width: 0;
  max-width: 10px;
}
.heatmap-legend .heatmap-cell {
  width: 9px;
  height: 9px;
}
.command-filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(150px, .8fr) minmax(150px, .8fr) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
}
.command-filter-form .field {
  margin: 0;
}
.command-filter-form input,
.command-filter-form select {
  min-height: 36px;
}
.command-table-wrap {
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.command-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.command-table th,
.command-table td {
  padding: 9px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  text-align: left;
  vertical-align: top;
}
.command-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface2);
  color: var(--text-3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.command-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.command-user {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}
.chat-message-text {
  display: block;
  color: var(--text-2);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@media (max-width: 800px) {
  .stats-summary,
  .stats-activity-grid {
    grid-template-columns: 1fr;
  }
  .command-filter-form {
    grid-template-columns: 1fr;
  }
}

/* Admin stats dashboard refresh */
.stats-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stats-hero {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.stats-hero-copy {
  min-width: 0;
}
.stats-hero .eyebrow {
  display: block;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.stats-hero h2 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.15;
}
.stats-hero p {
  margin: 5px 0 0;
  color: var(--text-3);
  font-size: 13px;
}
.stats-back-link {
  justify-self: end;
  grid-column: 2;
}
.stats-scope-head {
  margin: 0;
}
.stats-scope-head h2 {
  margin-bottom: 6px;
}
.range-picker {
  justify-content: flex-end;
  padding: 0;
}
.range-custom {
  margin-left: 0;
}
.range-btn {
  border-radius: 7px;
}
.stats-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
.stats-card {
  border-radius: var(--radius);
  padding: 12px;
  min-width: 0;
}
.stats-card-value {
  font-size: 21px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats-card-label {
  letter-spacing: .05em;
}
.stats-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.stats-board-wide {
  grid-column: 1 / -1;
  grid-row: auto;
}
.chart-panel {
  min-width: 0;
}
.chart-frame {
  height: 185px;
  margin-top: 8px;
}
.chart-frame canvas {
  width: 100% !important;
  height: 100% !important;
}
.heatmap-panel .panel-header {
  margin-bottom: 8px;
}
.heatmap {
  --heatmap-gap: 3px;
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-rows: 14px 1fr;
  gap: 4px;
  padding-bottom: 2px;
}
.heatmap-grid {
  min-width: 0;
}
.heatmap-cell {
  min-width: 8px;
  max-width: none;
  border-radius: 999px;
}
.heatmap-cell.is-empty {
  opacity: 0;
}
.heatmap-month-row {
  grid-column: 2;
}
.heatmap-day-row {
  padding-top: 0;
}
.heatmap-l0 {
  background: color-mix(in srgb, var(--surface2) 86%, white);
}
.heatmap-l1 { background: #c4b5fd; }
.heatmap-l2 { background: #a7f3d0; }
.heatmap-l3 { background: #6ee7b7; }
.heatmap-l4 { background: #4ade80; }
.staff-stat-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.staff-stat-card {
  grid-template-columns: 38px 1fr;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface2) 72%, transparent);
  padding: 10px 12px;
}
.staff-stat-avatar {
  width: 38px;
  height: 38px;
}
.staff-stat-main {
  justify-content: space-between;
}
.staff-stat-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}
.staff-stat-metrics span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-command-panels {
  margin-bottom: 0;
}
.top-commands li {
  grid-template-columns: minmax(90px, 130px) minmax(90px, 1fr) 54px;
}
.log-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 14px;
}
.log-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
.log-title span {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
}
.command-table-wrap {
  max-height: 440px;
  background: color-mix(in srgb, var(--surface2) 54%, transparent);
}
.command-table th,
.command-table td {
  padding: 8px 9px;
}
.rc-cmd {
  display: block;
  max-width: 34vw;
}
.chat-message-text {
  max-width: 34vw;
}

@media (max-width: 1180px) {
  .stats-hero {
    grid-template-columns: 1fr;
  }
  .stats-back-link {
    grid-column: 1;
    justify-self: start;
  }
  .range-picker {
    justify-content: flex-start;
  }
  .stats-summary {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  }
  .stats-board {
    grid-template-columns: 1fr;
  }
  .stats-board-wide {
    grid-row: auto;
  }
}

@media (max-width: 900px) {
  .log-grid,
  .stats-split {
    grid-template-columns: 1fr;
  }
  .command-filter-form {
    grid-template-columns: 1fr;
  }
  .staff-stat-metrics {
    grid-template-columns: 1fr;
  }
  .rc-cmd,
  .chat-message-text {
    max-width: none;
  }
}

@media (max-width: 620px) {
  .stats-hero {
    padding: 12px;
  }
  .range-custom {
    width: 100%;
    align-items: stretch;
    flex-wrap: wrap;
  }
  .range-custom input[type="date"] {
    flex: 1 1 125px;
  }
  .stats-card-value {
    font-size: 19px;
  }
}

/* CivInfo-style playtime heatmap */
.civ-heatmap-wrap {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: end;
  overflow: hidden;
}
.civ-heatmap-year {
  color: var(--text-2);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  align-self: center;
  letter-spacing: .02em;
}
.civ-heatmap-main {
  min-width: 0;
}
.civ-heatmap-month-row {
  display: grid;
  height: 16px;
  margin-left: 36px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
}
.civ-heatmap-month {
  justify-self: start;
  white-space: nowrap;
}
.civ-heatmap-body {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
}
.civ-heatmap-day-row {
  display: grid;
  grid-template-rows: repeat(7, 12px);
  color: var(--text-2);
  font-size: 12px;
  line-height: 12px;
  text-align: right;
}
.civ-heatmap-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 12px);
  gap: 0;
  min-width: 0;
  border: 1px solid #4a4a4a;
  background: #0b0b0c;
}
.civ-heatmap-cell {
  min-width: 0;
  width: 100%;
  height: 12px;
  background: #050606;
  border-right: 1px solid #18191b;
  border-bottom: 1px solid #18191b;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.015);
}
.civ-heatmap-cell.is-empty {
  background: #050606;
}
.civ-heatmap-cell.is-month-start {
  box-shadow: inset 2px 0 0 rgba(160,160,160,.55), inset 0 0 0 1px rgba(255,255,255,.015);
}
.civ-heatmap-scale {
  display: grid;
  grid-template-columns: auto 24px;
  grid-template-rows: auto 1fr auto;
  gap: 4px 8px;
  align-items: center;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
}
.civ-heatmap-scale span:first-child {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
}
.civ-heatmap-scale span:last-child {
  grid-column: 1;
  grid-row: 3;
  align-self: end;
}
.civ-heatmap-gradient {
  grid-column: 2;
  grid-row: 1 / 4;
  width: 24px;
  height: 112px;
  border-radius: 4px;
  background: linear-gradient(to top, #6d3bb7 0%, #3f4f9f 24%, #2e7fb0 43%, #27a598 63%, #49c25d 81%, #b8e83d 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.heatmap-wrap,
.heatmap,
.heatmap-month-row,
.heatmap-day-row,
.heatmap-grid,
.heatmap-legend {
  display: none;
}

@media (max-width: 900px) {
  .civ-heatmap-wrap {
    grid-template-columns: 26px minmax(0, 1fr);
  }
  .civ-heatmap-scale {
    display: none;
  }
  .civ-heatmap-month-row {
    font-size: 10px;
  }
  .civ-heatmap-day-row,
  .civ-heatmap-grid {
    grid-template-rows: repeat(7, 12px);
  }
  .civ-heatmap-day-row {
    font-size: 10px;
    line-height: 12px;
  }
  .civ-heatmap-cell {
    height: 12px;
  }
}

/* Admin shell redesign */
.admin-body {
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 10%, transparent), transparent 320px),
    var(--bg);
  color: var(--text);
}
.admin-sidebar {
  width: 276px;
  padding: 14px;
  gap: 14px;
  background: color-mix(in srgb, var(--surface) 88%, #050608);
  border-right: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  box-shadow: 10px 0 30px rgba(0,0,0,.12);
}
.admin-sidebar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}
.admin-brand {
  flex: 1;
  margin: 0;
  padding: 0;
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
}
.admin-brand .logo-icon,
.admin-brand .logo-img {
  width: 28px !important;
  height: 28px !important;
  border-radius: 7px !important;
  flex-shrink: 0;
}
.admin-brand span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-site-link {
  color: var(--text-3);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface2) 68%, transparent);
  border-radius: 7px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.admin-site-link:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}
.admin-nav {
  gap: 14px;
  overflow: visible;
}
.admin-nav-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-nav-heading {
  margin: 0;
  padding: 0 7px;
  color: color-mix(in srgb, var(--text-3) 82%, transparent);
  font-size: 10px;
  letter-spacing: .12em;
}
.admin-nav-links {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.admin-nav a,
.admin-nav-link {
  position: relative;
  display: grid;
  gap: 1px;
  padding: 8px 10px 8px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--text-2);
  text-decoration: none;
  transition: background .12s, border-color .12s, color .12s, transform .12s;
}
.admin-nav a:hover,
.admin-nav-link:hover {
  background: color-mix(in srgb, var(--surface2) 72%, transparent);
  color: var(--text);
  border-color: color-mix(in srgb, var(--border) 70%, transparent);
}
.admin-nav a.active,
.admin-nav-link.active {
  background: color-mix(in srgb, var(--accent) 13%, var(--surface2));
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  color: var(--text);
}
.admin-nav a.active::before,
.admin-nav-link.active::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 99px;
  background: var(--accent);
}
.admin-nav-link-main {
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
}
.admin-nav-link-meta {
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.25;
}
.admin-nav-link.active .admin-nav-link-meta {
  color: color-mix(in srgb, var(--text-2) 84%, var(--accent));
}
.admin-account {
  margin-top: auto;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: color-mix(in srgb, var(--surface2) 72%, transparent);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.admin-account img {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  image-rendering: pixelated;
  background: var(--surface3);
}
.admin-account-copy {
  min-width: 0;
}
.admin-account .admin-user-name,
.admin-account .admin-user-rank {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-account form {
  grid-column: 1 / -1;
  margin: 0;
}
.logout-btn {
  justify-content: center;
  text-align: center;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  padding: 7px 10px;
  border-radius: 7px;
  font-weight: 700;
}
.admin-main {
  min-height: 100vh;
}
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  backdrop-filter: blur(12px);
}
.admin-topbar-kicker {
  display: block;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.admin-topbar h1 {
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
}
.admin-content {
  width: 100%;
  max-width: 1380px;
  padding: 20px 28px 34px;
}
.admin-panel,
.stats-hero,
.stats-card,
.command-table-wrap,
.admin-table,
.cards-grid {
  border-color: color-mix(in srgb, var(--border) 76%, transparent);
}
.admin-panel {
  border-radius: 10px;
  padding: 16px;
}
.admin-panel h2,
.panel-header h2 {
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 960px) {
  .admin-body {
    flex-direction: column;
  }
  .admin-sidebar {
    position: static;
    width: 100%;
    height: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px;
  }
  .admin-nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(170px, 1fr);
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .admin-nav-section {
    min-width: 170px;
  }
  .admin-account {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }
  .admin-account form {
    grid-column: auto;
  }
  .logout-btn {
    width: auto;
    white-space: nowrap;
  }
  .admin-topbar {
    position: static;
    padding: 14px 16px;
  }
  .admin-content {
    padding: 16px;
  }
}

@media (max-width: 620px) {
  .admin-sidebar-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .admin-site-link {
    width: 100%;
    text-align: center;
  }
  .admin-nav {
    grid-auto-columns: minmax(150px, 78vw);
  }
  .admin-account {
    grid-template-columns: 34px minmax(0, 1fr);
  }
  .admin-account form {
    grid-column: 1 / -1;
  }
}

/* Admin nav simplification */
.admin-body {
  background: var(--bg);
}
.admin-sidebar {
  width: 248px;
  padding: 14px 12px;
  gap: 12px;
  overflow: visible;
  background: var(--surface);
  box-shadow: none;
}
.admin-sidebar-head {
  min-height: 34px;
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--border);
}
.admin-brand {
  font-size: 14px;
}
.admin-brand .logo-icon,
.admin-brand .logo-img {
  width: 24px !important;
  height: 24px !important;
}
.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: visible;
}
.admin-nav-link,
.admin-nav-dropdown > summary,
.admin-nav-submenu a {
  display: flex;
  align-items: center;
  min-height: 34px;
  border-radius: 7px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
}
.admin-nav-link {
  padding: 7px 10px;
}
.admin-nav-dropdown {
  border: 0;
  padding: 0;
  margin: 0;
}
.admin-nav-dropdown > summary {
  cursor: pointer;
  list-style: none;
  padding: 7px 10px;
  justify-content: space-between;
  user-select: none;
}
.admin-nav-dropdown > summary::-webkit-details-marker {
  display: none;
}
.admin-nav-dropdown > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: .6;
  transition: transform .12s;
  margin-left: 10px;
}
.admin-nav-dropdown[open] > summary::after {
  transform: rotate(225deg);
}
.admin-nav-link:hover,
.admin-nav-dropdown > summary:hover,
.admin-nav-submenu a:hover {
  color: var(--text);
  background: var(--surface2);
  border-color: var(--border);
}
.admin-nav-link.active,
.admin-nav-submenu a.active {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface2));
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
}
.admin-nav a.active::before,
.admin-nav-link.active::before {
  display: none;
}
.admin-nav-submenu {
  display: grid;
  gap: 3px;
  margin: 4px 0 2px;
  padding-left: 10px;
}
.admin-nav-submenu a {
  min-height: 30px;
  padding: 6px 10px;
  color: var(--text-3);
  font-weight: 650;
  font-size: 12.5px;
}
.admin-nav-link-main,
.admin-nav-link-meta,
.admin-nav-section,
.admin-nav-heading,
.admin-nav-links {
  display: contents;
}
.admin-account {
  grid-template-columns: 36px minmax(0, 1fr) 32px;
  gap: 9px;
  padding: 9px;
  border-radius: 9px;
}
.admin-account img {
  width: 36px;
  height: 36px;
}
.admin-profile-button {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: transparent;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}
.admin-profile-button::before,
.admin-profile-button::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-2);
}
.admin-profile-button::before {
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.admin-profile-button::after {
  bottom: 6px;
  width: 16px;
  height: 8px;
  border-radius: 9px 9px 3px 3px;
}
.admin-profile-button:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: var(--surface2);
}
.admin-profile-button:hover::before,
.admin-profile-button:hover::after {
  background: var(--text);
}
.admin-account form {
  grid-column: 1 / -1;
}
.logout-btn {
  width: 100%;
}
.admin-topbar {
  display: flex;
  justify-content: space-between;
  padding: 13px 24px;
}
.admin-topbar-kicker {
  display: none;
}
.admin-topbar h1 {
  font-size: 18px;
}
.admin-site-link {
  color: var(--text-3);
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 7px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 960px) {
  .admin-sidebar {
    overflow: visible;
  }
  .admin-nav {
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding-bottom: 0;
  }
  .admin-account {
    grid-template-columns: 36px minmax(0, 1fr) 32px;
  }
  .admin-account form {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .admin-sidebar-head {
    flex-direction: row;
    align-items: center;
  }
  .admin-site-link {
    width: auto;
  }
}
