/* SnakeFun site styles (homepage + language pages) */
:root {
    --bg: #f4f1e8;
    --surface: #ffffff;
    --surface-2: #faf8f2;
    --ink: #1d2817;
    --muted: #5e6b56;
    --line: #e6e1d3;
    --green-900: #24461a;
    --green-700: #3f6a25;
    --green-500: #5d9b2c;
    --green-100: #e8f3d9;
    --blue: #4e7cf6;
    --gold: #f2b705;
    --radius: 18px;
    --shadow: 0 1px 2px rgba(29, 40, 23, 0.06), 0 8px 24px rgba(29, 40, 23, 0.06);
    --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--green-700);
}

img {
    max-width: 100%;
    height: auto;
}

.wrap {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- header ---------- */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.site-header .wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 60px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.01em;
}

.brand img {
    width: 34px;
    height: 34px;
}

.brand span b {
    color: var(--green-500);
}

.site-nav {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.site-nav a {
    padding: 6px 10px;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}

.site-nav a:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.lang {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang select {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--line);
    background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235e6b56' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat right 10px center;
    border-radius: 10px;
    padding: 6px 28px 6px 10px;
    font: 600 14px var(--font);
    color: var(--ink);
    cursor: pointer;
}

/* ---------- hero + play area ---------- */
.hero {
    text-align: center;
    padding-top: 28px;
    padding-bottom: 6px;
}

.hero h1 {
    margin: 0 auto;
    max-width: 820px;
    font-size: clamp(26px, 4.2vw, 40px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero p {
    margin: 10px auto 0;
    max-width: 680px;
    color: var(--muted);
    font-size: 16px;
}

.hero p:empty {
    display: none;
}

.play-area {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
    padding-top: 18px;
    padding-bottom: 8px;
}

.play-area .sg {
    margin: 0;
    max-width: none;
}

@media (max-width: 960px) {
    .play-area {
        grid-template-columns: minmax(0, 1fr);
    }

    .play-area .sg {
        max-width: 680px;
        margin: 0 auto;
    }

    .play-area .lb {
        max-width: 680px;
        width: 100%;
        margin: 0 auto;
    }
}

/* ---------- content sections ---------- */
.section {
    padding-top: 40px;
    padding-bottom: 8px;
}

.section h2 {
    margin: 0 0 6px;
    font-size: clamp(22px, 3vw, 30px);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.015em;
}

.section .lead {
    margin: 0 0 18px;
    color: var(--muted);
    max-width: 720px;
}

.cards {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}

.card h3 {
    margin: 0 0 6px;
    font-size: 17px;
    line-height: 1.3;
}

.card p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}

.mode-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    margin-bottom: 10px;
    background: var(--green-100);
}

.mode-icon svg {
    width: 24px;
    height: 24px;
}

.steps {
    counter-reset: step;
}

.steps .card {
    position: relative;
    padding-top: 22px;
}

.steps .card::before {
    counter-increment: step;
    content: counter(step);
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-bottom: 10px;
    border-radius: 50%;
    background: var(--green-500);
    color: #fff;
    font-weight: 800;
}

.about {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
}

.about img {
    width: 120px;
    height: 120px;
}

.about p {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 600px) {
    .about {
        grid-template-columns: minmax(0, 1fr);
        text-align: center;
    }

    .about img {
        margin: 0 auto;
        width: 88px;
        height: 88px;
    }
}

.faq {
    display: grid;
    gap: 10px;
    max-width: 860px;
}

.faq details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0 18px;
}

.faq summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 28px 14px 0;
    position: relative;
    font-weight: 700;
}

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

.faq summary::after {
    content: "";
    position: absolute;
    right: 4px;
    top: 50%;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.15s;
}

.faq details[open] summary::after {
    transform: translateY(-30%) rotate(-135deg);
}

.faq details p,
.faq details div {
    margin: 0;
    padding: 0 0 14px;
    color: var(--muted);
}

/* ---------- footer ---------- */
.site-footer {
    margin-top: 48px;
    background: var(--green-900);
    color: #dfe9d4;
    padding: 28px 0;
    font-size: 14px;
}

.site-footer a {
    color: #fff;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

.footer-top {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.footer-langs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    opacity: 0.9;
}

@media (max-width: 720px) {
    .site-nav {
        display: none;
    }

    .lang {
        margin-left: auto;
    }

    .hero {
        padding-top: 18px;
    }

    .play-area {
        padding-top: 12px;
    }
}
