:root {
    --ctf-bg0: #0a0e27;
    --ctf-bg1: #1a1f3a;
    --ctf-card: #1a1f3a;
    --ctf-border: #2d3561;
    --ctf-text: #e0e6f1;
    --ctf-muted: #8b92a8;
    --ctf-accent: #00ff41;
    --ctf-accent2: #00d9ff;
    --ctf-danger: #ff4444;
    --ctf-gold: #ffd700;
}

html, body {
    min-height: 100%;
}

.ctf-body {
    background: linear-gradient(160deg, var(--ctf-bg0) 0%, var(--ctf-bg1) 55%, #0f1428 100%);
    color: var(--ctf-text);
    font-family: 'Inter', system-ui, sans-serif;
}

.font-mono {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.ctf-nav {
    background: rgba(10, 14, 39, 0.92) !important;
    backdrop-filter: blur(8px);
}

.ctf-brand-link {
    text-decoration: none;
    color: var(--ctf-text);
}

.unh-logo {
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.unh-logo--nav {
    width: 44px;
    height: 44px;
}

.unh-logo--about {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.unh-logo--footer {
    width: 56px;
    height: 56px;
    margin: 0 auto;
    opacity: 0.95;
}

.text-accent {
    color: var(--ctf-accent) !important;
}

.btn-accent {
    background: var(--ctf-accent);
    color: #041008;
    border: none;
    font-weight: 600;
    min-height: 44px;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.btn-accent:hover {
    color: #021004;
    box-shadow: 0 0 18px rgba(0, 255, 65, 0.45);
    transform: translateY(-1px);
}

.btn-outline-accent {
    border-color: var(--ctf-accent);
    color: var(--ctf-accent);
    min-height: 44px;
}

.btn-outline-accent:hover {
    background: rgba(0, 255, 65, 0.12);
    color: var(--ctf-accent);
}

.ctf-btn-link {
    color: var(--ctf-accent2) !important;
}

.ctf-card {
    background: rgba(26, 31, 58, 0.92);
    border: 1px solid var(--ctf-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.ctf-stat {
    background: rgba(10, 14, 39, 0.55);
    border: 1px solid var(--ctf-border);
}

.ctf-input {
    background: #0f1328 !important;
    border: 1px solid var(--ctf-border) !important;
    color: var(--ctf-text) !important;
}

.ctf-input:focus {
    border-color: var(--ctf-accent2) !important;
    box-shadow: 0 0 0 0.15rem rgba(0, 217, 255, 0.2) !important;
}

.ctf-progress {
    height: 0.65rem;
    background: #0f1328;
}

.bg-accent {
    background-color: var(--ctf-accent) !important;
}

.ctf-footer {
    background: rgba(10, 14, 39, 0.95);
}

.ctf-footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.fade-in {
    animation: ctfFade 0.6s ease both;
}

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

.ctf-glitch {
    text-shadow: 0 0 12px rgba(0, 255, 65, 0.25);
    animation: ctfGlitch 3.5s infinite ease-in-out;
}

@keyframes ctfGlitch {
    0%, 100% { transform: translate(0); }
    92% { transform: translate(0); }
    93% { transform: translate(-1px, 1px); }
    94% { transform: translate(1px, -1px); }
    95% { transform: translate(0); }
}

.hover-glow:hover {
    border-color: var(--ctf-accent2) !important;
    box-shadow: 0 0 14px rgba(0, 217, 255, 0.18);
}

.shake-anim {
    animation: ctfShake 0.45s ease;
}

@keyframes ctfShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.pulse-success {
    animation: ctfPulse 0.6s ease;
}

@keyframes ctfPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 65, 0.45); }
    100% { box-shadow: 0 0 0 18px rgba(0, 255, 65, 0); }
}

.table-dark {
    --bs-table-bg: transparent;
}

.challenge-card {
    transition: transform 0.15s ease, border-color 0.2s ease;
}

.challenge-card:hover {
    transform: translateY(-2px);
}

.toast.text-bg-success {
    background-image: linear-gradient(90deg, rgba(0,255,65,0.15), rgba(0,217,255,0.08));
}

.toast.text-bg-danger {
    background-image: linear-gradient(90deg, rgba(255,68,68,0.15), rgba(255,215,0,0.06));
}

.toast.text-bg-warning {
    color: #0a0e27 !important;
}

/* ——— Home: hacker / terminal atmosphere (scoped) ——— */
.home-hacker {
    position: relative;
    margin: -1rem -0.75rem 0;
    padding: 0 0.75rem 1rem;
    overflow: hidden;
    isolation: isolate;
}

/* Satu lapisan di atas seluruh backdrop + stream (hindari bug stacking di beberapa browser). */
.home-hacker-foreground {
    position: relative;
    z-index: 10;
    isolation: isolate;
}

@media (min-width: 576px) {
    .home-hacker {
        margin-left: -0.75rem;
        margin-right: -0.75rem;
    }
}

/* Full-bleed backdrop stack */
.home-hacker-backdrop {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(ellipse 100% 80% at 50% -30%, #0c1a2e 0%, transparent 55%),
        linear-gradient(165deg, #020308 0%, #071018 22%, #050a14 50%, #02060c 100%);
}

/* Soft neon blobs — animated */
.home-hacker-aurora {
    position: absolute;
    width: 160%;
    height: 100%;
    top: -35%;
    left: -30%;
    background:
        radial-gradient(ellipse 42% 38% at 28% 42%, rgba(0, 255, 120, 0.45), transparent 62%),
        radial-gradient(ellipse 48% 44% at 72% 28%, rgba(0, 210, 255, 0.32), transparent 58%),
        radial-gradient(ellipse 35% 55% at 55% 88%, rgba(140, 80, 255, 0.18), transparent 55%);
    filter: blur(52px);
    opacity: 0.92;
    animation: homeAurora 16s ease-in-out infinite alternate;
}

@keyframes homeAurora {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    25% { transform: translate(4%, 5%) scale(1.04) rotate(1deg); }
    50% { transform: translate(-3%, 2%) scale(0.98) rotate(-0.5deg); }
    75% { transform: translate(2%, -4%) scale(1.02) rotate(0.5deg); }
    100% { transform: translate(-2%, 1%) scale(1) rotate(0deg); }
}

/* Perspective “digital floor” grid */
.home-hacker-floor {
    position: absolute;
    left: -20%;
    right: -20%;
    top: 38%;
    bottom: -25%;
    background:
        linear-gradient(90deg, rgba(0, 255, 130, 0.14) 1px, transparent 1px),
        linear-gradient(rgba(0, 255, 130, 0.11) 1px, transparent 1px);
    background-size: 56px 56px;
    transform: perspective(420px) rotateX(66deg);
    transform-origin: 50% 0%;
    mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.9) 18%, #000 55%, transparent 92%);
    opacity: 0.55;
    animation:
        homeFloorPulse 5s ease-in-out infinite alternate,
        homeFloorScroll 18s linear infinite;
}

@keyframes homeFloorPulse {
    0% { opacity: 0.45; filter: brightness(1); }
    100% { opacity: 0.65; filter: brightness(1.15); }
}

@keyframes homeFloorScroll {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 56px 56px, 56px 56px; }
}

/* Diagonal circuit shards */
.home-hacker-shard {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            -24deg,
            transparent,
            transparent 52px,
            rgba(0, 217, 255, 0.045) 52px,
            rgba(0, 217, 255, 0.045) 53px
        ),
        repeating-linear-gradient(
            18deg,
            transparent,
            transparent 80px,
            rgba(0, 255, 90, 0.035) 80px,
            rgba(0, 255, 90, 0.035) 81px
        );
    opacity: 0.85;
    animation: homeShardDrift 22s linear infinite;
}

@keyframes homeShardDrift {
    0% { transform: translateY(0); }
    100% { transform: translateY(36px); }
}

/* CRT scan + horizontal sweep */
.home-hacker-scan {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(0, 0, 0, 0.22) 3px,
        rgba(0, 0, 0, 0.22) 5px
    );
    animation: homeScanMove 6s linear infinite;
    opacity: 0.4;
    mix-blend-mode: multiply;
}

.home-hacker-scan::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 28%;
    top: -28%;
    background: linear-gradient(
        180deg,
        transparent,
        rgba(0, 255, 130, 0.07),
        transparent
    );
    animation: homeSweepBar 4.5s ease-in-out infinite;
}

@keyframes homeScanMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(56px); }
}

@keyframes homeSweepBar {
    0% { top: -28%; opacity: 0; }
    8% { opacity: 1; }
    100% { top: 100%; opacity: 0.3; }
}

/* Edge crush — focus ke tengah */
.home-hacker-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 75% 65% at 50% 42%,
        transparent 0%,
        transparent 45%,
        rgba(0, 0, 0, 0.55) 100%
    );
    box-shadow: inset 0 0 120px 40px rgba(0, 0, 0, 0.65);
}

/* Partikel neon — naik & berdenyut */
.home-hacker-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 2;
    pointer-events: none;
}

.home-particle {
    position: absolute;
    left: var(--p-x, 50%);
    bottom: -8px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(0, 255, 130, 0.95);
    box-shadow:
        0 0 10px rgba(0, 255, 130, 1),
        0 0 22px rgba(0, 217, 255, 0.45);
    animation: homeParticleFloat var(--p-dur, 11s) ease-in infinite;
    animation-delay: var(--p-delay, 0s);
    opacity: 0;
}

.home-particle:nth-child(1) { --p-x: 8%; --p-dur: 9s; --p-delay: 0s; }
.home-particle:nth-child(2) { --p-x: 15%; --p-dur: 12s; --p-delay: 1.2s; }
.home-particle:nth-child(3) { --p-x: 22%; --p-dur: 10s; --p-delay: 2.5s; }
.home-particle:nth-child(4) { --p-x: 31%; --p-dur: 14s; --p-delay: 0.4s; }
.home-particle:nth-child(5) { --p-x: 38%; --p-dur: 11s; --p-delay: 3s; }
.home-particle:nth-child(6) { --p-x: 47%; --p-dur: 13s; --p-delay: 1s; }
.home-particle:nth-child(7) { --p-x: 54%; --p-dur: 9.5s; --p-delay: 4s; }
.home-particle:nth-child(8) { --p-x: 61%; --p-dur: 12s; --p-delay: 2s; }
.home-particle:nth-child(9) { --p-x: 68%; --p-dur: 10s; --p-delay: 0.8s; }
.home-particle:nth-child(10) { --p-x: 76%; --p-dur: 15s; --p-delay: 3.5s; }
.home-particle:nth-child(11) { --p-x: 83%; --p-dur: 11s; --p-delay: 1.8s; }
.home-particle:nth-child(12) { --p-x: 90%; --p-dur: 10s; --p-delay: 5s; }
.home-particle:nth-child(13) { --p-x: 12%; --p-dur: 13s; --p-delay: 6s; }
.home-particle:nth-child(14) { --p-x: 95%; --p-dur: 12s; --p-delay: 2.2s; }

@keyframes homeParticleFloat {
    0% {
        transform: translateY(0) translateX(0) scale(0.3);
        opacity: 0;
    }
    12% {
        opacity: 1;
    }
    88% {
        opacity: 0.85;
    }
    100% {
        transform: translateY(-100vh) translateX(18px) scale(1.1);
        opacity: 0;
    }
}

/* Teks terminal menggulir (background) */
.home-terminal-stream {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: flex;
    justify-content: space-between;
    gap: 0.35rem;
    padding: 0 0.5rem;
    pointer-events: none;
    opacity: 0.22;
    mask-image: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 0, 0, 0.95) 14%,
        rgba(0, 0, 0, 0.95) 86%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 0, 0, 0.95) 14%,
        rgba(0, 0, 0, 0.95) 86%,
        transparent 100%
    );
}

.home-stream-col {
    flex: 1 1 0;
    min-width: 0;
    max-width: 17%;
    height: 100%;
    overflow: hidden;
    mask-image: linear-gradient(180deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
}

.home-stream-track {
    animation: homeStreamScroll var(--stream-duration, 45s) linear infinite;
    animation-delay: var(--stream-delay, 0s);
    will-change: transform;
}

@keyframes homeStreamScroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

.home-stream-line {
    padding: 0.18rem 0.1rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.62rem;
    line-height: 1.4;
    color: rgba(0, 255, 130, 0.88);
    text-shadow:
        0 0 6px rgba(0, 255, 130, 0.45),
        0 0 14px rgba(0, 255, 130, 0.15);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.home-stream-line--accent {
    color: rgba(0, 230, 255, 0.82);
    text-shadow:
        0 0 6px rgba(0, 217, 255, 0.4),
        0 0 12px rgba(0, 217, 255, 0.12);
}

@media (max-width: 767.98px) {
    .home-terminal-stream {
        opacity: 0.22;
        gap: 0.15rem;
        padding: 0 0.25rem;
    }

    .home-stream-line {
        font-size: 0.52rem;
    }

    .home-stream-col:nth-child(n + 5) {
        display: none;
    }
}

/* Muncul berurutan — opacity: 1 agar tetap terlihat jika animasi/JS gagal (hosting) */
.home-rise {
    opacity: 1;
    animation: homeRiseIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.home-rise-1 { animation-delay: 0.08s; }
.home-rise-2 { animation-delay: 0.22s; }
.home-rise-3 { animation-delay: 0.38s; }
.home-rise-4 { animation-delay: 0.52s; }

@keyframes homeRiseIn {
    from {
        opacity: 0;
        transform: translateY(36px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Border terminal mengalir */
.home-terminal-shell {
    max-width: 52rem;
    margin-left: auto;
    margin-right: auto;
    padding: 2px;
    border-radius: 10px;
    background: linear-gradient(
        125deg,
        rgba(0, 255, 130, 0.75),
        rgba(0, 217, 255, 0.55),
        rgba(100, 255, 200, 0.5),
        rgba(0, 140, 255, 0.45),
        rgba(0, 255, 130, 0.75)
    );
    background-size: 320% 320%;
    animation:
        homeBorderShift 6s ease infinite,
        homeTerminalFloat 7s ease-in-out infinite;
    box-shadow:
        0 0 48px rgba(0, 255, 130, 0.2),
        0 0 80px rgba(0, 217, 255, 0.08);
}

@keyframes homeBorderShift {
    0%, 100% { background-position: 0% 40%; }
    50% { background-position: 100% 60%; }
}

.home-hacker .z-1 {
    z-index: 1;
}

.letter-spacing-hack {
    letter-spacing: 0.2em;
}

.home-hero {
    border-bottom: 1px solid rgba(0, 255, 65, 0.15);
    margin-bottom: 2rem;
}

.home-terminal {
    max-width: none;
    width: 100%;
    background: rgba(2, 6, 12, 0.97);
    border: 1px solid rgba(0, 255, 65, 0.25);
    border-radius: 8px;
    box-shadow:
        0 0 40px rgba(0, 255, 65, 0.1),
        inset 0 0 60px rgba(0, 40, 20, 0.18);
}

@keyframes homeTerminalFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.home-terminal-bar {
    background: rgba(0, 20, 10, 0.85);
    border-bottom: 1px solid rgba(0, 255, 65, 0.2);
    border-radius: 6px 6px 0 0;
}

.home-terminal-dots::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    background: #ff5f56;
    box-shadow: 16px 0 0 #ffbd2e, 32px 0 0 #27ca40;
}

.home-prompt-line {
    color: var(--ctf-muted);
}

.home-prompt-user {
    color: var(--ctf-accent2);
}

.home-hero-title {
    text-shadow:
        0 0 24px rgba(0, 255, 65, 0.35),
        0 0 2px rgba(0, 255, 65, 0.8);
}

.home-hero-title-shimmer {
    animation: homeTitleGlow 2.8s ease-in-out infinite alternate;
}

@keyframes homeTitleGlow {
    0% {
        text-shadow:
            0 0 18px rgba(0, 255, 65, 0.45),
            0 0 36px rgba(0, 217, 255, 0.2),
            0 0 2px rgba(0, 255, 65, 0.9);
        filter: brightness(1);
    }
    100% {
        text-shadow:
            0 0 32px rgba(0, 255, 65, 0.85),
            0 0 56px rgba(0, 217, 255, 0.45),
            0 0 3px rgba(180, 255, 220, 0.9);
        filter: brightness(1.08);
    }
}

.home-hex-stream {
    animation: homeHexPulse 4s ease-in-out infinite;
    letter-spacing: 0.04em;
}

@keyframes homeHexPulse {
    0%, 100% { opacity: 0.55; letter-spacing: 0.04em; }
    50% { opacity: 1; letter-spacing: 0.12em; }
}

.home-hero-lead {
    border-left: 2px solid rgba(0, 217, 255, 0.35);
    padding-left: 1rem;
    text-align: left;
}

@media (min-width: 992px) {
    .home-hero-lead {
        margin-left: auto;
        margin-right: auto;
    }
}

.home-blink-slow {
    animation: homeBlink 2.2s step-end infinite;
}

@keyframes homeBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.typing-cursor {
    animation: homeCursor 1s step-end infinite;
}

@keyframes homeCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.home-countdown-wrap {
    background: rgba(3, 8, 6, 0.9);
    border: 1px solid rgba(0, 255, 65, 0.25);
    box-shadow: 0 0 28px rgba(0, 255, 65, 0.12);
    animation: homeCountdownBox 3.5s ease-in-out infinite;
}

@keyframes homeCountdownBox {
    0%, 100% {
        box-shadow: 0 0 28px rgba(0, 255, 65, 0.12);
        border-color: rgba(0, 255, 65, 0.25);
    }
    50% {
        box-shadow:
            0 0 40px rgba(0, 255, 65, 0.28),
            0 0 64px rgba(0, 217, 255, 0.12);
        border-color: rgba(0, 255, 130, 0.45);
    }
}

.home-countdown-glow {
    position: absolute;
    inset: -1px;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.15), transparent 40%, rgba(0, 217, 255, 0.1));
    z-index: -1;
    animation: homeGlowPulse 2.5s ease-in-out infinite;
}

@keyframes homeGlowPulse {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.9; }
}

.home-countdown-digits {
    text-shadow: 0 0 16px rgba(0, 255, 65, 0.45);
}

.countdown-grid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.5rem;
    flex-wrap: wrap;
}

.countdown-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 3.25rem;
    padding: 0.45rem 0.55rem;
    background: rgba(0, 20, 12, 0.85);
    border: 1px solid rgba(0, 255, 65, 0.22);
    border-radius: 0.35rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.countdown-cell--tick {
    border-color: rgba(0, 255, 130, 0.55);
    box-shadow: 0 0 14px rgba(0, 255, 65, 0.2);
}

.countdown-val {
    font-size: clamp(1.35rem, 4vw, 1.85rem);
    font-weight: 600;
    color: var(--ctf-accent, #00ff41);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.countdown-lbl {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(160, 200, 175, 0.75);
    margin-top: 0.2rem;
}

.countdown-sep {
    font-size: 1.35rem;
    color: rgba(0, 255, 65, 0.45);
    line-height: 1;
    padding-bottom: 0.85rem;
    animation: countdownSepBlink 1s step-end infinite;
}

@keyframes countdownSepBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

.countdown-prompt,
.countdown-alt,
.countdown-target {
    transition: opacity 0.35s ease;
}

.countdown-fade.is-swapping {
    opacity: 0;
}

.countdown-live .countdown-val {
    color: #00d9ff;
}

.countdown-ended .countdown-val {
    color: var(--ctf-muted);
    opacity: 0.75;
}

.countdown-live .countdown-cell {
    border-color: rgba(0, 217, 255, 0.35);
}

@keyframes homeDigitTick {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.04); opacity: 0.9; }
}

.home-hacker-card {
    border-color: rgba(0, 255, 65, 0.22) !important;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(0, 217, 255, 0.06);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.home-hacker-card:hover {
    border-color: rgba(0, 255, 65, 0.35) !important;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.45),
        0 0 24px rgba(0, 255, 65, 0.08);
}

.home-card-hover-lift {
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.home-card-hover-lift:hover {
    transform: translateY(-5px);
}

.home-card-corner {
    animation: homeCornerBlink 3s ease-in-out infinite;
}

.home-card-corner-br {
    animation-delay: 1.5s;
}

@keyframes homeCornerBlink {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.95; }
}

.home-card-corner {
    position: absolute;
    width: 12px;
    height: 12px;
    pointer-events: none;
    border-color: var(--ctf-accent);
    opacity: 0.5;
}

.home-card-corner-tl {
    top: 8px;
    left: 8px;
    border-top: 2px solid;
    border-left: 2px solid;
}

.home-card-corner-br {
    bottom: 8px;
    right: 8px;
    border-bottom: 2px solid;
    border-right: 2px solid;
}

.home-table-hack thead th {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ctf-accent2) !important;
    border-bottom-color: rgba(0, 255, 65, 0.2) !important;
}

.home-rules-list li::marker {
    color: var(--ctf-accent);
}

.home-btn-pulse {
    position: relative;
}

.home-btn-pulse::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    border: 1px solid rgba(0, 255, 65, 0.4);
    opacity: 0;
    animation: homeBtnRing 2.5s ease-out infinite;
}

@keyframes homeBtnRing {
    0% { transform: scale(1); opacity: 0.5; }
    70% { transform: scale(1.04); opacity: 0; }
    100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .home-stream-track {
        animation: none !important;
    }

    .home-hacker-backdrop *,
    .home-hacker-particles,
    .home-terminal-shell,
    .home-hero-title-shimmer,
    .home-hex-stream,
    .home-countdown-wrap,
    .home-countdown-glow,
    .home-countdown-digits,
    .home-rise,
    .home-card-corner,
    .home-btn-pulse::after {
        animation: none !important;
    }

    .home-rise,
    .home-countdown-wrap {
        opacity: 1 !important;
        transform: none !important;
    }

    .home-card-hover-lift:hover {
        transform: none;
    }

    .home-particle {
        display: none;
    }

    .ctf-ambient-glow,
    .ctf-ambient-grid,
    .ctf-stat-value,
    .ctf-progress-bar {
        animation: none !important;
        transition: none !important;
    }

    .ctf-reveal {
        opacity: 1 !important;
        transform: none !important;
    }

    .ctf-card-interactive:hover,
    .ctf-action-tile:hover {
        transform: none;
    }
}

/* ——— Global UI polish (semua halaman kecuali efek khusus home) ——— */
.ctf-ambient {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.ctf-ambient-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(45, 53, 97, 0.35) 1px, transparent 1px),
        linear-gradient(90deg, rgba(45, 53, 97, 0.35) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 75%);
    opacity: 0.35;
}

.ctf-ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: ctfAmbientDrift 18s ease-in-out infinite alternate;
}

.ctf-ambient-glow--a {
    width: 45vw;
    height: 45vw;
    top: -15%;
    left: -10%;
    background: rgba(0, 255, 65, 0.12);
}

.ctf-ambient-glow--b {
    width: 40vw;
    height: 40vw;
    bottom: -20%;
    right: -5%;
    background: rgba(0, 217, 255, 0.1);
    animation-delay: -6s;
}

@keyframes ctfAmbientDrift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(4%, 6%) scale(1.08); }
}

.ctf-main {
    position: relative;
    z-index: 1;
}

.ctf-nav {
    transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.ctf-nav.ctf-nav-scrolled {
    background: rgba(6, 10, 28, 0.97) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    border-bottom-color: rgba(0, 255, 65, 0.15) !important;
}

.ctf-nav .nav-link {
    position: relative;
    padding-bottom: 0.35rem;
    transition: color 0.2s ease;
}

.ctf-nav .nav-link::after {
    content: '';
    position: absolute;
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--ctf-accent), var(--ctf-accent2));
    transform: scaleX(0);
    transition: transform 0.25s ease;
    border-radius: 2px;
}

.ctf-nav .nav-link:hover::after,
.ctf-nav .nav-link.active::after {
    transform: scaleX(1);
}

.ctf-nav .nav-link.active {
    color: var(--ctf-accent) !important;
}

.ctf-nav-register {
    border: 1px solid rgba(0, 217, 255, 0.45);
    border-radius: 0.375rem;
    padding: 0.35rem 0.75rem !important;
    margin-left: 0.25rem;
}

.ctf-nav-register:hover {
    background: rgba(0, 217, 255, 0.12);
    box-shadow: 0 0 16px rgba(0, 217, 255, 0.2);
}

.ctf-team-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 255, 65, 0.35);
    background: rgba(0, 30, 15, 0.55);
    box-shadow: inset 0 0 12px rgba(0, 255, 65, 0.08);
}

.ctf-team-pill-score {
    color: var(--ctf-accent);
    font-weight: 600;
}

.ctf-page-hero {
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 255, 65, 0.18);
    background: linear-gradient(135deg, rgba(26, 31, 58, 0.95), rgba(10, 14, 39, 0.85));
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    position: relative;
    overflow: hidden;
}

.ctf-page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ctf-accent), var(--ctf-accent2), transparent);
    opacity: 0.7;
}

.ctf-kicker {
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.85;
}

.ctf-page-title {
    font-weight: 700;
    text-shadow: 0 0 24px rgba(0, 255, 65, 0.15);
}

.ctf-page-hero-icon {
    font-size: 2.5rem;
    line-height: 1;
    filter: drop-shadow(0 0 12px rgba(0, 255, 65, 0.35));
}

/* Konten selalu terlihat dulu (cPanel / CDN kadang gagal muat app.js).
   Animasi fade-in hanya jika JS menandai html.ctf-anim-ready + .is-visible */
.ctf-reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

html.ctf-anim-ready .ctf-reveal:not(.is-visible) {
    opacity: 0;
    transform: translateY(18px);
}

html.ctf-anim-ready .ctf-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.ctf-card-interactive {
    position: relative;
    overflow: hidden;
    transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.ctf-card-interactive::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.06), transparent 55%);
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
}

.ctf-card-interactive:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 255, 65, 0.35) !important;
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.45),
        0 0 24px rgba(0, 255, 65, 0.1);
}

.ctf-card-interactive:hover::before {
    opacity: 1;
}

.ctf-card-interactive.challenge-card--solved {
    border-color: rgba(0, 255, 65, 0.35) !important;
}

.ctf-card-interactive.challenge-card--solved::after {
    content: '✓';
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: rgba(0, 255, 65, 0.15);
    color: var(--ctf-accent);
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.ctf-action-tile {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
}

.ctf-action-tile:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.15);
}

.ctf-stat-value {
    transition: transform 0.3s ease;
}

.ctf-stat-value.is-counted {
    animation: ctfStatPop 0.45s ease;
}

@keyframes ctfStatPop {
    0% { transform: scale(0.85); opacity: 0.5; }
    60% { transform: scale(1.06); }
    100% { transform: scale(1); opacity: 1; }
}

.ctf-progress-bar {
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 12px rgba(0, 255, 65, 0.35);
}

.ctf-badge-diff {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    border: 1px solid transparent;
}

.ctf-badge-diff--trivial { color: #8b92a8; border-color: rgba(139, 146, 168, 0.4); background: rgba(139, 146, 168, 0.1); }
.ctf-badge-diff--easy { color: #00ff41; border-color: rgba(0, 255, 65, 0.35); background: rgba(0, 255, 65, 0.08); }
.ctf-badge-diff--medium { color: #00d9ff; border-color: rgba(0, 217, 255, 0.35); background: rgba(0, 217, 255, 0.08); }
.ctf-badge-diff--hard { color: #ff4444; border-color: rgba(255, 68, 68, 0.35); background: rgba(255, 68, 68, 0.08); }

.ctf-badge-cat {
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: rgba(0, 217, 255, 0.1);
    color: var(--ctf-accent2);
    border: 1px solid rgba(0, 217, 255, 0.2);
}

.ctf-filter-bar .form-select {
    min-width: 10rem;
    cursor: pointer;
}

.ctf-filter-bar .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 255, 65, 0.15) !important;
}

.ctf-auth-shell {
    min-height: calc(100vh - 12rem);
    display: flex;
    align-items: center;
}

.ctf-auth-card {
    position: relative;
    border: 1px solid rgba(0, 255, 65, 0.2);
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(0, 255, 65, 0.06);
}

.ctf-auth-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.5), rgba(0, 217, 255, 0.3), transparent);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.6;
}

.ctf-alert {
    border: 1px solid transparent;
    border-radius: 10px;
    backdrop-filter: blur(6px);
}

.alert-danger.ctf-alert {
    border-color: rgba(255, 68, 68, 0.35);
    background: rgba(255, 68, 68, 0.12);
}

.alert-success.ctf-alert {
    border-color: rgba(0, 255, 65, 0.35);
    background: rgba(0, 255, 65, 0.1);
}

.ctf-table-wrap {
    border-radius: 10px;
    overflow: hidden;
}

.ctf-table-wrap tbody tr {
    transition: background 0.2s ease, transform 0.2s ease;
}

.ctf-table-wrap tbody tr:hover {
    background: rgba(0, 255, 65, 0.05) !important;
}

.ctf-table-wrap tbody tr.ctf-row-top1 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.08), transparent);
}

.ctf-table-wrap tbody tr.ctf-row-top2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.06), transparent);
}

.ctf-table-wrap tbody tr.ctf-row-top3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.06), transparent);
}

.ctf-table-wrap tbody tr.ctf-row-flash {
    animation: ctfRowFlash 1.2s ease;
}

@keyframes ctfRowFlash {
    0%, 100% { background-color: transparent; }
    30% { background-color: rgba(0, 255, 65, 0.12); }
}

.ctf-hint-block {
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.hint-unlock-form .btn-warning {
    color: #0a0e27;
    border-color: #ffc107;
    box-shadow: 0 0 12px rgba(255, 193, 7, 0.35);
}

.hint-unlock-form .btn-warning:hover {
    color: #0a0e27;
    background: #ffcd39;
}

.hint-content {
    border-left: 3px solid rgba(255, 193, 7, 0.6);
    padding-left: 0.75rem;
}

/* Modal Bootstrap: sembunyikan jika CSS/JS CDN gagal (hindari blok muncul di footer) */
.modal {
    display: none !important;
    position: fixed;
    inset: 0;
    z-index: 1055;
    overflow-x: hidden;
    overflow-y: auto;
}

.modal.show {
    display: block !important;
}

.ctf-hint-block.is-unlocked {
    border-color: rgba(255, 215, 0, 0.35) !important;
    box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.05);
}

.ctf-flag-panel {
    border: 1px solid rgba(0, 255, 65, 0.25);
    box-shadow: 0 0 32px rgba(0, 255, 65, 0.08);
}

.ctf-flag-panel .ctf-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 255, 65, 0.2), 0 0 16px rgba(0, 255, 65, 0.15) !important;
}

.ctf-list .list-group-item {
    transition: padding-left 0.2s ease, border-color 0.2s ease;
}

.ctf-list .list-group-item:hover {
    padding-left: 0.5rem;
    border-left: 2px solid var(--ctf-accent) !important;
}

.ctf-footer-disclaimer {
    max-width: 52rem;
    margin-left: auto;
    margin-right: auto;
}

.ctf-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ctf-accent);
    box-shadow: 0 0 8px var(--ctf-accent);
    animation: ctfLivePulse 1.5s ease-in-out infinite;
    vertical-align: middle;
    margin-right: 0.35rem;
}

@keyframes ctfLivePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.modal-content.ctf-card {
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.ctf-modal-backdrop-glow .modal-content {
    border-color: rgba(255, 215, 0, 0.35);
}

.ctf-body--home .ctf-main {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
    width: 100%;
}

.ctf-body--home .ctf-main.container {
    max-width: 100%;
}

@media (max-width: 575.98px) {
    .ctf-page-hero {
        padding: 1rem;
    }

    .ctf-team-pill {
        margin-top: 0.5rem;
        width: 100%;
        justify-content: center;
    }
}

/* ——— Footer: logo UNH + foto berdampingan ——— */
.ctf-footer-brand-row {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.25rem;
    width: auto;
    max-width: 100%;
}

.ctf-footer-brand-logo,
.ctf-footer-brand-photo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 10px;
    flex-shrink: 0;
}

.ctf-footer-brand-logo {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.ctf-footer-brand-photo {
    object-fit: cover;
    border: 1px solid rgba(45, 53, 97, 0.8);
    background: #0f1328;
}

@media (max-width: 575.98px) {
    .ctf-footer-brand-row {
        gap: 0.75rem;
    }

    .ctf-footer-brand-logo,
    .ctf-footer-brand-photo {
        width: 56px;
        height: 56px;
    }
}

@media (min-width: 576px) {
    .ctf-footer-brand-row {
        gap: 1.5rem;
    }

    .ctf-footer-brand-logo,
    .ctf-footer-brand-photo {
        width: 72px;
        height: 72px;
    }
}
