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

/* Variables */
:root {
    --color-bg: #faf9f7;
    --color-text: #2c2c2c;
    --color-accent: #5b7a6b;
    --color-accent-light: #e8efe9;
    --color-muted: #7a7a7a;
    --color-border: #e0ddd8;
    --font-body: 'Georgia', serif;
    --font-heading: 'Georgia', serif;
    --max-width: 960px;
}

/* Base */
html {
    font-size: 18px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-text);
}

/* Header / Nav */
header {
    border-bottom: 1px solid var(--color-border);
}

nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

nav .logo {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--color-text);
    letter-spacing: 0.02em;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.8rem;
}

nav ul a {
    color: var(--color-muted);
    font-size: 0.9rem;
    letter-spacing: 0.03em;
}

nav ul a:hover {
    color: var(--color-text);
}

/* Main */
main {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem;
    width: 100%;
}

/* Hero */
.hero {
    padding: 5rem 0 4rem;
    text-align: center;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: normal;
    margin-bottom: 0.8rem;
    letter-spacing: -0.02em;
}

.hero p {
    color: var(--color-muted);
    font-size: 1.1rem;
}

/* About */
.about {
    padding: 4rem 0 3rem;
    max-width: 640px;
    margin: 0 auto;
}

.about h1 {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: normal;
    margin-bottom: 1.2rem;
    letter-spacing: -0.02em;
}

.about p {
    color: var(--color-text);
    font-size: 1rem;
    line-height: 1.8;
}

/* Weather */
.weather {
    text-align: center;
    padding: 0 0 3rem;
}

.weather h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: normal;
    color: var(--color-muted);
    margin-bottom: 0.6rem;
}

.weather-loading {
    color: var(--color-muted);
    font-size: 0.9rem;
}

.weather-details {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 0.4rem;
}

.weather-icon {
    font-size: 2.4rem;
}

.weather-temp {
    font-size: 2rem;
    font-family: var(--font-heading);
}

.weather-desc {
    font-size: 1rem;
    color: var(--color-muted);
}

.weather-extra {
    color: var(--color-muted);
    font-size: 0.8rem;
}

/* Game */
.game {
    text-align: center;
    padding: 0 0 4rem;
}

.game h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: normal;
    margin-bottom: 0.5rem;
}

#game-status {
    color: var(--color-muted);
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-width: 280px;
    margin: 0 auto 1.5rem;
}

.cell {
    aspect-ratio: 1;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.15s ease;
}

.cell:hover:not(:disabled) {
    background: var(--color-accent-light);
}

.cell:disabled {
    cursor: default;
}

.cell.x {
    color: var(--color-accent);
}

.cell.o {
    color: #b07a5b;
}

.cell.winner {
    background: var(--color-accent-light);
}

.reset-btn {
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 0.5rem 1.4rem;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.reset-btn:hover {
    background: var(--color-text);
}

/* Footer */
footer {
    border-top: 1px solid var(--color-border);
    padding: 1.5rem;
    text-align: center;
}

footer p {
    color: var(--color-muted);
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 600px) {
    html {
        font-size: 16px;
    }

    .hero {
        padding: 3rem 0 2.5rem;
    }

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