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

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    overflow-x: hidden;
    position: relative;
}

/* Основные стили страниц ошибок */
.error-page {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    width: 100%;
    text-align: center;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h1 {
    font-size: 8rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.1);
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
    opacity: 0.9;
}

.home-btn {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid rgba(255,255,255,0.3);
}

.home-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Стили для юридического футера */
.legal-footer {
    margin-top: auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.legal-info {
    max-width: 600px;
    margin: 0 auto;
    font-size: 0.8rem;
    line-height: 1.4;
    opacity: 0.8;
}

.legal-info p {
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.legal-info a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
}

.legal-info a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Анимация для 503 - Технические работы */
.maintenance-animation {
    margin: 0 auto 3rem;
    width: 200px;
    height: 200px;
    position: relative;
}

.tools {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.tool {
    position: absolute;
    background: #fff;
    animation: tool-float 4s ease-in-out infinite;
}

.wrench {
    width: 40px;
    height: 8px;
    top: 30px;
    left: 30px;
    border-radius: 4px;
    animation-delay: 0s;
}

.wrench:before {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    background: #fff;
    border-radius: 50%;
    top: -3px;
    left: -5px;
}

.screwdriver {
    width: 50px;
    height: 6px;
    top: 80px;
    right: 40px;
    border-radius: 3px;
    animation-delay: 1s;
}

.screwdriver:before {
    content: '';
    position: absolute;
    width: 8px;
    height: 20px;
    background: #fff;
    border-radius: 4px;
    top: -7px;
    left: -4px;
}

.hammer {
    width: 35px;
    height: 8px;
    bottom: 50px;
    left: 50px;
    border-radius: 4px;
    animation-delay: 2s;
}

.hammer:before {
    content: '';
    position: absolute;
    width: 12px;
    height: 25px;
    background: #fff;
    border-radius: 6px;
    top: -8px;
    right: -3px;
}

.gear {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    margin: -40px 0 0 -40px;
    background: #fff;
    border-radius: 50%;
    animation: gear-rotate 6s linear infinite;
}

.tooth {
    position: absolute;
    width: 15px;
    height: 30px;
    background: #667eea;
    top: -10px;
    left: 50%;
    margin-left: -7.5px;
    border-radius: 5px;
}

.tooth:nth-child(1) { transform: rotate(0deg); }
.tooth:nth-child(2) { transform: rotate(45deg); }
.tooth:nth-child(3) { transform: rotate(90deg); }
.tooth:nth-child(4) { transform: rotate(135deg); }
.tooth:nth-child(5) { transform: rotate(180deg); }
.tooth:nth-child(6) { transform: rotate(225deg); }
.tooth:nth-child(7) { transform: rotate(270deg); }
.tooth:nth-child(8) { transform: rotate(315deg); }

.sparks {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    margin: -50px 0 0 -50px;
}

.spark {
    position: absolute;
    width: 4px;
    height: 15px;
    background: #ffeb3b;
    border-radius: 2px;
    animation: spark-fly 2s ease-in-out infinite;
}

.spark:nth-child(1) {
    top: 20px;
    left: 30px;
    animation-delay: 0s;
}

.spark:nth-child(2) {
    top: 60px;
    right: 25px;
    animation-delay: 0.5s;
}

.spark:nth-child(3) {
    bottom: 30px;
    left: 40px;
    animation-delay: 1s;
}

.countdown {
    margin: 2rem 0;
    padding: 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.countdown-text {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.timer {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

.timer.finished {
    color: #4CAF50;
    animation: pulse 1s infinite;
}

@keyframes tool-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(5deg); }
    75% { transform: translateY(5px) rotate(-5deg); }
}

@keyframes gear-rotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes spark-fly {
    0%, 100% { 
        opacity: 0;
        transform: translateY(0) scale(1);
    }
    50% { 
        opacity: 1;
        transform: translateY(-20px) scale(1.2);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Анимация для 404 - Призрак */
.ghost-animation {
    margin: 0 auto 3rem;
    width: 150px;
    height: 180px;
    position: relative;
}

.ghost {
    width: 100%;
    height: 100%;
    animation: float 3s ease-in-out infinite;
    position: relative;
}

.ghost:before, .ghost:after {
    content: '';
    position: absolute;
    background: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    top: 25px;
}

.ghost:before {
    left: 25px;
}

.ghost:after {
    right: 25px;
}

.face {
    position: absolute;
    width: 100%;
    top: 40px;
}

.eyes {
    display: flex;
    justify-content: space-around;
    padding: 0 30px;
}

.eye {
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    animation: blink 4s infinite;
}

.mouth {
    width: 30px;
    height: 10px;
    background: #667eea;
    margin: 20px auto 0;
    border-radius: 0 0 10px 10px;
}

.shadow {
    width: 100px;
    height: 20px;
    background: rgba(0,0,0,0.2);
    border-radius: 50%;
    margin: 30px auto 0;
    animation: scale 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes scale {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.8); }
}

@keyframes blink {
    0%, 95%, 100% { transform: scaleY(1); }
    97% { transform: scaleY(0.1); }
}

/* Анимация для 500 - Сервер */
.server-animation {
    margin: 0 auto 3rem;
    width: 120px;
    height: 180px;
    position: relative;
}

.server {
    width: 100px;
    height: 150px;
    background: #fff;
    border-radius: 10px;
    position: relative;
    margin: 0 auto;
}

.rack {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
}

.led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4CAF50;
    animation: blink-red 1s infinite;
}

.led:nth-child(2) {
    animation-delay: 0.2s;
}

.led:nth-child(3) {
    animation-delay: 0.4s;
}

.smoke {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
}

.smoke span {
    display: block;
    position: absolute;
    height: 0px;
    width: 0px;
    border: 20px solid #fff;
    border-radius: 50%;
    left: -20px;
    opacity: 0;
}

.smoke span:nth-child(1) {
    animation: smoke 4s infinite;
}
.smoke span:nth-child(2) {
    animation: smoke 4s 0.5s infinite;
}
.smoke span:nth-child(3) {
    animation: smoke 4s 1s infinite;
}
.smoke span:nth-child(4) {
    animation: smoke 4s 1.5s infinite;
}
.smoke span:nth-child(5) {
    animation: smoke 4s 2s infinite;
}

@keyframes blink-red {
    0%, 100% { background: #ff5252; }
    50% { background: #4CAF50; }
}

@keyframes smoke {
    0% { transform: scale(0.2); opacity: 0; }
    20% { opacity: 0.3; }
    100% { transform: scale(2); opacity: 0; }
}

/* Анимация для 403 - Замок */
.lock-animation {
    margin: 0 auto 3rem;
    width: 120px;
    height: 150px;
}

.lock {
    position: relative;
    width: 80px;
    height: 70px;
    background: #fff;
    border-radius: 15px;
    margin: 0 auto;
    animation: shake 0.5s ease-in-out infinite alternate;
}

.lock:before {
    content: '';
    position: absolute;
    width: 20px;
    height: 30px;
    background: #fff;
    top: -30px;
    left: 30px;
    border-radius: 5px 5px 0 0;
}

.lock:after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: #764ba2;
    border-radius: 50%;
    top: -20px;
    left: 35px;
}

.top {
    position: absolute;
    width: 20px;
    height: 30px;
    background: #764ba2;
    top: -30px;
    left: 30px;
    border-radius: 5px 5px 0 0;
    animation: unlock 2s infinite;
}

.bottom {
    position: absolute;
    width: 60px;
    height: 40px;
    background: #667eea;
    border-radius: 10px;
    top: 15px;
    left: 10px;
}

@keyframes shake {
    0% { transform: translateX(-2px); }
    100% { transform: translateX(2px); }
}

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

/* Адаптивность */
@media (max-width: 768px) {
    h1 {
        font-size: 6rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    p {
        font-size: 1rem;
    }
    
    .legal-info {
        font-size: 0.7rem;
        padding: 0 10px;
    }
    
    .legal-info p {
        margin-bottom: 0.3rem;
    }
    
    .timer {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 5rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .legal-info {
        font-size: 0.65rem;
    }
    
    .legal-info p {
        line-height: 1.3;
    }
    
    .ghost-animation,
    .server-animation,
    .lock-animation,
    .maintenance-animation {
        transform: scale(0.8);
    }
    
    .timer {
        font-size: 1.8rem;
    }
}