/* =====================================================================
   SUDOKA — base.css
   Общие стили сайта: токены, сброс, шапка/подвал, главная страница.
   Игровые стили живут в assets конкретной игры.
   ===================================================================== */

/* ---------- Токены дизайна ---------- */
:root {
    /* Палитра: тёплый крем + терракота + шалфей */
    --bg:           #FBF6EE;
    --bg-alt:       #F4EBDA;
    --card:         #FFFFFF;
    --ink:          #3A2E2A;
    --ink-muted:    #6B5D55;
    --terracotta:   #C75B2C;
    --terracotta-d: #A8481F;
    --terracotta-l: #F3D9CB;
    --sage:         #7B9E6B;
    --sage-d:       #5E7E50;
    --sage-l:       #DCE8D4;
    --danger:       #B23A48;
    --danger-l:     #F4D7DA;
    --border:       #E7DBC9;

    --radius:    16px;
    --radius-sm: 10px;
    --radius-lg: 24px;

    --shadow-sm: 0 1px 2px rgba(58, 46, 42, 0.06), 0 1px 3px rgba(58, 46, 42, 0.08);
    --shadow:    0 4px 14px rgba(58, 46, 42, 0.08);
    --shadow-lg: 0 12px 32px rgba(58, 46, 42, 0.12);

    --maxw: 1120px;
    --space: 1rem;

    --font: "Nunito", ui-rounded, "Segoe UI", system-ui, -apple-system,
            "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ---------- Сброс ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    color: var(--ink);
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 12% -8%, rgba(199, 91, 44, 0.10), transparent 42%),
        radial-gradient(circle at 92% 4%, rgba(123, 158, 107, 0.12), transparent 40%);
    background-attachment: fixed;
    line-height: 1.6;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--terracotta-d); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--terracotta); outline-offset: 2px; border-radius: 4px; }

/* ---------- Контейнер ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }

/* ---------- Шапка ---------- */
.site-header {
    position: sticky; top: 0; z-index: 20;
    background: rgba(251, 246, 238, 0.85);
    backdrop-filter: saturate(140%) blur(8px);
    border-bottom: 1px solid var(--border);
}
.site-header__inner {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    min-height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.35rem; letter-spacing: .02em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__logo { flex: none; }
.brand__name { font-weight: 800; }
.site-nav { display: flex; gap: 1.1rem; }
.site-nav a {
    color: var(--ink-muted); font-weight: 700; padding: .4rem .2rem; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--terracotta-d); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--terracotta-d); border-bottom-color: var(--terracotta); }

/* ---------- Основной контент ---------- */
.main { flex: 1 0 auto; padding-block: clamp(2rem, 5vw, 3.5rem); }

/* ---------- Главная: hero ---------- */
.hero { text-align: center; max-width: 760px; margin-inline: auto; margin-bottom: clamp(2rem, 5vw, 3rem); }
.hero__eyebrow { color: var(--terracotta-d); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.1; margin: .5rem 0 .75rem; }
.hero p { color: var(--ink-muted); font-size: clamp(1rem, 2.4vw, 1.18rem); }

/* ---------- Главная: категории и карточки игр ---------- */
.category { margin-bottom: clamp(2rem, 5vw, 3rem); }
.category__title {
    display: flex; align-items: center; gap: .6rem;
    font-size: 1.25rem; margin-bottom: 1rem;
}
.category__title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.1rem; }

.game-card {
    display: flex; flex-direction: column; gap: .6rem;
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--terracotta-l); text-decoration: none; }
.game-card__icon {
    width: 60px; height: 60px; border-radius: var(--radius-sm);
    background: var(--terracotta-l); display: grid; place-items: center;
}
.game-card__icon img { width: 38px; height: 38px; }
.game-card__title { font-size: 1.2rem; color: var(--ink); }
.game-card__short { color: var(--ink-muted); font-size: .95rem; }
.game-card__meta { margin-top: auto; display: flex; gap: .5rem; flex-wrap: wrap; padding-top: .4rem; }
.tag { font-size: .75rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; background: var(--bg-alt); color: var(--ink-muted); }
.tag--play { background: var(--sage-l); color: #2f5a2e; }

/* ---------- Подвал ---------- */
.site-footer { margin-top: auto; border-top: 1px solid var(--border); background: var(--bg-alt); padding-block: 1.6rem; }
.site-footer__inner { display: flex; flex-direction: column; gap: .25rem; text-align: center; color: var(--ink-muted); font-size: .92rem; }

/* ---------- Крошки ---------- */
.breadcrumbs { font-size: .9rem; color: var(--ink-muted); margin-bottom: 1rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; }
.breadcrumbs li::after { content: "›"; margin-left: .4rem; color: var(--border); }
.breadcrumbs li:last-child::after { content: ""; }
.breadcrumbs a { color: var(--ink-muted); }
.breadcrumbs a:hover { color: var(--terracotta-d); }

/* ---------- Карточка-обёртка страницы ---------- */
.panel {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow);
    padding: clamp(1rem, 4vw, 2rem);
}

/* ---------- Кнопки (общие) ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .65rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid transparent;
    font-weight: 800; background: var(--terracotta); color: #fff;
    transition: background .15s ease, transform .05s ease;
}
.btn:hover { background: var(--terracotta-d); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--terracotta-d); border-color: var(--terracotta-l); }
.btn--ghost:hover { background: var(--terracotta-l); color: var(--terracotta-d); }
.btn--sage { background: var(--sage); }
.btn--sage:hover { background: var(--sage-d); }

/* ---------- Адаптив ---------- */
@media (max-width: 640px) {
    .site-header__inner { min-height: 60px; }
    .brand__name { font-size: 1.2rem; }
}

/* ---------- Редьюс анимаций ---------- */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
