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

html, body {
    width: 100%;
    min-height: 100%;
    background: #FFF8E1;
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    color: #5D4037;
}

/* ---- Landing Page ---- */

#landing-page {
    padding: 48px 16px 32px;
}

.hero {
    text-align: center;
    padding: 24px 16px 32px;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 900;
    color: #5D4037;
    letter-spacing: -0.02em;
}

.tagline {
    margin-top: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #A1887F;
    line-height: 1.5;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

#game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    justify-items: center;
    gap: 16px;
    max-width: 960px;
    margin: 0 auto 32px;
    padding: 0 4px;
}

/* ---- Game Card ---- */

.game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 340px;
    padding: 28px 20px 24px;
    background: #FFFFFF;
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 150ms ease-out, box-shadow 150ms ease-out;
    text-align: center;
    gap: 10px;
}

.game-card:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.10);
}

.game-card:focus-visible {
    outline: 3px solid #FF8A65;
    outline-offset: 2px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.10);
}

.game-card:active {
    transform: scale(0.98);
}

.game-card-icon {
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.game-card h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #5D4037;
}

.game-card p {
    font-size: 0.85rem;
    font-weight: 600;
    color: #A1887F;
    line-height: 1.4;
    max-width: 220px;
}

/* ---- Mini Tic-Tac-Toe Board Icon ---- */

.mini-board {
    display: grid;
    grid-template-columns: repeat(3, 26px);
    grid-template-rows: repeat(3, 26px);
    gap: 3px;
    background: #FFE0B2;
    border-radius: 8px;
    padding: 4px;
}

.mini-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    border-radius: 5px;
    font-size: 17px;
}

.mini-cell.x {
    color: #FF6B8A;
}

.mini-cell.o {
    color: #448AFF;
}

/* ---- Landing Footer ---- */

.landing-footer {
    text-align: center;
    padding: 16px 16px 40px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #BCAAA4;
}

/* ---- Reduced Motion ---- */

@media (prefers-reduced-motion: reduce) {
    .game-card {
        transition: none;
    }

    .game-card:hover,
    .game-card:active {
        transform: none;
    }
}

/* ---- Responsive ---- */

@media (min-width: 600px) {
    #landing-page {
        padding-top: 60px;
    }

    #game-grid {
        gap: 20px;
        padding: 0 8px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .tagline {
        font-size: 1.05rem;
    }
}

@media (min-width: 900px) {
    #landing-page {
        padding-top: 72px;
    }

    #game-grid {
        gap: 24px;
        padding: 0 12px;
    }

    .hero h1 {
        font-size: 2.4rem;
    }
}
