<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Under Maintenance | Game Portal</title>
    <link rel="icon" type="image/png" href="/favicon.png">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Orbitron:wght@500;600;700;800&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --bg-primary: #0f0a0a;
            --text-primary: #ffffff;
            --text-secondary: #a8a29e;
            --accent-primary: #f59e0b;
            --accent-secondary: #d97706;
        }

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

        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--bg-primary);
            color: var(--text-primary);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow-y: auto;
            overflow-x: hidden;
            position: relative;
            padding: 2rem;
        }

        /* Animated Background */
        .bg-gradient {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: radial-gradient(
                circle at 20% 30%, 
                rgba(255, 100, 50, 0.25) 0%, 
                transparent 60%
            ),
            radial-gradient(
                circle at 80% 70%, 
                rgba(255, 180, 0, 0.2) 0%, 
                transparent 60%
            ),
            linear-gradient(
                135deg,
                #0a0505 0%,
                #1a0f0f 100%
            );
            z-index: -2;
            animation: gradientShift 8s ease-in-out infinite alternate;
            background-size: 150% 150%;
        }

        .bg-grid {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image: 
                linear-gradient(rgba(255, 80, 0, 0.1) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255, 80, 0, 0.1) 1px, transparent 1px);
            background-size: 40px 40px;
            z-index: -1;
            animation: gridMove 25s linear infinite;
            perspective: 1000px;
            transform-style: preserve-3d;
        }

        .container {
            text-align: center;
            padding: 3rem 2.5rem;
            width: 100%;
            max-width: 580px;
            margin: auto;
            background: rgba(20, 10, 10, 0.8);
            backdrop-filter: blur(30px) saturate(180%);
            border: 1px solid rgba(255, 100, 50, 0.3);
            border-radius: 32px;
            box-shadow: 
                0 0 0 1px rgba(255, 100, 50, 0.1),
                0 30px 60px rgba(0, 0, 0, 0.8),
                0 0 120px rgba(255, 80, 0, 0.15);
            position: relative;
            animation: fadeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1);
            z-index: 10;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .container::before {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: 32px;
            padding: 2px;
            background: linear-gradient(135deg, #ff4d00, #ffcc00, #ff4d00);
            -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            pointer-events: none;
            opacity: 0.6;
        }

        .icon-wrapper {
            font-size: 4.5rem;
            margin-bottom: 1.5rem;
            background: linear-gradient(135deg, #ffcc00 0%, #ff3300 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            filter: drop-shadow(0 10px 20px rgba(255, 60, 0, 0.3));
            animation: float 5s ease-in-out infinite;
        }

        h1 {
            font-family: 'Orbitron', sans-serif;
            font-size: 2.25rem;
            font-weight: 900;
            margin-bottom: 1rem;
            background: linear-gradient(135deg, #ffffff 20%, #ffcc00 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            text-transform: uppercase;
            letter-spacing: 2px;
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
            line-height: 1.2;
        }

        .status-badge {
            display: inline-block;
            padding: 0.5rem 1.2rem;
            background: rgba(245, 158, 11, 0.15);
            border: 1px solid rgba(245, 158, 11, 0.3);
            color: #fbbf24;
            border-radius: 50px;
            font-size: 0.85rem;
            font-weight: 700;
            margin-bottom: 1.5rem;
            letter-spacing: 1px;
            text-transform: uppercase;
            box-shadow: 0 0 15px rgba(245, 158, 11, 0.1);
        }

        p {
            color: var(--text-secondary);
            font-size: 1.1rem;
            line-height: 1.6;
            margin-bottom: 1.5rem;
            max-width: 500px;
            margin-left: auto;
            margin-right: auto;
        }

        .eta-info {
            display: inline-flex;
            align-items: center;
            padding: 0.875rem 1.5rem;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: #d6d3d1;
            border-radius: 16px;
            font-size: 1rem;
            font-weight: 500;
            margin-bottom: 1.5rem;
            backdrop-filter: blur(5px);
        }

        .eta-info i {
            margin-right: 0.75rem;
            color: var(--accent-primary);
            font-size: 1.1rem;
        }
        
        .eta-info strong {
            color: #ffffff;
            margin-left: 0.4rem;
            font-family: 'Orbitron', sans-serif;
            letter-spacing: 0.5px;
        }

        .btn {
            display: inline-block;
            padding: 1rem 2.5rem;
            background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
            color: #ffffff;
            text-decoration: none;
            border-radius: 50px;
            font-weight: 700;
            font-family: 'Orbitron', sans-serif;
            letter-spacing: 1px;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(217, 119, 6, 0.4);
            border: 1px solid rgba(255, 255, 255, 0.1);
            text-transform: uppercase;
            font-size: 0.9rem;
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(217, 119, 6, 0.5);
            filter: brightness(1.1);
        }

        @keyframes gradientShift {
            0%, 100% { opacity: 0.8; }
            50% { opacity: 0.5; }
        }

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

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

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

        @media (max-width: 640px) {
            .container {
                padding: 2.5rem 1.5rem;
                width: 95%;
            }

            h1 {
                font-size: 1.8rem;
            }
            
            .icon-wrapper {
                font-size: 4rem;
            }
        }
    </style>
</head>
<body>
    <div class="bg-gradient"></div>
    <div class="bg-grid"></div>

    <div class="container">
        <div class="icon-wrapper">
            <i class="fas fa-tools"></i>
        </div>
        <div class="status-badge">
            System Maintenance
        </div>
        <h1>We'll be back soon</h1>
        <p><%= message || 'The Game Portal is currently undergoing scheduled maintenance to improve your gaming experience. We apologize for the inconvenience and appreciate your patience.' %></p>
        
        <% if (eta) { %>
        <div class="eta-info" data-eta="<%= eta %>">
            <i class="fas fa-clock"></i>
            Expected completion: <strong id="eta-display">Loading...</strong>
        </div>
        <script>
            (function() {
                const etaContainer = document.querySelector('.eta-info');
                const etaDisplay = document.getElementById('eta-display');
                if (etaContainer && etaDisplay) {
                    const eta = etaContainer.getAttribute('data-eta');
                    if (eta) {
                        const date = new Date(eta);
                        etaDisplay.textContent = date.toLocaleString('en-US', {
                            month: 'short',
                            day: 'numeric',
                            hour: '2-digit',
                            minute: '2-digit',
                            hour12: true
                        });
                    }
                }
            })();
        </script>
        <% } %>
        
        <a href="/" class="btn">Check Status</a>
    </div>
</body>
</html>
