/* ================================================================
   ГИД ПО ОСНОВАМ ЛОГИКИ
   ================================================================ */

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

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

/* ---------- Тулбар ---------- */
.lg-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--line, #E8E2DA);
}

.lg-toolbar__left { display: flex; align-items: center; gap: 8px; }
.lg-toolbar__right { display: flex; align-items: center; gap: 8px; }

.lg-toolbar__label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6B6470;
}

.lg-progress {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #2A1745;
    background: #C6F432;
    padding: 5px 14px;
    border-radius: 999px;
}

.lg-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1.5px solid #E8E2DA;
    background: #fff;
    border-radius: 999px;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #2A1745;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .15s;
}

.lg-btn:hover {
    border-color: #6B3FA0;
    background: #EDE4FF;
    transform: translateY(-1px);
}

/* ---------- Дерево ---------- */
.lg-tree-wrap {
    position: relative;
    width: 100%;
    height: 460px;
    background: linear-gradient(180deg, #FAF6F0 0%, #F0E9DC 100%);
    border-radius: 16px;
    border: 1px solid #E8E2DA;
    margin-bottom: 22px;
    overflow: hidden;
}

@media (max-width: 640px) {
    .lg-tree-wrap { height: 340px; }
}

.lg-tree { display: block; width: 100%; height: 100%; }

.lg-trunk {
    transition: stroke-width .4s ease;
}

/* Ветка */
.lg-branch {
    fill: none;
    stroke: #8B5A2B;
    stroke-width: 7;
    stroke-linecap: round;
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: lgGrow 0.7s ease forwards;
}

@keyframes lgGrow {
    to { stroke-dashoffset: 0; }
}

/* Лист с термином */
.lg-leaf {
    opacity: 0;
    transform-origin: center;
    animation: lgLeafPop .55s cubic-bezier(.5, 1.6, .5, 1) forwards;
    animation-delay: .4s;
}

@keyframes lgLeafPop {
    from { opacity: 0; transform: scale(.2); }
    to   { opacity: 1; transform: scale(1); }
}

.lg-leaf__bg {
    fill: url(#lgLeafGrad);
    stroke: #2E7D32;
    stroke-width: 2;
}

.lg-leaf__text {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 700;
    fill: #1B5E20;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
}

/* Сова шевелится */
.lg-owl {
    animation: lgOwlBob 3s ease-in-out infinite;
    transform-origin: center;
}

@keyframes lgOwlBob {
    0%, 100% { transform: translate(80px, 380px) translateY(0); }
    50%      { transform: translate(80px, 380px) translateY(-6px); }
}

/* Сова «ухает» при правильном ответе */
.lg-owl.is-hooting {
    animation: lgOwlHoot .6s ease;
}

@keyframes lgOwlHoot {
    0%   { transform: translate(80px, 380px) scale(1); }
    40%  { transform: translate(80px, 380px) scale(1.2) rotate(-8deg); }
    70%  { transform: translate(80px, 380px) scale(.95) rotate(4deg); }
    100% { transform: translate(80px, 380px) scale(1); }
}

/* ---------- Вопрос ---------- */
.lg-question {
    padding: 22px 24px;
    background: #fff;
    border: 1.5px solid #E8E2DA;
    border-radius: 16px;
    margin-bottom: 18px;
    animation: lgFadeIn .35s ease;
}

@keyframes lgFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.lg-question__step {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #6B3FA0;
    margin-bottom: 8px;
    font-weight: 700;
}

.lg-question__title {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 22px;
    color: #2A1745;
    margin: 0 0 8px;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.lg-question__desc {
    font-size: 14.5px;
    line-height: 1.5;
    color: #6B6470;
    margin: 0 0 18px;
}

.lg-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}

.lg-option {
    text-align: left;
    padding: 14px 16px;
    background: #FAF6F0;
    border: 1.5px solid #E8E2DA;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: #1A1420;
    transition: border-color .2s, background .2s, transform .15s;
}

.lg-option:hover:not(:disabled) {
    border-color: #6B3FA0;
    background: #EDE4FF;
    transform: translateY(-2px);
}

.lg-option:disabled { cursor: default; }

.lg-option.is-correct {
    background: #E8F5E9;
    border-color: #4CAF50;
    color: #1B5E20;
    font-weight: 600;
}

.lg-option.is-wrong {
    background: #FFEBEE;
    border-color: #E53935;
    color: #B71C1C;
}

/* ---------- Результат ---------- */
.lg-result {
    padding: 28px 30px;
    background: linear-gradient(135deg, #FAF6F0 0%, #E8F5E9 100%);
    border: 2px solid #4CAF50;
    border-radius: 18px;
    animation: lgFadeIn .4s ease;
    margin-bottom: 18px;
}

@media (max-width: 640px) {
    .lg-result { padding: 20px 16px; }
}

.lg-result__tag {
    display: inline-block;
    padding: 5px 14px;
    background: #C6F432;
    color: #2A1745;
    border-radius: 999px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 700;
    margin-bottom: 14px;
}

.lg-result__title {
    font-family: 'Fraunces', serif;
    font-weight: 900;
    font-size: 26px;
    color: #1B5E20;
    margin: 0 0 12px;
    line-height: 1.15;
    letter-spacing: -.02em;
}

@media (max-width: 640px) {
    .lg-result__title { font-size: 20px; }
}

.lg-result__desc {
    font-size: 15px;
    line-height: 1.6;
    color: #1A1420;
    margin: 0 0 18px;
}

.lg-result__section-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 700;
    color: #2E7D32;
    margin-bottom: 8px;
}

.lg-result__list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
}

.lg-result__list li {
    position: relative;
    padding: 10px 14px 10px 36px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, .7);
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    color: #1A1420;
}

.lg-result__list li::before {
    content: '✓';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #C8E6C9;
    color: #1B5E20;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.lg-result__cta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed rgba(76, 175, 80, .3);
}

@media (max-width: 640px) {
    .lg-options { grid-template-columns: 1fr; }
    .lg-question__title { font-size: 18px; }
}