/* ================================================================
   СЛОВО КАК ЗЕРКАЛО ИСТОРИИ
   ================================================================ */

.sz-root { padding: 28px 32px; }

@media (max-width: 640px) {
    .sz-root { padding: 18px 14px; }
}

/* ---------- Режимы ---------- */
.sz-modes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px dashed #E8E2DA;
}

.sz-mode {
    padding: 10px 20px;
    border: 1.5px solid #E8E2DA;
    background: #fff;
    border-radius: 999px;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #6B6470;
    cursor: pointer;
    transition: all .2s;
}

.sz-mode:hover { border-color: #6B3FA0; color: #6B3FA0; }

.sz-mode.is-active {
    background: #2A1745;
    color: #C6F432;
    border-color: #2A1745;
}

/* ---------- Основная сетка ---------- */
.sz-explore {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 900px) {
    .sz-explore { grid-template-columns: 1fr; }
}

/* ---------- Сайдбар ---------- */
.sz-sidebar {
    padding: 18px;
    background: #FAF6F0;
    border: 1.5px solid #E8E2DA;
    border-radius: 16px;
    position: sticky;
    top: 20px;
}

@media (max-width: 900px) {
    .sz-sidebar { position: static; }
}

.sz-sidebar__title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #6B6470;
    font-weight: 700;
    margin-bottom: 12px;
}

.sz-sidebar__groups { display: flex; flex-direction: column; gap: 14px; }

.sz-group__title {
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #6B3FA0;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 6px;
}

.sz-group__list { display: flex; flex-wrap: wrap; gap: 6px; }

.sz-word-btn {
    padding: 6px 12px;
    border: 1.5px solid #E8E2DA;
    background: #fff;
    border-radius: 999px;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    color: #2A1745;
    cursor: pointer;
    transition: all .15s;
}

.sz-word-btn:hover { border-color: #6B3FA0; background: #EDE4FF; }

.sz-word-btn.is-active {
    background: #6B3FA0;
    color: #fff;
    border-color: #6B3FA0;
}

/* ---------- Карточка слова ---------- */
.sz-main { min-height: 400px; }

.sz-empty {
    padding: 60px 30px;
    text-align: center;
    color: #6B6470;
    font-size: 15px;
    line-height: 1.7;
}

.sz-empty__icon { font-size: 48px; margin-bottom: 12px; }

.sz-word-header {
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 2px solid #6B3FA0;
}

.sz-word-header__pie {
    display: inline-block;
    padding: 4px 12px;
    background: #2A1745;
    color: #C6F432;
    border-radius: 999px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
}

.sz-word-header__title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 900;
    font-size: 34px;
    color: #2A1745;
    margin: 0 0 10px;
    line-height: 1.1;
}

@media (max-width: 640px) {
    .sz-word-header__title { font-size: 26px; }
}

.sz-word-header__note {
    font-size: 14.5px;
    line-height: 1.65;
    color: #1A1420;
    margin: 0;
}

/* ---------- Сетка семей ---------- */
.sz-families {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.sz-family {
    padding: 18px;
    border-radius: 16px;
    border: 2px solid #E8E2DA;
    background: #FAF6F0;
}

.sz-family--slavic { border-color: #A5D6A7; background: #F1F8E9; }
.sz-family--germanic { border-color: #90CAF9; background: #E3F2FD; }
.sz-family--romance { border-color: #FFAB91; background: #FBE9E7; }

.sz-family__title {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #2A1745;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sz-family__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.sz-family--slavic .sz-family__dot { background: #4CAF50; }
.sz-family--germanic .sz-family__dot { background: #1976D2; }
.sz-family--romance .sz-family__dot { background: #E53935; }

.sz-family__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sz-form {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 10px;
    align-items: baseline;
    padding: 8px 12px;
    background: #fff;
    border-radius: 10px;
    font-size: 14px;
}

.sz-form__lang {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6B6470;
    font-weight: 700;
}

.sz-form__word {
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    color: #2A1745;
    font-size: 15px;
}

.sz-form__ipa {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #6B3FA0;
}

/* ---------- Заглушки ---------- */
.sz-placeholder {
    padding: 60px 30px;
    text-align: center;
    border: 2px dashed #E8E2DA;
    border-radius: 18px;
    background: #FAF6F0;
}

.sz-placeholder__icon { font-size: 52px; margin-bottom: 14px; }

.sz-placeholder h3 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: 24px;
    color: #2A1745;
    margin: 0 0 10px;
}

.sz-placeholder p {
    font-size: 14.5px;
    color: #6B6470;
    max-width: 460px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ---------- Шпаргалки ---------- */
.sz-cheatsheet { display: flex; flex-direction: column; gap: 10px; }

.sz-details {
    border: 1.5px solid #E8E2DA;
    border-radius: 14px;
    overflow: hidden;
    background: #FAF6F0;
}

.sz-details summary {
    padding: 16px 20px;
    cursor: pointer;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: #2A1745;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background .2s;
}

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

.sz-details summary::after {
    content: '+';
    font-size: 22px;
    color: #6B3FA0;
    transition: transform .25s;
}

.sz-details[open] summary::after { transform: rotate(45deg); }
.sz-details summary:hover { background: #EDE4FF; }

.sz-details__body {
    padding: 0 20px 20px;
    font-size: 14.5px;
    line-height: 1.7;
    color: #1A1420;
}

.sz-details__body p:first-child { margin-top: 0; }
.sz-details__body p:last-child { margin-bottom: 0; }

.sz-details__body ul {
    padding-left: 20px;
    margin: 10px 0;
}

.sz-details__body li { margin-bottom: 6px; }

.sz-details__body strong { color: #2A1745; }

/* ---------- Адаптив ---------- */
@media (max-width: 640px) {
    .sz-form { grid-template-columns: 1fr; gap: 4px; }
    .sz-family { padding: 14px; }
}

/* ---------- Тепловая карта ---------- */
.sz-hm-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: 24px;
    color: #2A1745;
    margin: 0 0 8px;
}

.sz-hm-desc {
    font-size: 14.5px;
    line-height: 1.6;
    color: #6B6470;
    margin: 0 0 22px;
    max-width: 720px;
}

.sz-hm-wrap {
    overflow-x: auto;
    margin-bottom: 18px;
    padding-bottom: 4px;
}

.sz-hm-table {
    border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    margin: 0 auto;
}

.sz-hm-table th,
.sz-hm-table td {
    width: 34px;
    height: 34px;
    text-align: center;
    border: 1px solid #fff;
}

.sz-hm-head {
    background: #2A1745;
    color: #C6F432;
    font-weight: 700;
    font-size: 11px;
    padding: 6px 4px;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.sz-hm-cell {
    font-weight: 700;
    color: #1A1420;
    cursor: default;
    transition: transform .15s, box-shadow .15s;
}

.sz-hm-cell:hover {
    transform: scale(1.12);
    box-shadow: 0 0 0 2px #2A1745;
    z-index: 2;
    position: relative;
}

.sz-hm-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 13px;
    color: #6B6470;
    justify-content: center;
}

.sz-hm-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sz-hm-legend__item > span {
    width: 22px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid #ccc;
    display: inline-block;
}

/* ---------- Игра-детектор ---------- */
.sz-game {
    max-width: 640px;
    margin: 0 auto;
}

.sz-game__stats {
    display: flex;
    justify-content: center;
    gap: 28px;
    padding: 12px 18px;
    background: #FAF6F0;
    border-radius: 12px;
    margin-bottom: 24px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #6B6470;
}

.sz-game__stat strong { color: #6B3FA0; font-size: 15px; }

.sz-game__caption {
    text-align: center;
    font-size: 15px;
    color: #6B6470;
    margin: 0 0 20px;
}

.sz-game__pair {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    align-items: center;
    margin-bottom: 26px;
}

.sz-game__card {
    padding: 22px 20px;
    background: #FAF6F0;
    border: 2px solid #E8E2DA;
    border-radius: 16px;
    text-align: center;
    transition: border-color .2s;
}

.sz-game__card:hover { border-color: #6B3FA0; }

.sz-game__lang {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #6B6470;
    margin-bottom: 10px;
    font-weight: 700;
}

.sz-game__word {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: 28px;
    color: #2A1745;
    line-height: 1.1;
}

.sz-game__vs {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    color: #6B3FA0;
    font-weight: 700;
}

.sz-game__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.sz-btn {
    padding: 14px 24px;
    border: 2px solid transparent;
    border-radius: 999px;
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s, background .2s;
}

.sz-btn--yes {
    background: #E8F5E9;
    color: #2E7D32;
    border-color: #A5D6A7;
}
.sz-btn--yes:hover { background: #C8E6C9; transform: translateY(-2px); }

.sz-btn--no {
    background: #FFEBEE;
    color: #B71C1C;
    border-color: #FFCDD2;
}
.sz-btn--no:hover { background: #FFCDD2; transform: translateY(-2px); }

.sz-btn--next {
    background: #2A1745;
    color: #C6F432;
}
.sz-btn--next:hover { transform: translateY(-2px); background: #6B3FA0; }

.sz-game__verdict {
    padding: 22px;
    border-radius: 16px;
    margin-bottom: 22px;
    text-align: center;
}

.sz-game__verdict--ok { background: #E8F5E9; border: 2px solid #4CAF50; }
.sz-game__verdict--fail { background: #FFEBEE; border: 2px solid #E53935; }

.sz-game__verdict-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: 22px;
    margin-bottom: 10px;
}

.sz-game__verdict--ok .sz-game__verdict-title { color: #1B5E20; }
.sz-game__verdict--fail .sz-game__verdict-title { color: #B71C1C; }

.sz-game__verdict-text {
    font-size: 14.5px;
    line-height: 1.6;
    color: #1A1420;
    margin: 0;
}

/* ================================================================
   САЙДБАР — АККОРДЕОНЫ КАТЕГОРИЙ
   ================================================================ */

.sz-group-details {
    border-bottom: 1px solid #E8E2DA;
    padding: 0;
}

.sz-group-details:last-child {
    border-bottom: none;
}

/* Summary */
.sz-group-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 4px;
    cursor: pointer;
    list-style: none;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #4A1F3D;
    text-transform: uppercase;
    letter-spacing: .06em;
    transition: color .2s;
    user-select: none;
}

/* Убираем встроенный маркер <details> во всех браузерах */
.sz-group-summary::-webkit-details-marker { display: none; }
.sz-group-summary::marker { content: ''; }

.sz-group-summary:hover {
    color: #6B3FA0;
}

.sz-group-summary__title {
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Счётчик слов */
.sz-group-summary__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    background: #EDE4FF;
    color: #6B3FA0;
    border-radius: 999px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Стрелка-индикатор */
.sz-group-summary::after {
    content: '▾';
    display: inline-block;
    font-size: 12px;
    color: #6B3FA0;
    line-height: 1;
    transition: transform .25s ease;
    flex-shrink: 0;
}

.sz-group-details[open] .sz-group-summary::after {
    transform: rotate(180deg);
}

/* Список слов внутри открытого аккордеона */
.sz-group__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0 14px 0;
    animation: szGroupFade .25s ease;
}

@keyframes szGroupFade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* На случай, если где-то остался старый .sz-group — нейтрализуем конфликт */
.sz-sidebar .sz-group + .sz-group {
    margin-top: 0;
}