:root {
    --bg: #07020d;
    --bg-2: #0e0820;
    --panel: rgba(7, 2, 13, 0.72);
    --magenta: #ff00ff;
    --cyan: #00fff7;
    --green: #39ff14;
    --yellow: #fff700;
    --red: #ff2e63;
    --text: #e8e7ff;
    --dim: #817e9f;
    --grid: rgba(0, 255, 247, 0.08);
}

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

html {
    background: var(--bg);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    cursor: crosshair;
    font-family: "Space Mono", monospace;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -3;
    content: "";
    background:
        radial-gradient(circle at 18% 22%, rgba(255, 0, 255, 0.22), transparent 34%),
        radial-gradient(circle at 82% 60%, rgba(0, 255, 247, 0.16), transparent 38%),
        radial-gradient(circle at 52% 100%, rgba(57, 255, 20, 0.11), transparent 45%),
        linear-gradient(135deg, #07020d, #120625 55%, #02151f);
    animation: bgshift 18s ease-in-out infinite;
    pointer-events: none;
}

@keyframes bgshift {
    0%, 100% { filter: hue-rotate(0deg); transform: scale(1); }
    50% { filter: hue-rotate(18deg); transform: scale(1.08); }
}

a {
    color: inherit;
}

button {
    font: inherit;
}

.grid-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, transparent 0%, black 22%, black 76%, transparent 100%);
    pointer-events: none;
    transform: perspective(520px) rotateX(62deg) translateY(-24px);
    transform-origin: center top;
    animation: gridmove 4s linear infinite;
}

@keyframes gridmove {
    from { background-position: 0 0; }
    to { background-position: 0 48px; }
}

.scanline,
.noise {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
}

.scanline {
    background: repeating-linear-gradient(
        180deg,
        transparent 0,
        transparent 2px,
        rgba(0, 0, 0, 0.24) 3px,
        rgba(0, 0, 0, 0.24) 4px
    );
    mix-blend-mode: overlay;
}

.scanline::after {
    position: absolute;
    right: 0;
    left: 0;
    height: 80px;
    content: "";
    background: linear-gradient(transparent, rgba(0, 255, 247, 0.08), transparent);
    animation: scanmove 7s linear infinite;
}

@keyframes scanmove {
    0% { top: -100px; }
    100% { top: 110vh; }
}

.noise {
    z-index: 99;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#particles {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.header {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr) auto;
    gap: 22px;
    align-items: center;
    padding: 18px 36px;
    border-bottom: 1px solid rgba(255, 0, 255, 0.22);
    background: rgba(7, 2, 13, 0.58);
    backdrop-filter: blur(12px);
}

.logo {
    display: flex;
    gap: 6px;
    align-items: center;
    color: var(--text);
    font-family: "Orbitron", sans-serif;
    font-size: 21px;
    font-weight: 900;
    letter-spacing: 2px;
    text-decoration: none;
}

.logo-bracket { color: var(--magenta); }
.logo-main { color: var(--cyan); text-shadow: 0 0 12px var(--cyan); }
.logo-num { color: var(--green); text-shadow: 0 0 12px var(--green); }
.logo-tm { align-self: flex-start; color: var(--dim); font-size: 12px; }

.status-bar {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: center;
    min-width: 0;
    color: var(--dim);
    font-size: 11px;
    letter-spacing: 1px;
    text-align: center;
}

.status-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 12px var(--green);
    animation: pulse 1.4s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.38; transform: scale(0.7); }
}

.ping { color: var(--cyan); }

.nav-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.nav-actions a,
.mini-btn {
    border: 1px solid rgba(0, 255, 247, 0.5);
    background: rgba(0, 255, 247, 0.05);
    color: var(--cyan);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: "Orbitron", sans-serif;
    font-size: 11px;
    font-weight: 700;
    padding: 10px 12px;
    transition: 160ms ease;
}

.nav-actions a:hover,
.mini-btn:hover {
    border-color: var(--magenta);
    color: var(--bg);
    background: var(--magenta);
    box-shadow: 0 0 18px rgba(255, 0, 255, 0.55);
}

.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before,
.glitch::after {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    width: 100%;
    content: attr(data-text);
}

.glitch::before {
    color: var(--magenta);
    clip-path: polygon(0 0, 100% 0, 100% 34%, 0 34%);
    animation: glitch-1 3s infinite linear alternate-reverse;
}

.glitch::after {
    color: var(--cyan);
    clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
    animation: glitch-2 2s infinite linear alternate-reverse;
}

@keyframes glitch-1 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 1px); }
    40% { transform: translate(-2px, -1px); }
    60% { transform: translate(2px, 1px); }
    80% { transform: translate(1px, -1px); }
}

@keyframes glitch-2 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(2px, -1px); }
    40% { transform: translate(1px, 1px); }
    60% { transform: translate(-2px, -1px); }
    80% { transform: translate(-1px, 1px); }
}

.main {
    position: relative;
    z-index: 5;
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 58px 38px;
}

.hidden { display: none !important; }

.hero {
    position: relative;
    min-height: calc(100vh - 190px);
    padding: 48px 0 122px;
    text-align: center;
}

.hero-tag {
    display: inline-block;
    max-width: 100%;
    margin-bottom: 30px;
    border: 1px solid var(--green);
    color: var(--green);
    font-size: 11px;
    letter-spacing: 3px;
    line-height: 1.45;
    padding: 7px 14px;
    text-shadow: 0 0 8px var(--green);
    animation: tagblink 4s infinite;
}

@keyframes tagblink {
    97% { opacity: 1; }
    98% { opacity: 0.35; }
    99% { opacity: 1; }
}

.hero-title {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.2em;
    margin-bottom: 32px;
    font-family: "Orbitron", sans-serif;
    font-size: clamp(52px, 11vw, 132px);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 0.95;
}

.word {
    position: relative;
    display: inline-block;
    color: var(--text);
    cursor: pointer;
    text-shadow: 2px 2px 0 var(--magenta), -2px -2px 0 var(--cyan);
    transition: transform 180ms ease;
}

.word:hover {
    transform: skewX(-10deg) scale(1.045);
    animation: shake 0.36s;
}

@keyframes shake {
    0%, 100% { transform: skewX(-10deg) translate(0); }
    25% { transform: skewX(-10deg) translate(-3px, 2px); }
    50% { transform: skewX(-10deg) translate(3px, -2px); }
    75% { transform: skewX(-10deg) translate(-2px, 1px); }
}

.word.neon {
    color: var(--green);
    text-shadow:
        0 0 10px var(--green),
        0 0 20px var(--green),
        0 0 44px var(--green),
        0 0 82px rgba(57, 255, 20, 0.5);
    animation: flicker 3s infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.96; }
    52% { opacity: 0.42; }
    54% { opacity: 1; }
}

.hero-sub {
    max-width: 680px;
    margin: 0 auto 46px;
    color: var(--dim);
    font-size: 16px;
    line-height: 1.75;
}

.hl {
    color: var(--cyan);
    border-bottom: 1px dashed var(--cyan);
    padding-bottom: 1px;
}

.cta-btn {
    position: relative;
    display: inline-flex;
    gap: 16px;
    align-items: center;
    overflow: hidden;
    border: 2px solid var(--magenta);
    background: transparent;
    box-shadow: 0 0 22px rgba(255, 0, 255, 0.4), inset 0 0 20px rgba(255, 0, 255, 0.2);
    color: var(--text);
    cursor: pointer;
    font-family: "Orbitron", sans-serif;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 4px;
    padding: 24px 58px;
    transition: all 220ms ease;
}

.cta-btn::before {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(120deg, transparent, rgba(255, 0, 255, 0.42), transparent);
    transform: translateX(-100%);
    transition: transform 620ms ease;
}

.cta-btn:hover::before { transform: translateX(100%); }

.cta-btn:hover {
    background: var(--magenta);
    box-shadow: 0 0 42px var(--magenta), 0 0 84px rgba(255, 0, 255, 0.6);
    color: var(--bg);
    transform: translateY(-2px);
}

.cta-arrow { transition: transform 180ms ease; }
.cta-btn:hover .cta-arrow { transform: translateX(8px); }

.ticker {
    position: absolute;
    right: -38px;
    bottom: 18px;
    left: -38px;
    overflow: hidden;
    border-top: 1px solid rgba(0, 255, 247, 0.32);
    border-bottom: 1px solid rgba(0, 255, 247, 0.32);
    background: rgba(0, 255, 247, 0.04);
    padding: 10px 0;
}

.ticker-track {
    display: flex;
    gap: 58px;
    width: max-content;
    color: var(--cyan);
    font-size: 12px;
    letter-spacing: 2px;
    white-space: nowrap;
    animation: tick 60s linear infinite;
}

@keyframes tick {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.scanner {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.scanner-frame {
    position: relative;
    width: min(720px, 100%);
    aspect-ratio: 4 / 3;
    border: 2px solid var(--cyan);
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 42px rgba(0, 255, 247, 0.36), inset 0 0 38px rgba(0, 255, 247, 0.1);
}

.corner {
    position: absolute;
    width: 25px;
    height: 25px;
    border: 3px solid var(--green);
}

.corner.tl { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.corner.tr { top: -2px; right: -2px; border-left: none; border-bottom: none; }
.corner.bl { bottom: -2px; left: -2px; border-top: none; border-right: none; }
.corner.br { right: -2px; bottom: -2px; border-top: none; border-left: none; }

.scanner-display {
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
}

.scanner-header {
    display: flex;
    justify-content: space-between;
    background: var(--cyan);
    color: var(--bg);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 9px 16px;
}

.scanner-screen {
    position: relative;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        repeating-linear-gradient(90deg, transparent 0 34px, rgba(255, 0, 255, 0.04) 34px 36px),
        radial-gradient(circle, rgba(0, 255, 247, 0.07), transparent 68%);
}

.orb-container {
    position: relative;
    width: min(220px, 48vw);
    height: min(220px, 48vw);
}

.orb,
.orb-ring {
    position: absolute;
    inset: 0;
}

.orb {
    display: flex;
    align-items: center;
    justify-content: center;
}

.orb-ring {
    margin: auto;
    border: 2px solid;
    border-radius: 50%;
}

.orb-ring.r1 {
    border-color: var(--magenta) transparent transparent;
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.6);
    animation: spin 2s linear infinite;
}

.orb-ring.r2 {
    inset: 15%;
    border-color: transparent var(--cyan) transparent transparent;
    box-shadow: 0 0 20px rgba(0, 255, 247, 0.6);
    animation: spin 1.35s linear infinite reverse;
}

.orb-ring.r3 {
    inset: 30%;
    border-color: transparent transparent var(--green);
    box-shadow: 0 0 16px rgba(57, 255, 20, 0.6);
    animation: spin 950ms linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.orb-core {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 20px white, 0 0 40px var(--cyan), 0 0 80px var(--magenta);
    animation: corepulse 1s infinite;
}

@keyframes corepulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.72; transform: scale(1.32); }
}

.scan-log {
    position: absolute;
    bottom: 16px;
    left: 16px;
    max-width: min(430px, 70%);
    color: var(--green);
    font-family: "VT323", monospace;
    font-size: 18px;
    line-height: 1.26;
    text-shadow: 0 0 8px var(--green);
}

.scanner-bar {
    height: 9px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.56);
}

.scanner-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--magenta), var(--cyan), var(--green));
    box-shadow: 0 0 18px var(--cyan);
    transition: width 300ms ease;
}

.questions {
    width: min(720px, 100%);
    margin: 0 auto;
    padding: 40px 0;
}

.q-progress {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    color: var(--cyan);
    font-family: "Orbitron", sans-serif;
    font-size: 12px;
    letter-spacing: 3px;
}

.q-bar {
    flex: 1;
    height: 5px;
    border: 1px solid rgba(0, 255, 247, 0.34);
    background: rgba(0, 255, 247, 0.14);
}

.q-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--cyan);
    box-shadow: 0 0 12px var(--cyan);
    transition: width 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.q-prompt {
    margin-bottom: 46px;
    color: var(--text);
    font-family: "Orbitron", sans-serif;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.q-options {
    display: grid;
    gap: 14px;
}

.q-option {
    position: relative;
    display: flex;
    gap: 16px;
    align-items: center;
    min-height: 70px;
    overflow: hidden;
    border: 2px solid rgba(255, 0, 255, 0.34);
    background: rgba(255, 0, 255, 0.06);
    color: var(--text);
    cursor: pointer;
    font-size: 16px;
    line-height: 1.35;
    padding: 20px 26px;
    text-align: left;
    opacity: 0;
    animation: fadein 480ms both;
    transition: 180ms ease;
}

.q-option::before {
    flex: 0 0 auto;
    content: "►";
    color: var(--magenta);
    transition: transform 180ms ease;
}

.q-option:hover {
    border-color: var(--magenta);
    background: rgba(255, 0, 255, 0.16);
    box-shadow: 0 0 26px rgba(255, 0, 255, 0.32);
    transform: translateX(8px);
}

.q-option:hover::before {
    color: var(--green);
    transform: translateX(4px);
}

.result {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 24px;
    padding: 36px 0;
    animation: fadein 560ms ease both;
}

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

.result-card {
    position: relative;
    overflow: hidden;
    border: 2px solid var(--magenta);
    background:
        linear-gradient(135deg, rgba(255, 0, 255, 0.1), rgba(0, 255, 247, 0.06)),
        var(--panel);
    box-shadow: 0 0 42px rgba(255, 0, 255, 0.28);
    padding: 38px;
}

.result-card::before {
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(0, 255, 247, 0.3);
    content: "";
    pointer-events: none;
}

.result-card::after {
    position: absolute;
    top: -120px;
    right: -120px;
    width: 260px;
    height: 260px;
    border: 1px solid rgba(57, 255, 20, 0.28);
    content: "";
    transform: rotate(45deg);
    pointer-events: none;
}

.result-meta {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    color: var(--green);
    font-size: 11px;
    letter-spacing: 2px;
}

.result-badge {
    position: relative;
    z-index: 1;
    display: grid;
    width: 96px;
    height: 96px;
    place-items: center;
    margin: 0 auto 18px;
    border: 2px solid currentColor;
    color: var(--yellow);
    font-family: "Orbitron", sans-serif;
    font-size: 42px;
    font-weight: 900;
    text-shadow: 0 0 18px currentColor;
    box-shadow: inset 0 0 22px rgba(255, 247, 0, 0.18), 0 0 22px rgba(255, 247, 0, 0.22);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

.result-label {
    position: relative;
    z-index: 1;
    margin-bottom: 9px;
    color: var(--dim);
    font-family: "Orbitron", sans-serif;
    font-size: 12px;
    letter-spacing: 6px;
    text-align: center;
}

.result-title {
    position: relative;
    z-index: 1;
    margin-bottom: 16px;
    color: var(--green);
    font-family: "Orbitron", sans-serif;
    font-size: clamp(31px, 5vw, 54px);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.1;
    text-align: center;
    text-shadow: 0 0 20px var(--green), 0 0 40px rgba(57, 255, 20, 0.56);
}

.result-desc {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto 34px;
    color: var(--text);
    font-size: 16px;
    line-height: 1.62;
    text-align: center;
}

.result-stats {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
    margin-bottom: 34px;
}

.stat {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) 50px;
    gap: 12px;
    align-items: center;
    font-size: 11px;
    letter-spacing: 2px;
}

.stat-label { color: var(--cyan); }

.stat-bar {
    position: relative;
    height: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 247, 0.34);
    background: rgba(0, 0, 0, 0.5);
}

.stat-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--magenta), var(--cyan));
    box-shadow: 0 0 9px var(--cyan);
    transition: width 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-val {
    color: var(--green);
    text-align: right;
}

.result-detail {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    margin-bottom: 30px;
    border-top: 1px solid rgba(255, 0, 255, 0.3);
    padding-top: 24px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    font-size: 13px;
    line-height: 1.45;
    padding-bottom: 12px;
}

.row-key {
    flex: 0 0 auto;
    color: var(--cyan);
    letter-spacing: 2px;
}

.row-val {
    color: var(--text);
    font-weight: 700;
    text-align: right;
}

.color-pill {
    border: 1px solid currentColor;
    font-family: "VT323", monospace;
    font-size: 16px;
    padding: 2px 12px;
}

.result-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-primary,
.btn-secondary {
    flex: 1 1 130px;
    min-height: 50px;
    border: 2px solid var(--cyan);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-family: "Orbitron", sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 3px;
    padding: 14px 18px;
    transition: 180ms ease;
}

.btn-primary {
    border-color: var(--green);
    color: var(--green);
}

.btn-secondary:hover {
    background: var(--cyan);
    box-shadow: 0 0 20px var(--cyan);
    color: var(--bg);
}

.btn-primary:hover {
    background: var(--green);
    box-shadow: 0 0 20px var(--green);
    color: var(--bg);
}

.result-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.side-card {
    border: 1px solid rgba(0, 255, 247, 0.32);
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(8px);
    padding: 20px;
}

.side-card h4 {
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(0, 255, 247, 0.2);
    color: var(--cyan);
    font-family: "Orbitron", sans-serif;
    font-size: 11px;
    letter-spacing: 3px;
    padding-bottom: 10px;
}

.compat-name {
    margin-top: 8px;
    color: var(--magenta);
    font-size: 14px;
    font-weight: 700;
}

.share-url {
    max-width: 100%;
    margin-bottom: 12px;
    color: var(--dim);
    font-size: 11px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.mini-btn {
    width: 100%;
    cursor: pointer;
}

.history-list {
    list-style: none;
    font-size: 12px;
}

.history-list li {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    color: var(--dim);
    padding: 8px 0;
}

.history-list li:last-child { border-bottom: none; }

.history-list .empty {
    color: var(--dim);
    font-style: italic;
    text-align: center;
}

.history-list .vibe-name { color: var(--green); }

.ach-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.ach {
    display: flex;
    aspect-ratio: 1;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.32);
    color: var(--text);
    cursor: help;
    filter: grayscale(1);
    font-size: 23px;
    opacity: 0.34;
    transition: all 220ms ease;
}

.ach.unlocked {
    border-color: var(--yellow);
    background: rgba(255, 247, 0, 0.08);
    box-shadow: 0 0 12px rgba(255, 247, 0, 0.4);
    filter: none;
    opacity: 1;
}

.footer {
    margin-top: 50px;
    border-top: 1px solid rgba(255, 0, 255, 0.22);
    background: rgba(7, 2, 13, 0.66);
    backdrop-filter: blur(10px);
    color: var(--dim);
    font-size: 11px;
    letter-spacing: 1px;
    padding: 30px 38px;
    text-align: center;
}

.footer-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 12px;
}

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

.footer-links a {
    color: var(--cyan);
    text-decoration: none;
    transition: color 160ms ease;
}

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

.footer-tag {
    color: var(--red);
    font-size: 10px;
    letter-spacing: 2px;
}

.modal-bg {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    padding: 20px;
}

.modal-bg.active { display: flex; }

.modal {
    position: relative;
    width: min(520px, 100%);
    border: 2px solid var(--cyan);
    background: var(--bg-2);
    box-shadow: 0 0 60px rgba(0, 255, 247, 0.48);
    padding: 38px;
    animation: modalin 260ms ease;
}

@keyframes modalin {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    border: 0;
    background: transparent;
    color: var(--magenta);
    cursor: pointer;
    font-size: 30px;
    transition: transform 160ms ease;
}

.modal-close:hover { transform: rotate(90deg) scale(1.2); }

.modal-title {
    margin-bottom: 20px;
    color: var(--green);
    font-family: "Orbitron", sans-serif;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.modal-body {
    color: var(--text);
    font-size: 14px;
    line-height: 1.7;
}

.modal-body p { margin-bottom: 12px; }
.modal-body strong { color: var(--magenta); }
.modal-body a { color: var(--cyan); }

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    z-index: 300;
    max-width: calc(100vw - 32px);
    background: var(--green);
    box-shadow: 0 0 30px var(--green);
    color: var(--bg);
    font-family: "Orbitron", sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 14px 26px;
    pointer-events: none;
    text-align: center;
    transform: translateX(-50%) translateY(100px);
    transition: transform 380ms cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show { transform: translateX(-50%) translateY(0); }

.secret-cube {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 150;
    width: 50px;
    height: 50px;
    border: 1px solid var(--yellow);
    background: rgba(7, 2, 13, 0.8);
    box-shadow: 0 0 18px rgba(255, 247, 0, 0.35);
    color: var(--yellow);
    cursor: pointer;
    font-size: 30px;
    opacity: 0;
    transform: translateY(80px) rotate(45deg);
    transition: all 360ms ease;
}

.secret-cube.show {
    opacity: 1;
    transform: translateY(0) rotate(45deg);
    animation: cubebob 2s infinite;
}

@keyframes cubebob {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -8px; }
}

.confetti {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 250;
    width: 8px;
    height: 8px;
    pointer-events: none;
    box-shadow: 0 0 8px currentColor;
}

body.rave { animation: rave 520ms infinite; }

@keyframes rave {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

body.rave .grid-bg { animation: gridmove 500ms linear infinite; }

@media (max-width: 900px) {
    .header {
        grid-template-columns: 1fr;
        justify-items: start;
        padding: 16px 20px;
    }

    .status-bar {
        justify-content: flex-start;
        text-align: left;
    }

    .nav-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .main {
        padding: 34px 20px;
    }

    .hero {
        min-height: calc(100vh - 240px);
        padding-top: 30px;
    }

    .ticker {
        right: -20px;
        left: -20px;
    }

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

    .result-card {
        padding: 28px 22px;
    }

    .ach-list {
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (max-width: 560px) {
    .logo {
        font-size: 16px;
        letter-spacing: 1px;
    }

    .status-bar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .nav-actions {
        flex-wrap: wrap;
    }

    .hero-title {
        font-size: clamp(42px, 17vw, 76px);
    }

    .hero-tag {
        letter-spacing: 2px;
    }

    .cta-btn {
        width: 100%;
        justify-content: center;
        font-size: 17px;
        padding: 21px 22px;
    }

    .scanner-frame {
        aspect-ratio: 3 / 4;
    }

    .scanner-screen {
        flex-direction: column;
    }

    .scan-log {
        max-width: calc(100% - 30px);
        font-size: 16px;
    }

    .q-progress {
        align-items: flex-start;
        flex-direction: column;
    }

    .q-bar {
        width: 100%;
    }

    .q-option {
        font-size: 14px;
        min-height: 74px;
        padding: 18px;
    }

    .result-meta,
    .result-row {
        flex-direction: column;
    }

    .row-val {
        text-align: left;
    }

    .stat {
        grid-template-columns: 76px minmax(0, 1fr) 44px;
        gap: 9px;
        letter-spacing: 1px;
    }

    .result-badge {
        width: 82px;
        height: 82px;
        font-size: 34px;
    }

    .ach-list {
        grid-template-columns: repeat(4, 1fr);
    }

    .footer-row {
        align-items: center;
        flex-direction: column;
    }
}

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