/* ═══════════════════════════════════════════════════════════
   Kill3rKai — hub (main.html)
   Console layout: identity rail on the left, link directory on the right.
   Brand kept: #020812 void, #00c8ff cyan, scanlines, grid, corner brackets,
   Bebas Neue / Share Tech Mono / Rajdhani, crosshair cursor.
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg: #020812;
    --panel: #05101d;
    --panel-hi: #08182a;
    --line: rgba(0, 200, 255, 0.16);
    --line-hi: rgba(0, 200, 255, 0.45);
    --cyan: #00c8ff;
    --accent: #00c8ff;
    --pink: #ff2d78;
    --purple: #a259ff;
    --gold: #d4af37;
    --noti: #d0342c;
    --goal: #ff8a3d;
    --specs: #39e58c;
    --text: #e0f4ff;
    --muted: #7ba3bf;
    --glow: 0 0 24px rgba(0, 200, 255, 0.35);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

a {
    color: inherit;
    text-decoration: none;
}

:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

/* ── ATMOSPHERE ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, .14) 2px, rgba(0, 0, 0, .14) 4px);
    pointer-events: none;
    z-index: 100
}

#fx {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none
}

.noise {
    position: fixed;
    inset: 0;
    opacity: .03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 99
}

.corner-deco {
    position: fixed;
    width: 60px;
    height: 60px;
    pointer-events: none;
    z-index: 2
}

.corner-deco.tl {
    top: 16px;
    left: 16px;
    border-top: 1px solid var(--line-hi);
    border-left: 1px solid var(--line-hi)
}

.corner-deco.tr {
    top: 16px;
    right: 16px;
    border-top: 1px solid var(--line-hi);
    border-right: 1px solid var(--line-hi)
}

.corner-deco.bl {
    bottom: 16px;
    left: 16px;
    border-bottom: 1px solid var(--line-hi);
    border-left: 1px solid var(--line-hi)
}

.corner-deco.br {
    bottom: 16px;
    right: 16px;
    border-bottom: 1px solid var(--line-hi);
    border-right: 1px solid var(--line-hi)
}

.shell {
    position: relative;
    z-index: 1;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 40px 90px
}

/* ── HERO ── */
.rail {
    min-height: 94vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 34px;
    padding: 72px 0 48px
}

.crest {
    position: relative;
    width: 104px;
    height: 104px;
    margin-bottom: 30px;
    border-radius: 50%;
    box-shadow: 0 0 50px rgba(0, 200, 255, .45)
}

.crest::before,
.crest::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    animation: spin 22s linear infinite
}

.crest::before {
    inset: -16px;
    border: 1px dashed rgba(0, 200, 255, .5)
}

.crest::after {
    inset: -32px;
    border: 1px dotted rgba(0, 200, 255, .3);
    animation-direction: reverse;
    animation-duration: 34s
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.icon-replacement {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
    border: 1px solid var(--line-hi);
    background: #111
}

.hero-name {
    position: relative;
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(5rem, 19.5vw, 19rem);
    line-height: .8;
    letter-spacing: .01em;
    color: #fff;
    text-shadow: 0 0 70px rgba(0, 200, 255, .55);
    white-space: nowrap;
    margin-bottom: 26px;
    animation: powerOn .9s steps(1, end) both
}

.hero-name::before,
.hero-name::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0;
    text-shadow: none
}

.hero-name::before {
    color: var(--cyan)
}

.hero-name::after {
    color: var(--pink)
}

.hero-name.glitch::before {
    opacity: .95;
    transform: translate(-9px, 0);
    clip-path: inset(var(--a, 20%) 0 var(--b, 55%) 0)
}

.hero-name.glitch::after {
    opacity: .95;
    transform: translate(9px, 0);
    clip-path: inset(var(--b, 55%) 0 var(--a, 20%) 0)
}

@keyframes powerOn {
    0% {
        opacity: 0
    }

    8% {
        opacity: 1
    }

    14% {
        opacity: .15
    }

    22% {
        opacity: 1
    }

    30% {
        opacity: .45
    }

    40%,
    100% {
        opacity: 1
    }
}

.hero-sub {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
    color: var(--cyan);
    min-height: 1.4em;
    margin-bottom: 12px
}

.hero-sub::before {
    content: '> ';
    opacity: .55
}

.hero-sub .cursor {
    display: inline-block;
    width: 2px;
    height: .9em;
    background: var(--cyan);
    vertical-align: middle;
    margin-left: 2px;
    animation: blink 1s step-end infinite
}

@keyframes blink {
    50% {
        opacity: 0
    }
}

.hero-desc {
    font-size: 1.3rem;
    color: var(--muted);
    max-width: 42ch
}

.rail-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 16px
}

.readout {
    min-width: 300px;
    border: 1px solid var(--line);
    background: rgba(5, 16, 29, .8);
    backdrop-filter: blur(6px);
    font-family: 'Share Tech Mono', monospace;
    font-size: .85rem
}

.readout-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px
}

.readout-row+.readout-row {
    border-top: 1px solid var(--line)
}

.readout dt {
    color: var(--muted)
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--pink)
}

.live-badge:hover {
    color: #fff
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--pink);
    border-radius: 50%;
    animation: pulse 1.8s ease-in-out infinite
}

@keyframes pulse {
    50% {
        opacity: .4;
        transform: scale(.7)
    }
}

.hint {
    font-family: 'Share Tech Mono', monospace;
    font-size: .85rem;
    color: var(--cyan);
    background: rgba(0, 200, 255, .06);
    border: 1px solid var(--line-hi);
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: background .2s, box-shadow .2s
}

.hint:hover {
    background: rgba(0, 200, 255, .14);
    box-shadow: var(--glow)
}

kbd {
    font: inherit;
    border: 1px solid currentColor;
    padding: 1px 8px
}

/* ── DIRECTORY (bento) ── */
.pane {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 64px 40px
}

.dir:nth-child(1),
.dir:nth-child(6),
.footer {
    grid-column: 1/-1
}

.js .dir {
    clip-path: inset(-8px calc(100% - 3px) -8px -8px);
    transition: clip-path .9s cubic-bezier(.7, 0, .2, 1)
}

.js .dir.in {
    clip-path: inset(-12px)
}

.dir-title {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: 1rem;
    color: var(--cyan);
    margin-bottom: 14px
}

.missions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px
}

.featured-card {
    --rx: 0deg;
    --ry: 0deg;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 38px 34px 32px;
    border: 1px solid var(--line);
    background: radial-gradient(520px circle at var(--mx, -300px) var(--my, -300px), rgba(var(--rgb), .22), transparent 60%), var(--panel);
    transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
    transition: transform .15s ease-out, border-color .25s
}

.featured-card::before,
.featured-card::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 0 solid var(--tone);
    transition: width .25s, height .25s
}

.featured-card::before {
    top: -1px;
    left: -1px;
    border-top-width: 2px;
    border-left-width: 2px
}

.featured-card::after {
    bottom: -1px;
    right: -1px;
    border-bottom-width: 2px;
    border-right-width: 2px
}

.featured-card:hover {
    border-color: rgba(var(--rgb), .6)
}

.featured-card:hover::before,
.featured-card:hover::after {
    width: 30px;
    height: 30px
}

.mission-lilly {
    --tone: var(--purple);
    --rgb: 162, 89, 255
}

.mission-os {
    --tone: var(--cyan);
    --rgb: 0, 200, 255
}

.featured-icon {
    font-size: 2.2rem;
    color: var(--tone);
    margin-bottom: 34px;
    filter: drop-shadow(0 0 14px var(--tone))
}

.featured-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3.2rem, 6vw, 5rem);
    line-height: .9;
    color: #fff;
    letter-spacing: .02em
}

.featured-sub {
    font-family: 'Share Tech Mono', monospace;
    font-size: .85rem;
    color: var(--muted);
    margin-top: 10px
}

.progress-wrap {
    margin-top: 30px;
    display: flex;
    align-items: center;
    gap: 12px
}

.progress-track {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, .08);
    overflow: hidden
}

.progress-fill {
    height: 100%;
    width: 0;
    background: var(--tone);
    box-shadow: 0 0 12px var(--tone);
    transition: width 1.5s cubic-bezier(.4, 0, .2, 1) .4s
}

.progress-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: .85rem;
    color: var(--tone);
    min-width: 38px;
    text-align: right
}

.rows {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line)
}

.rows.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr))
}

.dir:nth-child(6) .rows.cols-2 {
    grid-template-columns: repeat(3, minmax(0, 1fr))
}

.rows.cols-2 .row:last-child:nth-child(odd) {
    grid-column: 1/-1
}

.dir:nth-child(6) .rows.cols-2 .row:last-child:nth-child(odd) {
    grid-column: auto
}

.row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 17px 18px;
    min-width: 0;
    background: radial-gradient(260px circle at var(--mx, -300px) var(--my, -300px), rgba(0, 200, 255, .16), transparent 70%), var(--panel)
}

.row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--cyan);
    transform: scaleY(0);
    transition: transform .2s
}

.row:hover::before,
.row:focus-visible::before {
    transform: scaleY(1)
}

.row-icon {
    width: 24px;
    flex-shrink: 0;
    text-align: center;
    font-size: 1.25rem
}

.row-name {
    flex: 1;
    min-width: 0;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.15
}

.row-tag {
    font-family: 'Share Tech Mono', monospace;
    font-size: .78rem;
    color: var(--muted);
    white-space: nowrap;
    transition: color .2s
}

.row:hover .row-tag {
    color: var(--text)
}

.footer {
    font-family: 'Share Tech Mono', monospace;
    font-size: .75rem;
    letter-spacing: .2em;
    color: var(--muted)
}

.footer span {
    color: var(--cyan)
}

.footer-link:hover {
    color: #fff;
    text-shadow: 0 0 6px #fff
}

/* ── COMMAND PALETTE ── */
#palette {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 14vh 20px 20px;
    background: rgba(2, 8, 18, .82);
    backdrop-filter: blur(8px)
}

#palette[hidden] {
    display: none
}

.pal-box {
    width: min(640px, 100%);
    background: var(--panel);
    border: 1px solid var(--line-hi);
    box-shadow: var(--glow)
}

.pal-in {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    font-family: 'Share Tech Mono', monospace;
    color: var(--cyan)
}

.pal-in input {
    flex: 1;
    background: none;
    border: 0;
    outline: 0;
    color: var(--text);
    font: inherit;
    font-size: 1rem
}

#pal-list {
    list-style: none;
    max-height: 50vh;
    overflow: auto
}

#pal-list li {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 12px 18px;
    font-size: 1.1rem;
    font-weight: 600
}

#pal-list li span {
    font-family: 'Share Tech Mono', monospace;
    font-size: .78rem;
    color: var(--muted);
    font-weight: 400
}

#pal-list li em {
    margin-left: auto;
    font: 400 .78rem 'Share Tech Mono', monospace;
    color: var(--muted)
}

#pal-list li.sel {
    background: rgba(0, 200, 255, .12);
    box-shadow: inset 2px 0 var(--cyan)
}

/* ── CURSOR (fine pointers only) ── */
#cursor,
#cursorRing {
    display: none;
}

@media (pointer: fine) {

    body,
    a,
    button,
    *,
    *::before,
    *::after {
        cursor: none !important;
    }

    #cursor,
    #cursorRing {
        display: block;
    }
}

#cursor {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--cyan);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 16px var(--cyan);
    mix-blend-mode: screen;
}

#cursorRing {
    position: fixed;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(0, 200, 255, 0.4);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease;
}

/* ── LIVE TOAST (built by live.js) ── */
#live-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 200;
    width: 260px;
    background: rgba(2, 8, 18, 0.94);
    border: 1px solid rgba(255, 45, 120, 0.4);
    border-left: 3px solid var(--pink);
    box-shadow: 0 0 18px rgba(255, 45, 120, 0.3);
    overflow: hidden;
    animation: toastIn 0.5s ease both;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#live-toast .lt-link {
    display: block;
    color: var(--text);
}

#live-toast .lt-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: #071323;
}

#live-toast .lt-info {
    padding: 10px 12px 12px;
    font-family: 'Share Tech Mono', monospace;
}

#live-toast .lt-top {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

#live-toast .lt-live {
    color: var(--pink);
}

#live-toast .lt-viewers {
    margin-left: auto;
    color: var(--muted);
}

#live-toast .lt-title {
    margin-top: 6px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#live-toast .lt-game {
    margin-top: 2px;
    font-size: 0.7rem;
    color: var(--cyan);
    letter-spacing: 0.1em;
}

#live-toast .lt-link:hover .lt-title {
    color: var(--pink);
}

#live-toast .lt-close {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    line-height: 22px;
    background: rgba(2, 8, 18, 0.7);
    border: 0;
    border-radius: 50%;
    color: var(--text);
    font-size: 1.1rem;
}

/* ── RESPONSIVE ── */
@media (max-width:900px) {
    .shell {
        padding: 0 24px 72px
    }

    .pane {
        grid-template-columns: minmax(0, 1fr);
        gap: 48px
    }

    .dir:nth-child(6) .rows.cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

@media (max-width:600px) {

    .missions,
    .rows.cols-2,
    .dir:nth-child(6) .rows.cols-2 {
        grid-template-columns: minmax(0, 1fr)
    }

    .corner-deco {
        display: none
    }

    .hero-name {
        font-size: 23vw
    }

    .readout {
        min-width: 0;
        flex: 1
    }

    .hint {
        padding: 14px 20px
    }

    .crest {
        width: 84px;
        height: 84px
    }

    #live-toast {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto
    }

    #live-toast .lt-link {
        display: flex
    }

    #live-toast .lt-thumb {
        width: 110px;
        flex-shrink: 0
    }

    #live-toast .lt-info {
        min-width: 0;
        padding: 8px 30px 8px 10px
    }
}

@media (prefers-reduced-motion:reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important
    }

    html {
        scroll-behavior: auto
    }
}

/* ── MAINTENANCE ALET BOX ── */
.maintenance-banner {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 9997;

    background: rgba(255, 170, 0, 0.10);
    border-bottom: 1px solid rgba(255, 170, 0, 0.45);
    border-top: 1px solid rgba(255, 170, 0, 0.25);

    padding: 14px 24px;

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.maintenance-content {
    max-width: 1200px;
    margin: 0 auto;

    display: flex;
    align-items: center;
    gap: 16px;
}

.maintenance-icon {
    color: #ffb020;
    font-size: 25px;
    flex-shrink: 0;

    animation: maintenance-pulse 2s infinite;
}

.maintenance-text strong {
    display: block;
    color: #ffb020;

    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    letter-spacing: 1.5px;

    margin-bottom: 5px;
}

.maintenance-text p {
    color: #d6c49f;
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(15px, 1.15vw, 19px);
    font-weight: 500;

    margin: 0;
    line-height: 1.5;
}

@keyframes maintenance-pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.45;
    }
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .maintenance-banner {
        padding: clamp(14px, 1.5vw, 24px) clamp(20px, 2.5vw, 40px);
    }

    .maintenance-content {
        gap: 12px;
    }

    .maintenance-icon {
        font-size: clamp(25px, 2vw, 34px);
    }

    .maintenance-text strong {
        font-size: clamp(13px, 1vw, 18px);
    }

    .maintenance-text p {
        font-size: 13px;
    }
}