:root {
    --bg: #090d12;
    --bg-2: #0d131a;
    --surface: #121a23;
    --surface-2: #17212c;
    --surface-3: #1d2a36;
    --line: #293846;
    --line-soft: rgba(100, 199, 188, 0.18);
    --text: #f4f7f8;
    --muted: #a2afb9;
    --muted-2: #738392;
    --accent: #65c8bd;
    --accent-strong: #82ddd4;
    --accent-soft: rgba(101, 200, 189, 0.12);
    --danger: #ff7a86;
    --success: #65d69c;
    --shadow: 0 24px 70px rgba(2, 7, 13, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(9, 13, 18, 0.96), var(--bg)),
        repeating-linear-gradient(90deg, rgba(101, 200, 189, 0.028) 0 1px, transparent 1px 84px),
        repeating-linear-gradient(0deg, rgba(101, 200, 189, 0.022) 0 1px, transparent 1px 84px),
        var(--bg);
    font-family: Outfit, Arial, sans-serif;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

.skip-link:not(:focus):not(:active) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link:focus,
.skip-link:active {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 50;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--accent);
    color: #061014;
    font-weight: 800;
    text-decoration: none;
}

.shell {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(9, 13, 18, 0.9);
    backdrop-filter: blur(16px);
}

.topbar-inner,
.brand,
.nav-actions,
.profile,
.server-line,
.status-line,
.metric-row,
.hero-actions,
.command-head,
.stat-top,
.sidebar-item {
    display: flex;
    align-items: center;
}

.topbar-inner {
    min-height: 72px;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    min-width: 0;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
}

.brand-mark,
.avatar-fallback,
.mini-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    max-width: 42px;
    max-height: 42px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(101, 200, 189, 0.24);
    background: var(--accent-soft);
    display: grid;
    place-items: center;
    color: var(--accent);
    font-weight: 900;
}

.brand-mark img {
    display: block;
    width: 42px !important;
    height: 42px !important;
    max-width: 42px !important;
    max-height: 42px !important;
    object-fit: cover;
    border-radius: 8px;
}

.brand-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.brand-title,
.profile-name,
.server-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-title {
    font-weight: 900;
}

.brand-subtitle {
    color: var(--muted-2);
    font-size: 12px;
    font-weight: 700;
}

.nav-actions,
.hero-actions {
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.language-switcher {
    min-height: 40px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(13, 19, 26, 0.72);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.lang-option {
    min-width: 36px;
    min-height: 30px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.lang-option:hover,
.lang-option:focus-visible,
.lang-option.active {
    background: var(--accent);
    color: #061014;
}

.lang-option:active {
    transform: scale(0.96);
}

.btn {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(23, 33, 44, 0.92);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.btn:hover,
.btn:focus-visible {
    border-color: var(--accent);
    background: var(--surface-3);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(1px) scale(0.98);
}

.btn-primary {
    border-color: rgba(101, 200, 189, 0.72);
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #061014;
}

.btn-secondary {
    border-color: rgba(101, 200, 189, 0.34);
    background: rgba(101, 200, 189, 0.08);
    color: #d8f5f1;
}

.btn-danger {
    border-color: rgba(255, 122, 134, 0.42);
    background: rgba(255, 122, 134, 0.1);
    color: #ffc8ce;
}

.page-hero {
    padding: 42px 0 26px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 18px;
    align-items: stretch;
}

.hero-copy,
.hero-panel,
.panel,
.stat,
.server-card,
.setting-card,
.command-card,
.status-strip,
.sidebar-card,
.command-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(18, 26, 35, 0.98), rgba(13, 19, 26, 0.98));
    box-shadow: var(--shadow);
}

.hero-copy {
    min-height: 370px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    animation: panelIn 650ms ease both;
}

.hero-copy::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(101, 200, 189, 0.1), transparent 42%),
        linear-gradient(180deg, transparent 0 72%, rgba(101, 200, 189, 0.07));
    pointer-events: none;
}

.hero-copy > * {
    position: relative;
}

.hero-panel,
.panel,
.sidebar-card {
    padding: 22px;
}

.hero-panel {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 18px;
    animation: panelIn 720ms ease 80ms both;
}

.bot-lockup {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.bot-avatar,
.server-icon,
.user-avatar {
    display: block;
    object-fit: cover;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface-2);
}

.bot-avatar {
    width: 96px !important;
    height: 96px !important;
    max-width: 96px !important;
    max-height: 96px !important;
    border-radius: 8px;
}

.mascot-preview {
    min-height: 164px;
    border: 1px solid rgba(101, 200, 189, 0.2);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(101, 200, 189, 0.14), transparent 42%),
        rgba(23, 33, 44, 0.58);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
    padding: 18px;
}

.mascot-preview img {
    width: 124px !important;
    height: 124px !important;
    max-width: 124px !important;
    max-height: 124px !important;
    border-radius: 8px;
    object-fit: cover;
    animation: floatAvatar 5200ms ease-in-out infinite;
}

.kicker {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(101, 200, 189, 0.32);
    border-radius: 8px;
    background: rgba(101, 200, 189, 0.08);
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin: 16px 0 14px;
    font-size: 48px;
    line-height: 1.04;
    letter-spacing: 0;
    text-wrap: balance;
}

h2 {
    margin-bottom: 12px;
    font-size: 22px;
    line-height: 1.2;
}

.lead {
    max-width: 62ch;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.65;
    text-wrap: pretty;
}

.subtle,
.deck-label,
.stat-label,
.field-help {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.hero-actions {
    justify-content: flex-start;
    margin-top: 22px;
}

.pulse-line {
    height: 8px;
    border-radius: 8px;
    background:
        linear-gradient(90deg, var(--accent) 0 26%, transparent 26% 32%, rgba(101, 200, 189, 0.58) 32% 54%, transparent 54% 60%, rgba(101, 200, 189, 0.36) 60% 78%, transparent 78% 84%, rgba(101, 200, 189, 0.72) 84% 100%);
    background-size: 140% 100%;
    animation: pulseScan 3600ms ease-in-out infinite;
}

.deck-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.deck-tile {
    min-height: 84px;
    padding: 14px;
    border: 1px solid rgba(41, 56, 70, 0.86);
    border-radius: 8px;
    background: rgba(23, 33, 44, 0.72);
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.deck-value,
.stat-value,
.badge {
    font-variant-numeric: tabular-nums;
}

.deck-value {
    margin-bottom: 5px;
    font-size: 22px;
    font-weight: 900;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 24px;
}

.stat {
    min-height: 128px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    animation: panelIn 520ms ease both;
}

.stat:nth-child(2) {
    animation-delay: 70ms;
}

.stat:nth-child(3) {
    animation-delay: 140ms;
}

.stat:nth-child(4) {
    animation-delay: 210ms;
}

.stat-top {
    justify-content: space-between;
    gap: 12px;
}

.mini-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    max-width: 34px;
    max-height: 34px;
    font-size: 12px;
}

.stat-value {
    font-size: 30px;
    line-height: 1;
    font-weight: 900;
}

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

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

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

.module-card {
    min-height: 106px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(23, 33, 44, 0.68);
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.module-card:hover,
.deck-tile:hover,
.server-card:hover,
.command-card:hover,
.setting-card:hover {
    border-color: rgba(101, 200, 189, 0.42);
    background: rgba(29, 42, 54, 0.76);
    transform: translateY(-2px);
}

.module-card strong {
    display: block;
    margin-bottom: 6px;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 26px 0 14px;
}

.panel .section-head {
    margin-top: 0;
}

.section-title {
    margin-bottom: 5px;
}

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

.server-card,
.setting-card,
.command-card {
    padding: 18px;
}

.server-card {
    display: grid;
    gap: 18px;
    animation: panelIn 560ms ease both;
}

.server-line {
    gap: 12px;
    min-width: 0;
}

.server-icon,
.user-avatar {
    width: 48px !important;
    height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    border-radius: 8px;
    flex: 0 0 auto;
}

.server-title {
    max-width: 100%;
    font-weight: 900;
}

.status-line {
    gap: 8px;
    margin-top: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 16px rgba(101, 214, 156, 0.55);
}

.status-dot.muted {
    background: var(--muted-2);
    box-shadow: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(13, 19, 26, 0.76);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.badge-accent {
    border-color: rgba(101, 200, 189, 0.34);
    color: var(--accent);
}

.badge-danger {
    border-color: rgba(232, 115, 94, 0.45);
    background: rgba(232, 115, 94, 0.13);
    color: #ffae9c;
}

.spotlight-grid {
    margin: 0 0 24px;
}

.developer-card,
.community-card {
    min-height: 230px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
}

.developer-card::after,
.community-card::after {
    content: "";
    position: absolute;
    inset: auto -20% -45% 35%;
    height: 180px;
    background: radial-gradient(circle, rgba(101, 200, 189, 0.18), transparent 62%);
    pointer-events: none;
}

.developer-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
}

.developer-avatar {
    width: 74px !important;
    height: 74px !important;
    min-width: 74px !important;
    max-width: 74px !important;
    max-height: 74px !important;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(101, 200, 189, 0.28);
}

.profile {
    gap: 10px;
    min-width: 0;
    padding: 5px 8px 5px 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(18, 26, 35, 0.72);
}

.profile-name {
    max-width: 160px;
    font-weight: 800;
}

.settings-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 18px;
    padding: 30px 0 68px;
}

.sidebar {
    align-self: start;
    position: sticky;
    top: 92px;
}

.server-profile {
    text-align: center;
}

.server-profile .server-icon,
.server-profile .avatar-fallback {
    width: 86px !important;
    height: 86px !important;
    max-width: 86px !important;
    max-height: 86px !important;
    margin: 0 auto 12px;
    font-size: 34px;
}

.sidebar-list {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

.sidebar-item {
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid rgba(41, 56, 70, 0.68);
}

.setting-card {
    display: grid;
    gap: 8px;
}

.setting-card label {
    font-weight: 900;
}

.field {
    width: 100%;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: none;
    background: #0a0f15;
    color: var(--text);
}

.field:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(101, 200, 189, 0.12);
}

.save-bar {
    position: sticky;
    bottom: 16px;
    display: none;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid rgba(101, 200, 189, 0.34);
    border-radius: 8px;
    background: rgba(18, 26, 35, 0.98);
    box-shadow: var(--shadow);
}

.save-bar.active {
    display: flex;
}

.search-panel {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    margin-top: 18px;
}

.command-hero {
    padding-bottom: 18px;
}

.command-head {
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.command-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.command-item {
    padding: 12px;
    box-shadow: none;
}

.command-name {
    margin-bottom: 4px;
    color: var(--accent);
    font-family: Consolas, "Courier New", monospace;
    font-weight: 900;
}

.empty-panel {
    display: none;
    margin-top: 18px;
}

.empty-state {
    margin-bottom: 48px;
}

.status-strip {
    padding: 16px;
    margin: 24px 0 48px;
}

.metric-row {
    gap: 10px;
    flex-wrap: wrap;
}

footer {
    margin-top: auto;
    padding: 22px 0;
    border-top: 1px solid rgba(101, 200, 189, 0.14);
    color: var(--muted-2);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-inner a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 800;
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatAvatar {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes pulseScan {
    0%,
    100% {
        background-position: 0 0;
    }
    50% {
        background-position: 100% 0;
    }
}

@media (max-width: 920px) {
    .hero-grid,
    .settings-layout,
    .grid-2 {
        grid-template-columns: 1fr;
    }

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

    .sidebar {
        position: static;
    }
}

@media (max-width: 680px) {
    .shell {
        width: min(100% - 20px, 1240px);
    }

    .topbar-inner {
        min-height: auto;
        padding: 13px 0;
        align-items: flex-start;
    }

    .brand-copy {
        max-width: 190px;
    }

    .page-hero {
        padding-top: 28px;
    }

    .hero-copy {
        min-height: 0;
        padding: 22px;
    }

    h1 {
        font-size: 34px;
    }

    .lead {
        font-size: 15px;
    }

    .metric-grid,
    .module-grid,
    .server-grid,
    .deck-grid,
    .search-panel,
    .spotlight-grid,
    .mascot-preview {
        grid-template-columns: 1fr;
    }

    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .save-bar {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .brand-subtitle,
    .profile-name {
        display: none;
    }

    .language-switcher {
        order: 3;
        width: 100%;
        justify-content: space-between;
    }

    .lang-option {
        flex: 1;
    }

    .bot-lockup {
        grid-template-columns: 72px 1fr;
    }

    .bot-avatar {
        width: 72px !important;
        height: 72px !important;
        max-width: 72px !important;
        max-height: 72px !important;
    }
}

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