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

:root {
    --bg: #11111b;
    --surface: #1e1e2e;
    --card: #181825;
    --accent: #d52146;
    --text: #cdd6f4;
    --muted: #9399b2;
    --border: #313244;
    --danger: #f38ba8;
    --green: #a6e3a1;
    --orange: #fab387;

    --sidebar-width: 220px;
}

html,
body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
}

#shell {
    display: none;
    min-height: 100vh;
}

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 10;
}

#content-wrap {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    flex: 1;
}

@keyframes page-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#content {
    max-width: 1800px;
    margin: 0 auto;
    padding: 2.5rem 2.5rem 2.5rem;
    animation: page-in 0.18s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.4rem 1.2rem 1rem;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.sidebar-brand-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    line-height: 1.2;
}

.sidebar-version {
    font-size: 0.68rem;
    font-weight: 400;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.sidebar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface);
}

.guild-select {
    display: none;
}

.guild-picker {
    position: relative;
    margin: 0 0.65rem 0.5rem;
}

.guild-picker-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.55rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.12s;
}
.guild-picker-btn:hover {
    border-color: var(--accent);
}

.guild-picker-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.guild-picker-btn > span:nth-child(2) {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guild-picker-arrow {
    font-size: 0.65rem;
    color: var(--muted);
    flex-shrink: 0;
}

.guild-picker-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.guild-picker-dropdown.open {
    display: block;
}

.guild-picker-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.65rem;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s, color 0.1s;
}
.guild-picker-item:hover {
    background: var(--surface);
    color: var(--text);
}
.guild-picker-item.active {
    color: var(--text);
    font-weight: 500;
}

.guild-picker-item-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.guild-picker-item-icon--empty {
    background: var(--surface);
    border: 1px solid var(--border);
}

#home-guild-picker {
    margin-left: 0;
    margin-right: 0;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.nav-list {
    list-style: none;
    padding: 0.25rem 0.6rem;
    flex: 1;
}

.nav-section {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    padding: 1rem 0.6rem 0.3rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.12s, background 0.12s;
}

.nav-link svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    stroke-width: 2;
}

.nav-link:hover {
    color: var(--text);
    background: var(--card);
}
.nav-link.active {
    color: var(--accent);
    background: var(--card);
    font-weight: 500;
}

.sidebar-footer {
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.6rem;
    margin-bottom: 0.6rem;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
}

.sidebar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--border);
}

.sidebar-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.12s, border-color 0.12s;
}
.btn-logout:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.btn-logout i,
.btn-logout svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke-width: 2.2;
}

.stat-icon,
.stat-icon svg {
    width: 13px;
    height: 13px;
    vertical-align: middle;
    margin-right: 4px;
    stroke-width: 2.2;
    flex-shrink: 0;
}

.sidebar-copyright {
    margin-top: 0.6rem;
    font-size: 0.65rem;
    color: var(--muted);
    line-height: 1.4;
    opacity: 0.6;
    text-align: center;
}

.page-header {
    margin-bottom: 1.5rem;
}
.page-header h1 {
    font-size: 1.3rem;
    font-weight: 700;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.1rem;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 0.2rem;
    margin-right: 0.4rem;
    margin-bottom: 0.2rem;
    vertical-align: middle;
}
.status-dot.good {
    background: var(--green);
}
.status-dot.ok {
    background: var(--orange);
}
.status-dot.bad {
    background: var(--danger);
}

.home-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.home-main {
    flex: 1;
    min-width: 0;
}

.settings-panel {
    width: 260px;
    flex-shrink: 0;
}

.settings-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.1rem;
    margin-bottom: 0.75rem;
}

.settings-card-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.settings-card-title svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.admins-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.25rem;
    max-height: 280px;
    overflow-y: auto;
}

.admins-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
}

.admins-item:hover {
    background: var(--surface);
}

.admins-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--border);
}

.admins-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admins-loading {
    font-size: 0.8rem;
    color: var(--muted);
}

.settings-saved {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.settings-saved.ok {
    color: var(--green);
}
.settings-saved.err {
    color: var(--danger);
}

.settings-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
}

.settings-check-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text);
    cursor: pointer;
    margin-top: 0.75rem;
    user-select: none;
}

.settings-check-row input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s, border-color 0.12s;
    position: relative;
}

.settings-check-row input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.settings-check-row input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 0px;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

#lang-picker {
    margin: 0;
}

.lang-flag {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    border-radius: 2px;
    flex-shrink: 0;
}

.profile-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.profile-banner {
    height: 200px;
    background: linear-gradient(135deg, var(--accent) 0%, #7a1028 100%);
    background-size: cover;
    background-position: center;
}

.profile-body {
    padding: 0 1.8rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--card);
    margin-top: -60px;
    flex-shrink: 0;
    background: var(--surface);
    object-fit: cover;
}

.profile-meta {
    padding: 0;
}

.profile-name {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}

.profile-client-id {
    font-size: 0.72rem;
    color: var(--muted);
    font-family: monospace;
    margin-top: 0.1rem;
}

.profile-guilds {
    font-size: 0.8rem;
    color: var(--muted);
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.card-header {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border);
}

.card-header span {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--muted);
}

.card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.field {
    display: flex;
    flex-direction: column;
}

label {
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.3rem;
}

.field-hint {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.3rem;
}

input[type="text"],
input[type="password"],
textarea,
select {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: 0.45rem 0.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
    appearance: none;
}
input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
}
textarea {
    resize: vertical;
    min-height: 80px;
}
select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b6b8a'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.15s, background 0.15s;
}
.btn-accent {
    background: var(--accent);
    color: #fff;
}
.btn-accent:hover {
    opacity: 0.85;
}
.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    background: var(--surface);
    color: var(--text);
}

textarea.rule-input {
    resize: none;
    overflow: hidden;
    min-height: unset;
    line-height: 1.5;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 0.2rem 0.35rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.8rem;
    line-height: 1;
    flex-shrink: 0;
    font-family: inherit;
    transition: color 0.12s;
}
.btn-icon:hover {
    color: var(--danger);
}

.btn-add {
    background: transparent;
    color: var(--muted);
    border: 1px dashed var(--border);
    padding: 0.35rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: inherit;
    margin-top: 0.2rem;
    transition: border-color 0.15s, color 0.15s;
}
.btn-add:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.btn-add.full {
    width: 100%;
    margin-bottom: 1.25rem;
}

.actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

@keyframes status-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes status-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(4px);
    }
}

.status {
    font-size: 0.8rem;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    margin-right: auto;
    animation: status-in 0.2s ease;
}
.status.hiding {
    animation: status-out 0.2s ease forwards;
}
.status.success {
    background: #1a3a1a;
    color: var(--green);
}
.status.error {
    background: #3a1a1a;
    color: var(--danger);
}

.section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.6rem;
    overflow: hidden;
}

.section-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.section-num {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.section-head input {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    padding: 0.15rem 0.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    outline: none;
    width: auto;
}
.section-head input:focus {
    border-bottom-color: var(--accent);
}

.rules-list {
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.rules-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.rules-left {
    width: 400px;
    flex-shrink: 0;
}

.rules-right {
    flex: 1;
    min-width: 0;
}

.rule-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}
.rule-num {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
    min-width: 2.5rem;
    padding-top: 0.5rem;
}
.rule-row input {
    flex: 1;
}

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

.spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 30vh;
}

.spinner::after {
    content: "";
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.stats-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin: 0 auto;
}

.stats-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-top: 1px solid var(--border);
}

.stats-page-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 6px;
    padding: 0.2rem 0.6rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.12s, border-color 0.12s;
}
.stats-page-btn:hover:not(:disabled) {
    color: var(--text);
    border-color: var(--accent);
}
.stats-page-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.stats-page-info {
    font-size: 0.8rem;
    color: var(--muted);
    min-width: 3.5rem;
    text-align: center;
}

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

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

.stats-table th {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border);
}

.stats-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.stats-row {
    cursor: pointer;
    transition: background 0.1s;
}

.stats-row:hover {
    background: rgba(0, 0, 0, 0.2);
}

.stats-rank {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.85rem;
    width: 2.5rem;
}

.stats-user-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.stats-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.stats-username {
    font-weight: 500;
}

.stats-num {
    font-variant-numeric: tabular-nums;
}

.stats-empty {
    color: var(--muted);
    font-size: 0.875rem;
    padding: 2rem 0;
    text-align: center;
}

.modal.stats-user-modal {
    max-width: 720px;
    gap: 1.25rem;
    align-items: stretch;
    text-align: left;
}

.stats-modal-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.stats-modal-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.stats-modal-identity {
    flex: 1;
    min-width: 0;
}

.stats-modal-name {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.stats-modal-id {
    font-size: 0.72rem;
    color: var(--muted);
    font-family: monospace;
}

.stats-modal-close {
    margin-left: auto;
    font-size: 1.1rem;
    align-self: flex-start;
}

.stats-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
}

.stats-modal-edit {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stats-delete-btn {
    color: var(--danger);
    border-color: var(--danger);
}

.stats-delete-btn:hover {
    background: rgba(224, 85, 96, 0.1);
    color: var(--danger);
}

.num-input-wrap {
    display: flex;
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.15s;
}

.num-input-wrap:focus-within {
    border-color: var(--accent);
}

.num-input-wrap input[type="number"] {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.45rem 0.6rem;
    font-size: 0.9rem;
    color: var(--text);
    font-family: inherit;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.num-input-wrap input[type="number"]::-webkit-outer-spin-button,
.num-input-wrap input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.num-input-btns {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
}

.num-input-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 0 0.5rem;
    font-size: 0.65rem;
    line-height: 1;
    transition: background 0.1s, color 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.num-input-btn:hover {
    background: var(--card);
    color: var(--text);
}

.num-input-btn + .num-input-btn {
    border-top: 1px solid var(--border);
}

.console-card {
    background: #0d0d0f;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 1.5rem;
}

.console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.console-header-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.console-header-left svg {
    width: 16px;
    height: 16px;
    color: var(--muted);
    stroke-width: 2.2;
    flex-shrink: 0;
}

.console-header-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.console-header span {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--muted);
}

.console-clear-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 5px;
    padding: 0.2rem 0.35rem;
    cursor: pointer;
    transition: color 0.12s, border-color 0.12s;
}
.console-clear-btn svg {
    width: 13px;
    height: 13px;
    stroke-width: 2.2;
}
.console-clear-btn:hover {
    color: var(--text);
    border-color: var(--text);
}

.console-debug-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 5px;
    padding: 0.2rem 0.35rem;
    cursor: pointer;
    transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.console-debug-btn svg {
    width: 13px;
    height: 13px;
    stroke-width: 2.2;
}

.console-debug-btn:hover {
    color: var(--text);
    border-color: var(--text);
}

.console-debug-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.console-body {
    height: 220px;
    overflow-y: auto;
    padding: 0.5rem 0;
    font-family: "JetBrains Mono", "Consolas", "Menlo", monospace;
    font-size: 0.78rem;
    line-height: 1.6;
}

.console-line {
    display: flex;
    gap: 0.6rem;
    padding: 0 1rem;
}
.console-line:hover {
    background: rgba(255, 255, 255, 0.03);
}

.console-ts {
    color: var(--muted);
    flex-shrink: 0;
}

.console-level {
    flex-shrink: 0;
    font-weight: 700;
    width: 4.5rem;
}

.console-msg {
    color: var(--text);
    word-break: break-all;
}

.console-info .console-level {
    color: #7cb4f8;
}
.console-warn .console-level {
    color: var(--orange);
}
.console-error .console-level {
    color: var(--danger);
}
.console-success .console-level {
    color: var(--green);
}

.minecraft-layout {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.minecraft-left {
    width: 340px;
    flex-shrink: 0;
}

.minecraft-right {
    flex: 1;
    min-width: 0;
}

.mc-status-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.mc-stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    min-width: 90px;
}

.mc-preview-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.mc-preview-top .mc-status-grid {
    margin-bottom: 0;
    flex: 1;
}

.mc-server-icon {
    width: 64px;
    height: 64px;
    border-radius: 0.4rem;
    flex-shrink: 0;
    image-rendering: pixelated;
}

.mc-stat-card .stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.mc-stat-card .stat-value {
    font-weight: 700;
    font-size: 1rem;
    margin-top: 0.15rem;
}

.mc-version {
    font-size: 0.85rem !important;
}

.mc-motd {
    font-size: 0.82rem;
    color: var(--muted);
    white-space: pre-line;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
}

.mc-players {
    margin-top: 0.25rem;
}

.mc-players-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.mc-players-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.mc-player-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
}

.mc-player-row:last-child {
    border-bottom: none;
}

.mc-player-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    image-rendering: pixelated;
    flex-shrink: 0;
}

.mc-player-name {
    font-size: 0.88rem;
    font-weight: 500;
    flex: 1;
}

.mc-player-more {
    color: var(--muted);
}

.btn-mc-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: color 0.12s, border-color 0.12s;
}

.btn-mc-action:hover {
    color: var(--text);
    border-color: var(--text);
}

.btn-mc-action.btn-mc-danger:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.has-tooltip {
    position: relative;
}

.has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.72rem;
    white-space: nowrap;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
}

.has-tooltip:hover::after {
    opacity: 1;
}

.btn-mc-action i,
.btn-mc-action svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    stroke-width: 2.2;
}

.mc-countdown-label {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.5rem;
    text-align: right;
}

.mc-countdown-label span {
    font-weight: 600;
    color: var(--text);
}
.console-debug .console-level {
    color: #c084fc;
}

.error-msg {
    color: var(--danger);
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

code {
    font-size: 0.8em;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.1em 0.4em;
    border-radius: 4px;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.93) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modal-out {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.93) translateY(8px);
    }
}

.modal.closing {
    animation: modal-out 0.15s cubic-bezier(0.4, 0, 1, 1) both;
}

@keyframes overlay-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes overlay-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: rgba(0, 0, 0, 0.55);
    animation: overlay-in 0.18s ease both;
}

#auth-modal.modal-overlay {
    background: none;
}

.modal-overlay.closing {
    animation: overlay-out 0.15s ease both;
}

.login-bg {
    position: absolute;
    inset: 0;
    display: flex;
    overflow: hidden;
    filter: blur(3px);
    pointer-events: none;
    user-select: none;
}

.login-bg-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    height: 100%;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.4rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.login-bg-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.login-bg-guild {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.login-bg-nav {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 0.5rem;
}

.login-bg-content {
    flex: 1;
    background: var(--bg);
    padding: 2.5rem 3rem;
}

.login-bg-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.login-bg-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
}

.login-bg-card.wide {
    grid-column: 1 / -1;
}

.skel {
    background: var(--border);
    border-radius: 4px;
    opacity: 0.7;
}

.skel-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skel-icon-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skel-line {
    height: 10px;
}

.skel-nav-item {
    height: 9px;
    border-radius: 4px;
}

.skel-nav-section {
    height: 7px;
    width: 40%;
    border-radius: 4px;
    opacity: 0.35;
    margin-top: 0.4rem;
}

.modal {
    position: relative;
    z-index: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
    animation: modal-in 0.18s cubic-bezier(0.34, 1.3, 0.64, 1) both;
}

#auth-modal .modal {
    align-items: center;
    text-align: center;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.modal-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.05rem;
}

.login-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    display: none;
    box-shadow: 0 0 0 3px var(--border);
}

.login-avatar[src]:not([src=""]) {
    display: block;
}

.modal-sub {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.55;
    margin-bottom: 0.4rem;
}

@media (max-width: 640px) {
    :root {
        --sidebar-width: 0px;
    }

    #sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        align-items: center;
        padding: 0.5rem 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border);
        flex-wrap: wrap;
    }

    .sidebar-brand {
        padding: 0;
        border-bottom: none;
        margin-bottom: 0;
    }

    .nav-list {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.25rem;
        padding: 0;
        flex: 1;
        flex-wrap: wrap;
    }

    .nav-section {
        display: none;
    }

    .sidebar-footer {
        padding: 0;
        border-top: none;
    }
    .btn-logout {
        width: auto;
    }

    #content-wrap {
        margin-left: 0;
    }
    #content {
        padding: 1.2rem 1rem 3rem;
    }

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