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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    background: #fff;
}

.loader-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #f8f9ff 0%, #ffffff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loader-screen.hide {
    opacity: 0;
    visibility: hidden;
}

.loader-wrapper {
    perspective: 1000px;
}

.orbit-container {
    position: relative;
    width: 200px;
    height: 200px;
    transform-style: preserve-3d;
    animation: rotate3d 20s linear infinite;
}

@keyframes rotate3d {
    0% {
        transform: rotateY(0deg) rotateX(0deg);
    }
    100% {
        transform: rotateY(360deg) rotateX(360deg);
    }
}

.orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 4px solid;
    border-radius: 50%;
    transform-style: preserve-3d;
    filter: drop-shadow(0 0 10px currentColor);
}

.orbit-1 {
    width: 180px;
    height: 180px;
    margin: -90px 0 0 -90px;
    border-color: #667eea transparent transparent transparent;
    animation: orbit1 3s linear infinite;
}

.orbit-2 {
    width: 140px;
    height: 140px;
    margin: -70px 0 0 -70px;
    border-color: transparent #764ba2 transparent transparent;
    animation: orbit2 2s linear infinite reverse;
}

.orbit-3 {
    width: 100px;
    height: 100px;
    margin: -50px 0 0 -50px;
    border-color: transparent transparent #667eea transparent;
    animation: orbit3 2.5s linear infinite;
}

@keyframes orbit1 {
    0% { transform: rotateZ(0deg) rotateY(60deg); }
    100% { transform: rotateZ(360deg) rotateY(60deg); }
}

@keyframes orbit2 {
    0% { transform: rotateZ(0deg) rotateX(60deg); }
    100% { transform: rotateZ(360deg) rotateX(60deg); }
}

@keyframes orbit3 {
    0% { transform: rotateZ(0deg) rotateY(-60deg); }
    100% { transform: rotateZ(360deg) rotateY(-60deg); }
}

.center-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90px;
    height: 90px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 10;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.08);
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    }
}

.center-logo img {
    width: 65px;
    height: 65px;
    object-fit: contain;
    border-radius: 15px;
}

.error-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1.5rem;
    overflow: hidden;
}

.error-content {
    text-align: center;
    color: #fff;
    max-width: 650px;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 2;
}

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

.glitch-wrapper {
    margin-bottom: 2rem;
}

.glitch {
    font-size: 10rem;
    font-weight: 900;
    line-height: 1;
    color: #fff;
    position: relative;
    animation: glitch-skew 1s infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00de;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9, 2px 2px #ff00de;
    animation: glitch-anim2 1s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(10px, 9999px, 31px, 0); }
    20% { clip: rect(70px, 9999px, 71px, 0); }
    40% { clip: rect(121px, 9999px, 131px, 0); }
    60% { clip: rect(41px, 9999px, 60px, 0); }
    80% { clip: rect(20px, 9999px, 105px, 0); }
    100% { clip: rect(90px, 9999px, 110px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 119px, 0); }
    20% { clip: rect(90px, 9999px, 40px, 0); }
    40% { clip: rect(10px, 9999px, 99px, 0); }
    60% { clip: rect(85px, 9999px, 90px, 0); }
    80% { clip: rect(50px, 9999px, 120px, 0); }
    100% { clip: rect(60px, 9999px, 70px, 0); }
}

@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    10% { transform: skew(-2deg); }
    20% { transform: skew(2deg); }
    30% { transform: skew(0deg); }
    100% { transform: skew(0deg); }
}

.error-title {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.error-desc {
    font-size: 1.2rem;
    margin-bottom: 3rem;
    opacity: 0.95;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
}

.btn-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.primary-btn {
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    color: #1e3c72;
    border: none;
    padding: 1.1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.primary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.primary-btn:hover::before {
    left: 100%;
}

.primary-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
}

.primary-btn:active {
    transform: translateY(-2px) scale(1.02);
}

.primary-btn svg {
    transition: transform 0.3s ease;
}

.primary-btn:hover svg {
    transform: translateX(5px);
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: float 3s infinite ease-in-out;
}

.particle:nth-child(1) {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
    animation-duration: 4s;
}

.particle:nth-child(2) {
    top: 60%;
    left: 80%;
    animation-delay: 1s;
    animation-duration: 5s;
}

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

.particle:nth-child(4) {
    top: 40%;
    left: 70%;
    animation-delay: 0.5s;
    animation-duration: 4.5s;
}

.particle:nth-child(5) {
    top: 10%;
    left: 50%;
    animation-delay: 1.5s;
    animation-duration: 3.5s;
}

.particle:nth-child(6) {
    top: 70%;
    left: 10%;
    animation-delay: 2.5s;
    animation-duration: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-30px) scale(1.5);
        opacity: 1;
    }
}

.maintenance-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1.5rem;
    overflow: hidden;
}

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

.stars::before,
.stars::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    box-shadow: 
        100px 200px #fff, 200px 100px #fff, 300px 300px #fff,
        400px 150px #fff, 150px 400px #fff, 500px 250px #fff,
        50px 350px #fff, 350px 50px #fff, 250px 450px #fff,
        450px 350px #fff, 180px 280px #fff, 320px 180px #fff,
        80px 120px #fff, 420px 380px #fff, 280px 80px #fff,
        380px 420px #fff, 120px 480px #fff, 480px 120px #fff;
    animation: twinkle 3s infinite ease-in-out;
}

.stars::after {
    animation-delay: 1.5s;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.maintenance-content {
    text-align: center;
    color: #fff;
    max-width: 650px;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 2;
}

.icon-circle {
    width: 160px;
    height: 160px;
    margin: 0 auto 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
    }
}

.main-icon {
    animation: tick 2s ease-in-out infinite;
}

@keyframes tick {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    75% { transform: rotate(-15deg); }
}

.main-title {
    font-size: 3.25rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -1.5px;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    line-height: 1.1;
}

.divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    margin: 0 auto 2rem;
    border-radius: 2px;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.main-desc {
    font-size: 1.3rem;
    margin-bottom: 3rem;
    opacity: 0.92;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 1.15rem 3rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s;
}

.action-btn:hover::before {
    left: 100%;
}

.action-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.6);
}

.action-btn:active {
    transform: translateY(-2px) scale(1.02);
}

.action-btn svg {
    animation: rotate-refresh 2s linear infinite;
}

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

.hidden {
    display: none !important;
}

#content-frame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#content-frame.loaded {
    opacity: 1;
    visibility: visible;
}

#content-frame.error-state {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
}

@media (max-width: 768px) {
    .orbit-container {
        width: 160px;
        height: 160px;
    }
    
    .orbit-1 {
        width: 150px;
        height: 150px;
        margin: -75px 0 0 -75px;
    }
    
    .orbit-2 {
        width: 115px;
        height: 115px;
        margin: -57.5px 0 0 -57.5px;
    }
    
    .orbit-3 {
        width: 80px;
        height: 80px;
        margin: -40px 0 0 -40px;
    }
    
    .center-logo {
        width: 75px;
        height: 75px;
    }
    
    .center-logo img {
        width: 55px;
        height: 55px;
    }
    
    .orbit {
        border-width: 3px;
    }
    
    .glitch {
        font-size: 6rem;
    }
    
    .error-title {
        font-size: 2rem;
    }
    
    .error-desc {
        font-size: 1.05rem;
        margin-bottom: 2.5rem;
    }
    
    .primary-btn {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    .icon-circle {
        width: 130px;
        height: 130px;
        margin-bottom: 2rem;
    }
    
    .main-icon {
        width: 60px;
        height: 60px;
    }
    
    .main-title {
        font-size: 2.5rem;
    }
    
    .main-desc {
        font-size: 1.15rem;
        margin-bottom: 2.5rem;
    }
    
    .action-btn {
        padding: 1rem 2.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .orbit-container {
        width: 140px;
        height: 140px;
    }
    
    .orbit-1 {
        width: 130px;
        height: 130px;
        margin: -65px 0 0 -65px;
        border-width: 2px;
    }
    
    .orbit-2 {
        width: 100px;
        height: 100px;
        margin: -50px 0 0 -50px;
        border-width: 2px;
    }
    
    .orbit-3 {
        width: 70px;
        height: 70px;
        margin: -35px 0 0 -35px;
        border-width: 2px;
    }
    
    .center-logo {
        width: 65px;
        height: 65px;
    }
    
    .center-logo img {
        width: 48px;
        height: 48px;
    }
    
    .glitch {
        font-size: 4.5rem;
    }
    
    .error-title {
        font-size: 1.6rem;
    }
    
    .error-desc {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .primary-btn {
        padding: 0.9rem 1.75rem;
        font-size: 0.95rem;
    }
    
    .icon-circle {
        width: 110px;
        height: 110px;
        margin-bottom: 1.5rem;
    }
    
    .main-icon {
        width: 50px;
        height: 50px;
    }
    
    .main-title {
        font-size: 1.9rem;
    }
    
    .main-desc {
        font-size: 1.05rem;
        margin-bottom: 2rem;
    }
    
    .action-btn {
        padding: 0.95rem 2rem;
        font-size: 0.95rem;
    }
}
