* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    overflow-x: hidden;
    background: #0a0e27;
    color: white;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.loading-screen.fade-out {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
}

.loader {
    position: relative;
    width: 150px;
    height: 150px;
}

.game-loader {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.game-loader::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 4px solid transparent;
    border-top-color: #f39c12;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.game-loader::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 4px solid transparent;
    border-top-color: #2ecc71;
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 30px;
    font-size: 1.5rem;
    font-weight: bold;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin-top: 20px;
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    background: linear-gradient(90deg, #fff, #f39c12, #2ecc71);
    width: 0%;
    animation: loadProgress 2s ease-in-out forwards;
    border-radius: 10px;
}

@keyframes loadProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.main-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.5s ease 0.3s;
    overflow-y: auto;
}

.main-page.show {
    opacity: 1;
}

.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.game-particle {
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    animation: float 20s infinite;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

.header {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 60px 20px 40px;
    animation: slideDown 1s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portal-title {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #fff, #f39c12, #2ecc71, #3498db);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.portal-subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.games-container {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    animation: fadeInUp 1s ease-out 0.3s backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    transition: all 0.4s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.game-card:hover::before {
    opacity: 1;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
}

.game-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
    position: relative;
    z-index: 1;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

.game-card:nth-child(1) .game-icon { color: #2ecc71; animation-delay: 0s; }
.game-card:nth-child(2) .game-icon { color: #3498db; animation-delay: 0.2s; }
.game-card:nth-child(3) .game-icon { color: #e74c3c; animation-delay: 0.4s; }
.game-card:nth-child(4) .game-icon { color: #f39c12; animation-delay: 0.6s; }
.game-card:nth-child(5) .game-icon { color: #9b59b6; animation-delay: 0.8s; }

.game-title {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.game-description {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 20px;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.play-btn {
    padding: 12px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    background: linear-gradient(45deg, #f39c12, #e74c3c);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.play-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 ease;
}

.play-btn:hover::before {
    left: 100%;
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(231, 76, 60, 0.4);
}

.coming-soon {
    background: linear-gradient(45deg, #95a5a6, #7f8c8d);
    cursor: not-allowed;
}

.coming-soon:hover {
    transform: none;
    box-shadow: none;
}

.badge-status {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 2;
}

.badge-available {
    background: linear-gradient(45deg, #2ecc71, #27ae60);
}

.badge-coming {
    background: linear-gradient(45deg, #e67e22, #d35400);
}

.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.transition-overlay.active {
    display: flex;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        clip-path: circle(0% at 50% 50%);
    }
    to {
        clip-path: circle(150% at 50% 50%);
    }
}

.transition-text {
    font-size: 3rem;
    font-weight: bold;
    margin-top: 30px;
    animation: zoomIn 0.5s ease-out;
}

@keyframes zoomIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.footer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 30px 20px;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .portal-title {
        font-size: 2.5rem;
    }

    .portal-subtitle {
        font-size: 1.1rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .game-icon {
        font-size: 3rem;
    }

    .game-title {
        font-size: 1.5rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}