/* =========================================================
   VernuxSMP Regels
   ========================================================= */

:root {
  --bg: #0e0a18;
  --bg-2: #150f24;
  --card: #1b1430;
  --card-2: #241b3e;
  --line: #2f2550;
  --text: #ece8f6;
  --soft: #c9c0e0;
  --muted: #8f84ad;
  --accent: #a855f7;
  --accent-2: #c084fc;
  --accent-dark: #6b21a8;
  --bolt: #facc15;
  --ok: #22c55e;
  --err: #ef4444;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --pixel: 'Silkscreen', 'Inter', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* ---------- Knoppen & velden ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 8px;
  background: var(--card-2); border: 1px solid var(--line);
  font-weight: 600; font-size: 14.5px; text-decoration: none; color: var(--text);
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(2px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 3px 0 var(--accent-dark); }
.btn.primary:hover { background: #b46cf9; }
.btn.primary:active { box-shadow: 0 1px 0 var(--accent-dark); }
.btn.ghost { background: transparent; }
.btn.danger:hover { border-color: var(--err); color: #fca5a5; }
.btn.wide { width: 100%; }
.btn.small { padding: 6px 11px; font-size: 13px; }

input, select, textarea {
  width: 100%;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(168, 85, 247, .2); }
textarea { resize: vertical; line-height: 1.5; }
input[type="color"] { padding: 3px; width: 40px; height: 38px; cursor: pointer; flex: none; }

/* ---------- Logo ---------- */

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); }
.brand b { display: block; font-family: var(--pixel); font-weight: 700; font-size: 17px; letter-spacing: .5px; line-height: 1.1; }
.brand small { display: block; color: var(--muted); font-size: 12.5px; }
.logo { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; flex: none; }
.logo.bolt {
  display: grid; place-items: center;
  background: linear-gradient(145deg, #7e22ce, #4c1d95);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .3), 0 0 18px rgba(168, 85, 247, .35);
}
.logo.bolt svg { width: 22px; height: 22px; fill: var(--bolt); filter: drop-shadow(0 0 4px rgba(250, 204, 21, .6)); }

/* =========================================================
   Publieke pagina
   ========================================================= */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(14, 10, 24, .85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 68px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.ip-btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 13px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--line);
  font-family: var(--pixel); font-size: 13px; color: var(--soft);
}
.ip-btn:hover { border-color: var(--accent); color: var(--text); }
.ip-btn svg { width: 15px; height: 15px; color: var(--muted); }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; box-shadow: 0 3px 0 #3c45a5; }
.btn.discord:hover { background: #6b77f5; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  padding: 64px 0 46px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% -20%, rgba(168, 85, 247, .32), transparent 60%),
    var(--bg);
}
.hero::before {
  /* subtiel blokjespatroon */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, #000 20%, transparent 100%);
}
.hero .wrap { position: relative; text-align: center; }
.hero-kicker {
  display: inline-block; margin-bottom: 14px;
  font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--bolt);
}
.hero-title {
  margin: 0; font-family: var(--pixel); font-weight: 700;
  font-size: clamp(38px, 7vw, 72px); line-height: 1.05; letter-spacing: 1px;
  text-shadow: 0 4px 0 var(--accent-dark), 0 0 40px rgba(168, 85, 247, .45);
}
.hero-intro { max-width: 680px; margin: 20px auto 0; color: var(--soft); font-size: 17px; }
.hero-meta {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 12px;
  margin-top: 18px; color: var(--muted); font-size: 14px;
}
.hero-meta i { width: 4px; height: 4px; background: var(--muted); border-radius: 1px; }
.search {
  display: flex; align-items: center; gap: 10px;
  max-width: 560px; margin: 28px auto 0; padding: 0 16px;
  background: var(--card); border: 2px solid var(--line); border-radius: 12px;
  color: var(--muted);
  transition: border-color .15s;
}
.search:focus-within { border-color: var(--accent); color: var(--accent-2); }
.search input { border: 0; background: none; padding: 14px 0; box-shadow: none; font-size: 16px; }

/* Layout */
.layout { display: grid; grid-template-columns: 250px 1fr; gap: 36px; padding-top: 36px; padding-bottom: 60px; }
.toc { position: sticky; top: 92px; align-self: start; display: grid; gap: 2px; }
.toc-title { font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); padding: 0 12px 8px; }
.toc-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--soft); text-decoration: none; font-weight: 500; font-size: 15px;
  border-left: 3px solid transparent;
  transition: background .12s, color .12s;
}
.toc-link:hover { background: var(--card); color: var(--text); }
.toc-link.active { background: var(--card); color: var(--text); border-left-color: var(--c); font-weight: 700; }
.toc-icon { width: 22px; text-align: center; font-size: 16px; }
.toc-name { flex: 1; }
.toc-count { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--card-2); border-radius: 5px; padding: 0 7px; }
body.searching .toc { opacity: .45; }

/* Delen */
.sections { display: grid; gap: 26px; min-width: 0; }
.rule-section {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 26px 26px 14px;
  position: relative; overflow: hidden;
}
.rule-section::before {
  content: ''; position: absolute; left: 0; top: 0; right: 0; height: 4px;
  background: repeating-linear-gradient(90deg, var(--c) 0 16px, color-mix(in srgb, var(--c) 60%, #000) 16px 32px);
}
.sec-head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.sec-icon {
  display: grid; place-items: center; flex: none;
  width: 54px; height: 54px; border-radius: 12px; font-size: 26px;
  background: color-mix(in srgb, var(--c) 20%, transparent);
  border: 2px solid color-mix(in srgb, var(--c) 45%, transparent);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25);
}
.sec-num { font-family: var(--pixel); font-size: 12px; letter-spacing: 1px; color: color-mix(in srgb, var(--c) 70%, white); text-transform: uppercase; }
.sec-head h2 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; }
.sec-intro { color: var(--soft); margin: 10px 0 6px; }

.rules { list-style: none; margin: 10px 0 0; padding: 0; }
.rule {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 16px 8px 16px 6px;
  border-top: 1px solid var(--line);
  border-radius: 8px;
  transition: background .2s;
}
.rule:first-child { border-top: 0; }
.rule:hover { background: rgba(255, 255, 255, .02); }
.rule-num {
  flex: none; min-width: 48px; text-align: center;
  font-family: var(--pixel); font-size: 14px; font-weight: 700;
  padding: 4px 8px; border-radius: 6px;
  background: var(--bg-2); color: color-mix(in srgb, var(--c) 65%, white);
  border: 1px solid var(--line);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .3);
}
.rule-body { flex: 1; min-width: 0; padding-top: 2px; }
.rule-title {
  margin: 0 0 6px; font-size: 19px; font-weight: 800; line-height: 1.3; letter-spacing: -.2px;
  color: #fff; overflow-wrap: anywhere;
}
.rule-title + .rule-text { color: var(--soft); }
.rule-text { color: var(--text); overflow-wrap: anywhere; }
.rule-text strong { color: #fff; }
.rule-pun {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 8px; padding: 3px 10px; border-radius: 6px;
  background: rgba(239, 68, 68, .12); color: #fca5a5;
  font-size: 13px; font-weight: 600;
}
.rule-pun svg { width: 14px; height: 14px; }

/* Straffenladder: 1e > 2e > 3e overtreding */
.ladder { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; }
.ladder-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted);
}
.ladder-label svg { width: 14px; height: 14px; }
.ladder-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.step {
  --s: #facc15;
  display: inline-flex; align-items: stretch;
  border-radius: 7px;
  background: color-mix(in srgb, var(--s) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--s) 35%, transparent);
  font-size: 13px; font-weight: 600; line-height: 1.3;
}
.step-n {
  display: grid; place-items: center; padding: 3px 7px; border-radius: 6px 0 0 6px;
  font-family: var(--pixel); font-size: 11px; font-weight: 700;
  background: color-mix(in srgb, var(--s) 28%, transparent);
  color: color-mix(in srgb, var(--s) 75%, white);
}
.step-t { padding: 3px 9px; color: color-mix(in srgb, var(--s) 45%, white); }
.ladder-steps .step:not(:last-child) { position: relative; margin-right: 12px; }
.ladder-steps .step:not(:last-child)::after {
  content: ''; position: absolute; right: -11px; top: 50%;
  width: 6px; height: 6px; margin-top: -3px;
  border-top: 2px solid var(--muted); border-right: 2px solid var(--muted);
  transform: rotate(45deg);
}
.step.lv0 { --s: #facc15; }
.step.lv1 { --s: #fb923c; }
.step.lv2 { --s: #f87171; }
.step.lv3 { --s: #ef4444; }
.rule-link {
  flex: none; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 7px; color: var(--muted);
  opacity: 0; transition: opacity .15s, background .15s;
}
.rule:hover .rule-link, .rule-link:focus-visible { opacity: 1; }
.rule-link:hover { background: var(--card-2); color: var(--text); }
.rule.flash { animation: flash 2s ease-out; }
@keyframes flash {
  0%, 30% { background: rgba(250, 204, 21, .16); box-shadow: inset 3px 0 0 var(--bolt); }
  100% { background: transparent; box-shadow: inset 3px 0 0 transparent; }
}

.no-results, .empty-state { text-align: center; color: var(--muted); padding: 40px 0; margin: 0; }
.outro {
  display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center;
  padding: 26px; border-radius: 16px;
  border: 2px dashed var(--line); color: var(--soft);
}
.outro b { color: var(--text); font-size: 17px; }

.footer { border-top: 1px solid var(--line); padding: 22px 0; color: var(--muted); font-size: 13.5px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.staff-link { color: var(--muted); text-decoration: none; }
.staff-link:hover { color: var(--text); }
.edit-link { color: var(--bolt); font-weight: 700; text-decoration: none; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50;
  transform: translate(-50%, calc(100% + 40px));
  opacity: 0; visibility: hidden;
  padding: 11px 18px; border-radius: 10px;
  background: var(--ok); color: #fff; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  transition: transform .3s cubic-bezier(.2, .9, .3, 1.2), opacity .2s, visibility .3s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.toast.error { background: var(--err); }

/* =========================================================
   Login / installatie
   ========================================================= */

.auth-body {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at 20% 10%, rgba(168, 85, 247, .25), transparent 40%), var(--bg);
}
.auth-card {
  width: 100%; max-width: 400px; padding: 30px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}
.auth-card .brand { margin-bottom: 22px; }
.auth-title { margin: 0 0 8px; font-size: 28px; font-weight: 800; }
.auth-text { color: var(--muted); margin: 0 0 18px; }
.auth-form { display: grid; gap: 14px; margin-top: 14px; }
.auth-form label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.auth-form .btn { margin-top: 6px; padding: 12px; }
.auth-error { background: rgba(239, 68, 68, .15); border: 1px solid rgba(239, 68, 68, .4); color: #fca5a5; padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.auth-note { text-align: center; margin: 18px 0 0; font-size: 14px; }
.auth-note a { color: var(--muted); text-decoration: none; }

/* =========================================================
   Beheer
   ========================================================= */

.admin-bar .topbar-inner { height: 64px; }
.admin-main { padding: 30px 20px 80px; max-width: 900px; }
.admin-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.admin-title h1 { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -.5px; }
.admin-title p { margin: 2px 0 0; color: var(--muted); font-size: 14.5px; }
.tabs { display: flex; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.tab { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 18px; }
.card h2 { margin: 0 0 14px; font-size: 19px; font-weight: 800; }
.card h3 { margin: 20px 0 10px; font-size: 15px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.hint code { background: var(--bg-2); padding: 1px 6px; border-radius: 4px; color: var(--soft); }

.a-section { border-top: 4px solid var(--c); }
.a-sec-head { display: grid; grid-template-columns: 64px 1fr 40px auto; gap: 8px; align-items: center; }
.a-sec-head .icon-input { text-align: center; font-size: 20px; padding: 6px; }
.a-sec-head .title-input { font-size: 18px; font-weight: 700; }
.a-sec-tools { display: flex; gap: 4px; }
.a-sec-intro { margin-top: 10px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--muted);
}
.icon-btn:hover:not(:disabled) { background: var(--card-2); color: var(--text); }
.icon-btn.danger:hover:not(:disabled) { color: var(--err); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn svg { width: 17px; height: 17px; }

.a-rules { margin-top: 14px; display: grid; gap: 8px; }
.a-rule {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: start;
  padding: 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line);
}
.a-rule .rule-num { min-width: 0; margin-top: 4px; font-size: 12px; padding: 4px 4px; }
.a-rule-fields { display: grid; gap: 6px; min-width: 0; }
.a-rule textarea { min-height: 44px; background: var(--card); }
.a-rule .r-title, .a-add .add-title { font-weight: 700; font-size: 15.5px; background: var(--card); }
.a-add { display: grid !important; grid-template-columns: 1fr auto; }
.a-add .add-title { grid-column: 1 / -1; background: var(--bg-2); }
.a-rule .pun-input { background: var(--card); font-size: 13.5px; padding: 6px 10px; }
.a-rule-tools { display: grid; grid-template-columns: 34px; gap: 2px; }
.icon-btn.tiny { width: 28px; height: 28px; }
.icon-btn.tiny svg { width: 14px; height: 14px; }
.pen-box { padding: 8px 10px 6px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); }
.pen-title { font-size: 11.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.pen-list { display: grid; gap: 5px; }
.pen-list:empty { display: none; }
.pen-row { display: grid; grid-template-columns: 34px 1fr 28px; gap: 6px; align-items: center; }
.pen-n {
  font-family: var(--pixel); font-size: 11px; font-weight: 700; text-align: center;
  padding: 4px 0; border-radius: 5px; background: rgba(250, 204, 21, .12); color: var(--bolt);
}
.pen-row:nth-child(2) .pen-n { background: rgba(251, 146, 60, .14); color: #fdba74; }
.pen-row:nth-child(n+3) .pen-n { background: rgba(239, 68, 68, .14); color: #fca5a5; }
.pen-input { padding: 6px 10px; font-size: 13.5px; background: var(--bg-2); }
.pen-add { margin-top: 6px; padding: 4px 2px; font-size: 13px; font-weight: 600; color: var(--accent-2); }
.pen-add:hover { color: #fff; }
.a-add {
  display: flex; gap: 8px; margin-top: 10px;
}
.a-add textarea { min-height: 42px; }
.saving { position: relative; }
.saved-flash { animation: savedFlash 1s ease-out; }
@keyframes savedFlash { 0% { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); } }

.add-section { width: 100%; padding: 16px; border: 2px dashed var(--line); border-radius: 14px; color: var(--muted); font-weight: 700; }
.add-section:hover { border-color: var(--accent); color: var(--accent-2); }

.user-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); margin-bottom: 8px; }
.user-row b { flex: 1; }
.badge { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 5px; background: rgba(250, 204, 21, .15); color: var(--bolt); }
.inline-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }

/* ---------- Responsief ---------- */

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 20px; padding-top: 22px; }
  .toc {
    position: sticky; top: 68px; z-index: 10;
    display: flex; gap: 6px; overflow-x: auto;
    margin: 0 -20px; padding: 10px 20px;
    background: rgba(14, 10, 24, .92); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }
  .toc::-webkit-scrollbar { display: none; }
  .toc-title, .toc-count { display: none; }
  .toc-link { flex: none; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
  .toc-link.active { border-color: var(--c); }
  html { scroll-padding-top: 130px; }
}

@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .topbar-inner { height: 62px; }
  .brand small { display: none; }
  .ip-text { display: none; }
  .btn.discord span { display: none; }
  .btn.discord { padding: 9px 11px; }
  .hero { padding: 42px 0 32px; }
  .hero-intro { font-size: 15.5px; }
  .toc { top: 62px; margin: 0 -16px; padding: 10px 16px; }
  .rule-section { padding: 20px 16px 8px; border-radius: 14px; }
  .sec-icon { width: 44px; height: 44px; font-size: 21px; }
  .sec-head h2 { font-size: 22px; }
  .rule { gap: 12px; padding: 14px 2px; }
  .rule-num { min-width: 42px; font-size: 12px; padding: 3px 5px; }
  .rule-link { opacity: 1; width: 28px; height: 28px; }
  .ladder-steps { flex-direction: column; align-items: flex-start; gap: 5px; }
  .ladder-steps .step:not(:last-child) { margin-right: 0; }
  .ladder-steps .step:not(:last-child)::after { display: none; }
  .admin-main { padding: 22px 16px 60px; }
  .a-sec-head { grid-template-columns: 54px 1fr 40px; }
  .a-sec-tools { grid-column: 1 / -1; justify-content: flex-end; }
  .a-rule { grid-template-columns: 1fr; }
  .a-rule .rule-num { justify-self: start; }
  .a-rule-tools { grid-template-columns: repeat(3, 34px); justify-content: end; }
  .inline-form { grid-template-columns: 1fr; }
}
