:root {
    --primary-color: #FF6B6B;
    --secondary-color: #4ECDC4;
    --accent-color: #FFE66D;
    --white-color: #FFFFFF;
    --dark-color: #25283D;
    --font-main: 'Poppins', sans-serif;
    --font-fun: 'Fredoka One', cursive;
}

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

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

header h1 {
    font-family: var(--font-fun);
    font-size: 3rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

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

.game-card {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.45);
}

.game-card-content h2 {
    font-family: var(--font-fun);
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.play-button {
    background: var(--accent-color);
    color: var(--dark-color);
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-family: var(--font-fun);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.play-button:hover {
    background: var(--white-color);
    transform: scale(1.05);
}

footer {
    margin-top: 3rem;
    opacity: 0.8;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.5s;
}

.modal-content {
    background: rgba(255, 255, 255, 0.15);
    margin: 10% auto;
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 80%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    text-align: center;
}

.close-button {
    color: var(--white-color);
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
}

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

/* Game Specific Styles */
.tic-tac-toe-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 2rem auto;
    max-width: 300px;
}

.tic-tac-toe-grid div {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-family: var(--font-fun);
    cursor: pointer;
    transition: background 0.3s ease;
}

.tic-tac-toe-grid div:hover {
    background: rgba(255, 255, 255, 0.4);
}

.game-status {
    font-size: 1.2rem;
    margin: 1rem 0;
    min-height: 1.5rem;
}

.reset-button {
    background: var(--accent-color);
    color: var(--dark-color);
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    font-family: var(--font-fun);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-button:hover {
    background: var(--white-color);
}

.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 10px;
    margin-top: 2rem;
}

.alphabet-grid .letter {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 1rem;
    font-size: 1.8rem;
    font-family: var(--font-fun);
    cursor: pointer;
    transition: all 0.3s ease;
}

.alphabet-grid .letter:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.alphabet-display {
    margin-top: 2rem;
    font-size: 1.5rem;
    min-height: 100px;
}

.counting-display {
    font-size: 5rem;
    font-family: var(--font-fun);
    color: var(--accent-color);
    margin: 2rem 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.counting-controls button {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white-color);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-family: var(--font-fun);
    font-size: 1rem;
    cursor: pointer;
    margin: 0 0.5rem;
    transition: all 0.3s ease;
}

.counting-controls button:hover {
    background: rgba(255, 255, 255, 0.4);
}

@media (max-width: 768px) {
    header h1 { font-size: 2.5rem; }
    .modal-content { width: 90%; margin: 20% auto; }
}