@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&family=Noto+Sans+KR:wght@400;600;700&family=Orbitron:wght@400;600;700&family=Do+Hyeon&display=swap');

:root {
    --ink: #050a18;
    --navy: #002666;
    --blue: #0086d1;
    --frost: #e9f2ff;
    --panel: rgba(255, 255, 255, 0.04);
    --panel-strong: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.12);
    --muted: #a7b4c8;
    --success: #44d2a8;
    --danger: #ff6b6b;
    --font-heading: 'Orbitron', 'Do Hyeon', 'Space Grotesk', 'Noto Sans KR', system-ui, sans-serif;
    --font-body: 'Space Grotesk', 'Noto Sans KR', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(1100px circle at 20% -10%, rgba(0, 134, 209, 0.25), transparent 50%),
        radial-gradient(900px circle at 80% 10%, rgba(138, 43, 226, 0.15), transparent 45%),
        radial-gradient(800px circle at 50% 100%, rgba(0, 38, 102, 0.3), transparent 60%),
        linear-gradient(180deg, #050a18 0%, #0a0e1f 50%, #1a1435 100%);
    color: #eaf1fb;
    font-family: var(--font-body);
    letter-spacing: -0.01em;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 120px 120px;
    opacity: 0.35;
    pointer-events: none;
    animation: gridShift 20s linear infinite;
}

@keyframes gridShift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(120px, 120px); }
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 100px,
            rgba(0, 134, 209, 0.03) 100px,
            rgba(0, 134, 209, 0.03) 102px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 100px,
            rgba(0, 178, 255, 0.02) 100px,
            rgba(0, 178, 255, 0.02) 102px
        );
    animation: circuitPulse 10s ease-in-out infinite;
    pointer-events: none;
    opacity: 0.6;
}

@keyframes circuitPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

a {
    color: var(--frost);
    text-decoration: none;
}

.page-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 18px 48px;
    width: 100%;
    flex: 1;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(120deg, rgba(0, 38, 102, 0.92), rgba(0, 134, 209, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 14px 50px rgba(0, 134, 209, 0.25);
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg,
        rgba(0, 178, 255, 0) 0%,
        rgba(0, 178, 255, 0.25) 35%,
        rgba(0, 134, 209, 0) 70%);
    filter: blur(6px);
    opacity: 0.7;
    transform: translateX(-30%);
    animation: headerSweep 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes headerSweep {
    0%, 100% { transform: translateX(-30%); }
    50% { transform: translateX(40%); }
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand img {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    object-fit: contain;
}

.brand h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    font-family: var(--font-heading);
}

.brand small {
    display: block;
    color: #d2e6ff;
    font-size: 0.85rem;
    font-weight: 500;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    color: #eaf1fb;
    background: var(--panel);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(120deg, var(--blue), #00b2ff);
    border-color: rgba(0, 178, 255, 0.6);
    box-shadow:
        0 10px 30px rgba(0, 134, 209, 0.4),
        0 0 20px rgba(0, 178, 255, 0.2);
    position: relative;
    overflow: hidden;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 14px 38px rgba(0, 134, 209, 0.5),
        0 0 30px rgba(0, 178, 255, 0.4);
    border-color: rgba(0, 178, 255, 0.8);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow:
        0 8px 20px rgba(0, 134, 209, 0.4),
        0 0 15px rgba(0, 178, 255, 0.3);
}

.btn-cyber {
    position: relative;
    overflow: hidden;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid rgba(0, 178, 255, 0.7);
    background:
        linear-gradient(120deg, rgba(0, 178, 255, 0.25), rgba(0, 38, 102, 0.6)),
        radial-gradient(circle at 30% 50%, rgba(0, 178, 255, 0.2), transparent 45%);
    color: #eaf1fb;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    box-shadow:
        0 0 14px rgba(0, 178, 255, 0.35),
        inset 0 0 12px rgba(0, 178, 255, 0.2);
}

.btn-cyber::before,
.btn-cyber::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.btn-cyber::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: translateX(-100%);
    animation: cyberSweep 2.8s ease-in-out infinite;
}

.btn-cyber::after {
    border: 1px solid rgba(0, 178, 255, 0.45);
    inset: 2px;
    border-radius: 10px;
    opacity: 0.6;
}

.btn-cyber:hover {
    transform: translateY(-2px);
    box-shadow:
        0 0 18px rgba(0, 178, 255, 0.45),
        inset 0 0 14px rgba(0, 178, 255, 0.25);
    border-color: rgba(0, 178, 255, 0.85);
}

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

.btn-cyber .live-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-left: 8px;
    border-radius: 50%;
    background: #5cff9d;
    box-shadow:
        0 0 8px rgba(92, 255, 157, 0.9),
        0 0 16px rgba(92, 255, 157, 0.7),
        0 0 24px rgba(92, 255, 157, 0.6);
    animation: livePulse 1.2s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.4);
        opacity: 1;
    }
}

@keyframes cyberSweep {
    0% { transform: translateX(-120%); }
    50% { transform: translateX(120%); }
    100% { transform: translateX(-120%); }
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.25);
    color: #eaf1fb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.btn-ghost:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.hero {
    margin: 28px 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-copy h2 {
    margin: 0 0 8px;
    font-size: 2rem;
    letter-spacing: 0.01em;
    font-family: var(--font-heading);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero-copy p {
    margin: 0;
    color: var(--muted);
}

.muted {
    color: var(--muted);
}

.category-filter {
    margin-top: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: #eaf1fb;
    font-weight: 600;
    transition: all 0.2s ease;
}

.chip.active {
    background: linear-gradient(120deg, rgba(0, 134, 209, 0.25), rgba(0, 38, 102, 0.65));
    border-color: rgba(0, 134, 209, 0.55);
    box-shadow: 0 10px 24px rgba(0, 134, 209, 0.35);
}

.chip:hover {
    border-color: rgba(234, 241, 251, 0.5);
}

.challenge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.challenge-card {
    position: relative;
    padding: 18px;
    border-radius: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    text-decoration: none;
    color: #eaf1fb;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.challenge-card::before {
    content: '';
    position: absolute;
    inset: -30% auto auto -30%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(0, 134, 209, 0.12), transparent 55%);
    transform: rotate(-12deg);
    pointer-events: none;
}

.challenge-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 178, 255, 0.6);
    box-shadow: 0 16px 32px rgba(0, 134, 209, 0.25);
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.challenge-card.solved {
    border-color: rgba(68, 210, 168, 0.8);
    box-shadow: 0 16px 32px rgba(68, 210, 168, 0.35);
    background: linear-gradient(150deg, rgba(0, 134, 209, 0.18), rgba(68, 210, 168, 0.2));
}

.category-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    text-transform: uppercase;
    background: rgba(0, 134, 209, 0.14);
    border: 1px solid rgba(0, 134, 209, 0.35);
    color: #d4eaff;
}

.challenge-title {
    margin: 6px 0 12px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-heading);
    letter-spacing: 0.02em;
}

.points {
    font-weight: 700;
    color: #9fd6ff;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

.tag-solved {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px 6px;
    border-radius: 10px;
    background: rgba(68, 210, 168, 0.12);
    color: #c2f3e2;
    font-size: 0.9rem;
    border: 1px solid rgba(68, 210, 168, 0.4);
}

.site-footer {
    margin-top: 16px;
    padding: 8px 0;
    color: #9fb7d6;
    font-size: 0.92rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.site-footer a {
    color: #c8e7ff;
    font-weight: 600;
}

.site-footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Countdown */
.countdown-shell {
    display: grid;
    gap: 18px;
    justify-items: center;
    justify-content: center;
    align-content: center;
    text-align: center;
    padding: 20px;
    width: 100%;
}

.countdown-card {
    width: 100%;
    max-width: 720px;
    background: linear-gradient(150deg, rgba(0, 38, 102, 0.32), rgba(0, 134, 209, 0.28));
    border: 1px solid rgba(0, 178, 255, 0.35);
    border-radius: 18px;
    box-shadow:
        0 20px 46px rgba(0, 134, 209, 0.35),
        inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.countdown-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(0, 178, 255, 0.16), transparent 45%),
                radial-gradient(circle at 80% 10%, rgba(138, 43, 226, 0.16), transparent 40%);
    pointer-events: none;
}

.countdown-ring {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    width: auto;
    height: auto;
    border-radius: 14px;
    background: rgba(0, 178, 255, 0.08);
    box-shadow: 0 0 30px rgba(0, 178, 255, 0.25);
}

.countdown-digits {
    font-size: 3.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #eaf1fb;
    text-shadow: 0 0 24px rgba(0, 178, 255, 0.65);
}

.countdown-label {
    margin-top: 8px;
    color: #c8e7ff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.countdown-meta {
    margin-top: 12px;
    color: #a7b4c8;
    font-size: 0.95rem;
}

.countdown-progress {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-top: 14px;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.35);
}

.countdown-progress .bar {
    height: 100%;
    background: linear-gradient(90deg, #00ffd5, #0086d1);
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 16px rgba(0, 255, 213, 0.55);
}

.countdown-card.countdown-complete {
    animation: blast 1.4s ease forwards;
}

.countdown-card.last-ten .countdown-ring {
    animation: ringPulseFast 1s ease-in-out infinite;
    box-shadow: 0 0 calc(70px + 20px * var(--last-ten-scale, 0)) rgba(0, 255, 213, 0.65);
}

.countdown-card.last-ten .countdown-digits {
    color: #e0fff5;
    text-shadow:
        0 0 calc(24px + 10px * var(--last-ten-scale, 0)) rgba(0, 255, 213, 0.8),
        0 0 calc(48px + 10px * var(--last-ten-scale, 0)) rgba(0, 178, 255, 0.6);
}

.countdown-card.last-ten .bar {
    background: linear-gradient(90deg, #00ffcc, #00ffe0);
    box-shadow: 0 0 calc(20px + 12px * var(--last-ten-scale, 0)) rgba(0, 255, 213, 0.7);
}

/* Glitch overlay for transition */
.glitch-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: transparent;
    opacity: 0;
    z-index: 9999;
}

@keyframes blast {
    0% { transform: scale(1); opacity: 1; }
    60% { transform: scale(1.06); opacity: 1; box-shadow: 0 0 80px rgba(0, 255, 213, 0.6); }
    100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 rgba(0,0,0,0); }
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
        135deg,
        rgba(0, 178, 255, 0.1),
        transparent 30%,
        transparent 70%,
        rgba(0, 134, 209, 0.1)
    );
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.panel:hover::before {
    opacity: 1;
}

.panel > * {
    position: relative;
    z-index: 1;
}

.challenge-detail {
    margin-top: 24px;
    display: grid;
    gap: 16px;
}

.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(
        90deg,
        rgba(0, 178, 255, 0.6),
        rgba(0, 134, 209, 0.4),
        transparent
    ) 1;
    position: relative;
}

.detail-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, rgba(0, 178, 255, 1), transparent);
    box-shadow: 0 0 10px rgba(0, 178, 255, 0.6);
    animation: headerPulse 2s ease-in-out infinite;
}

@keyframes headerPulse {
    0%, 100% {
        width: 60px;
        opacity: 0.8;
    }
    50% {
        width: 100px;
        opacity: 1;
    }
}

.detail-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-family: var(--font-heading);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #eaf1fb;
    text-shadow: 0 0 10px rgba(0, 178, 255, 0.5);
}

.challenge-copy p {
    line-height: 1.7;
}

.challenge-copy h2,
.challenge-copy h3 {
    margin: 20px 0 8px;
    font-size: 1.1rem;
    color: #eaf1fb;
}

.challenge-copy pre {
    overflow-x: auto;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
}

.challenge-copy a {
    color: #9fd6ff;
}

.stat-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pill {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: #dce8f7;
    font-weight: 600;
}

.pill strong {
    color: #9fd6ff;
}

.messages {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}

.messages li {
    padding: 12px 14px;
    border-radius: 10px;
    margin-top: 10px;
    font-weight: 600;
}

.messages li.success {
    background: rgba(68, 210, 168, 0.12);
    border: 1px solid rgba(68, 210, 168, 0.4);
    color: #c8f5e7;
}

.messages li.error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.25);
    color: #ffc9c9;
}

.flag-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.flag-input {
    flex: 1 1 260px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    color: #eaf1fb;
    font-size: 1rem;
}

.flag-input:focus {
    outline: 2px solid rgba(0, 178, 255, 0.5);
    border-color: rgba(0, 178, 255, 0.7);
}

.resource-box {
    margin-top: 12px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}

.resource-box a {
    color: #c8e7ff;
    font-weight: 600;
}

.leaderboard-shell {
    margin-top: 24px;
    display: grid;
    gap: 18px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    color: #eaf1fb;
    position: relative;
}

.table thead {
    background: linear-gradient(120deg, rgba(0, 38, 102, 0.9), rgba(0, 134, 209, 0.9));
}

.table th,
.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.table th {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #c8e7ff;
}

.table td {
    font-size: 0.97rem;
}

.table th:nth-child(3),
.table td:nth-child(3) { text-align: center; }
.table th:last-child,
.table td:last-child { text-align: right; }

.graph {
    width: 100%;
    min-height: 380px;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(0, 38, 102, 0.15), rgba(0, 134, 209, 0.1)),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 40px,
            rgba(0, 178, 255, 0.03) 40px,
            rgba(0, 178, 255, 0.03) 41px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 40px,
            rgba(0, 178, 255, 0.03) 40px,
            rgba(0, 178, 255, 0.03) 41px
        );
    box-shadow:
        inset 0 0 40px rgba(0, 134, 209, 0.15),
        0 0 30px rgba(0, 178, 255, 0.1);
}

.graph::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(0, 178, 255, 0.08), transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(0, 134, 209, 0.08), transparent 50%);
    pointer-events: none;
    animation: graphAmbient 8s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes graphAmbient {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.graph::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 178, 255, 0.1),
        transparent
    );
    animation: graphScan 6s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes graphScan {
    0%, 100% {
        left: -100%;
        opacity: 0;
    }
    10%, 90% {
        opacity: 1;
    }
    50% {
        left: 100%;
    }
}

.footer-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-start;
}

.auth-shell {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px;
    position: relative;
    overflow: hidden;
    background-image:
        linear-gradient(160deg, rgba(0, 9, 30, 0.75), rgba(0, 38, 102, 0.65)),
        url('../images/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.auth-shell::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(0, 178, 255, 0.12), transparent 45%),
        radial-gradient(circle at 80% 10%, rgba(138, 43, 226, 0.12), transparent 40%),
        linear-gradient(0deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.75));
    z-index: 0;
    pointer-events: none;
}

.neon-rain {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        120deg,
        rgba(0, 178, 255, 0.08) 0px,
        rgba(0, 178, 255, 0.08) 2px,
        transparent 2px,
        transparent 20px
    );
    animation: rainDrift 12s linear infinite;
    mix-blend-mode: screen;
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
}

.scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.04) 0px,
        rgba(255, 255, 255, 0.04) 1px,
        transparent 1px,
        transparent 3px
    );
    animation: scanline 8s linear infinite;
    pointer-events: none;
    z-index: 2;
    opacity: 0.35;
}

@keyframes rainDrift {
    0% { transform: translateY(-30%); }
    100% { transform: translateY(30%); }
}

.auth-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            rgba(0, 134, 209, 0.03) 0px,
            transparent 1px,
            transparent 2px,
            rgba(0, 134, 209, 0.03) 3px
        );
    animation: scanline 8s linear infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(100%); }
}

.auth-ambient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.4;
    animation: float 8s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.4;
    }
    50% {
        transform: translate(15px, -15px) scale(1.05);
        opacity: 0.5;
    }
}

.orb.blue {
    width: 380px;
    height: 380px;
    background: rgba(0, 134, 209, 0.65);
    top: -140px;
    left: -120px;
    animation-delay: -2s;
}

.orb.navy {
    width: 420px;
    height: 420px;
    background: rgba(0, 38, 102, 0.6);
    bottom: -160px;
    right: -140px;
    animation-delay: -4s;
}

.data-stream {
    position: absolute;
    width: 2px;
    height: 100px;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(0, 178, 255, 0.8),
        rgba(0, 134, 209, 0.4),
        transparent
    );
    top: -100px;
    animation: streamFall 8s linear infinite;
    box-shadow: 0 0 10px rgba(0, 178, 255, 0.5);
}

@keyframes streamFall {
    0% {
        top: -100px;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

.cyber-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(0, 178, 255, 0.8);
    border-radius: 50%;
    box-shadow:
        0 0 10px rgba(0, 178, 255, 0.8),
        0 0 20px rgba(0, 134, 209, 0.5),
        0 0 30px rgba(0, 178, 255, 0.3);
    animation: particleFloat 6s ease-in-out infinite, particlePulse 2s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(30px, -40px);
    }
    50% {
        transform: translate(-20px, -80px);
    }
    75% {
        transform: translate(40px, -40px);
    }
}

@keyframes particlePulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

/* 로그인 성공 애니메이션 */
.login-attempt {
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.login-glitch {
    animation: glitchPulse 0.4s ease-out;
}

@keyframes glitchPulse {
    0%, 100% { transform: translate(0); filter: hue-rotate(0deg); }
    10% { transform: translate(-5px, 2px); filter: hue-rotate(90deg); }
    20% { transform: translate(3px, -3px); filter: hue-rotate(-90deg); }
    30% { transform: translate(-2px, 4px); filter: hue-rotate(60deg); }
    40% { transform: translate(4px, -2px); filter: hue-rotate(0deg); }
    50% { transform: translate(-3px, 3px); filter: hue-rotate(-60deg); }
    60% { transform: translate(2px, -4px); filter: hue-rotate(0deg); }
}

.login-success {
    animation: successFadeOut 0.8s ease-out forwards;
}

@keyframes successFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: brightness(1);
    }
    30% {
        filter: brightness(1.5);
    }
    100% {
        opacity: 0;
        transform: scale(1.05);
        filter: brightness(2) blur(10px);
    }
}

/* 성공 오버레이 */
.success-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(0, 134, 209, 0.2), rgba(5, 10, 24, 0.95));
    transition: opacity 0.3s ease-out;
}

.success-overlay.active {
    opacity: 1;
    animation: overlayPulse 1.5s ease-out;
}

@keyframes overlayPulse {
    0% { background: radial-gradient(circle at center, rgba(0, 134, 209, 0), rgba(5, 10, 24, 0)); }
    50% { background: radial-gradient(circle at center, rgba(0, 178, 255, 0.4), rgba(5, 10, 24, 0.7)); }
    100% { background: radial-gradient(circle at center, rgba(0, 134, 209, 0.2), rgba(5, 10, 24, 0.95)); }
}

/* 스캔 효과 */
.success-scan {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.success-scan::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg,
        transparent,
        rgba(0, 178, 255, 0.3),
        rgba(0, 178, 255, 1),
        rgba(0, 178, 255, 0.3),
        transparent
    );
    box-shadow:
        0 0 20px rgba(0, 178, 255, 1),
        0 0 40px rgba(0, 134, 209, 0.8),
        0 0 60px rgba(0, 178, 255, 0.6);
    animation: scanBeam 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.success-overlay.active .success-scan::before {
    animation: scanBeam 1.5s cubic-bezier(0.4, 0, 0.2, 1) 3;
}

@keyframes scanBeam {
    0% {
        top: -3px;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

.success-scan::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            rgba(0, 178, 255, 0.03) 1px,
            transparent 2px,
            transparent 4px
        );
    animation: scanlineMove 0.1s linear infinite;
}

@keyframes scanlineMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* ACCESS GRANTED 텍스트 */
.success-text {
    position: relative;
    font-family: 'Orbitron', monospace;
    font-size: 4rem;
    font-weight: 700;
    color: #00b2ff;
    text-align: center;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0;
    transform: scale(0.5) rotateX(90deg);
    text-shadow:
        0 0 10px rgba(0, 178, 255, 1),
        0 0 20px rgba(0, 178, 255, 0.8),
        0 0 30px rgba(0, 178, 255, 0.6),
        0 0 40px rgba(0, 134, 209, 0.5),
        0 0 60px rgba(0, 134, 209, 0.4),
        0 0 80px rgba(0, 178, 255, 0.3);
    z-index: 10;
}

.success-overlay.active .success-text {
    animation:
        textEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards,
        textGlow 1.5s ease-in-out 0.9s infinite;
}

@keyframes textEntrance {
    0% {
        opacity: 0;
        transform: scale(0.5) rotateX(90deg);
        filter: blur(20px);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) rotateX(0deg);
        filter: blur(0px);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateX(0deg);
        filter: blur(0px);
    }
}

@keyframes textGlow {
    0%, 100% {
        text-shadow:
            0 0 10px rgba(0, 178, 255, 1),
            0 0 20px rgba(0, 178, 255, 0.8),
            0 0 30px rgba(0, 178, 255, 0.6),
            0 0 40px rgba(0, 134, 209, 0.5),
            0 0 60px rgba(0, 134, 209, 0.4),
            0 0 80px rgba(0, 178, 255, 0.3);
    }
    50% {
        text-shadow:
            0 0 20px rgba(0, 178, 255, 1),
            0 0 40px rgba(0, 178, 255, 1),
            0 0 60px rgba(0, 178, 255, 0.8),
            0 0 80px rgba(0, 134, 209, 0.7),
            0 0 100px rgba(0, 134, 209, 0.6),
            0 0 140px rgba(0, 178, 255, 0.5);
    }
}

/* 파티클 효과 */
.success-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.success-overlay.active .success-particles::before,
.success-overlay.active .success-particles::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle, rgba(0, 178, 255, 0.8) 2px, transparent 2px),
        radial-gradient(circle, rgba(0, 134, 209, 0.6) 1px, transparent 1px),
        radial-gradient(circle, rgba(0, 178, 255, 0.9) 3px, transparent 3px),
        radial-gradient(circle, rgba(0, 134, 209, 0.7) 2px, transparent 2px),
        radial-gradient(circle, rgba(0, 178, 255, 0.8) 1px, transparent 1px);
    background-size:
        200px 200px,
        150px 150px,
        250px 250px,
        180px 180px,
        220px 220px;
    background-position:
        20% 30%,
        60% 70%,
        80% 20%,
        40% 60%,
        70% 40%;
    opacity: 0;
}

.success-overlay.active .success-particles::before {
    animation: particleBurst 1.5s ease-out 0.4s;
}

.success-overlay.active .success-particles::after {
    animation: particleBurst 1.5s ease-out 0.6s;
    background-position:
        30% 70%,
        70% 30%,
        10% 50%,
        90% 80%,
        50% 10%;
}

@keyframes particleBurst {
    0% {
        opacity: 0;
        transform: scale(0);
        filter: blur(0);
    }
    30% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
    100% {
        opacity: 0;
        transform: scale(3);
        filter: blur(4px);
    }
}

/* 카드 디졸브 효과 */
.auth-card.dissolve {
    animation: cardDissolve 1s ease-out forwards;
    position: relative;
}

.auth-card.dissolve::before {
    animation: none !important;
}

.auth-card.dissolve::after {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    border-radius: inherit;
    animation: glitchDissolve 0.6s steps(4) infinite;
    z-index: 5;
}

@keyframes cardDissolve {
    0% {
        opacity: 1;
        transform: scale(1) rotateX(0deg);
        filter: blur(0) brightness(1);
    }
    30% {
        opacity: 0.8;
        transform: scale(0.98) rotateX(5deg);
        filter: blur(1px) brightness(1.2);
    }
    60% {
        opacity: 0.4;
        transform: scale(0.95) rotateX(-5deg);
        filter: blur(3px) brightness(1.5);
    }
    100% {
        opacity: 0;
        transform: scale(0.9) rotateX(10deg);
        filter: blur(8px) brightness(2);
    }
}

@keyframes glitchDissolve {
    0%, 100% {
        clip-path: inset(0 0 0 0);
        transform: translate(0);
    }
    25% {
        clip-path: inset(10% 0 60% 0);
        transform: translate(-5px, 2px);
    }
    50% {
        clip-path: inset(40% 0 20% 0);
        transform: translate(5px, -2px);
    }
    75% {
        clip-path: inset(70% 0 10% 0);
        transform: translate(-3px, 3px);
    }
}

.btn-loading {
    animation: pulse 1s ease-in-out infinite;
}

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

.neon-sign {
    position: absolute;
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(0, 178, 255, 0.9);
    text-shadow:
        0 0 10px rgba(0, 178, 255, 0.8),
        0 0 20px rgba(0, 178, 255, 0.6),
        0 0 30px rgba(0, 178, 255, 0.4),
        0 0 40px rgba(0, 134, 209, 0.3);
    animation: neonFlicker 4s ease-in-out infinite;
    pointer-events: none;
    letter-spacing: 0.1em;
    opacity: 0.8;
}

@keyframes neonFlicker {
    0%, 100% {
        opacity: 0.8;
        text-shadow:
            0 0 10px rgba(0, 178, 255, 0.8),
            0 0 20px rgba(0, 178, 255, 0.6),
            0 0 30px rgba(0, 178, 255, 0.4),
            0 0 40px rgba(0, 134, 209, 0.3);
    }
    50% {
        opacity: 1;
        text-shadow:
            0 0 15px rgba(0, 178, 255, 1),
            0 0 30px rgba(0, 178, 255, 0.8),
            0 0 45px rgba(0, 178, 255, 0.6),
            0 0 60px rgba(0, 134, 209, 0.4);
    }
    75% {
        opacity: 0.6;
    }
    76% {
        opacity: 1;
    }
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 28px;
    border-radius: 18px;
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
    position: relative;
    overflow: hidden;
    z-index: 3;
    animation: cardEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-card-neo {
    background: linear-gradient(150deg, rgba(0, 38, 102, 0.35), rgba(0, 134, 209, 0.38));
    border: 1px solid rgba(0, 178, 255, 0.45);
    box-shadow:
        0 20px 46px rgba(0, 134, 209, 0.35),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        0 0 60px rgba(0, 134, 209, 0.2);
    backdrop-filter: blur(12px);
}

.auth-card-neo::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg,
        transparent 0%,
        rgba(0, 178, 255, 0.1) 25%,
        transparent 50%,
        rgba(0, 178, 255, 0.1) 75%,
        transparent 100%
    );
    background-size: 200% 200%;
    animation: borderGlow 3s linear infinite;
    border-radius: 18px;
    z-index: -1;
    pointer-events: none;
}

@keyframes borderGlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.auth-card-neo::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1), transparent 45%),
        radial-gradient(circle at 80% 0%, rgba(0, 178, 255, 0.18), transparent 40%);
}

.auth-card .brand {
    justify-content: center;
    gap: 18px;
    position: relative;
    z-index: 1;
}

.auth-card .brand img {
    width: 86px;
    height: 86px;
    border-radius: 18px;
    background: transparent;
    border: none;
    object-fit: contain;
    box-shadow:
        0 0 28px rgba(0, 178, 255, 0.55),
        0 0 48px rgba(0, 134, 209, 0.4);
    animation: logoGlow 2.2s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 28px rgba(0, 178, 255, 0.75));
}

@keyframes logoGlow {
    0% {
        filter: drop-shadow(0 0 22px rgba(0, 134, 209, 0.55));
    }
    100% {
        filter: drop-shadow(0 0 40px rgba(0, 178, 255, 0.9));
    }
}


.auth-card h1 {
    margin: 6px 0 2px;
    font-size: 2.2rem;
    text-align: center;
    position: relative;
    z-index: 1;
    text-shadow:
        0 0 20px rgba(0, 134, 209, 0.5),
        0 0 40px rgba(0, 178, 255, 0.3);
    animation: textFlicker 3s ease-in-out infinite;
}

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

.auth-card p {
    margin: 0;
    text-align: center;
    color: var(--muted);
    position: relative;
    z-index: 1;
}

.auth-tagline {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: #9fd6ff;
    margin-top: 8px;
    font-family: 'Orbitron', monospace;
    text-shadow: 0 0 10px rgba(0, 134, 209, 0.5);
}

.brand-center {
    justify-content: center;
    text-align: center;
}

.accent-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 178, 255, 0.8), transparent);
    margin: 14px 0;
    border-radius: 999px;
    opacity: 0.9;
    box-shadow: 0 0 10px rgba(0, 178, 255, 0.5);
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.7;
        box-shadow: 0 0 10px rgba(0, 178, 255, 0.5);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 20px rgba(0, 178, 255, 0.8);
    }
}

.auth-lead {
    margin: 0 0 10px;
    text-align: center;
    color: #eaf1fb;
    font-weight: 600;
}

.pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 14px;
    position: relative;
    z-index: 1;
}

.form-group label {
    font-weight: 600;
    color: #c8e7ff;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-control {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(5, 10, 24, 0.5);
    color: #eaf1fb;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.input-control:focus {
    outline: none;
    border-color: rgba(0, 178, 255, 0.8);
    background: rgba(5, 10, 24, 0.7);
    box-shadow:
        0 0 0 3px rgba(0, 178, 255, 0.15),
        inset 0 2px 8px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(0, 134, 209, 0.3);
    transform: translateY(-1px);
}

.input-control:hover {
    border-color: rgba(0, 134, 209, 0.5);
}

.input-control::placeholder {
    color: rgba(167, 180, 200, 0.5);
    font-style: italic;
}

.input-control:focus::placeholder {
    color: rgba(159, 214, 255, 0.4);
}

.btn-full {
    width: 100%;
}

.messages.auth {
    margin-top: 14px;
}

.messages.auth li {
    width: 100%;
}

@media (max-width: 720px) {
    .app-header, .detail-header, .hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .brand {
        width: 100%;
    }

    .btn-logout {
        width: 100%;
    }

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

    .success-text {
        font-size: 2rem;
        letter-spacing: 0.1em;
        padding: 0 20px;
    }
}
