@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&display=swap');

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

body {
    background-color: #000000;
    color: #00ff41;
    font-family: 'Courier Prime', 'Courier New', monospace;
    min-height: 100vh;
    line-height: 1.6;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 65, 0.03) 2px,
            rgba(0, 255, 65, 0.03) 4px
        );
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    border: 2px solid #00ff41;
    border-radius: 10px;
    background: rgba(0, 255, 65, 0.05);
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #00ff41, #00cc33, #00ff41);
    border-radius: 10px;
    z-index: -1;
    animation: borderGlow 2s linear infinite;
}

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

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 0 0 10px #00ff41;
    animation: textGlow 3s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from { text-shadow: 0 0 10px #00ff41; }
    to { text-shadow: 0 0 20px #00ff41, 0 0 30px #00ff41; }
}

.challenge-id {
    font-size: 1.2em;
    opacity: 0.8;
}

.challenge-content {
    background: rgba(0, 255, 65, 0.03);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #00ff41;
}

.description {
    font-size: 1.2em;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-left: 4px solid #00ff41;
    border-radius: 5px;
}

.download-section {
    margin-bottom: 30px;
    text-align: center;
}

.download-btn {
    background: linear-gradient(45deg, #001100, #003300);
    color: #00ff41;
    border: 2px solid #00ff41;
    padding: 12px 24px;
    font-family: 'Courier Prime', monospace;
    font-size: 1em;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.download-btn:hover {
    background: linear-gradient(45deg, #003300, #005500);
    box-shadow: 0 0 15px #00ff41;
    transform: translateY(-2px);
}

.flag-section {
    margin-bottom: 30px;
}

#flagForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#flagInput {
    background: #000000;
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 15px;
    font-family: 'Courier Prime', monospace;
    font-size: 1.1em;
    border-radius: 5px;
    outline: none;
    transition: all 0.3s ease;
}

#flagInput:focus {
    box-shadow: 0 0 10px #00ff41;
    border-color: #00cc33;
}

#flagInput::placeholder {
    color: #006600;
}

.submit-btn {
    background: linear-gradient(45deg, #003300, #005500);
    color: #00ff41;
    border: 2px solid #00ff41;
    padding: 15px 30px;
    font-family: 'Courier Prime', monospace;
    font-size: 1.1em;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
}

.submit-btn:hover {
    background: linear-gradient(45deg, #005500, #007700);
    box-shadow: 0 0 20px #00ff41;
    transform: translateY(-2px);
}

.hint-section {
    border-top: 1px solid #00ff41;
    padding-top: 20px;
}

.hint-btn {
    background: linear-gradient(45deg, #110000, #330000);
    color: #ff4141;
    border: 2px solid #ff4141;
    padding: 12px 24px;
    font-family: 'Courier Prime', monospace;
    font-size: 1em;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.hint-btn:hover:not(:disabled) {
    background: linear-gradient(45deg, #330000, #550000);
    box-shadow: 0 0 15px #ff4141;
    transform: translateY(-2px);
}

.hint-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.hint-display {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #ffff41;
    border-radius: 5px;
    padding: 15px;
    margin-top: 15px;
    color: #ffff41;
    font-style: italic;
    display: none;
}

.hint-display.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cooldown-display {
    color: #ff4141;
    font-size: 0.9em;
    margin-top: 10px;
    text-align: center;
}

.success-page {
    text-align: center;
    padding: 40px;
}

.success-title {
    font-size: 3em;
    margin-bottom: 30px;
    text-shadow: 0 0 20px #00ff41;
    animation: celebration 2s ease-in-out infinite alternate;
}

@keyframes celebration {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

.success-message {
    font-size: 1.5em;
    margin-bottom: 20px;
    animation: textGlow 3s ease-in-out infinite alternate;
}

.ascii-art {
    margin-top: 40px;
    font-size: 0.8em;
    line-height: 1.2;
    text-shadow: 0 0 10px #00ff41;
}

/* Terminal-like typing effect */
.typing::after {
    content: '_';
    animation: blink 1s infinite;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .challenge-content {
        padding: 20px;
    }
    
    #flagForm {
        gap: 10px;
    }
    
    .success-title {
        font-size: 2em;
    }
    
    .success-message {
        font-size: 1.2em;
    }
}

/* Matrix-like background effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 255, 65, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 255, 65, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(0, 255, 65, 0.1) 0%, transparent 50%);
    z-index: -2;
    animation: matrixMove 10s ease-in-out infinite alternate;
}

@keyframes matrixMove {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-10px) rotate(0.5deg); }
}