:root {
  color-scheme: dark;
  --bg: #0b1020;
  --panel: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.10);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --amber: #fbbf24;
  --amber-2: #f59e0b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 550px at 8% -10%, rgba(56, 189, 248, 0.10), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, rgba(245, 158, 11, 0.10), transparent 55%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.70);
  backdrop-filter: blur(12px);
}
.nav {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
}
.brand svg { color: var(--amber); }
.brand span span { color: var(--amber); }
.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}
.nav-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.nav-online {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  font-size: 0.8125rem;
  font-weight: 600;
}
.nav-online:hover { background: rgba(16, 185, 129, 0.20); color: #a7f3d0; }
.nav-online strong { font-size: 0.95rem; }
.nav-online-label { display: none; }
@media (min-width: 720px) { .nav-online-label { display: inline; } }
.nav-server {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  user-select: none;
}
.nav-server-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  box-shadow: 0 0 0 3px currentColor;
}
.nav-server.is-up {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
}
.nav-server.is-up .nav-server-dot {
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22);
}
.nav-server.is-down {
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
}
.nav-server.is-down .nav-server-dot {
  background: #fb7185;
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.22);
}
.nav-server-count {
  min-width: 1.1rem;
  text-align: center;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  font-variant-numeric: tabular-nums;
}
.nav-server-label { display: none; }
@media (min-width: 900px) { .nav-server-label { display: inline; } }
.nav-drop { position: relative; }
.nav-drop > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-drop > summary::-webkit-details-marker { display: none; }
.nav-drop > summary::marker { content: ''; }
.nav-drop[open] > summary { background: rgba(255,255,255,0.10); color: #fcd34d; }
.nav-drop-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 11.5rem;
  padding: 0.35rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 16px 32px rgba(0,0,0,0.35);
  z-index: 30;
}
.nav-drop-menu a {
  display: block;
  padding: 0.5rem 0.7rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #cbd5e1;
}
.nav-drop-menu a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-drop-menu a.active { background: rgba(245,158,11,0.14); color: #fcd34d; }
.nav-account {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0.15rem 0.15rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
}
.nav-signed {
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
}
.nav-signed strong { color: #e2e8f0; font-weight: 600; }
@media (max-width: 860px) {
  .nav-signed { display: none; }
  .nav-account { padding: 0.15rem; border: 0; background: transparent; }
}
.nav-link {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #cbd5e1;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-link.active { background: rgba(255,255,255,0.10); color: #fcd34d; }
.nav-sep {
  display: none;
  width: 1px;
  height: 1.25rem;
  margin: 0 0.25rem;
  background: var(--border);
}
@media (min-width: 640px) { .nav-sep { display: block; } }

.main {
  flex: 1;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.panel {
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);
}
.panel-pad { padding: 1.5rem; }

.label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
}
.input {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.60);
  padding: 0.5rem 0.75rem;
  color: #f1f5f9;
}
.input:focus {
  outline: none;
  border-color: rgba(245, 158, 11, 0.40);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.60);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  color: inherit;
  background: transparent;
}
.btn:disabled { cursor: not-allowed; opacity: 0.5; }
a.btn { text-decoration: none; }
.btn-primary { background: #f59e0b; color: #020617; }
.btn-primary:hover:not(:disabled) { background: #fbbf24; }
.btn-current { box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.45); }
.btn-secondary { background: rgba(255,255,255,0.10); color: #f1f5f9; }
.btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,0.20); }
.btn-danger { background: #e11d48; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #f43f5e; }
.btn-ghost { background: rgba(255,255,255,0.05); color: #cbd5e1; }
.btn-ghost.active { background: #f59e0b; color: #020617; }

.stat-tile {
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem;
}
a.stat-tile-link {
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
a.stat-tile-link:hover {
  border-color: rgba(251, 191, 36, 0.40);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}
.stat-tile-go {
  margin-top: 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
}
a.stat-tile-link:hover .stat-tile-go { color: #fcd34d; }
.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}
.stat-value { font-size: 1.5rem; font-weight: 700; color: #f8fafc; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-green { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.badge-red { background: rgba(244, 63, 94, 0.15); color: #fda4af; }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.badge-sky { background: rgba(14, 165, 233, 0.15); color: #7dd3fc; }
.badge-muted { background: rgba(255,255,255,0.05); color: #94a3b8; }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .md-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .md-grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: 2fr 1fr; }
  .lg-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .lg-grid-4 { grid-template-columns: repeat(4, 1fr); }
  .lg-span-2 { grid-column: span 2; }
}

.flash {
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}
.flash-ok { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; }
.flash-err { background: rgba(244, 63, 94, 0.12); color: #fda4af; }

.muted { color: var(--muted); }
.center { text-align: center; }
.space-y > * + * { margin-top: 1.5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.w-full { width: 100%; }
.form-stack { display: flex; flex-direction: column; gap: 1rem; }
.auth-wrap {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-box { width: 100%; max-width: 28rem; }
.h1 { font-size: 1.875rem; font-weight: 700; color: #f1f5f9; margin: 0; }
.h2 { font-size: 1.125rem; font-weight: 600; color: #f1f5f9; margin: 0 0 0.75rem; }
.page-title { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
.page-title svg { color: var(--amber); }

.carousel { position: relative; height: 14rem; overflow: hidden; }
@media (min-width: 640px) { .carousel { height: 18rem; } }
.slide {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.7s;
}
.slide.active { opacity: 1; }
.slide.has-image {
  background-size: cover;
  background-position: center;
}
.slide.has-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.78), rgba(2, 6, 23, 0.12));
}
.slide > * { position: relative; z-index: 1; }
.slide-link { display: block; color: inherit; }
.slide-link:hover h2 { color: #fde68a; }
.slide h2 { margin: 0; font-size: 1.5rem; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.slide p { margin: 0.25rem 0 0; color: rgba(241,245,249,0.9); }
.grad-1 { background: linear-gradient(to bottom right, rgba(245,158,11,0.30), rgba(244,63,94,0.10)); }
.grad-2 { background: linear-gradient(to bottom right, rgba(14,165,233,0.30), rgba(99,102,241,0.10)); }
.grad-3 { background: linear-gradient(to bottom right, rgba(16,185,129,0.30), rgba(20,184,166,0.10)); }
.dots { position: absolute; bottom: 0.75rem; right: 1rem; display: flex; gap: 0.375rem; }
.dot { width: 0.5rem; height: 0.5rem; border-radius: 999px; border: 0; background: rgba(255,255,255,0.4); cursor: pointer; }
.dot.active { width: 1.25rem; background: #fbbf24; }

.tabs { display: flex; border-bottom: 1px solid var(--border); }
.tab {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.tab.active { border-bottom-color: #fbbf24; color: #fcd34d; }
.news-list { max-height: 18rem; overflow-y: auto; padding: 1rem; }
.news-item { display: block; border-radius: 0.5rem; padding: 0.75rem; }
.news-item:hover { background: rgba(255,255,255,0.05); }
.news-item h3 { margin: 0; font-size: 1rem; color: #f1f5f9; }
.line-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.table-wrap { overflow-x: auto; }
.table-wrap.compact table { min-width: 0; width: 100%; }
table { width: 100%; min-width: 720px; border-collapse: collapse; text-align: left; font-size: 0.875rem; }
th { background: rgba(255,255,255,0.05); padding: 0.75rem 1rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: #94a3b8; }
td { padding: 0.7rem 1rem; border-top: 1px solid rgba(255,255,255,0.05); }
tr:hover td { background: rgba(255,255,255,0.03); }
.rank-1 { color: #fcd34d; font-weight: 700; }
.rank-2 { color: #cbd5e1; font-weight: 700; }
.rank-3 { color: #fb923c; font-weight: 700; }
.rank-n { color: #64748b; font-weight: 700; }
.mono-amber { font-family: ui-monospace, monospace; color: #fcd34d; text-align: right; }

.podium { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 2rem; align-items: end; }
@media (min-width: 640px) { .podium { grid-template-columns: repeat(3, 1fr); } }
.podium-card { position: relative; display: flex; flex-direction: column; align-items: center; padding: 1.25rem 1rem 1rem; }
.podium-card.gold { border-color: rgba(251,191,36,0.40); background: linear-gradient(to bottom, rgba(245,158,11,0.15), transparent); }
.podium-card.silver { border-color: rgba(203,213,225,0.30); background: linear-gradient(to bottom, rgba(203,213,225,0.10), transparent); }
.podium-card.bronze { border-color: rgba(251,146,60,0.30); background: linear-gradient(to bottom, rgba(249,115,22,0.10), transparent); }
.podium-badge {
  position: absolute; top: -0.75rem; left: 50%; transform: translateX(-50%);
  width: 1.75rem; height: 1.75rem; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
}
.gold-b { background: #fbbf24; color: #020617; }
.silver-b { background: #cbd5e1; color: #0f172a; }
.bronze-b { background: #fb923c; color: #020617; }
.job-avatar {
  width: 5.5rem; height: 6.5rem;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, rgba(245,158,11,0.18), rgba(15,23,42,0.6));
  border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  text-align: center; padding: 0.25rem; margin-bottom: 0.75rem;
  overflow: hidden;
}
.job-avatar.compact { width: 4.25rem; height: 5rem; margin: 0; }
.job-avatar.preview {
  overflow: visible;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 70%, rgba(245,158,11,0.16), transparent 62%),
    rgba(15, 23, 42, 0.45);
}
.job-avatar.preview .sprite-fit { max-height: 11.5rem; }
.sprite-fit { max-width: 100%; max-height: 100%; object-fit: contain; image-rendering: pixelated; }
.item-icon { width: 24px; height: 24px; object-fit: contain; image-rendering: pixelated; flex-shrink: 0; }
.item-chip { align-items: center; }
.char-card { display: block; }
.char-card .panel { padding: 1.25rem; transition: border-color 0.15s, background 0.15s; }
.char-card:hover .panel { border-color: rgba(251,191,36,0.30); background: rgba(255,255,255,0.07); }

.row {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: 0.375rem 0;
  font-size: 0.875rem;
}
.row:last-child { border-bottom: 0; }
.row span:first-child { display: flex; align-items: center; gap: 0.5rem; color: #94a3b8; }
.stat-box { border-radius: 0.5rem; background: rgba(255,255,255,0.05); padding: 0.5rem 0.75rem; text-align: center; }
.stat-box .k { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: #94a3b8; }
.stat-box .v { font-size: 1.125rem; font-weight: 700; }

.equip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-bottom: 0.75rem; }
.equip-slot {
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  border-radius: 0.5rem; background: rgba(255,255,255,0.05); padding: 0.5rem;
  font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b;
}
.item-list { display: flex; flex-direction: column; gap: 0.25rem; max-height: 18rem; overflow-y: auto; }
button.item-chip,
button.equip-slot {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  text-align: left;
}
.item-chip {
  display: flex; justify-content: space-between; gap: 0.5rem;
  width: 100%;
  border-radius: 0.5rem; background: rgba(255,255,255,0.04); padding: 0.4rem 0.6rem;
  font-size: 0.8125rem;
}
.item-chip:hover,
.equip-slot.js-item:hover { background: rgba(255,255,255,0.08); }
.item-chip.is-open,
.equip-slot.is-open {
  background: rgba(255,255,255,0.10);
  border-color: rgba(251,191,36,0.40);
}
.item-chip-name { flex: 1; min-width: 0; }
.item-tip { position: relative; z-index: 80; }
.item-tip-backdrop {
  position: fixed; inset: 0; z-index: 99;
  background: rgba(0,0,0,0.75);
}
.item-tip-panel {
  position: fixed; z-index: 100; width: 18rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(2,6,23,0.96);
  padding: 0.75rem;
  font-size: 0.75rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.55);
}
.item-tip-head {
  display: flex; align-items: center; gap: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  padding-bottom: 0.4rem;
  margin-bottom: 0.25rem;
  font-weight: 700; color: #fcd34d;
}
.item-tip-head img { width: 20px; height: 20px; object-fit: contain; image-rendering: pixelated; flex-shrink: 0; }
.item-tip-id { font-size: 10px; color: #ffffff; margin-bottom: 0.35rem; }
.item-tip-body { max-height: 13rem; overflow-y: auto; color: #ffffff; line-height: 1.35; }
.item-tip-muted { color: #e2e8f0; }
.item-tip-gap { height: 0.4rem; }
.link-amber { color: #fcd34d; }
.link-amber:hover { color: #fde68a; }
.server-line {
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 0.5rem; background: rgba(255,255,255,0.05); padding: 0.75rem 1rem;
}
.empty { padding: 3rem 1.5rem; text-align: center; color: #94a3b8; }
.dot-online { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 999px; background: #34d399; }
.dot-offline { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 999px; background: #475569; }
.emblem { width: 1.5rem; height: 1.5rem; border-radius: 0.25rem; object-fit: contain; background: rgba(0,0,0,0.2); image-rendering: pixelated; }
.emblem.md { width: 2.5rem; height: 2.5rem; }
.emblem-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; border-radius: 0.25rem;
  background: rgba(255,255,255,0.05); font-size: 9px; color: #64748b;
}
.session-row { display: flex; align-items: center; justify-content: space-between; padding: 1rem; gap: 1rem; }
.icon-box {
  width: 2.5rem; height: 2.5rem; border-radius: 0.75rem;
  background: rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: center;
}
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 1rem; }
.links-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.avatar-lg {
  width: 3.5rem; height: 3.5rem; border-radius: 1rem;
  background: rgba(245,158,11,0.15); color: #fcd34d;
  display: flex; align-items: center; justify-content: center;
}
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre-line { white-space: pre-line; }
.alert-box { border-radius: 0.5rem; padding: 0.5rem 0.75rem; font-size: 0.875rem; text-align: center; }
.alert-err { background: rgba(244,63,94,0.10); color: #fda4af; }
.alert-ok { background: rgba(16,185,129,0.10); color: #6ee7b7; }
.inline-form { display: inline; }
.icon-btn { border-radius: 0.5rem; padding: 0.5rem; color: #fb7185; background: none; border: 0; cursor: pointer; }
.icon-btn:hover { background: rgba(244,63,94,0.10); color: #fda4af; }

.progress-track {
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: #fbbf24;
  transition: width 0.2s ease;
}
.log-box {
  margin: 0;
  max-height: 16rem;
  overflow: auto;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: #020617;
  padding: 0.75rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  color: #94a3b8;
  white-space: pre-wrap;
}

.wiki-shell { display: grid; gap: 1.25rem; }
@media (min-width: 860px) {
  .wiki-shell { grid-template-columns: 16.5rem minmax(0, 1fr); align-items: start; }
}
.wiki-side { padding: 1rem; }
.wiki-side-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.wiki-nav ul { list-style: none; margin: 0; padding: 0; }
.wiki-nav li + li { margin-top: 0.15rem; }
.wiki-nav-children { padding-left: 0.75rem; margin-top: 0.15rem; }
.wiki-nav-link {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #cbd5e1;
}
.wiki-nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.wiki-nav-link.active { background: rgba(245,158,11,0.16); color: #fcd34d; font-weight: 600; }
.wiki-nav-link.wiki-draft { opacity: 0.7; }
.wiki-page-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem;
  margin-bottom: 1rem;
}
.wiki-prose { color: #e2e8f0; line-height: 1.65; }
.wiki-prose > :first-child { margin-top: 0; }
.wiki-prose h1 { font-size: 1.75rem; margin: 0 0 0.75rem; color: #f8fafc; }
.wiki-prose h2 { font-size: 1.25rem; margin: 1.5rem 0 0.5rem; color: #fde68a; }
.wiki-prose h3 { font-size: 1.05rem; margin: 1.25rem 0 0.4rem; color: #f1f5f9; }
.wiki-prose p { margin: 0.6rem 0; }
.wiki-prose ul, .wiki-prose ol { margin: 0.5rem 0 0.75rem; padding-left: 1.25rem; }
.wiki-prose li + li { margin-top: 0.25rem; }
.wiki-prose a.wiki-link { color: #fcd34d; text-decoration: underline; text-underline-offset: 2px; }
.wiki-prose a.wiki-missing { color: #fda4af; }
.wiki-prose img {
  display: block;
  max-width: 100%;
  margin: 0.75rem 0;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}
.wiki-prose blockquote {
  margin: 0.75rem 0;
  padding: 0.6rem 0.85rem;
  border-left: 3px solid #f59e0b;
  background: rgba(245,158,11,0.08);
  color: #fde68a;
}
.wiki-prose hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.wiki-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: rgba(15,23,42,0.8);
  padding: 0.1rem 0.35rem;
  border-radius: 0.3rem;
}
.wiki-code {
  overflow: auto;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: #020617;
  color: #cbd5e1;
  font-size: 0.8125rem;
}
.wiki-toolbar { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.5rem; }
.wiki-textarea {
  min-height: 22rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  resize: vertical;
}
.wiki-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: #cbd5e1; }

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.78);
}
.footer-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.75rem 1rem 1.25rem;
}
.footer-sponsors { margin-bottom: 1.25rem; }
.sponsor-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}
.sponsor-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  min-width: 7rem;
  padding: 0.5rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
}
.sponsor-card:hover { border-color: rgba(251, 191, 36, 0.35); background: rgba(255,255,255,0.07); }
.sponsor-card img {
  max-height: 2.75rem;
  max-width: 10rem;
  object-fit: contain;
}
.footer-placeholder { margin: 0.4rem 0 0; font-size: 0.8125rem; color: #64748b; }
.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer-social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: #cbd5e1;
  font-size: 0.8125rem;
  font-weight: 600;
}
.footer-social-link:hover { background: rgba(255,255,255,0.12); color: #fff; }
.footer-tagline {
  margin: 1.25rem 0 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #cbd5e1;
  letter-spacing: 0.02em;
}
.footer-copy {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
}
.admin-link-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: start;
}
.admin-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}
@media (min-width: 900px) {
  .admin-row { grid-template-columns: 8rem minmax(0, 1.4fr) 9rem 4.5rem auto auto; align-items: center; }
}
.admin-order { max-width: 5.5rem; }
.admin-sponsor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
@media (min-width: 768px) {
  .admin-sponsor { grid-template-columns: 8.5rem minmax(0, 1fr) auto; align-items: start; }
}
.admin-sponsor-img {
  width: 100%;
  max-height: 4.5rem;
  object-fit: contain;
  border-radius: 0.5rem;
  background: rgba(0,0,0,0.25);
  padding: 0.35rem;
}
.admin-sponsor-empty {
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.admin-hub {
  display: grid;
  gap: 1rem;
}
@media (min-width: 768px) {
  .admin-hub { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .admin-hub { grid-template-columns: repeat(3, 1fr); }
}
