#homePage {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    z-index: 10;
    width: min(520px, 90vw);
}

.title {
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--fg);
    user-select: none;
    opacity: 0;
    animation: slideUp 0.55s var(--ease) 0.05s forwards;
}

.search-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: var(--panel);
    padding: 13px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    backdrop-filter: blur(8px);
    transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
    opacity: 0;
    animation: slideUp 0.55s var(--ease) 0.14s forwards;
}

.search-wrap:focus-within {
    border-color: var(--line-3);
    background: rgba(22, 24, 42, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 8px 30px rgba(139, 125, 212, 0.1);
}

.search-icon {
    flex-shrink: 0;
    color: var(--fg-3);
    transition: color 0.25s var(--ease);
}

.search-wrap:focus-within .search-icon { color: var(--fg); }

.search-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--fg);
    font-size: 14px;
    font-weight: 400;
}

.search-field::placeholder { color: var(--fg-3); }

.quick-links {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    opacity: 0;
    animation: slideUp 0.55s var(--ease) 0.42s forwards;
}

.quick-links-label {
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg-3);
    font-weight: 500;
}

.links {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.link-btn {
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 14px;
    color: var(--fg-2);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}

.link-btn:hover {
    border-color: var(--line-3);
    color: var(--fg);
    background: rgba(200, 195, 230, 0.03);
    transform: translateY(-1px);
}

.link-btn:active { transform: translateY(0); }

a.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    line-height: 1;
}

a.link-btn.discord-link {
    color: #b9bdf4;
    border-color: rgba(88, 101, 242, 0.35);
}

a.link-btn.discord-link .discord-icon {
    color: #8a93f0;
    transition: color 0.2s var(--ease);
}

a.link-btn.discord-link:hover {
    color: #fff;
    border-color: rgba(88, 101, 242, 0.85);
    background: rgba(88, 101, 242, 0.10);
}

a.link-btn.discord-link:hover .discord-icon {
    color: #fff;
}

.nav-cards {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
    margin-top: 4px;
    width: 100%;
    max-width: 620px;
    opacity: 0;
    animation: slideUp 0.55s var(--ease) 0.28s forwards;
}

.nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 78px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--fg-2, #a9a3c7);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    background: transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.nav-card:hover {
    border-color: var(--line-3, rgba(200, 195, 230, 0.25));
    color: var(--fg, #eae6ff);
}

.nav-card svg {
    width: 20px;
    height: 20px;
    color: var(--accent, #b8b0da);
}

@media (max-width: 580px) {
    #homePage {
        top: 50%;
        gap: 18px;
        width: min(520px, calc(100vw - 24px));
    }
    .title {
        font-size: 24px;
    }
    .search-wrap {
        padding: 14px 14px;
        border-radius: 14px;
    }
    .search-field {
        font-size: 16px;
    }
    .links {
        gap: 6px;
    }
    .link-btn {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 38px;
    }
    .nav-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        max-width: 100%;
        padding: 0 4px;
        margin-top: 4px;
    }
    .nav-card {
        height: 70px;
        font-size: 11px;
        gap: 6px;
    }
    .nav-card svg { width: 18px; height: 18px; }
    .quick-links { margin-top: 6px; gap: 8px; }
    .quick-links-label { font-size: 9px; letter-spacing: 0.18em; }
}

@media (max-width: 380px) {
    #homePage { gap: 14px; }
    .title { font-size: 22px; }
    .nav-cards { gap: 5px; }
    .nav-card { height: 64px; font-size: 10.5px; }
    .nav-card svg { width: 17px; height: 17px; }
}

@media (max-height: 700px) and (max-width: 580px) {
    #homePage { top: 46%; gap: 12px; }
    .nav-cards { margin-top: 2px; }
}

.discord-chip {
    position: fixed;
    top: 16px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px 7px 11px;
    border-radius: 999px;
    background: rgba(200, 195, 230, 0.04);
    border: 1px solid var(--line);
    color: var(--fg-3);
    font-size: 11.5px;
    font-weight: 400;
    letter-spacing: 0.01em;
    text-decoration: none;
    z-index: 30;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: top 0.25s var(--ease), opacity 0.22s var(--ease), color 0.22s var(--ease), background 0.22s var(--ease), border-color 0.22s var(--ease), transform 0.22s var(--ease);
    opacity: 0;
    animation: slideDown 0.55s var(--ease) 0.55s forwards;
}

body:has(.tab-strip.visible) .discord-chip {
    top: 64px;
}

body.noc-overlay-open .discord-chip,
body.browsing .discord-chip {
    opacity: 0 !important;
    transform: translateY(-6px);
    pointer-events: none;
}

.discord-chip:hover {
    color: var(--fg);
    background: rgba(200, 195, 230, 0.07);
    border-color: var(--line-3);
}

.discord-chip .discord-chip-icon {
    flex-shrink: 0;
    color: var(--fg-3);
    transition: color 0.22s var(--ease);
}

.discord-chip:hover .discord-chip-icon { color: var(--accent); }

@media (max-width: 480px) {
    .discord-chip {
        top: 12px;
        left: 12px;
        padding: 6px 10px 6px 9px;
        font-size: 11px;
        gap: 6px;
    }
    body:has(.tab-strip.visible) .discord-chip { top: 66px; }
    .discord-chip-text { display: none; }
}

.welcome-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 6, 13, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
    animation: slideDown 0.4s var(--ease) forwards;
}

.welcome-banner.hidden {
    display: none;
}

.welcome-content {
    background: var(--panel);
    border: 1px solid var(--line-2);
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    animation: slideUp 0.5s var(--ease) 0.1s forwards;
    opacity: 0;
}

.welcome-content h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--fg);
    margin: 0 0 8px 0;
}

.welcome-decoration {
    width: 200px;
    height: 40px;
    margin: 12px auto 20px;
    display: block;
    color: var(--accent-2);
    animation: slideUp 0.6s var(--ease) 0.15s forwards;
    opacity: 0;
}

.welcome-desc {
    font-size: 24px;
    font-weight: 500;
    color: var(--fg-2);
    margin: 0 0 20px 0;
    letter-spacing: 0.3px;
}

.welcome-desc .highlight {
    color: var(--accent);
    font-weight: 600;
}

.welcome-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 24px 0;
    text-align: left;
}

.info-section h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--fg-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px 0;
}

.info-section p {
    font-size: 13px;
    color: var(--fg-2);
    margin: 0;
}

.tech-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 12px;
    color: var(--fg-2);
}

.tech-list li {
    padding: 2px 0;
    line-height: 1.5;
}

.welcome-ok-btn {
    margin-top: 24px;
    padding: 10px 24px;
    background: var(--accent);
    color: #05060d;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s var(--ease), transform 0.25s var(--ease);
    animation: slideUp 0.6s var(--ease) 0.3s forwards;
    opacity: 0;
}

.welcome-ok-btn:hover {
    background: var(--accent-2);
    transform: translateY(-2px);
}

.welcome-ok-btn:active {
    transform: translateY(0);
}

.ab-btn {
    position: absolute;
    top: 18px;
    left: 18px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px 7px 9px;
    background: rgba(200, 195, 230, 0.05);
    border: 1px solid rgba(200, 195, 230, 0.12);
    border-radius: 8px;
    color: var(--fg-2);
    font-size: 11px;
    font-family: 'JetBrains Mono', 'Space Mono', monospace;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    z-index: 5;
}
.ab-btn:hover {
    background: rgba(200, 195, 230, 0.1);
    border-color: rgba(200, 195, 230, 0.2);
    color: var(--fg);
}
.ab-btn svg { opacity: 0.9; }

.online-widget.outer {
    width: 220px;
    height: 140px;
    border-radius: 14px;
    padding: 1px;
    background: radial-gradient(circle 200px at 0% 0%, rgba(200, 195, 230, 0.6), #0c0d0d);
    position: relative;
    margin: 28px auto 0;
}
.online-widget .dot {
    width: 5px;
    aspect-ratio: 1;
    position: absolute;
    background-color: #c9c1ff;
    box-shadow: 0 0 10px #c9c1ff;
    border-radius: 100px;
    z-index: 2;
    right: 10%;
    top: 10%;
    animation: onlineMoveDot 6s linear infinite;
}
@keyframes onlineMoveDot {
    0%, 100% { top: 10%; right: 10%; }
    25% { top: 10%; right: calc(100% - 25px); }
    50% { top: calc(100% - 22px); right: calc(100% - 25px); }
    75% { top: calc(100% - 22px); right: 10%; }
}
.online-widget .card {
    z-index: 1;
    width: 100%;
    height: 100%;
    border-radius: 13px;
    border: solid 1px #1c1d2d;
    background: radial-gradient(circle 240px at 0% 0%, #2a2b3f, #0c0d12);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-direction: column;
    color: var(--fg);
    overflow: hidden;
}
.online-widget .ray {
    width: 180px;
    height: 38px;
    border-radius: 100px;
    position: absolute;
    background-color: #c9c1ff;
    opacity: 0.28;
    box-shadow: 0 0 50px #c9c1ff;
    filter: blur(10px);
    transform-origin: 10%;
    top: 0;
    left: 0;
    transform: rotate(40deg);
}
.online-widget .card .text {
    font-weight: 700;
    font-size: 2.6rem;
    line-height: 1;
    background: linear-gradient(45deg, #2a2336 4%, #fff, #2a2336);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-variant-numeric: tabular-nums;
}
.online-widget .online-label {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--fg-3);
    margin-top: 6px;
}
.online-widget .line {
    width: 100%;
    height: 1px;
    position: absolute;
    background-color: #2c2c3a;
}
.online-widget .topl {
    top: 10%;
    background: linear-gradient(90deg, #6b6580 30%, #1d1f2f 70%);
}
.online-widget .bottoml { bottom: 10%; }
.online-widget .leftl {
    left: 10%;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, #6b6580 30%, #22243a 70%);
}
.online-widget .rightl {
    right: 10%;
    width: 1px;
    height: 100%;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-suggest {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 40;
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    max-height: 320px;
    overflow-y: auto;
    background: rgba(10, 11, 20, 0.97);
    border: 1px solid var(--line-2);
    border-radius: 12px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}

.search-suggest.open {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.suggest-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--fg-2);
    font-size: 13.5px;
    text-align: left;
    cursor: pointer;
    transition: background 0.14s var(--ease), color 0.14s var(--ease);
}

.suggest-item .si-icon {
    flex-shrink: 0;
    display: flex;
    color: var(--fg-3);
    transition: color 0.14s var(--ease);
}

.suggest-item .si-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggest-item:hover,
.suggest-item.active {
    background: rgba(184, 176, 218, 0.12);
    color: var(--fg);
}

.suggest-item.active .si-icon,
.suggest-item:hover .si-icon { color: var(--accent); }

#navRail {
    position: fixed;
    left: 0;
    top: 46px;
    bottom: 0;
    width: 208px;
    z-index: 40;
    display: flex;
    align-items: stretch;
    transform: translateX(-100%);
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.tab-strip.visible ~ #navRail { top: 98px; }

body.browsing #navRail {
    transform: translateX(calc(-100% + 16px));
    pointer-events: auto;
}

body.browsing #navRail.intro,
body.browsing #navRail:hover {
    transform: translateX(0);
}

.nav-rail-inner {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 12px;
    background: rgba(8, 9, 16, 0.93);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--line);
    overflow-y: auto;
}

.rail-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-radius: 9px;
    color: var(--fg-2);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.16s var(--ease), color 0.16s var(--ease), transform 0.16s var(--ease);
}

.rail-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--accent);
}

.rail-item:hover {
    background: rgba(184, 176, 218, 0.12);
    color: var(--fg);
    transform: translateX(2px);
}

.nav-rail-tab {
    width: 16px;
    flex-shrink: 0;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 9, 16, 0.93);
    border-right: 1px solid var(--line);
    color: var(--fg-3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.rail-arrow { transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1); }

body.browsing #navRail:hover .rail-arrow,
body.browsing #navRail.intro .rail-arrow { transform: rotate(180deg); }

/* Hide the left slide-out rail while viewing an internal-page tab */
body.internal-active #navRail { display: none !important; }

@media (max-width: 580px) {
    .tab-strip.visible ~ #navRail { top: 102px; }
    #navRail { width: 200px; }
}

/* "Restore last state" chip shown after a refresh */
.noc-restore-chip {
    position: fixed;
    left: 50%;
    bottom: 74px;
    transform: translateX(-50%) translateY(14px);
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    background: rgba(13, 14, 24, 0.96);
    border: 1px solid var(--line-2);
    border-radius: 999px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(16px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.noc-restore-chip.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.noc-restore-chip .nrc-main {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--fg);
    font-size: 12.5px;
    font-weight: 500;
    font-family: inherit;
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.noc-restore-chip .nrc-main svg { color: var(--accent); flex-shrink: 0; }
.noc-restore-chip .nrc-main:hover { background: rgba(184, 176, 218, 0.12); }
.noc-restore-chip .nrc-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--fg-3);
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.noc-restore-chip .nrc-x:hover { background: rgba(200, 195, 230, 0.1); color: var(--fg); }
