/* Roles, events, game stats and leaderboards */
:root {
  --tone-blue: #38bdf8; --tone-amber: #fbbf24; --tone-violet: #a78bfa;
  --tone-green: #34d399; --tone-orange: #fb923c; --tone-gray: #94a3b8; --tone-red: #f87171;
}
.row.wrap { flex-wrap: wrap; }
.pill svg { width: 12px; height: 12px; }
.pill.role { --c: #94a3b8; background: color-mix(in srgb, var(--c) 18%, transparent); color: color-mix(in srgb, var(--c) 80%, var(--text)); text-transform: none; }
.spinner.sm { width: 24px; height: 24px; border-width: 2px; margin: 0 auto; }
.linkish { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.linkish:hover { color: var(--accent); }
#forgotBtn { color: var(--accent); }
.link svg { width: 12px; height: 12px; display: inline; vertical-align: -1px; }
.seg button svg { width: 15px; height: 15px; margin-right: 6px; }

/* ---------- events ---------- */
.ev-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ev-mini li { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; }
.ev-mini li:hover { background: var(--panel-2); }
.ev-date { width: 44px; flex: none; text-align: center; border-radius: 10px; padding: 4px 0; background: rgba(56, 189, 248, 0.12); color: var(--accent); line-height: 1.1; }
.ev-date b { display: block; font-family: var(--font-display); font-size: 18px; }
.ev-date span { font-size: 11px; text-transform: uppercase; font-weight: 600; }
.ev-info { flex: 1; min-width: 0; display: grid; }
.ev-info b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-info span { font-size: 12px; color: var(--muted); }
.ev-day { display: grid; gap: 10px; }
.ev-day-label { margin: 6px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.ev-list { display: grid; gap: 10px; }
.card.ev { --c: var(--accent); display: grid; grid-template-columns: 92px 1fr auto; gap: 16px; align-items: start; border-left: 3px solid var(--c); padding: 16px 18px; }
.card.ev.live { box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.35), var(--shadow); }
.ev-time { display: grid; font-variant-numeric: tabular-nums; }
.ev-time b { font-family: var(--font-display); font-size: 17px; white-space: nowrap; }
.ev-time span { color: var(--faint); font-size: 13px; }
.ev-main h4 { margin: 8px 0 4px; font-size: 16px; }
.ev-main p { margin: 0 0 10px; font-size: 14px; }
.ev-host { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.ev-actions { display: flex; gap: 6px; }
@media (max-width: 560px) {
  .card.ev { grid-template-columns: 1fr; gap: 8px; }
  .ev-time { display: flex; gap: 8px; align-items: baseline; }
  .ev-actions { justify-content: flex-end; }
}

/* ---------- game stats ---------- */
.stack-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--panel-2); }
.stack-bar i { display: block; min-width: 4px; }
.legend { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend b { color: var(--text); }
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.server { display: grid; gap: 12px; align-content: start; }
.server-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.server-head h4 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.server-count { text-align: right; line-height: 1; }
.server-count b { font-family: var(--font-display); font-size: 26px; }
.server-count span { color: var(--faint); font-size: 13px; margin-left: 2px; }
.bar.big { height: 8px; }
.server-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.team-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.team-rows li { display: grid; grid-template-columns: 10px 1fr 90px 26px; align-items: center; gap: 8px; font-size: 13px; }
.team-rows .bar { height: 6px; }
.team-rows b { text-align: right; font-variant-numeric: tabular-nums; }
.server > .btn { justify-self: start; }
.server-players { display: grid; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.server-players .chips { margin-top: 4px; }
.server-players .chip { font-size: 12px; padding: 4px 10px; }

.lookup-form { display: flex; gap: 10px; flex-wrap: wrap; }
.search.big { max-width: none; }
.search.big input { padding-top: 12px; padding-bottom: 12px; font-size: 15px; }
.recent { display: grid; gap: 8px; margin-top: 16px; }
.chip.ghost { border-style: dashed; color: var(--muted); }
.chip.static { cursor: default; }
.player-card .profile-head h3 { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.player-card .profile-head h3 .muted { font-size: 15px; font-family: var(--font); font-weight: 500; }

/* ---------- leaderboards ---------- */
.lb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; align-items: start; }
.lb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lb-list li { display: grid; grid-template-columns: 28px 32px 1fr auto; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; font-size: 14px; }
.lb-list li:hover { background: var(--panel-2); }
.lb-rank { font-weight: 700; color: var(--faint); text-align: center; font-variant-numeric: tabular-nums; }
.lb-list li.top .lb-rank { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #1a1100; font-size: 13px; }
.lb-list li.top1 .lb-rank { background: linear-gradient(135deg, #fde68a, #f59e0b); }
.lb-list li.top2 .lb-rank { background: linear-gradient(135deg, #f1f5f9, #94a3b8); }
.lb-list li.top3 .lb-rank { background: linear-gradient(135deg, #fed7aa, #c2410c); color: #fff; }
.lb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.lb-val { font-variant-numeric: tabular-nums; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; display: inline-block; }

/* ---------- roles ---------- */
.roles-layout { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
@media (max-width: 980px) { .roles-layout { grid-template-columns: 1fr; } }
.card-head.pad { padding: 16px 16px 0; }
.hint.pad { padding: 0 16px 16px; }
.roles-list ul { list-style: none; margin: 0; padding: 4px 8px 8px; display: grid; gap: 2px; }
.role-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left; }
.role-item:hover { background: var(--panel-2); }
.role-item.on { background: rgba(56, 189, 248, 0.12); }
.role-item span { flex: 1; display: grid; min-width: 0; }
.role-item b { font-size: 14px; }
.role-item small { color: var(--muted); font-size: 12px; }
.role-item svg { width: 15px; height: 15px; color: var(--faint); }
.role-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; display: inline-block; }
.card-head h3 .role-dot { margin-right: 6px; vertical-align: -1px; }
.role-basics { grid-template-columns: 1fr 1fr; margin-bottom: 18px; }
.role-basics label:first-child { grid-column: 1 / -1; }
.role-basics input[type="color"] { padding: 4px; height: 42px; cursor: pointer; }
.perm-groups { display: grid; gap: 14px; }
.perm-group { border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px 6px; margin: 0; min-width: 0; }
.perm-group legend { padding: 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.perm { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.perm:first-of-type { border-top: 0; }
.perm span { display: grid; }
.perm b { font-size: 14px; font-weight: 600; }
.perm small { font-size: 12px; color: var(--muted); }
.perm.disabled { cursor: not-allowed; opacity: 0.6; }
input.switch {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 40px; height: 22px; border-radius: 99px; padding: 0;
  border: 1px solid var(--line-strong); background: var(--panel-2);
  position: relative; cursor: inherit; transition: background 0.15s;
}
input.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--faint); transition: transform 0.15s, background 0.15s; }
input.switch:checked { background: var(--accent); border-color: var(--accent); }
input.switch:checked::after { transform: translateX(18px); background: #fff; }
.people .member-role { width: auto; min-width: 140px; padding: 6px 10px; font-size: 13px; }

/* ---------- avatars (Roblox headshots) ---------- */
.avatar.has-avatar { color: transparent; background-size: cover; background-position: center; background-color: var(--panel-2); }

/* ---------- applications / appeals ---------- */
.app-toggle { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.app-toggle h3 { margin: 0 0 2px; font-size: 16px; }
.app-toggle p { margin: 0; font-size: 14px; }
.application { display: grid; gap: 14px; }
.app-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px; }
.answers { margin: 0; display: grid; gap: 10px; }
.answers dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); font-weight: 600; }
.answers dd { margin: 2px 0 0; white-space: pre-wrap; }
.response { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--panel-2); font-size: 14px; color: var(--muted); }
.ref { margin-right: auto; font-family: ui-monospace, Consolas, monospace; }
.ban-ref { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; font-size: 14px; background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.3); }
.ban-ref.none { background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.25); }
.ban-ref svg { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--red); }
.ban-ref.none svg { color: var(--green); }
.player-card .ban-ref { margin-bottom: 16px; }
.appeal-text { margin: 0; white-space: pre-wrap; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.check-inline input { width: 16px; height: 16px; accent-color: var(--accent); }
.push-right { margin-left: auto; align-self: flex-start; }
.player-card .profile-head { flex-wrap: wrap; }

/* ---------- update log ---------- */
.update.draft { border-style: dashed; opacity: 0.85; }
.update h3 { margin: 8px 0 2px; font-family: var(--font-display); font-size: 19px; }
.version { font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: 13px; padding: 3px 8px; border-radius: 7px; background: var(--panel-2); border: 1px solid var(--line-strong); }
.notes { margin-top: 12px; color: var(--muted); font-size: 14px; }
.notes h5 { margin: 12px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text); }
.notes p { margin: 0 0 6px; }
.notes ul { margin: 0 0 6px; padding-left: 18px; }
.tag-picks { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* ---------- moderation activity ---------- */
.source { display: block; width: fit-content; margin-top: 3px; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.source.game { background: rgba(52, 211, 153, 0.14); color: #10b981; }
.source.web { background: rgba(56, 189, 248, 0.14); color: #0ea5e9; }
:root:not([data-theme="light"]) .source.game { color: #6ee7b7; }
:root:not([data-theme="light"]) .source.web { color: #7dd3fc; }
.mod-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mod-hist li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); font-size: 14px; }
@media (max-width: 640px) { .mod-hist li { grid-template-columns: auto 1fr; } .mod-hist li > :last-child { grid-column: 1 / -1; } }

/* ---------- credits editor ---------- */
.credits-editor { display: grid; gap: 16px; }
.credit-sec { display: grid; gap: 12px; }
.credit-sec-head { display: flex; gap: 10px; align-items: center; }
.credit-sec-head .sec-title { font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.credit-rows { display: grid; gap: 8px; }
.credit-row { display: grid; grid-template-columns: 32px minmax(120px, 1fr) minmax(160px, 2fr) minmax(140px, 1.4fr) auto; gap: 8px; align-items: center; }
.credit-row.head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.credit-row input { padding: 8px 10px; font-size: 13px; }
.credit-sec > .btn, .credits-editor > .btn { justify-self: start; }
@media (max-width: 900px) {
  .credit-row { grid-template-columns: 32px 1fr auto; }
  .credit-row.head { display: none; }
  .credit-row input:nth-of-type(2), .credit-row input:nth-of-type(3) { grid-column: 2 / -1; }
  .credit-row > .row { grid-column: 3; grid-row: 1; }
}
.save-bar {
  position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(10px); box-shadow: var(--shadow);
}
.save-bar .row { flex-wrap: wrap; }
.save-bar a svg { width: 14px; height: 14px; }

/* ---------- applications ---------- */
.app-sec { margin-top: 18px; }
.app-sec h4 { margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 14px; }
.app-answers { margin: 0; display: grid; gap: 12px; }
.app-answers dt { font-size: 12px; font-weight: 600; color: var(--faint); }
.app-answers dd { margin: 3px 0 0; font-size: 14px; word-break: break-word; }
.ans-long { white-space: pre-wrap; }
.ans-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ans-chips span { padding: 2px 9px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12px; }
.ans-ok { color: var(--green); font-weight: 600; font-size: 13px; }
.ans-warn { color: var(--amber); font-weight: 600; font-size: 13px; }
.ans-files { margin: 0; padding-left: 18px; }
.ans-table { border-collapse: collapse; font-size: 13px; }
.ans-table th, .ans-table td { padding: 6px 10px; border: 1px solid var(--line); text-align: left; background: none; }
.ans-sign { max-width: 280px; border-radius: 8px; background: #0b1324; border: 1px solid var(--line); }
.app-answers a { color: var(--accent); }
.app-actions { position: sticky; bottom: -20px; padding: 12px 0 0; background: var(--panel); border-top: 1px solid var(--line); margin-top: 18px; }
.profile-head h3 .muted { font-size: 14px; font-family: var(--font); font-weight: 500; }
.chips select { width: auto; padding: 6px 10px; font-size: 13px; border-radius: 999px; }
.form-card-admin { display: grid; gap: 14px; }
.form-card-admin h3 { margin: 0; font-family: var(--font-display); font-size: 18px; }
.pos-toggles { display: grid; gap: 8px; }
.chip.off { opacity: 0.6; text-decoration: line-through; }

/* ---------- form editor ---------- */
.fe-num { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--accent); background: rgba(56, 189, 248, 0.12); }
.fe-questions { display: grid; gap: 8px; }
.fe-q { border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: var(--panel-2); }
.fe-q.open { border-color: rgba(56, 189, 248, 0.4); }
.fe-q-row { display: grid; grid-template-columns: 170px 1fr auto auto; gap: 8px; align-items: center; }
.fe-q-row select, .fe-q-row input:not([type="checkbox"]) { padding: 7px 10px; font-size: 13px; }
.fe-details { margin-top: 10px; padding: 10px 4px 2px; border-top: 1px dashed var(--line); }
.fe-details .full { grid-column: 1 / -1; }
@media (max-width: 1200px) {
  .fe-q-row { grid-template-columns: 1fr auto auto; }
  .fe-q-row input[data-fe$=":label"] { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 640px) { .fe-q-row { grid-template-columns: 1fr; } }

/* ---------- documents ---------- */
.doc-cell { display: flex; gap: 12px; align-items: flex-start; min-width: 220px; }
.doc-cell > div { display: grid; gap: 2px; }
.doc-icon { font-size: 24px; line-height: 1.2; }
.docs-table td { vertical-align: top; }
.doc-kind { display: flex; gap: 6px; padding: 4px; }
.doc-kind label { display: inline-flex !important; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 8px; color: var(--text) !important; font-weight: 600; cursor: pointer; }
.doc-kind input { width: auto; }
.picker { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 12px; margin: 0; min-width: 0; }
.picker legend { padding: 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); }
.picker .chip { cursor: pointer; }
.picker .chip input { width: 14px; height: 14px; accent-color: var(--accent); }
.people-filter { margin-bottom: 8px; }
.people-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; max-height: 240px; overflow-y: auto; }
.person { display: flex !important; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--panel-2); cursor: pointer; color: var(--text) !important; font-weight: 500 !important; }
.person input { width: 15px; height: 15px; accent-color: var(--accent); flex: none; }
.person span { display: grid; min-width: 0; }
.person small { color: var(--muted); font-weight: 400; }
.doc-audience { color: var(--accent) !important; }

/* ---------- discord message editor ---------- */
.hook { border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px 12px; margin: 0; display: grid; gap: 8px; min-width: 0; }
.hook legend { padding: 0 6px; font-weight: 600; font-size: 14px; color: var(--text); }
.hook details summary { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 600; }
.hook-msg { margin-top: 10px; }
.ping-help { padding: 12px 14px; border-radius: 12px; background: var(--panel-2); font-size: 13px; color: var(--muted); }
.ping-help ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.ping-help b { color: var(--text); }
