/* --- Themes (kept in step with memi-engine's style.css) --- */

:root, [data-theme="light"] {
    --bg: #f5f3ef; --text: #2c2c2c; --heading: #1a1a1a; --subtle: #888;
    --card-bg: #fff; --card-shadow: rgba(0,0,0,0.12); --border: #ccc;
    --accent: #b8860b; --link: #777; --muted: #888;
}
[data-theme="yellow"] {
    --bg: #fdf6e3; --text: #3a3520; --heading: #2a2510; --subtle: #a09060;
    --card-bg: #fff8e8; --card-shadow: rgba(60,50,0,0.1); --border: #d8c890;
    --accent: #c89000; --link: #a09060; --muted: #a09060;
}
[data-theme="pink"] {
    --bg: #fdf0f4; --text: #3a2030; --heading: #2a1020; --subtle: #b08898;
    --card-bg: #fff5f8; --card-shadow: rgba(60,0,30,0.1); --border: #e0b8c8;
    --accent: #d4608a; --link: #b08898; --muted: #b08898;
}
[data-theme="blue"] {
    --bg: #e4eff8; --text: #1e3448; --heading: #142838; --subtle: #6a8aa8;
    --card-bg: #f0f6fc; --card-shadow: rgba(0,30,60,0.1); --border: #a8c4d8;
    --accent: #2a7ab8; --link: #6a8aa8; --muted: #6a8aa8;
}
[data-theme="green"] {
    --bg: #dce8d8; --text: #1e2e1a; --heading: #142010; --subtle: #6a8a60;
    --card-bg: #e8f0e4; --card-shadow: rgba(0,30,0,0.12); --border: #98b88e;
    --accent: #2e8a3e; --link: #6a8a60; --muted: #6a8a60;
}
[data-theme="brown"] {
    --bg: #c8b8a4; --text: #302418; --heading: #201810; --subtle: #7a6a58;
    --card-bg: #d4c4b0; --card-shadow: rgba(30,20,10,0.18); --border: #a89880;
    --accent: #906820; --link: #7a6a58; --muted: #7a6a58;
}
[data-theme="grey"] {
    --bg: #48484e; --text: #d8d8dc; --heading: #eaeaee; --subtle: #9898a0;
    --card-bg: #525258; --card-shadow: rgba(0,0,0,0.4); --border: #606068;
    --accent: #a0b0c8; --link: #9898a0; --muted: #9898a0;
}
[data-theme="dark"] {
    --bg: #232530; --text: #e8e6e3; --heading: #f0ece2; --subtle: #9a9a9a;
    --card-bg: #2c2e3a; --card-shadow: rgba(0,0,0,0.5); --border: #4a4a5a;
    --accent: #d4a843; --link: #8a8a9a; --muted: #8a8a9a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0 1.5rem 3rem;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
}

/* --- Theme picker (matches the games) --- */

.theme-picker {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: flex-end;
    padding: 1rem 0 0;
}
.theme-label { font-size: 0.7rem; color: var(--muted); margin-right: 0.2rem; }
.theme-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid;
    cursor: pointer;
}
.theme-dot[data-theme="light"]  { background: #f5f3ef; border-color: #ccc; }
.theme-dot[data-theme="yellow"] { background: #f0d060; border-color: #c8a830; }
.theme-dot[data-theme="pink"]   { background: #e8a0b8; border-color: #d080a0; }
.theme-dot[data-theme="blue"]   { background: #4ab4d8; border-color: #2a8ab8; }
.theme-dot[data-theme="green"]  { background: #6aba68; border-color: #4a9a48; }
.theme-dot[data-theme="brown"]  { background: #b09878; border-color: #988068; }
.theme-dot[data-theme="grey"]   { background: #68686e; border-color: #58585e; }
.theme-dot[data-theme="dark"]   { background: #232530; border-color: #4a4a5a; }

.theme-dot.active[data-theme="light"]  { border-color: #b8860b; }
.theme-dot.active[data-theme="yellow"] { border-color: #c89000; }
.theme-dot.active[data-theme="pink"]   { border-color: #d4608a; }
.theme-dot.active[data-theme="blue"]   { border-color: #2a8ab8; }
.theme-dot.active[data-theme="green"]  { border-color: #3a9a50; }
.theme-dot.active[data-theme="brown"]  { border-color: #c8a050; }
.theme-dot.active[data-theme="grey"]   { border-color: #a0b0c8; }
.theme-dot.active[data-theme="dark"]   { border-color: #d4a843; }

/* --- Header --- */

header {
    max-width: 46rem;
    margin: 2.5rem auto 0;
    text-align: center;
}
h1 {
    margin: 0;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--heading);
}
h1 a { color: inherit; text-decoration: none; }
.tagline {
    margin: 0.25rem 0 0;
    color: var(--subtle);
    font-size: 1.05rem;
}
.intro {
    max-width: 34rem;
    margin: 1.75rem auto 0;
    color: var(--text);
}
.header-nav {
    margin: 1.25rem 0 0;
    font-size: 0.9rem;
}
.header-nav a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 1px;
}

/* --- Editions --- */

main { max-width: 60rem; margin: 0 auto; }

.editions {
    list-style: none;
    padding: 0;
    margin: 2.5rem 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 1rem;
}

/* Each edition carries its own --edition colour. It tints the card and
   paints the stripe and title, so the eight are told apart at a glance.
   The tint is mixed into --card-bg, which means it follows every theme
   from light through dark without a second set of values. */
.editions a {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.1rem 1.25rem;
    background: color-mix(in srgb, var(--edition) 10%, var(--card-bg));
    border: 1px solid var(--border);
    border-left: 4px solid var(--edition);
    border-radius: 10px;
    box-shadow: 0 1px 3px var(--card-shadow);
    text-decoration: none;
    color: inherit;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.editions a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--card-shadow);
    background: color-mix(in srgb, var(--edition) 18%, var(--card-bg));
}

.editions .name {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--edition);
}
.editions .native {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--subtle);
    margin-top: 0.1rem;
}
.editions .what {
    font-size: 0.87rem;
    color: var(--text);
    margin-top: 0.6rem;
}

/* The general edition is the way in for most people — give it the full row. */
.editions li.featured { grid-column: 1 / -1; }
.editions li.featured .name { font-size: 1.4rem; }

/* Mid-luminance hues, so each one clears 3:1 against both the lightest
   and the darkest card background the themes produce. */
.editions li.world     { --edition: #c9901f; }
.editions li.portugal  { --edition: #2aa070; }
.editions li.lisboa    { --edition: #3a8fd0; }
.editions li.slovensko { --edition: #7a7fd8; }
.editions li.us        { --edition: #d96a55; }
.editions li.pyrenees  { --edition: #8aa83f; }
.editions li.krakow    { --edition: #b464b4; }

/* --- About page --- */

.content {
    max-width: 34rem;
    margin: 2.5rem auto 0;
    line-height: 1.75;
}
.content h2 {
    margin: 2.25rem 0 0.6rem;
    font-size: 1.15rem;
    color: var(--heading);
}
.content p { margin: 0 0 1rem; }
.content ul { padding-left: 1.2rem; }
.content li { margin-bottom: 0.6rem; }
.content a { color: var(--accent); }
.back-link {
    display: inline-block;
    margin-top: 2rem;
    color: var(--link);
    text-decoration: none;
    border-bottom: 1px solid var(--back-border, currentColor);
}

footer {
    max-width: 46rem;
    margin: 3.5rem auto 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
}
footer a { color: var(--link); }
