:root {
  color-scheme: dark;
  --bg: #08080a;
  --panel: #151316;
  --line: #422c32;
  --muted: #b9abb0;
  --accent: #b51634;
  --text: #f5f0f7;
  --ok: #35d47a;
  --err: #ed4059;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--text);
  font: 16px/1.6 system-ui, Segoe UI, sans-serif;
  background:
    radial-gradient(circle at 84% 8%, rgba(173, 11, 39, 0.2), transparent 31%),
    radial-gradient(circle at 8% 78%, rgba(102, 8, 27, 0.13), transparent 28%),
    linear-gradient(135deg, #070708 0%, #0d0b0e 48%, #12090d 100%);
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.13;
  background:
    linear-gradient(125deg, transparent 0 20%, #d0183a 20.1% 20.22%, transparent 20.32% 57%, #8f1029 57.1% 57.2%, transparent 57.3%),
    linear-gradient(35deg, transparent 0 72%, #8f1029 72.1% 72.2%, transparent 72.3%);
}
a { color: #f28da1; text-decoration: none; }
header, footer {
  padding: 18px max(24px, calc((100% - 1100px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #47252e;
  background: linear-gradient(90deg, rgba(7, 7, 8, 0.97), rgba(22, 10, 14, 0.94));
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}
header .brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #fff;
  font-weight: 700;
}
header .brand img,
.credit img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 50%;
  filter: drop-shadow(0 0 9px rgba(222, 27, 59, 0.42));
}
.brand strong {
  display: block;
  font-size: 23px;
  color: #fff;
  text-shadow: 0 0 16px rgba(224, 29, 61, 0.22);
}
.brand small,
.credit small {
  display: block;
  color: #ef8295;
  font-size: 12px;
  letter-spacing: 0.07em;
  font-weight: 650;
}
.who {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.who img.avatar { width: 28px; height: 28px; border-radius: 50%; }
#connection {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
#connection::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #35d47a;
  box-shadow: 0 0 10px rgba(53, 212, 122, 0.8);
}
#connection.off::before {
  background: #ed4059;
  box-shadow: 0 0 10px rgba(237, 64, 89, 0.8);
}
.sub {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px max(24px, calc((100% - 1100px) / 2));
  border-bottom: 1px solid #47252e;
  background: rgba(7, 7, 8, 0.55);
}
.sub a {
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 8px;
}
.sub a.on, .sub a:hover { background: var(--panel); color: #fff; }
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 55px;
  min-height: 70vh;
}
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.13em;
  color: #ef8295;
  margin: 0 0 8px;
}
h1 { font-size: 32px; letter-spacing: -0.03em; margin: 0 0 16px; color: #fff; }
h2 { font-size: 20px; margin: 24px 0 10px; color: #fff; }
.muted { color: var(--muted); font-size: 0.95rem; }
.panel, .card {
  padding: 25px;
  background: linear-gradient(145deg, rgba(27, 24, 28, 0.98), rgba(17, 16, 19, 0.98));
  border: 1px solid #422f35;
  border-top: 1px solid #6d2636;
  border-radius: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025), 0 13px 34px rgba(0, 0, 0, 0.18);
}
.card { padding: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.stat { font-size: 1.6rem; font-weight: 700; color: #fff; }
.flash {
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 20px;
  border: 1px solid #8e3e50;
  background: linear-gradient(90deg, #391a23, #261820);
}
.flash.ok { border-color: #2d6a45; background: linear-gradient(90deg, #163222, #122018); color: #9de0b1; }
.flash.err { color: #ff96aa; }
table {
  width: 100%;
  border-collapse: collapse;
  background: linear-gradient(145deg, rgba(27, 24, 28, 0.98), rgba(17, 16, 19, 0.98));
  border: 1px solid #422f35;
  border-radius: 15px;
  overflow: hidden;
}
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #422c32; font-size: 0.92rem; }
th { color: var(--muted); font-weight: 600; }
.btn, button.btn, a.btn {
  display: inline-block;
  background: linear-gradient(180deg, #c52442, #92142c);
  border: 1px solid #de405a;
  color: #fff;
  border-radius: 8px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 5px 14px rgba(100, 5, 25, 0.25);
}
.btn:hover, button.btn:hover { background: linear-gradient(180deg, #dd3150, #a61732); border-color: #f05c73; color: #fff; }
.btn.sec {
  background: linear-gradient(180deg, #342e32, #211e21);
  border-color: #57454b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 9px 14px;
  font-size: 14px;
}
.btn.sec:hover { background: linear-gradient(180deg, #44343a, #2a2226); }
.btn.danger { background: linear-gradient(180deg, #c52442, #7a1022); }
form.inline { display: inline; }
td form.inline { margin-right: 6px; }
input, select {
  background: linear-gradient(180deg, #100f12, #0b0b0d);
  color: #fff;
  border: 1px solid #514047;
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
}
input:hover, select:hover { border-color: #75505a; }
select[multiple] {
  min-height: 148px;
  padding: 8px;
}
label { display: block; margin: 12px 0 6px; color: var(--muted); font-size: 0.9rem; font-weight: 650; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.guild { display: flex; gap: 12px; align-items: center; color: inherit; }
.guild img, .guild .ph {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #111;
  object-fit: cover;
}
h1 { font-size: 1.7rem; }
.warn { color: #ff9daf; }
.callout {
  margin: 16px 0 20px;
  padding: 14px 16px;
  border-left: 3px solid #d52b49;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(112, 20, 40, 0.32), rgba(45, 27, 35, 0.2));
  color: #ead8dd;
  font-size: 0.95rem;
  line-height: 1.55;
}
.callout p { margin: 0; }
.callout-more {
  margin-top: 10px;
}
.callout-more summary {
  cursor: pointer;
  list-style: none;
  color: #ef8295;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  user-select: none;
  width: fit-content;
}
.callout-more summary:hover { color: #f28da1; }
.callout-more summary:focus-visible {
  outline: 1px solid #d52b49;
  outline-offset: 3px;
  border-radius: 4px;
}
.callout-more summary::-webkit-details-marker { display: none; }
.callout-more summary::marker { content: ""; }
.callout-more summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s ease;
}
.callout-more[open] summary::before { transform: rotate(90deg); }
.callout-more[open] summary { color: #f28da1; }
.callout-more p {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(213, 43, 73, 0.28);
  font-size: 0.92rem;
}
.ok { color: #9de0b1; }
.pager { margin-top: 16px; }
.sync-stats { margin: 12px 0 16px; }
.sync-stats .stat { font-size: 1.35rem; }
.nick-fail {
  display: block;
  margin-top: 4px;
  color: #ff9daf;
  font-size: 0.86rem;
  line-height: 1.4;
}
.table-wrap { overflow-x: auto; }
.history-id { font-size: 0.78rem; margin-top: 2px; }
.history-more { margin-top: 8px; }
.history-more summary {
  cursor: pointer;
  color: #ef8295;
  font-size: 0.82rem;
  font-weight: 650;
  width: fit-content;
}
.history-more summary:hover { color: #f28da1; }
.history-ids {
  margin: 6px 0 10px;
  padding-left: 18px;
  font-size: 0.82rem;
  color: var(--muted);
}
.hero { max-width: 720px; margin: 40px auto; }
.hero .banner {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  object-position: center;
  border-radius: 15px;
  margin-bottom: 18px;
  border: 1px solid #422f35;
  box-shadow: 0 13px 34px rgba(0, 0, 0, 0.28);
}
.login-card { padding: 32px; }
.guild-select { width: auto; min-width: 190px; }
.lang-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.lang-kicker {
  color: #c4b4b8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.lang-select {
  width: auto;
  min-width: 132px;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 650;
}
footer {
  border-bottom: 0;
  border-top: 1px solid #47252e;
  flex-wrap: wrap;
  font-size: 14px;
  margin-top: auto;
}
.credit { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.credit img { width: 36px; height: 36px; }
.credit strong { color: #fff; }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
footer nav a { color: #d7c6cc; text-decoration: underline; text-decoration-color: #7f3445; text-underline-offset: 4px; }
footer nav a:hover { color: #fff; }
@media (max-width: 760px) {
  header { flex-wrap: wrap; }
  header .who { width: 100%; justify-content: flex-start; }
  h1 { font-size: 1.4rem; }
}
