/* KersMC website — shared styles for the public site, dashboard, login and installer. */

/* ------------------------------------------------------------------ tokens */
:root {
  --accent: #e5161d;
  --on-accent: #fff;
  --bg: #0c0a0a;
  --bg-soft: #121010;
  --surface: #171414;
  --surface-2: #1f1b1b;
  --surface-3: #2a2424;
  --border: #2b2525;
  --border-strong: #3b3333;
  --text: #f7f2f2;
  --text-2: #cdc2c2;
  --muted: #9c8f8f;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --discord: #5865f2;
  --gold: #f5c518;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .22);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --accent-soft: color-mix(in srgb, var(--accent) 15%, transparent);
  --accent-border: color-mix(in srgb, var(--accent) 45%, transparent);
  --checker: repeating-conic-gradient(var(--surface-3) 0% 25%, var(--surface-2) 0% 50%) 50% / 18px 18px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f7f4f4;
  --bg-soft: #f0ebeb;
  --surface: #ffffff;
  --surface-2: #f5f1f1;
  --surface-3: #e9e2e2;
  --border: #e5dcdc;
  --border-strong: #d5c8c8;
  --text: #1c1515;
  --text-2: #4a3d3d;
  --muted: #7a6c6c;
  --shadow: 0 1px 2px rgba(40, 10, 10, .06), 0 8px 24px rgba(40, 10, 10, .06);
  --shadow-lg: 0 24px 60px rgba(40, 10, 10, .16);
  color-scheme: light;
}

/* -------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.25; }
code, kbd, pre { font-family: var(--mono); }
code { font-size: .92em; }
kbd { font: 600 12px var(--mono); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface-2); }
hr { border: 0; border-top: 1px solid var(--border); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
[hidden] { display: none !important; }

.container { width: min(1140px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; padding: 10px 14px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }
.inline-form { display: inline; margin: 0; }
.truncate { display: inline-block; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* ------------------------------------------------------------------- icons */
.icon { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.icon-xs { width: 14px; height: 14px; }
.icon-img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 4px; }
.icon-emoji { font-size: 1.3em; line-height: 1; }
.theme-icon-dark { display: none; }
[data-theme="light"] .theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark { display: inline-block; }

/* ----------------------------------------------------------------- buttons */
.btn {
  --btn-bg: var(--surface-2); --btn-fg: var(--text); --btn-border: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 14px;
  border-radius: 10px; border: 1px solid var(--btn-border); background: var(--btn-bg); color: var(--btn-fg);
  font: 600 14px/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .15s, box-shadow .15s, filter .15s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 18px; height: 18px; }
.btn .icon-img { width: 20px; height: 20px; }
.btn-primary { --btn-bg: var(--accent); --btn-fg: var(--on-accent); --btn-border: transparent; }
.btn-discord { --btn-bg: var(--discord); --btn-fg: #fff; --btn-border: transparent; }
.btn-gold { --btn-bg: var(--gold); --btn-fg: #1d1600; --btn-border: transparent; }
.btn-green { --btn-bg: #16a34a; --btn-fg: #fff; --btn-border: transparent; }
.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-border: transparent; }
.btn-primary:hover, .btn-discord:hover, .btn-gold:hover, .btn-green:hover, .btn-danger:hover { background: var(--btn-bg); filter: brightness(1.1); }
.btn-primary { box-shadow: 0 6px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; }
.btn-sm { min-height: 32px; padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn-lg { min-height: 48px; padding: 12px 20px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-meta { font-weight: 500; font-size: .85em; opacity: .9; padding-left: 10px; border-left: 1px solid color-mix(in srgb, currentColor 35%, transparent); }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; text-decoration: none;
  transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .icon { width: 18px; height: 18px; }
.icon-btn-danger:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.icon-btn.is-disabled { opacity: .4; cursor: not-allowed; }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------- forms */
.form { display: grid; gap: 16px; }
.form > .btn:not(.btn-block) { justify-self: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.span-2 { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; align-content: start; }
.field > label, .field > legend { font-weight: 600; font-size: 14px; color: var(--text); padding: 0; margin-bottom: 0; }
fieldset.field > legend { margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
.field-help { margin: 0; font-size: 13px; color: var(--muted); }
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):not([type="hidden"]), select, textarea {
  width: 100%; min-height: 40px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--bg-soft); color: var(--text); font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled { opacity: .6; cursor: not-allowed; }
input[type="file"] { font: inherit; font-size: 13px; color: var(--text-2); }
input[type="file"]::file-selector-button { margin-right: 10px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: 600 13px var(--font); cursor: pointer; }
textarea { resize: vertical; line-height: 1.55; min-height: 90px; }
select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239c8f8f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; }

.switch-list { display: grid; gap: 14px; }
.switch-row { position: relative; display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { position: relative; flex: none; width: 42px; height: 24px; margin-top: 1px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); transition: background-color .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: transform .2s; }
.switch-row input:checked + .switch { background: var(--accent); border-color: transparent; }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch-row input:disabled + .switch { opacity: .5; }
.switch-text { display: grid; gap: 2px; }
.switch-label { font-weight: 600; font-size: 14px; }

.color-input { display: flex; align-items: center; gap: 10px; }
.color-input input[type="color"] { width: 54px; height: 40px; padding: 3px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg-soft); cursor: pointer; }
.color-input code { font-size: 13px; color: var(--muted); }

.input-prefix, .input-suffix { display: flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg-soft); overflow: hidden; }
.input-prefix:focus-within, .input-suffix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-prefix > span, .input-suffix > span { display: flex; align-items: center; padding: 0 10px; color: var(--muted); font: 13px var(--mono); background: var(--surface-2); white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.input-prefix > span { border-right: 1px solid var(--border); }
.input-suffix > span { border-left: 1px solid var(--border); }
.input-prefix input, .input-suffix input { border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; min-width: 0; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; }
.copy-row input[readonly] { font: 13px var(--mono); }

.chip { --c: var(--accent); position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); font-weight: 600; font-size: 13px; transition: background-color .15s, border-color .15s; user-select: none; }
.chip span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 30%, transparent); }
.chip input:checked + span { background: color-mix(in srgb, var(--c) 20%, transparent); border-color: color-mix(in srgb, var(--c) 65%, transparent); }
.chip input:checked + span::after { content: "✓"; font-size: 12px; }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.role-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-tools { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 13px; margin-top: 6px; }

/* ---------------------------------------------- badges, alerts, cards, tables */
.badge { --c: var(--muted); display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.7; background: var(--surface-3); color: var(--text-2); white-space: nowrap; vertical-align: middle; }
.badge-role { background: color-mix(in srgb, var(--c) 17%, transparent); color: color-mix(in srgb, var(--c) 72%, var(--text)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.badge-success { background: color-mix(in srgb, var(--success) 16%, transparent); color: color-mix(in srgb, var(--success) 75%, var(--text)); }
.badge-warning { background: color-mix(in srgb, var(--warning) 18%, transparent); color: color-mix(in srgb, var(--warning) 75%, var(--text)); }
.badge-danger { background: color-mix(in srgb, var(--danger) 16%, transparent); color: color-mix(in srgb, var(--danger) 75%, var(--text)); }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }

.alert { --c: var(--info); display: flex; gap: 12px; align-items: flex-start; margin: 0 0 18px; padding: 12px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); background: color-mix(in srgb, var(--c) 9%, var(--surface)); font-size: 14px; }
.alert > .icon { color: var(--c); margin-top: 1px; }
.alert a { color: inherit; font-weight: 700; }
.alert-danger { --c: var(--danger); }
.alert-warning { --c: var(--warning); }
.alert-success { --c: var(--success); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card + .card, .card + .alert, .card + .dash-section { margin-top: 20px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; }
.card-head h2 .icon { color: var(--accent); width: 18px; height: 18px; }
.card-head p { flex-basis: 100%; margin: 0; font-size: 14px; }
.form-card > .form-grid, .form-card > .form, .form-card > .profile-summary, .form-card > .perm-list { padding: 20px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); }
.settings-form { display: grid; gap: 20px; }
.settings-form .card + .card { margin-top: 0; }
.sticky-actions { position: sticky; bottom: 12px; z-index: 10; justify-content: flex-end; border: 1px solid var(--border-strong); border-radius: 14px; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(8px); box-shadow: var(--shadow-lg); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; align-items: start; }
.grid-2 .card + .card { margin-top: 0; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 12px 16px; border-bottom: 1px solid var(--border); text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-compact td { padding: 9px 16px; }
.col-handle { width: 40px; padding-right: 0 !important; }
.col-actions { width: 1%; white-space: nowrap; text-align: right; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-title { font-weight: 600; color: var(--text); text-decoration: none; }
a.cell-title:hover { color: var(--accent); }
.cell-sub { font-size: 13px; color: var(--muted); word-break: break-all; text-decoration: none; }
.cell-icon { --tile: var(--accent); flex: none; display: grid; place-items: center; width: 36px; height: 36px; padding: 7px; border-radius: 10px; background: color-mix(in srgb, var(--tile) 16%, transparent); color: var(--tile); }
.cell-icon .icon { width: 20px; height: 20px; }
.cell-icon:has(.icon-img) { padding: 4px; }
tr.is-inactive td { opacity: .55; }
tr.is-dragging td { opacity: .35; }
tr.is-warning td { background: color-mix(in srgb, var(--warning) 6%, transparent); }
.drag-handle { display: inline-grid; place-items: center; color: var(--muted); cursor: grab; touch-action: none; }
.drag-handle:active { cursor: grabbing; }
.drag-handle .icon { width: 18px; height: 18px; }
.link-copy { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: 600 13px var(--mono); cursor: pointer; }
.link-copy:hover { border-color: var(--accent-border); }
.activity-icon { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 8px; border-radius: 7px; background: var(--surface-2); color: var(--muted); vertical-align: middle; }

/* ------------------------------------------------------- menus, modal, toast */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; display: none; min-width: 210px; padding: 6px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow-lg); }
.menu-wrap.is-open .menu { display: block; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--surface-2); }
.menu form { margin: 0; }
.menu .icon { width: 18px; height: 18px; color: var(--muted); }

.modal { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--border-strong); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.modal[open] { display: flex; flex-direction: column; animation: modal-in .18s ease-out; }
.modal::backdrop { background: rgba(6, 3, 3, .68); backdrop-filter: blur(3px); }
.modal-sm { width: min(420px, calc(100vw - 32px)); }
.modal-lg { width: min(1040px, calc(100vw - 32px)); }
.modal form[method="dialog"] { display: contents; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--border); }
.modal-title { margin: 0 0 6px; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-head .modal-title { margin: 0; }
.modal-body { padding: 20px; overflow: auto; }
.modal-body p { margin: 0; color: var(--text-2); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.toasts { position: fixed; inset: auto 16px 16px auto; z-index: 300; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); height: auto; margin: 0; padding: 0; overflow: visible; border: 0; background: none; color: var(--text); pointer-events: none; }
.toast { --c: var(--info); display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-strong); border-left: 4px solid var(--c); background: var(--surface); box-shadow: var(--shadow-lg); font-size: 14px; pointer-events: auto; animation: toast-in .2s ease-out; transition: opacity .2s, transform .2s; }
.toast-success { --c: var(--success); }
.toast-error { --c: var(--danger); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------------------------------------------------- shared status visuals */
.dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--muted); }
.is-online .dot { background: var(--success); animation: pulse 2s infinite; }
.is-offline .dot { background: var(--danger); }
.is-loading .dot { animation: blink 1.1s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }

.mc-motd { min-height: 52px; padding: 10px 12px; border-radius: 10px; background: #15100f; color: #aaa; font: 13px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.mc-l { font-weight: 700; }
.mc-o { font-style: italic; }
.mc-n { text-decoration: underline; }
.mc-m { text-decoration: line-through; }
.mc-n.mc-m { text-decoration: underline line-through; }
.mc-k { filter: blur(2px); }
.mc-offline { color: #ff8a8a; }

/* ---------------------------------------------------------- public: header */
body.site { min-height: 100vh; display: flex; flex-direction: column; }
body.site main { flex: 1; }
.announcement { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 80%, #000), var(--accent)); color: var(--on-accent); font-size: 14px; font-weight: 600; }
.announcement .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; padding: 9px 0; text-align: center; }
.announcement a { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.announcement .icon { width: 16px; height: 16px; }

.site-header { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); }
.nav-inner { position: relative; display: flex; align-items: center; gap: 16px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 19px; letter-spacing: -.01em; text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.site-nav { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.site-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: 15px; text-decoration: none; }
.site-nav a:hover { background: var(--surface-2); color: var(--text); }
.site-nav a.is-active { background: var(--accent-soft); color: var(--text); }
.site-nav .icon-xs { opacity: .55; }
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-toggle { display: none; }

/* ------------------------------------------------------------ public: hero */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: 64px 0 84px; text-align: center; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: 32px 32px; -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 25%, transparent 72%); mask-image: radial-gradient(ellipse at 50% 40%, #000 25%, transparent 72%); }
[data-theme="light"] .hero::before { background-image: linear-gradient(rgba(60, 20, 20, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(60, 20, 20, .06) 1px, transparent 1px); }
.hero-glow { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(520px 360px at 50% 34%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 70%), radial-gradient(460px 300px at 12% 8%, rgba(76, 175, 80, .13), transparent 70%), radial-gradient(460px 300px at 88% 12%, rgba(245, 197, 24, .08), transparent 70%); }
.hero.has-image::before { background: var(--hero-image) center / cover no-repeat; opacity: .45; -webkit-mask-image: none; mask-image: none; }
.hero.has-image::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 35%, transparent) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 60%, var(--bg) 100%); }
.hero-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.hero-logo { width: min(340px, 72vw); height: auto; margin: 0 auto 4px; filter: drop-shadow(0 28px 36px rgba(0, 0, 0, .45)); animation: float 6s ease-in-out infinite; }
.hero-tagline { max-width: 640px; margin: 0; color: var(--text-2); font-size: clamp(17px, 2.4vw, 21px); font-weight: 500; }
.hero-join { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 4px; }
.hero-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ip-box { display: inline-flex; align-items: center; gap: 14px; padding: 8px 8px 8px 18px; border-radius: 14px; border: 1px solid var(--border-strong); background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--text); font: inherit; cursor: pointer; backdrop-filter: blur(8px); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.ip-box:hover { border-color: var(--accent-border); transform: translateY(-1px); }
.ip-label { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.ip-value { font: 700 18px var(--mono); }
.ip-action { display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 14px; }
.ip-action .icon { width: 16px; height: 16px; }
.status-pill { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 88%, transparent); font-weight: 600; backdrop-filter: blur(8px); }
.status-pill strong { font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------- public: sections */
.section { padding: 64px 0; }
.section-alt { border-block: 1px solid var(--border); background: var(--bg-soft); }
.section-head { max-width: 720px; margin: 0 auto 32px; text-align: center; }
.section-head h2 { margin: 0 0 8px; font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -.02em; }
.section-head > p { margin: 0; color: var(--muted); font-size: 17px; }
.prose-center { color: var(--text-2); font-size: 17px; text-align: center; }

.join-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; max-width: 960px; margin: 0 auto; }
.join-card { display: grid; align-content: start; gap: 14px; padding: 24px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.join-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.join-edition { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.join-edition .icon { width: 16px; height: 16px; }
.join-card h3 { margin: 0; font-size: 20px; }
.join-steps { display: grid; gap: 6px; margin: 0; padding-left: 20px; color: var(--text-2); }
.join-steps li::marker { color: var(--accent); font-weight: 700; }
.join-address { display: flex; flex-wrap: wrap; gap: 8px; }
.copy-field { display: inline-flex; flex: 1 1 auto; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--bg-soft); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s; }
.copy-field:hover { border-color: var(--accent-border); }
.copy-field code { overflow: hidden; font: 700 15px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.copy-field .icon { width: 18px; height: 18px; margin-left: auto; color: var(--muted); }
.copy-field-small { flex: 0 0 auto; }
.copy-label { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.status-inline { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.status-inline.is-online { color: color-mix(in srgb, var(--success) 75%, var(--text)); }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.feature-card { padding: 22px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); font-size: 15px; transition: transform .15s, border-color .15s; }
.feature-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.feature-card h3 { margin: 0 0 6px; font-size: 18px; }
.feature-card .anchor { display: none; }

/* ------------------------------------------------- public: pages and prose */
.page-hero { padding: 52px 0 28px; border-bottom: 1px solid var(--border); background: radial-gradient(760px 220px at 50% 0%, var(--accent-soft), transparent); text-align: center; }
.page-hero h1 { margin: 0 0 6px; font-size: clamp(30px, 4.5vw, 44px); letter-spacing: -.02em; }
.page-hero p { margin: 0; }
.page-layout { display: grid; gap: 48px; max-width: 800px; padding: 40px 0 72px; }
.page-layout.has-toc { grid-template-columns: minmax(0, 1fr) 230px; max-width: 1080px; }
.page-main { min-width: 0; }
.toc { position: sticky; top: 96px; align-self: start; font-size: 14px; }
.toc nav { display: grid; gap: 2px; padding-left: 14px; border-left: 1px solid var(--border); }
.toc-title { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.toc a { padding: 4px 0; color: var(--muted); text-decoration: none; }
.toc a:hover, .toc a.is-active { color: var(--text); }
.toc a.is-active { font-weight: 600; }

.prose { color: var(--text-2); font-size: 16px; line-height: 1.75; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--text); line-height: 1.3; letter-spacing: -.01em; scroll-margin-top: 96px; }
.prose h2 { margin: 2em 0 .6em; padding-bottom: .3em; border-bottom: 1px solid var(--border); font-size: 24px; }
.prose h3 { margin: 1.6em 0 .5em; font-size: 19px; }
.prose p { margin: 0 0 1em; }
.prose a { color: var(--accent); font-weight: 600; }
.prose strong { color: var(--text); }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.4em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--accent); font-weight: 700; }
.prose code { padding: .15em .4em; border-radius: 6px; background: var(--surface-3); color: var(--text); }
.prose pre { overflow: auto; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.prose pre code { padding: 0; background: none; }
.prose blockquote { margin: 0 0 1em; padding: 4px 16px; border-left: 3px solid var(--border-strong); color: var(--muted); }
.prose img { border-radius: 12px; }
.prose hr { margin: 2em 0; }
.prose .table-wrap { margin: 0 0 1em; border: 1px solid var(--border); border-radius: 12px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.prose tr:last-child td { border-bottom: 0; }
.prose th { background: var(--surface-2); color: var(--text); }
.anchor { margin-left: 6px; color: var(--muted) !important; font-weight: 400 !important; text-decoration: none; opacity: 0; transition: opacity .15s; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .anchor:focus { opacity: 1; }
.callout { --c: var(--info); margin: 0 0 1.2em; padding: 14px 16px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); background: color-mix(in srgb, var(--c) 9%, transparent); }
.callout-title { margin: 0 0 4px !important; color: color-mix(in srgb, var(--c) 80%, var(--text)); font-weight: 800; }
.callout > :last-child { margin-bottom: 0; }
.callout-tip { --c: var(--success); }
.callout-important { --c: #a855f7; }
.callout-warning { --c: var(--warning); }
.callout-danger { --c: var(--danger); }

.error-page { max-width: 560px; padding: 40px 0; text-align: center; }
.error-page h1 { margin: 8px 0; }
.error-page p { margin: 0 0 24px; }
.error-code { background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 35%, #000)); -webkit-background-clip: text; background-clip: text; color: transparent; font: 900 clamp(84px, 16vw, 140px) / 1 var(--font); letter-spacing: -.04em; }

/* ---------------------------------------------------------- public: footer */
.site-footer { padding: 40px 0 24px; border-top: 1px solid var(--border); background: var(--bg-soft); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 24px; }
.footer-brand p { max-width: 380px; margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-links a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); color: var(--text-2); font-weight: 600; font-size: 14px; text-decoration: none; }
.footer-links a:hover { border-color: var(--border-strong); color: var(--text); }
.footer-links .icon, .footer-links .icon-img { width: 18px; height: 18px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.footer-staff { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; }
.footer-staff:hover { color: var(--text); }
.footer-staff .icon { width: 14px; height: 14px; }

/* ------------------------------------------------------------ admin: shell */
.admin-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; gap: 8px; height: 100vh; padding: 16px 12px; overflow-y: auto; border-right: 1px solid var(--border); background: var(--bg-soft); }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; color: var(--text); font-weight: 800; font-size: 17px; text-decoration: none; }
.sidebar-brand span { display: grid; line-height: 1.2; }
.sidebar-brand small { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.sidebar-nav { display: grid; gap: 2px; }
.sidebar-nav a, .sidebar-foot a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: 14px; text-decoration: none; transition: background-color .15s, color .15s; }
.sidebar-nav a:hover, .sidebar-foot a:hover { background: var(--surface-2); color: var(--text); }
.sidebar-nav a.is-active { background: var(--accent-soft); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.sidebar-nav a.is-active .icon { color: var(--accent); }
.sidebar-nav .icon, .sidebar-foot .icon { width: 18px; height: 18px; }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.sidebar-backdrop { display: none; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 28px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); }
.topbar-title { display: none; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.sidebar-toggle { display: none; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.user-chip:hover { border-color: var(--border-strong); }
.user-chip-text { display: grid; line-height: 1.2; text-align: left; }
.user-chip-name { font-size: 13px; font-weight: 700; }
.user-chip-role { color: color-mix(in srgb, var(--c) 75%, var(--text)); font-size: 11px; font-weight: 700; }
.avatar { flex: none; border-radius: 8px; background: var(--surface-3); image-rendering: pixelated; }
.avatar-letter { display: inline-grid; place-items: center; background: color-mix(in srgb, var(--c) 70%, #000); color: #fff; font-weight: 800; font-size: 14px; }
.admin-content { width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 32px 72px; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -.02em; }
.page-head p { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 75ch; margin: 0; color: var(--muted); }
.page-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.empty { display: grid; justify-items: center; gap: 6px; padding: 48px 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); text-align: center; }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 8px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); }
.empty-icon .icon { width: 26px; height: 26px; }
.empty h2 { margin: 0; font-size: 18px; }
.empty p { max-width: 440px; margin: 0; color: var(--muted); }
.empty-actions { margin-top: 12px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 24px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar select { width: auto; min-width: 190px; }
.toolbar-count { margin-left: auto; font-size: 14px; }
.search-input { position: relative; flex: 1 1 240px; max-width: 420px; }
.search-input .icon { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.search-input input { padding-left: 38px !important; }

/* -------------------------------------------------------- admin: dashboard */
.dash-section { margin-top: 28px; }
.section-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 12px; }
.section-title h2 { margin: 0; font-size: 18px; }
.view-as { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.view-as label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.view-as .icon { width: 16px; height: 16px; }
.view-as select { width: auto; min-height: 36px; }
.checklist { margin-bottom: 8px; }
.checklist ul { display: grid; gap: 2px; margin: 0; padding: 8px; list-style: none; }
.checklist a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; }
.checklist a:hover { background: var(--surface-2); }
.checklist a .icon { color: var(--accent); width: 18px; height: 18px; }

.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.server-card { display: grid; gap: 14px; padding: 18px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.server-card-head { display: flex; align-items: center; gap: 12px; }
.server-icon { width: 48px; height: 48px; flex: none; border-radius: 10px; background: var(--surface-2); image-rendering: pixelated; }
.server-name { flex: 1; min-width: 0; }
.server-name h3 { margin: 0; font-size: 16px; }
.server-address { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 0; border: 0; background: none; color: var(--muted); font: 13px var(--mono); cursor: pointer; text-align: left; }
.server-address:hover { color: var(--text); }
.status-badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 700; white-space: nowrap; }
.is-online .status-badge { background: color-mix(in srgb, var(--success) 15%, transparent); color: color-mix(in srgb, var(--success) 75%, var(--text)); }
.is-offline .status-badge { background: color-mix(in srgb, var(--danger) 15%, transparent); color: color-mix(in srgb, var(--danger) 75%, var(--text)); }
.server-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.server-stats div { min-width: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.server-stats dt { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.server-stats dd { display: -webkit-box; margin: 2px 0 0; overflow: hidden; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.35; overflow-wrap: anywhere; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.server-stats dd small { color: var(--muted); font-size: 12px; font-weight: 500; }
.server-card.is-loading .mc-motd, .server-card.is-loading .server-stats dd { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 8%, transparent), transparent) 0 0 / 200% 100%; animation: shimmer 1.3s infinite linear; border-radius: 6px; color: transparent; }
.player-list { display: flex; flex-wrap: wrap; gap: 6px; }
.player-list:empty { display: none; }
.player { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 3px; border-radius: 8px; background: var(--surface-2); font-size: 12px; font-weight: 600; }
.player img { width: 20px; height: 20px; border-radius: 4px; image-rendering: pixelated; }
.server-meta { margin: 0; font-size: 12px; }
.server-meta:empty { display: none; }
.server-test { display: grid; gap: 2px; margin-top: 6px; font-size: 13px; }
.server-test .is-ok { color: color-mix(in srgb, var(--success) 75%, var(--text)); }
.server-test .is-fail { color: color-mix(in srgb, var(--danger) 75%, var(--text)); }

.tile-group + .tile-group { margin-top: 22px; }
.tile-group-title { margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tile { --tile: var(--accent); position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 18px 16px 16px; overflow: hidden; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; transition: transform .15s, border-color .15s, box-shadow .15s; }
.tile::before { content: ""; position: absolute; inset: 0; background: radial-gradient(140px 90px at 0% 0%, color-mix(in srgb, var(--tile) 16%, transparent), transparent 70%); pointer-events: none; }
.tile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--tile) 55%, var(--border)); box-shadow: 0 12px 30px -12px color-mix(in srgb, var(--tile) 55%, transparent); }
.tile-icon { position: relative; flex: none; display: grid; place-items: center; width: 46px; height: 46px; padding: 10px; border-radius: 12px; background: color-mix(in srgb, var(--tile) 18%, transparent); color: var(--tile); }
.tile-icon .icon { width: 24px; height: 24px; }
.tile-icon:has(.icon-img) { padding: 5px; }
.tile-icon.show-letter::after { content: attr(data-letter); font-size: 20px; font-weight: 800; }
.tile-body { position: relative; display: grid; gap: 2px; min-width: 0; }
.tile-title { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.tile-desc { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.4; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile-lock { display: inline-flex; color: var(--muted); }
.tile-lock .icon { width: 14px; height: 14px; }
.status-dot { position: absolute; top: 12px; right: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.status-dot.is-up { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent); }
.status-dot.is-down { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); }
.status-dot.is-loading { animation: blink 1.2s infinite; }

/* ------------------------------------------------------------ admin: media */
.dropzone { margin-bottom: 20px; padding: 22px; border: 2px dashed var(--border-strong); border-radius: 16px; background: var(--surface); text-align: center; transition: border-color .15s, background-color .15s; }
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-inner > .icon { width: 34px; height: 34px; margin: 0 auto 6px; color: var(--accent); display: block; }
.dropzone p { margin: 4px 0; }
.dropzone-category { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; margin-top: 12px; font-size: 13px; }
.dropzone-category label { color: var(--muted); font-weight: 600; }
.dropzone-category input { width: 260px !important; min-height: 34px !important; }
.upload-list { display: grid; gap: 8px; margin-top: 12px; text-align: left; }
.upload-list:empty { display: none; }
.upload-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.upload-name { flex: 0 1 260px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.upload-bar { flex: 1; height: 6px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.upload-bar span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .2s; }
.upload-item.is-done .upload-bar span { background: var(--success); }
.upload-item.is-error { color: color-mix(in srgb, var(--danger) 80%, var(--text)); }
.upload-item.is-error .upload-bar { display: none; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.media-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.media-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.media-card.is-new { animation: pop .35s ease-out; border-color: var(--accent-border); }
.media-thumb { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 10px; border: 0; background: var(--checker); cursor: zoom-in; }
.media-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.media-badge { position: absolute; top: 8px; left: 8px; padding: 1px 7px; border-radius: 6px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 11px; font-weight: 800; }
.media-info { min-width: 0; padding: 10px 12px 2px; }
.media-title { overflow: hidden; font-weight: 600; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.media-meta { color: var(--muted); font-size: 12px; }
.media-actions { display: flex; gap: 2px; padding: 4px 6px 8px; }
.media-detail { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(290px, 1fr); gap: 20px; }
.media-detail-preview { display: grid; place-items: center; min-height: 320px; padding: 12px; border-radius: 12px; background: var(--checker); }
.media-detail-preview img { max-height: 62vh; width: auto; object-fit: contain; }
.media-detail-side { display: grid; align-content: start; gap: 16px; min-width: 0; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.action-grid .menu { left: 0; right: auto; }
.meta-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 13px; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; word-break: break-all; }
.manage-block { padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; }
.manage-block summary { display: flex; align-items: center; gap: 8px; padding: 12px 0; font-weight: 700; cursor: pointer; }
.manage-block summary .icon { width: 18px; height: 18px; color: var(--muted); }
.manage-block .form { gap: 10px; padding: 14px 0; border-top: 1px solid var(--border); }
.manage-block form:last-child { padding-bottom: 14px; }
.manage-block .btn { justify-self: start; }

/* -------------------------------------------------------- admin: links etc */
.quick-link { margin-bottom: 8px; }
.quick-link-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 10px; padding: 16px 20px; }
.quick-link-result { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 0 20px 18px; color: color-mix(in srgb, var(--success) 75%, var(--text)); font-weight: 600; }
.quick-link-result .copy-field { flex: 0 1 520px; color: var(--text); }

.md-editor { overflow: hidden; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--bg-soft); }
.md-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.md-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.md-toolbar .icon-btn { width: 32px; height: 32px; }
.md-spacer { flex: 1; }
.md-tabs { display: flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--surface-3); }
.md-tabs button { padding: 5px 10px; border: 0; border-radius: 7px; background: none; color: var(--muted); font: 600 13px var(--font); cursor: pointer; }
.md-tabs button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.md-editor textarea { min-height: 260px; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; font: 14px/1.65 var(--mono) !important; }
.md-preview { min-height: 260px; padding: 16px 18px; background: var(--surface); }
.md-help { border-top: 1px solid var(--border); font-size: 13px; }
.md-help summary { display: flex; align-items: center; gap: 6px; padding: 8px 12px; color: var(--muted); font-weight: 600; cursor: pointer; }
.md-help summary .icon { width: 16px; height: 16px; }
.md-help table { width: 100%; border-collapse: collapse; }
.md-help td { padding: 6px 12px; border-top: 1px solid var(--border); vertical-align: top; }
.md-help code { font-size: 12px; }

.icon-picker { display: grid; gap: 10px; }
.icon-picker-row { display: flex; align-items: center; gap: 8px; }
.icon-picker-row input { flex: 1; min-width: 0; }
.icon-preview { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 8px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--accent); }
.icon-preview .icon { width: 22px; height: 22px; }
.icon-preview:has(.icon-img) { padding: 4px; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 4px; max-height: 150px; padding: 6px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft); }
.icon-choice { position: relative; display: grid; place-items: center; height: 40px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text-2); cursor: pointer; }
.icon-choice:hover { background: var(--surface-2); color: var(--text); }
.icon-choice.is-selected { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.icon-choice small { position: absolute; bottom: 0; font-size: 9px; font-weight: 800; }
.icon-choice:has(small) .icon { margin-top: -8px; }

.media-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.media-pick { display: grid; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.media-pick:hover { border-color: var(--accent); }
.media-pick img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 6px; background: var(--checker); }
.media-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-soft); }
.perm-list { display: grid; gap: 8px; margin: 0; list-style: none; }
.perm-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.perm-list .is-yes .icon { color: var(--success); }
.perm-list .is-no { color: var(--muted); }
.perm-list .is-no .icon { color: var(--danger); }
.profile-summary { display: flex; align-items: center; gap: 14px; padding-bottom: 0 !important; }
.profile-summary .cell-title { margin-bottom: 4px; }

/* ---------------------------------------------------- login and installer */
body.bare { min-height: 100vh; background: radial-gradient(900px 520px at 50% -10%, var(--accent-soft), transparent), var(--bg); }
.bare-main { display: grid; place-items: center; min-height: 100vh; padding: 96px 16px 40px; }
.login-card { width: min(420px, 100%); padding: 32px; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-lg); text-align: center; }
.login-card h1 { margin: 0 0 4px; font-size: 24px; }
.login-card > p { margin: 0; }
.login-card .form { margin-top: 22px; text-align: left; }
.login-card .alert { margin: 18px 0 0; text-align: left; }
.login-logo img { width: 150px; margin: -100px auto 6px; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .45)); }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; color: var(--muted); font-size: 14px; text-decoration: none; }
.back-link:hover { color: var(--text); }
.back-link .icon { width: 16px; height: 16px; }
.install-card { width: min(780px, 100%); padding: 32px; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-lg); }
.install-logo { display: block; width: 120px; margin: -96px auto 6px; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .45)); }
.install-card > h1, .install-card > p { text-align: center; }
.install-card > h1 { margin: 0 0 4px; }
.install-card > p { margin: 0; }
.check-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px; margin: 22px 0; padding: 0; list-style: none; }
.check-list li { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.check-list .icon { width: 18px; height: 18px; margin-top: 1px; }
.check-list .is-ok .icon { color: var(--success); }
.check-list .is-fail { color: color-mix(in srgb, var(--danger) 80%, var(--text)); }
.check-list .is-warn .icon { color: var(--warning); }
.check-list small { display: block; color: var(--muted); }
.install-form { gap: 20px; }
.install-form fieldset { margin: 0; padding: 18px 20px 20px; border: 1px solid var(--border); border-radius: 16px; }
.install-form legend { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-weight: 800; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 13px; }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.radio-card { display: flex; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid var(--border-strong); border-radius: 12px; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.radio-card input { margin-top: 4px; accent-color: var(--accent); }
.radio-card small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }

.login-discord { display: grid; gap: 12px; justify-items: center; margin-top: 22px; }
.login-discord .btn .icon { width: 22px; height: 22px; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 -6px; color: var(--muted); font-size: 13px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.login-alt { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); text-align: left; }
.login-alt summary { color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; text-align: center; }
.login-alt .form { margin-top: 16px; }

/* ------------------------------------------------- shared: tabs and badges */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: 14px; text-decoration: none; }
.tabs a:hover { background: var(--surface-2); color: var(--text); }
.tabs a.is-active { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent-border); }
.tabs .icon { width: 16px; height: 16px; }
.tab-count { padding: 0 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.badge .icon-xs { width: 12px; height: 12px; }
.badge-discord { background: color-mix(in srgb, var(--discord) 18%, transparent); color: color-mix(in srgb, var(--discord) 70%, var(--text)); }
.badge-news { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.badge-changelog { background: color-mix(in srgb, var(--success) 16%, transparent); color: color-mix(in srgb, var(--success) 72%, var(--text)); }
.discord-tag { display: inline-flex; align-items: center; gap: 4px; color: color-mix(in srgb, var(--discord) 65%, var(--text)); }
.field-label { font-weight: 600; font-size: 14px; }
.check-sm { font-size: 13px; color: var(--muted); }
.check-sm input { width: 15px; height: 15px; }
.stack { display: grid; gap: 20px; align-content: start; }
.stack .card + .card { margin-top: 0; }
.section-sub { font-size: 13px; font-weight: 500; }
.avatar-discord { border-radius: 50%; image-rendering: auto; }

/* ----------------------------------------------------- admin: integrations */
.integrations { display: grid; gap: 20px; }
.integrations .card + .card { margin-top: 0; }
.integrations .card-head .badge { margin-left: auto; }
.form-card > .server-test { margin: 0; padding: 0 20px 16px; }
.steps { padding: 0 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-soft); font-size: 14px; }
.steps summary { display: flex; align-items: center; gap: 8px; padding: 12px 0; font-weight: 700; cursor: pointer; }
.steps summary .icon { width: 18px; height: 18px; color: var(--accent); }
.steps ol { display: grid; gap: 8px; margin: 0; padding: 4px 0 16px 20px; color: var(--text-2); }
.steps li::marker { color: var(--accent); font-weight: 700; }
.steps .copy-field { display: flex; margin: 6px 0; }
.steps .copy-field code { font-size: 13px; }
.mapping-list { display: grid; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.mapping-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mapping-list .icon-xs { color: var(--muted); }
.discord-account { display: flex; align-items: center; gap: 12px; }
.discord-account .avatar { border-radius: 50%; }

/* ------------------------------------------------------ admin: pterodactyl */
.ptero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.ptero-card { display: grid; gap: 14px; align-content: start; padding: 18px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.ptero-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ptero-icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: color-mix(in srgb, #0ea5e9 16%, transparent); color: #38bdf8; }
.ptero-title { flex: 1; min-width: 0; }
.ptero-title h3 { margin: 0; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.ptero-title p { margin: 0; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.is-busy .status-badge { background: color-mix(in srgb, var(--warning) 16%, transparent); color: color-mix(in srgb, var(--warning) 75%, var(--text)); }
.is-busy .dot { background: var(--warning); animation: blink 1.1s infinite; }
.meters { display: grid; gap: 10px; }
.meter-label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; font-size: 13px; }
.meter-label span:first-child { color: var(--muted); font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.meter-label span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.meter-bar { height: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.meter-bar span { display: block; height: 100%; border-radius: inherit; background: var(--success); transition: width .4s ease; }
.meter.is-warn .meter-bar span { background: var(--warning); }
.meter.is-high .meter-bar span { background: var(--danger); }
.ptero-card.is-loading .meter { height: 26px; border-radius: 8px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 8%, transparent), transparent) 0 0 / 200% 100%; animation: shimmer 1.3s infinite linear; }
.ptero-meta { margin: -4px 0 0; font-size: 12px; }
.ptero-error { margin: 0; color: color-mix(in srgb, var(--danger) 75%, var(--text)); font-size: 14px; }
.ptero-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.ptero-actions .btn .icon { width: 15px; height: 15px; }
.ptero-actions .btn:disabled { opacity: .4; cursor: not-allowed; filter: none; transform: none; }

/* ------------------------------------------------------------ public: team */
.team-page { display: grid; gap: 40px; padding: 40px 0 72px; }
.team-role { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 20px; }
.team-role-dot { width: 12px; height: 12px; border-radius: 4px; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); }
.team-role small { padding: 0 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 12px; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.team-card { position: relative; display: grid; justify-items: center; gap: 2px; padding: 22px 14px 18px; overflow: hidden; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: center; text-decoration: none; transition: transform .15s, border-color .15s; }
.team-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 70px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 22%, transparent), transparent); pointer-events: none; }
.team-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 50%, var(--border)); }
.team-head { position: relative; width: 80px; height: 80px; margin-bottom: 10px; image-rendering: pixelated; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .35)); }
.team-card h3 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.team-mc { margin: 0; color: var(--muted); font: 13px var(--mono); }
.team-title { margin: 6px 0 0; color: color-mix(in srgb, var(--c) 70%, var(--text)); font-size: 13px; font-weight: 600; }
.team-online { position: absolute; top: 10px; right: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--success) 16%, var(--surface)); color: color-mix(in srgb, var(--success) 75%, var(--text)); font-size: 11px; font-weight: 700; }
.team-online .dot { width: 7px; height: 7px; background: var(--success); }
.team-roles { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 8px 0 0; }
.chip input:disabled + span { opacity: .65; cursor: not-allowed; }

/* ------------------------------------------------------------ public: news */
.news-page { display: grid; gap: 24px; padding: 32px 0 72px; }
.news-page > .tabs { justify-self: start; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.news-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); transition: transform .15s, border-color .15s, box-shadow .15s; }
.news-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.news-cover { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.news-cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.news-card:hover .news-cover img { transform: scale(1.03); }
.news-cover.is-empty { display: grid; place-items: center; background: radial-gradient(240px 140px at 30% 20%, var(--accent-soft), transparent), var(--surface-2); color: var(--accent); }
.news-cover-icon .icon { width: 42px; height: 42px; opacity: .8; }
.news-body { display: grid; gap: 8px; padding: 16px 18px 20px; }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.news-body h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.news-body h3 a { color: var(--text); text-decoration: none; }
.news-body h3 a:hover { color: var(--accent); }
.news-body p { margin: 0; color: var(--text-2); font-size: 14px; }
.section-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; max-width: none; text-align: left; }
.post-hero { text-align: left; }
.post-hero .container { max-width: 800px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--muted); font-size: 14px; }
.post-author { display: flex; align-items: center; gap: 8px; margin-top: 10px !important; color: var(--text-2); font-size: 14px; }
.post-author img { border-radius: 6px; image-rendering: pixelated; }
.post-layout { max-width: 800px; padding: 32px 0 64px; }
.post-cover { display: block; width: 100%; max-height: 460px; margin-bottom: 28px; border-radius: 18px; object-fit: cover; box-shadow: var(--shadow); }
.post-layout .back-link { margin-top: 32px; }

/* ------------------------------------------------------------ public: bans */
.page-hero-actions { margin-top: 18px !important; }
.bans-page { display: grid; gap: 20px; padding: 32px 0 72px; }
.bans-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.bans-toolbar .search-input { flex: 0 1 300px; }
.ban-list { overflow: hidden; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); }
.ban-row { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(0, 2fr) minmax(120px, 1fr) 150px 140px; align-items: center; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 14px; }
.ban-list.no-staff .ban-row { grid-template-columns: minmax(150px, 1.1fr) minmax(0, 2fr) 150px 140px; }
.ban-row-head { border-top: 0; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.ban-row:not(.ban-row-head):hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.ban-player, .ban-staff { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.ban-player img { width: 32px; height: 32px; border-radius: 7px; image-rendering: pixelated; }
.ban-staff img { width: 20px; height: 20px; border-radius: 5px; image-rendering: pixelated; }
.ban-staff { color: var(--text-2); font-weight: 500; }
.ban-staff .icon { width: 18px; height: 18px; color: var(--muted); }
.ban-player a { overflow: hidden; color: var(--text); text-decoration: none; text-overflow: ellipsis; }
.ban-player a:hover { color: var(--accent); }
.ban-reason { color: var(--text-2); overflow-wrap: anywhere; }
.ban-date { color: var(--muted); font-size: 13px; }

/* -------------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 70; width: 276px; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  .sidebar-open .sidebar { transform: none; }
  .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(0, 0, 0, .55); }
  .sidebar-toggle { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .topbar-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .admin-content { padding: 22px 16px 56px; }
  .page-layout.has-toc { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .quick-link-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-grid; }
  .site-nav { position: absolute; top: 100%; left: -16px; right: -16px; flex-direction: column; align-items: stretch; gap: 2px; margin: 0; padding: 10px 16px 16px; border-bottom: 1px solid var(--border); background: var(--bg); box-shadow: var(--shadow-lg); display: none; }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px; }
  .nav-actions .btn span { display: none; }
}

@media (max-width: 720px) {
  body { font-size: 15px; }
  .form-grid, .grid-2, .media-detail, .radio-cards, .quick-link-form { grid-template-columns: minmax(0, 1fr); }
  .hide-sm { display: none; }
  .announcement .container > .icon { display: none; }
  .page-head h1 { font-size: 22px; }
  .user-chip-text { display: none; }
  .user-chip { padding: 3px; }
  .hero { padding: 40px 0 60px; }
  .section { padding: 48px 0; }
  .ip-box { flex-wrap: wrap; justify-content: center; padding: 10px; }
  .server-grid { grid-template-columns: minmax(0, 1fr); }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .install-card, .login-card { padding: 24px 18px; }
  .toolbar-count { margin-left: 0; }
  .action-grid { grid-template-columns: 1fr; }
  .modal-lg .modal-body { padding: 14px; }
  .ptero-grid { grid-template-columns: minmax(0, 1fr); }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .team-page { gap: 30px; }
  .bans-toolbar .search-input { flex: 1 1 100%; max-width: none; }
  .ban-row-head { display: none; }
  .ban-row, .ban-list.no-staff .ban-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 16px; }
  .ban-reason { grid-column: 1 / -1; }
  .ban-staff, .ban-date { font-size: 13px; }
  .ban-date { text-align: right; }
  .ban-state { grid-row: 1; grid-column: 2; }
}

/* ======================================================================
 * Version 1.2: players, community, content pages, statistics and extras
 * ==================================================================== */

/* One chart series in blue (checked for contrast on both surfaces); red stays reserved for the brand and errors. */
:root { --chart-1: #3987e5; }
[data-theme="light"] { --chart-1: #2a78d6; }

/* ------------------------------------------------- public: menu and header */
.nav-group { position: relative; }
.nav-group-toggle { display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; border: 0; border-radius: 10px; background: none; color: var(--text-2); font: 600 15px var(--font); cursor: pointer; }
.nav-group-toggle:hover, .nav-group.is-open .nav-group-toggle { background: var(--surface-2); color: var(--text); }
.nav-group.has-active .nav-group-toggle { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.nav-group-toggle .icon-xs { opacity: .6; transition: transform .15s; }
.nav-group.is-open .nav-group-toggle .icon-xs { transform: rotate(180deg); }
.nav-dropdown { position: absolute; left: 0; top: calc(100% + 6px); z-index: 45; display: none; min-width: 220px; padding: 6px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow-lg); }
.nav-dropdown::before { content: ""; position: absolute; inset: -8px 0 auto; height: 8px; }
.nav-group.is-open .nav-dropdown { display: grid; gap: 2px; }
.site-nav .nav-dropdown a { display: flex; width: 100%; padding: 9px 12px; font-size: 14px; }
@media (hover: hover) and (min-width: 861px) {
  .nav-group:hover .nav-dropdown { display: grid; gap: 2px; }
}
.player-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 180px; padding: 3px 12px 3px 3px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 700; text-decoration: none; }
.player-chip:hover { border-color: var(--border-strong); }
.player-chip .avatar { border-radius: 50%; image-rendering: pixelated; }
.player-chip .avatar-discord { image-rendering: auto; }
.player-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-switch { border-color: var(--border); font: 800 12px var(--font); letter-spacing: .04em; }
.footer-socials { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; margin-left: -8px; }
.footer-extra { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.footer-install { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 500; text-decoration: none; }
.footer-install:hover { color: var(--text); }
.footer-install .icon { width: 14px; height: 14px; }

/* ---------------------------------------------- public: page frames, search */
.card-page, .players-page, .stats-page, .events-page, .suggestions-page, .contest-page, .contact-page, .timeline-page, .faq-page,
.wiki-home, .commands-page, .rulebook-page, .search-page, .guide-page, .player-account { display: grid; gap: 24px; align-content: start; padding: 36px 0 72px; }
.container.narrow-page { width: min(820px, 100% - 32px); }
.section-label { margin: 8px 0 -8px; color: var(--muted); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.breadcrumb { margin: 0 0 8px !important; color: var(--muted); font-size: 14px; }
.breadcrumb a { color: var(--muted); font-weight: 600; text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.error-icon { width: 54px; height: 54px; color: var(--accent); }
.error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.news-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.mono { font-family: var(--mono) !important; font-size: 13px !important; }
.card-pad { margin: 0; padding: 16px 20px; }
.form-card > .inline-row { padding: 16px 20px; }
.inline-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.inline-row input:not([type="hidden"]), .inline-row select { flex: 1 1 170px; width: auto; }
.simple-list { display: grid; margin: 0; padding: 0; list-style: none; }
.simple-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 10px 20px; border-top: 1px solid var(--border); font-size: 14px; }
.simple-list li:first-child { border-top: 0; }
.form .simple-list li { padding-inline: 0; }
.simple-list a { color: var(--text); font-weight: 600; text-decoration: none; }
.simple-list a:hover { color: var(--accent); }
.simple-list .avatar { vertical-align: middle; border-radius: 4px; }
.simple-list-meta { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.checkbox-list { display: grid; gap: 8px; }
.hp-field { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.hero-search { position: relative; display: flex; align-items: center; gap: 8px; width: min(580px, 100%); margin: 22px auto 0; text-align: left; }
.hero-search > .icon { position: absolute; left: 15px; top: 24px; width: 18px; height: 18px; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.hero-search input[type="search"] { flex: 1; min-width: 0; min-height: 48px !important; padding-left: 42px !important; border-radius: 14px !important; background: var(--surface) !important; font-size: 16px !important; }
.hero-search .btn { min-height: 48px; border-radius: 14px; }
.search-suggestions { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; display: grid; gap: 2px; padding: 6px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow-lg); }
.search-suggestion { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); font-weight: 600; text-decoration: none; }
.search-suggestion:hover, .search-suggestion.is-active { background: var(--surface-2); }
.search-suggestion img { border-radius: 5px; image-rendering: pixelated; }
.search-suggestion-note { margin: 0; padding: 8px 10px; color: var(--muted); font-size: 14px; }
.search-group h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 17px; }
.search-group h2 .icon { width: 18px; height: 18px; color: var(--accent); }
.search-results { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.search-results a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s; }
.search-results a:hover { border-color: var(--accent-border); }
.search-results img { flex: none; border-radius: 5px; image-rendering: pixelated; }
.search-results span { display: grid; min-width: 0; }
.search-results small { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------ public: players */
.player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.player-card { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 700; text-decoration: none; transition: transform .15s, border-color .15s; }
.player-card:hover { transform: translateY(-2px); border-color: var(--accent-border); }
.player-card img { flex: none; width: 44px; height: 44px; image-rendering: pixelated; }
.player-card > span:last-child { display: grid; min-width: 0; overflow-wrap: anywhere; }
.player-card small { color: var(--muted); font-size: 13px; font-weight: 500; }
.player-rank { position: absolute; top: 8px; right: 10px; color: var(--muted); font: 800 12px var(--mono); }

.profile-hero { padding: 36px 0 30px; border-bottom: 1px solid var(--border); background: radial-gradient(640px 260px at 22% 20%, var(--accent-soft), transparent); }
.profile-head { display: flex; align-items: center; gap: 36px; }
.profile-info { display: grid; justify-items: start; gap: 10px; min-width: 0; }
.profile-info h1 { margin: 0; font-size: clamp(32px, 5vw, 50px); letter-spacing: -.02em; line-height: 1.1; overflow-wrap: anywhere; }
.profile-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.profile-title { margin: -4px 0 0; color: var(--text-2); font-weight: 600; }
.profile-dates { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; }
.profile-dates dt { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.profile-dates dd { margin: 0; font-weight: 600; }
.profile-body { display: grid; gap: 34px; padding: 32px 0 72px; }
.profile-section h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 20px; }
.profile-section h2 .icon { color: var(--accent); }
.profile-section > p { margin: 0; color: var(--text-2); }
.rank-prefix { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 7px; background: #15100f; color: #fff; font: 700 13px/1.5 var(--mono); white-space: nowrap; }
.clean-record { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: color-mix(in srgb, var(--success) 75%, var(--text)); font-weight: 600; }
.clean-record .icon { color: var(--success); }
.ban-list-compact .ban-row { grid-template-columns: 130px minmax(0, 2fr) 120px 120px; }

/* 3D skin viewer (built by app.js; the flat picture stays when 3D is not possible) */
.skin-stage { position: relative; flex: none; display: grid; place-items: center; width: 220px; height: 290px; border-radius: 24px; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent); perspective: 900px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.skin-stage.is-3d { cursor: grab; }
.skin-stage.is-dragging { cursor: grabbing; }
.skin-stage.is-3d::after { content: ""; position: absolute; left: 50%; bottom: 18px; width: 120px; height: 20px; margin-left: -60px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .45), transparent); pointer-events: none; }
.skin-fallback { width: auto; height: 240px; image-rendering: pixelated; filter: drop-shadow(0 18px 20px rgba(0, 0, 0, .4)); }
.skin-model { position: absolute; left: 50%; top: 50%; z-index: 1; transform-style: preserve-3d; }
.skin-part, .skin-layer { position: absolute; left: 0; top: 0; transform-style: preserve-3d; }
.skin-face { position: absolute; left: 0; top: 0; background-repeat: no-repeat; image-rendering: crisp-edges; image-rendering: pixelated; }

/* ----------------------------------------------------- stat tiles, badges */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; }
.stat-tile { display: grid; align-content: start; gap: 2px; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.stat-tile strong { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat-note { color: var(--muted); font-size: 13px; }
.stat-tiles-compact { padding: 0 20px 20px; }
.stat-tiles-compact .stat-tile { padding: 12px 14px; border-color: transparent; background: var(--surface-2); }
.stat-tiles-compact .stat-tile strong { font-size: 20px; }
.record-card { display: flex; align-items: center; gap: 18px; padding: 20px 22px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 11%, var(--surface)), var(--surface) 60%); }
.record-card > div { display: grid; }
.record-icon { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px; background: color-mix(in srgb, var(--gold) 18%, transparent); color: color-mix(in srgb, var(--gold) 85%, var(--text)); }
.record-icon .icon { width: 26px; height: 26px; }
.hero-figure { font-size: 42px; font-weight: 900; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.badge-card { --c: var(--accent); display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "icon name" "icon desc" "bar bar"; align-items: center; gap: 2px 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.badge-card:not(.is-earned) { opacity: .62; filter: grayscale(.85); }
.badge-card.is-earned { border-color: color-mix(in srgb, var(--c) 42%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, var(--c) 12%, var(--surface)), var(--surface) 70%); }
.badge-card-icon { grid-area: icon; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); font-size: 22px; }
.badge-card-icon .icon { width: 22px; height: 22px; }
.badge-card-name { grid-area: name; font-weight: 700; line-height: 1.3; }
.badge-card-desc { grid-area: desc; color: var(--muted); font-size: 13px; line-height: 1.35; }
.badge-progress { grid-area: bar; height: 5px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.badge-progress span { display: block; height: 100%; border-radius: inherit; background: var(--c); }
.badge-dot { --c: var(--accent); display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.badge-dot .icon { width: 16px; height: 16px; }
.entry-mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.entry-mini { display: grid; overflow: hidden; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; }
.entry-mini:hover { border-color: var(--accent-border); }
.entry-mini img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.entry-mini span { display: grid; padding: 10px 12px; }
.entry-mini small { color: var(--muted); }

/* ------------------------------------------------------------------ charts */
.chart { margin: 0; padding: 18px 20px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.chart figcaption { display: grid; gap: 2px; margin-bottom: 14px; }
.chart figcaption strong { font-size: 16px; }
.chart figcaption span { color: var(--muted); font-size: 13px; }
.chart-line:focus-visible { outline-offset: 3px; }
.chart-canvas { position: relative; min-height: 190px; touch-action: pan-y; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-gridline { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }
.chart-axis { stroke: var(--border-strong); stroke-width: 1; shape-rendering: crispEdges; }
.chart-label { fill: var(--muted); font: 12px var(--font); font-variant-numeric: tabular-nums; }
.chart-stroke { fill: none; stroke: var(--chart-1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: var(--chart-1); fill-opacity: .1; }
.chart-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-dot { fill: var(--chart-1); stroke: var(--surface); stroke-width: 2; }
.chart-table { margin-top: 10px; font-size: 13px; }
.chart-table summary { width: max-content; color: var(--muted); font-weight: 600; cursor: pointer; }
.chart-table .table-wrap { max-height: 280px; margin-top: 8px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.chart-table table { width: 100%; border-collapse: collapse; }
.chart-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); }
.chart-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.chart-tip { position: fixed; z-index: 400; display: grid; gap: 1px; max-width: 260px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow-lg); color: var(--text); font-size: 13px; pointer-events: none; }
.chart-tip-label { color: var(--muted); font-size: 12px; }
.chart-tip strong { font-variant-numeric: tabular-nums; }
.bar-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 200px) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 5px 6px; border-radius: 8px; font-size: 14px; }
.bar-row:hover, .bar-row:focus-visible { background: var(--surface-2); }
.bar-label { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.bar-label > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label a { color: var(--text); text-decoration: none; }
.bar-label a:hover { color: var(--accent); }
.bar-label img { flex: none; border-radius: 4px; image-rendering: pixelated; }
.bar-track { height: 18px; border-left: 1px solid var(--border-strong); }
.bar-fill { display: block; min-width: 2px; height: 100%; border-radius: 0 4px 4px 0; background: var(--chart-1); }
.bar-value { color: var(--text-2); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; margin-bottom: 20px; }
.range-filter { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); }
.range-filter a { display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 8px; color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none; }
.range-filter a:hover { color: var(--text); }
.range-filter a.is-active { background: var(--accent-soft); color: var(--text); }

/* ------------------------------------------------- homepage strips & cards */
.countdown-banner { border-bottom: 1px solid var(--border); background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, var(--bg-soft)), var(--bg-soft) 70%); }
.countdown-banner .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 20px; padding: 14px 0; }
.countdown-title { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.countdown-title .icon { color: var(--accent); }
.countdown-title a { color: var(--text); }
.countdown-units { display: inline-flex; flex-wrap: wrap; gap: 8px; font-weight: 800; }
.countdown-unit { display: grid; justify-items: center; min-width: 58px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.countdown-unit strong { font-size: 20px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.countdown-unit small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.countdown-card { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-bottom: 28px; padding: 18px 20px; border-radius: var(--radius-lg); border: 1px solid var(--accent-border); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.countdown-label { font-weight: 800; }
.countdown-card .btn { margin-left: auto; }
.countdown-card.is-live { border-color: color-mix(in srgb, var(--success) 45%, transparent); background: color-mix(in srgb, var(--success) 9%, var(--surface)); }
.online-strip { border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.online-strip .container { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.online-label { display: inline-flex; flex: none; align-items: center; gap: 8px; color: var(--text-2); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.online-label .dot { background: var(--success); animation: pulse 2s infinite; }
.online-heads { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.online-head { display: block; width: 32px; height: 32px; overflow: hidden; border-radius: 7px; transition: transform .15s; }
.online-head:hover { transform: translateY(-2px) scale(1.08); }
.online-head img { display: block; width: 32px; height: 32px; image-rendering: pixelated; }
.online-more { margin-left: 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
.live-strip { border-bottom: 1px solid var(--border); background: color-mix(in srgb, #9146ff 7%, var(--bg-soft)); }
.live-strip .container { display: flex; flex-wrap: wrap; gap: 10px; padding: 10px 0; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 13px; text-decoration: none; }
.live-pill:hover { border-color: var(--accent-border); }
.live-pill img { flex: none; border-radius: 50%; }
.live-pill strong { white-space: nowrap; }
.live-pill .muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-badge { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 6px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 900; letter-spacing: .06em; line-height: 1.6; }

.poll-card, .potm-card { max-width: 720px; margin: 0 auto; padding: 26px; border-radius: 22px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.poll-kicker { display: inline-flex; align-items: center; gap: 8px; color: color-mix(in srgb, var(--accent) 80%, var(--text)); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.poll-kicker .icon { width: 16px; height: 16px; }
.poll-card h2 { margin: 6px 0 18px; font-size: clamp(20px, 2.6vw, 26px); }
.poll-options { display: grid; gap: 8px; }
.poll-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--bg-soft); color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; transition: border-color .15s, background-color .15s; }
.poll-option:not(:disabled):hover { border-color: var(--accent-border); background: var(--accent-soft); }
.poll-option:disabled { cursor: default; }
.poll-option-bar { display: none; grid-column: 1 / -1; grid-row: 2; height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.has-results .poll-option-bar { display: block; }
.poll-option-bar span { display: block; width: 0; height: 100%; border-radius: 0 4px 4px 0; background: var(--chart-1); transition: width .5s ease; }
.poll-option-value { grid-column: 2; grid-row: 1; color: var(--text-2); font-variant-numeric: tabular-nums; }
.poll-option.is-voted { border-color: var(--accent); }
.poll-option.is-voted .poll-option-label::after { content: " ✓"; color: var(--accent); }
.poll-note { margin: 14px 0 0; font-size: 14px; }
.potm-card { display: flex; align-items: center; gap: 26px; background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 10%, var(--surface)), var(--surface) 65%); }
.potm-head { flex: none; width: 120px; height: 120px; image-rendering: pixelated; filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .35)); }
.potm-card .poll-kicker { color: color-mix(in srgb, var(--gold) 70%, var(--text)); }
.potm-body { min-width: 0; }
.potm-body h2 { margin: 4px 0 8px; font-size: 28px; }
.potm-body .prose { margin-bottom: 12px; font-size: 15px; }

/* ------------------------------------------------------- public: contact */
.discord-duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 18px; }
.discord-card { --c: var(--discord); display: grid; align-content: start; justify-items: start; gap: 10px; padding: 24px; border-radius: 20px; border: 1px solid color-mix(in srgb, var(--c) 35%, var(--border)); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 14%, var(--surface)), var(--surface) 65%); }
.discord-card-support { --c: var(--accent); }
.discord-card-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; background: color-mix(in srgb, var(--c) 22%, transparent); color: color-mix(in srgb, var(--c) 80%, var(--text)); }
.discord-card-icon .icon { width: 26px; height: 26px; }
.discord-card h2, .discord-card h3 { margin: 0; font-size: 20px; }
.discord-card p { margin: 0; color: var(--text-2); }
.discord-card .btn { margin-top: 6px; }
.discord-count { display: inline-flex; align-items: center; gap: 8px; color: var(--muted) !important; font-size: 13px; font-weight: 600; }
.discord-count .dot { background: var(--success); }
.where-to h2 { margin: 0 0 12px; font-size: 20px; }
.where-to ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.where-to li { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 14px; }
.where-to li > .icon { flex: none; margin-top: 2px; color: var(--accent); }
.where-to strong { display: block; color: var(--text); }
.contact-form { width: 100%; max-width: 760px; margin: 0 auto; }

/* ---------------------------------------------- public: creators, partners */
.creator-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.creator-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 8px 16px; padding: 18px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); }
.creator-card.is-live { border-color: color-mix(in srgb, #dc2626 55%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, #dc2626 14%, transparent); }
.creator-image { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.creator-card.is-live .creator-image { box-shadow: 0 0 0 3px #dc2626; }
.creator-body h2 { margin: 0; font-size: 17px; }
.creator-body p { margin: 4px 0 0; font-size: 14px; }
.creator-platform { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px !important; font-weight: 600; }
.live-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--text-2); }
.creator-card > .btn { grid-column: 2; justify-self: start; }
.partner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.partner-card { display: grid; justify-items: center; align-content: start; gap: 8px; padding: 24px 18px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); text-align: center; }
.partner-logo { width: 88px; height: 88px; border-radius: 18px; object-fit: contain; }
.partner-logo-letter { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 36px; font-weight: 900; }
.partner-card h2 { margin: 4px 0 0; font-size: 18px; }
.partner-card p { margin: 0; font-size: 14px; }
.partner-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.partner-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.partner-chip { display: grid; place-items: center; min-width: 120px; height: 72px; padding: 10px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 700; text-decoration: none; transition: border-color .15s, transform .15s; }
.partner-chip:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.partner-chip img { width: auto; max-width: 140px; max-height: 52px; object-fit: contain; opacity: .85; filter: grayscale(1); transition: filter .15s, opacity .15s; }
.partner-chip:hover img { opacity: 1; filter: none; }

/* ------------------------------------------------------ public: history */
.timeline { position: relative; width: 100%; max-width: 760px; margin: 0 auto; padding: 0; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 21px; top: 8px; bottom: 8px; width: 2px; background: var(--border-strong); }
.timeline-year { position: relative; margin: 26px 0 14px; }
.timeline-year:first-child { margin-top: 0; }
.timeline-year span { display: inline-block; padding: 3px 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: 800; }
.timeline-item { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.timeline-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); color: var(--accent); font-size: 20px; }
.timeline-dot .icon { width: 20px; height: 20px; }
.timeline-dot .icon-img { width: 26px; height: 26px; }
.timeline-item.is-auto .timeline-dot { border-style: dashed; }
.timeline-body { padding: 14px 18px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.timeline-body time { color: var(--muted); font-size: 13px; font-weight: 600; }
.timeline-body h2 { margin: 2px 0 6px; font-size: 18px; }
.timeline-body .prose { font-size: 15px; }
.timeline-image { margin-top: 10px; border-radius: 12px; }

/* ------------------------------------------------- public: FAQ, wiki, guide */
.faq-group h2 { margin: 0 0 12px; font-size: 20px; }
.faq-item { scroll-margin-top: 90px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.faq-item + .faq-item { margin-top: 8px; }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; font-weight: 700; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { flex: none; color: var(--muted); transition: transform .2s; }
.faq-item[open] { border-color: var(--border-strong); }
.faq-item[open] summary .icon { transform: rotate(180deg); }
.faq-item:target { border-color: var(--accent-border); }
.faq-item .prose { padding: 0 18px 16px; font-size: 15px; }
.wiki-categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.wiki-category { padding: 20px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); }
.wiki-category h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 18px; }
.wiki-category-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.wiki-category-icon .icon { width: 20px; height: 20px; }
.wiki-category > p { margin: 0 0 8px; font-size: 14px; }
.wiki-category ul { display: grid; gap: 2px; margin: 8px 0 0; padding: 0; list-style: none; }
.wiki-category li a { display: block; margin: 0 -10px; padding: 6px 10px; border-radius: 8px; color: var(--text-2); font-weight: 600; text-decoration: none; }
.wiki-category li a:hover { background: var(--surface-2); color: var(--text); }
.wiki-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 200px; gap: 40px; padding: 36px 0 72px; }
.wiki-layout:not(:has(> .toc)) { grid-template-columns: 220px minmax(0, 1fr); }
.wiki-nav, .handbook-nav { position: sticky; top: 92px; align-self: start; display: grid; gap: 2px; font-size: 14px; }
.wiki-nav-title { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.wiki-nav-title:first-child { margin-top: 0; }
.wiki-nav-title .icon { width: 14px; height: 14px; }
.wiki-nav a, .handbook-nav a { padding: 6px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; text-decoration: none; }
.wiki-nav a:hover, .handbook-nav a:hover { background: var(--surface-2); color: var(--text); }
.wiki-nav a.is-active, .handbook-nav a.is-active { background: var(--accent-soft); color: var(--text); font-weight: 700; }
.guide-progress { position: sticky; top: 80px; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); font-weight: 700; font-variant-numeric: tabular-nums; }
.guide-progress-bar { flex: 1; height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.guide-progress-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--success); transition: width .3s ease; }
.guide-steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.guide-step { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: 18px 20px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); transition: border-color .2s; }
.guide-step.is-done { border-color: color-mix(in srgb, var(--success) 40%, var(--border)); }
.guide-step.is-done .guide-body { opacity: .72; }
.guide-check { position: relative; display: grid; place-items: center; width: 40px; height: 40px; cursor: pointer; }
.guide-check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.guide-number { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--border-strong); color: var(--text-2); font-weight: 800; transition: background-color .2s, border-color .2s; }
.guide-check input:checked + .guide-number { border-color: var(--success); background: var(--success); color: #fff; font-size: 0; }
.guide-check input:checked + .guide-number::after { content: "✓"; font-size: 18px; }
.guide-check input:focus-visible + .guide-number { outline: 2px solid var(--accent); outline-offset: 2px; }
.guide-body h2 { margin: 6px 0; font-size: 19px; }
.guide-body .prose { font-size: 15px; }
.guide-image { margin-top: 12px; border-radius: 12px; }
.guide-done { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--success) 40%, transparent); background: color-mix(in srgb, var(--success) 10%, var(--surface)); }
.guide-done .icon { width: 26px; height: 26px; color: var(--success); }

/* ------------------------------------------ public: commands and rulebook */
.rank-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-button { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2); font: 600 13px var(--font); cursor: pointer; }
.chip-button:hover { color: var(--text); }
.chip-button.is-active { border-color: var(--accent-border); background: var(--accent-soft); color: var(--text); }
.command-group h2, .rulebook-group h2 { margin: 0 0 10px; font-size: 18px; }
.command-list { overflow: hidden; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.command-row { display: grid; grid-template-columns: minmax(180px, 300px) minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--border); }
.command-row:first-child { border-top: 0; }
.command-code { display: inline-flex; align-items: center; gap: 8px; justify-self: start; max-width: 100%; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.command-code:hover { border-color: var(--accent-border); }
.command-code code { font: 600 14px var(--mono); overflow-wrap: anywhere; }
.command-code .icon { color: var(--muted); }
.command-text { color: var(--text-2); font-size: 14px; }
.rulebook-table td:not(:first-child), .rulebook-table th:not(:first-child) { width: 19%; }
.rulebook-table td strong { color: var(--text); }

/* -------------------------------------------------------- public: events */
.event-list { display: grid; gap: 10px; }
.event-list.is-past { opacity: .72; }
.event-card { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; transition: transform .15s, border-color .15s; }
.event-card:hover { transform: translateY(-1px); border-color: var(--accent-border); }
.event-card.is-live { border-color: color-mix(in srgb, #dc2626 50%, var(--border)); }
.event-date { flex: none; display: grid; justify-items: center; width: 56px; padding: 6px 0; border-radius: 12px; background: var(--accent-soft); line-height: 1.1; }
.event-day { font-size: 22px; font-weight: 900; }
.event-month { color: color-mix(in srgb, var(--accent) 70%, var(--text)); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.event-body { display: grid; flex: 1; min-width: 0; }
.event-body strong { font-size: 16px; }
.event-body .muted { font-size: 14px; }
.event-countdown { flex: none; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 700; white-space: nowrap; }
.event-countdown:empty { display: none; }
.badge-event { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.event-when-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px !important; color: var(--text-2); font-weight: 600; }
.event-when-line .icon { width: 18px; height: 18px; color: var(--accent); }

/* ------------------------------------------------------ public: contests */
.contest-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; margin-top: 10px !important; color: var(--text-2); font-size: 14px; }
.contest-meta span { display: inline-flex; align-items: center; gap: 6px; }
.contest-intro, .contest-submit { width: 100%; max-width: 820px; }
.contest-intro .post-cover { margin-bottom: 20px; }
.vote-bar { position: sticky; top: 80px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--accent-border); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); font-weight: 700; }
.podium { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 16px; }
.podium-place { display: grid; flex: 1 1 220px; max-width: 320px; justify-items: center; gap: 6px; padding: 18px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); text-align: center; }
.podium-place.place-1 { order: 2; padding-top: 28px; border-color: color-mix(in srgb, var(--gold) 55%, var(--border)); background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 14%, var(--surface)), var(--surface)); }
.podium-place.place-2 { order: 1; }
.podium-place.place-3 { order: 3; }
.podium-rank { font-size: 34px; line-height: 1; }
.podium-place img { width: 100%; aspect-ratio: 16 / 10; border-radius: 12px; object-fit: cover; }
.podium-place strong { font-size: 16px; }
.entry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.entry-card { display: flex; flex-direction: column; overflow: hidden; scroll-margin-top: 150px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); }
.entry-card:target { border-color: var(--accent-border); }
.entry-image img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.entry-thumbs { display: flex; gap: 4px; padding: 4px 4px 0; }
.entry-thumbs a { flex: 1; }
.entry-thumbs img { display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: 6px; object-fit: cover; }
.entry-body { display: grid; flex: 1; align-content: start; gap: 6px; padding: 14px 16px; }
.entry-body h3 { margin: 0; font-size: 17px; }
.entry-body p { margin: 0; font-size: 14px; }
.entry-place { color: color-mix(in srgb, var(--gold) 80%, var(--text)); }
.entry-author { display: inline-flex; align-items: center; gap: 6px; justify-self: start; color: var(--text-2); font-size: 14px; font-weight: 600; text-decoration: none; }
.entry-author img { border-radius: 4px; image-rendering: pixelated; }
.vote-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin: 0 16px 16px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: 700 14px var(--font); cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.vote-button:hover:not(:disabled) { border-color: var(--accent-border); }
.vote-button.is-voted { border-color: transparent; background: var(--accent); color: var(--on-accent); }
.vote-button.is-voted .icon { fill: currentColor; }
.vote-button:disabled { opacity: .5; cursor: not-allowed; }
.vote-button .icon { width: 18px; height: 18px; }
.entry-votes { display: inline-flex; align-items: center; gap: 6px; margin: 0 16px 16px; color: var(--text-2); font-size: 14px; font-weight: 700; }

/* --------------------------------------------------- public: suggestions */
.suggestions-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.suggestions-page > .back-link { justify-self: start; margin-top: 0; }
.suggestions-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 24px; }
.suggestion-list { display: grid; gap: 12px; }
.suggestion-form { position: sticky; top: 88px; }
.suggestion-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.upvote { display: grid; justify-items: center; align-content: center; width: 56px; min-height: 64px; padding: 6px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: 800 16px var(--font); font-variant-numeric: tabular-nums; cursor: pointer; transition: border-color .15s, background-color .15s; }
.upvote:hover:not(:disabled) { border-color: var(--accent-border); }
.upvote.is-voted { border-color: var(--accent); background: var(--accent-soft); }
.upvote:disabled { opacity: .6; cursor: default; }
.upvote-icon { width: 22px; height: 22px; color: var(--muted); transform: rotate(180deg); }
.upvote.is-voted .upvote-icon { color: var(--accent); }
.suggestion-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; }
.suggestion-body { min-width: 0; }
.suggestion-body h2 { margin: 6px 0 4px; font-size: 18px; }
.suggestion-body h2 a { color: var(--text); text-decoration: none; }
.suggestion-body h2 a:hover { color: var(--accent); }
.suggestion-body > p { margin: 0 0 8px; color: var(--text-2); font-size: 15px; overflow-wrap: anywhere; }
.suggestion-body > p.suggestion-author { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.suggestion-author img { border-radius: 3px; image-rendering: pixelated; }
.staff-reply { margin-top: 10px; padding: 12px 14px; border-left: 3px solid var(--accent); border-radius: 12px; background: var(--surface-2); }
.staff-reply-label { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; color: var(--text); font-size: 13px; font-weight: 800; }
.staff-reply-label .icon { color: var(--accent); }
.staff-reply .prose { font-size: 14px; }

/* ---------------------------------------------- public: player login/account */
.login-explain { display: grid; justify-items: center; gap: 14px; max-width: 540px; margin: 0 auto; padding: 32px; text-align: center; }
.login-explain h1 { margin: 0; font-size: 24px; }
.login-explain p { margin: 0; }
.login-explain .back-link { margin-top: 4px; }
.login-explain-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: color-mix(in srgb, var(--discord) 20%, transparent); color: var(--discord); }
.login-explain-icon .icon { width: 34px; height: 34px; }
.login-card .login-explain-icon { margin: 0 auto 12px; background: var(--accent-soft); color: var(--accent); }
.check-list-plain { display: grid; gap: 8px; margin: 4px 0; padding: 0; list-style: none; text-align: left; }
.check-list-plain li { display: flex; gap: 10px; color: var(--text-2); font-size: 14px; }
.check-list-plain .icon { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--success); }
.player-account > .btn { justify-self: start; }
.player-account .card + .card { margin-top: 0; }

/* ------------------------------------------------------------ video embeds */
.video-embed { position: relative; margin: 0 0 1.2em; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 14px; border: 1px solid var(--border); background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* --------------------------------------------- seasons and the easter egg */
.season-fx, .cherry-rain { position: fixed; inset: 0; z-index: 60; overflow: hidden; pointer-events: none; }
.cherry-rain { z-index: 250; }
.season-bit { position: absolute; top: -40px; left: var(--x); font-size: var(--size); line-height: 1; opacity: .7; animation: season-fall var(--time) linear var(--delay) infinite; will-change: transform; }
@keyframes season-fall { to { transform: translate3d(var(--drift), calc(100vh + 80px), 0) rotate(260deg); } }
.season-winter .season-bit { color: #d6ebff; text-shadow: 0 0 6px rgba(150, 200, 255, .6); }
[data-theme="light"] .season-winter .season-bit { color: #7fb0e6; }
.season-newyear .season-bit { color: var(--gold); }
.season-halloween .season-bit { opacity: .5; }
.season-spring .season-bit { color: #f9a8d4; }
.season-kingsday .season-bit { width: 8px; height: 13px; border-radius: 2px; background: #ff7a00; }
.season-kingsday .season-bit:nth-child(4n) { background: #ae1c28; }
.season-kingsday .season-bit:nth-child(4n + 1) { background: #21468b; }
.season-halloween .hero-glow { background: radial-gradient(520px 360px at 50% 34%, rgba(249, 115, 22, .32), transparent 70%), radial-gradient(460px 300px at 12% 8%, rgba(147, 51, 234, .16), transparent 70%); }
.season-winter .hero-glow { background: radial-gradient(520px 360px at 50% 34%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%), radial-gradient(520px 320px at 85% 10%, rgba(150, 200, 255, .16), transparent 70%); }
.season-kingsday .hero-glow { background: radial-gradient(520px 360px at 50% 34%, rgba(255, 122, 0, .3), transparent 70%); }
.cherry { position: absolute; top: -60px; left: var(--x); font-size: var(--size); line-height: 1; animation: cherry-fall var(--time) cubic-bezier(.35, .1, .6, 1) var(--delay) forwards; }
@keyframes cherry-fall { to { transform: translateY(calc(100vh + 120px)) rotate(var(--spin)); } }

/* -------------------------------------------------------- dashboard additions */
.sidebar-group { margin: 16px 12px 4px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-nav > .sidebar-group:first-child { margin-top: 4px; }
.search-trigger { display: inline-flex; align-items: center; gap: 10px; min-width: 250px; height: 38px; padding: 0 6px 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: 500 14px var(--font); cursor: pointer; transition: border-color .15s; }
.search-trigger:hover { border-color: var(--border-strong); color: var(--text-2); }
.search-trigger .icon { width: 17px; height: 17px; }
.search-trigger kbd { margin-left: auto; color: var(--muted); font-size: 11px; }
.palette { width: min(640px, calc(100vw - 32px)); max-height: min(560px, 76vh); margin: 11vh auto auto; }
.palette-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.palette-bar > .icon { color: var(--muted); }
.palette-bar input { min-height: 44px !important; padding: 8px 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; font-size: 16px !important; }
.palette-bar input::-webkit-search-cancel-button { display: none; }
.palette-results { flex: 1; min-height: 140px; padding: 6px; overflow-y: auto; }
.palette-group { padding: 10px 10px 4px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; }
.palette-item.is-active { background: var(--accent-soft); }
.palette-icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); color: var(--text-2); }
.palette-icon .icon { width: 18px; height: 18px; }
.palette-item.is-active .palette-icon { color: var(--accent); }
.palette-text { display: grid; min-width: 0; }
.palette-label { font-size: 14px; font-weight: 600; }
.palette-sub { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.palette-empty { margin: 0; padding: 22px 12px; text-align: center; }
.palette-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.palette-foot kbd { margin-right: 3px; }
.admin-tabs { margin-bottom: 20px; }
.tile-wrap { position: relative; display: grid; }
.tile-fav { position: absolute; right: 8px; bottom: 8px; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s, color .15s, background-color .15s; }
.tile-wrap:hover .tile-fav, .tile-fav:focus-visible, .tile-fav.is-favorite { opacity: 1; }
.tile-fav:hover { background: var(--surface-2); color: var(--gold); }
.tile-fav.is-favorite { color: var(--gold); }
.tile-fav.is-favorite .icon { fill: currentColor; }
.tile-fav .icon { width: 16px; height: 16px; }
@media (hover: none) { .tile-fav { opacity: .75; } }
.announcement-alert .icon-btn { flex: none; margin: -6px -6px 0 auto; }
.announcement-body { display: grid; flex: 1; gap: 4px; min-width: 0; }
.announcement-body .prose { color: var(--text-2); font-size: 14px; }
.announcement-body .muted { font-size: 12px; }
.announcement-alert.is-leaving { opacity: .4; transition: opacity .2s; }
.dash-duo { margin-top: 20px; }
.team-ingame { display: grid; gap: 2px; margin: 0; padding: 8px; list-style: none; }
.team-ingame li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; font-size: 14px; }
.team-ingame li:hover { background: var(--surface-2); }
.team-ingame .avatar { border-radius: 5px; }
.team-ingame .cell-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-ingame .muted { font-size: 13px; white-space: nowrap; }
.card-link { display: flex; align-items: center; gap: 6px; padding: 12px 20px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 14px; font-weight: 600; text-decoration: none; }
.card-link:hover { color: var(--accent); }
.live-hint { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12px; font-weight: 700; }
.live-hint .dot { width: 8px; height: 8px; background: var(--success); animation: pulse 2s infinite; }
.punishment-list { display: grid; margin: 0; padding: 4px 0; list-style: none; }
.punishment-list li { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--border); font-size: 14px; }
.punishment-list li:first-child { border-top: 0; }
.punishment-list li.is-new { background: color-mix(in srgb, var(--accent) 7%, transparent); animation: pop .4s ease-out; }
.punishment-list li > div { display: grid; min-width: 0; }
.punishment-list .muted { font-size: 13px; overflow-wrap: anywhere; }
.punishment-type { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; font-weight: 700; }
.punishment-type .icon { width: 16px; height: 16px; color: var(--muted); }
.player-sheet-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 20px; }
.player-sheet-head img { image-rendering: pixelated; }
.player-sheet-head > div { flex: 1; min-width: 0; }
.player-sheet-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 22px; }
.player-sheet-head p { margin: 2px 0 0; font-size: 13px; }
.player-sheet-grid { margin-top: 20px; }
.note-list { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.note-list:empty { display: none; }
.note-list li { position: relative; display: grid; gap: 4px; padding: 12px 56px 12px 20px; border-bottom: 1px solid var(--border); }
.note-list li:last-child { border-bottom: 0; }
.note-list p { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.note-list .muted { font-size: 12px; }
.note-list form { position: absolute; top: 8px; right: 10px; }
.file-folder + .file-folder { margin-top: 20px; }
.file-ext { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font: 800 10px var(--mono); letter-spacing: .04em; }
.map-frame { height: calc(100vh - 220px); min-height: 420px; overflow: hidden; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface-2); }
.map-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.menu-groups { display: grid; gap: 8px; }
.menu-group-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 10px; font-size: 13px; }
.block-list { display: grid; gap: 6px; margin: 0; padding: 16px 20px 0; list-style: none; }
.block-list li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-soft); }
.block-list li.is-dragging { opacity: .5; border-style: dashed; }
.block-list .switch-row { flex: 1; }
.drag-handle:focus-visible { border-radius: 6px; outline: 2px solid var(--accent); }
.feature-switches { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.english-block { padding: 0 16px; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--bg-soft); }
.english-block summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 0; font-size: 14px; font-weight: 700; cursor: pointer; }
.english-block summary .icon { width: 18px; height: 18px; color: var(--info); }
.english-block > .form-grid { padding: 4px 0 16px; }
.settings-jump { position: sticky; top: 64px; z-index: 12; display: flex; gap: 6px; margin: -8px 0 12px; padding: 8px 0; overflow-x: auto; background: var(--bg); scrollbar-width: none; }
.settings-jump::-webkit-scrollbar { display: none; }
.settings-jump a { flex: none; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none; }
.settings-jump a:hover { border-color: var(--border-strong); color: var(--text); }
.settings-form > .card { scroll-margin-top: 130px; }
.integrations > .card { scroll-margin-top: 80px; }
.twofactor-setup { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 24px; }
.qr-box { padding: 12px; border-radius: 16px; background: #fff; line-height: 0; box-shadow: var(--shadow); }
.qr-box svg { width: 200px; height: 200px; }
.setup-steps { display: grid; gap: 12px; margin: 0; padding-left: 20px; color: var(--text-2); }
.setup-steps li::marker { color: var(--accent); font-weight: 800; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.recovery-codes code { display: block; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 15px; font-weight: 700; letter-spacing: .06em; text-align: center; }
input.code-input { font: 700 20px var(--mono) !important; letter-spacing: .3em; text-align: center; }
.message-card .card-head > .muted { flex-basis: 100%; font-size: 13px; }
.message-card.is-unread { border-color: var(--accent-border); }
.message-text { margin: 0 0 12px; color: var(--text-2); font-size: 14px; overflow-wrap: anywhere; }
.entry-review { margin-top: 20px; }
.entry-review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; padding: 20px; }
.entry-review-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-soft); }
.entry-review-card.is-pending { border-color: color-mix(in srgb, var(--warning) 50%, var(--border)); }
.entry-review-card.is-rejected { opacity: .6; }
.entry-review-card img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.entry-review-body { display: grid; flex: 1; gap: 4px; padding: 12px 14px; font-size: 14px; }
.entry-review-body p { margin: 0; color: var(--text-2); }
.entry-review-body .muted { font-size: 13px; }
.entry-review-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 14px 14px; }
.handbook { display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: start; gap: 20px; }
.handbook-nav { top: 84px; padding: 12px; }
.handbook-page { padding: 24px 28px; }

.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.album-card { position: relative; display: grid; gap: 6px; padding: 8px 8px 10px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.album-card:hover { transform: translateY(-2px); border-color: var(--accent-border); }
.album-cover { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 9px; background: var(--checker); }
.album-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.album-name { display: flex; align-items: center; gap: 6px; padding: 0 4px; overflow: hidden; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.album-name .icon { flex: none; color: var(--muted); }
.album-count { position: absolute; top: 14px; right: 14px; padding: 0 8px; border-radius: 999px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 12px; font-weight: 700; }
.album-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.album-head input { flex: 0 1 280px; min-height: 34px !important; }

/* ------------------------------------------------- v1.2 responsive rules */
@media (max-width: 980px) {
  .wiki-layout, .wiki-layout:not(:has(> .toc)) { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .wiki-nav { position: static; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
  .suggestions-layout { grid-template-columns: minmax(0, 1fr); }
  .suggestion-form { position: static; order: -1; }
  .handbook { grid-template-columns: minmax(0, 1fr); }
  .handbook-nav { position: static; }
}

@media (max-width: 860px) {
  .nav-group { display: grid; }
  .nav-group-toggle { justify-content: space-between; width: 100%; padding: 12px; }
  .nav-group.has-active .nav-group-toggle { box-shadow: none; }
  .nav-dropdown { position: static; min-width: 0; padding: 2px 0 6px 12px; border: 0; background: none; box-shadow: none; }
  .nav-dropdown::before { display: none; }
  .player-chip span { display: none; }
  .player-chip { padding: 3px; }
}

@media (max-width: 720px) {
  .card-page, .players-page, .stats-page, .events-page, .suggestions-page, .contest-page, .contact-page, .timeline-page, .faq-page,
  .wiki-home, .commands-page, .rulebook-page, .search-page, .guide-page, .player-account { gap: 18px; padding: 24px 0 56px; }
  .search-trigger { min-width: 0; width: 38px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .profile-head { flex-direction: column; gap: 14px; text-align: center; }
  .profile-info { justify-items: center; }
  .profile-badges, .profile-dates { justify-content: center; }
  .skin-stage { width: 200px; height: 250px; }
  .skin-fallback { height: 210px; }
  .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .badge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .badge-card { grid-template-columns: minmax(0, 1fr); grid-template-areas: "icon" "name" "desc" "bar"; align-items: start; padding: 12px; }
  .badge-card-icon { width: 36px; height: 36px; margin-bottom: 6px; font-size: 18px; }
  .stat-tile { padding: 12px 14px; }
  .stat-tile strong { font-size: 21px; }
  .hero-figure { font-size: 34px; }
  .bar-row { grid-template-columns: minmax(90px, 38%) minmax(0, 1fr) auto; gap: 8px; }
  .chart { padding: 14px; }
  .countdown-unit { min-width: 50px; }
  .poll-card, .potm-card { padding: 20px; }
  .potm-card { flex-direction: column; text-align: center; }
  .command-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .command-text { grid-column: 1 / -1; grid-row: 2; }
  .rulebook-table thead { display: none; }
  .rulebook-table tr { display: grid; gap: 4px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .rulebook-table tbody tr:last-child { border-bottom: 0; }
  .rulebook-table td { display: flex; justify-content: space-between; gap: 12px; width: auto !important; padding: 0; border: 0; }
  .rulebook-table td:first-child { display: block; margin-bottom: 4px; }
  .rulebook-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 13px; font-weight: 600; }
  .event-card { flex-wrap: wrap; padding: 12px 14px; gap: 10px 14px; }
  .event-countdown { margin-left: 70px; }
  .podium-place { max-width: none; }
  .podium-place.place-1, .podium-place.place-2, .podium-place.place-3 { order: 0; }
  .suggestion-card { gap: 12px; padding: 14px; }
  .upvote { width: 48px; min-height: 56px; }
  .vote-bar, .guide-progress { top: 72px; }
  .creator-card > .btn { grid-column: 1 / -1; }
  .ban-list-compact .ban-row { grid-template-columns: minmax(0, 1fr) auto; }
  .punishment-list li { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 16px; }
  .punishment-list li > div { grid-column: 1 / -1; grid-row: 2; }
  .twofactor-setup { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .recovery-codes { grid-template-columns: minmax(0, 1fr); }
  .menu-group-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .online-strip .container { align-items: flex-start; }
  .settings-jump { top: 64px; }
  .map-frame { height: 70vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
