:root {
    --bg: #060816;
    --panel: rgba(11, 17, 35, 0.72);
    --panel-strong: rgba(14, 22, 42, 0.88);
    --line: rgba(110, 139, 255, 0.22);
    --line-strong: rgba(98, 222, 255, 0.38);
    --text: #e8f2ff;
    --muted: #9fb4d9;
    --primary: #67e8f9;
    --primary-strong: #7c3aed;
    --success: #34d399;
    --danger: #fb7185;
    --warning: #f59e0b;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.18), transparent 38%),
        radial-gradient(circle at top right, rgba(103, 232, 249, 0.15), transparent 30%),
        linear-gradient(180deg, #03050d 0%, #080f1f 52%, #03050d 100%);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    position: relative;
    overflow-x: hidden;
}

canvas#fxCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.85;
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(103, 232, 249, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(103, 232, 249, 0.05) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 90%);
    z-index: 0;
}

.bg-glow {
    position: fixed;
    width: 38vw;
    height: 38vw;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.24;
    z-index: 0;
}

.bg-glow-a {
    top: -12vw;
    left: -10vw;
    background: #7c3aed;
}

.bg-glow-b {
    right: -10vw;
    top: 20vh;
    background: #06b6d4;
}

.app-shell,
.login-shell {
    position: relative;
    z-index: 1;
    width: min(1280px, calc(100% - 32px));
    margin: 24px auto;
}

.login-shell {
    min-height: calc(100vh - 48px);
    display: grid;
    place-items: center;
}

.glass-card,
.panel-card {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-radius: 24px;
    margin-bottom: 18px;
}

.brand {
    display: inline-flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text);
}

.brand-kicker,
.eyebrow {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--primary);
    font-size: 11px;
}

.brand-title {
    margin-top: 6px;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(18px, 2vw, 24px);
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.nav-link,
.btn,
.icon-btn {
    border: 0;
    text-decoration: none;
    cursor: pointer;
    transition: 0.22s ease;
}

.nav-link {
    color: var(--text);
    padding: 11px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    font-weight: 600;
}

.nav-link:hover,
.nav-link.active {
    border-color: var(--line-strong);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(103, 232, 249, 0.1), 0 0 26px rgba(103, 232, 249, 0.08);
}

.nav-link.danger:hover {
    border-color: rgba(251, 113, 133, 0.42);
    box-shadow: 0 0 26px rgba(251, 113, 133, 0.08);
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    padding: 28px;
    border-radius: 30px;
    margin-bottom: 18px;
}

.hero h1,
.login-card h1 {
    margin: 10px 0 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.08;
}

.lead {
    margin: 0;
    color: var(--muted);
    max-width: 720px;
    line-height: 1.7;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.content-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    padding-bottom: 40px;
}

.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-7 { grid-column: span 7; }
.col-6 { grid-column: span 6; }
.col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; }

.panel-card {
    border-radius: 28px;
    padding: 24px;
}

.panel-card h2,
.panel-card h3 {
    margin: 0 0 10px;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(18px, 2vw, 24px);
}

.panel-muted {
    color: var(--muted);
    margin-bottom: 18px;
    line-height: 1.7;
}

.stats-grid,
.result-grid,
.cards-grid,
.editor-grid {
    display: grid;
    gap: 14px;
}

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

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

.stat-card,
.info-box,
.server-card {
    min-width: 0;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
}

.stat-card strong,
.server-card strong {
    display: block;
    margin-top: 10px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.stat-label,
.meta-label {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #dce8ff;
}

input[type="text"],
input[type="password"],
input[type="search"],
textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(4, 10, 26, 0.84);
    color: var(--text);
    outline: none;
    font-size: 15px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

input:focus,
textarea:focus {
    border-color: rgba(103, 232, 249, 0.55);
    box-shadow: 0 0 0 4px rgba(103, 232, 249, 0.09);
}

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

.input-group,
.stack,
.stack-lg {
    display: grid;
    gap: 10px;
}

.stack { gap: 12px; }
.stack-lg { gap: 18px; }

.form-actions,
.inline-actions,
.toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 16px;
    font-weight: 700;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    color: #03111e;
    background: linear-gradient(135deg, var(--primary) 0%, #38bdf8 100%);
    box-shadow: 0 10px 30px rgba(103, 232, 249, 0.18);
}

.btn-primary:hover,
.icon-btn:hover {
    transform: translateY(-2px);
}

.btn-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
}

.btn-danger {
    color: #fff;
    background: linear-gradient(135deg, #ef4444 0%, #fb7185 100%);
    box-shadow: 0 12px 28px rgba(239, 68, 68, 0.18);
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 14px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    font-size: 14px;
    font-weight: 700;
}

.alert {
    margin-bottom: 16px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid transparent;
}

.alert-danger {
    background: rgba(190, 24, 93, 0.12);
    border-color: rgba(251, 113, 133, 0.3);
    color: #fecdd3;
}

.alert-success,
.alert-info {
    background: rgba(6, 182, 212, 0.12);
    border-color: rgba(103, 232, 249, 0.28);
    color: #cffafe;
}

.login-card {
    width: min(560px, 100%);
    border-radius: 32px;
    padding: 34px;
}

.login-meta {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.meta-item span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    box-shadow: 0 0 16px rgba(103, 232, 249, 0.5);
}

.code-block,
.data-pill {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    word-break: break-all;
}

.code-block {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.78);
    border: 1px solid rgba(103, 232, 249, 0.12);
    color: #d4e9ff;
    line-height: 1.65;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    box-sizing: border-box;
}

.data-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--line);
}

.table-wrap {
    overflow: auto;
    border-radius: 22px;
    border: 1px solid var(--line);
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.table th,
.table td {
    padding: 16px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    text-align: left;
    vertical-align: top;
}

.table th {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.server-meta {
    display: grid;
    gap: 8px;
}

.server-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.empty-state {
    padding: 28px;
    border-radius: 22px;
    border: 1px dashed rgba(103, 232, 249, 0.24);
    text-align: center;
    color: var(--muted);
}

.helper-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.8;
}

.helper-list strong {
    color: var(--text);
}

.kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    max-width: 100%;
    padding: 0 10px;
    min-height: 32px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.05);
    font-weight: 700;

    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 1080px) {
    .col-8, .col-7, .col-6, .col-5, .col-4 {
        grid-column: span 12;
    }

    .hero,
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid,
    .result-grid,
    .cards-grid,
    .editor-grid,
    .input-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .app-shell,
    .login-shell {
        width: min(100% - 20px, 1280px);
        margin: 10px auto;
    }

    .topbar,
    .panel-card,
    .hero,
    .login-card {
        padding: 18px;
        border-radius: 22px;
    }

    .hero h1,
    .login-card h1 {
        font-size: 26px;
    }

    .btn,
    .icon-btn,
    .nav-link {
        width: 100%;
    }

    .server-actions,
    .main-nav,
    .toolbar,
    .form-actions,
    .inline-actions {
        width: 100%;
    }
}

a {
    color: var(--primary);
}

a:hover {
    color: #ffffff;
}

.switcher-card {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.info-box,
.panel-card,
.input-group {
    min-width: 0;
    overflow: hidden;
}

@media (max-width: 720px) {
    .code-block {
        font-size: 13px;
        line-height: 1.5;
        padding: 12px 14px;
    }

    .kbd {
        display: inline-block;
        max-width: 100%;
        line-height: 1.4;
        padding: 8px 10px;
    }

    .info-box {
        padding: 16px;
    }
}
