:root {
    color-scheme: dark;
    --nf-bg: #061a19;
    --nf-surface: #0d2b29;
    --nf-line: #28534d;
    --nf-text: #f3fbf8;
    --nf-muted: #b7cfca;
    --nf-mint: #65e3ad;
    --nf-purple: #b59cff;
    --nf-orange: #ff9b74;
    --nf-blue: #7bc6f5;
}

* { box-sizing: border-box; }
html { background: var(--nf-bg); }
body.tct404-body {
    background:
        radial-gradient(circle at 12% 12%, rgba(101, 227, 173, .12), transparent 30%),
        radial-gradient(circle at 92% 24%, rgba(123, 198, 245, .12), transparent 28%),
        var(--nf-bg);
    color: var(--nf-text);
    font-family: Poppins, Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    margin: 0;
    min-height: 100vh;
}

.tct404-nav {
    align-items: center;
    background: #103c3c;
    border-bottom: 1px solid var(--nf-line);
    display: flex;
    justify-content: space-between;
    min-height: 72px;
    padding: 12px max(20px, calc((100vw - 1180px) / 2));
}
.tct404-brand { align-items: center; color: var(--nf-text); display: flex; gap: 11px; text-decoration: none; }
.tct404-brand img { display: block; height: 44px; max-width: min(250px, 50vw); object-fit: contain; width: auto; }
.tct404-brand > span:last-child { display: grid; gap: 2px; }
.tct404-brand strong { font-size: 17px; letter-spacing: -.01em; }
.tct404-brand small { color: var(--nf-muted); font-size: 9px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.tct404-brand-mark { align-items: center; background: #073f39; border: 1px solid #187262; border-radius: 11px 11px 11px 4px; display: inline-flex; height: 38px; justify-content: center; transform: rotate(-4deg); width: 38px; }
.tct404-brand-mark span { border: 4px solid var(--nf-mint); border-radius: 50%; height: 16px; position: relative; width: 16px; }
.tct404-brand-mark span::after { background: var(--nf-mint); border-radius: 3px; content: ""; height: 5px; position: absolute; right: -7px; top: 4px; width: 7px; }
.tct404-tools-link { color: var(--nf-text); font-size: 14px; font-weight: 750; padding: 9px 3px; position: relative; text-decoration: none; }
.tct404-tools-link::after { background: var(--nf-mint); bottom: 3px; content: ""; height: 2px; left: 0; position: absolute; transform: scaleX(0); transform-origin: left; transition: transform .2s ease; width: 100%; }
.tct404-tools-link:hover::after,
.tct404-tools-link:focus-visible::after { transform: scaleX(1); }

.tct404-main {
    align-items: center;
    display: grid;
    gap: clamp(32px, 6vw, 86px);
    grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr);
    margin: auto;
    max-width: 1180px;
    min-height: calc(100vh - 146px);
    padding: clamp(48px, 8vw, 96px) 20px;
}
.tct404-kicker { color: var(--nf-mint); font-size: 12px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.tct404-copy h1 { font-size: clamp(42px, 6vw, 76px); letter-spacing: -.025em; line-height: 1.02; margin: 15px 0 20px; }
.tct404-copy p { color: var(--nf-muted); font-size: clamp(17px, 2vw, 20px); line-height: 1.65; margin: 0; max-width: 620px; }
.tct404-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.tct404-actions a { border: 1px solid var(--nf-line); border-radius: 13px; font-size: 15px; font-weight: 800; min-height: 48px; padding: 13px 18px; text-decoration: none; }
.tct404-primary { background: #08765d; border-color: #08765d !important; color: #fff; }
.tct404-primary:hover,
.tct404-primary:focus-visible { background: #087f63; border-color: #087f63 !important; color: #fff; }
.tct404-secondary { background: var(--nf-surface); color: var(--nf-text); }
.tct404-secondary:hover,
.tct404-secondary:focus-visible { border-color: var(--nf-mint); }

.tct404-actions a:hover,
.tct404-actions a:focus-visible {
    background: linear-gradient(135deg,#078653 0%,#075247 100%);
    border-color: #27efa3 !important;
    box-shadow: 0 0 0 1px rgba(39,239,163,.72), 0 10px 25px rgba(11,192,108,.3);
    color: #fff;
    outline: 0;
    transform: translateY(-2px);
}

.tct404-scene {
    --mx: 0;
    --my: 0;
    aspect-ratio: 1.12;
    background: linear-gradient(145deg, rgba(13, 43, 41, .95), rgba(12, 33, 42, .95));
    border: 1px solid var(--nf-line);
    border-radius: 34px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .32);
    isolation: isolate;
    max-width: 620px;
    overflow: hidden;
    position: relative;
    transform: perspective(900px) rotateX(calc(var(--my) * -2deg)) rotateY(calc(var(--mx) * 3deg));
    transition: transform .12s ease-out;
    width: 100%;
}
.tct404-scene.is-playing .tct404-core,
.tct404-scene.is-playing .tct404-card,
.tct404-scene.is-playing .tct404-hint,
.tct404-scene.is-finished .tct404-core,
.tct404-scene.is-finished .tct404-card,
.tct404-scene.is-finished .tct404-hint { opacity: .08; pointer-events: none; }
.tct404-scene::before { background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg,rgba(255,255,255,.035) 1px, transparent 1px); background-size: 34px 34px; content: ""; inset: 0; position: absolute; }
.tct404-orbit { border: 1px solid rgba(101, 227, 173, .28); border-radius: 50%; height: 68%; left: 16%; position: absolute; top: 16%; transform: rotate(calc(var(--mx) * 7deg)); width: 68%; }
.tct404-orbit::before,
.tct404-orbit::after { border: 1px solid rgba(181, 156, 255, .18); border-radius: 50%; content: ""; inset: 12%; position: absolute; }
.tct404-orbit::after { border-color: rgba(123, 198, 245, .15); inset: 27%; }
.tct404-core { align-items: center; background: #082f2d; border: 1px solid #3f766d; border-radius: 50%; box-shadow: 0 0 55px rgba(101, 227, 173, .18); display: flex; font-size: clamp(48px, 8vw, 88px); font-weight: 850; gap: 8px; height: 42%; justify-content: center; left: 29%; letter-spacing: -.08em; position: absolute; top: 29%; transform: translate(calc(var(--mx) * 7px), calc(var(--my) * 7px)); width: 42%; }
.tct404-core i { background: var(--nf-mint); border-radius: 50%; height: 12px; width: 12px; }
.tct404-card { background: rgba(16, 45, 48, .93); border: 1px solid var(--nf-line); border-radius: 16px; display: grid; gap: 5px; padding: 15px 17px; position: absolute; transition: transform .12s ease-out; width: min(205px, 38%); }
.tct404-card span { font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.tct404-card strong { color: var(--nf-text); font-size: clamp(12px, 1.5vw, 15px); line-height: 1.3; }
.tct404-card--text { left: 5%; top: 9%; transform: translate(calc(var(--mx) * -12px), calc(var(--my) * -8px)) rotate(-3deg); }
.tct404-card--text span { color: var(--nf-purple); }
.tct404-card--image { right: 4%; top: 16%; transform: translate(calc(var(--mx) * 14px), calc(var(--my) * -10px)) rotate(4deg); }
.tct404-card--image span { color: var(--nf-orange); }
.tct404-card--security { bottom: 8%; left: 12%; transform: translate(calc(var(--mx) * -9px), calc(var(--my) * 13px)) rotate(2deg); }
.tct404-card--security span { color: var(--nf-mint); }
.tct404-hint { bottom: 20px; color: var(--nf-muted); font-size: 11px; letter-spacing: .08em; margin: 0; position: absolute; right: 22px; text-transform: uppercase; }
.tct404-game-intro,
.tct404-game-result {
    align-items: center;
    background: rgba(6, 26, 25, .88);
    border: 1px solid rgba(101, 227, 173, .35);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,.34);
    display: flex;
    flex-direction: column;
    gap: 10px;
    left: 50%;
    max-width: 360px;
    padding: 25px;
    position: absolute;
    text-align: center;
    top: 50%;
    transform: translate(-50%,-50%);
    width: calc(100% - 44px);
    z-index: 8;
}
.tct404-game-intro > span,
.tct404-game-result > span { color: var(--nf-mint); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.tct404-game-intro h2,
.tct404-game-result h2 { font-size: clamp(22px,3vw,30px); letter-spacing: -.02em; line-height: 1.15; margin: 0; }
.tct404-game-intro p,
.tct404-game-result p { color: var(--nf-muted); font-size: 13px; line-height: 1.55; margin: 0; }
.tct404-game-intro button,
.tct404-game-result button {
    background: linear-gradient(135deg,#078653,#075247);
    border: 1px solid #55e2a0;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(11,192,108,.22);
    color: #fff;
    cursor: pointer;
    font: 800 13px/1.2 Poppins,system-ui,sans-serif;
    margin-top: 4px;
    min-height: 44px;
    padding: 11px 16px;
}
.tct404-game-intro button:hover,
.tct404-game-intro button:focus-visible,
.tct404-game-result button:hover,
.tct404-game-result button:focus-visible { box-shadow: 0 0 0 3px rgba(101,227,173,.25),0 12px 28px rgba(11,192,108,.32); outline: 0; transform: translateY(-2px); }
.tct404-game-hud {
    display: flex;
    gap: 9px;
    justify-content: space-between;
    left: 18px;
    position: absolute;
    right: 18px;
    top: 16px;
    z-index: 10;
}
.tct404-game-hud[hidden],
.tct404-game-intro[hidden],
.tct404-game-result[hidden] { display: none !important; }
.tct404-game-hud span { background: rgba(6,26,25,.88); border: 1px solid var(--nf-line); border-radius: 999px; color: var(--nf-muted); font-size: 12px; padding: 7px 12px; }
.tct404-game-hud strong { color: var(--nf-text); font-size: 14px; }
.tct404-game-arena { inset: 0; overflow: hidden; pointer-events: none; position: absolute; z-index: 9; }
.tct404-target {
    align-items: center;
    animation: tct404-pop .22s ease-out;
    background: radial-gradient(circle at 35% 28%,#fff7bf,#f0bd46 70%);
    border: 2px solid rgba(255,255,255,.72);
    border-radius: 50%;
    box-shadow: 0 0 0 7px rgba(101,227,173,.11),0 12px 28px rgba(0,0,0,.28);
    color: #173b35;
    cursor: pointer;
    display: inline-flex;
    font-size: 22px;
    height: 54px;
    justify-content: center;
    pointer-events: auto;
    position: absolute;
    transform: translate(-50%,-50%);
    width: 54px;
}
.tct404-target:hover,
.tct404-target:focus-visible { background:linear-gradient(135deg,#078653,#075247); color:#fff; border-color: #57f5b3; box-shadow: 0 0 0 2px rgba(101,227,173,.6),0 11px 27px rgba(10,184,111,.32); outline: 0; }
.tct404-target.is-caught { animation: tct404-caught .25s ease-out forwards; pointer-events: none; }
.tct404-game-result { z-index: 12; }
@keyframes tct404-pop { from { opacity:0; transform:translate(-50%,-50%) scale(.45); } to { opacity:1; transform:translate(-50%,-50%) scale(1); } }
@keyframes tct404-caught { to { opacity:0; transform:translate(-50%,-50%) scale(1.7) rotate(18deg); } }
.tct404-footer { border-top: 1px solid var(--nf-line); color: var(--nf-muted); font-size: 12px; padding: 14px 20px; text-align: center; }

@media (max-width: 860px) {
    .tct404-main { grid-template-columns: 1fr; }
    .tct404-copy { text-align: center; }
    .tct404-copy p { margin-inline: auto; }
    .tct404-actions { justify-content: center; }
    .tct404-scene { margin: auto; max-width: 560px; }
}
@media (max-width: 520px) {
    .tct404-nav { min-height: 64px; }
    .tct404-brand small { display: none; }
    .tct404-main { padding-top: 42px; }
    .tct404-copy h1 { font-size: 42px; }
    .tct404-scene { border-radius: 24px; }
    .tct404-hint { display: none; }
    .tct404-game-intro,
    .tct404-game-result { padding: 20px; }
    .tct404-target { height: 48px; width: 48px; }
}
@media (prefers-reduced-motion: reduce) {
    .tct404-scene,
    .tct404-card,
    .tct404-core,
    .tct404-orbit { transform: none !important; transition: none !important; }
    .tct404-target { animation: none !important; }
}
