:root {
    --primary: #3f51b5; /* Indigo */
    --brand-black: #1E1E1E;
    --brand-green: #008C44;
    --bg-light: #f9fafb;
    --text-main: #1f2937;
    --text-muted: #6b7280;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Site nav (appears on every page) */
.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.site-nav a.logo {
    font-weight: 900;
    font-size: 1.25rem;
    color: var(--primary);
    text-decoration: none;
}

.site-nav a.nav-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: bold;
}

/* Hero Section (homepage) */
header {
    text-align: center;
    padding: 80px 20px 40px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Store Badges (Placeholders) */
.store-badges {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}
.btn {
    background-color: var(--brand-black);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
}

.btn-primary {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
}

/* The Mexican Train Deluxe Upsell */
.upsell-card {
    background-color: var(--brand-black);
    border: 3px solid var(--brand-green);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    margin: 40px 0;
    color: white;
}

.upsell-card h2 {
    color: white;
    margin-bottom: 15px;
}

.btn-green {
    display: inline-block;
    background-color: var(--brand-green);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 15px;
}

/* Marketing sections (homepage: what it is, why use it, which games) */
.marketing-section {
    padding: 30px 0;
}

.marketing-section h2 {
    font-size: 1.75rem;
    margin-bottom: 15px;
}

.marketing-section > p {
    color: var(--text-muted);
    margin-bottom: 10px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.feature-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.feature-card h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.games-list-inline {
    color: var(--text-main);
    font-weight: bold;
    margin-bottom: 20px;
}

/* Semantic SEO-friendly dropdowns (used on generated rules pages) */
details {
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

summary {
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '+';
    color: var(--primary);
    font-size: 1.5rem;
}

details[open] summary::after {
    content: '\2212';
}

details p {
    margin-top: 15px;
    color: var(--text-muted);
}

/* Rules & hub page header (smaller than the homepage hero) */
.page-header {
    text-align: center;
    padding: 20px 20px 30px;
}

.page-header h1 {
    font-size: 2rem;
}

.back-link {
    display: inline-block;
    margin: 20px 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

/* Domino cards (image + instructions, side by side, non-clickable) */
.domino-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.domino-card img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 8px;
}

.domino-card-text h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 6px;
}

.domino-card-text p {
    color: var(--text-muted);
}

/* Individual rule sections on a game page */
.section-block {
    margin-bottom: 30px;
}

.section-block h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--primary);
}

/*
 * Games hub page: CSS-only tabs (Card Games / Tabletop Games / etc.)
 *
 * All categories' content is always present in the HTML - only the
 * CSS display property changes based on which radio is checked. This
 * keeps every game fully crawlable regardless of which tab is active,
 * with zero JavaScript required.
 *
 * The specific #tab-{slug}:checked ~ [data-tab="{slug}"] rules that
 * connect each tab to its panel are generated per-build by
 * build-site.js (inline in games/index.html), since the number of
 * categories can grow over time. Everything below is the generic,
 * category-agnostic styling.
 */

.tabs input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tabs label {
    display: inline-block;
    padding: 12px 24px;
    margin-right: 10px;
    margin-bottom: 20px;
    border-radius: 8px;
    background: white;
    color: var(--text-main);
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.tabs input[type="radio"]:checked + label {
    background: var(--primary);
    color: white;
}

.tabs input[type="radio"]:focus-visible + label {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.tab-panel {
    display: none;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.game-card {
    display: block;
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: bold;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.game-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Contact form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}

.contact-form label {
    font-weight: bold;
    font-size: 0.9rem;
    margin-top: 14px;
}

.contact-form select,
.contact-form input,
.contact-form textarea {
    font-size: 1rem;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: var(--bg-light);
    color: var(--text-main);
}

.contact-form select:focus,
.contact-form input:focus,
.contact-form textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.contact-form textarea {
    resize: vertical;
}

.contact-form .btn {
    border: none;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 20px;
    align-self: flex-start;
}

.form-note {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer a {
    color: var(--primary);
    text-decoration: none;
}

@media (max-width: 600px) {
    h1 { font-size: 2rem; }
    .store-badges { flex-direction: column; }
    .domino-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .domino-card img {
        width: 100%;
        max-width: 160px;
        height: auto;
    }
}