/* ==========================================
   styles/home-dashboard.css — визуальная система главной (V3)

   НОРМАТИВНЫЙ ВЛАДЕЛЕЦ вёрстки `#screen-home` в режиме `.tp-dash`.
   Загружается после home-redesign / -density / -glass, поэтому старые
   правила `.tp-home-*` остаются на месте для всего, что их ещё использует,
   а классы `.tp-dash-*` ни с чем не спорят и не требуют `!important`.

   ТРИ ПРАВИЛА, ИЗ КОТОРЫХ СОБРАН ЭТОТ ЭКРАН
   ─────────────────────────────────────────
   1. ГРУППЫ РАЗДЕЛЯЕТ ТОН И ВОЗДУХ, А НЕ РАМКА. Обводка есть только у
      главной карточки состояния — там она несёт иерархию. Всё остальное
      отделяется чуть более светлой поверхностью и расстоянием. Экран, где
      каждая мелочь обведена, читается как таблица, а не как приложение.
   2. ЗОЛОТО — ЭТО СМЫСЛ, А НЕ ОФОРМЛЕНИЕ. Оно означает: главное действие,
      идущая партия, достижение. Обычные сведения — светлый текст, служебные
      — приглушённый серый. Золотой заголовок у каждого раздела обесценивает
      золото.
   3. НЕ ВСЁ — КАРТОЧКА. Новость выглядит новостью, партия — партией, друг —
      человеком, показатель — числом. Одинаковые прямоугольники на всё это
      и делали экран «сжатой веб-панелью».

   ЧТО НЕ ПРИНАДЛЕЖИТ ЭТОМУ ФАЙЛУ: отступ снизу под нижнюю панель и боковые
   16px — их владелец mobile-glass-nav.css и product-ui-cleanup.css, оба
   ключуются по `.tp-home__content`; нижняя навигация; токены.
   ========================================== */

.tp-dash {
    --dash-gap-section: 24px;
    --dash-gap-heading: 10px;
    --dash-gap-tile: 8px;

    /* Поверхности главной. Три ступени тона вместо рамок. */
    --dash-surface: color-mix(in srgb, var(--tp-color-text) 5%, var(--tp-color-page));
    --dash-surface-raised: color-mix(in srgb, var(--tp-color-text) 8%, var(--tp-color-page));
    --dash-surface-hover: color-mix(in srgb, var(--tp-color-text) 12%, var(--tp-color-page));
    --dash-hairline: color-mix(in srgb, var(--tp-color-text) 9%, transparent);
    --dash-radius: 14px;

    /* Палитра фирменной графики новости.
       ВАЖНО: второй аргумент здесь — литерал, а не переменная, которая сама
       является color-mix(). Вложенная смесь (`color-mix` внутри `color-mix`)
       браузером не разбирается, и объявление отбрасывается целиком — вместе
       со всеми слоями фона. Проверено замером: такой градиент вычисляется
       в `none`. */
    --dash-art-base: color-mix(in srgb, var(--tp-color-primary) 9%, #221e1a);
    --dash-art-warm: color-mix(in srgb, var(--tp-color-primary) 26%, #2a2420);
    --dash-art-glow: color-mix(in srgb, var(--tp-color-primary) 34%, transparent);
    --dash-stone: color-mix(in srgb, var(--tp-color-primary) 86%, #fff8e8);

    /* Бирюза логотипа — очень скупо: живое состояние и техническая строка
       движка. Интерфейс от этого не становится синим, но и не остаётся
       только чёрно-золотым. */
    --dash-accent: var(--tp-color-success);

    /* ── Типографические роли ────────────────────────────────────────────
       В проекте три собственных семейства (проверено загрузкой, а не по
       имени в CSS): DM Sans 400/500/700/800 — интерфейс, Unbounded 400/700/900
       — витрина, JetBrains Mono 400/500/600 — цифры. Своего реестра токенов
       здесь не заводится: роли собраны из уже существующих --tp-font-*.

       Правило: если полужирным набрано всё, полужирного нет ни у чего.
       700–800 остаётся витрине и результату, разделам хватает 600,
       служебным строкам — 400. */
    --type-display-family: var(--tp-font-display);
    --type-ui-family: var(--tp-font-sans);
    /* ВНИМАНИЕ: моноширинное семейство объявлено как --font-mono, а НЕ
       --tp-font-mono. Опечатка не ломает страницу и не даёт ошибки —
       неизвестная переменная просто наследует шрифт родителя, и вся
       числовая типографика молча не применяется. Поймано замером
       вычисленного font-family, а не чтением файла. */
    --type-num-family: var(--font-mono);

    --type-section-size: 16px;
    --type-section-weight: 600;
    --type-card-size: 15px;
    --type-card-weight: 600;
    --type-body-size: 14px;
    --type-body-weight: 500;
    --type-meta-size: 12px;
    --type-meta-weight: 400;
    --type-button-weight: 600;
    --type-stat-size: 22px;
    --type-stat-weight: 600;
}

/* Фон под содержимым успокоен: зерно и золотое зарево из темы остаются
   опознавательным знаком продукта, но текст должен читаться поверх фона, а
   не соревноваться с ним. Экран кладёт собственную мягкую подложку. */
/* Фон под содержимым успокоен. Зерно и золотое зарево темы остаются знаком
   продукта, но экран кладёт поверх них почти непрозрачную подложку: сквозь
   неё текстура читается примерно на треть прежней силы. Текст должен
   замечаться первым, фон — вторым. */
/* Зерно рисует НЕ этот экран, а `.app-container.tp-shell` (шумовой SVG в
   data-URI), и лежит оно под содержимым. Прежний вариант этого правила был
   записан как `#screen-home.tp-dash` и молча не применялся: в
   rewards-themes.css есть
   `html[data-theme] body:not(.game-active) #screen-home.tp-home`,
   а это вес (1,3,2) против моих (1,1,0). Ошибка не давала ни сбоя, ни
   предупреждения — фон просто оставался прежним. Найдено сравнением
   вычисленного background с ожидаемым, а не чтением файла.

   Здесь тот же вид селектора и на один класс длиннее, поэтому правило
   выигрывает честно. Экран кладёт почти непрозрачную подложку: текстура
   остаётся знаком продукта, но уходит на глубину, а не спорит с текстом. */
/* Зерно рисует НЕ этот экран, а `.app-container.tp-shell` (шумовой SVG в
   data-URI) — оно лежит под содержимым и просвечивает в промежутках между
   разделами.

   Успокаивать его через `background` самого экрана бесполезно: правило
   матчится, парсится и всё равно проигрывает чужому `!important`. Вместо
   войны весов экран кладёт собственный слой — псевдоэлемент, которым
   владеем только мы. `isolation: isolate` на #screen-home (home-glass.css)
   держит слой внутри экрана, z-index -2 уводит его под содержимое и под
   золотое зарево ::before. Спорить тут не с чем и не с кем.

   Текстура остаётся знаком продукта, но уходит на глубину: замер разброса
   яркости пустого фона — единственный честный способ это проверить. */
#screen-home.tp-dash::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(120% 38% at 50% 0%, color-mix(in srgb, var(--tp-color-primary) 7%, transparent), transparent 66%),
        /* 88%, а не «поглуше на глазок»: замер разброса яркости в пустом
           промежутке между разделами даёт 5.88 без подложки и 0.74 с ней.
           Зерно остаётся различимым вблизи, но перестаёт спорить с текстом,
           а фон уходит заметно темнее карточек — поверхности читаются сами
           собой, без единой рамки. */
        color-mix(in srgb, var(--tp-color-page) 88%, transparent);
}
#screen-home.tp-dash::before { opacity: 0.06; }

/* ── Базовое начертание главной ──────────────────────────────────────────
   В style.css есть `* { font-family: -apple-system, … }`. Универсальный
   селектор применяется к КАЖДОМУ элементу напрямую, поэтому он побеждает
   наследование: любой узел, которому шрифт не назначен явно, набирался
   системным, а не DM Sans. Обнаружено замером вычисленного font-family —
   по файлу это не видно никак.

   Правило намеренно завёрнуто в `:where()` целиком: вес 0-0-0, ровно как у
   `*`, а лист загружается позже — значит выигрывает по порядку. Любая
   ролевая строчка ниже (0-1-0) остаётся сильнее и продолжает назначать
   витринное и цифровое начертание. Общий `*` в style.css не трогаю: он
   держит весь остальной продукт. */
:where(#screen-home.tp-dash, #news-detail-dialog) :where(span, p, h1, h2, h3, h4, strong, small, b, em, li, div, button, a, time) {
    font-family: var(--type-ui-family);
}

.tp-dash .tp-dash__content {
    display: flex;
    flex-direction: column;
    gap: var(--dash-gap-section);
    padding-top: var(--tp-space-4);
}

/* ── Личность игрока ─────────────────────────────────────────────────────
   Имя — опознавательный знак, а не заголовок страницы: это экран
   приложения, а не приветственная посадочная. */

.tp-dash-id {
    display: flex;
    align-items: center;
    gap: var(--tp-space-3);
    margin: 0;
}

.tp-dash-id__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--dash-surface-raised);
    font-size: 20px;
    line-height: 1;
    overflow: hidden;
}
.tp-dash-id__avatar img { width: 100%; height: 100%; object-fit: cover; }
/* Инициалы — обязательный элемент интерфейса, поэтому набираются тем же
   шрифтом, что и всё остальное, а не системным эмодзи, которого на
   устройстве может не оказаться. */
.tp-dash-id__avatar.is-initials,
.tp-dash-person__avatar.is-initials {
    font-family: var(--type-ui-family);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--tp-color-text-muted);
}

.tp-dash-id__copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.tp-dash-id__name {
    font-family: var(--type-ui-family);
    font-size: 17px;
    font-weight: var(--type-section-weight);
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--tp-color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tp-dash-id__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--tp-color-text-muted);
}
.tp-dash-id__rating { display: inline-flex; align-items: center; gap: 4px; }
.tp-dash-id__rating i { color: var(--tp-color-primary); font-size: 10px; }
.tp-dash-id__rating strong { font-family: var(--type-num-family); font-variant-numeric: tabular-nums; color: var(--tp-color-text); font-weight: 600; }
.tp-dash-id__status { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.tp-dash-id__status i { font-size: 6px; color: var(--tp-color-text-subtle); }
.tp-dash-id__status[data-online-status="ready"] i { color: var(--dash-accent); }

/* ── Заголовки разделов ──────────────────────────────────────────────────
   Обычным предложением и обычным весом. Прописные полужирные заголовки
   кричали громче содержимого, которое подписывали. */

.tp-dash-block { display: flex; flex-direction: column; gap: var(--dash-gap-heading); margin: 0; }
.tp-dash-block.is-empty { display: none; }

.tp-dash-block__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--tp-space-3);
    padding: 0;
    border: 0;
    background: none;
}

.tp-dash-block__head h2 {
    margin: 0;
    font-family: var(--type-ui-family);
    font-size: var(--type-section-size);
    font-weight: var(--type-section-weight);
    letter-spacing: -0.01em;
    text-transform: none;
    color: var(--tp-color-text);
}

.tp-dash-block__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    /* Касаемая площадь 44px набирается отрицательным полем, чтобы ссылка не
       раздвигала строку заголовка. */
    min-height: 44px;
    margin-block: -13px;
    padding: 0 2px;
    border: 0;
    background: none;
    color: var(--tp-color-text-subtle);
    font-family: var(--type-ui-family);
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
}
.tp-dash-block__link i { font-size: 9px; opacity: 0.6; }
.tp-dash-block__link:hover { color: var(--tp-color-text); }

/* ── Главная карточка состояния ──────────────────────────────────────────
   Единственное место экрана, которому позволено доминировать. */

.tp-dash-primary { margin: 0; }

.tp-dash-primary__card {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 13px var(--tp-space-3);
    border-radius: 16px;
    background: var(--dash-surface-raised);
}

/* Идущая партия. Тёплое свечение и золотая грань — это состояние «прямо
   сейчас», ради которого человек и открыл приложение. */
.tp-dash-primary[data-primary="online"] .tp-dash-primary__card {
    border: 1px solid color-mix(in srgb, var(--tp-color-primary) 38%, transparent);
    background:
        radial-gradient(120% 100% at 0% 0%, color-mix(in srgb, var(--tp-color-primary) 13%, transparent), transparent 62%),
        var(--dash-surface-raised);
    background-color: var(--dash-surface-raised);
    box-shadow: 0 10px 30px -18px color-mix(in srgb, var(--tp-color-primary) 60%, transparent);
}

.tp-dash-primary[data-primary="ai"] .tp-dash-primary__card {
    border: 1px solid var(--dash-hairline);
    background:
        radial-gradient(120% 100% at 100% 0%, color-mix(in srgb, var(--tp-color-primary) 9%, transparent), transparent 60%),
        var(--dash-surface-raised);
    background-color: var(--dash-surface-raised);
}

.tp-dash-primary__kicker {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-size: var(--type-meta-size);
    font-weight: 500;
    color: var(--tp-color-text-muted);
}
.tp-dash-primary__kicker i { font-size: 11px; color: var(--tp-color-primary); }
.tp-dash-primary__tc { margin-left: auto; font-weight: 500; color: var(--tp-color-text-subtle); }

.tp-dash-live-dot { font-size: 8px !important; animation: tp-dash-pulse 2.2s var(--tp-ease-standard) infinite; }
@keyframes tp-dash-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Двое за столом */
.tp-dash-match { display: flex; align-items: center; gap: 6px; }
.tp-dash-match__player { display: flex; align-items: center; gap: 7px; flex: 1 1 0; min-width: 0; }
.tp-dash-match__player--them { flex-direction: row-reverse; text-align: right; }

.tp-dash-match__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--dash-surface-hover);
    color: var(--tp-color-text-muted);
    font-family: var(--type-ui-family);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.tp-dash-match__player--you .tp-dash-match__mark {
    background: color-mix(in srgb, var(--tp-color-primary) 22%, #2a2724);
    color: var(--tp-color-primary);
}

.tp-dash-match__copy { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.tp-dash-match__name {
    font-size: 14px;
    font-weight: var(--type-card-weight);
    line-height: 1.25;
    color: var(--tp-color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tp-dash-match__rating { font-family: var(--type-num-family); font-variant-numeric: tabular-nums; font-size: 11px; color: var(--tp-color-text-muted); }
.tp-dash-match__vs { flex: 0 0 auto; font-size: 10px; color: var(--tp-color-text-subtle); }

.tp-dash-primary__status {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--tp-color-text-muted);
}
.tp-dash-primary__pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}
.tp-dash-primary__status--go { color: var(--tp-color-success); }
.tp-dash-primary__status--wait { color: var(--tp-color-text-muted); }

/* Партия с движком: портрет уровня даёт ей собственное лицо. */
.tp-dash-ai { display: flex; align-items: center; gap: var(--tp-space-3); }
.tp-dash-ai__copy { flex: 1 1 auto; }
.tp-dash-ai__portrait {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background:
        radial-gradient(100% 100% at 30% 12%, var(--dash-art-warm), var(--dash-art-base));
    box-shadow: inset 0 0 0 1px var(--dash-hairline);
}
/* Монограмма 9Q продукта, залитая золотом через маску: цвет задаём мы, а не
   файл, поэтому знак живёт в тёплой гамме карточки. */
.tp-dash-ai__portrait::before {
    content: "";
    width: 31px;
    height: 31px;
    background: var(--tp-color-primary);
    -webkit-mask: url("/static/icons/brand-9q-mono.svg") no-repeat center / contain;
    mask: url("/static/icons/brand-9q-mono.svg") no-repeat center / contain;
}

.tp-dash-ai__copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* Витринное начертание получают ровно две вещи на экране: имя движка и
   заголовок новости. Оно и работает потому, что встречается редко. */
.tp-dash-ai__name { font-family: var(--type-display-family); font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--tp-color-text); }
.tp-dash-ai__meta { font-family: var(--type-ui-family); font-size: var(--type-meta-size); font-weight: var(--type-meta-weight); color: var(--dash-accent); }
.tp-dash-ai__score { display: inline-flex; align-items: baseline; gap: 4px; font-size: 13px; color: var(--tp-color-text-muted); }
.tp-dash-ai__score-mine { color: var(--tp-color-primary); font-weight: 700; }
.tp-dash-ai__score-sep { opacity: 0.5; }

.tp-dash-primary__go {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 11px;
    background: color-mix(in srgb, var(--tp-color-primary) 16%, transparent);
    color: var(--tp-color-primary);
    font-family: var(--tp-font-sans);
    font-size: 13px;
    font-weight: var(--type-button-weight);
    cursor: pointer;
    transition: background var(--tp-motion-fast) var(--tp-ease-standard);
}
.tp-dash-primary__go:hover { background: color-mix(in srgb, var(--tp-color-primary) 26%, transparent); }
.tp-dash-primary__go i { font-size: 11px; }

.tp-dash-primary__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 var(--tp-space-4);
    border-radius: 12px;
    font-size: 14px;
    font-weight: var(--type-button-weight);
}
.tp-dash-primary__actions { display: flex; flex-wrap: wrap; gap: var(--tp-space-2); }
.tp-dash-primary__actions > .tp-dash-primary__go {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 11px;
    background: color-mix(in srgb, var(--tp-color-primary) 16%, transparent);
    color: var(--tp-color-primary);
    font-family: var(--tp-font-sans);
    font-size: 13px;
    font-weight: var(--type-button-weight);
    cursor: pointer;
    transition: background var(--tp-motion-fast) var(--tp-ease-standard);
}
.tp-dash-primary__go:hover { background: color-mix(in srgb, var(--tp-color-primary) 26%, transparent); }
.tp-dash-primary__go i { font-size: 11px; }

.tp-dash-primary__cta { flex: 1 1 auto; }
.tp-dash-primary > .tp-dash-primary__card > .tp-dash-primary__go {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 11px;
    background: color-mix(in srgb, var(--tp-color-primary) 16%, transparent);
    color: var(--tp-color-primary);
    font-family: var(--tp-font-sans);
    font-size: 13px;
    font-weight: var(--type-button-weight);
    cursor: pointer;
    transition: background var(--tp-motion-fast) var(--tp-ease-standard);
}
.tp-dash-primary__go:hover { background: color-mix(in srgb, var(--tp-color-primary) 26%, transparent); }
.tp-dash-primary__go i { font-size: 11px; }

.tp-dash-primary__cta { align-self: stretch; }

/* Завершённая партия и пустое состояние ничего не требуют сейчас — они
   строки, и собственной карточки им не положено. */
.tp-dash-primary__card[data-compact] { padding: 0; background: none; border: 0; box-shadow: none; gap: 0; }

.tp-dash-lead {
    display: flex;
    align-items: center;
    gap: var(--tp-space-3);
    width: 100%;
    min-height: 60px;
    padding: 8px var(--tp-space-3);
    border: 0;
    border-radius: var(--dash-radius);
    background: var(--dash-surface);
    color: var(--tp-color-text);
    font-family: var(--tp-font-sans);
    text-align: left;
    cursor: pointer;
    transition: background var(--tp-motion-fast) var(--tp-ease-standard);
}
.tp-dash-lead:hover { background: var(--dash-surface-raised); }

.tp-dash-lead__copy { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.tp-dash-lead__kicker { font-size: 11px; font-weight: var(--type-meta-weight); color: var(--tp-color-text-subtle); }
.tp-dash-lead__line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-family: var(--type-ui-family);
    font-size: var(--type-card-size);
    font-weight: var(--type-card-weight);
    line-height: 1.25;
}
.tp-dash-lead__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-dash-lead__meta { font-size: var(--type-meta-size); font-weight: var(--type-meta-weight); color: var(--tp-color-text-muted); }
.tp-dash-lead__chevron { font-size: 12px; color: var(--tp-color-text-subtle); flex: 0 0 auto; }

/* ── Горизонтальные дорожки ──────────────────────────────────────────────
   Отрицательные поля вытягивают дорожку до края экрана, чтобы плитка не
   обрывалась в пустоте, а `padding` возвращает те же 16px первому и
   последнему элементу. */

.tp-dash-row {
    display: flex;
    gap: var(--dash-gap-tile);
    overflow-x: auto;
    overflow-y: hidden;
    margin-inline: calc(-1 * var(--tp-space-4));
    padding: 1px var(--tp-space-4);
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.tp-dash-row::-webkit-scrollbar { display: none; }

/* Класс ставит ui/home-dashboard.js, когда дорожка действительно длиннее
   экрана: обрезанная плитка должна читаться как продолжение, а не как обрыв. */
.tp-dash-row.is-scrollable {
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent 100%);
}

/* ── Режимы игры ─────────────────────────────────────────────────────────
   Действия, а не витрина возможностей: крупный значок, название, контроль
   времени. Без обводки — плитку держит тон. */

.tp-dash-tile {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    flex: 0 0 auto;
    min-width: 84px;
    max-width: 172px;
    min-height: 52px;
    padding: 9px 11px;
    border: 0;
    border-radius: var(--dash-radius);
    background: var(--dash-surface);
    color: var(--tp-color-text);
    font-family: var(--tp-font-sans);
    text-align: left;
    overflow: hidden;
    scroll-snap-align: start;
    cursor: pointer;
    transition: background var(--tp-motion-fast) var(--tp-ease-standard);
}
button.tp-dash-tile:hover { background: var(--dash-surface-raised); }
div.tp-dash-tile { cursor: default; }

.tp-dash-tile__value {
    min-width: 0;
    max-width: 100%;
    font-family: var(--tp-font-sans);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--tp-color-text);
}
.tp-dash-tile__label { font-size: 11px; font-weight: var(--type-meta-weight); line-height: 1.2; color: var(--tp-color-text-muted); }
.tp-dash-tile__detail { font-size: 11px; line-height: 1.25; color: var(--tp-color-text-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tp-dash-tile--play {
    /* Ширина фиксирована, а не «по содержимому»: при 390px три плитки плюс
       промежутки занимают 333px из 358, и от четвёртой остаётся ровно
       четверть — видно значок и начало названия. Это читается как
       продолжение ряда, а не как оборванное на середине слово. */
    flex: 0 0 113px;
    min-width: 113px;
    justify-content: flex-start;
    gap: 5px;
    min-height: 76px;
    padding: 11px;
}
/* Значки режимов — самая выразительная роль на экране: это действия. */
.tp-dash-tile--play > i { font-size: 17px; color: var(--tp-color-primary); }
.tp-dash-tile--play .tp-dash-tile__value { font-weight: var(--type-card-weight); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-dash-tile--play .tp-dash-tile__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Показатели: сильное число, тихая подпись, никакой рамки. */
.tp-dash-tile--stat { min-width: 76px; align-items: flex-start; background: var(--dash-surface); }
/* У показателей свой характер: моноширинный набор с табличными цифрами —
   числа не пляшут при обновлении и не спорят с заголовками за витринный
   шрифт. Число сильнее подписи, а не наравне с ней. */
.tp-dash-tile--stat .tp-dash-tile__value {
    font-family: var(--type-num-family);
    font-size: var(--type-stat-size);
    font-weight: var(--type-stat-weight);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    color: var(--tp-color-text);
}
.tp-dash-tile--stat .tp-dash-tile__label { font-weight: var(--type-meta-weight); }
/* Золото остаётся ровно одному числу — рейтингу. */
#home-progress-row .tp-dash-tile--stat:first-child .tp-dash-tile__value { color: var(--tp-color-primary); }

/* ── Сегодня ─────────────────────────────────────────────────────────────
   Задача дня зовёт к действию, поэтому она шире и с названием. Серия и
   счёт решённых — показания, им хватает малого размера. */

.tp-dash-today {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    min-height: 58px;
    padding: 10px 12px;
    border: 0;
    border-radius: var(--dash-radius);
    background: var(--dash-surface);
    color: var(--tp-color-text);
    font-family: var(--tp-font-sans);
    text-align: left;
    overflow: hidden;
    scroll-snap-align: start;
    cursor: pointer;
    transition: background var(--tp-motion-fast) var(--tp-ease-standard);
}
.tp-dash-today:hover { background: var(--dash-surface-raised); }

.tp-dash-today--wide { flex: 1 1 auto; min-width: 190px; max-width: 240px; }
.tp-dash-today--mini { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; min-width: 74px; }

.tp-dash-today__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    /* Служебная роль: приглушённая подложка и нейтральный цвет. Задача дня
       не должна спорить за внимание с идущей партией и новостью, а золото
       обесценивается, если им покрашен каждый значок подряд. */
    background: var(--dash-surface-hover);
    color: var(--tp-color-text-muted);
    font-size: 15px;
}
.tp-dash-today__copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tp-dash-today__label { font-size: 11px; font-weight: var(--type-meta-weight); color: var(--tp-color-text-muted); }
.tp-dash-today__value {
    max-width: 100%;
    font-size: var(--type-body-size);
    font-weight: var(--type-body-weight);
    line-height: 1.25;
    color: var(--tp-color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tp-dash-today--mini .tp-dash-today__value {
    font-family: var(--type-num-family);
    font-size: 18px;
    font-weight: var(--type-stat-weight);
    font-variant-numeric: tabular-nums;
}

/* ── Лига ────────────────────────────────────────────────────────────────
   Не ещё одна строка статистики, а вход в раздел. */

.tp-dash-wide {
    display: flex;
    align-items: center;
    gap: var(--tp-space-3);
    width: 100%;
    min-height: 64px;
    padding: 10px var(--tp-space-3);
    border: 0;
    border-radius: var(--dash-radius);
    background: var(--dash-surface);
    color: var(--tp-color-text);
    font-family: var(--tp-font-sans);
    text-align: left;
    cursor: pointer;
    transition: background var(--tp-motion-fast) var(--tp-ease-standard);
}
.tp-dash-wide:hover { background: var(--dash-surface-raised); }

.tp-dash-wide__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    /* Лига — вход в раздел, поэтому медальон отличается формой и рамкой,
       а не просто цветом заливки. */
    border-radius: 12px;
    background: color-mix(in srgb, var(--tp-color-primary) 13%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tp-color-primary) 26%, transparent);
    color: var(--tp-color-primary);
    font-size: 16px;
}
.tp-dash-wide__copy { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.tp-dash-wide__copy strong { font-size: var(--type-card-size); font-weight: var(--type-card-weight); color: var(--tp-color-text); }
.tp-dash-wide__detail { font-size: var(--type-meta-size); font-weight: var(--type-meta-weight); line-height: 1.3; color: var(--tp-color-text-muted); }
.tp-dash-wide__chevron { font-size: 12px; color: var(--tp-color-text-subtle); flex: 0 0 auto; }

/* ── Сообщество ──────────────────────────────────────────────────────────
   Люди с лицами, а не счётчики в прямоугольниках. */

.tp-dash-person {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    min-width: 150px;
    max-width: 210px;
    min-height: 58px;
    padding: 9px 11px;
    border: 0;
    border-radius: var(--dash-radius);
    background: var(--dash-surface);
    color: var(--tp-color-text);
    font-family: var(--tp-font-sans);
    text-align: left;
    overflow: hidden;
    scroll-snap-align: start;
    cursor: pointer;
    transition: background var(--tp-motion-fast) var(--tp-ease-standard);
}
.tp-dash-person:hover { background: var(--dash-surface-raised); }

.tp-dash-person__avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--dash-surface-hover);
    font-size: 17px;
    line-height: 1;
}
.tp-dash-person__avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.tp-dash-person__avatar--icon { border-radius: 11px; color: var(--tp-color-text-muted); font-size: 15px; }

.tp-dash-person__dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--tp-color-success);
    box-shadow: 0 0 0 2.5px var(--dash-surface);
}

.tp-dash-person__copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tp-dash-person__name {
    font-size: var(--type-body-size);
    font-weight: var(--type-card-weight);
    color: var(--tp-color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tp-dash-person__meta {
    font-size: 11px;
    color: var(--tp-color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── История ─────────────────────────────────────────────────────────────
   Список строк на одной поверхности, а не карточка на каждую партию. */

.tp-dash-history {
    display: flex;
    flex-direction: column;
    border: 0;
    border-radius: var(--dash-radius);
    background: var(--dash-surface);
    overflow: hidden;
}

.tp-dash-history-row {
    display: flex;
    align-items: center;
    gap: var(--tp-space-2);
    min-height: 46px;
    padding: 6px var(--tp-space-3);
    border: 0;
    border-top: 1px solid var(--dash-hairline);
    background: none;
    color: var(--tp-color-text);
    font-family: var(--tp-font-sans);
    text-align: left;
    cursor: pointer;
}
.tp-dash-history-row:first-child { border-top: 0; }
.tp-dash-history-row:hover { background: var(--dash-surface-raised); }

.tp-dash-history-row__name { flex: 1 1 auto; min-width: 0; font-size: var(--type-body-size); font-weight: var(--type-body-weight); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-dash-history-row__meta { font-family: var(--type-num-family); font-size: 11px; font-variant-numeric: tabular-nums; color: var(--tp-color-text-subtle); white-space: nowrap; }
.tp-dash-history-row > i { font-size: 11px; color: var(--tp-color-text-subtle); }

/* Итог партии — цветом текста и тихой подложкой, без яркой пилюли. */
.tp-dash-lead .tp-result-badge,
.tp-dash-history-row .tp-result-badge {
    flex: 0 0 auto;
    padding: 2px 8px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
}

/* ── Новость: единственный визуально богатый блок ────────────────────────
   Она обязана выглядеть новостью, а не строкой лиги и не строкой матча.
   Графика — собственная фирменная отрисовка доски, лежащая в проекте;
   выдавать декоративную картинку за фотографию события нечестно, а пустой
   прямоугольник вместо неё — уныло. */

.tp-dash-feature {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: var(--dash-surface-raised);
    color: var(--tp-color-text);
    font-family: var(--tp-font-sans);
    text-align: left;
    overflow: hidden;
    cursor: pointer;
    transition: background var(--tp-motion-fast) var(--tp-ease-standard);
}
.tp-dash-feature:hover { background: var(--dash-surface-hover); }

/* Графика занимает треть ширины, а не половину высоты экрана. */
.tp-dash-feature__art {
    position: relative;
    display: block;
    flex: 0 0 34%;
    max-width: 132px;
    align-self: stretch;
    background:
        radial-gradient(88% 120% at 50% 8%, var(--dash-art-glow), transparent 72%),
        linear-gradient(158deg, var(--dash-art-warm), var(--dash-art-base));
    overflow: hidden;
}

/* Орнамент — тот же ою, что живёт в теме продукта. */
.tp-dash-feature__art::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--rich-oyu-soft, none);
    background-repeat: no-repeat;
    background-position: 128% -40%;
    background-size: 104px 104px;
    opacity: 0.34;
}

/* Три лунки с кумалаками: знак самой игры в компактном формате. */
.tp-dash-feature__pits {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    display: flex;
    gap: 6px;
    transform: translate(-50%, -50%);
}
.tp-dash-feature__pit {
    width: 24px;
    height: 32px;
    border-radius: 12px / 16px;
    background:
        radial-gradient(circle at 50% 28%, var(--dash-stone) 0 3.2px, transparent 3.4px),
        radial-gradient(circle at 33% 60%, var(--dash-stone) 0 2.9px, transparent 3.1px),
        radial-gradient(circle at 67% 64%, var(--dash-stone) 0 2.7px, transparent 2.9px),
        linear-gradient(180deg, rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.24));
    box-shadow: inset 0 1px 0 var(--dash-art-glow);
}
.tp-dash-feature__pit:first-child,
.tp-dash-feature__pit:last-child { opacity: 0.55; }

/* Мягкая грань между графикой и текстом вместо жёсткой линии шва. */
.tp-dash-feature__art::after {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    width: 34px;
    background: linear-gradient(90deg, transparent, var(--dash-surface-raised));
}

.tp-dash-feature__copy {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 12px var(--tp-space-4) 12px 12px;
}

.tp-dash-feature__tag {
    align-self: flex-start;
    padding: 3px 8px;
    border-radius: var(--tp-radius-pill);
    background: color-mix(in srgb, var(--tp-color-primary) 18%, transparent);
    color: var(--tp-color-primary);
    font-family: var(--type-ui-family);
    font-size: 10px;
    font-weight: 700;
    /* Единственное место, где прописные уместны: маленькая редакционная
       метка. Заголовки разделов набираются обычным предложением. */
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.tp-dash-feature__title {
    font-family: var(--type-display-family);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--tp-color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tp-dash-feature__summary {
    font-family: var(--type-ui-family);
    font-size: var(--type-meta-size);
    font-weight: var(--type-meta-weight);
    line-height: 1.35;
    color: var(--tp-color-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tp-dash-feature__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--tp-space-3); }
.tp-dash-feature__date { font-family: var(--type-num-family); font-size: 11px; font-variant-numeric: tabular-nums; color: var(--tp-color-text-subtle); }
/* Новости не нужен ещё один золотой значок: её опознают графика, метка и
   заголовок. Стрелка здесь — тихая навигационная подсказка. */
.tp-dash-feature__go { font-size: 12px; color: var(--tp-color-text-subtle); }

/* Ручные редакционные записи ниже — тише, чем главный анонс. */
.tp-dash-news-list { display: flex; flex-direction: column; gap: var(--dash-gap-tile); }
.tp-dash-news-list.is-empty { display: none; }
.tp-dash-news {
    display: flex;
    align-items: center;
    gap: var(--tp-space-3);
    width: 100%;
    padding: 10px var(--tp-space-3);
    border: 0;
    border-radius: var(--dash-radius);
    background: var(--dash-surface);
    color: var(--tp-color-text);
    font-family: var(--tp-font-sans);
    text-align: left;
}
.tp-dash-news__image { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; }
.tp-dash-news__copy { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; text-decoration: none; color: inherit; }
.tp-dash-news__meta { margin: 0; font-size: 11px; color: var(--tp-color-text-muted); }
.tp-dash-news__title { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--tp-color-text); }
.tp-dash-news__summary {
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
    color: var(--tp-color-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tp-dash-news__chevron { font-size: 11px; color: var(--tp-color-text-subtle); flex: 0 0 auto; }

/* ── Окно новости ────────────────────────────────────────────────────────
   Позиционирование задано явно: правило
   `body:not(.game-active) .modal-overlay { position: relative }` из
   inline-styles.css иначе роняет оверлей в поток документа. */

.tp-news-dialog {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10050 !important;
    padding: var(--tp-space-4);
    background: rgba(8, 7, 6, 0.78) !important;
    overflow-y: auto;
}
.tp-news-dialog:not(.open) { display: none !important; }
.tp-news-dialog.open { display: flex !important; align-items: center; justify-content: center; }

.tp-news-dialog__sheet {
    width: min(560px, 100%);
    max-height: min(86dvh, 720px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--tp-space-4);
    border: 1px solid var(--dash-hairline);
    border-radius: 18px;
    background: var(--tp-color-surface);
    box-shadow: var(--tp-shadow-md);
}
.tp-news-dialog__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--tp-space-3); margin-bottom: var(--tp-space-3); }
.tp-news-dialog__bar h2 { margin: 0; font-family: var(--tp-font-sans); font-size: 15px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--tp-color-text); }
.tp-news-dialog__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: -11px -11px -11px 0;
    border: 0;
    background: none;
    color: var(--tp-color-text-muted);
    font-size: 16px;
    cursor: pointer;
}
.tp-news-dialog__close:hover { color: var(--tp-color-text); }
.tp-news-dialog .tp-release-news__card { grid-template-columns: minmax(0, 1fr); padding: 0; border: 0; background: none; }

/* ── Верхняя панель оболочки ─────────────────────────────────────────────
   Логотип не должен забирать первый экран себе. Высоту панели не трогаем —
   она уже в норме; уменьшается только знак внутри неё. */
@media (max-width: 767px) {

    /* Нижняя панель: состав и маршруты не тронуты, убрана только лишняя
       масса — запас под неё был почти вдвое больше самой панели, и главная
       заканчивалась широкой мёртвой полосой. Касаемая площадь пункта
       остаётся не меньше 44px. */
    :root { --tp-mobile-nav-height: 78px; }
    .tp-mobile-nav__item { padding-block: 6px; }
    .tp-mobile-nav__item.is-active { background: color-mix(in srgb, var(--tp-color-primary) 13%, transparent); }
}

/* ── Скелет первой отрисовки ─────────────────────────────────────────────── */

.tp-dash-primary[aria-busy="true"] {
    padding: var(--tp-space-4);
    border-radius: 18px;
    background: var(--dash-surface-raised);
}
.tp-dash-primary[aria-busy="true"] .tp-skeleton--title { margin-top: 0; }

/* ── Планшет и рабочий стол ──────────────────────────────────────────────
   Те же компоненты в двух колонках: отдельного настольного макета эта
   задача не строит. */

@media (min-width: 768px) {
    .tp-dash .tp-dash__content { max-width: var(--tp-home-max); margin-inline: auto; gap: 28px; }
    .tp-dash-id__name { font-size: 19px; }
    .tp-dash-row { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; overflow-x: visible; }
    .tp-dash-row.is-scrollable { mask-image: none; -webkit-mask-image: none; }
    .tp-dash-tile { flex: 1 1 140px; max-width: none; }
    .tp-dash-tile--stat { flex: 1 1 110px; }
    .tp-dash-feature__art { height: 168px; }
}

@media (min-width: 1024px) {
    .tp-dash .tp-dash__content {
        display: grid;
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
        align-items: start;
        column-gap: 28px;
    }
    .tp-dash-id,
    .tp-dash-primary { grid-column: 1 / -1; }
}

/* ── Уменьшить движение ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .tp-dash-live-dot { animation: none; }
    .tp-dash-tile,
    .tp-dash-today,
    .tp-dash-person,
    .tp-dash-wide,
    .tp-dash-lead,
    .tp-dash-feature { transition: none; }
}

/* Game-first Home composition. The board and live state share one surface;
   everything below reads as supporting information, not another dashboard. */
.tp-dash .tp-dash__content { gap: 24px; }
.tp-dash-stage {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    min-height: 306px;
    overflow: hidden;
    border: 1px solid var(--tp-game-line);
    border-radius: 16px;
    background: var(--tp-game-surface);
}
.tp-dash-stage__board { position: relative; min-height: 306px; overflow: hidden; background: var(--tp-color-wood); }
.tp-dash-stage__board img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.tp-dash-stage__board::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(10, 7, 5, .86), transparent 64%);
    pointer-events: none;
}
.tp-dash-stage__wordmark {
    position: absolute;
    z-index: 1;
    left: 32px;
    bottom: 27px;
    font-family: var(--tp-font-display);
    font-size: clamp(20px, 2.3vw, 31px);
    font-weight: 700;
    line-height: 1.16;
    letter-spacing: .045em;
    color: var(--tp-color-text);
    text-shadow: 0 2px 12px var(--tp-color-page);
}
#screen-home .tp-dash-stage .tp-dash-primary { display: flex; grid-column: auto; align-items: stretch; min-width: 0; padding: clamp(24px, 3vw, 44px); }
#screen-home .tp-dash-stage .tp-dash-primary__card {
    display: flex;
    flex: 1;
    justify-content: center;
    gap: 18px;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}
.tp-dash-primary__headline {
    margin: 0;
    font-family: var(--tp-font-display);
    font-size: clamp(21px, 2vw, 27px);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.025em;
    color: var(--tp-color-text);
}
.tp-dash-primary__detail { margin: -6px 0 0; font-size: 14px; line-height: 1.5; color: var(--tp-color-text-muted); }
.tp-dash-primary__start,
#screen-home .tp-dash-stage .tp-dash-primary__go,
#screen-home .tp-dash-stage .tp-dash-primary__cta {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    align-self: flex-start;
    min-width: 210px;
    min-height: 52px;
    padding: 0 19px;
    border: 1px solid var(--tp-color-primary);
    border-radius: 9px;
    background: var(--tp-color-primary);
    color: var(--tp-color-primary-ink);
    font-family: var(--tp-font-sans);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--tp-game-interaction), border-color var(--tp-game-interaction);
}
.tp-dash-primary__start:hover,
#screen-home .tp-dash-stage .tp-dash-primary__go:hover,
#screen-home .tp-dash-stage .tp-dash-primary__cta:hover {
    border-color: var(--tp-color-primary-hover);
    background: var(--tp-color-primary-hover);
}
.tp-dash-primary__start:active,
#screen-home .tp-dash-stage .tp-dash-primary__go:active,
#screen-home .tp-dash-stage .tp-dash-primary__cta:active {
    border-color: var(--tp-color-primary-pressed);
    background: var(--tp-color-primary-pressed);
}
.tp-dash-primary__start:focus-visible,
#screen-home .tp-dash-stage .tp-dash-primary__go:focus-visible,
#screen-home .tp-dash-stage .tp-dash-primary__cta:focus-visible,
.tp-dash-block--modes .tp-dash-tile--play:focus-visible {
    outline: 2px solid var(--tp-color-primary-hover);
    outline-offset: 3px;
}
.tp-dash-stage .tp-dash-ai { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px 16px; }
.tp-dash-stage .tp-dash-ai__portrait { width: 64px; height: 64px; }
.tp-dash-stage .tp-dash-ai__name { font-size: 20px; }
.tp-dash-stage .tp-dash-ai__meta { font-size: 13px; }
.tp-dash-stage .tp-dash-ai .tp-dash-primary__go { grid-column: 1 / -1; margin-top: 10px; }
.tp-dash-stage .tp-dash-match { margin-block: 4px; }
.tp-dash-stage .tp-dash-match__name { font-size: 16px; }
.tp-dash-stage .tp-dash-primary__status { font-size: 14px; }
.tp-dash-stage .tp-dash-lead { padding: 13px 0 0; border-top: 1px solid var(--tp-game-line); border-radius: 0; background: none; }
.tp-dash-stage .tp-dash-lead:hover { background: none; }
.tp-dash-stage .tp-dash-lead__line { font-size: 14px; }

.tp-dash-block--modes .tp-dash-row--modes { gap: 0; border-block: 1px solid var(--dash-hairline); }
.tp-dash-block--modes .tp-dash-tile--play {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-content: center;
    column-gap: 10px;
    flex: 1 1 0;
    max-width: none;
    min-height: 72px;
    padding: 10px 18px;
    border-right: 1px solid var(--dash-hairline);
    border-radius: 0;
    background: transparent;
    transition: background var(--tp-game-interaction);
}
.tp-dash-block--modes .tp-dash-tile--play:last-child { border-right: 0; }
.tp-dash-block--modes .tp-dash-tile--play > i { grid-row: 1 / 3; align-self: center; font-size: 18px; }
.tp-dash-block--modes .tp-dash-tile--play .tp-dash-tile__value { font-size: 15px; }
.tp-dash-block--modes .tp-dash-tile--play .tp-dash-tile__label { font-size: 12px; }
.tp-dash-block--modes .tp-dash-tile--play:hover { background: var(--dash-surface-raised); }
.tp-dash-block--modes .tp-dash-block__head h2 { font-size: 17px; }
.tp-dash-block--news { opacity: .88; }

@media (min-width: 768px) {
    .tp-dash .tp-dash__content { max-width: 1280px; gap: 24px; }
    .tp-dash-block--modes, .tp-dash-stage { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
    .tp-dash-stage { display: block; }
    .tp-dash-stage__board { min-height: 0; height: 154px; }
    .tp-dash-stage__wordmark { left: 20px; bottom: 16px; font-size: 20px; }
    #screen-home .tp-dash-stage .tp-dash-primary { padding: 22px; }
    #screen-home .tp-dash-stage .tp-dash-primary__card { gap: 13px; }
    .tp-dash-stage .tp-dash-ai .tp-dash-primary__go { margin-top: 2px; }
    .tp-dash-primary__start,
    #screen-home .tp-dash-stage .tp-dash-primary__go,
    #screen-home .tp-dash-stage .tp-dash-primary__cta { width: 100%; }
    .tp-dash-block--modes .tp-dash-tile--play { flex: 0 0 152px; padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .tp-dash-primary__start,
    #screen-home .tp-dash-stage .tp-dash-primary__go,
    #screen-home .tp-dash-stage .tp-dash-primary__cta,
    .tp-dash-block--modes .tp-dash-tile--play { transition: none; }
}

/* Obsidian Sand Home refinement. The preset supplies every color; these
   local roles give the game surface, supporting rows, and actions distinct
   levels without changing Home's content or the other theme presets. */
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home.tp-dash {
    --dash-surface: var(--tp-color-surface);
    --dash-surface-raised: var(--tp-color-surface-raised);
    --dash-surface-hover: color-mix(in srgb, var(--tp-color-text) 5%, var(--tp-color-surface-raised));
    --dash-hairline: color-mix(in srgb, var(--tp-color-border) 58%, transparent);
    --dash-radius: 9px;
    --dash-interaction: 160ms ease;
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash__content { gap: 22px; }
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-id__name {
    font-size: 20px;
    font-weight: 700;
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-id__meta { font-size: 13px; }

html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home.tp-dash::after {
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--tp-color-page-secondary) 95%, transparent),
        color-mix(in srgb, var(--tp-color-page) 96%, transparent) 420px);
}

/* Header geometry belongs to header-component.css, independently of route. */

html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-block__head h2 {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.28;
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-block__link {
    color: var(--tp-color-text-muted);
    font-size: 14px;
    transition: color var(--dash-interaction);
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-block__link:hover {
    color: var(--tp-color-text);
}

html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-stage {
    border-color: var(--dash-hairline);
    border-radius: 10px;
    background: var(--tp-color-surface);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--tp-color-page) 18%, transparent),
        0 16px 36px color-mix(in srgb, var(--tp-color-page) 18%, transparent);
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-stage__board::after {
    background: linear-gradient(90deg, transparent 70%, var(--tp-color-surface) 100%),
        linear-gradient(0deg, color-mix(in srgb, var(--tp-color-page) 86%, transparent), transparent 64%);
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-stage .tp-dash-primary {
    padding-inline: clamp(28px, 3vw, 42px);
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-primary__kicker,
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-primary__detail {
    color: var(--tp-color-text-muted);
    font-size: 13px;
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-primary__headline {
    font-size: clamp(23px, 2vw, 29px);
    line-height: 1.22;
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-stage .tp-dash-ai__name {
    font-size: 22px;
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-primary__start,
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-stage .tp-dash-primary__go,
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-stage .tp-dash-primary__cta {
    min-height: 56px;
    padding-inline: 20px;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.2;
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--tp-color-text) 24%, transparent),
        0 2px 5px color-mix(in srgb, var(--tp-color-page) 18%, transparent);
    transition: background-color var(--dash-interaction), border-color var(--dash-interaction), box-shadow var(--dash-interaction);
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-primary__start:hover,
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-stage .tp-dash-primary__go:hover,
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-stage .tp-dash-primary__cta:hover {
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--tp-color-text) 32%, transparent),
        0 3px 8px color-mix(in srgb, var(--tp-color-page) 22%, transparent);
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-primary__start:active,
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-stage .tp-dash-primary__go:active,
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-stage .tp-dash-primary__cta:active {
    box-shadow: inset 0 2px 4px color-mix(in srgb, var(--tp-color-page) 22%, transparent);
}

html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-block--modes .tp-dash-row--modes {
    gap: 4px;
    margin-inline: 0;
    padding: 5px;
    border: 1px solid var(--dash-hairline);
    border-radius: 10px;
    background: var(--tp-color-surface);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--tp-color-text) 3%, transparent);
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-block--modes .tp-dash-tile--play {
    min-height: 68px;
    padding: 10px 16px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    transition: background-color var(--dash-interaction);
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-block--modes .tp-dash-tile--play:hover {
    background: var(--tp-color-surface-raised);
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-block--modes .tp-dash-tile--play .tp-dash-tile__label {
    color: var(--tp-color-text-muted);
    font-size: 13px;
    line-height: 1.3;
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-block--modes .tp-dash-tile--play .tp-dash-tile__value {
    font-size: 16px;
    font-weight: 700;
}
/* Three recessed pits identify the game once the large board has scrolled away. */
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-block--modes .tp-dash-block__head h2::before {
    content: "";
    display: inline-block;
    width: 30px;
    height: 16px;
    margin-right: 10px;
    vertical-align: -2px;
    background:
        radial-gradient(ellipse 3px 6px at 4px 50%, var(--tp-color-wood) 96%, transparent),
        radial-gradient(ellipse 3px 6px at 15px 50%, var(--tp-color-wood) 96%, transparent),
        radial-gradient(ellipse 3px 6px at 26px 50%, var(--tp-color-wood) 96%, transparent);
}

html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-tile--stat,
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-today {
    min-height: 62px;
    padding: 11px 13px;
    border-radius: 9px;
    background: var(--tp-color-surface);
    transition: background-color var(--dash-interaction);
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home #home-progress-row {
    gap: 0;
    margin-inline: 0;
    padding: 5px;
    border-radius: 10px;
    background: var(--tp-color-surface);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--tp-color-text) 3%, transparent),
        0 3px 10px color-mix(in srgb, var(--tp-color-page) 12%, transparent);
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home #home-progress-row .tp-dash-tile--stat {
    flex: 1 0 0;
    min-width: 82px;
    min-height: 68px;
    padding: 10px 14px;
    border-radius: 7px;
    background: transparent;
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home #home-progress-row button.tp-dash-tile--stat:hover {
    background: var(--tp-color-surface-raised);
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home #home-progress-row .tp-dash-tile--stat .tp-dash-tile__value {
    font-size: 24px;
    font-weight: 600;
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home #home-progress-row .tp-dash-tile--stat .tp-dash-tile__label,
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-today__label {
    font-size: 12px;
    color: var(--tp-color-text-muted);
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home button.tp-dash-tile--stat:hover,
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-today:hover {
    background: var(--tp-color-surface-raised);
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home #home-progress-row .tp-dash-tile--stat:first-child .tp-dash-tile__value {
    color: var(--tp-color-text);
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-wide {
    min-height: 68px;
    padding: 10px 12px 10px 0;
    border-top: 1px solid var(--dash-hairline);
    border-radius: 0;
    background: transparent;
    transition: background-color var(--dash-interaction);
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-wide:hover {
    background: var(--tp-color-surface);
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-wide__icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--tp-color-surface-raised);
    box-shadow: none;
    color: var(--tp-color-text-muted);
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-wide__copy strong { font-size: 16px; font-weight: 700; }
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-wide__detail {
    font-size: 13px;
    line-height: 1.4;
}

html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-block--news { opacity: 1; }
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-feature {
    display: block;
    border-top: 1px solid var(--dash-hairline);
    border-radius: 0;
    background: transparent;
    transition: border-color var(--dash-interaction);
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-feature:hover {
    border-top-color: var(--tp-color-text-muted);
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-feature__art {
    display: none;
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-feature__copy {
    gap: 8px;
    padding: 18px 10px 16px 0;
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-feature__tag {
    padding: 0;
    background: transparent;
    color: var(--tp-color-text-muted);
    font-size: 11px;
    letter-spacing: .06em;
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-feature__title {
    font-size: 19px;
    line-height: 1.32;
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-feature__summary {
    color: var(--tp-color-text-muted);
    font-size: 14px;
    line-height: 1.5;
    -webkit-line-clamp: 2;
}
html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-feature__date {
    font-size: 12px;
    color: var(--tp-color-text-muted);
}

@media (max-width: 767px) {

    html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-stage__board::after {
        background: linear-gradient(0deg, var(--tp-color-surface), transparent 58%);
    }
    html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-stage .tp-dash-primary {
        padding: 22px;
    }
    html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home .tp-dash-block--modes .tp-dash-tile--play {
        flex: 0 0 152px;
        padding-inline: 12px;
    }
    html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home #home-progress-row .tp-dash-tile--stat {
        flex: 1 1 0;
        min-width: 0;
        padding-inline: 8px;
    }
}

/* Desktop task titles use the available column instead of a mobile-size cap. */
@media (min-width: 1025px) {
    #screen-home.tp-dash #home-today-row .tp-dash-today--wide {
        min-width: 0;
        max-width: none;
    }
    #screen-home.tp-dash #home-today-row .tp-dash-today--wide .tp-dash-today__copy {
        flex: 1;
    }
    #screen-home.tp-dash #home-today-row .tp-dash-today--wide .tp-dash-today__value {
        white-space: normal;
        overflow-wrap: anywhere;
        text-overflow: clip;
    }
}

/* Keep supporting activity in view on short laptops; tall desktops retain
   the full illustration and the playable board is owned by its own styles. */
@media (min-width: 1025px) and (max-height: 820px) {
    #screen-home.tp-dash .tp-dash-stage,
    #screen-home.tp-dash .tp-dash-stage__board {
        min-height: 266px;
    }
    #screen-home.tp-dash .tp-dash-stage .tp-dash-primary {
        padding-block: 26px;
    }
    #screen-home.tp-dash .tp-dash-stage__board img {
        position: absolute;
        inset: 0;
    }
}

html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home button:focus-visible {
    outline: 2px solid var(--tp-color-primary-hover);
    outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    html:is([data-theme="obsidian-sand"], [data-theme="steppe-light"]) #screen-home button {
        transition: none;
    }
}

/* ── Последняя партия и дневная привычка ──────────────────────────────────
   Две личные карточки: что я сыграл (и одна кнопка в разбор) и что сегодня
   (серия + задача дня). Одна поверхность, тихая типографика, единственный
   цветной акцент — кнопка «Разобрать» и огонёк живой серии. */

html[data-theme] #screen-home .tp-dash-last { display: flex; flex-direction: column; flex: 1; min-width: 0; }
html[data-theme] #screen-home .tp-dash-last[aria-busy="true"]:empty { min-height: 84px; border-radius: 16px; background: var(--tp-material-1, var(--dash-surface)); }

html[data-theme] #screen-home .tp-dash-last__card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px 14px;
    flex: 1;
    min-height: 84px;
    margin: 0;
    padding: 14px 14px 14px 16px;
    border: 1px solid var(--tp-material-edge, var(--tp-color-border));
    border-radius: 16px;
    background: var(--tp-material-1, var(--dash-surface));
    box-shadow: inset 0 1px var(--tp-material-sheen, transparent);
    color: var(--tp-color-text);
}
html[data-theme] #screen-home .tp-dash-last__copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
html[data-theme] #screen-home .tp-dash-last__copy > p { margin: 0; }
html[data-theme] #screen-home .tp-dash-last__line { display: flex; align-items: center; gap: 8px; min-width: 0; }
html[data-theme] #screen-home .tp-dash-last__line .tp-result-badge { min-height: 22px; padding: 0 8px; }
html[data-theme] #screen-home .tp-dash-last__name {
    min-width: 0;
    overflow: hidden;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: -0.005em;
    text-overflow: ellipsis;
    white-space: nowrap;
}
html[data-theme] #screen-home .tp-dash-last__level { flex: 0 0 auto; font-size: 12px; color: var(--tp-color-text-muted); }
html[data-theme] #screen-home .tp-dash-last__verdict { font-size: 13px; line-height: 1.35; color: var(--tp-color-text); }
html[data-theme] #screen-home .tp-dash-last__meta { font-size: 12px; line-height: 1.4; color: var(--tp-color-text-muted); font-variant-numeric: tabular-nums; }
html[data-theme] #screen-home .tp-dash-last__review { min-height: 44px; padding-inline: 16px; border-radius: 12px; white-space: nowrap; font-weight: 650; }
html[data-theme] #screen-home .tp-dash-last__review > i { font-size: 14px; }
html[data-theme] #screen-home .tp-dash-last__review:active { transform: scale(0.97); transition: transform 100ms ease-out; }

/* «Сыграйте первую партию» — приглашение, а не пустая рамка. */
html[data-theme] #screen-home .tp-dash-last__card--empty .tp-dash-last__name { white-space: normal; }
html[data-theme] #screen-home .tp-dash-last__card--empty .tp-dash-last__meta { max-width: 46ch; }

/* Сегодня: одна карточка — серия сверху, задача дня под ней. */
html[data-theme] #screen-home #home-today-row { overflow: visible; }
html[data-theme] #screen-home #home-today-row .tp-dash-habit {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1 1 100%;
    grid-column: 1 / -1;
    gap: 0;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 1px solid var(--tp-material-edge, var(--tp-color-border));
    border-radius: 16px;
    background: var(--tp-material-1, var(--dash-surface));
    box-shadow: inset 0 1px var(--tp-material-sheen, transparent);
    color: var(--tp-color-text);
    font: inherit;
    text-align: left;
    overflow: hidden;
    cursor: pointer;
    transition: background-color var(--tp-motion-fast, 120ms) ease;
}
html[data-theme] #screen-home #home-today-row div.tp-dash-habit { cursor: default; }
html[data-theme] #screen-home #home-today-row button.tp-dash-habit:hover { background: var(--tp-color-surface-raised); }
html[data-theme] #screen-home #home-today-row button.tp-dash-habit:active { background: var(--tp-color-surface-soft); }

html[data-theme] #screen-home .tp-dash-habit__streak {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 11px;
    border-bottom: 1px solid var(--dash-hairline, var(--tp-color-border));
}
html[data-theme] #screen-home .tp-dash-habit__flame-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--dash-surface-hover, var(--tp-color-surface-soft));
    color: var(--tp-color-text-subtle);
}
html[data-theme] #screen-home .tp-dash-habit__flame { width: 18px; height: 18px; }
html[data-theme] #screen-home .tp-dash-habit[data-streak="on"] .tp-dash-habit__flame-wrap {
    background: color-mix(in srgb, var(--tp-color-warning) 16%, transparent);
    color: var(--tp-color-warning);
}
html[data-theme] #screen-home .tp-dash-habit__streak-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
html[data-theme] #screen-home .tp-dash-habit__streak-value { font-size: 15px; font-weight: 650; line-height: 1.25; letter-spacing: -0.005em; font-variant-numeric: tabular-nums; }
html[data-theme] #screen-home .tp-dash-habit__streak-note { font-size: 12px; line-height: 1.3; color: var(--tp-color-text-muted); }

html[data-theme] #screen-home .tp-dash-habit__week { display: inline-flex; align-items: center; gap: 4px; }
html[data-theme] #screen-home .tp-dash-habit__day {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--tp-color-text) 14%, transparent);
}
html[data-theme] #screen-home .tp-dash-habit__day.is-on { background: var(--tp-color-warning); }
html[data-theme] #screen-home .tp-dash-habit__day.is-today:not(.is-on) { background: transparent; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--tp-color-warning) 70%, transparent); }

html[data-theme] #screen-home .tp-dash-habit__task {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 11px 14px 12px;
}
html[data-theme] #screen-home .tp-dash-habit__task-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
html[data-theme] #screen-home .tp-dash-habit__task-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; font-size: 12px; color: var(--tp-color-text-muted); }
html[data-theme] #screen-home .tp-dash-habit__status--todo { color: var(--tp-color-primary); font-weight: 600; }
html[data-theme] #screen-home .tp-dash-habit__status--done { color: var(--tp-color-success); font-weight: 600; }
html[data-theme] #screen-home .tp-dash-habit__task-title { font-size: 14px; font-weight: 550; line-height: 1.3; color: var(--tp-color-text); overflow-wrap: anywhere; }
html[data-theme] #screen-home .tp-dash-habit[data-daily="done"] .tp-dash-habit__mark { background: color-mix(in srgb, var(--tp-color-success) 14%, transparent); color: var(--tp-color-success); }
html[data-theme] #screen-home .tp-dash-habit__chevron { font-size: 11px; color: var(--tp-color-text-subtle); }

@media (min-width: 1025px) {
    html[data-theme] #screen-home #home-today-row { min-height: 0; }
    html[data-theme] #screen-home #home-today-row .tp-dash-habit { min-height: 148px; }
    html[data-theme] #screen-home .tp-dash-habit__task { flex: 1; }
    html[data-theme] #screen-home .tp-dash-last__card { grid-template-columns: minmax(0, 1fr); align-content: space-between; min-height: 148px; padding: 16px; }
    html[data-theme] #screen-home .tp-dash-last__review { justify-self: start; }
}

/* The invitation has a longer button label: it sits under the copy. */
html[data-theme] #screen-home .tp-dash-last__card--empty { grid-template-columns: minmax(0, 1fr); align-content: start; }
html[data-theme] #screen-home .tp-dash-last__card--empty .tp-dash-last__review { justify-self: start; }

/* Phone and tablet: what is personal (last game, today) comes straight after
   the hero; other ways to play follow. Desktop keeps its own grid. */
@media (max-width: 1024px) {
    html[data-theme] #screen-home .tp-dash-block--last,
    html[data-theme] #screen-home .tp-dash-block--today { order: 1; }
    html[data-theme] #screen-home .tp-dash-block--modes { order: 2; }
    html[data-theme] #screen-home .tp-dash-dashboard > .tp-dash-block:not(.tp-dash-block--last, .tp-dash-block--today) { order: 3; }
}

/* Narrow phones: the button drops under the copy instead of squeezing it. */
@media (max-width: 359px) {
    html[data-theme] #screen-home .tp-dash-last__card { grid-template-columns: minmax(0, 1fr); }
    html[data-theme] #screen-home .tp-dash-last__review { justify-self: start; }
    html[data-theme] #screen-home .tp-dash-habit__week { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html[data-theme] #screen-home .tp-dash-last__review:active { transform: none; }
}
