* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #533483 75%, #7209b7 100%);
    background-attachment: fixed;
    font-family: 'Open Sans', sans-serif;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 118, 117, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 204, 112, 0.3) 0%, transparent 50%);
    animation: backgroundPulse 8s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes backgroundPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: float 15s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Language Selector */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.lang-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 8px 16px;
    margin: 0 5px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

.lang-btn.active {
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    border-color: transparent;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
}

/* Main Container */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 2;
}

.form-container {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 500px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.form-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    animation: shimmer 3s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Game Title */
.game-title {
    text-align: center;
    margin-bottom: 30px;
}

.game-title h1 {
    font-family: 'Cinzel', serif;
    font-size: 3em;
    font-weight: 600;
    background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: goldShine 2s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

@keyframes goldShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    font-size: 1.2em;
    color: #b8b8b8;
    margin-top: 10px;
    font-weight: 300;
}

/* Registration Form */
.registration-form {
    display: flex;
    flex-direction: column;
}

.form-section h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.5em;
    margin-bottom: 25px;
    color: #ffd700;
    text-align: center;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    z-index: 3;
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 50px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1em;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.input-group input:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Register Button */
.register-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24, #ff6b6b);
    background-size: 200% 200%;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    color: white;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.register-btn:hover {
    animation: buttonGlow 1.5s ease-in-out infinite;
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.5);
}

@keyframes buttonGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.btn-effect {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.register-btn:hover .btn-effect {
    left: 100%;
}

.register-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.register-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}



/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(30, 30, 46, 0.9));
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.4s ease;
    text-align: center;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    margin-bottom: 20px;
}

.modal-icon {
    font-size: 4em;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
}

.success-icon {
    animation: successPulse 1s ease-in-out infinite;
}

.error-icon {
    animation: errorShake 0.5s ease-in-out 3;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.modal-header h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.8em;
    margin: 0;
}

.modal.success .modal-header h3 {
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.modal.error .modal-header h3 {
    color: #ff4757;
    text-shadow: 0 0 10px rgba(255, 71, 87, 0.5);
}

.modal-body {
    margin-bottom: 25px;
    line-height: 1.6;
    color: #e0e0e0;
}

.modal-btn {
    background: linear-gradient(45deg, #4834d4, #686de0);
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
}

.modal-btn:hover {
    background: linear-gradient(45deg, #5742d4, #7d7de0);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 52, 212, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-container {
        padding: 30px 20px;
    }
    
    .game-title h1 {
        font-size: 2em;
    }
    
    .language-selector {
        top: 10px;
        right: 10px;
    }
    
    .lang-btn {
        padding: 6px 12px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .form-container {
        padding: 20px 15px;
    }
    
    .game-title h1 {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .modal-content {
        padding: 20px;
        width: 95%;
    }
}

/* Additional magical effects */
.input-group input:focus + .input-icon {
    animation: iconGlow 0.3s ease;
}

@keyframes iconGlow {
    0% { filter: drop-shadow(0 0 0 transparent); }
    100% { filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8)); }
}