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

body {
    font-family: 'Courier New', monospace;
    background: #000000;
    color: #000000;
    overflow: hidden;
    height: 100vh;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 10% 10%, #111111 0%, transparent 40%),
        radial-gradient(circle at 90% 90%, #0a0a0a 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, #080808 0%, transparent 60%),
        linear-gradient(135deg, #000000 0%, #050505 25%, #000000 50%, #020202 75%, #000000 100%);
    z-index: -1;
}

.background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
    animation: gridMove 30s linear infinite;
}

.background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.02) 0%, transparent 80%);
    animation: pulse 6s ease-in-out infinite alternate;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

@keyframes pulse {
    0% { opacity: 0.3; }
    100% { opacity: 0.8; }
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #000000;
    border-radius: 50%;
    animation: float 6s infinite linear;
    opacity: 0.4;
    box-shadow: 0 0 5px #ffffff, 0 0 10px rgba(255, 255, 255, 0.3);
}

.particle::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    animation: particleGlow 1.5s ease-in-out infinite alternate;
}

@keyframes particleGlow {
    0% { transform: scale(1); opacity: 0.3; }
    100% { transform: scale(1.5); opacity: 0.8; }
}

.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 8s;
}

.particle:nth-child(2) {
    left: 20%;
    animation-delay: 1s;
    animation-duration: 6s;
}

.particle:nth-child(3) {
    left: 30%;
    animation-delay: 2s;
    animation-duration: 7s;
}

.particle:nth-child(4) {
    left: 40%;
    animation-delay: 3s;
    animation-duration: 9s;
}

.particle:nth-child(5) {
    left: 50%;
    animation-delay: 4s;
    animation-duration: 5s;
}

.particle:nth-child(6) {
    left: 60%;
    animation-delay: 5s;
    animation-duration: 8s;
}

.particle:nth-child(7) {
    left: 70%;
    animation-delay: 6s;
    animation-duration: 6s;
}

.particle:nth-child(8) {
    left: 80%;
    animation-delay: 7s;
    animation-duration: 7s;
}

.particle:nth-child(9) {
    left: 90%;
    animation-delay: 8s;
    animation-duration: 9s;
}

.particle:nth-child(10) {
    left: 95%;
    animation-delay: 9s;
    animation-duration: 5s;
}

@keyframes float {
    0% {
        transform: translateY(100vh) scale(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    50% {
        transform: translateY(50vh) scale(1) rotate(180deg);
        opacity: 1;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100px) scale(0.5) rotate(360deg);
        opacity: 0;
    }
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    position: relative;
    z-index: 1;
}

.code-input-container {
    text-align: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 40px 30px;
    border-radius: 15px;
    border: 2px solid #444444;
    box-shadow: 
        0 0 30px rgba(0, 0, 0, 0.8),
        0 0 60px rgba(0, 0, 0, 0.6),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    width: 90%;
    max-width: 500px;
    min-width: 300px;
    position: relative;
    margin: 0 auto;
}

.title {
    font-size: clamp(20px, 5vw, 28px);
    margin-bottom: clamp(20px, 4vw, 40px);
    color: #ffffff;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.3),
        0 0 20px rgba(255, 255, 255, 0.1);
    letter-spacing: clamp(1px, 0.5vw, 3px);
    font-weight: bold;
    text-transform: uppercase;
}

.code-input {
    width: 100%;
    padding: clamp(15px, 3vw, 20px);
    font-size: clamp(16px, 4vw, 20px);
    background: #000000;
    border: 2px solid #666666;
    border-radius: 8px;
    color: #ffffff;
    text-align: center;
    font-family: 'Courier New', monospace;
    letter-spacing: clamp(1px, 0.5vw, 3px);
    outline: none;
    transition: all 0.4s ease;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 2px 8px rgba(0, 0, 0, 0.8);
    box-sizing: border-box;
}

.code-input:focus {
    box-shadow: 
        0 0 15px rgba(0, 123, 255, 0.5),
        0 0 30px rgba(0, 123, 255, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.7);
    border-color: #007bff;
    transform: scale(1.01);
}

.code-input::placeholder {
    color: #666666;
    letter-spacing: 2px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.join-button-container {
    margin-top: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.join-button-container.show {
    opacity: 1;
    transform: translateY(0);
}

.join-button {
    background: linear-gradient(135deg, #333333 0%, #1a1a1a 100%);
    border: 2px solid #666666;
    color: #ffffff;
    padding: clamp(12px, 2.5vw, 15px) clamp(30px, 6vw, 40px);
    font-size: clamp(14px, 3.5vw, 18px);
    font-family: 'Courier New', monospace;
    letter-spacing: clamp(1px, 0.5vw, 3px);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.4s ease;
    text-transform: uppercase;
    font-weight: bold;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    display: block;
}

.join-button:hover {
    background: linear-gradient(135deg, #0e0e0e 0%, #000000 100%);
    color: #ffffff;
    box-shadow: 
        0 6px 12px rgba(0, 123, 255, 0.4),
        0 0 20px rgba(0, 123, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
    border-color: #111111;
}

.join-button:active {
    transform: scale(0.95);
}

/* Дополнительные эффекты */
.code-input-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #000000, #0c0c0c, #131212);
    border-radius: 10px;
    z-index: -1;
    animation: borderGlow 2s linear infinite;
}

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

/* Анимация появления */
.code-input-container {
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Плавающие линии */
.floating-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ffffff, #ffffff, transparent);
    animation: lineFloat 8s infinite linear;
    opacity: 0.3;
    box-shadow: 0 0 5px #ffffff;
}

.floating-line:nth-child(16) {
    top: 20%;
    left: 0;
    width: 30%;
    animation-delay: 0s;
    animation-duration: 10s;
}

.floating-line:nth-child(17) {
    top: 40%;
    right: 0;
    width: 25%;
    animation-delay: 2s;
    animation-duration: 12s;
}

.floating-line:nth-child(18) {
    top: 60%;
    left: 0;
    width: 40%;
    animation-delay: 4s;
    animation-duration: 8s;
}

.floating-line:nth-child(19) {
    top: 80%;
    right: 0;
    width: 35%;
    animation-delay: 6s;
    animation-duration: 14s;
}

.floating-line:nth-child(20) {
    top: 10%;
    left: 50%;
    width: 20%;
    animation-delay: 8s;
    animation-duration: 6s;
}

@keyframes lineFloat {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Дополнительные эффекты для контейнера */
.code-input-container {
    position: relative;
    overflow: hidden;
}

.code-input-container::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, rgba(255, 255, 255, 0.05), transparent);
    animation: rotate 10s linear infinite;
    z-index: -1;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Таймер */
.timer-container {
    position: fixed;
    top: clamp(20px, 3vw, 30px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 90%;
    max-width: 400px;
}

/* GATE Таймер */
.gate-timer-container {
    position: fixed;
    top: clamp(140px, 20vw, 180px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 90%;
    max-width: 300px;
}

.gate-timer {
    display: flex;
    justify-content: center;
    align-items: center;
}

.gate-square {
    position: relative;
    width: auto;
    height: auto;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid #666666;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 
        0 0 20px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(0, 0, 0, 0.6),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.gate-text {
    color: #ffffff;
    font-size: clamp(20px, 5vw, 32px);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.3),
        0 0 20px rgba(255, 255, 255, 0.1);
    letter-spacing: clamp(3px, 0.8vw, 6px);
    text-transform: uppercase;
}

.timer {
    display: flex;
    justify-content: center;
    align-items: center;
}

.timer-circle {
    position: relative;
    width: clamp(80px, 15vw, 120px);
    height: clamp(80px, 15vw, 120px);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid #333333;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 
        0 0 20px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(0, 0, 0, 0.6),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.timer-progress {
    position: absolute;
    top: -3px;
    left: -3px;
    width: clamp(80px, 15vw, 120px);
    height: clamp(80px, 15vw, 120px);
    border-radius: 50%;
    background: conic-gradient(from 0deg, #111111, #0f0f0f 0%, transparent 0%);
    animation: timerCountdown 252000s linear forwards;
    z-index: -1;
}

.timer-text {
    color: #ffffff;
    font-size: clamp(14px, 3vw, 20px);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.3),
        0 0 20px rgba(255, 255, 255, 0.1);
    letter-spacing: clamp(0.5px, 0.2vw, 1px);
}

@keyframes timerCountdown {
    0% {
        background: conic-gradient(from 0deg, #0a0a0a, #000000 100%, transparent 100%);
    }
    100% {
        background: conic-gradient(from 0deg, #000000, #000000 0%, transparent 0%);
    }
}

/* Счетчик денег */
.money-counter {
    position: fixed;
    bottom: clamp(10px, 2vw, 15px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    text-align: center;
    width: 90%;
    max-width: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    padding: clamp(8px, 1.5vw, 12px) clamp(15px, 3vw, 20px);
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #333333;
    border-radius: 10px;
    box-shadow: 
        0 0 20px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(0, 0, 0, 0.6),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.money-symbol {
    color: #747474;
    font-size: clamp(20px, 5vw, 32px);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-shadow: 
        0 0 10px #333333,
        0 0 20px rgba(0, 255, 0, 0.5);
    margin-right: clamp(5px, 1.5vw, 10px);
}

.money-amount {
    color: #797a79;
    font-size: clamp(18px, 4.5vw, 28px);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-shadow: 
        0 0 10px #000000,
        0 0 20px rgba(219, 219, 219, 0.5);
    letter-spacing: clamp(1px, 0.3vw, 2px);
}

/* Анимация для счетчика денег */
.money-counter {
    animation: moneyGlow 2s ease-in-out infinite alternate;
}

@keyframes moneyGlow {
    0% {
        box-shadow: 
            0 0 20px rgba(49, 49, 49, 0.3),
            0 0 40px rgba(51, 51, 51, 0.1),
            inset 0 0 20px rgba(0, 255, 0, 0.05);
    }
    100% {
        box-shadow: 
            0 0 30px rgba(1, 8, 1, 0.5),
            0 0 60px rgba(80, 80, 80, 0.2),
            inset 0 0 20px rgba(0, 255, 0, 0.1);
    }
}

/* Медиа-запросы для адаптивности */
@media (max-width: 768px) {
    .code-input-container {
        padding: 30px 20px;
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .timer-container {
        top: 15px;
        width: 95%;
    }
    
    .gate-timer-container {
        top: 120px;
        width: 95%;
    }
    
    .money-counter {
        bottom: 8px;
        width: 95%;
        padding: 8px 12px;
    }
    
    .join-button {
        padding: 12px 25px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .code-input-container {
        padding: 25px 15px;
        margin: 15px;
        width: calc(100% - 30px);
        min-width: 280px;
    }
    
    .timer-container {
        top: 10px;
        width: 98%;
    }
    
    .gate-timer-container {
        top: 100px;
        width: 98%;
    }
    
    .gate-square {
        padding: 8px 16px;
    }
    
    .gate-text {
        font-size: 16px;
    }
    
    .money-counter {
        bottom: 5px;
        width: 90%;
        padding: 6px 10px;
    }
    
    .join-button {
        padding: 10px 20px;
        font-size: 14px;
        max-width: 150px;
    }
    
    .code-input {
        padding: 12px;
        font-size: 16px;
    }
}

/* Анимация пульсации для таймера */
.timer-circle::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 2px solid #4b4b4b;
    opacity: 0;
    animation: timerPulse 2s ease-in-out infinite;
}

@keyframes timerPulse {
    0% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

/* Эффект при окончании времени */
.timer.warning .timer-progress {
    background: conic-gradient(from 0deg, #ff4444, #ff4444 0%, transparent 0%);
    animation: timerWarning 1s ease-in-out infinite alternate;
}

.timer.warning .timer-circle {
    border-color: #ff4444;
    box-shadow: 
        0 0 20px rgba(255, 68, 68, 0.5),
        0 0 40px rgba(255, 68, 68, 0.3),
        inset 0 0 20px rgba(255, 68, 68, 0.1);
}

.timer.warning .timer-text {
    color: #ff4444;
    text-shadow: 
        0 0 10px rgba(255, 68, 68, 0.5),
        0 0 20px rgba(255, 68, 68, 0.3);
}

@keyframes timerWarning {
    0% {
        opacity: 0.8;
    }
    100% {
        opacity: 1;
    }
}
