@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Courier+Prime:wght@400;700&display=swap');

:root {
    --primary-color: #d4a574;
    --secondary-color: #8b6f47;
    --dark-bg: #1a1410;
    --paper-bg: #f4e8d8;
    --text-dark: #2c1810;
    --text-light: #f4e8d8;
    --gold: #ffd700;
    --shadow: rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cinzel', serif;
    background: var(--dark-bg);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Da Vinci Pattern Background */
.da-vinci-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 35px,
            rgba(212, 165, 116, 0.03) 35px,
            rgba(212, 165, 116, 0.03) 70px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 35px,
            rgba(212, 165, 116, 0.03) 35px,
            rgba(212, 165, 116, 0.03) 70px
        );
    opacity: 0.5;
    animation: patternMove 60s linear infinite;
}

@keyframes patternMove {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(70px) translateY(70px); }
}

/* Particles Canvas */
#particlesCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Main Content */
.content {
    position: relative;
    z-index: 10;
    max-width: 600px;
    width: 100%;
    text-align: center;
}

/* Title */
.title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px var(--shadow);
    animation: titleGlow 3s ease-in-out infinite;
}

.title .icon {
    display: inline-block;
    animation: iconFloat 3s ease-in-out infinite;
}

.title .icon:last-child {
    animation-delay: 1.5s;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 2px 2px 4px var(--shadow); }
    50% { text-shadow: 2px 2px 20px var(--gold), 2px 2px 4px var(--shadow); }
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 3rem;
    font-style: italic;
}

/* Code Container */
.code-container {
    background: var(--paper-bg);
    border: 3px solid var(--primary-color);
    border-radius: 15px;
    padding: 3rem 2rem;
    box-shadow: 
        0 10px 40px var(--shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.code-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(139, 111, 71, 0.05) 2px,
            rgba(139, 111, 71, 0.05) 4px
        );
    pointer-events: none;
}

.code-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

.lock-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: lockShake 0.5s ease-in-out;
}

.lock-icon.unlocked {
    animation: unlockSpin 1s ease-in-out;
}

@keyframes lockShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

@keyframes unlockSpin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.3); }
    100% { transform: rotate(360deg) scale(1); }
}

.code-display {
    font-family: 'Courier Prime', monospace;
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 0.8rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.5);
    border: 2px dashed var(--secondary-color);
    border-radius: 10px;
    display: inline-block;
    min-width: 90%;
    word-break: break-all;
}

.code-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(-20px) rotateX(90deg);
    animation: none;
}

.code-char.revealed {
    animation: revealChar 0.8s ease-out forwards;
}

@keyframes revealChar {
    0% {
        opacity: 0;
        transform: translateY(-30px) rotateX(90deg) scale(0.5);
    }
    50% {
        opacity: 0.5;
        transform: translateY(10px) rotateX(-10deg) scale(1.2);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0deg) scale(1);
    }
}

.code-char.hidden {
    opacity: 1;
    animation: none;
}

/* Reveal Button */
.reveal-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    border: none;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(212, 165, 116, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.reveal-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.reveal-btn:hover::before {
    width: 300px;
    height: 300px;
}

.reveal-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(212, 165, 116, 0.6);
}

.reveal-btn:active {
    transform: translateY(-1px);
}

.reveal-btn:disabled {
    background: #666;
    cursor: not-allowed;
    box-shadow: none;
}

.reveal-btn:disabled:hover {
    transform: none;
}

.btn-text,
.btn-icon {
    position: relative;
    z-index: 1;
}

.btn-icon {
    margin-left: 0.5rem;
    display: inline-block;
    animation: iconSparkle 2s ease-in-out infinite;
}

@keyframes iconSparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(-10deg); }
    75% { transform: scale(1.2) rotate(10deg); }
}

/* Statistics */
.stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(26, 20, 16, 0.6);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    border: 2px solid var(--primary-color);
    min-width: 150px;
}

.stat-item.online {
    border-color: #4caf50;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.stat-item.online .stat-label {
    color: #4caf50;
}

.online-dot {
    width: 10px;
    height: 10px;
    background: #4caf50;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
        transform: scale(1.1);
    }
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
}

.stat-item.online .stat-value {
    color: #4caf50;
}

/* Message */
.message {
    margin-top: 2rem;
    padding: 1rem;
    border-radius: 10px;
    font-size: 1.1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.message.show {
    opacity: 1;
    transform: translateY(0);
}

.message.success {
    background: rgba(76, 175, 80, 0.2);
    border: 2px solid #4caf50;
    color: #4caf50;
}

.message.error {
    background: rgba(244, 67, 54, 0.2);
    border: 2px solid #f44336;
    color: #f44336;
}

/* Responsive */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .code-display {
        font-size: 2.5rem;
        letter-spacing: 0.4rem;
        min-width: 100%;
        padding: 1.5rem 1rem;
    }
    
    .stats {
        flex-direction: row;
        gap: 1rem;
        justify-content: center;
    }
    
    .stat-item {
        min-width: 120px;
        padding: 0.8rem 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .reveal-btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    
    .code-container {
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .code-display {
        font-size: 2rem;
        letter-spacing: 0.3rem;
        padding: 1rem 0.5rem;
    }
    
    .lock-icon {
        font-size: 2.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-item {
        flex: 1;
        min-width: 100px;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
}