:root {
    --blue-50: #eef5ff;
    --blue-100: #d9e8ff;
    --blue-200: #b4d2ff;
    --blue-400: #4b9bff;
    --blue-500: #1f7cff;
    --blue-600: #0f63e6;
    --blue-700: #0b4fbd;
    --blue-900: #0a2a66;
    --sky: #5cc8ff;

    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-alt: #f7f9fd;
    --border: #dfe6f1;
    --border-strong: #c8d3e3;
    --text: #13213b;
    --text-muted: #5a6983;
    --text-soft: #8593aa;
    --primary: var(--blue-500);
    --primary-hover: var(--blue-600);
    --primary-soft: var(--blue-50);
    --primary-text: var(--blue-700);
    --success: #1b8a4b;
    --success-soft: #e5f5ec;
    --danger: #cc3a3a;
    --danger-soft: #fdecec;
    --warning: #a86800;
    --warning-soft: #fdf3df;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow: 0 1px 2px rgba(15, 35, 75, 0.06);
    --shadow-raised: 0 8px 24px rgba(15, 35, 75, 0.1);

    --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --container: 1180px;
    color-scheme: light;
}

[data-mode="dark"] {
    --bg: #0c1424;
    --surface: #131d31;
    --surface-alt: #18243c;
    --border: #243452;
    --border-strong: #31466b;
    --text: #e6edf8;
    --text-muted: #9fb0cc;
    --text-soft: #7384a1;
    --primary: #3d8fff;
    --primary-hover: #5aa2ff;
    --primary-soft: #16294a;
    --primary-text: #8fc0ff;
    --success-soft: #11321f;
    --danger-soft: #3a1a1d;
    --warning-soft: #362a12;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-raised: 0 8px 24px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 0.5em;
    letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

p {
    margin: 0 0 1em;
}

a {
    color: var(--primary-text);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    display: block;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding-inline: 20px;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.muted { color: var(--text-muted); }
.soft { color: var(--text-soft); }
.small { font-size: 0.875rem; }
.nowrap { white-space: nowrap; }

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-header .container {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 64px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.02em;
}

.brand:hover {
    text-decoration: none;
}

.brand img {
    width: 36px;
    height: 36px;
    border-radius: 9px;
}

.main-nav {
    display: flex;
    gap: 4px;
    flex: 1;
}

.main-nav a {
    color: var(--text-muted);
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.main-nav a:hover {
    color: var(--text);
    background: var(--surface-alt);
    text-decoration: none;
}

.main-nav a[aria-current="page"] {
    color: var(--primary-text);
    background: var(--primary-soft);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn.nav-toggle {
    display: none;
}

.menu {
    position: relative;
}

.menu > summary {
    list-style: none;
    cursor: pointer;
}

.menu > summary::-webkit-details-marker {
    display: none;
}

.menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-raised);
    padding: 6px;
    z-index: 60;
}

.menu-panel a,
.menu-panel button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text);
    background: none;
    border: 0;
    font: inherit;
    cursor: pointer;
}

.menu-panel a:hover,
.menu-panel button:hover {
    background: var(--surface-alt);
    text-decoration: none;
}

.menu-panel hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 6px 0;
}

.menu-panel .current {
    color: var(--primary-text);
    font-weight: 700;
}

.lang-button {
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.user-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-weight: 600;
}

.avatar {
    border-radius: 8px;
    object-fit: cover;
    background: var(--surface-alt);
    image-rendering: pixelated;
    flex-shrink: 0;
}

.avatar-xs { width: 24px; height: 24px; border-radius: 6px; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 44px; height: 44px; }
.avatar-lg { width: 72px; height: 72px; border-radius: 12px; }
.avatar-xl { width: 120px; height: 120px; border-radius: 16px; }

main {
    flex: 1;
    padding-block: 32px 56px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-head h1 {
    margin-bottom: 4px;
}

.page-head p {
    margin: 0;
    color: var(--text-muted);
}

.breadcrumb {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-soft);
    margin-bottom: 8px;
}

.breadcrumb a {
    color: var(--text-muted);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    min-width: 0;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.card-head h2 {
    font-size: 1.05rem;
    margin: 0;
}

.card-head a {
    font-size: 0.9rem;
    font-weight: 600;
}

.card-flush {
    padding: 0;
    overflow: hidden;
}

.card-flush .card-head {
    padding: 16px 20px 0;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.stack > * + * {
    margin-top: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-secondary:hover {
    background: var(--surface-alt);
}

.btn-ghost {
    background: none;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: var(--surface-alt);
    color: var(--text);
}

.btn-danger {
    background: var(--surface);
    color: var(--danger);
    border-color: var(--border-strong);
}

.btn-danger:hover {
    background: var(--danger-soft);
    border-color: var(--danger);
}

.btn-discord {
    background: #5865f2;
    color: #fff;
}

.btn-discord:hover {
    background: #4752c4;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.inline-form {
    display: inline;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.6;
    background: var(--surface-alt);
    color: var(--text-muted);
    border: 1px solid var(--border);
    white-space: nowrap;
}

.badge-blue {
    background: var(--primary-soft);
    color: var(--primary-text);
    border-color: transparent;
}

.badge-success {
    background: var(--success-soft);
    color: var(--success);
    border-color: transparent;
}

.badge-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: transparent;
}

.badge-warning {
    background: var(--warning-soft);
    color: var(--warning);
    border-color: transparent;
}

.badge-tag {
    color: #fff;
    border-color: transparent;
}

.badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-soft);
    display: inline-block;
}

.dot-online {
    background: #22b35e;
    box-shadow: 0 0 0 3px rgba(34, 179, 94, 0.18);
}

.dot-offline {
    background: var(--danger);
}

.alerts {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-weight: 600;
}

.alert-success { background: var(--success-soft); color: var(--success); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--primary-soft); color: var(--primary-text); }

.form {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 6px;
}

.field label,
.label {
    font-weight: 700;
    font-size: 0.9rem;
}

.field .hint {
    font-size: 0.85rem;
    color: var(--text-soft);
}

.input,
.select,
.textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.textarea {
    min-height: 120px;
    resize: vertical;
}

.input-color {
    width: 56px;
    height: 40px;
    padding: 2px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
}

.check input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.form-row {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.table th,
.table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-soft);
    font-weight: 700;
    background: var(--surface-alt);
}

.table tr:last-child td {
    border-bottom: 0;
}

.empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--text-muted);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #1a86ff 0%, #0a5cf0 60%, #0848c9 100%);
    color: #fff;
    padding: 44px 40px;
    margin-bottom: 24px;
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(120, 210, 255, 0.35);
    pointer-events: none;
}

.hero::before {
    width: 320px;
    height: 320px;
    right: -60px;
    top: -140px;
}

.hero::after {
    width: 180px;
    height: 180px;
    right: 220px;
    bottom: -110px;
    background: rgba(255, 255, 255, 0.12);
}

.hero-shape {
    position: absolute;
    width: 150px;
    height: 150px;
    right: 90px;
    bottom: 28px;
    border-radius: 22px;
    background: rgba(120, 210, 255, 0.28);
    transform: rotate(-18deg);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}

.hero h1 {
    font-weight: 700;
    margin-bottom: 12px;
}

.hero p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    margin-bottom: 24px;
}

.hero .btn-secondary {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.hero .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.24);
}

.hero .btn-primary {
    background: #fff;
    color: var(--blue-700);
}

.hero .btn-primary:hover {
    background: var(--blue-50);
}

.home-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
}

.video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-title {
    margin: 12px 0 0;
    font-weight: 700;
}

.video-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.video-item {
    color: var(--text);
}

.video-item:hover {
    text-decoration: none;
}

.video-item:hover .video-item-title {
    color: var(--primary-text);
}

.video-item img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
    width: 100%;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
}

.video-item-title {
    font-weight: 700;
    font-size: 0.92rem;
    margin: 8px 0 2px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.server-card .status-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.server-card .status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.server-card .count {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text-muted);
}

.meter {
    height: 6px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 16px;
}

.meter span {
    display: block;
    height: 100%;
    background: var(--primary);
    border-radius: inherit;
    transition: width 0.3s;
}

.player-heads {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.player-heads img {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    image-rendering: pixelated;
    background: var(--surface-alt);
}

.address {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 8px 8px 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.address code {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.discord-card {
    background: #5865f2;
    border-color: #5865f2;
    color: #fff;
}

.discord-card h2 {
    color: #fff;
}

.discord-card p {
    color: rgba(255, 255, 255, 0.88);
}

.discord-card .btn {
    background: #fff;
    color: #3c46c5;
}

.discord-card .btn:hover {
    background: #eef0ff;
}

.join-hint {
    margin: 16px 0 0;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    color: var(--primary-text);
    font-size: 0.9rem;
    font-weight: 600;
}

.x-timeline {
    max-height: 520px;
    overflow-y: auto;
    border-radius: var(--radius-sm);
}

.x-timeline > a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 700;
}

.x-timeline > a:hover {
    background: var(--surface-alt);
    text-decoration: none;
}

.list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.list-item:first-child {
    border-top: 0;
    padding-top: 0;
}

.list-item:last-child {
    padding-bottom: 0;
}

.list-item .grow {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    display: block;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-item-meta {
    font-size: 0.85rem;
    color: var(--text-soft);
}

.mod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.mod-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.mod-card:hover {
    text-decoration: none;
    border-color: var(--blue-200);
    box-shadow: var(--shadow-raised);
}

.mod-card-head {
    display: flex;
    gap: 14px;
    align-items: center;
}

.mod-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--primary-soft);
    display: grid;
    place-items: center;
    color: var(--primary-text);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.mod-icon-lg {
    width: 88px;
    height: 88px;
    border-radius: 18px;
    font-size: 2rem;
}

.mod-card h2 {
    margin: 0;
    font-size: 1.15rem;
}

.mod-card p {
    color: var(--text-muted);
    margin: 0;
    flex: 1;
}

.mod-meta {
    display: grid;
    gap: 8px;
    font-size: 0.85rem;
}

.mod-meta-row {
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.mod-meta-row > span:first-child {
    color: var(--text-soft);
    min-width: 84px;
    font-weight: 600;
}

.mod-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.mod-header {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
}

.mod-header h1 {
    margin-bottom: 4px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.gallery a {
    display: block;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.gallery img {
    aspect-ratio: 16 / 10;
    object-fit: cover;
    width: 100%;
    transition: transform 0.2s;
}

.gallery a:hover img {
    transform: scale(1.03);
}

.lightbox {
    border: 0;
    padding: 0;
    background: transparent;
    max-width: min(1100px, 94vw);
}

.lightbox::backdrop {
    background: rgba(5, 12, 28, 0.85);
}

.lightbox img {
    max-height: 84vh;
    border-radius: var(--radius);
    margin: 0 auto;
}

.lightbox p {
    color: #fff;
    text-align: center;
    margin: 10px 0 0;
}

.version {
    border-top: 1px solid var(--border);
    padding: 16px 0;
}

.version:first-child {
    border-top: 0;
    padding-top: 0;
}

.version-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.version-head h3 {
    margin: 0;
}

.version details {
    margin-top: 8px;
}

.version summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.prose {
    overflow-wrap: anywhere;
}

.prose > :last-child {
    margin-bottom: 0;
}

.prose h1, .prose h2, .prose h3 {
    margin-top: 1.4em;
}

.prose h1:first-child, .prose h2:first-child, .prose h3:first-child {
    margin-top: 0;
}

.prose img {
    border-radius: var(--radius-sm);
    margin: 8px 0;
}

.prose blockquote {
    margin: 0 0 1em;
    padding: 4px 16px;
    border-left: 3px solid var(--blue-200);
    color: var(--text-muted);
}

.prose code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    padding: 1px 5px;
    border-radius: 4px;
}

.prose pre {
    background: #0f1a2e;
    color: #e3ebf8;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

.prose pre code {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
}

.prose table {
    border-collapse: collapse;
    margin-bottom: 1em;
    display: block;
    overflow-x: auto;
}

.prose th, .prose td {
    border: 1px solid var(--border);
    padding: 6px 10px;
}

.prose ul, .prose ol {
    padding-left: 1.4em;
    margin: 0 0 1em;
}

.editor {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.editor:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.editor-bar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
    flex-wrap: wrap;
}

.editor-tabs {
    display: flex;
    gap: 2px;
    margin-right: 8px;
}

.editor-tab,
.editor-tool {
    border: 0;
    background: none;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.editor-tab[aria-selected="true"] {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

.editor-tool:hover,
.editor-tab:hover {
    color: var(--text);
    background: var(--surface);
}

.editor-tool svg {
    width: 16px;
    height: 16px;
}

.editor-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
}

.editor textarea {
    display: block;
    width: 100%;
    min-height: 220px;
    border: 0;
    padding: 14px;
    font-family: var(--font-mono);
    font-size: 0.92rem;
    line-height: 1.6;
    background: var(--surface);
    color: var(--text);
    resize: vertical;
}

.editor textarea:focus {
    outline: none;
}

.editor.is-dragging textarea {
    background: var(--primary-soft);
}

.editor-preview {
    min-height: 220px;
    padding: 14px;
}

.editor-foot {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 12px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-soft);
}

.forum-table .category-name {
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--text);
}

.forum-table .category-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 2px 0 0;
}

.forum-table td.num {
    text-align: center;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text-muted);
    width: 90px;
}

.forum-table th.num {
    text-align: center;
}

.forum-table .last {
    width: 260px;
}

.last-post {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.last-post .grow {
    min-width: 0;
}

.last-post a.title {
    display: block;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.thread-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.thread-title a {
    color: var(--text);
    font-weight: 700;
}

.thread-flags {
    display: inline-flex;
    gap: 4px;
}

.icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    vertical-align: -3px;
}

.post {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    padding: 0;
    overflow: hidden;
}

.post-author {
    padding: 20px;
    background: var(--surface-alt);
    border-right: 1px solid var(--border);
    text-align: center;
    display: grid;
    justify-items: center;
    gap: 6px;
    align-content: start;
}

.post-author .name {
    font-weight: 700;
    color: var(--text);
    overflow-wrap: anywhere;
}

.post-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-soft);
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.post-actions {
    display: flex;
    gap: 6px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    justify-content: flex-end;
}

.post .prose {
    flex: 1;
}

.mod-tools {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.mod-tools form {
    display: flex;
    gap: 6px;
    align-items: center;
}

.mod-tools .select {
    width: auto;
    padding: 6px 8px;
    font-size: 0.88rem;
}

.profile-background {
    height: 220px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #1a86ff 0%, #0a5cf0 70%);
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.profile-background:not(.has-image)::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    right: -40px;
    top: -100px;
    background: rgba(120, 210, 255, 0.35);
}

.profile-head {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    padding: 0 24px;
    margin-top: -56px;
    position: relative;
    flex-wrap: wrap;
}

.profile-head .avatar-xl {
    border: 4px solid var(--surface);
    box-shadow: var(--shadow-raised);
}

.profile-head-info {
    flex: 1;
    padding-top: 64px;
    padding-bottom: 6px;
    min-width: 200px;
}

.profile-head-info h1 {
    margin: 0 0 6px;
}

.tabs {
    display: flex;
    gap: 4px;
    box-shadow: inset 0 -1px 0 var(--border);
    margin: 24px 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.tabs a {
    padding: 10px 14px;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.tabs a:hover {
    color: var(--text);
    text-decoration: none;
}

.tabs a[aria-current="page"] {
    color: var(--primary-text);
    border-bottom-color: var(--primary);
}

.tab-count {
    display: inline-block;
    min-width: 22px;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
}

.tabs a[aria-current="page"] .tab-count {
    background: var(--primary-soft);
    border-color: transparent;
    color: var(--primary-text);
}

.profile-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.facts {
    display: grid;
    gap: 12px;
    margin: 16px 0 0;
}

.facts div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.92rem;
}

.facts dt {
    color: var(--text-muted);
}

.facts dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 16px;
    padding-top: 16px;
}

.stats strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.3rem;
}

.stats span {
    font-size: 0.8rem;
    color: var(--text-soft);
}

.wall-post {
    display: flex;
    gap: 12px;
}

.wall-post .grow {
    flex: 1;
    min-width: 0;
}

.wall-post-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.wall-post-head a {
    font-weight: 700;
    color: var(--text);
}

.wall-post p {
    margin: 4px 0 0;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.item-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 3px solid var(--item-color, var(--primary));
}

.item-card-head {
    display: flex;
    gap: 12px;
    align-items: center;
}

.item-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--item-color, var(--primary)) 14%, transparent);
    display: grid;
    place-items: center;
    color: var(--item-color, var(--primary));
    flex-shrink: 0;
    image-rendering: pixelated;
    object-fit: contain;
}

.item-icon svg {
    width: 24px;
    height: 24px;
}

.item-card h3 {
    margin: 0;
}

.item-card p {
    color: var(--text-muted);
    margin: 0;
    flex: 1;
    font-size: 0.92rem;
}

.item-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-soft);
}

.link-box {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 8px 8px 12px;
    font-family: var(--font-mono);
    font-size: 0.92rem;
}

.link-box code {
    flex: 1;
    overflow-wrap: anywhere;
}

.settings-section + .settings-section {
    margin-top: 20px;
}

.image-setting {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.background-preview {
    width: 220px;
    height: 60px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #1a86ff 0%, #0a5cf0 70%);
    background-size: cover;
    background-position: center;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.feature {
    display: grid;
    gap: 8px;
    align-content: start;
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary-text);
    display: grid;
    place-items: center;
}

.feature-icon svg {
    width: 22px;
    height: 22px;
}

.feature h3 {
    margin: 4px 0 0;
}

.feature p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.steps {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: step;
    display: grid;
    gap: 14px;
}

.steps li {
    counter-increment: step;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.steps li::before {
    content: counter(step);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.auth-wrap {
    max-width: 420px;
    margin: 24px auto 0;
}

.auth-wrap h1 {
    margin-bottom: 4px;
}

.auth-foot {
    text-align: center;
    margin-top: 16px;
    color: var(--text-muted);
}

.error-page {
    text-align: center;
    max-width: 480px;
    margin: 48px auto;
}

.error-page .code {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 12px;
}

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding-block: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: var(--text-muted);
}

.admin-shell {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-side {
    background: var(--blue-900);
    color: #c9d8f2;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.admin-side .brand {
    color: #fff;
    padding: 0 8px;
}

.admin-side nav {
    display: grid;
    gap: 2px;
}

.admin-side nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: #c9d8f2;
    font-weight: 600;
}

.admin-side nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
}

.admin-side nav a[aria-current="page"] {
    background: var(--blue-500);
    color: #fff;
}

.admin-side .back {
    margin-top: auto;
    color: #9fb4d8;
    padding: 0 10px;
    font-size: 0.9rem;
}

.admin-main {
    padding: 28px 32px 56px;
    min-width: 0;
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 600;
}

.stat-card span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.admin-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.admin-image img {
    aspect-ratio: 16 / 10;
    object-fit: cover;
    width: 100%;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.admin-image form {
    display: grid;
    gap: 8px;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

code.command {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background: var(--surface-alt);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
    overflow-wrap: anywhere;
}

@media (max-width: 980px) {
    .home-grid,
    .mod-layout,
    .profile-layout,
    .split {
        grid-template-columns: minmax(0, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .forum-table .last {
        width: auto;
    }
}

@media (max-width: 820px) {
    .btn.nav-toggle {
        display: inline-flex;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: 8px 16px 16px;
        box-shadow: var(--shadow-raised);
    }

    .main-nav.is-open {
        display: flex;
    }

    .site-header .container {
        justify-content: space-between;
    }

    .user-button .name {
        display: none;
    }

    .admin-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-side {
        position: static;
        height: auto;
        padding: 14px;
    }

    .admin-side nav {
        display: flex;
        overflow-x: auto;
    }

    .admin-side .back {
        margin-top: 0;
    }

    .admin-main {
        padding: 20px 16px 48px;
    }
}

@media (max-width: 640px) {
    .container {
        padding-inline: 16px;
    }

    main {
        padding-block: 20px 40px;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: minmax(0, 1fr);
    }

    .video-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .hero {
        padding: 28px 22px;
    }

    .hero-shape {
        display: none;
    }

    .post {
        grid-template-columns: minmax(0, 1fr);
    }

    .post-author {
        border-right: 0;
        border-bottom: 1px solid var(--border);
        display: flex;
        justify-content: flex-start;
        text-align: left;
        padding: 12px 16px;
    }

    .post-author .avatar-lg {
        width: 40px;
        height: 40px;
    }

    .post-author .post-author-extra {
        display: none;
    }

    .forum-table .hide-sm {
        display: none;
    }

    .profile-background {
        height: 140px;
    }

    .profile-head {
        padding: 0 12px;
    }

    .avatar-xl {
        width: 96px;
        height: 96px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}

.about-person {
    padding-top: 0;
    margin-bottom: 12px;
    border-top: 0;
}

input[type="file"] {
    font: inherit;
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 100%;
}

input[type="file"]::file-selector-button {
    font: inherit;
    font-weight: 700;
    margin-right: 10px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
    background: var(--surface-alt);
}

.bio {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.money {
    font-family: var(--font-display);
    color: var(--success);
}

.theme-preview svg {
    width: 26px;
    height: 26px;
}

.inline-player {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.hero .badge {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
    font-size: 0.85rem;
    padding: 4px 12px;
}

.mod-header p {
    margin: 0;
}

.version-date {
    margin-left: auto;
}

.version .prose {
    margin-top: 8px;
}

.version-form {
    margin: 16px 0 12px;
}

.mod-tools-card {
    margin-bottom: 20px;
    padding: 12px 16px;
}

.reply-card {
    margin-top: 20px;
}

.reply-card .alert {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-inline {
    width: auto;
    flex: 1;
    min-width: 160px;
}

.input-narrow {
    width: 90px;
}

.command-input {
    font-family: var(--font-mono);
    font-size: 0.92rem;
}

.grow {
    flex: 1;
    min-width: 0;
}

.badge-beta {
    background: #efe7ff;
    color: #6b3fd4;
    border-color: transparent;
}

[data-mode="dark"] .badge-beta {
    background: #2a1f4d;
    color: #c4b0ff;
}

.btn-beta {
    background: #7c4ddb;
    color: #fff;
}

.btn-beta:hover {
    background: #6a3cc7;
}

.beta-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 28px 32px;
    margin-bottom: 24px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #2b1a66 0%, #4a2bb3 55%, #1f7cff 100%);
    color: #fff;
}

.beta-hero h1 {
    margin: 10px 0 6px;
}

.beta-hero p {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
}

.beta-hero .badge-beta {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.beta-hero .btn-primary {
    background: #fff;
    color: #3b2596;
}

.news-post-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.news-post-head h2 {
    margin: 0 0 4px;
    font-size: 1.25rem;
}

.news-post-head p {
    margin: 0;
}

.locked-icon {
    width: 64px;
    height: 64px;
}

.dropzone {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 28px 16px;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-alt);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.dropzone:hover,
.dropzone.is-dragging {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.dropzone-icon {
    width: 28px;
    height: 28px;
    color: var(--primary-text);
}

.progress {
    height: 10px;
    border-radius: 999px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    overflow: hidden;
}

.progress span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--primary);
    transition: width 0.2s;
}

.skeleton {
    display: block;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--surface-alt) 25%, var(--border) 50%, var(--surface-alt) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.skeleton-line {
    height: 14px;
    width: 85%;
    margin-top: 10px;
}

.skeleton-line.short {
    width: 45%;
}

.skeleton-inline {
    display: inline-block;
    width: 96px;
    height: 14px;
    vertical-align: middle;
}

[data-mc-name] .skeleton-inline {
    height: 24px;
}

[data-video-latest] .skeleton-line {
    height: 18px;
    margin-top: 16px;
}

.skeleton-head {
    display: inline-block;
    width: 36px;
    height: 36px;
    border-radius: 6px;
}

.skeleton-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
}

.video-frame.skeleton {
    background-color: transparent;
}

.btn.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

.btn.is-loading::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes skeleton-shimmer {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
