/* ==================== Base Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    width: 100%;
}

/* ==================== Header ==================== */
.header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInDown 0.8s ease-out;
}

.title {
    font-size: 3.5em;
    color: white;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    font-weight: 800;
}

.subtitle {
    font-size: 1.3em;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    letter-spacing: 1px;
}

/* ==================== Games Grid ==================== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.game-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.8s ease-out;
    animation-fill-mode: both;
}

.game-card:nth-child(1) { animation-delay: 0.1s; }
.game-card:nth-child(2) { animation-delay: 0.2s; }
.game-card:nth-child(3) { animation-delay: 0.3s; }

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ==================== Card Header ==================== */
.card-header {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.card-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

.match3-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.sudoku-bg {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.mathcross-bg {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.game2048-bg {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
}

.snake-bg {
    background: linear-gradient(135deg, #55efc4 0%, #00b894 100%);
}

.flappy-bg {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
}

.tetris-bg {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
}

.memory-bg {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
}

.minesweeper-bg {
    background: linear-gradient(135deg, #636e72 0%, #2d3436 100%);
}

.breakout-bg {
    background: linear-gradient(135deg, #ff7675 0%, #d63031 100%);
}

.game-icon {
    font-size: 5em;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
    animation: bounce 2s infinite;
}

/* ==================== Card Body ==================== */
.card-body {
    padding: 30px;
}

.game-title {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 12px;
    font-weight: 700;
}

.game-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.game-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.feature {
    background: #f0f0f0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    color: #555;
    font-weight: 500;
}

/* ==================== Play Button ==================== */
.play-button {
    display: block;
    width: 100%;
    padding: 15px;
    text-align: center;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 1.1em;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.match3-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.sudoku-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.mathcross-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.game2048-btn {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #2d3436;
}

.snake-btn {
    background: linear-gradient(135deg, #55efc4 0%, #00b894 100%);
}

.flappy-btn {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
}

.tetris-btn {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
}

.memory-btn {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
}

.minesweeper-btn {
    background: linear-gradient(135deg, #636e72 0%, #2d3436 100%);
}

.breakout-btn {
    background: linear-gradient(135deg, #ff7675 0%, #d63031 100%);
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.play-button:active {
    transform: translateY(0);
}

/* ==================== Footer ==================== */
.footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    margin-top: 40px;
    animation: fadeIn 1s ease-out 0.5s both;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.footer-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.footer-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.footer-text {
    margin: 0;
}

/* ==================== Animations ==================== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .title {
        font-size: 2.5em;
    }
    
    .subtitle {
        font-size: 1.1em;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .game-icon {
        font-size: 4em;
    }
}
