/* General Body Styles */
body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(45deg, #0f0f23, #1a1a2e, #16213e, #0f3460);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    color: #fff;
    margin: 0;
    padding: 20px; /* Consistent padding */
    min-height: 100vh;
    overflow-x: hidden;
    display: flex; /* Use flexbox for overall layout */
    flex-direction: column;
    align-items: center; /* Center content horizontally */
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Header Styles */
.main-header {
    margin-bottom: 40px;
    width: 100%;
    max-width: 1000px; /* Limit header width */
}

h1 {
    font-family:'Courier New', monospace;
    font-size: 3.5em;
    color: #00ff88;
    text-shadow: 0 0 20px #00ff88, 0 0 40px #00ff88;
    margin-bottom: 20px;
    animation: titlePulse 3s ease-in-out infinite alternate;
    text-align: center;
}

@keyframes titlePulse {
    from { text-shadow: 0 0 20px #00ff88, 0 0 40px #00ff88; }
    to { text-shadow: 0 0 30px #00ff88, 0 0 60px #00ff88, 0 0 80px #00ff88; }
}

.subtitle {
    font-size: 1.2em;
    color: #ffcc00;
    margin-bottom: 40px;
    opacity: 0.9;
    max-width: 800px; /* Limit subtitle width */
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
    text-align: center;
}

/* Main Menu Layout */
.game-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive grid */
    gap: 30px;
    width: 100%;
    max-width: 1000px; /* Max width for the menu grid */
    margin-bottom: 40px;
}

.menu-category {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #00ff88;
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.menu-category h2 {
    color: #00ff88;
    font-size: 1.8em;
    margin-bottom: 25px;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.button-group {
    display: flex;
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px; /* Space between buttons */
    width: 100%; /* Buttons take full width of group */
}

/* Base Button Style (applied to all buttons) */
button {
    background: linear-gradient(45deg, #ff6b6b, #ff8e53); /* Default red-orange gradient */
    border: none;
    color: white;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    display: block; /* Ensure buttons are block for margin auto */
    width: 100%; /* Fill button group width */
    max-width: 300px; /* Max width for individual buttons */
    margin-left: auto;
    margin-right: auto;
    text-decoration: none; /* Remove underline from anchor */
}

button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.5);
}

/* Specific Button Styles (override base for different categories) */
.main-btn {
    background: linear-gradient(45deg, #4facfe, #00f2fe); /* Blue gradient */
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
    color: #000; /* Text color for blue gradient */
}
.main-btn:hover {
    box-shadow: 0 8px 20px rgba(79, 172, 254, 0.5);
}

.secondary-btn {
    background: linear-gradient(45deg, #ffcc00, #ffed4e); /* Yellow gradient */
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.3);
    color: #000; /* Text color for yellow gradient */
}
.secondary-btn:hover {
    box-shadow: 0 8px 20px rgba(255, 204, 0, 0.5);
}

.minigame-btn {
    background: linear-gradient(45deg, #c471ed, #f64f59); /* Purple-red gradient */
    box-shadow: 0 4px 15px rgba(196, 113, 237, 0.3);
}
.minigame-btn:hover {
    box-shadow: 0 8px 20px rgba(196, 113, 237, 0.5);
}

.info-btn {
    background: linear-gradient(45deg, #00ff88, #43e97b); /* Green gradient */
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
    color: #000; /* Text color for green gradient */
}
.info-btn:hover {
    box-shadow: 0 8px 20px rgba(0, 255, 136, 0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5em;
    }
    .subtitle {
        font-size: 1em;
        margin-bottom: 30px;
    }
    .game-menu {
        grid-template-columns: 1fr; /* Stack categories on small screens */
        gap: 20px;
    }
    .menu-category {
        padding: 20px;
    }
    .menu-category h2 {
        font-size: 1.5em;
        margin-bottom: 20px;
    }
    button {
        font-size: 16px;
        padding: 12px 25px;
        max-width: none; /* Allow buttons to take full width */
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2em;
    }
    .subtitle {
        font-size: 0.9em;
        margin-bottom: 20px;
    }
    body {
        padding: 15px;
    }
}