:root {
    --green: #39ff14;
    --green-dim: #1a7a09;
    --green-glow: rgba(57, 255, 20, 0.4);
    --amber: #ffb300;
    --red: #ff2400;
    --cyan: #00ffff;
    --bg: #030803;
    --surface: rgba(0, 10, 0, 0.85);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: var(--bg);
    color: var(--green);
    font-family: 'Share Tech Mono', monospace;
    overflow-x: hidden;
    cursor: crosshair;
    position: relative;
}

body.modal-open {
    overflow: hidden;
    touch-action: none;
}

#webgl-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 4px var(--green);
    opacity: 0;
    animation: float-particle linear forwards;
}

@keyframes float-particle {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0);
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateY(-100vh) translateX(var(--drift));
    }
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.15) 2px,
            rgba(0, 0, 0, 0.15) 4px);
    pointer-events: none;
    z-index: 999;
    animation: scanroll 8s linear infinite;
}

@keyframes scanroll {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 100px;
    }
}

@keyframes phosphor {

    0%,
    100% {
        opacity: 1;
    }

    92% {
        opacity: 1;
    }

    93% {
        opacity: 0.85;
    }

    94% {
        opacity: 1;
    }

    96% {
        opacity: 0.9;
    }

    97% {
        opacity: 1;
    }
}

#page-wrap {
    animation: phosphor 6s ease-in-out infinite;
    position: relative;
    z-index: 2;
    overflow-x: hidden;
}

#loading-screen {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: pointer;
    transition: opacity 0.4s ease;
}

#loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

#typewriter-text {
    width: 80%;
    max-width: 600px;
    font-family: 'Courier New', Courier, monospace;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    line-height: 1.8;
    white-space: pre-wrap;
    color: var(--green);
    padding: 0 20px;
}

@keyframes blink-text {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 1.2rem;
    background-color: var(--green);
    animation: blink-text 1s step-end infinite;
    vertical-align: middle;
}

#ticker-wrap {
    width: 100%;
    background: rgba(57, 255, 20, 0.08);
    border-top: 1px solid var(--green-dim);
    border-bottom: 1px solid var(--green-dim);
    overflow: hidden;
    padding: 6px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

#ticker-inner {
    display: flex;
    white-space: nowrap;
    animation: ticker 30s linear infinite;
    font-size: clamp(0.65rem, 1.5vw, 0.8rem);
    letter-spacing: 2px;
    color: var(--amber);
    font-family: 'Share Tech Mono', monospace;
}

#ticker-inner span {
    padding: 0 40px;
}

#ticker-inner .sep {
    color: var(--red);
}

@keyframes ticker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

#main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

.hero {
    text-align: center;
    padding: 80px 0 60px;
    position: relative;
}

.pfp-wrap {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto 40px;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.pfp-wrap:hover .pfp-img {
    transform: rotateY(15deg) rotateX(10deg) translateZ(20px);
}

.radiation-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--green-dim);
    animation: pulse-ring 3s ease-out infinite;
    opacity: 0;
}

.radiation-ring:nth-child(1) {
    inset: -20px;
    animation-delay: 0s;
}

.radiation-ring:nth-child(2) {
    inset: -45px;
    animation-delay: 1s;
}

.radiation-ring:nth-child(3) {
    inset: -70px;
    animation-delay: 2s;
}

@keyframes pulse-ring {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    20% {
        opacity: 0.6;
    }

    100% {
        opacity: 0;
        transform: scale(1.1);
    }
}

.pfp-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--green);
    box-shadow:
        0 0 30px var(--green-glow),
        inset 0 0 20px rgba(57, 255, 20, 0.05),
        0 20px 60px rgba(0, 0, 0, 0.5);
    background-image: url('assets/wasteland_bot.png');
    background-size: cover;
    background-position: center;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
}

.glitch-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 8px;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.4rem, 8vw, 5.5rem);
    font-weight: 900;
    letter-spacing: 8px;
    text-transform: uppercase;
    color: var(--green);
    text-shadow:
        0 0 20px var(--green-glow),
        0 0 40px var(--green-glow),
        0 0 80px rgba(57, 255, 20, 0.2);
    position: relative;
    background: linear-gradient(180deg, var(--green) 0%, rgba(57, 255, 20, 0.6) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h1::before,
h1::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: none;
    -webkit-text-fill-color: initial;
}

h1::before {
    color: var(--red);
    animation: glitch-1 4s infinite;
    clip-path: polygon(0 30%, 100% 30%, 100% 50%, 0 50%);
}

h1::after {
    color: var(--cyan);
    animation: glitch-2 4s infinite;
    clip-path: polygon(0 60%, 100% 60%, 100% 75%, 0 75%);
}

@keyframes glitch-1 {

    0%,
    89%,
    100% {
        transform: none;
        opacity: 0;
    }

    90% {
        transform: translateX(-4px);
        opacity: 0.8;
    }

    91% {
        transform: translateX(4px);
        opacity: 0.8;
    }

    92% {
        transform: translateX(0);
        opacity: 0;
    }

    95% {
        transform: translateX(-3px);
        opacity: 0.6;
    }

    96% {
        transform: none;
        opacity: 0;
    }
}

@keyframes glitch-2 {

    0%,
    85%,
    100% {
        transform: none;
        opacity: 0;
    }

    86% {
        transform: translateX(5px);
        opacity: 0.7;
    }

    87% {
        transform: translateX(-3px);
        opacity: 0.7;
    }

    88% {
        transform: none;
        opacity: 0;
    }

    93% {
        transform: translateX(2px);
        opacity: 0.5;
    }

    94% {
        transform: none;
        opacity: 0;
    }
}

.hero-sub {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    letter-spacing: 6px;
    color: var(--amber);
    text-transform: uppercase;
    margin-bottom: 24px;
    animation: subtle-glow 3s ease-in-out infinite;
}

@keyframes subtle-glow {

    0%,
    100% {
        text-shadow: 0 0 10px rgba(255, 179, 0, 0.3);
    }

    50% {
        text-shadow: 0 0 20px rgba(255, 179, 0, 0.6);
    }
}

.hero-desc {
    max-width: 680px;
    margin: 0 auto 36px;
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    line-height: 1.9;
    color: rgba(57, 255, 20, 0.7);
}

.btn-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.btn {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.8rem, 1.5vw, 1rem);
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 16px 32px;
    background: transparent;
    color: var(--green);
    border: 2px solid var(--green);
    cursor: crosshair;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
    box-shadow: 0 0 0 rgba(57, 255, 20, 0);
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--green);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: -1;
}

.btn::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, transparent, var(--green-glow), transparent);
    opacity: 0;
    transition: opacity 0.3s;
    animation: border-flow 3s linear infinite;
    z-index: -2;
}

@keyframes border-flow {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

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

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

.btn:active::after {
    opacity: 1;
}

.btn:active {
    color: #000;
    box-shadow:
        0 0 20px var(--green-glow),
        0 0 40px var(--green-glow),
        0 10px 30px rgba(0, 0, 0, 0.5);
}

@media (hover: hover) and (pointer: fine) {
    .btn:hover::before {
        transform: translateY(0);
    }

    .btn:hover::after {
        opacity: 1;
    }

    .btn:hover {
        color: #000;
        box-shadow:
            0 0 20px var(--green-glow),
            0 0 40px var(--green-glow),
            0 10px 30px rgba(0, 0, 0, 0.5);
        transform: translateY(-2px);
    }
}

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

.btn.danger::before {
    background: var(--red);
}

.btn.danger::after {
    background: linear-gradient(45deg, transparent, rgba(255, 36, 0, 0.4), transparent);
}

@media (hover: hover) and (pointer: fine) {
    .btn.danger:hover {
        color: #fff;
        box-shadow:
            0 0 20px rgba(255, 36, 0, 0.4),
            0 0 40px rgba(255, 36, 0, 0.2),
            0 10px 30px rgba(0, 0, 0, 0.5);
    }
}

.countdown-section {
    text-align: center;
    padding: 60px 0;
    border-top: 1px dashed var(--green-dim);
    border-bottom: 1px dashed var(--green-dim);
    margin: 40px 0 60px;
    background: radial-gradient(ellipse at center, rgba(57, 255, 20, 0.03) 0%, transparent 70%);
}

.countdown-label {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.6rem, 1.2vw, 0.7rem);
    letter-spacing: 6px;
    color: var(--red);
    margin-bottom: 30px;
    animation: blink-text 2s step-end infinite;
}

.countdown-digits {
    display: flex;
    justify-content: center;
    gap: clamp(4px, 2vw, 12px);
    align-items: center;
    flex-wrap: wrap;
}

.cd-block {
    text-align: center;
    perspective: 1000px;
}

.cd-num {
    font-family: 'VT323', monospace;
    font-size: clamp(3rem, 8vw, 5.5rem);
    line-height: 1;
    color: var(--green);
    text-shadow:
        0 0 15px var(--green-glow),
        0 0 30px var(--green-glow);
    display: block;
    min-width: clamp(60px, 15vw, 110px);
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--green-dim);
    padding: 12px 8px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s;
}

.cd-num::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(57, 255, 20, 0.2), transparent);
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 200%;
    }
}

.cd-block:hover .cd-num {
    transform: rotateX(10deg) scale(1.05);
}

.cd-label {
    font-size: clamp(0.5rem, 1vw, 0.65rem);
    letter-spacing: 4px;
    color: var(--green-dim);
    margin-top: 8px;
    display: block;
}

.cd-sep {
    font-family: 'VT323', monospace;
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: var(--red);
    line-height: 1;
    margin-bottom: 24px;
    animation: blink-text 1s step-end infinite;
}

.section-box {
    border: 1px solid var(--green-dim);
    padding: clamp(24px, 5vw, 40px);
    margin-bottom: 40px;
    background: var(--surface);
    position: relative;
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
    opacity: 0;
    transform: translateY(40px) rotateX(10deg);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
    backdrop-filter: blur(5px);
}

.section-box.visible {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
}

.section-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.section-box::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    width: 50px;
    height: 50px;
    border-top: 3px solid var(--green);
    border-left: 3px solid var(--green);
    transition: all 0.3s;
}

.section-box::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 50px;
    height: 50px;
    border-bottom: 3px solid var(--green);
    border-right: 3px solid var(--green);
    transition: all 0.3s;
}

.section-box:hover::before,
.section-box:hover::after {
    width: 70px;
    height: 70px;
}

.section-label {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.55rem, 1vw, 0.65rem);
    letter-spacing: 5px;
    color: var(--green-dim);
    margin-bottom: 16px;
    text-transform: uppercase;
}

h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    letter-spacing: 3px;
    color: var(--green);
    text-transform: uppercase;
    margin-bottom: 20px;
    text-shadow: 0 0 8px var(--green-glow);
}

p {
    line-height: 1.9;
    color: rgba(57, 255, 20, 0.75);
    margin-bottom: 16px;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.stat-item {
    border-left: 3px solid var(--green-dim);
    padding-left: 16px;
    transition: all 0.3s;
    position: relative;
}

.stat-item::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 0;
    width: 3px;
    height: 0;
    background: var(--green);
    transition: height 0.3s;
}

.stat-item:hover::before {
    height: 100%;
}

.stat-item:hover {
    transform: translateX(5px);
}

.stat-label {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.55rem, 1vw, 0.6rem);
    letter-spacing: 4px;
    color: var(--green-dim);
    margin-bottom: 8px;
    display: block;
}

.stat-value {
    font-family: 'VT323', monospace;
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    color: var(--green);
    line-height: 1.2;
}

.rad-bar-wrap {
    margin-top: 32px;
}

.rad-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: clamp(0.65rem, 1.2vw, 0.75rem);
    color: var(--green-dim);
    letter-spacing: 2px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.rad-bar-track {
    width: 100%;
    height: 16px;
    background: rgba(57, 255, 20, 0.1);
    border: 1px solid var(--green-dim);
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

.rad-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green) 0%, var(--amber) 60%, var(--red) 100%);
    animation: rad-fill 3s ease-out forwards, rad-pulse 2s 3s ease-in-out infinite;
    position: relative;
    box-shadow: 0 0 20px var(--green-glow);
}

.rad-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: rad-shine 2s linear infinite;
}

@keyframes rad-fill {
    0% {
        width: 0%;
    }

    100% {
        width: 87%;
    }
}

@keyframes rad-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes rad-shine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(200%);
    }
}

.signal-log {
    font-size: clamp(0.75rem, 1.3vw, 0.9rem);
    line-height: 2.2;
    color: rgba(57, 255, 20, 0.6);
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.signal-log::-webkit-scrollbar {
    width: 8px;
}

.signal-log::-webkit-scrollbar-track {
    background: rgba(57, 255, 20, 0.05);
}

.signal-log::-webkit-scrollbar-thumb {
    background: var(--green-dim);
    border-radius: 4px;
}

.signal-log::-webkit-scrollbar-thumb:hover {
    background: var(--green);
}

.signal-log .log-line {
    display: block;
    opacity: 0;
    animation: fade-in-log 0.3s forwards;
}

@keyframes fade-in-log {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.signal-log .ts {
    color: var(--green-dim);
    margin-right: 12px;
}

.signal-log .ok {
    color: var(--green);
    font-weight: bold;
}

.signal-log .err {
    color: var(--red);
    font-weight: bold;
}

.signal-log .warn {
    color: var(--amber);
    font-weight: bold;
}

.trait-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.trait-pill {
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    letter-spacing: 2px;
    padding: 10px 18px;
    border: 1px solid var(--green-dim);
    color: var(--green);
    background: rgba(57, 255, 20, 0.05);
    clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
    cursor: crosshair;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.trait-pill::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--green);
    opacity: 0;
    transition: opacity 0.3s;
}

.trait-pill:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 20px rgba(57, 255, 20, 0.3);
}

.trait-pill:hover::before {
    opacity: 0.1;
}

.trait-pill.rare {
    border-color: var(--amber);
    color: var(--amber);
}

.trait-pill.rare::before {
    background: var(--amber);
}

.trait-pill.rare:hover {
    box-shadow: 0 5px 20px rgba(255, 179, 0, 0.3);
}

.trait-pill.legendary {
    border-color: var(--red);
    color: var(--red);
    animation: legendary-pulse 2s ease-in-out infinite;
}

.trait-pill.legendary::before {
    background: var(--red);
}

.trait-pill.legendary:hover {
    box-shadow: 0 5px 20px rgba(255, 36, 0, 0.4);
}

@keyframes legendary-pulse {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(255, 36, 0, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 36, 0, 0.6);
    }
}

footer {
    text-align: center;
    padding: 60px 0 40px;
    border-top: 1px solid var(--green-dim);
    position: relative;
}

.footer-logo {
    font-family: 'VT323', monospace;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: var(--green);
    text-shadow: 0 0 20px var(--green-glow);
    letter-spacing: 8px;
    margin-bottom: 30px;
    animation: phosphor 4s ease-in-out infinite;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: clamp(20px, 5vw, 40px);
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--green-dim);
    text-decoration: none;
    font-size: clamp(0.75rem, 1.5vw, 0.9rem);
    letter-spacing: 3px;
    text-transform: uppercase;
    transition: all 0.3s;
    position: relative;
    padding-bottom: 5px;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--green);
    transition: width 0.3s;
}

.footer-links a:hover {
    color: var(--green);
    text-shadow: 0 0 8px var(--green-glow);
}

.footer-links a:hover::after {
    width: 100%;
}

.footer-small {
    font-size: clamp(0.65rem, 1.2vw, 0.75rem);
    color: var(--green-dim);
    letter-spacing: 2px;
    animation: blink-text 4s step-end infinite;
}


@media (max-width: 768px) {
    #main {
        padding: 0 16px 60px;
    }

    .hero {
        padding: 60px 0 40px;
    }

    .pfp-wrap {
        width: 200px;
        height: 200px;
    }

    .countdown-section {
        padding: 40px 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .section-box {
        padding: 20px;
    }

    h1 {
        letter-spacing: 4px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: clamp(1.75rem, 9vw, 3.1rem);
        letter-spacing: 1px;
        white-space: nowrap;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .countdown-digits {
        gap: 4px;
    }

    .cd-num {
        padding: 8px 4px;
    }

    .trait-grid {
        gap: 8px;
    }

    .footer-logo {
        letter-spacing: 4px;
    }
}

.audio-btn {
    position: fixed;
    top: calc(16px + env(safe-area-inset-top, 0px));
    right: calc(16px + env(safe-area-inset-right, 0px));
    z-index: 1000;
    padding: 10px;
    font-size: 0.8rem;
    width: auto !important;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    background: rgba(0, 10, 0, 0.8);
}

@media (max-width: 768px) {
    /* Backdrop blur is expensive on mobile GPUs */
    #ticker-wrap {
        backdrop-filter: none;
    }

    .audio-btn {
        backdrop-filter: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    body::after {
        animation: none;
    }

    #page-wrap {
        animation: none;
    }

    #ticker-inner {
        animation: none;
    }

    .radiation-ring {
        animation: none;
    }

    .apply-scanlines {
        display: none;
    }

    .apply-ping i {
        animation: none;
    }
}
.audio-btn:active {
    transform: none;
}

.audio-btn .audio-icon {
    width: 22px;
    height: 22px;
    display: block;
    fill: none;
    stroke: var(--green);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.audio-btn .audio-icon--off {
    display: none;
}

.audio-btn.is-muted .audio-icon--on {
    display: none;
}

.audio-btn.is-muted .audio-icon--off {
    display: block;
}

/* MODAL STYLES */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 10, 0, 0.95);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    opacity: 1 !important; /* Override intersection observer */
    transform: none !important;
}

/* ─── ENLISTMENT UPLINK (APPLICATION EXPERIENCE) ─── */
.apply-overlay {
    background: radial-gradient(ellipse 120% 80% at 50% 20%, rgba(57, 255, 20, 0.12), transparent 55%),
        radial-gradient(ellipse 80% 60% at 80% 100%, rgba(255, 36, 0, 0.08), transparent 45%),
        rgba(0, 8, 2, 0.97);
    backdrop-filter: blur(12px);
    padding: calc(16px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.apply-vignette {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 2001;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.75) 100%);
}

.apply-scanlines {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 2002;
    opacity: 0.12;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.45) 2px,
            rgba(0, 0, 0, 0.45) 4px);
    mix-blend-mode: multiply;
}

.apply-shell {
    position: relative;
    z-index: 2005;
    max-width: 820px;
    width: 100%;
    margin: auto;
    padding: clamp(20px, 4vw, 36px) !important;
    background: linear-gradient(165deg, rgba(0, 18, 6, 0.92) 0%, rgba(0, 6, 2, 0.96) 100%);
    border-color: rgba(57, 255, 20, 0.35);
    box-shadow:
        0 0 0 1px rgba(57, 255, 20, 0.08),
        0 24px 80px rgba(0, 0, 0, 0.65),
        0 0 60px rgba(57, 255, 20, 0.06);
}

.apply-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    width: 40px;
    height: 40px;
    border: 1px solid var(--green-dim);
    background: rgba(0, 0, 0, 0.5);
    color: var(--green);
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.apply-close:hover,
.apply-close:focus-visible {
    color: var(--amber);
    border-color: var(--amber);
    box-shadow: 0 0 16px rgba(255, 179, 0, 0.25);
    outline: none;
}

.apply-corners {
    pointer-events: none;
    position: absolute;
    inset: 10px;
    z-index: 0;
}

.apply-corners span {
    position: absolute;
    width: 28px;
    height: 28px;
    border-color: rgba(57, 255, 20, 0.25);
    border-style: solid;
}

.apply-corners span:nth-child(1) {
    top: 0;
    left: 0;
    border-width: 2px 0 0 2px;
}

.apply-corners span:nth-child(2) {
    top: 0;
    right: 0;
    border-width: 2px 2px 0 0;
}

.apply-corners span:nth-child(3) {
    bottom: 0;
    left: 0;
    border-width: 0 0 2px 2px;
}

.apply-corners span:nth-child(4) {
    bottom: 0;
    right: 0;
    border-width: 0 2px 2px 0;
}

.apply-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    padding-right: 48px;
    position: relative;
    z-index: 1;
}

.apply-section-kicker {
    margin-bottom: 8px !important;
}

.apply-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1rem, 3vw, 1.35rem);
    letter-spacing: 0.2em;
    margin-bottom: 8px !important;
    text-shadow: 0 0 20px var(--green-glow);
}

.apply-tagline {
    font-size: clamp(0.75rem, 1.8vw, 0.9rem);
    color: rgba(57, 255, 20, 0.55);
    letter-spacing: 0.12em;
    max-width: 36ch;
    line-height: 1.6;
}

.apply-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    min-width: 160px;
}

.apply-ping {
    display: flex;
    gap: 6px;
}

.apply-ping i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green-dim);
    animation: apply-ping 1.4s ease-in-out infinite;
}

.apply-ping i:nth-child(2) {
    animation-delay: 0.2s;
}

.apply-ping i:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes apply-ping {

    0%,
    100% {
        opacity: 0.35;
        transform: scale(1);
        background: var(--green-dim);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
        background: var(--green);
        box-shadow: 0 0 8px var(--green-glow);
    }
}

.apply-uplink {
    text-align: right;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
}

.apply-uplink-label {
    color: var(--green-dim);
    display: block;
    margin-bottom: 4px;
}

.apply-uplink-val {
    color: var(--cyan);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.35);
}

.apply-rad-meter {
    width: 100%;
    max-width: 180px;
}

.apply-rad-label {
    font-size: 0.6rem;
    letter-spacing: 0.25em;
    color: var(--red);
    display: block;
    margin-bottom: 4px;
}

.apply-rad-bar {
    height: 6px;
    background: rgba(255, 36, 0, 0.15);
    border: 1px solid rgba(255, 36, 0, 0.35);
    overflow: hidden;
}

.apply-rad-bar span {
    display: block;
    height: 100%;
    width: 22%;
    background: linear-gradient(90deg, var(--amber), var(--red));
    box-shadow: 0 0 12px rgba(255, 36, 0, 0.5);
    transition: width 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.apply-progress-block {
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.apply-progress-track {
    height: 3px;
    background: rgba(57, 255, 20, 0.12);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 14px;
}

.apply-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--green-dim), var(--green));
    box-shadow: 0 0 14px var(--green-glow);
    transition: width 0.55s cubic-bezier(0.23, 1, 0.32, 1);
}

.apply-phases {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 0;
    padding: 0;
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.55rem, 1.8vw, 0.65rem);
    letter-spacing: 0.08em;
    color: var(--green-dim);
}

.apply-phases li {
    text-align: center;
    padding: 8px 4px;
    border: 1px solid rgba(57, 255, 20, 0.12);
    background: rgba(0, 0, 0, 0.35);
    transition: border-color 0.25s, color 0.25s, box-shadow 0.25s;
}

.apply-phase-num {
    display: block;
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    color: rgba(57, 255, 20, 0.35);
    margin-bottom: 4px;
}

.apply-phases li.is-active {
    border-color: var(--amber);
    color: var(--amber);
    box-shadow: 0 0 20px rgba(255, 179, 0, 0.15);
}

.apply-phases li.is-active .apply-phase-num {
    color: var(--amber);
}

.apply-phases li.is-done {
    border-color: rgba(57, 255, 20, 0.45);
    color: rgba(57, 255, 20, 0.85);
}

.apply-phases li.is-done .apply-phase-num {
    color: var(--green);
}

.apply-body {
    display: grid;
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
    gap: clamp(16px, 3vw, 28px);
    align-items: start;
    position: relative;
    z-index: 1;
}

/* Prevent horizontal overflow inside the modal */
.apply-shell,
.apply-shell * {
    min-width: 0;
}

.apply-trace {
    border: 1px solid rgba(57, 255, 20, 0.15);
    background: rgba(0, 0, 0, 0.45);
    min-height: 200px;
    max-height: 420px;
    display: flex;
    flex-direction: column;
}

.apply-trace-hdr {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    color: var(--green-dim);
    padding: 10px 12px;
    border-bottom: 1px dashed rgba(57, 255, 20, 0.15);
}

.apply-live-log {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    line-height: 1.65;
    color: rgba(57, 255, 20, 0.55);
}

.apply-log-line {
    margin-bottom: 8px;
    padding-left: 8px;
    border-left: 2px solid rgba(57, 255, 20, 0.2);
    animation: apply-log-in 0.35s ease-out;
}

@keyframes apply-log-in {
    from {
        opacity: 0;
        transform: translateX(-6px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.apply-main {
    min-width: 0;
}

.apply-phase-banner {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.65rem, 2vw, 0.75rem);
    letter-spacing: 0.28em;
    color: var(--cyan);
    margin-bottom: 20px;
    text-shadow: 0 0 12px rgba(0, 255, 255, 0.25);
}

.step-flavor {
    font-size: clamp(0.8rem, 2vw, 0.95rem);
    color: rgba(57, 255, 20, 0.45);
    line-height: 1.65;
    margin: -12px 0 20px;
    font-style: italic;
    letter-spacing: 0.04em;
}

.faction-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-left: 4px;
}

.faction-copy strong {
    letter-spacing: 0.12em;
    font-size: 0.95rem;
}

.faction-copy small {
    font-size: 0.75rem;
    color: rgba(57, 255, 20, 0.45);
    letter-spacing: 0.06em;
    text-transform: none;
}

.apply-faction-commit {
    margin-top: 20px;
    width: 100%;
}

.apply-transmit {
    width: 100%;
    margin-top: 20px;
}

.apply-shell.apply-flash {
    animation: apply-shell-flash 0.18s ease-out;
}

@keyframes apply-shell-flash {
    0% {
        filter: brightness(1.15) contrast(1.08);
    }

    100% {
        filter: brightness(1) contrast(1);
    }
}

.form-step--shake {
    animation: apply-shake 0.45s ease-out;
}

@keyframes apply-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

.apply-success {
    position: relative;
    text-align: center;
    padding: 12px 8px 8px;
}

.apply-success-glow {
    pointer-events: none;
    position: absolute;
    inset: -20%;
    background: radial-gradient(circle at 50% 30%, rgba(255, 179, 0, 0.12), transparent 55%);
    z-index: 0;
}

.apply-success-ascii {
    position: relative;
    z-index: 1;
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.55rem, 2.5vw, 0.7rem);
    color: var(--amber);
    line-height: 1.35;
    margin-bottom: 16px;
    text-shadow: 0 0 20px rgba(255, 179, 0, 0.35);
    overflow-x: auto;
}

.apply-success-title {
    position: relative;
    z-index: 1;
    color: var(--amber) !important;
    font-size: clamp(1rem, 3vw, 1.2rem) !important;
    margin-bottom: 16px !important;
}

.apply-success-lead {
    position: relative;
    z-index: 1;
    color: rgba(57, 255, 20, 0.75);
    line-height: 1.85;
    max-width: 42ch;
    margin: 0 auto 20px;
    font-size: clamp(0.85rem, 2.2vw, 1rem);
}

.apply-success-warn {
    position: relative;
    z-index: 1;
    color: var(--red);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.apply-tweet-cta {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
}

.apply-success-done {
    display: none;
    position: relative;
    z-index: 1;
    color: var(--green);
    margin-top: 24px;
    font-family: 'VT323', monospace;
    font-size: 1.4rem;
}

@media (max-width: 720px) {
    /* Mobile / narrow: one compact column, keyboard-friendly, no full-viewport overlay scroll */
    .apply-overlay {
        align-items: stretch;
        justify-content: flex-start;
        overflow-y: hidden;
        padding: calc(10px + env(safe-area-inset-top, 0px)) calc(10px + env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) calc(10px + env(safe-area-inset-left, 0px));
    }

    .apply-overlay .apply-vignette,
    .apply-overlay .apply-scanlines {
        display: none;
    }

    .apply-shell {
        margin: 0 auto;
        max-height: min(88vh, calc(100vh - 24px));
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    @supports (height: 100dvh) {
        .apply-shell {
            max-height: min(88dvh, calc(100svh - 24px));
        }
    }

    .apply-corners {
        display: none;
    }

    .apply-tagline {
        display: none;
    }

    .apply-header {
        padding-right: 44px;
        margin-bottom: 14px;
        gap: 12px;
    }

    .apply-title {
        font-size: clamp(0.85rem, 3.8vw, 1.1rem);
    }

    .apply-header-right {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 10px 16px;
        width: 100%;
        min-width: 0;
    }

    .apply-rad-meter {
        max-width: 140px;
    }

    .apply-progress-block {
        margin-bottom: 12px;
    }

    .apply-phases {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4px;
        font-size: 0.52rem;
    }

    .apply-phases li {
        padding: 6px 2px;
    }

    .apply-phase-num {
        font-size: 0.95rem;
        margin-bottom: 2px;
    }

    .apply-phase-banner {
        margin-bottom: 10px;
        font-size: 0.58rem;
        letter-spacing: 0.18em;
    }

    .apply-body {
        grid-template-columns: 1fr;
    }

    /* Trace log removed on small screens — saves vertical space; desktop keeps the “experience” */
    .apply-trace {
        display: none;
    }

    .step-flavor {
        display: none;
    }

    .step-prompt {
        font-size: clamp(1rem, 3.6vw, 1.2rem);
        margin-bottom: 12px;
        min-height: 0;
    }

    .apply-main .modal-footer {
        position: sticky;
        bottom: 0;
        margin-top: 16px;
        padding-top: 12px;
        padding-bottom: 4px;
        background: linear-gradient(180deg, transparent, rgba(0, 6, 2, 0.96) 28%, rgba(0, 6, 2, 0.98) 100%);
        border-top-color: rgba(57, 255, 20, 0.2);
        z-index: 2;
    }
}

@media (max-width: 480px) {
    .apply-overlay {
        padding: calc(12px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) calc(12px + env(safe-area-inset-left, 0px));
    }

    .apply-shell {
        padding: 18px !important;
    }

    .input-row {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 12px;
    }

    .input-row input {
        flex: 1 1 100%;
        font-size: 16px;
        padding: 10px 0;
    }

    textarea {
        font-size: 16px;
    }

    .btn-next {
        width: 100% !important;
    }
}

.form-step {
    animation: boot-up 0.4s ease-out;
}

@keyframes boot-up {
    0% { opacity: 0; transform: translateY(10px) scale(0.98); filter: brightness(2) contrast(1.5); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: brightness(1) contrast(1); }
}

.step-prompt {
    color: var(--amber);
    margin-bottom: 24px;
    font-family: 'VT323', monospace;
    font-size: 1.4rem;
    text-transform: uppercase;
    text-shadow: 0 0 5px rgba(255, 179, 0, 0.5);
    min-height: 2rem;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(57, 255, 20, 0.05);
    border: 1px solid var(--green-dim);
    padding: 8px 16px;
    transition: all 0.3s;
}

.input-row:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 15px var(--green-glow);
}

.prompt-cursor {
    color: var(--green);
    font-weight: bold;
    animation: blink-text 1s step-end infinite;
    font-size: 1.2rem;
}

.input-row input {
    background: transparent;
    border: none;
    color: var(--green);
    padding: 12px 0;
    flex: 1;
    font-size: 1.2rem;
    font-family: 'Share Tech Mono', monospace;
    outline: none;
}

.input-row input::placeholder, textarea::placeholder {
    color: rgba(57, 255, 20, 0.3);
}

textarea {
    width: 100%;
    background: rgba(57, 255, 20, 0.05);
    border: 1px solid var(--green-dim);
    color: var(--green);
    padding: 16px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s;
    resize: vertical;
}

textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 15px var(--green-glow);
}

.btn.minimal {
    border: none;
    background: transparent;
    padding: 8px 16px;
    color: var(--cyan);
    font-size: 0.9rem;
    clip-path: none;
    box-shadow: none;
}

.btn.minimal::before, .btn.minimal::after {
    display: none;
}

.btn.minimal:hover {
    color: #fff;
    text-shadow: 0 0 10px var(--cyan);
    transform: none;
    box-shadow: none;
}

.faction-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.faction-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    color: var(--green);
    border: 1px solid var(--green-dim);
    padding: 16px;
    transition: all 0.2s;
    background: rgba(0,0,0,0.4);
    font-size: 1.1rem;
}

.faction-option:hover {
    border-color: var(--green);
    background: rgba(57, 255, 20, 0.1);
}

.faction-option input {
    display: none;
}

.f-box {
    margin-right: 15px;
    color: var(--green-dim);
    font-family: 'VT323', monospace;
    font-size: 1.3rem;
}

.faction-option input:checked + .f-box {
    color: var(--amber);
}

.faction-option:has(input:checked) {
    border-color: var(--amber);
    background: rgba(255, 179, 0, 0.1);
    color: var(--amber);
    box-shadow: 0 0 15px rgba(255, 179, 0, 0.3);
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    border-top: 1px dashed var(--green-dim);
    padding-top: 15px;
}

.step-indicator {
    color: var(--green-dim);
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.abort-btn {
    color: var(--red) !important;
}

.abort-btn:hover {
    color: #fff !important;
    text-shadow: 0 0 10px var(--red) !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}