/* Royal dashboard — black and white, no JavaScript required.
   Inline styles are blocked by the Content-Security-Policy, so every visual
   lives here. */

:root {
  --bg: #000;
  --panel: #0a0a0a;
  --panel-2: #111;
  --line: #1c1c1c;
  --line-2: #2a2a2a;
  --text: #f5f5f5;
  --muted: #8a8a8a;
  --gold: #fff;
  --gold-soft: rgba(255, 255, 255, .1);
  --green: #fff;
  --red: #b5b5b5;
  --blurple: #fff;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .55);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: .05em .4em; font-size: .9em; }

/* ------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, .82); border-bottom: 1px solid var(--line);
}
.topbar .inner { max-width: 1200px; margin: 0 auto; padding: .7rem 1.2rem; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 700; font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand img { width: auto; height: 16px; border-radius: 0; }
.brand .crown { color: var(--gold); }
.nav { display: flex; gap: 1.2rem; margin-left: auto; align-items: center; }
.nav a { color: var(--muted); font-weight: 500; }
.nav a:hover, .nav a.on { color: var(--text); text-decoration: none; }
.who { display: flex; align-items: center; gap: .5rem; }
.who img { width: 28px; height: 28px; border-radius: 50%; }
.who form { margin: 0; }

/* -------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: .45rem; padding: .62rem 1.1rem;
  border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--text); font: inherit; font-weight: 600; cursor: pointer; transition: .15s;
}
.btn:hover { border-color: #555; text-decoration: none; transform: translateY(-1px); }
.btn.gold, .btn.primary { background: #fff; border-color: #fff; color: #000; }
.btn.gold:hover { filter: brightness(1.08); }
.btn.primary:hover { background: #ddd; border-color: #ddd; color: #000; }
.btn.blurple { background: #fff; border-color: #fff; color: #000; }
.btn.danger { background: transparent; border-color: #777; color: var(--text); }
.btn.small { padding: .38rem .75rem; font-size: .85rem; }
.btn.link { background: none; border: none; color: var(--muted); padding: 0; }
.btn.link:hover { color: var(--text); transform: none; }

/* --------------------------------------------------------------- layout */
main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 2rem 1.2rem 3rem; }
.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.footer .inner { max-width: 1200px; margin: 0 auto; padding: 1.4rem 1.2rem; display: flex; gap: 1.2rem; flex-wrap: wrap; }
.footer a { color: var(--muted); }
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.card.hover { transition: .15s; }
.card.hover:hover { border-color: #555; transform: translateY(-2px); box-shadow: var(--shadow); }
.card h3 { display: flex; align-items: center; gap: .5rem; }

/* ----------------------------------------------------------------- hero */
.hero { text-align: center; padding: 3.5rem 0 2.5rem; }
.hero .avatar { width: 112px; height: 112px; border-radius: 50%; margin: 0 auto 1.4rem;
  box-shadow: 0 0 0 6px var(--gold-soft), var(--shadow); }
.hero .wordmark { width: min(440px, 78%); height: auto; margin: 0 auto 2rem; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 620px; margin: 0 auto 1.8rem; }
.hero .actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.gold-text { color: var(--text); }

.stat { text-align: center; }
.stat b { display: block; font-size: 1.9rem; color: var(--text); }
.stat span { color: var(--muted); font-size: .9rem; }

/* -------------------------------------------------------------- servers */
.server { display: flex; align-items: center; gap: .9rem; }
.server .icon, .server .initials {
  width: 52px; height: 52px; border-radius: 14px; flex: none; object-fit: cover;
}
.server .initials { display: grid; place-items: center; background: var(--panel-2);
  border: 1px solid var(--line); font-weight: 700; color: var(--gold); }
.server .meta { flex: 1; min-width: 0; }
.server .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------- guild layout */
.shell { display: grid; grid-template-columns: 250px 1fr; gap: 1.6rem; align-items: start; }
.sidebar { position: sticky; top: 78px; }
.sidebar details { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; }
.sidebar summary { list-style: none; cursor: pointer; padding: .5rem .6rem; font-weight: 700;
  display: flex; align-items: center; gap: .6rem; }
.sidebar summary::-webkit-details-marker { display: none; }
.sidebar summary img, .sidebar summary .initials { width: 34px; height: 34px; border-radius: 10px; }
.sidebar summary .initials { display: grid; place-items: center; background: var(--panel-2); color: var(--gold); font-size: .8rem; }
.sidebar .group { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; padding: .9rem .6rem .3rem; }
.sidebar a.item { display: flex; align-items: center; gap: .55rem; padding: .45rem .6rem; border-radius: 9px;
  color: var(--muted); font-weight: 500; }
.sidebar a.item:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.sidebar a.item.on { background: var(--gold-soft); color: var(--gold); }
.sidebar .dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: #3a3a3a; }
.sidebar .dot.on { background: var(--green); }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 0; }

/* ---------------------------------------------------------------- forms */
.form-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.row { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(220px, 1.3fr); gap: 1rem 1.6rem;
  padding: 1.05rem 1.3rem; border-bottom: 1px solid var(--line); align-items: center; }
.row:last-of-type { border-bottom: none; }
.row label.name { font-weight: 600; display: block; }
.row .help { color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.row .err { color: var(--text); font-size: .85rem; margin-top: .35rem; }
.row.bad { background: rgba(255, 255, 255, .04); }
input[type=text], input[type=number], input[type=url], select, textarea {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: .6rem .75rem; font: inherit; transition: .15s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.form-actions { display: flex; justify-content: flex-end; gap: .7rem; padding: 1rem 1.3rem;
  border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 var(--radius) var(--radius); }

/* Toggle switch built from a checkbox. */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #262626; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: #fff; }
.switch input:checked + span::before { transform: translateX(20px); background: #000; }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--gold-soft); }

/* -------------------------------------------------------------- notices */
.toast { display: flex; gap: .6rem; align-items: center; padding: .8rem 1rem; border-radius: 12px;
  margin-bottom: 1.2rem; font-weight: 500; }
.toast.ok { background: var(--panel); border: 1px solid var(--line-2, #2a2a2a); color: var(--text); }
.toast.bad { background: var(--panel); border: 1px solid #777; color: var(--text); }
.toast.info { background: var(--panel); border: 1px solid var(--line-2, #2a2a2a); color: var(--text); }

.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .6rem; border-radius: 99px;
  font-size: .78rem; font-weight: 600; border: 1px solid var(--line); color: var(--muted); }
.pill.on { color: var(--text); border-color: #777; background: var(--panel-2); }
.pill.off { color: var(--muted); }

/* --------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
tr:last-child td { border-bottom: none; }
td.wrap { white-space: normal; min-width: 240px; }
td .person { display: flex; align-items: center; gap: .6rem; }
td .person img { width: 28px; height: 28px; border-radius: 50%; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.pager { display: flex; gap: .6rem; justify-content: center; align-items: center; margin-top: 1rem; }

/* ------------------------------------------------------------- commands */
.jump { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 2rem; }
.cmd-section { margin-bottom: 2.4rem; scroll-margin-top: 90px; }
.cmd { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 1rem; padding: .55rem 0;
  border-bottom: 1px solid var(--line); }
.cmd code { color: var(--gold); justify-self: start; }

.prose { max-width: 780px; }
.prose h2 { margin-top: 1.8rem; }
.prose li { margin-bottom: .35rem; }

.section-title { margin: 3rem 0 1.2rem; }
.section-label { margin: 2rem 0 .8rem; letter-spacing: .08em; }
.log-controls { display: flex; gap: .8rem; align-items: center; }
.log-controls select { flex: 1; }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem 0; border-bottom: 1px solid var(--line); }
.toggle-row code { display: block; color: var(--gold); margin-bottom: .25rem; }
.toggle-row .small { display: block; }
.form-card + .form-card, .table-wrap + .form-card { margin-top: 1rem; }
.footer-logo { height: 12px; width: auto; opacity: .65; margin-right: auto; }
.who img, .server .icon, .person img, .sidebar summary img { filter: grayscale(1); }

/* --------------------------------------------------------------- mobile */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .row { grid-template-columns: 1fr; }
  .nav { gap: .8rem; }
  .nav .hide-sm { display: none; }
  .cmd { grid-template-columns: 1fr; gap: .2rem; }
}
