/* Стили реальных игровых компонентов для демо на главной (из territory_battle, cabinet, pvp_duel) */

/* --- Карта --- */
.tb-demo-stage[data-demo="capture"] {
    padding: 0 12px 12px;
    box-sizing: border-box;
}
.tb-demo-stage[data-demo="capture"] .map-wrap {
    position: relative;
    margin: 0;
    width: 68%;
    max-width: 260px;
    height: auto;
    aspect-ratio: 1 / 0.92;
    flex-shrink: 0;
    padding: 8px;
    background: linear-gradient(165deg, #5c4033 0%, #4a3520 30%, #3d2914 100%);
    border-radius: 6px;
    border: 2px solid #2c1810;
    box-shadow: inset 0 0 0 1px rgba(212,168,75,0.2);
}
.tb-demo-stage[data-demo="capture"] .map-viewport {
    height: 100%;
}
.tb-demo-stage .map-wrap {
    position: relative;
    margin: 0;
    max-width: none;
    height: 100%;
    padding: 10px;
    background: linear-gradient(165deg, #5c4033 0%, #4a3520 30%, #3d2914 100%);
    border-radius: 6px;
    border: 2px solid #2c1810;
    box-shadow: inset 0 0 0 1px rgba(212,168,75,0.2);
}
.tb-demo-stage .map-viewport {
    overflow: hidden;
    border-radius: 4px;
    min-height: 0;
    height: calc(100% - 8px);
    border: 2px solid #3d2914;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
    cursor: default;
}
.tb-demo-stage .territory-map {
    display: block;
    width: 100%;
    height: 100%;
}
.tb-demo-stage .territory-map .region { cursor: default; transition: filter 0.2s; }
.tb-demo-stage .territory-map .region-path {
    stroke: rgba(180,180,185,0.9);
    stroke-width: 2;
    fill: rgba(212,168,75,0.12);
    transition: fill 0.6s ease;
}
.tb-demo-stage .territory-map .region-path.owned {
    fill: var(--region-color, rgba(212,168,75,0.35));
}
.tb-demo-stage .territory-map .region.demo-region-highlight .region-path {
    stroke: #d4a84b;
    stroke-width: 3;
    filter: brightness(1.15);
}
.tb-demo-stage .territory-map .region-label-bg {
    fill: rgba(244,228,188,0.95);
    stroke: #5c4033;
    stroke-width: 1;
    rx: 3;
    pointer-events: none;
}
.tb-demo-stage .territory-map .region-label {
    font-size: 7px;
    font-weight: bold;
    fill: #2c1810;
    text-anchor: middle;
    pointer-events: none;
    font-family: 'Cinzel', Georgia, serif;
}
.tb-demo-stage .territory-map .region-strength-value-bg {
    fill: rgba(244,228,188,0.98);
    stroke: #5c4033;
    stroke-width: 1;
    rx: 3;
    pointer-events: none;
}
.tb-demo-stage .territory-map .region-strength-value {
    font-size: 8px;
    font-weight: bold;
    fill: #2c1810;
    text-anchor: middle;
    pointer-events: none;
    font-family: 'Cinzel', Georgia, serif;
}
.tb-demo-stage .territory-map .region-flag {
    pointer-events: none;
    stroke: #5c4033;
    stroke-width: 1.5;
}

/* --- Подтверждение захвата --- */
.tb-demo-stage .territory-confirm-wrap {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 6px;
    padding: 0 8px;
    justify-content: center;
    z-index: 12;
}
.tb-demo-stage .territory-confirm-wrap.open {
    display: flex;
}
.tb-demo-stage .territory-confirm-box {
    background: linear-gradient(180deg, #f4e4bc 0%, #e8d5a3 100%);
    border-radius: 4px;
    padding: 10px 14px;
    box-shadow: 0 0 0 2px #5c4033, 0 6px 20px rgba(0,0,0,0.4);
    border: 2px solid #3d2914;
    max-width: 260px;
    width: 100%;
}
.tb-demo-stage .territory-confirm-text {
    margin: 0 0 10px;
    font-size: 0.92rem;
    font-weight: bold;
    font-family: 'Cinzel', Georgia, serif;
    color: #3d2914;
    text-align: center;
    line-height: 1.35;
}
.tb-demo-stage .territory-confirm-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.tb-demo-stage .territory-confirm-btn {
    padding: 6px 16px;
    border: 2px solid #5c4033;
    border-radius: 4px;
    font-size: 0.92rem;
    font-weight: bold;
    cursor: default;
    font-family: 'Cinzel', Georgia, serif;
}
.tb-demo-stage .territory-confirm-yes {
    background: linear-gradient(145deg, #4a3520 0%, #3d2914 100%);
    color: #d4a84b;
}
.tb-demo-stage .territory-confirm-no {
    background: linear-gradient(180deg, #c4b098 0%, #a89070 100%);
    color: #2c1810;
}

/* --- Модалка задачи --- */
.tb-demo-stage .task-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.tb-demo-stage .task-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}
.tb-demo-stage .task-modal {
    background: linear-gradient(180deg, #f4e4bc 0%, #e8d5a3 50%, #dcc898 100%);
    border-radius: 4px;
    max-width: 100%;
    width: 100%;
    box-shadow: 0 0 0 2px #5c4033, 0 8px 24px rgba(0,0,0,0.5);
    border: 2px solid #3d2914;
    color: #2c1810;
}
.tb-demo-stage .task-modal-header {
    padding: 10px 14px 8px;
    border-bottom: 2px solid #5c4033;
}
.tb-demo-stage .task-modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-family: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
    color: #3d2914;
}
.tb-demo-stage .task-modal-body {
    padding: 10px 14px;
}
.tb-demo-stage .task-modal-body .task-text {
    margin-bottom: 10px;
    line-height: 1.5;
    font-size: 0.96rem;
    color: #2c1810;
}
.tb-demo-stage .task-modal-body .task-answer-wrap label {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.92rem;
    color: #3d2914;
}
.tb-demo-stage .task-modal-body .task-answer-wrap input {
    padding: 6px 10px;
    border: 2px solid #5c4033;
    border-radius: 4px;
    font-size: 16px;
    background: rgba(255,255,255,0.6);
    color: #2c1810;
    width: 5ch;
}
.tb-demo-stage .task-modal-footer {
    padding: 8px 14px 12px;
    text-align: center;
}
.tb-demo-stage .submit-task-btn {
    padding: 8px 20px;
    background: linear-gradient(145deg, #4a3520 0%, #3d2914 100%);
    color: #d4a84b;
    border: 2px solid #5c4033;
    border-radius: 4px;
    font-weight: bold;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.96rem;
    cursor: default;
}

/* --- Toast результата --- */
.tb-demo-stage .task-result-toast {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%) translateY(60px);
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: bold;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.88rem;
    z-index: 30;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    border: 2px solid rgba(0,0,0,0.2);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    white-space: nowrap;
}
.tb-demo-stage .task-result-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.tb-demo-stage .task-result-toast.correct {
    background: linear-gradient(145deg, #3d5c34 0%, #2d4a24 100%);
    color: #c8e0b8;
}

/* --- Карточка игрока --- */
.tb-demo-stage .territory-player-card {
    margin: 0;
    max-width: none;
    background: linear-gradient(145deg, #4a3520 0%, #3d2914 100%);
    border: 2px solid #5c4033;
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: inset 0 1px 0 rgba(212,168,75,0.12);
    display: flex;
    align-items: center;
    gap: 10px;
}
.tb-demo-stage .territory-player-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2c1810;
    border: 2px solid #5c4033;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.tb-demo-stage .territory-player-main { flex: 1; min-width: 0; }
.tb-demo-stage .territory-player-name {
    font-family: 'Cinzel', Georgia, serif;
    font-weight: bold;
    font-size: 1.02rem;
    color: #e8dcc4;
}
.tb-demo-stage .territory-player-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 4px;
}
.tb-demo-stage .territory-player-level-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.tb-demo-stage .territory-player-level {
    font-size: 0.9rem;
    color: #d4a84b;
    font-weight: bold;
}
.tb-demo-stage .territory-player-xp-wrap {
    flex: 1;
    height: 8px;
    background: #2c1810;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #5c4033;
    max-width: 100px;
}
.tb-demo-stage .territory-player-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b6914, #d4a84b);
    border-radius: 3px;
    transition: width 0.5s ease;
}
.tb-demo-stage .territory-player-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.9rem;
    color: #c4b098;
}
.tb-demo-stage .territory-player-stats strong { color: #d4a84b; }
.tb-demo-stage .territory-player-energy {
    font-weight: bold;
    color: #d4a84b;
}
.tb-demo-stage .territory-buff-icons {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.tb-demo-stage .territory-buff-icons .territory-buff-icon {
    width: 22px;
    height: 22px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(212,168,75,0.4);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.35s, transform 0.35s;
}
.tb-demo-stage .territory-buff-icons .territory-buff-icon.visible {
    opacity: 1;
    transform: scale(1);
}

/* --- Клан --- */
.tb-demo-stage .territory-player-clan {
    display: flex;
    align-items: center;
    gap: 6px;
}
.tb-demo-stage .territory-player-clan-flag-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #5c4033;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.tb-demo-stage .territory-player-clan-name {
    font-weight: bold;
    color: #d4a84b;
    font-size: 0.9rem;
    font-family: 'Cinzel', Georgia, serif;
}

/* --- Global progress (лидеры кланов) --- */
.tb-demo-stage .global-progress {
    margin: 0;
    background: linear-gradient(145deg, #4a3520 0%, #3d2914 100%);
    border-radius: 4px;
    padding: 10px 12px;
    border: 2px solid #5c4033;
    width: 100%;
}
.tb-demo-stage .global-progress-title {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.88rem;
    margin-bottom: 8px;
    color: #d4a84b;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
}
.tb-demo-stage .global-leader-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.92rem;
    color: #e8dcc4;
    margin-bottom: 6px;
}
.tb-demo-stage .global-leader-row:last-child { margin-bottom: 0; }
.tb-demo-stage .global-class-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    border: 2px solid #5c4033;
    flex-shrink: 0;
}
.tb-demo-stage .global-class-name {
    min-width: 60px;
    font-weight: bold;
    font-size: 0.9rem;
}
.tb-demo-stage .global-class-count {
    font-weight: bold;
    color: #d4a84b;
    font-size: 0.88rem;
}

/* --- Подпись текущего шага анимации --- */
.tb-demo-stage .demo-step-caption {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    text-align: center;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.88rem;
    line-height: 1.35;
    letter-spacing: 0.06em;
    color: #d4a84b;
    z-index: 40;
    padding: 10px 14px 8px;
    transition: opacity 0.35s;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(30,18,8,0.55) 0%, transparent 100%);
}
.tb-demo-stage[data-demo="capture"] .territory-map .region-path {
    stroke-width: 1.5;
}
.tb-demo-stage[data-demo="capture"] .territory-map .region.demo-region-highlight .region-path {
    stroke-width: 2.5;
}
.tb-demo-stage[data-demo="capture"] .task-result-toast.demo-toast {
    font-size: 0.82rem;
    padding: 6px 12px;
    bottom: 8px;
}
.tb-demo-stage[data-demo="capture"] .demo-step-caption {
    font-size: 0.92rem;
}
.tb-demo-stage--register > .demo-step-caption {
    padding-bottom: 6px;
}
.tb-demo-stage .demo-step-caption.fade { opacity: 0.4; }

/* --- Курсор на карте --- */
.tb-demo-stage .demo-map-cursor {
    position: absolute;
    font-size: 1.45rem;
    pointer-events: none;
    z-index: 18;
    opacity: 0;
    transition: left 0.55s ease, top 0.55s ease, opacity 0.25s;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* --- Лавка / инвентарь (расширенный сценарий) --- */
.demo-item-flow {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    height: 100%;
    padding: 8px 12px 16px;
    position: relative;
}
.demo-item-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    transition: opacity 0.45s, transform 0.45s;
}
.demo-item-col.dim {
    opacity: 0.35;
    transform: scale(0.96);
}
.demo-item-col.active {
    opacity: 1;
    transform: scale(1);
}
.demo-col-label {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8b7355;
}
.demo-item-connector {
    display: flex;
    align-items: center;
    padding-bottom: 42px;
    opacity: 0.25;
    transition: opacity 0.4s;
}
.demo-item-connector.lit { opacity: 1; }
.demo-flow-arrow {
    color: #d4a84b;
    font-size: 1.28rem;
    font-weight: bold;
}
.tb-demo-stage .shop-item-tile {
    background: linear-gradient(145deg, #3d2914 0%, #2c1810 100%);
    border: 2px solid #5c4033;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    width: 88px;
    flex-shrink: 0;
    opacity: 0.5;
    transform: scale(0.92);
    transition: opacity 0.4s, transform 0.4s, border-color 0.3s, box-shadow 0.3s;
}
.tb-demo-stage .shop-item-tile img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 4px;
}
.tb-demo-stage .shop-item-tile .tile-name {
    font-weight: bold;
    color: #e8dcc4;
    font-size: 0.82rem;
    margin-bottom: 2px;
    line-height: 1.2;
}
.tb-demo-stage .shop-item-tile .tile-price {
    color: #d4a84b;
    font-size: 0.82rem;
}
.tb-demo-stage .shop-item-tile.visible {
    opacity: 1;
    transform: scale(1);
}
.tb-demo-stage .shop-item-tile.highlight {
    border-color: #d4a84b;
    box-shadow: 0 0 16px rgba(212,168,75,0.45);
    animation: demo-shop-pulse 0.8s ease-in-out 2;
}
@keyframes demo-shop-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(212,168,75,0.25); }
    50% { box-shadow: 0 0 20px rgba(212,168,75,0.55); }
}
.demo-nums-cost {
    font-size: 0.82rem;
    font-weight: bold;
    color: #ef4444;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.35s, transform 0.35s;
}
.demo-nums-cost.show {
    opacity: 1;
    transform: translateY(0);
}
.tb-demo-stage .inventory-tile {
    background: linear-gradient(145deg, #3d2914 0%, #2c1810 100%);
    border: 2px solid #5c4033;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    flex-shrink: 0;
    width: 76px;
    opacity: 0;
    transform: scale(0.85) translateY(8px);
    transition: opacity 0.45s, transform 0.45s, box-shadow 0.3s;
}
.tb-demo-stage .inventory-tile.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}
.tb-demo-stage .inventory-tile.selected {
    border-color: #d4a84b;
    box-shadow: 0 0 14px rgba(212,168,75,0.4);
}
.tb-demo-stage .inventory-tile.used {
    opacity: 0.3;
    transform: scale(0.88);
}
.demo-use-btn {
    padding: 5px 10px;
    border: 2px solid #5c4033;
    border-radius: 4px;
    background: linear-gradient(145deg, #5c4033 0%, #4a3520 100%);
    color: #d4a84b;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: default;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s, transform 0.35s, box-shadow 0.3s;
    white-space: nowrap;
}
.demo-use-btn.visible {
    opacity: 1;
    transform: translateY(0);
}
.demo-use-btn.pulse {
    animation: demo-use-pulse 0.7s ease-in-out 3;
    border-color: #d4a84b;
}
@keyframes demo-use-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(212,168,75,0); }
    50% { box-shadow: 0 0 14px rgba(212,168,75,0.55); }
}
.demo-use-popover {
    position: absolute;
    background: linear-gradient(180deg, #f4e4bc 0%, #e8d5a3 100%);
    border: 2px solid #5c4033;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.82rem;
    color: #3d2914;
    font-weight: bold;
    font-family: 'Cinzel', Georgia, serif;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 22;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}
.demo-use-popover.show {
    opacity: 1;
    transform: scale(1);
}
.demo-target-col .territory-player-card {
    transition: box-shadow 0.5s;
}
.demo-target-col .territory-player-card.buffed {
    box-shadow: 0 0 18px rgba(212,168,75,0.45), inset 0 1px 0 rgba(212,168,75,0.12);
}
.demo-stat-pop {
    position: absolute;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.92rem;
    font-weight: bold;
    color: #4ade80;
    text-shadow: 0 0 8px rgba(74,222,128,0.5);
    opacity: 0;
    pointer-events: none;
    z-index: 26;
    white-space: nowrap;
}
.demo-stat-pop.show {
    animation: demo-stat-pop 1.1s ease-out forwards;
}
@keyframes demo-stat-pop {
    0% { opacity: 0; transform: translateY(0) scale(0.8); }
    20% { opacity: 1; transform: translateY(-4px) scale(1.1); }
    100% { opacity: 0; transform: translateY(-28px) scale(1); }
}
.demo-atk-value {
    display: inline-block;
    transition: color 0.3s, transform 0.3s;
}
.demo-atk-value.bump {
    color: #4ade80;
    transform: scale(1.15);
}
.tb-demo-stage .demo-flying-item {
    position: absolute;
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid #d4a84b;
    opacity: 0;
    pointer-events: none;
    z-index: 25;
    box-shadow: 0 0 14px rgba(212,168,75,0.55);
    transition: left 0.05s linear, top 0.05s linear, opacity 0.2s, transform 0.2s;
}
.tb-demo-stage .demo-flying-item.trail {
    box-shadow: 0 0 20px rgba(212,168,75,0.8), 0 0 40px rgba(212,168,75,0.3);
}
.tb-demo-stage .territory-buff-icons .territory-buff-icon {
    transition: opacity 0.4s, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tb-demo-stage .territory-buff-icons .territory-buff-icon.visible {
    opacity: 1;
    transform: scale(1);
}
.demo-buff-timer {
    font-size: 0.72rem;
    color: #b8a088;
    opacity: 0;
    transition: opacity 0.4s;
}
.demo-buff-timer.show { opacity: 1; }

/* --- Баланс / модалка покупки --- */
.tb-demo-stage .demo-shop-balance {
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 5;
}
.tb-demo-stage .nums-balance-block {
    background: linear-gradient(145deg, #3d2914 0%, #2c1810 100%);
    border: 2px solid #5c4033;
    border-radius: 8px;
    padding: 6px 12px;
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.tb-demo-stage .nums-balance-block .nums-value {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.15rem;
    font-weight: bold;
    color: #d4a84b;
    transition: color 0.3s;
}
.tb-demo-stage .nums-balance-block .nums-value.spent {
    color: #ef4444;
}
.tb-demo-stage .nums-balance-block .nums-suffix {
    font-size: 0.88rem;
    color: #b8a088;
}
.tb-demo-stage .shop-item-modal.demo-shop-modal {
    position: absolute;
    inset: 0;
    background: rgba(20, 12, 6, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s;
    border-radius: inherit;
}
.tb-demo-stage .shop-item-modal.demo-shop-modal.open {
    opacity: 1;
    pointer-events: auto;
}
.tb-demo-stage .shop-item-modal .modal-box {
    background: linear-gradient(180deg, #f4e4bc 0%, #e8d5a3 100%);
    border: 2px solid #5c4033;
    border-radius: 10px;
    padding: 16px 18px;
    text-align: center;
    max-width: 200px;
    transform: scale(0.92);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tb-demo-stage .shop-item-modal.open .modal-box {
    transform: scale(1);
}
.tb-demo-stage .shop-item-modal .modal-box h3 {
    margin: 0 0 8px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.15rem;
    color: #3d2914;
}
.tb-demo-stage .shop-item-modal .item-image {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    margin: 0 auto 6px;
    display: block;
    border: 2px solid #5c4033;
}
.tb-demo-stage .demo-shop-desc {
    margin: 0 0 6px;
    font-size: 0.82rem;
    color: #5c4033;
}
.tb-demo-stage .shop-item-modal .item-price {
    font-size: 1.15rem;
    color: #8b6914;
    font-weight: bold;
    margin: 0 0 10px;
}
.tb-demo-stage .shop-item-modal .btn-buy {
    padding: 8px 18px;
    border-radius: 6px;
    border: 2px solid #5c4033;
    background: linear-gradient(145deg, #5c4033 0%, #4a3520 100%);
    color: #d4a84b;
    font-weight: bold;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.88rem;
    cursor: default;
}
.tb-demo-stage .shop-item-modal .btn-buy.flash {
    filter: brightness(1.25);
    border-color: #d4a84b;
}

.tb-demo-stage .inventory-tile-img-wrap {
    position: relative;
    display: inline-block;
    margin: 0 auto 4px;
    width: 44px;
    height: 44px;
}
.tb-demo-stage .inventory-tile-img-wrap img.item-icon-main {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}
.tb-demo-stage .inventory-tile .tile-name {
    font-weight: bold;
    color: #e8dcc4;
    font-size: 0.78rem;
    line-height: 1.2;
}

/* --- Снаряжение (кабинет) --- */
.demo-layout-equip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    height: 100%;
    padding: 8px 12px 14px;
    position: relative;
    box-sizing: border-box;
}
.demo-equip-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.demo-equip-inventory {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.demo-equip-inv-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 8px;
    background: linear-gradient(145deg, #3d2914 0%, #2c1810 100%);
    border: 2px solid #5c4033;
    border-radius: 8px;
    width: 52px;
    transition: opacity 0.35s, transform 0.35s, border-color 0.3s, box-shadow 0.3s;
}
.demo-equip-inv-item img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}
.demo-equip-inv-item span {
    font-size: 0.68rem;
    color: #b8a088;
    text-align: center;
    line-height: 1.2;
}
.demo-equip-inv-item.active {
    border-color: #d4a84b;
    box-shadow: 0 0 12px rgba(212,168,75,0.45);
    transform: scale(1.05);
}
.demo-equip-inv-item.used {
    opacity: 0.25;
    transform: scale(0.92);
}
.tb-demo-stage .equipment-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
        ". helmet ."
        "weapon chest offhand"
        "gloves pants boots";
    gap: 6px;
    width: 220px;
    max-width: 100%;
    margin: 0 auto;
}
.tb-demo-stage .equipment-slot {
    background: linear-gradient(145deg, #3d2914 0%, #2c1810 100%);
    border-radius: 8px;
    border: 2px solid #5c4033;
    padding: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(212,168,75,0.08);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    transition: box-shadow 0.35s, border-color 0.35s, transform 0.35s;
}
.tb-demo-stage .equipment-slot-label { display: none; }
.tb-demo-stage .equipment-slot-body {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px dashed rgba(212,168,75,0.35);
    background-color: rgba(26,15,8,0.7);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    width: 100%;
    min-height: 0;
    position: relative;
}
.tb-demo-stage .equipment-slot-body::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(0, 0, 0, 0.35);
    pointer-events: none;
    transition: background 0.3s;
}
.tb-demo-stage .equipment-slot--inactive { opacity: 0.7; }
.tb-demo-stage .equipment-slot--equipped {
    opacity: 1;
    border-color: #8b6914;
    box-shadow: 0 0 12px rgba(212,168,75,0.55), inset 0 1px 0 rgba(255,255,255,0.15);
}
.tb-demo-stage .equipment-slot--equipped .equipment-slot-body::after { background: none; }
.tb-demo-stage .equipment-slot.demo-equip-active {
    border-color: #d4a84b;
    transform: scale(1.06);
    box-shadow: 0 0 18px rgba(212,168,75,0.65);
    z-index: 2;
}
.tb-demo-stage .equipment-slot--helmet   { grid-area: helmet; }
.tb-demo-stage .equipment-slot--chest    { grid-area: chest; }
.tb-demo-stage .equipment-slot--pants    { grid-area: pants; }
.tb-demo-stage .equipment-slot--gloves   { grid-area: gloves; }
.tb-demo-stage .equipment-slot--boots    { grid-area: boots; }
.tb-demo-stage .equipment-slot--weapon   { grid-area: weapon; }
.tb-demo-stage .equipment-slot--offhand  { grid-area: offhand; }
.tb-demo-stage .equipment-slot-body--helmet  { background-image: url("../item/standart/helmet.png"); }
.tb-demo-stage .equipment-slot-body--chest   { background-image: url("../item/standart/breastplate.png"); }
.tb-demo-stage .equipment-slot-body--pants   { background-image: url("../item/standart/trousers.png"); }
.tb-demo-stage .equipment-slot-body--gloves  { background-image: url("../item/standart/gloves.png"); }
.tb-demo-stage .equipment-slot-body--weapon  { background-image: url("../item/standart/weapon.png"); }
.tb-demo-stage .equipment-slot-body--offhand { background-image: url("../item/standart/weapon.png"); }
.tb-demo-stage .equipment-slot-body--boots   { background-image: url("../item/standart/boots.png"); }
.tb-demo-stage .demo-equip-flying {
    position: absolute;
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
    border: 2px solid #d4a84b;
    opacity: 0;
    pointer-events: none;
    z-index: 25;
    box-shadow: 0 0 14px rgba(212,168,75,0.55);
    transition: left 0.05s linear, top 0.05s linear, opacity 0.2s, transform 0.2s;
}
.tb-demo-stage .demo-equip-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    min-width: 88px;
}
.tb-demo-stage .demo-equip-stat {
    font-size: 0.96rem;
    color: #c4b098;
    transition: transform 0.25s;
}
.tb-demo-stage .demo-equip-stat.bump {
    transform: scale(1.08);
}
.tb-demo-stage .demo-equip-stat strong { color: #d4a84b; }
.tb-demo-stage .demo-equip-atk,
.tb-demo-stage .demo-equip-def {
    color: #e8dcc4;
    font-weight: bold;
}

/* --- PvP: вызов на дуэль --- */
.tb-demo-stage--pvp {
    min-height: 300px;
}
.demo-pvp-challenge-scene {
    position: absolute;
    inset: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 14px 12px;
    box-sizing: border-box;
    z-index: 8;
    opacity: 1;
    transition: opacity 0.45s;
}
.demo-pvp-challenge-scene.hidden {
    opacity: 0;
    pointer-events: none;
}
.demo-pvp-arena-block {
    width: 100%;
    max-width: 280px;
    background: linear-gradient(145deg, #4a3520 0%, #3d2914 100%);
    border: 2px solid #5c4033;
    border-radius: 8px;
    padding: 10px 12px;
}
.demo-pvp-arena-title {
    margin: 0 0 8px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.92rem;
    color: #d4a84b;
    letter-spacing: 0.04em;
}
.tb-demo-stage .pvp-participant-btn.demo-pvp-participant {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: rgba(44,24,16,0.5);
    border: 2px solid #5c4033;
    border-radius: 6px;
    color: #e8dcc4;
    text-align: left;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
    box-sizing: border-box;
}
.tb-demo-stage .pvp-participant-btn.demo-pvp-participant.highlight {
    border-color: #d4a84b;
    box-shadow: 0 0 14px rgba(212,168,75,0.4);
    transform: scale(1.02);
}
.tb-demo-stage .demo-pvp-participant-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #2c1810;
    border: 2px solid #5c4033;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.28rem;
    flex-shrink: 0;
}
.tb-demo-stage .pvp-participant-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tb-demo-stage .pvp-participant-name {
    font-family: 'Cinzel', Georgia, serif;
    font-weight: bold;
    font-size: 0.96rem;
    color: #e8dcc4;
}
.tb-demo-stage .pvp-participant-level {
    font-size: 0.82rem;
    color: #c4b098;
    line-height: 1.35;
}
.demo-pvp-wager-modal {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 12, 6, 0.72);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s;
    border-radius: inherit;
    z-index: 12;
}
.demo-pvp-wager-modal.open {
    opacity: 1;
    pointer-events: auto;
}
.demo-pvp-wager-box {
    background: linear-gradient(180deg, #f4e4bc 0%, #e8d5a3 100%);
    border: 2px solid #5c4033;
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
    max-width: 220px;
    width: 90%;
    transform: scale(0.92);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.demo-pvp-wager-modal.open .demo-pvp-wager-box {
    transform: scale(1);
}
.demo-pvp-wager-box h4 {
    margin: 0 0 8px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.02rem;
    color: #3d2914;
}
.demo-pvp-wager-opp {
    margin: 0 0 6px;
    font-size: 0.9rem;
    color: #5c4033;
}
.demo-pvp-wager-amount {
    margin: 0 0 12px;
    font-size: 0.92rem;
    color: #3d2914;
}
.demo-pvp-wager-amount strong {
    color: #8b6914;
}
.tb-demo-stage .pvp-btn.demo-pvp-wager-submit {
    padding: 8px 18px;
    border: 2px solid #5c4033;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: default;
    background: linear-gradient(145deg, #5c4033 0%, #4a3520 100%);
    color: #d4a84b;
    font-weight: bold;
    font-family: 'Cinzel', Georgia, serif;
}
.tb-demo-stage .pvp-btn.demo-pvp-wager-submit.flash {
    filter: brightness(1.25);
    border-color: #d4a84b;
}
.demo-pvp-start-banner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    padding: 10px 18px;
    background: linear-gradient(145deg, #5c4033 0%, #4a3520 100%);
    border: 2px solid #d4a84b;
    border-radius: 8px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.15rem;
    font-weight: bold;
    color: #d4a84b;
    opacity: 0;
    pointer-events: none;
    z-index: 14;
    box-shadow: 0 0 20px rgba(212,168,75,0.45);
    transition: opacity 0.35s, transform 0.35s;
    white-space: nowrap;
}
.demo-pvp-start-banner.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* --- PvP дуэль --- */
.tb-demo-stage .pvp-duel-opponent {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: linear-gradient(145deg, #4a3520 0%, #3d2914 100%);
    border: 2px solid #5c4033;
    border-radius: 8px;
    width: 100%;
    max-width: 260px;
    margin: 0 auto 8px;
}
.tb-demo-stage .pvp-duel-opponent .avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2c1810;
    border: 2px solid #5c4033;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.28rem;
    flex-shrink: 0;
}
.tb-demo-stage .pvp-duel-opponent .main { flex: 1; min-width: 0; }
.tb-demo-stage .pvp-duel-opponent .name {
    font-family: 'Cinzel', Georgia, serif;
    font-weight: bold;
    font-size: 0.96rem;
    color: #e8dcc4;
}
.tb-demo-stage .pvp-duel-hp-wrap {
    margin-top: 4px;
    height: 10px;
    background: #2c1810;
    border: 1px solid #5c4033;
    border-radius: 5px;
    overflow: hidden;
}
.tb-demo-stage .pvp-duel-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b6914, #d4a84b);
    border-radius: 4px;
    transition: width 0.45s ease;
}
.tb-demo-stage .pvp-duel-hp-text {
    font-size: 0.82rem;
    margin-top: 2px;
    color: #c4b098;
}
.tb-demo-stage .pvp-duel-task-area {
    padding: 10px 12px;
    background: linear-gradient(145deg, #4a3520 0%, #3d2914 100%);
    border-radius: 8px;
    border: 2px solid #5c4033;
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
}
.tb-demo-stage .pvp-duel-task-area h2 {
    margin: 0 0 6px;
    font-family: 'Cinzel', Georgia, serif;
    color: #d4a84b;
    font-size: 0.96rem;
}
.tb-demo-stage .pvp-duel-task-text {
    margin: 0 0 8px;
    font-size: 0.92rem;
    color: #e8dcc4;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.3s;
}
.tb-demo-stage .pvp-duel-task-text.show { opacity: 1; }
.tb-demo-stage .pvp-duel-task-answer input {
    padding: 5px 8px;
    border: 2px solid #5c4033;
    border-radius: 4px;
    background: #2c1810;
    color: #e8dcc4;
    font-size: 0.96rem;
    width: 5ch;
}
.tb-demo-stage .pvp-duel-task-answer .submit-btn {
    margin-top: 6px;
    padding: 5px 14px;
    background: linear-gradient(145deg, #5c4033 0%, #4a3520 100%);
    color: #d4a84b;
    border: 2px solid #5c4033;
    border-radius: 4px;
    font-weight: bold;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.9rem;
    cursor: default;
}
.tb-demo-stage .demo-pvp-hit {
    position: absolute;
    font-size: 1.15rem;
    font-weight: bold;
    color: #ef4444;
    opacity: 0;
    pointer-events: none;
    text-shadow: 0 0 8px rgba(239,68,68,0.8);
    z-index: 20;
    font-family: 'Cinzel', Georgia, serif;
}
.tb-demo-stage .demo-pvp-hit.show {
    animation: demo-pvp-hit-float 0.8s ease-out forwards;
}
@keyframes demo-pvp-hit-float {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-24px); }
}

/* --- Раскладки демо --- */
.demo-layout-task {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    height: 100%;
    padding: 10px;
    gap: 8px;
    position: relative;
}
.demo-layout-task .territory-player-card {
    flex-shrink: 0;
}
.demo-layout-clans {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    height: 100%;
    padding: 10px;
    gap: 8px;
}
.demo-layout-clans .demo-clans-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.demo-layout-pvp {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 8px 10px 10px;
    position: relative;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s;
    box-sizing: border-box;
}
.demo-layout-pvp.visible {
    opacity: 1;
    pointer-events: auto;
}

/* --- Сундук --- */
.demo-layout-chest {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 100%;
    padding: 12px 8px;
    flex-wrap: wrap;
}
.tb-demo-stage .demo-chest-tile {
    opacity: 1;
    transform: scale(1);
    cursor: default;
}
.tb-demo-stage .demo-chest-tile.highlight {
    border-color: #d4a84b;
    box-shadow: 0 0 16px rgba(212,168,75,0.45);
    animation: demo-shop-pulse 0.8s ease-in-out 2;
}
.demo-chest-emoji {
    font-size: 2rem;
    line-height: 44px;
    display: block;
}
.demo-chest-open-scene {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.4s, transform 0.4s;
    pointer-events: none;
    max-width: 140px;
}
.demo-chest-open-scene.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}
.tb-demo-stage .demo-chest-wrap {
    position: relative;
    width: 100px;
    height: 90px;
    display: grid;
    place-items: center;
}
.demo-chest-icon {
    font-size: 3.2rem;
    line-height: 1;
    transform-origin: 50% 80%;
    display: block;
    transition: transform 0.3s, filter 0.3s;
}
.demo-chest-icon.opening {
    animation: demo-chest-pop 1.4s ease-in-out;
}
.demo-chest-icon.opened {
    transform: translateY(-4px) scale(1.05);
    filter: drop-shadow(0 8px 16px rgba(255, 215, 0, 0.4));
}
@keyframes demo-chest-pop {
    0%, 100% { transform: scale(1) rotate(0); }
    25% { transform: scale(1.1) rotate(-4deg); }
    50% { transform: scale(1.15) rotate(4deg); }
    75% { transform: scale(1.08) rotate(-2deg); }
}
.demo-chest-sparkles {
    position: absolute;
    inset: -10px;
    pointer-events: none;
    opacity: 0;
}
.demo-chest-sparkles.active {
    opacity: 1;
    animation: demo-sparkle-fade 1.2s ease-out forwards;
}
.demo-chest-sparkles::before,
.demo-chest-sparkles::after {
    content: '✦';
    position: absolute;
    color: #ffd700;
    font-size: 1.4rem;
    animation: demo-sparkle-float 1s ease-out infinite;
}
.demo-chest-sparkles::before { top: 10%; left: 15%; animation-delay: 0s; }
.demo-chest-sparkles::after { top: 20%; right: 10%; animation-delay: 0.3s; }
@keyframes demo-sparkle-float {
    0% { opacity: 0; transform: translateY(8px) scale(0.5); }
    50% { opacity: 1; transform: translateY(-8px) scale(1); }
    100% { opacity: 0; transform: translateY(-20px) scale(0.3); }
}
@keyframes demo-sparkle-fade {
    0% { opacity: 0; }
    30% { opacity: 1; }
    100% { opacity: 0; }
}
.tb-demo-stage .demo-drop-result {
    width: 100%;
    font-size: 0.88rem;
    font-weight: bold;
    color: #3d2914;
    text-align: center;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s, transform 0.35s;
    padding: 8px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255,215,0,0.25), rgba(255,237,78,0.2));
    border: 2px solid rgba(255,140,0,0.45);
}
.tb-demo-stage .demo-drop-result.show {
    opacity: 1;
    transform: translateY(0);
}
.tb-demo-stage .drop-result-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.tb-demo-stage .drop-result-grant-icon {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid rgba(255,140,0,0.5);
    background: rgba(255,255,255,0.35);
}
.tb-demo-stage .drop-result-caption {
    font-size: 0.88rem;
    color: #3d2914;
}
.tb-demo-stage .demo-chest-reward-tile {
    opacity: 0;
    transform: scale(0.85);
}
.tb-demo-stage .demo-chest-reward-tile.visible {
    opacity: 1;
    transform: scale(1);
}
.tb-demo-stage--chest { min-height: 200px; }

/* --- Поиск клана --- */
.demo-clan-search-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    height: 100%;
    justify-content: center;
}
.tb-demo-stage .clan-search-ad-card {
    background: linear-gradient(145deg, #4a3520 0%, #3d2914 100%);
    border: 2px solid #5c4033;
    border-radius: 8px;
    padding: 10px 12px;
    transition: border-color 0.3s, box-shadow 0.3s, opacity 0.3s;
}
.tb-demo-stage .clan-search-ad-card.highlight {
    border-color: #d4a84b;
    box-shadow: 0 0 14px rgba(212,168,75,0.35);
}
.tb-demo-stage .clan-search-ad-card.dim {
    opacity: 0.45;
}
.tb-demo-stage .clan-search-ad-main {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.tb-demo-stage .clan-search-ad-flag-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.tb-demo-stage .clan-search-ad-body { flex: 1; min-width: 0; }
.tb-demo-stage .clan-search-ad-clan-name {
    font-weight: bold;
    color: #e8dcc4;
    font-size: 1.15rem;
}
.tb-demo-stage .clan-search-ad-text {
    color: #b8a088;
    font-size: 0.88rem;
    line-height: 1.45;
}
.tb-demo-stage .clan-search-ad-actions {
    flex-shrink: 0;
}
.tb-demo-stage .clan-search-ad-actions .btn-apply {
    padding: 5px 10px;
    border: 2px solid #5c4033;
    border-radius: 4px;
    background: linear-gradient(145deg, #5c4033 0%, #4a3520 100%);
    color: #d4a84b;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: default;
    white-space: nowrap;
}
.tb-demo-stage .btn-apply.pulse {
    animation: demo-use-pulse 0.7s ease-in-out 3;
    border-color: #d4a84b;
}
.tb-demo-stage .clan-search-ad-pending {
    font-size: 0.78rem;
    color: #b8a088;
    display: none;
}
.tb-demo-stage .clan-search-ad-pending.show {
    display: inline;
}
.tb-demo-stage .clan-search-ad-actions .btn-apply.hidden {
    display: none;
}
.tb-demo-stage .clan-search-modal-overlay.demo-clan-modal {
    position: absolute;
    inset: 0;
    background: rgba(20, 12, 6, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s;
    border-radius: inherit;
}
.tb-demo-stage .clan-search-modal-overlay.demo-clan-modal.open {
    opacity: 1;
    pointer-events: auto;
}
.tb-demo-stage .clan-search-modal-box {
    background: linear-gradient(180deg, #f4e4bc 0%, #e8d5a3 100%);
    border: 2px solid #5c4033;
    border-radius: 10px;
    padding: 16px 18px;
    max-width: 220px;
    text-align: center;
}
.tb-demo-stage .clan-search-modal-box h3 {
    margin: 0 0 8px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.05rem;
    color: #3d2914;
}
.tb-demo-stage .demo-clan-modal-text {
    margin: 0 0 12px;
    font-size: 0.92rem;
    color: #5c4033;
    line-height: 1.45;
}
.tb-demo-stage .clan-search-modal-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.tb-demo-stage .clan-search-modal-buttons button {
    padding: 6px 12px;
    border: 2px solid #5c4033;
    border-radius: 4px;
    background: linear-gradient(145deg, #5c4033 0%, #4a3520 100%);
    color: #d4a84b;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.82rem;
    font-weight: bold;
    cursor: default;
}
.tb-demo-stage .demo-clan-modal-confirm.flash {
    filter: brightness(1.25);
    border-color: #d4a84b;
}
.tb-demo-stage--clan-search { min-height: 220px; }

/* --- Чат --- */
.demo-layout-chat {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 8px 16px 12px;
    box-sizing: border-box;
}
.tb-demo-stage .demo-clan-chat-panel {
    width: 100%;
    max-width: 320px;
    opacity: 1;
    transform: none;
}
.tb-demo-stage .demo-clan-chat-panel.open {
    opacity: 1;
    transform: none;
}
.tb-demo-stage .demo-clan-chat-panel .modal-box {
    background: linear-gradient(180deg, #f4e4bc 0%, #e8d5a3 100%);
    border: 2px solid #5c4033;
    border-radius: 8px;
    padding: 10px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
.tb-demo-stage .demo-clan-chat-panel .modal-box h3 {
    margin: 0 0 8px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.92rem;
    color: #3d2914;
    flex-shrink: 0;
}
.tb-demo-stage .demo-clan-chat-panel .clan-chat-messages {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}
.tb-demo-stage .demo-clan-chat-panel .clan-chat-msg {
    padding: 6px 8px;
    background: rgba(61,41,20,0.2);
    border-radius: 4px;
    border-left: 3px solid #8b6914;
    font-size: 0.82rem;
    max-width: 92%;
}
.tb-demo-stage .demo-clan-chat-panel .clan-chat-msg-own {
    align-self: flex-end;
    border-left: none;
    border-right: 3px solid #d4a84b;
    text-align: right;
    background: rgba(90,60,30,0.25);
}
.tb-demo-stage .demo-clan-chat-panel .chat-author {
    font-weight: bold;
    color: #5c4033;
    margin-right: 6px;
}
.tb-demo-stage .demo-clan-chat-panel .chat-time {
    font-size: 0.75rem;
    color: #8b7355;
}
.tb-demo-stage .demo-clan-chat-panel .chat-text {
    color: #3d2914;
    margin-top: 2px;
    line-height: 1.35;
}
.tb-demo-stage .demo-chat-own-msg {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s, transform 0.35s;
}
.tb-demo-stage .demo-chat-own-msg.visible {
    opacity: 1;
    transform: translateY(0);
}
.tb-demo-stage .demo-clan-chat-panel .clan-chat-form {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.tb-demo-stage .demo-clan-chat-panel .clan-chat-form input {
    flex: 1;
    min-width: 0;
    padding: 5px 8px;
    border: 2px solid #5c4033;
    border-radius: 4px;
    background: #fff;
    font-size: 0.78rem;
    color: #3d2914;
}
.tb-demo-stage .demo-clan-chat-panel .clan-chat-form button {
    padding: 5px 10px;
    border: 2px solid #5c4033;
    border-radius: 4px;
    background: linear-gradient(145deg, #5c4033 0%, #4a3520 100%);
    color: #d4a84b;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: default;
    white-space: nowrap;
}
.tb-demo-stage .demo-clan-chat-panel .clan-chat-form button.flash {
    filter: brightness(1.25);
}
.tb-demo-stage--chat { min-height: 240px; }

/* --- Регистрация --- */
.tb-demo-stage--register { min-height: 260px; }
.demo-register-scenes {
    position: relative;
    height: 100%;
    min-height: 0;
    padding: 2px 10px 10px;
    box-sizing: border-box;
    overflow: hidden;
}
.demo-register-scene {
    position: absolute;
    inset: 2px 10px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.demo-register-scene.demo-register-form-scene {
    align-items: flex-start;
    justify-content: center;
    padding-top: 10px;
    box-sizing: border-box;
}
.demo-register-scene.active {
    opacity: 1;
    pointer-events: auto;
}
.demo-register-map-preview {
    position: relative;
    width: 72%;
    max-width: 220px;
    aspect-ratio: 1 / 0.92;
    border-radius: 6px;
    border: 2px solid #2c1810;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(212,168,75,0.2);
}
.demo-register-map-mini {
    width: 100%;
    height: 100%;
    background:
        linear-gradient(165deg, #5c4033 0%, #4a3520 30%, #3d2914 100%),
        repeating-linear-gradient(45deg, rgba(212,168,75,0.08) 0 8px, transparent 8px 16px);
}
.demo-register-guest-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: rgba(20, 12, 6, 0.72);
    text-align: center;
}
.demo-register-guest-text {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #e8dcc4;
}
.tb-demo-stage .demo-register-login-btn {
    padding: 7px 14px;
    border: 2px solid #5c4033;
    border-radius: 4px;
    background: linear-gradient(145deg, #5c4033 0%, #4a3520 100%);
    color: #d4a84b;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.78rem;
    font-weight: bold;
    cursor: default;
    white-space: nowrap;
}
.tb-demo-stage .demo-register-login-btn.pulse {
    animation: demo-use-pulse 0.7s ease-in-out 2;
    border-color: #d4a84b;
}
.demo-register-box {
    width: 100%;
    max-width: 188px;
    background: linear-gradient(180deg, #f4e4bc 0%, #e8d5a3 100%);
    border: 2px solid #5c4033;
    border-radius: 8px;
    padding: 8px 10px;
    box-sizing: border-box;
}
.demo-register-box h4 {
    margin: 0 0 6px;
    text-align: center;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.84rem;
    color: #3d2914;
}
.demo-reg-label {
    display: block;
    margin: 0 0 2px;
    font-size: 0.65rem;
    font-weight: bold;
    color: #5c4033;
}
.tb-demo-stage .demo-register-box input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 5px;
    padding: 4px 6px;
    border: 1.5px solid #a89070;
    border-radius: 4px;
    background: #fff;
    font-size: 0.7rem;
    color: #2c1810;
}
.tb-demo-stage .demo-reg-submit {
    width: 100%;
    margin-top: 2px;
    padding: 5px 8px;
    border: 2px solid #5c4033;
    border-radius: 4px;
    background: linear-gradient(145deg, #5c4033 0%, #4a3520 100%);
    color: #d4a84b;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.72rem;
    font-weight: bold;
    cursor: default;
}
.tb-demo-stage .demo-reg-submit.flash {
    filter: brightness(1.25);
    border-color: #d4a84b;
}
.demo-register-success {
    margin-bottom: 10px;
    padding: 8px 14px;
    border-radius: 6px;
    background: rgba(74, 222, 128, 0.15);
    border: 2px solid rgba(74, 222, 128, 0.45);
    color: #86efac;
    font-weight: bold;
    font-size: 0.88rem;
    text-align: center;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.35s, transform 0.35s;
}
.demo-register-success.show {
    opacity: 1;
    transform: translateY(0);
}
.tb-demo-stage .demo-register-player {
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.4s, transform 0.4s;
    max-width: 280px;
}
.tb-demo-stage .demo-register-player.visible {
    opacity: 1;
    transform: scale(1);
}
.demo-register-ready {
    margin: 6px 0 0;
    font-size: 0.78rem;
    color: #b8a088;
}

@media (max-width: 600px) {
    .demo-item-flow {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px 2px;
        padding: 6px 4px 12px;
    }
    .demo-item-col {
        flex: 0 1 auto;
        max-width: 30%;
    }
    .demo-item-connector {
        padding-bottom: 28px;
        flex: 0 0 auto;
    }
    .demo-flow-arrow { font-size: 1rem; }
    .tb-demo-stage .shop-item-tile {
        width: 72px;
        padding: 6px;
    }
    .tb-demo-stage .shop-item-tile img {
        width: 40px;
        height: 40px;
    }
    .tb-demo-stage .inventory-tile {
        width: 64px;
        padding: 6px;
    }
    .demo-col-label { font-size: 0.68rem; }
    .demo-layout-equip {
        flex-direction: column;
        gap: 10px;
        padding: 6px 8px 10px;
    }
    .tb-demo-stage .equipment-grid {
        width: min(200px, 100%);
    }
    .tb-demo-stage .demo-equip-stats {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px 16px;
        width: 100%;
        min-width: 0;
    }
    .demo-equip-inventory {
        gap: 6px;
    }
    .demo-equip-inv-item {
        width: 46px;
        padding: 4px 6px;
    }
    .demo-equip-inv-item img {
        width: 30px;
        height: 30px;
    }
    .tb-demo-stage--pvp { min-height: 260px; }
    .demo-pvp-challenge-scene { padding: 6px 10px 10px; }
    .demo-pvp-arena-block { max-width: 100%; }
    .tb-demo-stage .pvp-duel-opponent,
    .tb-demo-stage .pvp-duel-task-area {
        max-width: 100%;
    }
    .demo-register-box {
        max-width: 100%;
    }
    .demo-register-map-preview {
        width: 88%;
    }
    .tb-demo-stage .demo-clan-chat-panel {
        max-width: 100%;
    }
    .tb-demo-stage .demo-clan-chat-panel .clan-chat-form {
        flex-direction: column;
    }
    .tb-demo-stage .demo-clan-chat-panel .clan-chat-form button {
        width: 100%;
    }
    .demo-layout-chest {
        flex-direction: column;
        padding: 10px 6px;
    }
}

/* --- Время битвы --- */
.tb-demo-stage--time { min-height: 220px; }
.demo-time-scenes {
    position: relative;
    min-height: 180px;
    padding: 8px 12px 12px;
    box-sizing: border-box;
}
.demo-time-scene {
    position: absolute;
    inset: 8px 12px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease;
}
.demo-time-scene.active {
    opacity: 1;
    pointer-events: auto;
}
.tb-demo-stage .demo-time-block {
    max-width: 300px;
    width: 100%;
}
.tb-demo-stage .demo-time-end-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.tb-demo-stage .demo-time-end-row .global-progress-title {
    margin-bottom: 0;
    font-size: 0.75rem;
}
.tb-demo-stage .capture-countdown-value {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.35rem;
    font-weight: bold;
    color: #d4a84b;
    text-align: center;
    letter-spacing: 0.08em;
}
.tb-demo-stage .demo-time-end-row .capture-countdown-value {
    font-size: 1.1rem;
}
.demo-time-finished-banner {
    padding: 10px 16px;
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(212,168,75,0.25) 0%, rgba(139,105,20,0.2) 100%);
    border: 2px solid rgba(212,168,75,0.55);
    color: #e8c86a;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.4s, transform 0.4s;
}
.demo-time-finished-banner.show {
    opacity: 1;
    transform: scale(1);
}
.tb-demo-stage .demo-time-winner-block {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.45s, transform 0.45s;
}
.tb-demo-stage .demo-time-winner-block.visible {
    opacity: 1;
    transform: translateY(0);
}
.demo-time-results-hint {
    margin: 0;
    font-size: 0.78rem;
    color: #b8a088;
    text-align: center;
}

/* --- Навыки и умения --- */
.tb-demo-stage--skills {
    padding: 0 10px 12px;
}
.demo-skills-panel {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 10px 12px 14px;
    border-radius: 10px;
    border: 2px solid #5c4033;
    background: linear-gradient(145deg, rgba(74,53,32,0.95) 0%, rgba(44,24,16,0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(212,168,75,0.1), 0 4px 14px rgba(0,0,0,0.28);
    min-height: 280px;
    position: relative;
}
.demo-skills-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    padding: 3px;
    border-radius: 8px;
    background: rgba(20,12,6,0.45);
    border: 1px solid rgba(92,64,51,0.55);
}
.demo-skills-tab {
    flex: 1;
    padding: 7px 6px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #9a8878;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.68rem;
    cursor: default;
    transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}
.demo-skills-tab.active {
    background: linear-gradient(180deg, rgba(212,168,75,0.22) 0%, rgba(92,64,51,0.45) 100%);
    color: #e8c86a;
    box-shadow: 0 0 10px rgba(212,168,75,0.15);
}
.demo-skills-scene {
    display: none;
    animation: demo-skills-fade-in 0.45s ease;
}
.demo-skills-scene.active {
    display: block;
}
.demo-skills-scene--tree.active {
    overflow-y: auto;
    max-height: 360px;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: #8b6914 #1a0f08;
}
.demo-skills-scene--tree.active::-webkit-scrollbar { width: 5px; }
.demo-skills-scene--tree.active::-webkit-scrollbar-thumb {
    background: #8b6914;
    border-radius: 3px;
}
@keyframes demo-skills-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.demo-skills-points-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 0.72rem;
    color: #b8a088;
}
.demo-skills-points-val {
    font-family: 'Cinzel', Georgia, serif;
    font-weight: 700;
    color: #e8c86a;
    min-width: 1ch;
}
.demo-skills-stat-cards {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.demo-skills-stat-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(92,64,51,0.65);
    background: rgba(20,12,6,0.38);
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
}
.demo-skills-stat-card.highlight {
    border-color: rgba(212,168,75,0.65);
    box-shadow: 0 0 12px rgba(212,168,75,0.2);
    transform: scale(1.02);
}
.demo-skills-stat-icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(212,168,75,0.12);
    border: 1px solid rgba(212,168,75,0.28);
    font-size: 0.95rem;
}
.demo-skills-stat-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.demo-skills-stat-name {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.74rem;
    font-weight: 700;
    color: #d4a84b;
}
.demo-skills-stat-desc {
    font-size: 0.62rem;
    color: #8a7868;
    line-height: 1.3;
}
.demo-skills-stat-stepper {
    display: flex;
    align-items: center;
    gap: 6px;
}
.demo-skills-stat-value {
    font-family: 'Cinzel', Georgia, serif;
    font-weight: 700;
    color: #e8dcc8;
    font-size: 0.9rem;
    min-width: 1.5ch;
    text-align: center;
    transition: transform 0.2s, color 0.2s;
}
.demo-skills-stat-value.bump {
    transform: scale(1.2);
    color: #e8c86a;
}
.demo-skills-stat-plus {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid rgba(212,168,75,0.45);
    background: linear-gradient(180deg, rgba(212,168,75,0.2) 0%, rgba(92,64,51,0.4) 100%);
    color: #e8c86a;
    font-size: 1rem;
    line-height: 1;
    cursor: default;
    transition: transform 0.15s, filter 0.15s;
}
.demo-skills-stat-plus.pulse {
    transform: scale(0.9);
    filter: brightness(1.35);
}
.demo-skills-save-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(212,168,75,0.45);
    background: linear-gradient(180deg, rgba(212,168,75,0.2) 0%, rgba(92,64,51,0.5) 100%);
    color: #e8c86a;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: default;
    opacity: 0.45;
    transition: opacity 0.3s, box-shadow 0.3s;
}
.demo-skills-save-btn.ready {
    opacity: 1;
    box-shadow: 0 0 14px rgba(212,168,75,0.25);
}
.demo-skills-save-btn.flash {
    filter: brightness(1.2);
}
.demo-skills-intro-text {
    margin: 0 0 10px;
    font-size: 0.68rem;
    line-height: 1.45;
    color: #b8a088;
    text-align: center;
}
.demo-skills-classes-scroll {
    overflow: hidden;
    margin-bottom: 10px;
}
.demo-skills-classes {
    display: flex;
    gap: 6px;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.demo-skills-class {
    flex: 0 0 72px;
    padding: 8px 4px;
    border-radius: 8px;
    border: 1px solid rgba(92,64,51,0.65);
    background: rgba(20,12,6,0.42);
    text-align: center;
    opacity: 0.55;
    filter: grayscale(0.4);
    transition: opacity 0.35s, filter 0.35s, border-color 0.35s, box-shadow 0.35s, transform 0.35s;
}
.demo-skills-class-icon {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 3px;
}
.demo-skills-class-name {
    display: block;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.58rem;
    color: #c4b49a;
    line-height: 1.2;
}
.demo-skills-class--target {
    opacity: 1;
    filter: none;
    border-color: rgba(90,138,196,0.75);
    box-shadow: 0 0 14px rgba(90,138,196,0.35);
    transform: scale(1.06);
}
.demo-skills-class--target .demo-skills-class-name {
    color: #a8c8e8;
}
.demo-skills-choose-btn {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid rgba(90,138,196,0.55);
    background: linear-gradient(180deg, rgba(90,138,196,0.28) 0%, rgba(92,64,51,0.5) 100%);
    color: #d8e8f8;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: default;
    opacity: 0.5;
    transition: opacity 0.3s, transform 0.2s, filter 0.2s;
}
.demo-skills-choose-btn.ready {
    opacity: 1;
}
.demo-skills-choose-btn.pulse {
    transform: scale(0.97);
    filter: brightness(1.25);
}
.demo-skills-class-banner strong {
    color: #a8c8f0;
    font-family: 'Cinzel', Georgia, serif;
}

/* --- Дерево умений (детальная сцена) --- */
.demo-skills-abilities-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 10px;
    margin-bottom: 8px;
}
.demo-skills-ability-points {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(212,168,75,0.4);
    background: rgba(212,168,75,0.1);
    font-size: 0.62rem;
    color: #b8a088;
}
.demo-skills-ability-points-val {
    font-family: 'Cinzel', Georgia, serif;
    font-weight: 700;
    color: #e8c86a;
    font-size: 0.78rem;
    min-width: 1ch;
    transition: transform 0.2s, color 0.2s;
}
.demo-skills-ability-points-val.bump {
    transform: scale(1.15);
    color: #fff0c8;
}
.demo-skills-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    font-size: 0.54rem;
    color: #8a7868;
}
.demo-skills-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}
.demo-skills-legend-item i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}
.demo-skills-legend-item--available i { background: #e8c86a; box-shadow: 0 0 4px rgba(232,200,106,0.5); }
.demo-skills-legend-item--progress i { background: #9a8878; }
.demo-skills-legend-item--locked i { background: #4a4845; }
.demo-skills-class-banner {
    text-align: center;
    margin-bottom: 8px;
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid rgba(90,138,196,0.45);
    background: linear-gradient(145deg, rgba(90,138,196,0.15) 0%, rgba(20,12,6,0.4) 100%);
    font-size: 0.62rem;
    color: #c8d8e8;
}
.demo-skills-tree-viewport {
    overflow: hidden;
    margin: 0 -4px;
    padding: 2px 4px 6px;
    border-radius: 8px;
    background: rgba(10,6,4,0.25);
}
.demo-skills-tree-track {
    display: flex;
    gap: 8px;
    align-items: stretch;
    justify-content: center;
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.demo-skills-branch {
    --sk-color: #5a8ac4;
    flex: 0 0 200px;
    width: 200px;
    border-radius: 10px;
    border: 1px solid rgba(92,64,51,0.7);
    background: linear-gradient(180deg, rgba(30,20,12,0.55) 0%, rgba(20,12,6,0.35) 100%);
    overflow: hidden;
}
.demo-skills-branch--foreign {
    flex: 0 0 52px;
    width: 52px;
    opacity: 0.32;
    filter: grayscale(0.9);
    pointer-events: none;
}
.demo-skills-branch--foreign .demo-skills-branch-head {
    font-size: 0.5rem;
    padding: 6px 2px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    min-height: 80px;
}
.demo-skills-branch--foreign .demo-skills-branch-head span {
    color: #6a6258;
}
.demo-skills-branch-ghost {
    height: 200px;
    background: linear-gradient(180deg, rgba(40,36,32,0.4), transparent);
}
.demo-skills-branch--active {
    border-color: color-mix(in srgb, var(--sk-color) 55%, #5c4033);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--sk-color) 20%, transparent), 0 4px 14px rgba(0,0,0,0.28);
}
.demo-skills-branch-head {
    text-align: center;
    padding: 7px 6px 6px;
    border-bottom: 1px solid color-mix(in srgb, var(--sk-color) 35%, transparent);
    background: linear-gradient(180deg, color-mix(in srgb, var(--sk-color) 12%, transparent), transparent);
}
.demo-skills-branch-name {
    display: block;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--sk-color);
    line-height: 1.2;
}
.demo-skills-branch-desc {
    display: block;
    margin-top: 2px;
    font-size: 0.54rem;
    line-height: 1.3;
    color: #8a7868;
}
.demo-skills-branch-body {
    padding: 4px 6px 8px;
}
.demo-sk-tier {
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 3px;
    align-items: start;
}
.demo-sk-tier-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10px;
}
.demo-sk-tier-roman {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.52rem;
    font-weight: 700;
    color: var(--sk-color);
    opacity: 0.9;
}
.demo-sk-tier-name {
    margin-top: 1px;
    font-size: 0.44rem;
    line-height: 1.1;
    color: #6a5a4a;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    max-height: 36px;
    overflow: hidden;
}
.demo-sk-tier-main { min-width: 0; }
.demo-sk-tier-hint {
    text-align: center;
    font-size: 0.48rem;
    color: #6a5a4a;
    font-style: italic;
    margin: 0 0 4px;
    line-height: 1.3;
}
.demo-sk-tier-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    align-items: stretch;
}
.demo-sk-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    padding-left: 16px;
    pointer-events: none;
}
.demo-sk-link-stem {
    width: 2px;
    height: 8px;
    background: color-mix(in srgb, var(--sk-color) 45%, #5c4033);
    border-radius: 1px;
}
.demo-sk-link-bar {
    width: 72%;
    height: 2px;
    background: color-mix(in srgb, var(--sk-color) 40%, #5c4033);
}
.demo-sk-link-legs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 72%;
}
.demo-sk-link-legs div {
    justify-self: center;
    width: 2px;
    height: 8px;
    background: color-mix(in srgb, var(--sk-color) 40%, #5c4033);
}
.demo-sk-link--fork .demo-sk-link-stem { height: 6px; }
.demo-sk-link--merge .demo-sk-link-legs div { height: 6px; }
.demo-sk-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 3px 5px;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: border-color 0.3s, box-shadow 0.3s, opacity 0.3s;
}
.demo-sk-node--locked {
    opacity: 0.72;
}
.demo-sk-node--locked .demo-sk-node-orb {
    border-color: rgba(70,68,64,0.6);
    background: radial-gradient(circle at 30% 30%, rgba(60,58,55,0.35), rgba(20,12,6,0.85));
    filter: grayscale(0.5);
}
.demo-sk-node--locked .demo-sk-node-title { color: #7a7268; }
.demo-sk-node--locked .demo-sk-node-card {
    border-color: rgba(60,58,55,0.5);
    background: rgba(15,12,10,0.5);
}
.demo-sk-node--available.demo-sk-node--glow {
    border-color: rgba(90,138,196,0.55);
    box-shadow: 0 0 14px rgba(90,138,196,0.3);
    animation: demo-sk-node-glow 1.8s ease-in-out infinite;
}
.demo-sk-node--progress .demo-sk-node-orb {
    border-color: color-mix(in srgb, var(--sk-color) 60%, #5a5550);
}
@keyframes demo-sk-node-glow {
    0%, 100% { box-shadow: 0 0 8px rgba(90,138,196,0.2); }
    50% { box-shadow: 0 0 18px rgba(90,138,196,0.45); }
}
.demo-sk-node-orb-wrap { position: relative; }
.demo-sk-node-orb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border: 2px solid rgba(90,138,196,0.55);
    background: radial-gradient(circle at 30% 30%, rgba(90,138,196,0.35), rgba(20,12,6,0.8));
    margin-bottom: 3px;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.demo-sk-node-pips {
    display: flex;
    gap: 3px;
    margin-bottom: 3px;
}
.demo-sk-node-pips span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    border: 1px solid rgba(90,138,196,0.45);
    background: rgba(20,12,6,0.8);
    transition: background 0.35s, box-shadow 0.35s, transform 0.25s;
}
.demo-sk-node-pips span.on {
    background: var(--sk-color);
    box-shadow: 0 0 5px color-mix(in srgb, var(--sk-color) 55%, transparent);
}
.demo-sk-node-pips span.pop {
    transform: scale(1.35);
}
.demo-sk-node-title {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.52rem;
    font-weight: 700;
    color: #e8dcc8;
    text-align: center;
    line-height: 1.2;
    min-height: 2.4em;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
.demo-sk-node-status {
    display: inline-block;
    margin-bottom: 3px;
    padding: 1px 5px;
    border-radius: 999px;
    font-size: 0.44rem;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.demo-sk-node-status--available {
    color: #fff0c8;
    background: rgba(90,138,196,0.25);
    border: 1px solid rgba(90,138,196,0.5);
}
.demo-sk-node-status--progress {
    color: #c8b8a8;
    background: rgba(50,48,45,0.55);
    border: 1px solid rgba(90,88,85,0.5);
}
.demo-sk-node-status--locked {
    color: #8a7068;
    background: rgba(30,28,26,0.6);
    border: 1px solid rgba(70,68,64,0.55);
}
.demo-sk-node-card {
    width: 100%;
    padding: 4px 5px;
    border-radius: 5px;
    border: 1px solid rgba(92,64,51,0.55);
    background: rgba(20,12,6,0.42);
    text-align: center;
    box-sizing: border-box;
}
.demo-sk-node-bonus {
    font-size: 0.48rem;
    line-height: 1.35;
    color: #9a8878;
    margin-bottom: 3px;
}
.demo-sk-node-lock {
    font-size: 0.44rem;
    line-height: 1.3;
    color: #6a5048;
    min-height: 2.5em;
}
.demo-sk-node-btn {
    display: block;
    width: 100%;
    padding: 3px 6px;
    border-radius: 5px;
    border: 1px solid rgba(212,168,75,0.4);
    background: linear-gradient(180deg, rgba(212,168,75,0.18) 0%, rgba(92,64,51,0.4) 100%);
    color: #e8c86a;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.48rem;
    cursor: default;
    transition: transform 0.15s, filter 0.15s;
}
.demo-sk-node-btn.pulse {
    transform: scale(0.96);
    filter: brightness(1.3);
}
.demo-sk-node-cost {
    display: block;
    margin-top: 2px;
    font-size: 0.42rem;
    color: #7a6a5a;
}
.demo-sk-node--fork-left.demo-sk-node--path-chosen,
.demo-sk-node--fork-left.demo-sk-node--available {
    opacity: 1;
    border-color: rgba(90,138,196,0.4);
}
.demo-sk-node--fork-right.demo-sk-node--path-dimmed {
    opacity: 0.45;
}
.demo-skills-bonuses-line {
    margin-top: 8px;
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid rgba(92,64,51,0.45);
    background: rgba(20,12,6,0.35);
    font-size: 0.54rem;
    color: #8a7868;
    text-align: center;
    line-height: 1.4;
    transition: color 0.35s, border-color 0.35s;
}
.demo-skills-bonuses-line--active {
    color: #c8d8e8;
    border-color: rgba(90,138,196,0.4);
}
.demo-skills-bonuses-line strong { color: #a8c8f0; }
.demo-skills-bonus-toast {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%) translateY(10px);
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid rgba(90,184,122,0.55);
    background: rgba(30,50,38,0.94);
    color: #b8e8c8;
    font-size: 0.58rem;
    font-family: 'Cinzel', Georgia, serif;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s, transform 0.35s;
    z-index: 2;
}
.demo-skills-bonus-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
@media (max-width: 600px) {
    .demo-skills-panel { max-width: 100%; min-height: 260px; }
    .demo-skills-panel--tree { min-height: 320px; }
    .demo-skills-tab { font-size: 0.62rem; padding: 8px 4px; }
    .demo-skills-branch { flex: 0 0 178px; width: 178px; }
    .demo-skills-branch--foreign { flex: 0 0 36px; width: 36px; }
    .demo-sk-node-title { font-size: 0.48rem; min-height: 2.2em; }
}
