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

body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.menu-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 900px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 3em;
    color: #667eea;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    color: #666;
    font-size: 1.3em;
}

.game-categories {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-bottom: 30px;
}

.category-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e9ecef;
}

.category-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

.category-header h2 {
    color: #667eea;
    font-size: 1.8em;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.game-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    position: relative;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: #667eea;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.game-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

/* Applied at runtime by flagNewestGame() in index.html, driven by data-released */
.game-card.is-new {
    border-color: #f5a623;
    box-shadow: 0 5px 18px rgba(245, 166, 35, 0.28);
}

.game-card.is-new:hover {
    border-color: #f5a623;
    box-shadow: 0 10px 25px rgba(245, 166, 35, 0.45);
}

.new-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #f5a623 0%, #f2545b 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 3px 8px rgba(242, 84, 91, 0.4);
    animation: new-badge-pulse 2s ease-in-out infinite;
}

@keyframes new-badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
    .new-badge { animation: none; }
}

.game-card h2 {
    color: #667eea;
    font-size: 1.8em;
    margin-bottom: 10px;
}

.game-card p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 20px;
    line-height: 1.5;
}

.game-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.game-features span {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
}

footer {
    text-align: center;
    color: #666;
    font-size: 1.1em;
    margin-top: 20px;
}

/* Welcome Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 40px;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideDown 0.4s ease;
    border: 4px solid #667eea;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    color: #764ba2;
    transform: scale(1.2);
}

.modal-content h2 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-body {
    margin: 30px 0;
    line-height: 1.8;
}

.modal-body p {
    color: #666;
    font-size: 1.2em;
    margin-bottom: 20px;
    text-align: center;
}

.modal-body strong {
    color: #667eea;
    font-weight: bold;
}

.modal-button {
    display: block;
    margin: 30px auto 0;
    padding: 15px 40px;
    font-size: 1.3em;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.modal-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.modal-button:active {
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 2em;
    }

    .game-card {
        padding: 20px;
    }

    .category-section {
        padding: 20px;
    }

    .category-header h2 {
        font-size: 1.5em;
    }

    .menu-container {
        padding: 20px;
    }

    .modal-content {
        margin: 20% auto;
        padding: 30px 20px;
    }

    .modal-content h2 {
        font-size: 2em;
    }

    .modal-body p {
        font-size: 1em;
    }

    .modal-button {
        padding: 12px 30px;
        font-size: 1.1em;
    }
}

