:root {
    --cyber-primary: #00F0FF;
    --cyber-secondary: #00d4ff;
    --cyber-danger: #ff0040;
    --cyber-warning: #ffcc00;
    --cyber-purple: #9d4edd;
    --cyber-bg: #00040d;
    --cyber-card: #0a1628;
    --cyber-border: rgba(0,240,255,0.3);
    --glow-primary: 0 0 20px rgba(0,240,255,0.5);
    --glow-secondary: 0 0 20px rgba(0, 212, 255, 0.5);
    --glow-danger: 0 0 20px rgba(255, 0, 64, 0.5);
}

.celebration-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 4, 13, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
}

.celebration-modal.show {
    opacity: 1;
    visibility: visible;
}

.celebration-content {
    position: relative;
    background: linear-gradient(135deg, #0a1628 0%, #1a0a28 100%);
    border: 2px solid var(--cyber-primary);
    border-radius: 20px;
    padding: 40px 60px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--glow-primary), inset 0 0 60px rgba(0,240,255,0.05);
    animation: modalPulse 2s infinite;
    overflow: visible;
    z-index: 10000;
}

.celebration-content > *:not(.celebration-glow) {
    position: relative;
    z-index: 1;
}

.celebration-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, var(--cyber-primary), transparent, var(--cyber-secondary), transparent);
    animation: rotateGlow 4s linear infinite;
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
}

@keyframes rotateGlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes modalPulse {
    0%, 100% { box-shadow: var(--glow-primary), inset 0 0 60px rgba(0,240,255,0.05); }
    50% { box-shadow: 0 0 40px rgba(0,240,255,0.8), inset 0 0 80px rgba(0,240,255,0.1); }
}

.celebration-icon {
    font-size: 60px;
    color: var(--cyber-warning);
    margin-bottom: 20px;
    animation: iconBounce 0.6s ease-out, iconGlow 1.5s infinite;
    text-shadow: 0 0 30px var(--cyber-warning);
}

@keyframes iconBounce {
    0% { transform: scale(0) rotate(-180deg); }
    50% { transform: scale(1.2) rotate(10deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes iconGlow {
    0%, 100% { text-shadow: 0 0 30px var(--cyber-warning); }
    50% { text-shadow: 0 0 50px var(--cyber-warning), 0 0 80px var(--cyber-warning); }
}

.celebration-badge {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
}

.badge-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: var(--cyber-primary);
    border-radius: 50%;
    animation: spinRing 1s linear infinite;
}

.badge-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--cyber-primary), var(--cyber-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: var(--cyber-bg);
    box-shadow: var(--glow-primary);
}

@keyframes spinRing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.celebration-title {
    font-family: 'PhelixBoomgartner', 'Orbitron', sans-serif;
    font-size: 2.5rem;
    color: var(--cyber-primary);
    margin-bottom: 15px;
    text-shadow: 0 0 20px var(--cyber-primary);
    animation: glitchTitle 3s infinite;
    letter-spacing: 3px;
}

@keyframes glitchTitle {
    0%, 90%, 100% { 
        transform: translateX(0);
        text-shadow: 0 0 20px var(--cyber-primary);
    }
    92% { 
        transform: translateX(-5px);
        text-shadow: -3px 0 var(--cyber-danger), 3px 0 var(--cyber-secondary);
    }
    94% { 
        transform: translateX(5px);
        text-shadow: 3px 0 var(--cyber-danger), -3px 0 var(--cyber-secondary);
    }
    96% { 
        transform: translateX(-2px);
        text-shadow: -1px 0 var(--cyber-danger), 1px 0 var(--cyber-secondary);
    }
}

.celebration-message {
    font-size: 1.1rem;
    color: #b0b0b0;
    margin-bottom: 25px;
    line-height: 1.6;
}

.celebration-points {
    background: rgba(0,240,255,0.1);
    border: 1px solid var(--cyber-primary);
    border-radius: 10px;
    padding: 15px 30px;
    margin-bottom: 20px;
    display: inline-block;
}

.points-label {
    color: #888;
    font-size: 0.9rem;
    margin-right: 10px;
}

.points-value {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    color: var(--cyber-primary);
    font-weight: bold;
    text-shadow: 0 0 15px var(--cyber-primary);
    animation: pointsPulse 0.5s ease-out;
}

@keyframes pointsPulse {
    0% { transform: scale(1.5); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.celebration-rank {
    color: var(--cyber-secondary);
    margin-bottom: 25px;
    font-size: 0.9rem;
}

.celebration-rank i {
    margin-right: 8px;
    animation: pulse 1s infinite;
}

.celebration-btn {
    background: linear-gradient(135deg, var(--cyber-primary), var(--cyber-secondary));
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: bold;
    color: var(--cyber-bg);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 10;
}

.celebration-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px var(--cyber-primary);
}

.celebration-btn i {
    transition: transform 0.3s ease;
}

.celebration-btn:hover i {
    transform: translateX(5px);
}

.winner-banner {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 10000;
    background: linear-gradient(135deg, #1a0a28, #0a1628);
    border: 2px solid var(--cyber-warning);
    border-radius: 15px;
    padding: 20px 50px;
    box-shadow: 0 0 40px rgba(255, 204, 0, 0.5);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

.winner-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.winner-content i {
    font-size: 30px;
    color: var(--cyber-warning);
    animation: crownBounce 0.5s infinite alternate;
}

@keyframes crownBounce {
    from { transform: translateY(0) rotate(-5deg); }
    to { transform: translateY(-5px) rotate(5deg); }
}

.winner-text {
    font-family: 'PhelixBoomgartner', 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--cyber-warning);
    text-shadow: 0 0 20px var(--cyber-warning);
    letter-spacing: 3px;
}

.threat-map-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(0,240,255,0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(0, 212, 255, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(157, 78, 221, 0.02) 0%, transparent 60%);
    z-index: -2;
    pointer-events: none;
}

.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0,240,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,240,255,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
    animation: gridPulse 4s infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

.leaderboard-crown {
    position: relative;
    display: inline-block;
}

.leaderboard-crown::before {
    content: '\f521';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    color: var(--cyber-warning);
    text-shadow: 0 0 15px var(--cyber-warning);
    animation: crownFloat 2s infinite ease-in-out;
}

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

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
}

.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    animation: goldPulse 1.5s infinite;
}

@keyframes goldPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6); }
    50% { box-shadow: 0 0 35px rgba(255, 215, 0, 0.9); }
}

.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #000;
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.5);
}

.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #a0522d);
    color: #fff;
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.5);
}

.rank-other {
    background: rgba(0,240,255,0.1);
    border: 1px solid var(--cyber-primary);
    color: var(--cyber-primary);
}

.challenge-solved-badge {
    position: relative;
}

.challenge-solved-badge::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: -10px;
    right: -10px;
    width: 25px;
    height: 25px;
    background: var(--cyber-primary);
    color: var(--cyber-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: var(--glow-primary);
    animation: checkBounce 0.5s ease-out;
}

@keyframes checkBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.hacker-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

.stat-card {
    background: rgba(0,240,255,0.05);
    border: 1px solid var(--cyber-border);
    border-radius: 12px;
    padding: 20px 30px;
    text-align: center;
    min-width: 150px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--glow-primary);
    border-color: var(--cyber-primary);
}

.stat-value {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    color: var(--cyber-primary);
    text-shadow: 0 0 15px var(--cyber-primary);
}

.stat-label {
    color: #888;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

.terminal-text {
    font-family: 'Hack', 'Consolas', monospace;
    color: var(--cyber-primary);
}

.typing-effect {
    overflow: hidden;
    border-right: 2px solid var(--cyber-primary);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    from, to { border-color: transparent; }
    50% { border-color: var(--cyber-primary); }
}

.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyber-primary), transparent);
    animation: scanDown 8s linear infinite;
    opacity: 0.3;
    pointer-events: none;
    z-index: 1000;
}

@keyframes scanDown {
    0% { top: -2px; }
    100% { top: 100%; }
}

.glitch-active {
    animation: glitchEffect 0.3s infinite;
}

@keyframes glitchEffect {
    0% { transform: translate(0); filter: hue-rotate(0deg); }
    20% { transform: translate(-2px, 2px); filter: hue-rotate(90deg); }
    40% { transform: translate(-2px, -2px); filter: hue-rotate(180deg); }
    60% { transform: translate(2px, 2px); filter: hue-rotate(270deg); }
    80% { transform: translate(2px, -2px); filter: hue-rotate(360deg); }
    100% { transform: translate(0); filter: hue-rotate(0deg); }
}

.pulse-border {
    animation: pulseBorder 2s infinite;
}

@keyframes pulseBorder {
    0%, 100% { border-color: var(--cyber-primary); box-shadow: 0 0 10px var(--cyber-primary); }
    50% { border-color: var(--cyber-secondary); box-shadow: 0 0 20px var(--cyber-secondary); }
}

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

.secret-mission-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
}

.secret-mission-modal.show {
    display: flex;
}

.secret-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.secret-mission-modal.fade-in .secret-overlay {
    opacity: 1;
}

.secret-mission-modal.fade-out .secret-overlay {
    opacity: 0;
}

.secret-content {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.5s ease;
    max-width: 700px;
    width: 90%;
}

.secret-mission-modal.reveal .secret-content {
    opacity: 1;
    transform: scale(1);
}

.secret-scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #00F0FF, #00d4ff, transparent);
    animation: secretScan 2s linear infinite;
    z-index: 10;
    box-shadow: 0 0 20px #00F0FF, 0 0 40px #00F0FF;
}

@keyframes secretScan {
    0% { top: 0; }
    100% { top: 100%; }
}

.secret-glitch-bars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.secret-glitch-bars::before,
.secret-glitch-bars::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: rgba(255, 0, 64, 0.8);
    animation: glitchBars 0.1s infinite;
}

@keyframes glitchBars {
    0% { top: 10%; left: 0; }
    25% { top: 40%; left: -5px; }
    50% { top: 70%; left: 5px; }
    75% { top: 25%; left: -3px; }
    100% { top: 85%; left: 0; }
}

.secret-terminal {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    border: 2px solid #00F0FF;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0,240,255,0.3), inset 0 0 50px rgba(0,240,255,0.05);
}

.terminal-header {
    background: linear-gradient(90deg, #1a1a2e, #2a2a4e);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(0,240,255,0.3);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dot.red { background: #ff5f56; box-shadow: 0 0 10px #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; box-shadow: 0 0 10px #ffbd2e; }
.terminal-dot.green { background: #27ca40; box-shadow: 0 0 10px #27ca40; }

.terminal-title {
    margin-left: auto;
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    color: #ff0040;
    letter-spacing: 3px;
    animation: titleFlicker 2s infinite;
}

@keyframes titleFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
    52% { opacity: 1; }
    54% { opacity: 0.5; }
    56% { opacity: 1; }
}

.terminal-body {
    padding: 30px;
    min-height: 300px;
    font-family: 'Hack', 'Consolas', monospace;
    font-size: 0.95rem;
    line-height: 1.8;
}

.typing-container {
    position: relative;
}

.terminal-line {
    margin-bottom: 5px;
    opacity: 0;
    animation: lineAppear 0.1s forwards;
}

@keyframes lineAppear {
    to { opacity: 1; }
}

.terminal-line.system { color: #888; }
.terminal-line.success { color: #00F0FF; text-shadow: 0 0 10px #00F0FF; }
.terminal-line.progress { color: #00d4ff; }
.terminal-line.border { color: #ff0040; text-shadow: 0 0 5px #ff0040; }
.terminal-line.title { color: #ffcc00; font-weight: bold; text-shadow: 0 0 15px #ffcc00; }
.terminal-line.mission { color: #00d4ff; font-weight: bold; }
.terminal-line.message { color: #aaa; }
.terminal-line.highlight { 
    color: #00F0FF; 
    font-weight: bold;
    text-shadow: 0 0 20px #00F0FF;
    animation: highlightPulse 1s infinite;
}

@keyframes highlightPulse {
    0%, 100% { text-shadow: 0 0 20px #00F0FF; }
    50% { text-shadow: 0 0 40px #00F0FF, 0 0 60px #00F0FF; }
}

.cursor {
    color: #00F0FF;
    animation: cursorBlink 0.7s infinite;
}

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

.secret-badge-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.secret-badge-container.show {
    opacity: 1;
    transform: scale(1);
}

.secret-badge {
    position: relative;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #1a0a28, #0a1628);
    border: 3px solid #ffcc00;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.5);
}

.secret-badge i {
    font-size: 40px;
    color: #ffcc00;
    text-shadow: 0 0 20px #ffcc00;
    animation: badgeGlow 2s infinite;
}

@keyframes badgeGlow {
    0%, 100% { text-shadow: 0 0 20px #ffcc00; transform: scale(1); }
    50% { text-shadow: 0 0 40px #ffcc00, 0 0 60px #ffcc00; transform: scale(1.1); }
}

.badge-glow {
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255, 204, 0, 0.3) 0%, transparent 70%);
    animation: badgeGlowPulse 2s infinite;
}

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

.secret-points-display {
    text-align: center;
    margin-top: 25px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.secret-points-display.show {
    opacity: 1;
    transform: translateY(0);
}

.secret-label {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: #888;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.secret-points {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    color: #00F0FF;
    font-weight: bold;
    text-shadow: 0 0 30px #00F0FF;
}

.secret-continue-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 30px auto 0;
    padding: 18px 40px;
    background: linear-gradient(135deg, #ff0040, #ff4466);
    border: none;
    border-radius: 50px;
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 0, 64, 0.5);
}

.secret-continue-btn.show {
    opacity: 1;
    transform: translateY(0);
}

.secret-continue-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 40px rgba(255, 0, 64, 0.8);
}

.secret-continue-btn i {
    font-size: 1.2rem;
}
