:root {
  --bg: #050705;
  --bg-soft: #090e0a;
  --panel: rgba(17, 22, 18, .82);
  --panel-2: rgba(27, 34, 28, .78);
  --panel-3: rgba(8, 11, 9, .88);
  --line: rgba(255, 255, 255, .09);
  --line-green: rgba(85, 255, 85, .24);
  --accent: #55ff55;
  --accent-2: #b9ffb9;
  --text: #f4faf4;
  --muted: #a7b4a7;
  --danger: #ff6b6b;
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --shadow: 0 24px 80px rgba(0, 0, 0, .46);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 170px 170px,
    linear-gradient(0deg, rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 170px 170px,
    radial-gradient(circle at 74% 8%, rgba(85,255,85,.13), transparent 360px),
    radial-gradient(circle at 22% 18%, rgba(185,255,185,.07), transparent 270px),
    linear-gradient(180deg, #070a07 0%, #050705 55%, #030403 100%);
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(85,255,85,.10), transparent 28%, transparent 72%, rgba(85,255,85,.05)),
    repeating-linear-gradient(90deg, transparent 0 88px, rgba(255,255,255,.025) 88px 156px);
  opacity: .45;
  mask-image: radial-gradient(circle at 50% 10%, black, transparent 82%);
}
a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 16px;
  z-index: 10;
  width: min(1180px, calc(100% - 32px));
  margin: 16px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(10, 12, 10, .78);
  box-shadow: 0 18px 56px rgba(0,0,0,.42);
  backdrop-filter: blur(18px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 10px;
  font-weight: 900;
}
.brand span {
  width: 18px;
  height: 18px;
  border-radius: 7px;
  background: linear-gradient(145deg, #eaffea, var(--accent) 54%, #1fbf4b);
  box-shadow: 0 0 28px rgba(85,255,85,.58), inset 0 1px 0 rgba(255,255,255,.42);
}
.navlinks { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.navlinks a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--muted);
  font-weight: 800;
}
.navlinks a.active, .navlinks a:hover {
  color: var(--text);
  border-color: var(--line-green);
  background: linear-gradient(180deg, rgba(85,255,85,.18), rgba(85,255,85,.07));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 12px 34px rgba(85,255,85,.08);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 76px;
}
.hero {
  position: relative;
  min-height: 292px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  padding: clamp(28px, 4vw, 54px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(110deg, rgba(18,22,19,.94), rgba(18,30,20,.72) 52%, rgba(8,10,8,.9)),
    radial-gradient(circle at 78% 55%, rgba(85,255,85,.22), transparent 310px);
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0 48%, rgba(255,255,255,.04) 48% 64%, transparent 64%);
}
.hero > * { position: relative; z-index: 1; }
.hero.compact { min-height: 210px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
}
h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(38px, 7vw, 78px);
  line-height: .96;
  letter-spacing: 0;
}
h2 {
  margin: 34px 0 16px;
  font-size: 24px;
}
.hero p:not(.eyebrow) {
  max-width: 650px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 650;
}
.hero-stat {
  min-width: 190px;
  padding: 24px;
  border: 1px solid var(--line-green);
  border-radius: var(--radius-lg);
  background: rgba(5, 8, 6, .58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.hero-stat span { display: block; color: var(--accent); font-size: 50px; font-weight: 950; }
.hero-stat small, .muted { color: var(--muted); }

.toolbar {
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 12px;
  margin: 28px 0 18px;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(8, 12, 9, .86);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(85,255,85,.12), inset 0 1px 0 rgba(255,255,255,.06);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th, td { padding: 16px 18px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.06); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
tbody tr { cursor: pointer; transition: background .18s ease, color .18s ease; }
tbody tr:hover { background: rgba(85,255,85,.08); }
tbody tr:last-child td { border-bottom: 0; }
.type-pill, .status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--line-green);
  border-radius: 999px;
  padding: 5px 11px;
  color: var(--accent-2);
  background: rgba(85,255,85,.09);
  font-size: 12px;
  font-weight: 900;
}

.rules-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 22px;
  align-items: start;
  margin-top: 24px;
}
.markdown-panel, .admin-panel, .block-card, .profile-head, .stats-grid > div, .person-card, .punishment-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(0,0,0,.28);
}
.markdown-panel {
  padding: clamp(24px, 4vw, 38px);
  min-height: 420px;
}
.markdown-panel h1 { font-size: 40px; line-height: 1.08; }
.markdown-panel h2 { color: var(--accent-2); }
.markdown-panel a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(85,255,85,.5); }
.markdown-panel code, #auth-command {
  display: block;
  white-space: pre-wrap;
  padding: 15px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  background: #050805;
  color: var(--accent);
}
.admin-panel {
  position: sticky;
  top: 98px;
  padding: 20px;
}
.admin-panel textarea {
  min-height: 430px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.primary {
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #8cff8c, var(--accent));
  color: #051005;
  font-weight: 950;
  padding: 13px 18px;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(85,255,85,.20), inset 0 1px 0 rgba(255,255,255,.45);
}
.primary:hover { transform: translateY(-1px); }
.primary.inline { display: inline-flex; margin-top: 18px; }
.auth-dialog {
  width: min(540px, calc(100% - 28px));
  border: 1px solid var(--line-green);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(18,24,19,.98), rgba(8,12,9,.98));
  color: var(--text);
  padding: 26px;
  box-shadow: var(--shadow);
}
.auth-dialog::backdrop { background: rgba(0,0,0,.76); backdrop-filter: blur(8px); }
.dialog-close {
  float: right;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
}

.block-card, .profile-head {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  padding: clamp(22px, 4vw, 34px);
  margin-top: 24px;
}
.skin-frame {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px solid var(--line-green);
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 20%, rgba(85,255,85,.23), transparent 190px),
    linear-gradient(180deg, rgba(85,255,85,.12), rgba(85,255,85,.03));
}
.skin-frame img { max-height: 250px; max-width: 100%; image-rendering: pixelated; }
.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0 0;
}
.details-grid div {
  padding: 14px;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 17px;
  background: rgba(0,0,0,.22);
}
.details-grid .wide { grid-column: 1 / -1; }
dt { color: var(--muted); font-size: 12px; }
dd { margin: 3px 0 0; word-break: break-word; font-weight: 750; }

.people-grid, .punishment-grid, .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.person-card, .punishment-card, .stats-grid > div {
  padding: 17px;
}
.person-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 7px 13px;
  align-items: center;
}
.person-card img {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  image-rendering: pixelated;
  grid-row: span 2;
  background: rgba(255,255,255,.06);
}
.person-card span, .punishment-card small, .stats-grid small { color: var(--muted); }
.punishment-card { display: flex; flex-direction: column; gap: 8px; }
.punishment-card span { color: var(--accent); font-weight: 900; }
.stats-grid { margin: 24px 0 8px; }
.stats-grid span { display: block; font-size: 23px; font-weight: 950; }
.status-line { color: var(--muted); margin-top: 12px; }
.status-line.online { color: var(--accent); }

@media (max-width: 780px) {
  .topbar, .hero, .block-card, .profile-head { align-items: flex-start; flex-direction: column; display: flex; }
  .topbar { top: 8px; width: min(100% - 20px, 1180px); margin-top: 8px; border-radius: 22px; }
  .toolbar, .rules-layout, .details-grid { grid-template-columns: 1fr; }
  .shell { width: min(100% - 20px, 1180px); padding-top: 22px; }
  h1 { font-size: 42px; }
  .navlinks { width: 100%; justify-content: flex-start; }
  .navlinks a { flex: 1 1 auto; justify-content: center; }
  .admin-panel { position: static; }
}
