/* ============================================================================
   1. СИСТЕМНЫЕ СТИЛИ, СКРОЛЛБАРЫ И ПЕРЕМЕННЫЕ
   ============================================================================ */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle, #223d29 0%, #16291b 50%, #3d2d14 100%);
    font-family: sans-serif;
    color: #fff;
    overflow: hidden;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.4);
}

/* Единые стили скроллбаров для всех окон и списков */
.dropdown-playlist::-webkit-scrollbar,
.custom-options-container::-webkit-scrollbar,
.box textarea::-webkit-scrollbar,
#questLogContainer ::-webkit-scrollbar,
#questLogList::-webkit-scrollbar,
#playlistTracksContainer::-webkit-scrollbar,
#settingsTabletContainer::-webkit-scrollbar,
#campingTabletContainer::-webkit-scrollbar,
#kingdomTabletContainer::-webkit-scrollbar,
.init-cards-scroll-list::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    display: block;
}

.dropdown-playlist::-webkit-scrollbar-track,
.custom-options-container::-webkit-scrollbar-track,
.box textarea::-webkit-scrollbar-track,
#questLogContainer ::-webkit-scrollbar-track,
#questLogList::-webkit-scrollbar-track,
#playlistTracksContainer::-webkit-scrollbar-track,
#settingsTabletContainer::-webkit-scrollbar-track,
#campingTabletContainer::-webkit-scrollbar-track,
#kingdomTabletContainer::-webkit-scrollbar-track,
.init-cards-scroll-list::-webkit-scrollbar-track {
    background: #040905;
    border-left: 1px solid rgba(138, 100, 33, 0.2);
    border-radius: 4px;
}

#questLogList::-webkit-scrollbar-track {
    margin: 15px 5px 15px 0;
}

.dropdown-playlist::-webkit-scrollbar-thumb,
.custom-options-container::-webkit-scrollbar-thumb,
.box textarea::-webkit-scrollbar-thumb,
#questLogContainer ::-webkit-scrollbar-thumb,
#questLogList::-webkit-scrollbar-thumb,
#playlistTracksContainer::-webkit-scrollbar-thumb,
#settingsTabletContainer::-webkit-scrollbar-thumb,
#campingTabletContainer::-webkit-scrollbar-thumb,
#kingdomTabletContainer::-webkit-scrollbar-thumb,
.init-cards-scroll-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8a6421 0%, #b89445 50%, #6e4e14 100%);
    border: 1px solid #543e0d;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.dropdown-playlist::-webkit-scrollbar-thumb:hover,
.custom-options-container::-webkit-scrollbar-thumb:hover,
.box textarea::-webkit-scrollbar-thumb:hover,
#questLogContainer ::-webkit-scrollbar-thumb:hover,
#questLogList::-webkit-scrollbar-thumb:hover,
#settingsTabletContainer::-webkit-scrollbar-thumb:hover,
#campingTabletContainer::-webkit-scrollbar-thumb:hover,
#kingdomTabletContainer::-webkit-scrollbar-thumb:hover,
.init-cards-scroll-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a68032 0%, #dfbc6f 50%, #8a6421 100%);
    border-color: #a68032;
}

.box textarea, .custom-options-container {
    scrollbar-width: thin;
    scrollbar-color: #b89445 #040905;
}

/* ============================================================================
   2. ВЬЮПОРТ И ГЛОБАЛЬНАЯ СЕТКА КАРТЫ (ГЕКСЫ)
   ============================================================================ */
.map-viewport {
    height: 100dvh;
    width: 100%;
    overflow: hidden;
    position: relative;
    cursor: grab;
    touch-action: none;
    contain: layout;
}

.map-viewport:active {
    cursor: grabbing;
}

.map-container {
    position: absolute;
    top: 0;
    right: 0;
    width: 3840px;
    height: 1280px;
    user-select: none;
    transform-origin: 100% 0;
    will-change: transform;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: subpixel-antialiased;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.map-image {
    display: block;
    width: 3840px;
    height: 1280px;
}

.visual-hex {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    z-index: 3;
}

.visual-hex:hover,
.visual-hex:focus-within {
    z-index: 10000 !important;
}

.visual-hex:has(.hex-quest-mini-tooltip) {
    z-index: 50;
}

.hex-shape {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.hex-shape::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.2s ease;
    pointer-events: none;
    z-index: 1;
}

.visual-hex:hover .hex-shape::before {
    background: rgba(0, 0, 0, 0.35);
}

.visual-hex.squad-dark .hex-shape::before {
    background: rgba(0, 0, 0, 0);
}

.visual-hex.squad-dark .hex-shape {
    background: radial-gradient(circle, rgba(231, 76, 60, 0.8) 0%, rgba(231, 76, 60, 0) 70%);
    filter: drop-shadow(0 0 4px #e74c3c);
}

.visual-hex.fog-active::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
    pointer-events: none;
}

.visual-hex.hex-focused-flash {
    z-index: 999999 !important;
}

.visual-hex.hex-focused-flash::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 216, 117, 0.8) 0%, rgba(231, 76, 60, 0.2) 70%);
    z-index: 999999;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    animation: hexPureRedFlash 1.2s ease-in-out 3;
    pointer-events: none;
    filter: drop-shadow(0 0 15px #ffd875);
}



/* ============================================================================
   3. ИКОНКИ, МАРКЕРЫ И ФЛАГИ НА КАРТЕ
   ============================================================================ */
.hex-stats-label,
.type-icon-container,
.explored-icon-container,
.mapped-icon-container,
.terrain-icon-container {
    position: absolute;
    pointer-events: none;
    color: #fff;
    text-shadow: 0 0 15px rgba(0, 0, 0, 0.7), 0 0 8px rgba(0, 0, 0, 0.9);
}

.hex-stats-label {
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    white-space: nowrap;
    bottom: 20px;
    font: bold 20px sans-serif;
}

.type-icon-container,
.explored-icon-container,
.mapped-icon-container,
.terrain-icon-container {
    z-index: 4;
    display: none;
}

.type-icon-container     { top: 32%; right: 10px; font-size: 24px; animation: floatAnim 3s infinite ease-in-out; }
.explored-icon-container { top: 32%; left: 10px;  font-size: 22px; animation: floatAnim 4s infinite ease-in-out; }
.mapped-icon-container   { top: 52%; left: 10px;  font-size: 22px; animation: floatAnim 4s infinite ease-in-out; }
.terrain-icon-container  { top: 52%; right: 10px; font-size: 22px; animation: floatAnim 4s infinite ease-in-out; }

.squad-flag-container {
    position: absolute;
    top: 50%;
    left: 45%;
    transform: translate(-50%, -50%);
    z-index: 4;
    pointer-events: none;
    display: none;
    transform-origin: bottom center;
}

.squad-flag-container.active-flag {
    animation: flagSwing 5s infinite ease-in-out;
}

.squad-pole {
    width: 6px;
    height: 50px;
    background: #333;
    margin-left: 6px;
    border-radius: 2px;
    border: 1px solid #000;
}

.squad-flag {
    width: 30px;
    height: 20px;
    background: #c0392b;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
    border: 2px solid #ffffff;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

.global-flying-flag {
    position: fixed;
    z-index: 999999;
    pointer-events: none;
    transform-origin: bottom center;
    left: 0;
    top: 0;
    width: 44px;
    height: 55px;
    will-change: transform, opacity;
    animation: windowsSmoothFly 1.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.flag-impact-burst {
    position: fixed;
    z-index: 999998;
    width: 100px;
    height: 100px;
    pointer-events: none;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.impact-spark {
    position: absolute;
    width: 6px;
    height: 20px;
    background: #fff;
    border-radius: 3px;
    box-shadow: 0 0 8px #f1c40f;
    transform-origin: center bottom;
    animation: sparkExplode 0.25s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

/* ============================================================================
   4. ТУЛТИПЫ И ПОДПИСИ ГЕКСОВ
   ============================================================================ */
.hex-tooltip {
    position: fixed;
    display: none;
    background: rgba(20, 20, 20, 0.95);
    color: #fff;
    padding: 18px 24px;
    border-radius: 9px;
    border: 2px solid #d4af37;
    font-size: 20px;
    max-width: 500px;
    z-index: 10006;
    pointer-events: none;
    line-height: 1.5;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.8),
    0 0 20px rgba(255, 255, 255, 0.6),
    0 0 35px #ffd875,
    0 0 60px rgba(223, 188, 111, 0.5);
}

.hex-tooltip .tooltip-value {
    color: #ffd875;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.tooltip-title,
.tooltip-desc {
    font-family: "Tinos", serif;
    font-weight: 700;
    color: #ffd875;
}

.tooltip-title {
    font-size: 24px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    -webkit-text-stroke: 0.5px #ffd875;
    text-shadow: 0 0 4px #dfbc6f, 0 0 12px rgba(223, 188, 111, 0.7), 0 2px 5px rgba(0, 0, 0, 0.95);
    margin-bottom: 8px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    padding-bottom: 6px;
}

.tooltip-desc {
    font-style: italic;
    font-size: 24px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    word-break: break-word;
}

.hex-title-label-framed {
    position: absolute;
    transform: translate(-50%, -50%);
    backface-visibility: hidden;
    z-index: 10005;
    padding: 3px 6px;
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #d4af37;
    border-radius: 9px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 220px;
}

.hex-title-text {
    color: #dfbc6f;
    font: bold 14px/1.2 sans-serif;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.visual-hex:hover .hex-title-label-framed {
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3), 0 0 8px rgba(212, 175, 55, 0.2);
    border-color: #ebd291;
}

.hex-title-label-framed:not(.hex-region-stats-framed) .hex-title-text {
    font-family: "Tinos", serif;
    font-style: italic;
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #ffd875;
    -webkit-text-stroke: 0.5px #ffd875;
    text-shadow: 0 0 4px #dfbc6f, 0 0 12px rgba(223, 188, 111, 0.7), 0 2px 5px rgba(0, 0, 0, 0.95);
}

.hex-region-stats-framed {
    padding: 2px 4px;
    max-width: 110px;
}

.hex-region-stats-framed .hex-title-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: #ebd291;
}

.hex-title-label-framed:has(.hex-title-text:empty),
.hex-region-stats-framed:has(.hex-title-text:empty),
.hex-quest-mini-tooltip:empty,
#visualLayer.hide-quest-tooltips .hex-quest-mini-tooltip {
    display: none;
}

.hex-quest-mini-tooltip {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -90%);
    z-index: 100000;
    background: rgba(20, 20, 20, 0.95);
    color: #dfbc6f;
    padding: 3px 6px;
    border-radius: 6px;
    border: 2px solid #d4af37;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.85);
    font: bold 14px sans-serif;
    width: max-content;
    max-width: 150px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    animation: floatAnimHigher 3.5s infinite ease-in-out;
}


/* ============================================================================
   5. БАЗОВАЯ РАМКА КАРТЫ
   ============================================================================ */
.kingmaker-frame {
    position: relative;
    pointer-events: none;
    z-index: 10000;
    border: 22px solid transparent;
    will-change: top, left, width, height;
    overflow: visible;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.8),
    0 0 25px rgba(255, 255, 255, 0.9),
    0 0 45px #ffd875,
    0 0 75px rgba(223, 188, 111, 0.85),
    0 0 120px rgba(223, 188, 111, 0.45);
}

.kingmaker-frame::before {
    content: '';
    position: absolute;
    inset: -22px;
    padding: 22px;
    background: linear-gradient(to bottom right, #8a6421 0%, #1e3625 15%, #b89445 30%, #152e1d 50%, #a68032 70%, #1c3324 85%, #6e4e14 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.frame-corner {
    position: absolute;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #a68032, #543e0d);
    border: 2px solid #36260d;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    z-index: 10005;
}

.frame-corner::before {
    content: '';
    position: absolute;
    inset: 4px;
    border: 2px solid #23472e;
    background: linear-gradient(135deg, #184024, #0b2112);
    box-shadow: inset 0 0 8px rgba(35, 71, 46, 0.8);
}

.top-left     { top: -24px; left: -24px; }
.top-right    { top: -24px; right: -24px; }
.bottom-left  { bottom: -24px; left: -24px; }
.bottom-right { bottom: -24px; right: -24px; }

.hex-rune {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #dfbc6f;
    text-shadow: 0 0 4px rgba(223, 188, 111, 0.7), 0 0 8px rgba(0, 0, 0, 0.9);
    z-index: 10001;
    font-family: monospace;
    animation: runeBreathe 3.5s ease-in-out infinite;
    will-change: opacity;
}

/* ============================================================================
   6. ОКОННЫЕ МОДАЛЬНЫЕ МЕНЮ И ФОРМЫ
   ============================================================================ */
.pop-menu {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #112618 0%, #09140d 100%);
    color: #ebd291;
    padding: 8px 25px 15px 25px;
    width: 550px;
    max-width: 95vw;
    border: 3px solid transparent;
    border-image: linear-gradient(to bottom right, #a68032, #543e0d, #b89445) 3 round;
    z-index: 10100;
    overflow: visible;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6),
    0 15px 40px rgba(0, 0, 0, 0.9),
    0 0 25px rgba(255, 255, 255, 0.9),
    0 0 45px #ffd875,
    0 0 75px rgba(223, 188, 111, 0.85),
    0 0 120px rgba(223, 188, 111, 0.45);
}

.pop-menu.open {
    display: block;
}

.menu-logo {
    display: block;
    width: 65%;
    max-width: 180px;
    margin: 0 auto;
}

.checkbox-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(84, 62, 13, 0.3);
}

.checkbox-row label,
.checkbox-row input[type="checkbox"] {
    cursor: pointer;
}

.checkbox-row label {
    color: #ebd291;
    font-size: 13px;
}

.checkbox-row input[type="checkbox"] {
    accent-color: #a68032;
}

.box {
    margin-bottom: 8px;
}

.box label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    color: #dfbc6f;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.box input[type="text"],
.box textarea,
.box select {
    width: 100%;
    padding: 6px 8px;
    background: #090f0b;
    border: 1px solid #543e0d;
    border-radius: 3px;
    color: #ebd291;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.box select {
    padding: 3px 24px 3px 8px;
    font-size: 16px;
}

.box select option {
    padding: 4px 6px;
    font-size: 16px;
}

.box select option:checked {
    background-color: #1e3c27;
    color: #dfbc6f;
}

.box input[type="text"]:focus,
.box textarea:focus,
.box select:focus,
.box input[type="text"]:hover,
.box textarea:hover,
.box select:hover {
    border-color: #b89445;
    box-shadow: 0 0 5px rgba(184, 148, 69, 0.4);
}

.box input[type="text"]:focus,
.box textarea:focus,
.custom-select.active .custom-select-trigger {
    border-color: #ffd875;
    overflow: visible;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.95),
    0 0 15px #ffd875,
    0 0 30px rgba(223, 188, 111, 0.85),
    inset 0 0 6px rgba(255, 216, 117, 0.2);
}

.box textarea {
    overflow-y: auto;
}

.box-row-combined {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
    width: 100%;
}

.box-row-combined .box {
    flex: 1;
    margin-bottom: 0;
}

.custom-select {
    position: relative;
    width: 100%;
    cursor: pointer;
}

.custom-select-trigger {
    display: block;
    width: 100%;
    padding: 6px 8px;
    background: #090f0b;
    border: 1px solid #543e0d;
    border-radius: 3px;
    color: #ebd291;
}

.custom-options-container {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 180px;
    background: #090f0b;
    border: 1px solid #b89445;
    border-radius: 0 0 4px 4px;
    z-index: 99999;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.85);
}

.custom-select.active .custom-options-container {
    display: block;
    overflow-y: auto;
    overflow-x: hidden;
}

.custom-option {
    padding: 6px 10px;
    color: #ebd291;
    cursor: pointer;
    transition: background 0.2s ease;
}

.custom-option:hover,
.custom-option.selected {
    background-color: #1e3c27;
    color: #dfbc6f;
}

#colorPresetsContainer {
    display: flex;
    gap: 8px;
}

.color-preset-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ccc;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-preset-btn:hover,
.color-preset-btn.active {
    transform: scale(1.15);
    border-color: #333;
}

.transparent-preset {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e74c3c;
    font-weight: bold;
}

.buttons {
    display: flex;
    gap: 15px;
    margin: 20px 0 0 0;
    width: 100%;
    justify-content: space-between;
    box-sizing: border-box;
    clear: both;
}

.buttons .btn {
    flex: 1 1 0%;
    width: 100%;
    padding: 12px 16px;
    border-radius: 3px;
    font: bold 14px sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    text-align: center;
    white-space: nowrap;
}

.btn.del { background: linear-gradient(180deg, #5c1e1e 0%, #3a1111 100%); color: #f7baba; border: 1px solid #823030; }
.btn.del:hover { border-color: #ff7675; filter: brightness(1.2); }
.btn.cc  { background: linear-gradient(180deg, #42351f 0%, #292011 100%); color: #ebd291; border: 1px solid #543e0d; }
.btn.cc:hover { border-color: #ebd291; filter: brightness(1.2); }
.btn.ok  { background: linear-gradient(180deg, #1e3c27 0%, #112417 100%); color: #dfbc6f; border: 1px solid #3e6349; }
.btn.ok:hover { border-color: #dfbc6f; filter: brightness(1.2); box-shadow: 0 0 8px rgba(223, 188, 111, 0.3); }




/* ============================================================================
   7. МОНОЛИТНЫЙ АУДИОПЛЕЕР И ЛЕГЕНДА КАРТЫ (ЧАСТЬ 1)
   ============================================================================ */
.music-player-monolith-wrapper {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 504px;
    z-index: 1005;
    display: flex;
    flex-direction: column;
    background: #112417;
    border: 2px solid #543e0d;
    border-radius: 4px;
    box-shadow: inset 1px 1px 0px #8a6421,
    inset -1px -1px 0px #8a6421,
    0 15px 35px rgba(0, 0, 0, 0.9),
    0 0 20px rgba(255, 255, 255, 0.9),
    0 0 40px #ffd875,
    0 0 70px rgba(223, 188, 111, 0.8),
    0 0 100px rgba(223, 188, 111, 0.4);
    transform: translateX(-550px);
    opacity: 0;
    pointer-events: none;
    overflow: visible;
    transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.25s ease;
}

.music-player-monolith-wrapper.ui-expanded {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.legend-container {
    position: relative;
    display: block;
    width: 100%;
    z-index: 2;
    transition: border-bottom 0.15s ease;
}

.legend-container.open {
    border-bottom: 1px solid rgba(84, 62, 13, 0.4);
}

.legend-header {
    background: rgba(0, 0, 0, 0.4);
    color: #ffd875;
    font-family: "Tinos", serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: inset 0 1px 0px #8a6421, inset 0 -1px 0px #8a6421, inset 1px 0px 0px #8a6421, inset -1px 0px 0px #8a6421;
    padding: 6px 12px;
    height: 27px;
    font-size: 16px;
    text-shadow: 0 0 4px #ffd875, 0 0 10px #dfbc6f, 0 0 20px rgba(223, 188, 111, 0.6), 0 2px 4px rgba(0, 0, 0, 0.9);
}

.legend-container.open .legend-header {
    border-bottom: 1px solid #543e0d;
}

.legend-header:hover {
    background: rgba(0, 0, 0, 0.5);
}

.legend-header button {
    font-size: 16px;
    background: none;
    border: none;
    color: #dfbc6f;
    cursor: pointer;
}

.legend-content {
    background: #112417;
    background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3));
    border: 1px solid #543e0d;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.9), inset 1px 1px 0px #8a6421, inset -1px -1px 0px #8a6421;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
    will-change: max-height, opacity, transform;
    transition: max-height 0.6s ease-in-out, opacity 0.5s ease-in-out, transform 0.6s ease-in-out, margin 0.6s ease-in-out;
}

.legend-container.open .legend-content {
    margin: 6px 6px 0 6px;
    opacity: 1;
    transform: translateY(0);
}

.legend-group {
    margin-bottom: 24px;
    width: 100%;
}

.legend-group:not(:first-of-type) { margin-top: 10px; }
.legend-group:last-of-type { margin-bottom: 0; }

.legend-group p {
    color: #ffd875;
    font-family: "Tinos", serif;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    margin: 8px 0 10px 0;
    letter-spacing: 1.5px;
    padding-bottom: 6px;
    text-align: center;
    display: block;
    border-bottom: 1px solid #dfbc6f;
    text-shadow: 0 0 4px #ffd875, 0 0 10px #dfbc6f, 0 0 20px rgba(223, 188, 111, 0.6), 0 2px 4px rgba(0, 0, 0, 0.9);
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px 10px;
    width: 100%;
    box-sizing: border-box;
    padding-bottom: 4px;
}

.legend-grid span {
    font-family: "Tinos", serif;
    font-weight: bold;
    color: #ebd291;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 6px 6px 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px dashed rgba(138, 100, 33, 0.25);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.music-controller {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.music-player-monolith-wrapper.playlist-open .music-controller {
    border-bottom: 1px solid rgba(84, 62, 13, 0.4);
}

.winamp-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(84, 62, 13, 0.4);
    padding: 0 4px;
    margin: 6px 6px 0 6px;
    width: calc(100% - 12px);
    height: 27px;
    font-size: 16px;
    box-shadow: inset 0 1px 0px #8a6421, inset 0 -1px 0px #8a6421, inset 1px 0px 0px #8a6421, inset -1px 0px 0px #8a6421;
    line-height: 27px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.winamp-title-bar:hover {
    background: rgba(138, 100, 33, 0.2);
    border-color: #dfbc6f;
}

.winamp-title-bar,
.winamp-track-info-marquee {
    font-family: "Tinos", serif;
    font-weight: bold;
    text-transform: uppercase;
    color: #ffd875;
    letter-spacing: 1.5px;
    text-shadow: 0 0 4px #ffd875, 0 0 10px #dfbc6f, 0 0 20px rgba(223, 188, 111, 0.6), 0 2px 4px rgba(0, 0, 0, 0.9);
}
/* ============================================================================
   7. МОНОЛИТНЫЙ АУДИОПЛЕЕР И ЛЕГЕНДА КАРТЫ (ЧАСТЬ 2: ЭКРАН И ПЛЕЙЛИСТ)
   ============================================================================ */
.winamp-display-section,
.winamp-timeline-section,
.winamp-action-section {
    margin-left: 6px;
    margin-right: 6px;
    width: calc(100% - 12px);
}

.winamp-display-section {
    display: grid;
    grid-template-columns: 172px 1fr;
    gap: 6px;
    height: 78px;
    margin-top: 9px;
    box-sizing: border-box;
}

.winamp-display-left,
.winamp-track-info-marquee {
    background: #040905;
    border: 1px solid #543e0d;
    box-shadow: inset 1px 1px 4px rgba(0, 0, 0, 0.9);
}

.winamp-track-info-marquee .marquee-text {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    animation: winampMarquee 15s linear infinite;
}

.winamp-display-left {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px;
}

.winamp-time-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wa-status-icon {
    font-size: 15px;
    color: #dfbc6f;
}

.winamp-display-left .time-lbl {
    font-family: 'Courier New', monospace;
    font-size: 27px;
    font-weight: bold;
    color: #dfbc6f;
    text-shadow: 0 0 5px rgba(223, 188, 111, 0.6);
}

.winamp-display-right {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    width: 100%;
}

.winamp-audio-kbps {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    color: #888;
    padding: 0 2px;
    font-family: monospace;
}

.winamp-audio-kbps .wa-kbps,
.winamp-audio-kbps .wa-khz {
    color: #ebd291;
    font-weight: bold;
}

.winamp-audio-kbps .wa-unit { color: #555; }

.wa-channels .wa-stereo.active {
    color: #2ecc71;
    text-shadow: 0 0 4px rgba(46, 204, 113, 0.5);
    font-weight: bold;
}

.wa-channels .wa-mono {
    margin-right: 4px;
    color: #444;
}

.winamp-sound-sliders {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.wa-slider-container {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(84, 62, 13, 0.4);
    padding: 3px 6px;
}

.wa-slider-icon { font-size: 9px; }

.wa-slider-container input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 9px;
    background: linear-gradient(to right, #42351f 0%, #8a6421 50%, #dfbc6f 100%);
    border: 1px solid #09140d;
    outline: none;
}

.wa-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 8px;
    height: 10px;
    background: #292011;
    border: 1px solid #543e0d;
    box-shadow: inset 1px 1px 0px #ebd291;
    cursor: pointer;
}

.winamp-timeline-section {
    position: relative;
    height: 18px;
    background: #040905;
    border: 1px solid #543e0d;
    box-shadow: inset 1px 1px 4px rgba(0, 0, 0, 0.9);
    cursor: pointer;
    margin-top: 9px;
    box-sizing: border-box;
}

.timeline-fill {
    height: 100%;
    background: linear-gradient(90deg, #8a6421, #dfbc6f);
    box-shadow: 0 0 4px rgba(223, 188, 111, 0.4);
    width: 0%;
}

.winamp-action-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.music-player-monolith-wrapper:not(.playlist-open) .music-controller .winamp-action-section {
    margin-bottom: 6px;
}

.winamp-playback-buttons {
    display: flex;
    gap: 3px;
}

.winamp-playback-buttons button {
    flex: 1;
    background: linear-gradient(to bottom, #42351f 0%, #292011 100%);
    border: 1px solid #543e0d;
    color: #ebd291;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    box-shadow: inset 1px 1px 0px #8a6421;
    height: 36px;
    font-size: 16px;
}

.winamp-playback-buttons button.winamp-main-play {
    color: #dfbc6f;
    flex: 1.5;
}

.winamp-meta-toggles {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 4px;
}

.winamp-meta-toggles button {
    font-family: monospace;
    font-weight: bold;
    background: linear-gradient(to bottom, #42351f 0%, #292011 100%);
    border: 1px solid #543e0d;
    color: #ebd291;
    cursor: pointer;
    box-shadow: inset 1px 1px 0px #8a6421;
    text-transform: uppercase;
    height: 30px;
    font-size: 15px;
}

.winamp-meta-toggles button.active,
.winamp-meta-toggles button.winamp-pl-toggle.active {
    background: #09140d;
    color: #dfbc6f;
    border-color: #dfbc6f;
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.8);
    text-shadow: 0 0 4px rgba(223, 188, 111, 0.8);
}

.winamp-meta-toggles .winamp-pl-toggle {
    background: linear-gradient(to bottom, #1e3c27 0%, #112417 100%);
    border-color: #3e6349;
    box-shadow: inset 1px 1px 0px #53805e;
    padding: 0 8px;
}

.winamp-playback-buttons button:active,
.winamp-meta-toggles button:active {
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.9);
    background: #19140b;
}

#playerPlaylist {
    position: relative;
    width: 100%;
    background: transparent;
    display: flex;
    flex-direction: column;
    max-height: 0;
    opacity: 0;
    transform: translateY(-5px);
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.5s ease-in-out, opacity 0.4s ease-in-out, transform 0.5s ease-in-out, visibility 0.5s;
}

#playerPlaylist.open {
    max-height: 430px;
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.playlist-title-bar {
    margin: 1px;
    width: calc(100% - 2px);
}

#playlistTracksContainer {
    max-height: 390px;
    height: 390px;
    overflow-y: auto;
    background: #040905;
    border: 1px solid #543e0d;
    box-shadow: inset 1px 1px 4px rgba(0, 0, 0, 0.9);
    padding: 4px;
    box-sizing: border-box;
}

.playlist-item {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #00e100;
    text-shadow: 0 0 3px rgba(0, 225, 0, 0.4);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.1s ease;
    font-size: 18px;
    padding: 5px 6px;
}

.playlist-item:hover {
    background: #12281a;
    color: #ffffff;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
}

.playlist-item.current {
    color: #ffffff;
    background: #163d24;
    border: 1px dashed #ebd291;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}



/* ============================================================================
   8. ЖУРНАЛ ЗАДАНИЙ И ПЛАНШЕТЫ (ПОЛНОЭКРАННЫЙ ТВ-РЕЖИМ HUD)
   ============================================================================ */
#questLogContainer,
.quest-log-container {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    background: #0d1e13 !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 8px 24px 24px 24px !important;
    box-sizing: border-box !important;
    z-index: 1999999 !important;
    transform: none !important;
    transition: opacity 0.25s ease, transform 0.25s ease !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    overflow: visible !important;
    contain: none !important;
    font-family: "Tinos", serif;
}

#questLogContainer.ui-collapsed {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: scale(0.99) !important;
}

#questLogContainer.init-round-flash-active {
    animation: initRoundFlashPulseHUD 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards !important;
}

/* Полностью скрываем старую текстовую шапку журнала для экономии места на ТВ */
#questLogContainer .quest-log-header,
#questLogContainer h2,
#questLogContainer h3,
#questLogContainer .quest-log-title,
#questLogContainer .quest-log-header-left {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Панель вкладок-табов */
.quest-log-tabs {
    display: flex !important;
    gap: 4px !important;
    flex-wrap: wrap !important;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(84, 62, 13, 0.4);
}

.quest-tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 6px 12px !important;
    color: #ebd291;
    font-family: "Tinos", serif;
    font-size: 15px !important;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px 4px 0 0 !important;
    transition: all 0.2s ease;
}

.quest-tab-btn:hover {
    background: rgba(21, 46, 29, 0.4);
    color: #ebd291;
    text-shadow: 0 0 6px #dfbc6f, 0 0 12px rgba(223, 188, 111, 0.4);
}

.quest-tab-btn.active {
    background: rgba(21, 46, 29, 0.6);
    color: #ffd875;
    border-bottom: 4px solid #a68032;
    text-shadow: 0 0 4px #ffd875, 0 0 10px #dfbc6f, 0 0 20px rgba(223, 188, 111, 0.6), 0 2px 4px rgba(0, 0, 0, 0.9);
}

.quest-tab-btn.tab-close-action {
    background: linear-gradient(180deg, rgba(92, 30, 30, 0.2) 0%, rgba(58, 17, 17, 0.4) 100%) !important;
    border-left: 1px solid rgba(130, 48, 48, 0.4) !important;
}

.quest-tab-btn.tab-close-action:hover {
    background: linear-gradient(180deg, #5c1e1e 0%, #3a1111 100%) !important;
    color: #fff !important;
    text-shadow: 0 0 8px rgba(255, 118, 117, 0.6) !important;
}

/* Рабочие области вкладок */
#questLogList,
#settingsTabletContainer,
#campingTabletContainer,
#kingdomTabletContainer {
    flex-grow: 1 !important;
    width: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: calc(100vh - 90px) !important;
    padding-right: 10px !important;
    box-sizing: border-box !important;
}

#initiativeTabletContainer {
    flex-grow: 1 !important;
    width: 100% !important;
    overflow: visible !important;
    contain: none !important;
}

/* Карточки заданий и слухов в стиле ТВ */
.quest-log-list {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.quest-log-item,
#questLogList .quest-log-item.status-rumor {
    background: #050806 !important;
    border: 3px solid #543e0d !important;
    border-left: 4px solid #a68032 !important;
    padding: 18px 24px !important;
    border-radius: 6px !important;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
    transition: all 0.2s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.quest-log-item:hover,
#questLogList .quest-log-item.status-rumor:hover {
    border-color: #b89445 !important;
    background: rgba(184, 148, 69, 0.05) !important;
}

.quest-item-title,
#questLogList .quest-item-title {
    font-family: "Tinos", serif;
    font-size: 35px !important;
    font-weight: 900 !important;
    line-height: 1.15 !important;
    color: #ffd875 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin-bottom: 10px !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9) !important;
}

.quest-item-location,
#questLogList .quest-item-location {
    font-family: "Tinos", serif;
    font-size: 35px !important;
    color: #a4b0be !important;
    margin-bottom: 14px !important;
}

.quest-item-desc,
#questLogList .quest-item-desc {
    font-family: "Tinos", serif;
    font-size: 45px !important;
    line-height: 1.35 !important;
    font-style: italic;
    border-top: 2px dashed rgba(84, 62, 13, 0.5);
    padding-top: 16px !important;
    margin-top: 14px !important;
    color: #dfbc6f !important;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9) !important;
}

.quest-log-empty {
    text-align: center;
    color: #888;
    font-family: "Tinos", serif;
    font-size: 24px;
    padding: 60px 0;
}




/* ============================================================================
   9. ПРАВАЯ ПАНЕЛЬ И КНОПКИ ИНТЕРФЕЙСА (СЕТКА 3x4)
   ============================================================================ */
.right-controls-panel {
    position: fixed !important;
    right: 40px !important;
    bottom: 40px !important;
    z-index: 10005 !important;
    display: grid !important;
    grid-template-columns: repeat(3, 46px) !important;
    gap: 8px !important;
    border-radius: 6px !important;
    padding: 6px !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    overflow: visible !important;
    transition: background 0.25s ease, box-shadow 0.25s ease !important;
}

.right-controls-panel.ui-expanded::before {
    content: "" !important;
    position: absolute !important;
    inset: -20px !important;
    z-index: -1 !important;
    border-radius: 20px !important;
    background: #ffd875 !important;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.8),
    0 0 35px rgba(255, 255, 255, 0.9),
    0 0 55px #ffd875,
    0 0 90px rgba(223, 188, 111, 0.85),
    0 0 150px rgba(223, 188, 111, 0.45) !important;
    filter: blur(14px) !important;
    pointer-events: none !important;
}

.right-controls-panel button {
    pointer-events: auto !important;
    will-change: transform, opacity;
}

.right-controls-panel .btn-ui-toggle,
.right-controls-panel #btnFrameStyle,
.right-controls-panel #btnTogglePaths {
    width: 46px !important;
    height: 44px !important;
    font-size: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    background: linear-gradient(180deg, #42351f 0%, #292011 100%) !important;
    border: 1px solid #543e0d !important;
    color: #ebd291 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8) !important;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.right-controls-panel .master-toggle-btn {
    background: linear-gradient(180deg, #4f5d65 0%, #2c3539 100%) !important;
    border: 1px solid #778ca3 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 14px rgba(209, 216, 224, 0.3) !important;
}

.right-controls-panel .master-toggle-btn.ui-active {
    transform: rotate(90deg) !important;
}

.right-controls-panel button:hover,
.right-controls-panel .btn-ui-toggle:hover,
.right-controls-panel #btnFrameStyle:hover,
.right-controls-panel #btnTogglePaths:hover {
    background: linear-gradient(180deg, #b89445 0%, #6e4e14 100%) !important;
    border-color: #ebd291 !important;
    color: #fff !important;
    box-shadow: 0 0 12px rgba(184, 148, 69, 0.6), 0 6px 18px rgba(0, 0, 0, 0.6) !important;
}

.right-controls-panel:not(.ui-expanded) button:not(.master-toggle-btn),
.right-controls-panel.ui-collapsed button:not(.master-toggle-btn) {
    transform: scale(0.6) translateY(40px) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.right-controls-panel.ui-expanded button:not(.master-toggle-btn) {
    transform: scale(1) translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

#visualLayer.hide-quest-tooltips ~ .right-controls-panel #btnToggleTooltips,
.right-controls-panel #btnTogglePaths.paths-hidden,
.right-controls-panel #btnToggleKingdomRoads.paths-hidden {
    background: linear-gradient(180deg, #5c1e1e 0%, #3a1111 100%) !important;
    border-color: #823030 !important;
    color: #f7baba !important;
}

.right-controls-panel:not(.ui-expanded) .master-toggle-btn {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6),
    0 0 15px rgba(255, 255, 255, 0.8),
    0 0 25px #ffd875,
    0 0 45px rgba(223, 188, 111, 0.6) !important;
}

.right-controls-panel:not(.ui-expanded) .master-toggle-btn:hover {
    box-shadow: 0 0 20px rgba(255, 255, 255, 1),
    0 0 35px #ffd875,
    0 0 55px #dfbc6f,
    0 6px 18px rgba(0, 0, 0, 0.7) !important;
}

#mapPathsSvg {
    position: absolute;
    top: 0;
    left: 0;
    width: 3840px;
    height: 1280px;
    z-index: 5 !important;
    pointer-events: none;
}

#mapPathsSvg.hide-paths {
    display: none !important;
}

/* ============================================================================
   10. СИСТЕМНЫЕ АНИМАЦИИ И СПЕЦЭФФЕКТЫ КАРТЫ
   ============================================================================ */
@keyframes floatAnim {
    0%, 100% { transform: translate(0, 0) rotate(-5deg); }
    50%      { transform: translate(2px, -3px) rotate(5deg); }
}

@keyframes floatAnimHigher {
    0%, 100% { transform: translate(-50%, -90%) translateY(0) rotate(-1deg); }
    50%      { transform: translate(-50%, -90%) translateY(-4px) rotate(1deg); }
}

@keyframes flagSwing {
    0%, 100% { transform: translate(-50%, -50%) rotate(-5deg); }
    50%      { transform: translate(-50%, -50%) rotate(5deg); }
}

@keyframes hexPureRedFlash {
    0%, 100% { opacity: 0; }
    50%      { opacity: 1; }
}

@keyframes windowsSmoothFly {
    0%   { opacity: 0; transform: translate3d(var(--start-x), var(--start-y), 0) scale(2.5) rotate(-90deg); }
    1%   { opacity: 1; }
    100% { opacity: 1; transform: translate3d(var(--target-x), var(--target-y), 0) scale(1) rotate(-90deg); }
}

@keyframes windowsSmoothFly3D {
    0%   { opacity: 0; transform: translate3d(var(--start-x), var(--start-y), 0) scale(0.7); }
    12%  { opacity: 1; }
    100% { opacity: 1; transform: translate3d(var(--target-x), var(--target-y), 0) scale(1); }
}

@keyframes sparkExplode {
    0%   { transform: rotate(var(--angle, 0deg)) translateY(0) scaleY(0.3); opacity: 1; }
    100% { transform: rotate(var(--angle, 0deg)) translateY(45px) scaleY(1.5) scaleX(0.1); opacity: 0; }
}

@keyframes runeBreathe {
    0%, 100% { opacity: 0.01; }
    50%      { opacity: 0.99; }
}

@keyframes winampMarquee {
    0%   { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

@keyframes beamShootOut {
    0%   { transform: rotate(var(--angle, 0deg)) translateY(0px) scaleY(0.01) scaleX(0.1); opacity: 0; }
    20%  { opacity: 1; transform: rotate(var(--angle, 0deg)) translateY(-15px) scaleY(1) scaleX(3.8); }
    55%  { opacity: 0.85; transform: rotate(var(--angle, 0deg)) translateY(-40px) scaleY(1.15) scaleX(1.4); }
    100% { transform: rotate(var(--angle, 0deg)) translateY(-70px) scaleY(1.45) scaleX(0.01); opacity: 0; }
}

@keyframes initRoundFlashPulseHUD {
    0%   { box-shadow: none !important; background-color: #0d1e13 !important; }
    15%  { box-shadow: inset 0 0 200px 40px rgba(255, 216, 117, 0.5) !important; background-color: #24351a !important; }
    100% { box-shadow: none !important; background-color: #0d1e13 !important; }
}

.wa-minimize {
    display: inline-block;
    cursor: pointer;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.wa-minimize:hover {
    color: #ffffff;
    text-shadow: 0 0 8px #ffd875, 0 0 15px #dfbc6f, 0 2px 4px rgba(0, 0, 0, 0.9);
}

.hex-beams-burst {
    position: fixed;
    z-index: 999998;
    width: 1px;
    height: 1px;
    pointer-events: none;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.focus-beam {
    position: absolute;
    background: transparent;
    width: 1px;
    height: 1px;
    box-shadow: 0 -15px 12px 12px #ffffff,
    0 -25px 20px 15px #ffffff,
    0 -40px 35px 25px #ffd875,
    0 -55px 50px 35px #ffd875,
    0 -75px 80px 55px #dfbc6f,
    0 -95px 130px 80px rgba(223, 188, 111, 0.95);
    filter: blur(1px);
    transform-origin: center bottom;
    will-change: transform, opacity;
    animation: beamShootOut 0.7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.squad-path-line {
    stroke: #ffd875;
    stroke-width: 6px;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 8, 8;
    fill: none;
    filter: drop-shadow(0 0 5px rgba(223, 188, 111, 0.7));
    will-change: transform;
}

canvas[style*="position: fixed"] {
    animation: windowsSmoothFly3D 1.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards !important;
}

@media (max-width: 480px) {
    .buttons {
        flex-direction: column;
        gap: 10px;
    }
}

/* ============================================================================
11. ДОПОЛНИТЕЛЬНЫЕ ЭФФЕКТЫ И МЕДИА-ЗАПРОСЫ (OLD) @TODO DELETE
============================================================================ */
/*
.wa-minimize {
    display: inline-block;
    cursor: pointer;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}
.wa-minimize:hover {
    color: #ffffff;
    text-shadow: 0 0 8px #ffd875, 0 0 15px #dfbc6f, 0 2px 4px rgba(0, 0, 0, 0.9);
}
.hex-beams-burst {
    position: fixed;
    z-index: 999998;
    width: 1px;
    height: 1px;
    pointer-events: none;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.focus-beam {
    position: absolute;
    background: transparent;
    width: 1px;
    height: 1px;
    border-radius: 0;
    box-shadow: 0 -15px 12px 12px #ffffff,
    0 -25px 20px 15px #ffffff,
    0 -40px 35px 25px #ffd875,
    0 -55px 50px 35px #ffd875,
    0 -75px 80px 55px #dfbc6f,
    0 -95px 130px 80px rgba(223, 188, 111, 0.95);
    filter: blur(1px);
    transform-origin: center bottom;
    will-change: transform, opacity;
    animation: beamShootOut 0.7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.squad-path-line {
    stroke: #ffd875;
    stroke-width: 6px;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 8, 8;
    fill: none;
    filter: drop-shadow(0 0 5px rgba(223, 188, 111, 0.7));
    will-change: transform;
}

@media (max-width: 480px) {
    .buttons {
        flex-direction: column;
        gap: 10px;
    }
}
 */

/* ============================================================================
   11. ПЛАНШЕТ КОРОЛЕВСТВА И ХОЛСТ КАРТЫ
   ============================================================================ */
.kingdom-tablet-content {
    display: flex;
    gap: 30px;
    padding: 30px;
    flex-grow: 1;
    overflow-y: auto;
    font-family: "Tinos", serif;
    flex-wrap: nowrap;
}

.kingdom-left-col {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.kingdom-right-col {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    border-left: 2px dashed rgba(138, 100, 33, 0.3);
    padding-left: 30px;
}

.kingdom-section-title {
    font-size: 24px;
    font-weight: bold;
    color: #ffd875;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.4);
    padding-bottom: 5px;
    text-shadow: 0 0 6px rgba(255, 216, 117, 0.4);
}

.kingdom-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.k-stat-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #543e0d;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.k-stat-name {
    font-size: 18px;
    color: #dfbc6f;
}

.k-stat-controls,
.k-res-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.k-stat-controls button,
.k-res-controls button {
    background: linear-gradient(180deg, #42351f 0%, #292011 100%);
    border: 1px solid #543e0d;
    color: #ebd291;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 3px;
}

.k-stat-controls button:hover,
.k-res-controls button:hover {
    border-color: #ebd291;
    color: #fff;
}

.k-stat-val,
.k-res-number {
    font-size: 18px;
    font-weight: bold;
    color: #ffd875;
    min-width: 60px;
    text-align: center;
}

.kingdom-resources-panel {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(84, 62, 13, 0.5);
    padding: 15px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.k-resource-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    color: #ebd291;
}

.kingdom-leaders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.k-leader-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border: 1px solid rgba(84, 62, 13, 0.3);
    border-radius: 4px;
}

.k-leader-role {
    color: #dfbc6f;
    font-weight: bold;
    font-size: 16px;
}

.k-leader-row input[type="text"] {
    background: #090f0b;
    border: 1px solid #543e0d;
    border-radius: 3px;
    color: #ebd291;
    padding: 6px 10px;
    font-family: "Tinos", serif;
    font-size: 16px;
    outline: none;
}

.k-leader-row input[type="text"]:focus {
    border-color: #ffd875;
    box-shadow: 0 0 5px rgba(255, 216, 117, 0.4);
}

.kingdom-save-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    gap: 15px;
    box-sizing: border-box;
    margin-top: auto;
    padding-top: 10px;
}

.btn.ok.k-btn-save-small {
    flex: none;
    width: auto;
    min-width: 140px;
    padding: 8px 20px;
    font-size: 13px;
}

#mapCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 3840px;
    height: 1280px;
    z-index: 10 !important;
    pointer-events: auto;
    image-rendering: optimizeQuality;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

/* ============================================================================
   12. СТИЛИ РАМОК: ОБЫЧНЫЙ И ТЯЖЕЛЫЙ ОРНАМЕНТ (ЧАСТЬ 1)
   ============================================================================ */
.frame-style-ornament,
.frame-style-ornament-heavy {
    opacity: 1 !important;
    visibility: visible !important;
}

#ornamentCanvas {
    position: absolute;
    inset: -22px;
    pointer-events: none;
    z-index: 10003;
    will-change: transform;
}

.kingmaker-frame.frame-style-ornament-heavy {
    border: 22px solid transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    will-change: transform, top, left, width, height;
    transform: translateZ(0);
}

.kingmaker-frame.frame-style-ornament-heavy::before {
    position: absolute !important;
    inset: -22px !important;
    padding: 22px !important;
    background: linear-gradient(to bottom right, #8a6421 0%, #1e3625 15%, #b89445 30%, #152e1d 50%, #a68032 70%, #1c3324 85%, #6e4e14 100%) !important;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0) !important;
    -webkit-mask-composite: xor !important;
    mask-composite: exclude !important;
}

.kingmaker-frame.frame-style-ornament-heavy::after {
    content: "" !important;
    position: absolute !important;
    inset: -22px !important;
    border: none !important;
    background-color: transparent !important;
    pointer-events: none !important;
    z-index: 10002 !important;
    box-shadow: 0 0 20px 26px rgba(255, 216, 117, 0.85),
    0 0 45px 32px rgba(223, 188, 111, 0.65),
    0 0 160px 48px rgba(223, 188, 111, 0.25) !important;
    will-change: transform;
    transform: translateZ(0);
}

.heavy-absolute-shield {
    display: none !important;
}

.frame-style-ornament-heavy .heavy-absolute-shield {
    display: block !important;
    position: absolute !important;
    inset: -46px !important;
    border: 24px solid #16291b !important;
    background-color: transparent !important;
    background-clip: border-box !important;
    -webkit-mask: none !important;
    mask: none !important;
    z-index: 10001 !important;
    pointer-events: none !important;
    box-shadow: none !important;
}

/* ============================================================================
   12. СТИЛИ РАМОК: ТЯЖЕЛЫЙ ОРНАМЕНТ (ЧАСТЬ 2: ЗУБЦЫ, БАСТИОНЫ И УГЛЫ)
   ============================================================================ */
.frame-style-ornament-heavy .diamond-row {
    position: absolute;
    display: flex;
    pointer-events: none;
    z-index: 10004 !important;
    overflow: hidden;
    box-shadow: none !important;
    filter: none !important;
}

.frame-style-ornament-heavy .diamond-row.row-top,
.frame-style-ornament-heavy .diamond-row.row-bottom {
    justify-content: center !important;
    height: 34px;
    left: 26px;
    right: 26px;
}

.frame-style-ornament-heavy .diamond-row.row-top    { top: -29px; }
.frame-style-ornament-heavy .diamond-row.row-bottom { bottom: -29px; }

.frame-style-ornament-heavy .diamond-row.row-left,
.frame-style-ornament-heavy .diamond-row.row-right {
    justify-content: space-between;
    width: 34px;
    flex-direction: column;
    top: 22px;
    bottom: 22px;
}

.frame-style-ornament-heavy .diamond-row.row-left  { left: -29px; }
.frame-style-ornament-heavy .diamond-row.row-right { right: -29px; }

.frame-style-ornament-heavy .diamond-tooth {
    width: 20px;
    height: 20px;
    background-color: #8a6421;
    border: 1.5px solid #dfbc6f;
    transform: rotate(45deg);
    flex-shrink: 0;
    box-shadow: none !important;
    filter: none !important;
}

.frame-style-ornament-heavy .diamond-tooth::before {
    content: '' !important;
    position: absolute !important;
    inset: 2px !important;
    background: linear-gradient(135deg, #184024, #0b2112) !important;
}

.frame-style-ornament-heavy .diamond-tooth::after {
    content: '' !important;
    position: absolute !important;
    inset: 5px !important;
    background: linear-gradient(135deg, #ffd875, #b89445) !important;
    border: 0.5px solid #3a2a0a !important;
}

.frame-style-ornament-heavy .diamond-row.row-top .diamond-tooth,
.frame-style-ornament-heavy .diamond-row.row-bottom .diamond-tooth { margin: auto 4.5px; }
.frame-style-ornament-heavy .diamond-row.row-left .diamond-tooth,
.frame-style-ornament-heavy .diamond-row.row-right .diamond-tooth { margin: 4px auto; }

.center-bastion {
    position: absolute;
    background: linear-gradient(135deg, #a68032, #543e0d);
    box-shadow: none !important;
    z-index: 10006 !important;
    pointer-events: none;
}

.center-bastion::before {
    content: '';
    position: absolute;
    inset: 4px;
    background: linear-gradient(135deg, #184024, #0b2112);
    box-shadow: inset 0 0 15px rgba(35, 71, 46, 0.9);
}

.center-bastion,
.center-bastion::before {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.bastion-top    { width: 180px; height: 60px; top: -42px; left: 50%; transform: translateX(-50%); }
.bastion-bottom { width: 180px; height: 60px; bottom: -42px; left: 50%; transform: translateX(-50%); }
.bastion-left   { width: 60px; height: 180px; left: -42px; top: 50%; transform: translateY(-50%); }
.bastion-right  { width: 60px; height: 180px; right: -42px; top: 50%; transform: translateY(-50%); }

.diamond-spacer { flex-grow: 1; pointer-events: none; }

.frame-style-ornament-heavy .frame-corner {
    width: 68px;
    height: 68px;
    border: 0px solid #184024;
    box-shadow: none !important;
    z-index: 10006 !important;
}

.frame-style-ornament-heavy .frame-corner::before {
    inset: 5px;
    border: 2px solid #23472e;
    box-shadow: inset 0 0 12px rgba(35, 71, 46, 0.9);
}

.frame-style-ornament-heavy .frame-corner,
.frame-style-ornament-heavy .frame-corner::before {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.frame-style-ornament-heavy .top-left     { top: -46px; left: -46px; }
.frame-style-ornament-heavy .top-right    { top: -46px; right: -46px; }
.frame-style-ornament-heavy .bottom-left  { bottom: -46px; left: -46px; }
.frame-style-ornament-heavy .bottom-right { bottom: -46px; right: -46px; }

.center-bastion .bastion-diamond {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #a68032, #543e0d);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.85), 0 0 3px #ffd875;
    z-index: 10007 !important;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.center-bastion .bastion-diamond::before {
    content: '' !important;
    position: absolute !important;
    inset: 3.5px;
    border: 1.5px solid #23472e;
    background: linear-gradient(135deg, #184024, #0b2112) !important;
    box-shadow: inset 0 0 8px rgba(35, 71, 46, 0.9);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.frame-style-ornament-heavy .frame-corner::after {
    content: '' !important;
    position: absolute !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 24px;
    height: 24px;
    z-index: 10008 !important;
    background: linear-gradient(135deg, #184024, #0b2112) padding-box,
    linear-gradient(135deg, #a68032, #543e0d) border-box !important;
    border: 2px solid transparent !important;
    box-shadow: inset 0 0 6px rgba(35, 71, 46, 0.9), 0 0 6px rgba(0, 0, 0, 0.85) !important;
}

.frame-style-ornament-heavy .frame-corner .corner-sub-diamond {
    position: absolute;
    width: 10px;
    height: 10px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    z-index: 10009 !important;
    background: linear-gradient(135deg, #ffd875, #b89445) !important;
    border: 1px solid #543e0d !important;
}

.frame-style-ornament-heavy .center-bastion .bastion-sub-diamond {
    position: absolute;
    width: 14px;
    height: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10008 !important;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%) !important;
    background: linear-gradient(135deg, #ffd875, #b89445) !important;
}

.frame-style-ornament-heavy ~ .map-viewport .map-container,
.frame-style-ornament-heavy ~ .map-container,
.kingmaker-frame.frame-style-ornament-heavy ~ .map-container {
    clip-path: inset(22px) !important;
    z-index: 1 !important;
}





/* ============================================================================
   13. ТАКТИЧЕСКАЯ СЕТКА, ЗАЩИТА ТЕКСТУР ПОЛА И ЭФФЕКТЫ ОТРЯДА
   ============================================================================ */
.tactical-square.squad-dark {
    background: rgba(24, 64, 36, 0.2) !important;
    box-shadow: inset 0 0 0 2px #dfbc6f, inset 0 0 10px rgba(43, 203, 116, 0.4) !important;
}

.tactical-square.focused-entity {
    box-shadow: inset 0 0 0 3px #ffd875, 0 0 12px #ffd875 !important;
}

/* Базовые текстуры пола и защита при наложении любых объектов (obstacle-*) */
.tactical-square.floor-planks,
.tactical-square.floor-planks[class*="obstacle-"] {
    background-color: #4a3329 !important;
    background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.4) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) !important;
    background-size: 10px 100%, 100% 20px !important;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.6) !important;
}

.tactical-square.floor-cobble,
.tactical-square.floor-cobble[class*="obstacle-"] {
    background-color: #383838 !important;
    background-image: linear-gradient(45deg, rgba(0, 0, 0, 0.3) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.3) 75%, rgba(0, 0, 0, 0.3)),
    linear-gradient(45deg, rgba(0, 0, 0, 0.3) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.3) 75%, rgba(0, 0, 0, 0.3)) !important;
    background-size: 14px 14px !important;
    background-position: 0 0, 7px 7px !important;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.7) !important;
}

.tactical-square.floor-earth,
.tactical-square.floor-earth[class*="obstacle-"] {
    background-color: #2b1a17 !important;
    background-image: radial-gradient(rgba(0, 0, 0, 0.3) 15%, transparent 20%) !important;
    background-size: 6px 6px !important;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5) !important;
}

.tactical-square[class*="obstacle-"][class*="floor-"] {
    border: none !important;
}

/* Объекты на пустой клетке без покрытия пола */
.tactical-square[class*="obstacle-"]:not(.floor-planks):not(.floor-cobble):not(.floor-earth) {
    background-color: #16291b !important;
}

.tactical-square.obstacle-ice:not(.floor-planks):not(.floor-cobble):not(.floor-earth) {
    background-color: rgba(0, 206, 201, 0.15) !important;
    border: 1px solid rgba(0, 206, 201, 0.5) !important;
    box-shadow: inset 0 0 10px rgba(0, 206, 201, 0.3) !important;
}

.tactical-square.obstacle-web:not(.floor-planks):not(.floor-cobble):not(.floor-earth) {
    background-color: rgba(155, 89, 182, 0.15) !important;
    box-shadow: inset 0 0 12px rgba(155, 89, 182, 0.25) !important;
}

.tactical-square.obstacle-wall:not(.floor-planks):not(.floor-cobble):not(.floor-earth),
.tactical-square.obstacle-destructible:not(.floor-planks):not(.floor-cobble):not(.floor-earth),
.tactical-square.obstacle-stones:not(.floor-planks):not(.floor-cobble):not(.floor-earth) {
    background-color: rgba(0, 0, 0, 0.2) !important;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.4) !important;
}

.tactical-square.obstacle-water:not(.floor-planks):not(.floor-cobble):not(.floor-earth) {
    background-color: rgba(41, 128, 185, 0.2) !important;
    box-shadow: inset 0 0 10px rgba(116, 185, 255, 0.4) !important;
}

.tactical-square.obstacle-forest:not(.floor-planks):not(.floor-cobble):not(.floor-earth) {
    background-color: rgba(20, 40, 25, 0.25) !important;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.5) !important;
}

.tactical-square.obstacle-bushes:not(.floor-planks):not(.floor-cobble):not(.floor-earth) {
    background-color: rgba(39, 174, 96, 0.15) !important;
    box-shadow: inset 0 0 8px rgba(46, 204, 113, 0.2) !important;
}

/* Анимации перемещения отряда на карте */
.squad-impact-ripple {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 4px solid #ebd291;
    background: rgba(46, 204, 113, 0.2);
    border-radius: 50%;
    box-shadow: 0 0 20px #2ecc71, inset 0 0 15px #2ecc71;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    animation: squadRippleAnim 0.8s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes squadRippleAnim {
    0%   { width: 20px; height: 20px; opacity: 1; border-width: 4px; }
    100% { width: 260px; height: 260px; opacity: 0; border-width: 1px; }
}

.squad-impact-cloud {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(235, 240, 255, 0.7) 0%, rgba(100, 110, 120, 0.4) 50%, rgba(0, 0, 0, 0) 70%);
    filter: blur(8px);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    pointer-events: none;
    z-index: 9999;
    animation: squadCloudAnim 1.2s ease-out forwards;
}

@keyframes squadCloudAnim {
    0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    30%  { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2.2); filter: blur(20px); opacity: 0; }
}

.squad-screen-shake {
    animation: squadShakeAnim 0.35s cubic-bezier(.36, .07, .19, .97) both !important;
    transform: translate3d(0, 0, 0) !important;
}

@keyframes squadShakeAnim {
    10%, 90%     { transform: translate3d(0, -3px, 0); }
    20%, 80%     { transform: translate3d(0, 4px, 0); }
    30%, 50%, 70%{ transform: translate3d(0, -5px, 0); }
    40%, 60%     { transform: translate3d(0, 3px, 0); }
}

.squad-rune-particle {
    position: absolute;
    color: #ffffff !important;
    font-family: 'Times New Roman', serif;
    font-size: 36px;
    font-weight: 900;
    mix-blend-mode: screen !important;
    text-shadow: 0 0 6px #ffffff, 0 0 12px #ffffff, 0 0 20px #ffd875, 0 0 35px #ffd875, 0 0 55px #d4af37, 0 0 80px #e67e22, 0 0 110px #ff3300 !important;
    filter: contrast(1.4) saturate(1.5) drop-shadow(0 0 15px rgba(255, 216, 117, 0.9)) !important;
    pointer-events: none;
    opacity: 0;
    transform: translate(var(--start-x), var(--start-y)) rotate(var(--rotate-deg)) scale(0.6);
    animation: squadRuneWaveAnim 1.45s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
}

@keyframes squadRuneWaveAnim {
    0%   { opacity: 0; transform: translate(var(--start-x), var(--start-y)) rotate(var(--rotate-deg)) scale(0.6); }
    15%  { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--target-x), var(--target-y)) rotate(var(--rotate-deg)) scale(1.4); }
}

/* ============================================================================
   14. ПЛАНШЕТ ПРИВАЛА (ЧАСТЬ 1: ДВУХКОЛОНОЧНЫЙ МАКЕТ И ТАБЛИЦА ДЕЙСТВИЙ)
   ============================================================================ */
.camping-tablet-content {
    display: none;
    gap: 50px;
    padding: 25px 30px 35px 30px !important;
    height: calc(100% - 60px) !important;
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
}

.camping-left-col {
    flex: 0.9;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 480px;
}

.camping-right-col {
    flex: 1.1;
    display: flex;
    flex-direction: column;
    border-left: 3px dashed rgba(138, 100, 33, 0.3);
    padding-left: 50px;
    gap: 20px;
}

.camping-section-title {
    font-size: 32px;
    font-weight: bold;
    color: #ffd875;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.4);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.camp-current-hex-banner {
    background: rgba(138, 100, 33, 0.12);
    border: 2px dashed #dfbc6f;
    padding: 14px 20px;
    border-radius: 6px;
    color: #ffd875;
    font-size: 24px;
    font-weight: bold;
}

.camping-region-bar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: rgba(0, 0, 0, 0.5);
    padding: 16px 20px;
    border: 2px solid #543e0d;
    border-radius: 6px;
}

.camp-param-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.camp-param-label {
    color: #ebd291;
    font-size: 24px;
    font-weight: bold;
}

.camp-count-controls {
    display: flex;
    align-items: center;
    gap: 18px;
    background: #040905;
    border: 2px solid #543e0d;
    padding: 6px 16px;
    border-radius: 4px;
}

.camp-count-controls button {
    background: transparent;
    border: none;
    color: #dfbc6f;
    cursor: pointer;
    font-weight: 900;
    font-size: 28px;
    padding: 0 6px;
}

.camp-count-controls button:hover {
    color: #fff;
}

#campBaseChecksVal,
#campCheckModVal {
    font-weight: bold;
    color: #fff;
    min-width: 30px;
    text-align: center;
    font-family: monospace;
    font-size: 26px;
}

/* Таблица действий привала */
.camp-gm-inputs-grid {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(84, 62, 13, 0.5);
    border-radius: 6px;
    padding: 10px 20px;
}

.camp-invisible-table {
    width: 100%;
    border-collapse: collapse;
}

.camp-invisible-table th {
    padding: 12px 4px 15px 4px !important;
    font-size: 22px !important;
    text-transform: uppercase;
    font-weight: 900 !important;
    letter-spacing: 1px !important;
}

.camp-invisible-table th.col-act-name {
    text-align: left;
    color: #dfbc6f;
}

.camp-invisible-table th.col-radio,
.camp-invisible-table td:not(.camp-act-cell) {
    text-align: center !important;
    width: 65px !important;
    padding: 14px 4px !important;
    vertical-align: middle !important;
}

.camp-invisible-table th.crit-suc  { color: #2ecc71; }
.camp-invisible-table th.suc       { color: #ebd291; }
.camp-invisible-table th.fail      { color: #ff7675; }
.camp-invisible-table th.crit-fail { color: #e74c3c; }

.camp-invisible-table tr {
    border-bottom: 16px solid transparent !important;
}

.camp-invisible-table tr:last-child {
    border-bottom: none !important;
}

.camp-invisible-table td.camp-act-cell {
    display: block !important;
    width: calc(100% - 16px) !important; /* Отступ справа, чтобы не упираться в радиокнопки */
    background: #020503 !important;
    border: 2px solid #b89445 !important;
    border-radius: 6px !important;
    padding: 12px 16px !important;
    text-align: left !important;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.95), 0 4px 10px rgba(0, 0, 0, 0.5) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.camp-invisible-table tr:hover td.camp-act-cell {
    border-color: #ffd875 !important;
    box-shadow: inset 0 0 15px rgba(255, 216, 117, 0.12), 0 4px 15px rgba(0, 0, 0, 0.7) !important;
}

.camp-invisible-table .act-name {
    display: block !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 10px !important;
    color: #ffd875 !important; /* Золотой цвет названия действия */
    font-size: 28px !important; /* Укрупненный шрифт */
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    text-shadow: 0 0 10px rgba(255, 216, 117, 0.45), 0 2px 4px #000 !important;
}

/* Вложенная внутрь блока рамка-плашка для навыка и СЛ */
.camp-invisible-table td.camp-act-cell > span:not(.act-name),
.camp-invisible-table td.camp-act-cell > div:not(.act-name),
.camp-invisible-table .skill-name-large,
[id^="label_dc_"] {
    display: inline-block !important;
    background: #09140d !important;
    border: 1.5px solid #8a6421 !important;
    border-radius: 5px !important;
    padding: 5px 14px !important;
    margin-top: 2px !important;
    font-size: 22px !important; /* Укрупненный шрифт навыка и СЛ */
    font-weight: 800 !important;
    color: #ebd291 !important;
    letter-spacing: 0.5px !important;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.9) !important;
    text-shadow: 0 0 6px rgba(255, 216, 117, 0.35) !important;
}

/* Защита от двойной рамки, если внутри .skill-name-large вложен еще один тег */
.camp-invisible-table .skill-name-large > * {
    display: inline !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.camp-invisible-table td.camp-act-cell br,
.camp-invisible-table td.camp-act-cell .skill-name-large + .skill-name-large {
    display: none !important;
}

.camp-invisible-table .skill-name-large {
    display: block !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

[id^="label_dc_"] {
    display: inline-block !important;
    background: #09140d !important;
    border: 1.5px solid #8a6421 !important;
    border-radius: 4px !important;
    padding: 4px 12px !important;
    margin-top: 2px !important;
    font-size: 19px !important;
    font-weight: 800 !important;
    color: #ffd875 !important;
    letter-spacing: 0.5px !important;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.9) !important;
    text-shadow: 0 0 6px rgba(255, 216, 117, 0.35) !important;
}
.camp-invisible-table td.camp-act-cell br,
.camp-invisible-table td.camp-act-cell .skill-name-large + .skill-name-large {
    display: none !important;
}

/* Укрупненные радиокнопки с золотой лилией для ТВ (38px) */
.camp-invisible-table input[type="radio"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: #020503 !important;
    border: 2.5px solid #543e0d !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    margin: 0 auto !important;
    display: block !important;
    position: relative !important;
    cursor: pointer !important;
    outline: none !important;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.9) !important;
}

.camp-invisible-table input[type="radio"]:hover {
    border-color: #b89445 !important;
    box-shadow: 0 0 12px rgba(184, 148, 69, 0.6) !important;
    transform: scale(1.06);
}

.camp-invisible-table input[type="radio"]:checked {
    border-color: #ffd875 !important;
    box-shadow: 0 0 16px #ffd875, inset 0 0 6px rgba(255, 216, 117, 0.4) !important;
    background: #112417 !important;
}

.camp-invisible-table input[type="radio"]:checked::before {
    content: "⚜" !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 22px !important;
    color: #ffd875 !important;
    font-weight: 900 !important;
    text-shadow: 0 0 5px #dfbc6f !important;
}

/* ============================================================================
   ПАНЕЛЬ СОЮЗНИКОВ НА ПРИВАЛЕ И ПЕРЕТАСКИВАНИЕ НА ДЕЙСТВИЯ
   ============================================================================ */

/* Делаем ячейку действия точкой отсчета для мини-аватарки справа */
.camp-invisible-table td.camp-act-cell {
    position: relative !important;
    padding-right: 110px !important; /* Резерв справа под портрет назначенного героя */
}

/* Подсветка блока действия при наведении перетаскиваемой аватарки */
.camp-invisible-table td.camp-act-cell.camp-drop-hover {
    border-color: #2ecc71 !important;
    background: #0b2414 !important;
    box-shadow: inset 0 0 18px rgba(46, 204, 113, 0.35), 0 0 15px rgba(46, 204, 113, 0.5) !important;
}

/* Мини-аватарка назначенного союзника внутри блока действия (справа) */
.camp-assigned-ally-badge {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    z-index: 5;
    transition: transform 0.15s ease;
}

.camp-assigned-ally-badge:hover {
    transform: translateY(-50%) scale(1.06);
}

.camp-assigned-ally-img {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    border: 2px solid #2ecc71;
    background: #09140d;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffd875;
    font-weight: 900;
    font-size: 20px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.85);
}

.camp-assigned-ally-name {
    font-size: 12px;
    font-weight: 900;
    color: #ffd875;
    max-width: 82px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px #000;
    text-transform: uppercase;
}

/* Нижний док с 6 союзниками в левой колонке */
.camp-allies-dock {
    margin-top: auto;
    background: rgba(0, 0, 0, 0.45);
    border: 2px solid #543e0d;
    border-radius: 6px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.camp-allies-dock-title {
    font-size: 16px;
    font-weight: 900;
    color: #dfbc6f;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px dashed rgba(138, 100, 33, 0.4);
    padding-bottom: 6px;
}

.camp-allies-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.camp-ally-slot {
    aspect-ratio: 1 / 1;
    background: #020503;
    border: 2px solid #2ecc71;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.camp-ally-slot:hover {
    transform: translateY(-3px) scale(1.05);
    border-color: #ffd875;
    box-shadow: 0 6px 16px rgba(255, 216, 117, 0.4);
}

.camp-ally-slot:active {
    cursor: grabbing;
}

.camp-ally-slot.empty-slot {
    border: 1.5px dashed rgba(84, 62, 13, 0.45);
    background: rgba(2, 5, 3, 0.5);
    cursor: default;
    box-shadow: none;
}

.camp-ally-slot.empty-slot:hover {
    transform: none;
    border-color: rgba(84, 62, 13, 0.45);
    box-shadow: none;
}

.camp-ally-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.camp-ally-slot-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    color: #2ecc71;
    background: linear-gradient(180deg, #1b4d2b 0%, #0d2b16 100%);
    pointer-events: none;
}

.camp-ally-slot-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.82);
    color: #ffd875;
    font-size: 11px;
    font-weight: 900;
    text-align: center;
    padding: 2px 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}


/* ============================================================================
   14. ПЛАНШЕТ ПРИВАЛА (ЧАСТЬ 2: ИТОГИ, 3D-КУБИК D20 И МОДАЛЬНОЕ ОКНО)
   ============================================================================ */
.camp-calculated-counters { display: flex; flex-direction: column; gap: 18px; }
.calc-counter-item {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(0, 0, 0, 0.4); padding: 16px 24px;
    border: 2px solid #543e0d; border-radius: 6px;
}
.calc-counter-item.status-danger { background: rgba(92, 30, 30, 0.2); border-color: #823030; }
.calc-label-large { color: #ebd291; font-size: 24px; font-weight: bold; }

.calc-value-massive {
    font-family: monospace; font-size: 48px; font-weight: 900; color: #ffd875;
    background: #020503; border: 3px solid #dfbc6f; padding: 4px 22px;
    border-radius: 6px; min-width: 75px; text-align: center;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9);
    text-shadow: 0 0 12px rgba(255, 216, 117, 0.5);
}
.calc-counter-item.status-danger .calc-value-massive { color: #ff7675; border-color: #e74c3c; text-shadow: 0 0 12px rgba(255, 118, 117, 0.5); }
.calc-value-massive.checks { color: #2ecc71; border-color: #2ecc71; text-shadow: 0 0 12px rgba(46, 204, 113, 0.5); }

.camping-resources-panel-large {
    background: rgba(0, 0, 0, 0.5); border: 2px solid #543e0d; padding: 20px 24px;
    border-radius: 6px; display: flex; flex-direction: column; gap: 12px;
}
.c-res-label-large { color: #dfbc6f; font-size: 24px; font-weight: bold; }
.resource-yield-massive { color: #2ecc71 !important; font-size: 36px; font-family: monospace; font-weight: bold; }

.camp-effects-log-large {
    flex-grow: 1; background: #020402; border: 2px solid #543e0d; border-radius: 6px;
    padding: 20px; display: flex; flex-direction: column; gap: 12px;
    min-height: 140px; max-height: 180px; overflow-y: auto;
}
.camp-log-title-large { color: #ffd875; font-weight: bold; font-size: 22px; text-transform: uppercase; border-bottom: 2px dashed rgba(138, 100, 33, 0.4); padding-bottom: 8px; }
.camp-effects-list-large { display: flex; flex-direction: column; gap: 8px; font-size: 22px; }

.camp-effect-line { padding-left: 24px; position: relative; color: #ebd291; line-height: 1.4; }
.camp-effect-line::before { content: '⚜'; position: absolute; left: 0; color: #b89445; font-size: 18px; top: 2px; }

#campingTabletContainer .kingdom-save-wrapper .btn {
    flex: 1 1 0% !important; width: 100% !important; padding: 12px 16px !important;
    font-size: 14px !important; font-weight: bold !important; font-family: sans-serif !important;
    text-transform: uppercase !important; letter-spacing: 0.5px !important; border-radius: 3px !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4) !important; cursor: pointer;
}

.button-flash-overlay {
    position: absolute; pointer-events: none; z-index: 99999; border-radius: 3px;
    background: linear-gradient(180deg, #ffffff 0%, #ffd875 50%, #b89445 100%);
    box-shadow: 0 0 25px #ffd875, inset 0 0 10px #fff;
    opacity: 1; will-change: opacity; transition: opacity 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Неоновая подсветка маркеров исходов */
.outcome-crit-success { color: #2ecc71 !important; font-weight: 900 !important; text-transform: uppercase !important; text-shadow: 0 0 10px rgba(46, 204, 113, 0.8), 0 0 20px rgba(46, 204, 113, 0.4) !important; }
.outcome-success      { color: #ffd875 !important; font-weight: 900 !important; text-transform: uppercase !important; text-shadow: 0 0 10px rgba(255, 216, 117, 0.8), 0 0 20px rgba(223, 188, 111, 0.4) !important; }
.outcome-failure      { color: #ff7675 !important; font-weight: 900 !important; text-transform: uppercase !important; text-shadow: 0 0 10px rgba(255, 118, 117, 0.8), 0 0 20px rgba(231, 76, 60, 0.4) !important; }
.outcome-crit-failure { color: #e74c3c !important; font-weight: 900 !important; text-transform: uppercase !important; text-shadow: 0 0 12px rgba(231, 76, 60, 0.95), 0 0 25px rgba(231, 76, 60, 0.5) !important; }

/* Оверлей 3D-анимации кубика D20 */
#campDiceOverlay,
.camp-dice-overlay {
    position: fixed !important; inset: 0 !important; width: 100vw !important; height: 100vh !important;
    background: rgba(0, 0, 0, 0.85) !important; z-index: 9999999 !important;
    display: none; align-items: center !important; justify-content: center !important;
    backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
}
#campDiceOverlay.open, .camp-dice-overlay.open { display: flex !important; }

.dodecahedron-scene {
    width: 400px; height: 400px; display: flex; align-items: center; justify-content: center;
    position: relative; will-change: filter;
    animation: goldAuraBreathe 1.5s ease-in-out infinite alternate;
}

@keyframes goldAuraBreathe {
    0%   { filter: drop-shadow(0 0 12px rgba(255, 216, 117, 0.8)) drop-shadow(0 0 25px rgba(223, 162, 0, 0.6)) drop-shadow(0 0 50px rgba(223, 111, 0, 0.35)); }
    100% { filter: drop-shadow(0 0 22px rgba(255, 235, 170, 0.95)) drop-shadow(0 0 45px rgba(255, 184, 0, 0.85)) drop-shadow(0 0 90px rgba(223, 111, 0, 0.55)); }
}

#d20Canvas { display: block; margin: 0 auto; background: transparent; max-width: 400px; max-height: 400px; }

/* Модальное окно итогов привала */
#campResultModal,
.camp-result-modal {
    position: fixed !important; top: 50% !important; left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: linear-gradient(135deg, #0f2215 0%, #050b07 100%) !important;
    border: 5px solid #dfbc6f !important; border-radius: 12px !important;
    padding: 30px 50px 35px 50px !important; width: 1150px !important; max-width: 95vw !important;
    max-height: 96vh !important; box-shadow: 0 35px 90px rgba(0, 0, 0, 0.95), 0 0 70px rgba(223, 188, 111, 0.65) !important;
    z-index: 10000000 !important; display: none; flex-direction: column !important; align-items: center !important; gap: 20px !important;
    font-family: "Tinos", serif;
}
#campResultModal.open, .camp-result-modal.open { display: flex !important; }

#campResultModal h2,
.camp-res-modal-title {
    width: 100% !important; font-size: 28px !important; color: #ffd875 !important;
    text-transform: uppercase !important; text-align: center !important;
    border-bottom: 2px solid #543e0d !important; padding-bottom: 10px !important; margin: 0 0 5px 0 !important;
    letter-spacing: 2px !important; text-shadow: 0 0 8px #ffd875, 0 2px 4px rgba(0, 0, 0, 0.95) !important;
}

#campResultModalBody,
.camp-res-modal-body { width: 100% !important; display: block !important; overflow-y: auto; max-height: 65vh; }

#campResultModalBody > div:first-child {
    display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 16px 40px !important;
    margin-bottom: 20px !important; padding: 16px 30px !important; font-size: 32px !important;
    font-weight: 900 !important; text-transform: uppercase !important; color: #ffd875 !important;
    background: rgba(0, 0, 0, 0.5) !important; border: 2px solid #543e0d !important; border-radius: 6px !important;
}

#campResultModalBody > div:first-child span,
#campResultModalBody .camp-effect-line span,
.camp-result-text-container .camp-effect-line span {
    display: inline-block !important; vertical-align: middle !important; color: #2ecc71 !important;
    background: #020503 !important; border: 1px solid #dfbc6f !important; padding: 2px 12px !important;
    border-radius: 4px !important; margin: 0 6px !important; font-family: monospace !important;
    font-weight: 900 !important; box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.85) !important;
    text-shadow: 0 0 10px rgba(46, 204, 113, 0.6) !important; white-space: nowrap !important;
}

#campResultModalBody > div:first-child span.negative,
#campResultModalBody .camp-effect-line span.negative,
#campResultModalBody .camp-effect-line.bad span,
.camp-result-text-container .camp-effect-line.bad span {
    color: #e74c3c !important; text-shadow: 0 0 10px rgba(231, 76, 60, 0.85) !important;
}

#campResultModalBody .camp-effect-line,
.camp-result-text-container .camp-effect-line {
    display: block !important; width: 100% !important; font-size: 24px !important; line-height: 1.6 !important;
    text-align: left !important; padding-left: 45px !important; margin-top: 20px !important;
    font-weight: bold !important; color: #ebd291 !important; white-space: normal !important;
}

.camp-res-modal-footer { margin-top: 15px !important; display: flex !important; justify-content: center !important; width: 100% !important; }
.camp-res-modal-footer .btn {
    padding: 16px 70px !important; font-size: 24px !important; min-width: 260px !important;
    background: linear-gradient(180deg, #1e3c27 0%, #112417 100%) !important; color: #dfbc6f !important;
    border: 2px solid #dfbc6f !important; border-radius: 6px !important; font-weight: 900 !important;
    text-transform: uppercase !important; letter-spacing: 1px !important; cursor: pointer !important;
}
.camp-res-modal-footer .btn:hover { filter: brightness(1.2) !important; box-shadow: 0 0 20px rgba(223, 188, 111, 0.5) !important; }

/* ============================================================================
   15. ВКЛАДКА НАСТРОЕК: ВЫПАДАЮЩИЕ СПИСКИ, РАДИО-ЛИЛИИ И ПАЛИТРА ОТРЯДА
   ============================================================================ */
#settingsTabletContainer .custom-select {
    width: 100%;
    position: relative;
    font-family: 'Montserrat', sans-serif;
}

#settingsTabletContainer .custom-select-trigger {
    background: #090f0b;
    border: 1px solid #543e0d;
    color: #ebd291;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

#settingsTabletContainer .custom-select.active .custom-select-trigger {
    border-color: #ffd875;
    box-shadow: 0 0 10px rgba(255, 216, 117, 0.4);
}

#settingsTabletContainer .custom-options-container {
    background: #090f0b;
    border: 2px solid #b89445;
    border-radius: 4px;
    margin-top: 2px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.9);
}

#settingsTabletContainer .custom-option {
    padding: 10px 14px;
    color: #ebd291;
    font-size: 14px;
    transition: all 0.15s ease;
}

#settingsTabletContainer .custom-option:hover,
#settingsTabletContainer .custom-option.selected {
    background-color: #1e3c27;
    color: #ffd875;
}

/* Геральдические строки радиокнопок */
#settingsTabletContainer .radio-row {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    margin-bottom: 10px !important;
    padding: 8px 14px !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(84, 62, 13, 0.4) !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

#settingsTabletContainer .radio-row:hover {
    background: rgba(21, 46, 29, 0.25) !important;
    border-color: #b89445 !important;
}

#settingsTabletContainer .radio-row input[type="radio"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: #020503 !important;
    border: 2px solid #543e0d !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    margin: 0 !important;
    position: relative !important;
    cursor: pointer !important;
    outline: none !important;
    flex-shrink: 0 !important;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.9) !important;
}

#settingsTabletContainer .radio-row input[type="radio"]:hover {
    border-color: #b89445 !important;
    box-shadow: 0 0 8px rgba(184, 148, 69, 0.5) !important;
}

#settingsTabletContainer .radio-row input[type="radio"]:checked {
    border-color: #ffd875 !important;
    box-shadow: 0 0 12px #ffd875, inset 0 0 4px rgba(255, 216, 117, 0.3) !important;
}

#settingsTabletContainer .radio-row input[type="radio"]:checked::before {
    content: "⚜" !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 14px !important;
    color: #ffd875 !important;
    font-weight: 900 !important;
    text-shadow: 0 0 4px #dfbc6f !important;
}

#settingsTabletContainer .radio-row label,
#settingsTabletContainer .radio-row span {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 16px !important;
    font-weight: bold !important;
    color: #ebd291 !important;
    cursor: pointer !important;
    user-select: none !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block !important;
}

#settingsTabletContainer .radio-row input[type="radio"]:checked + label,
#settingsTabletContainer .radio-row input[type="radio"]:checked + span {
    color: #fff !important;
    text-shadow: 0 0 8px rgba(255, 216, 117, 0.5) !important;
}

/* Разделитель системных блоков */
.kingmaker-hr {
    position: relative !important;
    width: 100% !important;
    height: 1px !important;
    background: linear-gradient(90deg, transparent 0%, rgba(184, 148, 69, 0.4) 20%, #b89445 50%, rgba(184, 148, 69, 0.4) 80%, transparent 100%) !important;
    margin: 30px 0 !important;
    border: none !important;
    overflow: visible !important;
}

.kingmaker-hr::before {
    content: "⚜" !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: #0d1e13 !important;
    padding: 0 14px !important;
    color: #ffd875 !important;
    font-size: 22px !important;
    font-weight: 900 !important;
    text-shadow: 0 0 4px #dfbc6f, 0 0 10px rgba(255, 216, 117, 0.5), 0 2px 4px rgba(0, 0, 0, 0.9) !important;
}

/* Ряд кнопок цвета маркера отряда */
.squad-color-presets-row {
    display: flex !important;
    gap: 0 !important;
    width: 100% !important;
    justify-content: space-between !important;
    background: #090f0b !important;
    padding: 10px 12px !important;
    border: 1px solid #543e0d !important;
    border-radius: 4px !important;
    box-sizing: border-box !important;
    flex-wrap: nowrap !important;
    overflow: visible !important;
}

.squad-color-presets-row .squad-color-btn {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    border: 1.5px solid #ffffff !important;
    cursor: pointer !important;
    transition: all 0.15s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
    flex-shrink: 0 !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 1px !important;
}

.squad-color-presets-row .squad-color-btn:hover {
    transform: scale(1.4) !important;
    border-color: #ffd875 !important;
    z-index: 10 !important;
}

.squad-color-presets-row .squad-color-btn.active {
    transform: scale(1.5) !important;
    border-color: #ffd875 !important;
    box-shadow: 0 0 14px #ffd875, 0 4px 8px rgba(0, 0, 0, 0.7), inset 0 0 3px rgba(255, 255, 255, 0.7) !important;
    z-index: 11 !important;
}

/* ============================================================================
   16. ТРЕКЕР ИНИЦИАТИВЫ (ЧАСТЬ 1: ПАНЕЛЬ БОЯ И ВЕРТИКАЛЬНЫЙ СПИСОК)
   ============================================================================ */
.init-header-zone {
    padding-top: 0 !important;
}

.init-master-battle-control-bar {
    display: flex !important;
    gap: 16px !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: rgba(0, 0, 0, 0.5) !important;
    padding: 10px !important;
    border: 2px solid #543e0d !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8) !important;
    margin-top: 0 !important;
    margin-bottom: 8px !important;
}

.init-round-counter-badge {
    position: relative !important;
    gap: 10px !important;
    background: linear-gradient(180deg, #1e3c27 0%, #0d1a10 100%) !important;
    border: 2px solid #2ecc71 !important;
    color: #fff !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    letter-spacing: 1.5px !important;
    padding: 0 24px !important;
    height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px !important;
    text-shadow: 0 0 8px rgba(46, 204, 113, 0.6) !important;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.2) !important;
    white-space: nowrap !important;
}

#initRoundCounterNum {
    color: #ffd875 !important;
    font-size: 24px !important;
    margin-left: 6px !important;
    text-shadow: 0 0 8px #dfbc6f !important;
}

.init-btn-reset-round-inline {
    background: transparent !important;
    border: none !important;
    color: #ebd291 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    padding: 2px 4px !important;
    transition: all 0.2s ease !important;
}

.init-btn-reset-round-inline:hover {
    color: #ff7675 !important;
    transform: rotate(-180deg) scale(1.2) !important;
}

.init-btn-view-toggle {
    background: linear-gradient(180deg, #42351f 0%, #292011 100%) !important;
    border: 1px solid #543e0d !important;
    color: #ebd291 !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 14px !important;
    font-weight: bold !important;
    padding: 0 16px !important;
    height: 50px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.init-btn-view-toggle:hover {
    border-color: #dfbc6f !important;
    color: #fff !important;
    background: linear-gradient(180deg, #b89445 0%, #6e4e14 100%) !important;
}

.init-quick-input-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 12px 16px;
    border: 1px solid rgba(138, 100, 33, 0.4);
    border-radius: 6px;
    margin-bottom: 12px !important;
    width: 100%;
}

#initInputName {
    flex-grow: 1;
    background: #040905;
    border: 1px solid #543e0d;
    color: #ebd291;
    padding: 8px 12px;
    font-size: 16px;
    border-radius: 4px;
    outline: none;
}

.init-nat20-checkbox-label {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    user-select: none !important;
    background: #020503 !important;
    border: 1px solid #543e0d !important;
    padding: 6px 10px !important;
    border-radius: 4px !important;
    height: 38px !important;
}

.init-nat20-checkbox-label input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    border: 2px solid #543e0d !important;
    background: #000 !important;
    border-radius: 3px !important;
    position: relative !important;
    cursor: pointer !important;
}

.init-nat20-checkbox-label input[type="checkbox"]:checked {
    border-color: #ffd875 !important;
    background: #1e3c27 !important;
}

.init-nat20-checkbox-label input[type="checkbox"]:checked::before {
    content: "✓" !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    color: #ffd875 !important;
    font-size: 13px !important;
    font-weight: 900 !important;
}

.init-nat20-checkbox-label span {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 14px !important;
    font-weight: bold !important;
    color: #ebd291 !important;
}

/* Вертикальный контейнер списка */
.init-cards-scroll-list {
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    overflow-x: visible !important;
    max-height: calc(100vh - 180px) !important;
    padding: 15px 45px 45px 45px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Карточки участников и эффект раздвижения при ходе */
.init-cards-scroll-list .init-combatant-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    border-radius: 6px;
    box-sizing: border-box !important;
    position: relative !important;
    margin: 2px 0 !important;
    height: auto !important;
    cursor: grab !important;
    user-select: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    margin 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s ease !important;
    z-index: 1;
}

.init-combatant-card:active { cursor: grabbing !important; }
.init-combatant-card.init-card-dragging { opacity: 0.4 !important; border-style: dashed !important; }

/* Цвета фракций в вертикальном списке */
.init-combatant-card.faction-friend {
    border: 3px solid #2ecc71 !important;
    background: #11381e !important;
    box-shadow: inset 0 0 15px rgba(46, 204, 113, 0.4) !important;
}

.init-combatant-card.faction-enemy {
    border: 3px solid #e74c3c !important;
    background: #3c1616 !important;
    box-shadow: inset 0 0 15px rgba(231, 76, 60, 0.4) !important;
}

/* Утвержденный плотный золотой градиент нейтралов без черноты */
.init-cards-scroll-list .init-combatant-card[data-faction="neutral"],
.init-cards-scroll-list .init-combatant-card.faction-neutral {
    background: linear-gradient(90deg, #d4af37 0%, #855e13 100%) !important;
    border: 2px solid #ffd875 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.2) !important;
}

.init-cards-scroll-list .init-combatant-card.faction-neutral .init-card-name-text {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9) !important;
}

.init-cards-scroll-list .init-combatant-card.faction-neutral select {
    background: rgba(0, 0, 0, 0.4) !important;
    color: #ffffff !important;
    border: 1px solid #ffd875 !important;
}

/* ============================================================================
   16. ТРЕКЕР ИНИЦИАТИВЫ (ЧАСТЬ 2: АКТИВНЫЙ ХОД, ГОРИЗОНТ BG3 И БОЕВАЯ ЦИТАТА)
   ============================================================================ */

/* Эффект расталкивания соседей в вертикальном списке при активном ходе */
.init-cards-scroll-list .init-combatant-card.selected-turn-gold {
    z-index: 10 !important;
    transform: scale(1.02) !important;
    margin-top: 10px !important;
    margin-bottom: 10px !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 20px 4px rgba(255, 216, 117, 0.95), 0 0 35px 8px rgba(223, 188, 111, 0.6) !important;
}

.init-cards-scroll-list .init-combatant-card.selected-turn-gold + .init-combatant-card {
    transform: translateY(4px) !important;
}

/* Внутренние элементы карточки в вертикальном режиме */
.init-card-left { display: flex; align-items: center; gap: 16px; }
.init-card-right { display: flex; align-items: center; gap: 14px; }

.init-turn-pointer-arrow { color: #ffd875; font-size: 20px; opacity: 0; transition: opacity 0.2s; }
.init-turn-pointer-arrow.visible { opacity: 1; }

.init-avatar-shield-circle {
    width: 44px; height: 44px; border-radius: 50%; border: 2px solid #543e0d;
    background: #020503; display: flex; align-items: center; justify-content: center;
    color: #b89445; font-size: 16px; font-weight: 900; font-family: monospace;
    overflow: hidden; flex-shrink: 0;
}
.init-avatar-shield-circle.active { border-color: #dfbc6f; box-shadow: 0 0 8px rgba(255, 216, 117, 0.4); }
.init-avatar-shield-circle img { width: 100%; height: 100%; object-fit: cover; display: block; }

.init-card-name-text { font-size: 26px; font-weight: bold; color: #fff; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8); }
.init-crown-badge { display: inline-block; margin-left: 8px; font-size: 24px; filter: drop-shadow(0 0 6px #ffd875); animation: initCrownFloat 2s ease-in-out infinite alternate; }
.init-nat1-skull-badge { display: inline-block; margin-left: 8px; font-size: 24px; filter: drop-shadow(0 0 6px #e74c3c); animation: initSkullShake 1s infinite alternate; }

@keyframes initCrownFloat { 0% { transform: translateY(0) scale(1); } 100% { transform: translateY(-3px) scale(1.08); } }
@keyframes initSkullShake { 0% { transform: rotate(-5deg); } 100% { transform: rotate(5deg); } }

.init-btn-toggle-d20-inline {
    background: #020503; border: 1px solid #543e0d; color: #7f8c8d; font-size: 18px;
    width: 34px; height: 34px; cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center;
}
.init-btn-toggle-d20-inline.active { border-color: #ffd875; color: #ffd875; background: #1e3c27; box-shadow: 0 0 10px rgba(255, 216, 117, 0.3); }

.init-inline-faction-select {
    background: #040905; border: 1px solid #543e0d; color: #ebd291;
    padding: 6px 10px; font-size: 16px; border-radius: 4px; cursor: pointer;
}

.init-inline-score-input {
    width: 80px; height: 44px; font-size: 26px !important; font-weight: 900; color: #ffd875;
    background: #020503; border: 2px solid #dfbc6f; border-radius: 6px; text-align: center;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.9); outline: none; cursor: ns-resize;
    -moz-appearance: textfield;
}
.init-inline-score-input::-webkit-outer-spin-button,
.init-inline-score-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.init-btn-delete-card {
    background: linear-gradient(180deg, #5c1e1e 0%, #3a1111 100%); color: #f7baba;
    border: 1px solid #823030; font-size: 22px; width: 34px; height: 34px;
    cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center;
}
.init-btn-delete-card:hover { border-color: #ff7675; color: #fff; }


/* ============================================================================
   17. ГОРИЗОНТАЛЬНЫЙ РЕЖИМ (MODE-BG3): ИМЯ СВЕРХУ + ПОРТРЕТ + СТАТУС СНИЗУ
   ============================================================================ */
#questLogContainer .init-cards-scroll-list.mode-bg3 {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    height: auto !important;
    min-height: 235px !important;
    max-height: none !important;
    padding: 16px 30px !important;
    gap: 24px !important;
}

/* Единая карточка без зазоров между секциями */
#questLogContainer .mode-bg3 .init-combatant-card {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    flex-shrink: 0 !important;
    width: 115px !important;
    min-width: 115px !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 6px !important;
    border-width: 2px !important;
    overflow: hidden !important;
    gap: 0 !important;
}

/* Фоны карточек по фракциям */
#questLogContainer .mode-bg3 .init-combatant-card.faction-friend  { background: linear-gradient(180deg, #1b4d2b 0%, #0d2b16 100%) !important; border-color: #2ecc71 !important; }
#questLogContainer .mode-bg3 .init-combatant-card.faction-enemy   { background: linear-gradient(180deg, #591818 0%, #2e0a0a 100%) !important; border-color: #e74c3c !important; }
#questLogContainer .mode-bg3 .init-combatant-card.faction-neutral { background: linear-gradient(180deg, #b89428 0%, #6e520c 100%) !important; border-color: #f1c40f !important; }

/* Активный ход (увеличенный блок x1.35) */
#questLogContainer .mode-bg3 .init-combatant-card.selected-turn-gold {
    width: 156px !important;
    min-width: 156px !important;
    height: auto !important;
    min-height: auto !important;
    transform: none !important;
    z-index: 999 !important;
    border-width: 3px !important;
}
#questLogContainer .mode-bg3 .init-combatant-card.faction-friend.selected-turn-gold  { border-color: #2ecc71 !important; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 0 25px rgba(46, 204, 113, 0.85) !important; }
#questLogContainer .mode-bg3 .init-combatant-card.faction-enemy.selected-turn-gold   { border-color: #e74c3c !important; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 0 25px rgba(231, 76, 60, 0.85) !important; }
#questLogContainer .mode-bg3 .init-combatant-card.faction-neutral.selected-turn-gold { border-color: #f1c40f !important; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 0 25px rgba(241, 196, 15, 0.85) !important; }

/* Обертка левой части: содержит плашку имени и квадрат портрета */
#questLogContainer .mode-bg3 .init-card-left {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
    pointer-events: none !important;
}

/* 1. ВЕРХНЯЯ ПОЛОСКА С ИМЕНЕМ (Строго выше портрета, без зазора) */
#questLogContainer .mode-bg3 .init-card-name-text {
    order: 1 !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    padding: 4px 5px !important;
    background: rgba(2, 5, 3, 0.94) !important;
    border-bottom: 1px solid rgba(223, 188, 111, 0.35) !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    line-height: 1.15 !important;
    text-align: center !important;
    color: #ffd875 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
    z-index: 4 !important;
    text-shadow: 0 1px 3px #000 !important;
}
#questLogContainer .mode-bg3 .init-combatant-card.selected-turn-gold .init-card-name-text {
    font-size: 20px !important;
    padding: 5px 6px !important;
}

/* 2. ЦЕНТРАЛЬНЫЙ КВАДРАТ ПОРТРЕТА */
#questLogContainer .mode-bg3 .init-avatar-shield-circle {
    order: 2 !important;
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 111px !important;
    border-radius: 0 !important;
    border: none !important;
    background: transparent !important;
    font-size: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1 !important;
}
#questLogContainer .mode-bg3 .init-combatant-card.selected-turn-gold .init-avatar-shield-circle {
    height: 152px !important;
}
#questLogContainer .mode-bg3 .init-avatar-shield-circle img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* 3. НИЖНЯЯ ПОЛОСКА СО СТАТУСОМ И ИНИЦИАТИВОЙ (Строго под портретом, без зазора) */
#questLogContainer .mode-bg3 .init-card-right {
    order: 3 !important;
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 32px !important;
    padding: 3px 4px !important;
    background: rgba(2, 5, 3, 0.94) !important;
    border-top: 1px solid rgba(223, 188, 111, 0.35) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    pointer-events: auto !important;
    z-index: 5 !important;
}

/* Выпадашка статуса в нижней полоске */
#questLogContainer .mode-bg3 .init-inline-status-select {
    display: inline-block !important;
    position: relative !important;
    width: 44px !important;
    height: 24px !important;
    padding: 0 0 0 4px !important;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif !important;
    font-size: 13px !important;
    text-align: left !important;
    text-align-last: left !important;
    background: rgba(2, 5, 3, 0.95) !important;
    border: 1px solid #dfbc6f !important;
    border-radius: 4px !important;
    color: #ffd875 !important;
    cursor: pointer !important;
}

/* Поле инициативы в нижней полоске */
#questLogContainer .mode-bg3 .init-score-massive-block {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
}
#questLogContainer .mode-bg3 .init-inline-score-input {
    width: 40px !important;
    height: 24px !important;
    padding: 0 !important;
    font-size: 18px !important;
    background: rgba(2, 5, 3, 0.95) !important;
    border: 1px solid #ffd875 !important;
    border-radius: 4px !important;
}

/* Подсветка натуральной 20 (зелёный) и натуральной 1 (красный) */
.init-inline-score-input.nat-20,
#questLogContainer .mode-bg3 .init-inline-score-input.nat-20 {
    color: #2ecc71 !important;
    border-color: #2ecc71 !important;
    box-shadow: inset 0 0 8px rgba(46, 204, 113, 0.35), 0 0 8px rgba(46, 204, 113, 0.5) !important;
    text-shadow: 0 0 8px rgba(46, 204, 113, 0.8) !important;
}
.init-inline-score-input.nat-1,
#questLogContainer .mode-bg3 .init-inline-score-input.nat-1 {
    color: #ff4757 !important;
    border-color: #ff4757 !important;
    box-shadow: inset 0 0 8px rgba(255, 71, 87, 0.35), 0 0 8px rgba(255, 71, 87, 0.5) !important;
    text-shadow: 0 0 8px rgba(255, 71, 87, 0.8) !important;
}

/* Кнопка удаления при наведении */
#questLogContainer .mode-bg3 .init-btn-delete-card {
    display: flex !important;
    position: absolute !important;
    top: 2px !important;
    right: 2px !important;
    width: 20px !important;
    height: 20px !important;
    font-size: 14px !important;
    line-height: 1 !important;
    background: rgba(92, 30, 30, 0.92) !important;
    border: 1px solid #ff7675 !important;
    color: #fff !important;
    border-radius: 4px !important;
    opacity: 0 !important;
    pointer-events: auto !important;
    transition: opacity 0.15s ease !important;
    z-index: 20 !important;
}
#questLogContainer .mode-bg3 .init-combatant-card:hover .init-btn-delete-card {
    opacity: 1 !important;
}

/* Скрываем лишние элементы в горизонте */
.init-cards-scroll-list.mode-bg3 .avatar-picker-wrapper,
.init-cards-scroll-list.mode-bg3 .init-select-wrapper,
.init-cards-scroll-list.mode-bg3 .init-turn-pointer-arrow,
.init-cards-scroll-list.mode-bg3 .init-btn-toggle-d20-inline {
    display: none !important;
}

/* Рамка эпической цитаты текущего хода */
.init-focus-quote-shield {
    display: none;
    margin: 25px auto 0 auto;
    width: calc(100% - 60px);
    background: linear-gradient(135deg, rgba(14, 22, 16, 0.96) 0%, rgba(5, 12, 7, 0.99) 100%);
    border: 4px solid transparent;
    border-image: linear-gradient(to right, #6e4e14, #ffd875, #6e4e14) 4 round;
    border-radius: 8px;
    padding: 35px 50px;
    min-height: 160px;
    text-align: center;
    box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.95), 0 12px 40px rgba(0, 0, 0, 0.7);
}
.init-cards-scroll-list.mode-bg3 + .init-focus-quote-shield { display: block !important; }
.init-focus-phrase-text { font-family: "Tinos", serif; font-size: 40px; font-style: italic; font-weight: bold; color: #ebd291; line-height: 1.5; text-shadow: 0 3px 6px rgba(0, 0, 0, 0.95); }
.init-focus-quote-shield span.gold-unit-focus-name { color: #ffd875 !important; font-family: 'Montserrat', sans-serif; font-style: normal !important; font-size: 44px; font-weight: 900; text-transform: uppercase; padding: 0 12px; text-shadow: 0 0 15px #ffd875, 0 0 30px rgba(212, 175, 55, 0.6), 0 3px 6px #000 !important; }

/* Нижний блок выбывших (в том же стиле, только серый) */
.init-out-combatants-zone {
    margin: 18px auto 0 auto;
    width: calc(100% - 60px);
    background: rgba(18, 22, 24, 0.85);
    border: 2px dashed #636e72;
    border-radius: 8px;
    padding: 12px 24px;
}
.init-out-zone-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 900;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}
#questLogContainer .init-out-zone-grid.mode-bg3 {
    height: auto !important;
    min-height: 135px !important;
    max-height: none !important;
    padding: 8px 4px !important;
    gap: 24px !important;
    flex-wrap: wrap !important;
    overflow: visible !important;
}
.init-combatant-card.status-out,
#questLogContainer .mode-bg3 .init-combatant-card.status-out {
    background: linear-gradient(180deg, #3a3f42 0%, #222629 100%) !important;
    border-color: #636e72 !important;
    box-shadow: none !important;
    opacity: 0.85 !important;
}
.init-combatant-card.status-out img { filter: grayscale(100%) contrast(0.9) !important; }
.init-combatant-card.status-out .init-card-name-text { color: #b2bec3 !important; }




/* ============================================================================
   УВЕЛИЧЕННАЯ ТВ-ВЕРСТКА ЛЕВОЙ КОЛОНКИ ПРИВАЛА (КРУПНЫЕ ШРИФТЫ, КНОПКИ И ПОРТРЕТЫ)
   ============================================================================ */

/* 1. Блок «Базовые проверки» и верхний баннер */
#campingTabletContainer .camping-left-col {
    gap: 12px !important;
    justify-content: space-between !important;
}

#campingTabletContainer .camp-current-hex-banner {
    padding: 12px 18px !important;
    font-size: 24px !important;
}

#campingTabletContainer .camping-region-bar {
    padding: 14px 18px !important;
    gap: 12px !important;
}

#campingTabletContainer .camp-param-label {
    font-size: 24px !important;
}

#campingTabletContainer #campEncounterTerrainLabel {
    font-size: 18px !important;
    margin-top: 2px !important;
}

#campingTabletContainer .camp-count-controls {
    padding: 6px 18px !important;
    gap: 20px !important;
}

#campingTabletContainer .camp-count-controls button {
    font-size: 32px !important;
}

#campingTabletContainer #campBaseChecksVal,
#campingTabletContainer #campCheckModVal {
    font-size: 30px !important;
    min-width: 38px !important;
}




/* 2. Таблица «Действие»: увеличенная высота карточек, крупный текст и радиокнопки */
#campingTabletContainer .camp-gm-inputs-grid {
    padding: 8px 16px !important;
}

#campingTabletContainer .camp-invisible-table th {
    padding: 4px 4px 8px 4px !important;
    font-size: 20px !important;
}

#campingTabletContainer .camp-invisible-table tr {
    border-bottom: 10px solid transparent !important;
}

#campingTabletContainer .camp-invisible-table td.camp-act-cell {
    padding: 12px 150px 12px 14px !important;
    min-height: 82px !important;
}

#campingTabletContainer .camp-invisible-table .act-name {
    font-size: 23px !important;
    margin-bottom: 6px !important;
}

#campingTabletContainer [id^="label_dc_"],
#campingTabletContainer .camp-invisible-table .skill-name-large {
    font-size: 18px !important;
    padding: 3px 12px !important;
}


/* Крупные радиокнопки с золотой лилией (38px) */
#campingTabletContainer .camp-invisible-table td:not(.camp-act-cell) {
    width: 56px !important;
    padding: 6px 4px !important;
}

#campingTabletContainer .camp-invisible-table input[type="radio"] {
    width: 34px !important;
    height: 34px !important;
}

#campingTabletContainer .camp-invisible-table input[type="radio"]:checked::before {
    font-size: 22px !important;
}

/* 3. Увеличенные аватарки основного героя и помощника внутри карточки действия */
#campingTabletContainer .camp-assigned-allies-group {
    right: 14px !important;
    gap: 10px !important;
}

#campingTabletContainer .camp-assigned-ally-badge.is-leader .camp-assigned-ally-img {
    width: 64px !important;
    height: 64px !important;
}

#campingTabletContainer .camp-assigned-ally-badge.is-helper .camp-assigned-ally-img {
    width: 48px !important;
    height: 48px !important;
}

#campingTabletContainer .camp-aid-value-pill {
    min-width: 26px !important;
    height: 20px !important;
    font-size: 13px !important;
    line-height: 17px !important;
    bottom: -6px !important;
    right: -6px !important;
}

/* 4. Нижний док с 6 союзниками */
#campingTabletContainer .camp-allies-dock {
    padding: 10px 14px !important;
    gap: 8px !important;
    margin-top: 0 !important;
}

#campingTabletContainer .camp-allies-dock-title {
    font-size: 16px !important;
    padding-bottom: 5px !important;
}

#campingTabletContainer .camp-allies-grid {
    gap: 10px !important;
}


/* ============================================================================
   ПАРНОЕ НАЗНАЧЕНИЕ ГЕРОЕВ НА ДЕЙСТВИЕ (ОСНОВНОЙ + ПОМОЩНИК)
   ============================================================================ */

/* Контейнер группы из 1-2 аватарок справа внутри блока действия */
#campingTabletContainer .camp-assigned-allies-group {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    align-items: flex-end !important;
    gap: 8px !important;
    z-index: 5 !important;
}

/* Сбрасываем старое абсолютное позиционирование одиночного бейджа */
#campingTabletContainer .camp-assigned-ally-badge {
    position: static !important;
    transform: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: transform 0.15s ease !important;
}

#campingTabletContainer .camp-assigned-ally-badge:hover {
    transform: scale(1.1) !important;
}

/* Основной герой (первый перетащенный) — крупный портрет */
#campingTabletContainer .camp-assigned-ally-badge.is-leader .camp-assigned-ally-img {
    width: 46px !important;
    height: 46px !important;
    border: 2px solid #2ecc71 !important;
    border-radius: 6px !important;
    font-size: 20px !important;
}

/* Помощник (второй перетащенный) — уменьшенный портрет с золотой окантовкой */
#campingTabletContainer .camp-assigned-ally-badge.is-helper .camp-assigned-ally-img {
    width: 32px !important;
    height: 32px !important;
    border: 1.5px solid #ffd875 !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.9) !important;
}

/* Скрываем имена в блоках действий */
#campingTabletContainer .camp-assigned-ally-name {
    display: none !important;
}

/* Увеличиваем правый отступ в ячейке действия под два портрета */
#campingTabletContainer .camp-invisible-table td.camp-act-cell {
    padding-right: 108px !important;
}

/* ============================================================================
   ЗОЛОТАЯ ПОДСВЕТКА ИМЕН ГЕРОЕВ В ЛОГАХ И ИТОГОВОМ ОКНЕ ПРИВАЛА
   ============================================================================ */

#campingTabletContainer .camp-effect-line span.camp-actor-highlight,
#campResultModalBody .camp-effect-line span.camp-actor-highlight,
.camp-result-text-container .camp-effect-line span.camp-actor-highlight {
    display: inline !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 2px !important;
    margin: 0 !important;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: #ffd875 !important;
    text-shadow: 0 0 10px rgba(255, 216, 117, 0.8), 0 1px 3px #000000 !important;
}
/* Принудительный вывод выпадашки статусов в левом нижнем углу карточки (Режим Горизонт) */
#questLogContainer .init-cards-scroll-list.mode-bg3 .init-card-right {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    pointer-events: none !important;
    z-index: 20 !important;
}

#questLogContainer .init-cards-scroll-list.mode-bg3 .init-inline-status-select {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    bottom: 4px !important;
    left: 4px !important;
    width: 44px !important;
    height: 26px !important;
    padding: 0 0 0 4px !important;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif !important;
    font-size: 14px !important;
    text-align: left !important;
    text-align-last: left !important;
    background: rgba(2, 5, 3, 0.94) !important;
    border: 1.5px solid #dfbc6f !important;
    border-radius: 4px !important;
    color: #ffd875 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 30 !important;
}


#questLogContainer .init-cards-scroll-list.mode-bg3 .init-score-massive-block {
    display: block !important;
    position: absolute !important;
    bottom: 4px !important;
    right: 4px !important;
    pointer-events: auto !important;
    z-index: 30 !important;
}

/* ============================================================================
   ОБНОВЛЕННАЯ КАРТОЧКА В ГОРИЗОНТЕ: ПЛАШКА ИМЕНИ СВЕРХУ + ПОРТРЕТ + ПЛАШКА СТАТУСА СНИЗУ
   ============================================================================ */

/* Контейнер ленты подстраивается под новую высоту карточек с плашками */
#questLogContainer .init-cards-scroll-list.mode-bg3 {
    height: auto !important;
    min-height: 235px !important;
    max-height: none !important;
    padding: 16px 30px !important;
    align-items: center !important;
}

/* Сама карточка: вертикальный стек из 3 плотно прилегающих блоков без зазоров */
#questLogContainer .mode-bg3 .init-combatant-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: 115px !important;
    min-width: 115px !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    gap: 0 !important;
}

/* Увеличение активной карточки при ходе (без деформации пропорций) */
#questLogContainer .mode-bg3 .init-combatant-card.selected-turn-gold {
    width: 156px !important;
    min-width: 156px !important;
    height: auto !important;
    min-height: auto !important;
    transform: none !important;
}

/* Левый блок превращаем в обертку для верхней плашки имени и центрального портрета */
#questLogContainer .mode-bg3 .init-card-left {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
}

/* 1. ВЕРХНЯЯ ПЛАШКА-ПОЛОСКА С ИМЕНЕМ (Строго выше портрета, без зазора) */
#questLogContainer .mode-bg3 .init-card-name-text {
    order: 1 !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    padding: 4px 4px !important;
    background: rgba(2, 5, 3, 0.94) !important;
    border-bottom: 1px solid rgba(223, 188, 111, 0.35) !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
    text-align: center !important;
    color: #ffd875 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
    -webkit-line-clamp: unset !important;
    box-sizing: border-box !important;
}

#questLogContainer .mode-bg3 .init-combatant-card.selected-turn-gold .init-card-name-text {
    font-size: 20px !important;
    padding: 5px 6px !important;
}

/* 2. ЦЕНТРАЛЬНЫЙ БЛОК ПОРТРЕТА (Чистый квадрат без перекрытия текстом) */
#questLogContainer .mode-bg3 .init-avatar-shield-circle {
    order: 2 !important;
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 111px !important;
    border-radius: 0 !important;
    border: none !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#questLogContainer .mode-bg3 .init-combatant-card.selected-turn-gold .init-avatar-shield-circle {
    height: 152px !important;
}

/* 3. НИЖНЯЯ ПЛАШКА-ПОЛОСКА СО СТАТУСОМ И ИНИЦИАТИВОЙ (Строго под портретом, без зазора) */
#questLogContainer .mode-bg3 .init-card-right {
    order: 3 !important;
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 32px !important;
    padding: 3px 4px !important;
    background: rgba(2, 5, 3, 0.94) !important;
    border-top: 1px solid rgba(223, 188, 111, 0.35) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    pointer-events: auto !important;
    box-sizing: border-box !important;
}

/* Выпадашка статуса внутри нижней плашки */
#questLogContainer .mode-bg3 .init-inline-status-select {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    width: 44px !important;
    height: 24px !important;
    padding: 0 0 0 4px !important;
    font-size: 13px !important;
    border: 1px solid #dfbc6f !important;
    border-radius: 4px !important;
}

/* Поле инициативы внутри нижней плашки */
#questLogContainer .mode-bg3 .init-score-massive-block {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    display: flex !important;
    align-items: center !important;
}

#questLogContainer .mode-bg3 .init-inline-score-input {
    width: 40px !important;
    height: 24px !important;
    font-size: 18px !important;
    padding: 0 !important;
    border: 1px solid #ffd875 !important;
    border-radius: 4px !important;
}

/* Кнопка удаления остаётся в правом верхнем углу поверх плашки имени при наведении */
#questLogContainer .mode-bg3 .init-btn-delete-card {
    top: 2px !important;
    right: 2px !important;
    width: 20px !important;
    height: 20px !important;
    font-size: 14px !important;
}
/* ============================================================================
   ФИКС: ПРИНУДИТЕЛЬНАЯ ОТРИСОВКА 3-СЕКЦИОННОЙ КАРТОЧКИ В ГОРИЗОНТЕ
   ============================================================================ */
#questLogContainer .init-cards-scroll-list.mode-bg3 .init-combatant-card {
    display: flex !important;
    flex-direction: column !important;
    width: 118px !important;
    min-width: 118px !important;
    height: auto !important;
    padding: 0 !important;
    overflow: hidden !important;
}

#questLogContainer .init-cards-scroll-list.mode-bg3 .init-combatant-card.selected-turn-gold {
    width: 156px !important;
    min-width: 156px !important;
    height: auto !important;
}

/* Яркие градиенты фракций внутри портрета */
#questLogContainer .init-cards-scroll-list.mode-bg3 .init-combatant-card.faction-friend  { background: linear-gradient(180deg, #1b4d2b 0%, #0d2b16 100%) !important; }
#questLogContainer .init-cards-scroll-list.mode-bg3 .init-combatant-card.faction-enemy   { background: linear-gradient(180deg, #591818 0%, #2e0a0a 100%) !important; }
#questLogContainer .init-cards-scroll-list.mode-bg3 .init-combatant-card.faction-neutral { background: linear-gradient(180deg, #b89428 0%, #6e520c 100%) !important; }
#questLogContainer .init-cards-scroll-list.mode-bg3 .init-combatant-card.status-out      { background: linear-gradient(180deg, #3a3f42 0%, #222629 100%) !important; }

/* Левый контейнер как колонка (Имя + Портрет) */
#questLogContainer .init-cards-scroll-list.mode-bg3 .init-card-left {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
}

/* 1. Верхняя полоска с золотым именем */
#questLogContainer .init-cards-scroll-list.mode-bg3 .init-card-name-text {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    padding: 4px 5px !important;
    background: #040905 !important;
    border-bottom: 1px solid rgba(223, 188, 111, 0.4) !important;
    color: #ffd875 !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
}
#questLogContainer .init-cards-scroll-list.mode-bg3 .init-combatant-card.selected-turn-gold .init-card-name-text {
    font-size: 20px !important;
}

/* 2. Центральный квадрат с аватаркой */
#questLogContainer .init-cards-scroll-list.mode-bg3 .init-avatar-shield-circle {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 114px !important;
    border-radius: 0 !important;
    border: none !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}
#questLogContainer .init-cards-scroll-list.mode-bg3 .init-combatant-card.selected-turn-gold .init-avatar-shield-circle {
    height: 152px !important;
}
#questLogContainer .init-cards-scroll-list.mode-bg3 .init-avatar-shield-circle img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* 3. Нижняя полоска со статусом и инициативой */
#questLogContainer .init-cards-scroll-list.mode-bg3 .init-card-right {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 32px !important;
    padding: 3px 4px !important;
    background: #040905 !important;
    border-top: 1px solid rgba(223, 188, 111, 0.4) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    pointer-events: auto !important;
}
/* ============================================================================
   КОМПАКТНАЯ УПАКОВКА ГОРИЗОНТАЛЬНОГО ТРЕКЕРА БЕЗ ЛИШНИХ ПОЛОСОК И ПРОКРУТКИ
   ============================================================================ */

/* 1. Полностью убираем пустой блок стрелки хода из потока в режиме Горизонт */
#questLogContainer .init-cards-scroll-list.mode-bg3 .init-turn-pointer-arrow,
#questLogContainer .init-cards-scroll-list.mode-bg3 .init-turn-pointer-arrow.visible {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 2. Плотная стыковка имени и аватара без зазоров */
#questLogContainer .init-cards-scroll-list.mode-bg3 .init-card-left {
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 3. Делаем карточки и портреты чуть компактнее по высоте, чтобы всё помещалось в экран */
#questLogContainer .init-cards-scroll-list.mode-bg3 {
    min-height: 195px !important;
    padding: 8px 30px !important;
}

#questLogContainer .init-cards-scroll-list.mode-bg3 .init-avatar-shield-circle {
    height: 96px !important;
}

#questLogContainer .init-cards-scroll-list.mode-bg3 .init-combatant-card.selected-turn-gold .init-avatar-shield-circle {
    height: 128px !important;
}

/* 4. Уменьшаем вертикальные отступы рамки цитаты и блока выбывших, чтобы нижний ряд не обрезался */
.init-cards-scroll-list.mode-bg3 + .init-focus-quote-shield {
    margin: 10px auto 0 auto !important;
    padding: 16px 35px !important;
    min-height: 95px !important;
}

.init-cards-scroll-list.mode-bg3 + .init-focus-quote-shield .init-focus-phrase-text {
    font-size: 30px !important;
    line-height: 1.3 !important;
}

.init-cards-scroll-list.mode-bg3 + .init-focus-quote-shield span.gold-unit-focus-name {
    font-size: 34px !important;
}

.init-out-combatants-zone {
    margin: 10px auto 0 auto !important;
    padding: 8px 20px !important;
}

#questLogContainer .init-out-zone-grid.mode-bg3 {
    min-height: auto !important;
    padding: 4px 0 !important;
    gap: 16px !important;
}

#questLogContainer .init-out-zone-grid.mode-bg3 .init-avatar-shield-circle {
    height: 82px !important;
}
/* ============================================================================
   ПЛАШКИ СТАТУСОВ В ВЕРХНЕЙ ЧАСТИ ПОРТРЕТА (ТОЛЬКО ПРИ СМЕРТИ И РАСПЛАСТАН)
   ============================================================================ */

/* Общая база для верхней ленты статуса внутри портрета */
#questLogContainer .mode-bg3 .init-combatant-card.state-dying .init-avatar-shield-circle::after,
#questLogContainer .mode-bg3 .init-combatant-card.state-prone .init-avatar-shield-circle::after {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 10.5px !important;
    font-weight: 900 !important;
    text-align: center !important;
    padding: 2px 0 !important;
    letter-spacing: 0.4px !important;
    text-shadow: 0 1px 2px #000 !important;
    z-index: 5 !important;
    pointer-events: none !important;
}

/* 1. При смерти (Багровая плашка) */
#questLogContainer .mode-bg3 .init-combatant-card.state-dying .init-avatar-shield-circle::after {
    content: "🩸 ПРИ СМЕРТИ" !important;
    background: rgba(165, 20, 20, 0.92) !important;
    border-bottom: 1px solid #ff7675 !important;
    color: #ffffff !important;
}

/* 2. Распластан (Янтарно-золотая плашка) */
#questLogContainer .mode-bg3 .init-combatant-card.state-prone .init-avatar-shield-circle::after {
    content: "💫 РАСПЛАСТАН" !important;
    background: rgba(155, 95, 10, 0.92) !important;
    border-bottom: 1px solid #ffd875 !important;
    color: #ffd875 !important;
}
/* ============================================================================
   ФИКС ВЕРТИКАЛЬНОГО СПИСКА: ТЁМНАЯ ВЫПАДАШКА СТАТУСОВ И СЕРЫЙ ЦВЕТ ВЫБЫВШИХ
   ============================================================================ */

/* 1. Единый тёмный стиль для выпадашки статусов в вертикальном списке (не затрагивая Горизонт) */
.init-cards-scroll-list:not(.mode-bg3) .init-inline-status-select {
    background-color: #040905 !important;
    border: 1px solid #543e0d !important;
    color: #ebd291 !important;
    padding: 6px 10px !important;
    font-size: 16px !important;
    font-weight: normal !important;
    border-radius: 4px !important;
    height: auto !important;
    cursor: pointer !important;
    outline: none !important;
}

.init-cards-scroll-list:not(.mode-bg3) .init-inline-status-select option {
    background-color: #040905 !important;
    color: #ebd291 !important;
}

.init-cards-scroll-list:not(.mode-bg3) .init-inline-status-select.status-dying {
    border-color: #e74c3c !important;
    color: #ff7675 !important;
}

.init-cards-scroll-list:not(.mode-bg3) .init-inline-status-select.status-prone {
    border-color: #f39c12 !important;
    color: #f1c40f !important;
}

.init-cards-scroll-list:not(.mode-bg3) .init-inline-status-select.status-out {
    border-color: #636e72 !important;
    color: #b2bec3 !important;
}

/* 2. Принудительный серый фон и рамка для ВЫБЫВШИХ бойцов любой фракции (включая Нейтралов) */
#questLogContainer .init-cards-scroll-list .init-combatant-card.status-out,
#questLogContainer .init-cards-scroll-list .init-combatant-card.faction-neutral.status-out,
#questLogContainer .init-cards-scroll-list .init-combatant-card.faction-friend.status-out,
#questLogContainer .init-cards-scroll-list .init-combatant-card.faction-enemy.status-out {
    background: linear-gradient(90deg, #3a3f42 0%, #222629 100%) !important;
    border: 2px solid #636e72 !important;
    box-shadow: none !important;
    opacity: 0.85 !important;
}

#questLogContainer .init-cards-scroll-list .init-combatant-card.status-out .init-card-name-text {
    color: #b2bec3 !important;
}

.k-panel { background: rgba(12, 18, 14, 0.92); border: 1px solid #543e0d; border-radius: 6px; padding: 10px 12px; }
.k-sec-title { font-size: 13px; font-weight: 900; color: #ffd875; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; border-bottom: 1px solid rgba(212, 175, 55, 0.3); padding-bottom: 4px; }
.k-box-card { background: #060b07; border: 1px solid #543e0d; border-radius: 4px; padding: 6px 8px; }
.k-box-title { font-size: 11px; font-weight: 900; color: #dfbc6f; margin-bottom: 4px; }
.k-lbl { display: block; font-size: 11px; color: #dfbc6f; margin-bottom: 2px; font-weight: bold; }
.k-inp { width: 100%; background: #040905; border: 1px solid #543e0d; color: #ebd291; padding: 4px 6px; font-size: 13px; border-radius: 4px; box-sizing: border-box; }
.k-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.k-table th { text-align: left; color: #ffd875; border-bottom: 1px solid #543e0d; padding: 4px; }
.k-table td { padding: 3px 4px; border-bottom: 1px solid rgba(84, 62, 13, 0.35); }
.k-table input.k-inp { width: 48px; text-align: center; padding: 2px; }

/* ============================================================================
   КАТАЛОГ ПОСТРОЕК ГОРОДА: РЕСАЙЗЕР, КАТЕГОРИИ И КРУПНЫЙ ШРИФТ
   ============================================================================ */
.k-catalog-panel {
    flex-shrink: 0;
    min-width: 240px;
    max-width: 750px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.k-catalog-scroll {
    overflow-y: auto;
    padding-right: 4px;
    flex: 1;
}

.k-catalog-scroll::-webkit-scrollbar { width: 8px; }
.k-catalog-scroll::-webkit-scrollbar-track { background: #040905; border-radius: 4px; }
.k-catalog-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8a6421 0%, #b89445 50%, #6e4e14 100%);
    border: 1px solid #543e0d;
    border-radius: 4px;
}

.k-catalog-resizer {
    width: 10px;
    cursor: col-resize;
    flex-shrink: 0;
    position: relative;
    margin: 0 4px;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.k-catalog-resizer::after {
    content: "";
    position: absolute;
    top: 8%;
    bottom: 8%;
    left: 4px;
    width: 2px;
    background: rgba(184, 148, 69, 0.35);
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.k-catalog-resizer:hover,
.k-catalog-resizer.active {
    background: rgba(184, 148, 69, 0.15);
}

.k-catalog-resizer:hover::after,
.k-catalog-resizer.active::after {
    background: #ffd875;
    box-shadow: 0 0 8px #ffd875;
}

.k-catalog-group {
    margin-bottom: 10px;
    border: 1px solid #543e0d;
    border-radius: 5px;
    background: #060b07;
    overflow: hidden;
}

.k-catalog-group-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: linear-gradient(180deg, #1b3322 0%, #0f1f14 100%);
    border: none;
    border-bottom: 1px solid #543e0d;
    color: #ffd875;
    font-family: "Tinos", serif;
    font-size: 17px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    cursor: pointer;
    text-align: left;
    transition: filter 0.15s ease;
}

.k-catalog-group-header:hover {
    filter: brightness(1.2);
}

.k-catalog-group.collapsed .k-catalog-group-header {
    border-bottom: none;
}

.k-catalog-group.collapsed .k-catalog-group-body {
    display: none;
}

.k-group-arrow {
    color: #dfbc6f;
    font-size: 16px;
    width: 14px;
}

.k-group-title {
    flex: 1;
}

.k-group-count {
    background: rgba(184, 148, 69, 0.25);
    border: 1px solid #8a6421;
    color: #ebd291;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 13px;
    font-family: monospace;
}

.k-catalog-group-body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.k-bld-palette-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: #0a120c;
    border: 1px solid #543e0d;
    border-radius: 4px;
    cursor: grab;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.k-bld-palette-item:hover {
    border-color: #ffd875;
    background: #142619;
}

.k-bld-palette-item:active {
    cursor: grabbing;
}

.k-bld-thumb {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border: 1px solid #d4af37;
    border-radius: 4px;
    background: #1c2118;
    flex-shrink: 0;
}

.k-bld-info {
    flex: 1;
    min-width: 0;
}

.k-bld-name {
    font-family: "Tinos", serif;
    font-size: 16px;
    font-weight: bold;
    color: #ffd875;
    line-height: 1.25;
    white-space: normal;
    word-break: break-word;
}

.k-bld-meta {
    font-size: 13px;
    color: #a4b0be;
    margin-top: 3px;
}

/* Строка поиска в каталоге построек */
.k-catalog-search-wrap {
    position: relative;
    margin-bottom: 10px;
}

.k-catalog-search-inp {
    padding: 8px 30px 8px 10px !important;
    font-size: 14px !important;
    border-color: #8a6421 !important;
}

.k-catalog-search-inp:focus {
    border-color: #ffd875 !important;
    box-shadow: 0 0 8px rgba(255, 216, 117, 0.35);
    outline: none;
}

.k-catalog-search-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: rgba(92, 30, 30, 0.85);
    border: 1px solid #ff7675;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.k-catalog-search-clear:hover {
    filter: brightness(1.25);
}
/* ============================================================================
   СВОДКА БОНУСОВ ПОСТРОЕК И БЕЙДЖИ В КАТАЛОГЕ
   ============================================================================ */
.k-bld-bonus-tag {
    font-size: 12px;
    color: #2ecc71;
    margin-top: 3px;
    line-height: 1.25;
}

.k-urban-summary-box {
    background: #060b07;
    border: 1px solid #8a6421;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.k-urban-summary-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: #ebd291;
    border-bottom: 1px dashed rgba(138, 100, 33, 0.35);
    padding-bottom: 6px;
}

.k-urban-summary-top b {
    color: #ffd875;
}

.k-urban-summary-skills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.k-eff-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid #543e0d;
    color: #ebd291;
}

.k-eff-badge.good {
    background: rgba(46, 204, 113, 0.14);
    border-color: #2ecc71;
    color: #2ecc71;
}

.k-eff-badge.bad {
    background: rgba(231, 76, 60, 0.15);
    border-color: #e74c3c;
    color: #ff7675;
}
/* ============================================================================
   ТРЕКЕР ДЕЙСТВИЙ ЛИДЕРОВ (ФАЗА ДЕЯТЕЛЬНОСТИ КОРОЛЕВСТВА)
   ============================================================================ */
.k-act-pip {
    width: 24px;
    height: 24px;
    padding: 0;
    background: #0d2415;
    border: 1px solid #2ecc71;
    border-radius: 4px;
    color: #2ecc71;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    box-shadow: 0 0 6px rgba(46, 204, 113, 0.25);
}

.k-act-pip:hover:not(.disabled) {
    transform: scale(1.1);
    border-color: #ffd875;
}

.k-act-pip.spent {
    background: #2b1111;
    border-color: #543e0d;
    color: #5c4d3c;
    box-shadow: none;
}

.k-act-pip.disabled {
    background: #060907;
    border-color: #2c3531;
    color: #2c3531;
    cursor: not-allowed;
    box-shadow: none;
}
/* ============================================================================
   БЕЙДЖ МОДИФИКАТОРА ПОМОЩИ (AID: ОТ -1 ДО +2) НА АВАТАРЕ ПОМОЩНИКА
   ============================================================================ */
#campingTabletContainer .camp-assigned-ally-badge.is-helper {
    position: relative !important;
    cursor: ns-resize !important;
}

#campingTabletContainer .camp-aid-value-pill {
    position: absolute;
    bottom: -6px;
    right: -6px;
    min-width: 22px;
    height: 17px;
    padding: 0 4px;
    border-radius: 4px;
    background: #040905;
    border: 1.5px solid #ffd875;
    color: #ffd875;
    font-family: monospace;
    font-size: 11px;
    font-weight: 900;
    line-height: 14px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.95);
    pointer-events: none;
    z-index: 10;
}

#campingTabletContainer .camp-aid-value-pill.is-pos {
    border-color: #2ecc71;
    color: #2ecc71;
}

#campingTabletContainer .camp-aid-value-pill.is-neg {
    border-color: #e74c3c;
    color: #ff7675;
}
/* ============================================================================
   УВЕЛИЧЕНИЕ ВЫСОТЫ КАРТОЧЕК ДЕЙСТВИЙ И ПОРТРЕТОВ ГЕРОЕВ В ПРИВАЛЕ
   ============================================================================ */
#campingTabletContainer .camp-invisible-table td.camp-act-cell {
    padding: 18px 168px 18px 18px !important;
    min-height: 108px !important;
}

#campingTabletContainer .camp-invisible-table .act-name {
    font-size: 28px !important;
    margin-bottom: 10px !important;
}

#campingTabletContainer [id^="label_dc_"],
#campingTabletContainer .camp-invisible-table .skill-name-large {
    font-size: 22px !important;
    padding: 5px 15px !important;
}

#campingTabletContainer .camp-assigned-allies-group {
    right: 16px !important;
    gap: 12px !important;
}

/* Основной герой — крупный портрет (76x76px) */
#campingTabletContainer .camp-assigned-ally-badge.is-leader .camp-assigned-ally-img {
    width: 76px !important;
    height: 76px !important;
    border-width: 3px !important;
    border-radius: 8px !important;
    font-size: 30px !important;
}

/* Помощник — увеличенный портрет (56x56px) */
#campingTabletContainer .camp-assigned-ally-badge.is-helper .camp-assigned-ally-img {
    width: 56px !important;
    height: 56px !important;
    border-width: 2.5px !important;
    border-radius: 7px !important;
    font-size: 22px !important;
}

/* Крупный бейдж модификатора помощи (+2 / -1) */
#campingTabletContainer .camp-aid-value-pill {
    min-width: 30px !important;
    height: 23px !important;
    font-size: 15px !important;
    line-height: 20px !important;
    bottom: -7px !important;
    right: -7px !important;
    border-width: 2px !important;
}
/* ============================================================================
   ФИНАЛЬНАЯ ТВ-ПОДГОНКА ПРИВАЛА: ИМЕНА СОЮЗНИКОВ, ТИП МЕСТНОСТИ И ОКНО ЛОГА
   ============================================================================ */

/* 1. Крупный шрифт для строки «Тип местности: 🌾 Равнины (СЛ 12)» */
#campingTabletContainer #campEncounterTerrainLabel,
#campingTabletContainer .camping-region-bar small,
#campingTabletContainer .camping-region-bar div[style*="font-size"],
#campingTabletContainer .camping-region-bar span[style*="font-size"] {
    font-size: 21px !important;
    line-height: 1.35 !important;
    color: #ebd291 !important;
}

/* 2. Крупные имена на аватарках в нижнем блоке «Союзники отряда» */
#campingTabletContainer .camp-ally-slot-name {
    font-size: 16px !important;
    padding: 4px 5px !important;
    letter-spacing: 0.4px !important;
    background: rgba(2, 5, 3, 0.92) !important;
    border-top: 1px solid rgba(223, 188, 111, 0.35) !important;
    text-shadow: 0 1px 3px #000 !important;
}

/* 3. Растягиваем окно «Активные игровые эффекты привала» на всю высоту до кнопок */
#campingTabletContainer .camping-right-col {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
}

#campingTabletContainer .camp-effects-log-large {
    flex: 1 1 auto !important;
    max-height: none !important;
    min-height: 360px !important;
    margin-bottom: 6px !important;
}

#campingTabletContainer .camping-right-col .kingdom-save-wrapper {
    margin-top: auto !important;
    flex-shrink: 0 !important;
}

/* ============================================================================
   ЕДИНЫЙ ГЕРАЛЬДИЧЕСКИЙ СТИЛЬ ДЛЯ ВСЕХ ЧЕКБОКСОВ И РАДИОКНОПОК В НАСТРОЙКАХ
   ============================================================================ */
#settingsTabletContainer .checkbox-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 14px !important;
    margin-bottom: 10px !important;
    padding: 8px 14px !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(84, 62, 13, 0.4) !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

#settingsTabletContainer .checkbox-row:hover {
    background: rgba(21, 46, 29, 0.25) !important;
    border-color: #b89445 !important;
}

#settingsTabletContainer .checkbox-row label {
    order: 1 !important;
    flex: 1 !important;
    text-align: left !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 16px !important;
    font-weight: bold !important;
    color: #ebd291 !important;
    cursor: pointer !important;
    user-select: none !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    margin: 0 !important;
    padding: 0 !important;
}

#settingsTabletContainer .checkbox-row input[type="checkbox"]:checked + label,
#settingsTabletContainer .checkbox-row:has(input[type="checkbox"]:checked) label {
    color: #fff !important;
    text-shadow: 0 0 8px rgba(255, 216, 117, 0.5) !important;
}

#settingsTabletContainer .checkbox-row input[type="checkbox"] {
    order: -1 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background: #020503 !important;
    border: 2px solid #543e0d !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    cursor: pointer !important;
    outline: none !important;
    flex-shrink: 0 !important;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.9) !important;
}

#settingsTabletContainer .checkbox-row input[type="checkbox"]:hover {
    border-color: #b89445 !important;
    box-shadow: 0 0 8px rgba(184, 148, 69, 0.5) !important;
}

#settingsTabletContainer .checkbox-row input[type="checkbox"]:checked {
    border-color: #ffd875 !important;
    background: #020503 !important;
    box-shadow: 0 0 12px #ffd875, inset 0 0 4px rgba(255, 216, 117, 0.3) !important;
}

#settingsTabletContainer .checkbox-row input[type="checkbox"]:checked::before {
    content: "⚜" !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 14px !important;
    color: #ffd875 !important;
    font-weight: 900 !important;
    text-shadow: 0 0 4px #dfbc6f !important;
}
/* ============================================================================
   ТВ-МАСШТАБИРОВАНИЕ МОДАЛЬНЫХ ОКОН ПОГОДЫ И ПОГОДНЫХ ЯВЛЕНИЙ (x2.5 – x3)
   ============================================================================ */
#kWeatherRollOverlay > div,
#kHazardDetailsOverlay > div {
    width: 1320px !important;
    max-width: 96vw !important;
    padding: 36px 46px !important;
    border-width: 4px !important;
    border-radius: 12px !important;
    font-size: 26px !important;
    line-height: 1.45 !important;
}

/* Крупные заголовки окон погоды */
#kWeatherRollOverlay > div > div:first-child,
#kHazardDetailsOverlay > div > div:first-child {
    font-size: 36px !important;
    padding-bottom: 14px !important;
    margin-bottom: 22px !important;
    border-bottom-width: 2px !important;
}

/* Строки чистых проверок (Осадки, Холод, Погодное явление) */
#kWeatherRollOverlay > div > div:nth-child(2) > div {
    padding: 18px 24px !important;
    border-width: 2px !important;
    border-radius: 8px !important;
    font-size: 25px !important;
    gap: 20px !important;
}

#kWeatherRollOverlay > div > div:nth-child(2) > div div[style*="font-size:11px"],
#kWeatherRollOverlay > div > div:nth-child(2) > div[style*="font-size:12px"] {
    font-size: 20px !important;
    margin-top: 4px !important;
}

/* Поля ввода d20 */
#kWeatherRollOverlay input.k-inp {
    width: 145px !important;
    height: 68px !important;
    font-size: 38px !important;
    border-width: 2.5px !important;
    border-radius: 8px !important;
}

/* Секция таблицы опасных погодных явлений */
#kWHazardSection {
    padding: 20px 24px !important;
    border-width: 2.5px !important;
    margin-bottom: 20px !important;
}

#kWHazardSection > div:first-child span {
    font-size: 28px !important;
}

#kWHazardSection div[style*="grid-template-columns"] {
    gap: 10px 16px !important;
    font-size: 22px !important;
}

#kWHazardSection [data-hz-id] {
    padding: 10px 14px !important;
    border-width: 2px !important;
    border-radius: 6px !important;
}

#kWNat20Hint {
    font-size: 22px !important;
    margin-bottom: 12px !important;
}

/* Блок предпросмотра и карточка правил опасного явления */
#kWSummaryPreview {
    padding: 18px 24px !important;
    font-size: 25px !important;
    border-width: 2px !important;
    margin-bottom: 22px !important;
}

#kWeatherRollOverlay div[style*="border:1.5px solid #e74c3c"],
#kHazardDetailsOverlay div[style*="border:1.5px solid #e74c3c"] {
    padding: 22px 28px !important;
    border-width: 3px !important;
    border-radius: 10px !important;
    font-size: 25px !important;
    line-height: 1.5 !important;
    margin-top: 16px !important;
}

#kWeatherRollOverlay div[style*="border:1.5px solid #e74c3c"] span[style*="font-size:16px"],
#kHazardDetailsOverlay div[style*="border:1.5px solid #e74c3c"] span[style*="font-size:16px"] {
    font-size: 34px !important;
}

#kWeatherRollOverlay div[style*="border:1.5px solid #e74c3c"] span[style*="font-size:12px"],
#kHazardDetailsOverlay div[style*="border:1.5px solid #e74c3c"] span[style*="font-size:12px"] {
    font-size: 23px !important;
    padding: 4px 14px !important;
}

#kWeatherRollOverlay div[style*="border:1.5px solid #e74c3c"] span[style*="font-size:11px"],
#kHazardDetailsOverlay div[style*="border:1.5px solid #e74c3c"] span[style*="font-size:11px"],
#kWeatherRollOverlay div[style*="border:1.5px solid #e74c3c"] div[style*="font-size:11px"],
#kHazardDetailsOverlay div[style*="border:1.5px solid #e74c3c"] div[style*="font-size:11px"] {
    font-size: 21px !important;
    margin-top: 8px !important;
}

/* Крупные кнопки «Отмена», «Применить погоду дня» и «Закрыть» */
#kWeatherRollOverlay .btn,
#kHazardDetailsOverlay .btn {
    padding: 16px 36px !important;
    font-size: 24px !important;
    min-width: 220px !important;
    border-radius: 6px !important;
}
/* ============================================================================
   ЕДИНЫЙ МАСШТАБ ШРИФТОВ В БЛОКЕ «ТЕКУЩАЯ ПОГОДА ДНЯ» КАК В ТАБЛИЦЕ ЯВЛЕНИЙ
   ============================================================================ */
#weatherTabletContainer .k-panel:first-child {
    padding: 18px 22px !important;
    gap: 14px !important;
}

/* Заголовок секции — 22px, как у таблицы явлений */
#weatherTabletContainer .k-panel:first-child .k-sec-title {
    font-size: 22px !important;
    line-height: 1.3 !important;
}

/* Иконка погоды (48px) */
#weatherTabletContainer .k-panel:first-child div[style*="font-size:48px"] {
    font-size: 48px !important;
}

/* Название погоды («Ясно и благоприятно» и т.д.) — 22px */
#weatherTabletContainer .k-panel:first-child div[style*="font-size:24px"] {
    font-size: 22px !important;
    line-height: 1.3 !important;
    margin-bottom: 4px !important;
}

/* Описание эффектов погоды — 18px */
#weatherTabletContainer .k-panel:first-child div[style*="font-size:17px"] {
    font-size: 18px !important;
    line-height: 1.4 !important;
}

/* Кнопка «☀️ Сбросить в ясно» — 16px */
#weatherTabletContainer #wBtnResetClear {
    font-size: 16px !important;
    padding: 8px 14px !important;
}

/* Блок «🎲 СЛ утренних чистых проверок» — 18px */
#weatherTabletContainer .k-panel:first-child div[style*="font-size:18px"] {
    font-size: 18px !important;
    padding: 12px 16px !important;
    line-height: 1.45 !important;
}

/* Заглушка «Опасных погодных явлений сегодня нет» — 18px */
#weatherTabletContainer .k-panel:first-child div[style*="font-size:19px"] {
    font-size: 18px !important;
    padding: 16px !important;
}

/* Карточка активного погодного явления — 18px (заголовок 21px, бейдж 15px) */
#weatherTabletContainer .k-panel:first-child div[style*="border:1.5px solid #e74c3c"] {
    font-size: 18px !important;
    padding: 14px 16px !important;
    line-height: 1.45 !important;
}

#weatherTabletContainer .k-panel:first-child div[style*="border:1.5px solid #e74c3c"] span[style*="font-size:16px"] {
    font-size: 21px !important;
}

#weatherTabletContainer .k-panel:first-child div[style*="border:1.5px solid #e74c3c"] span[style*="font-size:12px"] {
    font-size: 15px !important;
    padding: 2px 10px !important;
}

#weatherTabletContainer .k-panel:first-child div[style*="border:1.5px solid #e74c3c"] span[style*="font-size:11px"],
#weatherTabletContainer .k-panel:first-child div[style*="border:1.5px solid #e74c3c"] div[style*="font-size:11px"] {
    font-size: 15px !important;
    margin-top: 6px !important;
}

/* ============================================================================
   СБАЛАНСИРОВАННЫЕ ОТСТУПЫ И ВОЗДУХ В БЛОКЕ «ДЕЙСТВИЕ» ПРИВАЛА
   ============================================================================ */
#campingTabletContainer .camping-left-col {
    gap: 10px !important;
    justify-content: flex-start !important;
}

#campingTabletContainer .camp-gm-inputs-grid {
    padding: 10px 16px !important;
}

#campingTabletContainer .camp-invisible-table {
    border-collapse: separate !important;
    border-spacing: 0 12px !important;
}

#campingTabletContainer .camp-invisible-table th {
    padding: 4px 4px 6px 4px !important;
    font-size: 19px !important;
}

#campingTabletContainer .camp-invisible-table tr {
    height: auto !important;
    border-bottom: none !important;
}

#campingTabletContainer .camp-invisible-table td.camp-act-cell {
    height: auto !important;
    min-height: 78px !important;
    padding: 12px 148px 12px 16px !important;
    vertical-align: middle !important;
}

#campingTabletContainer .camp-invisible-table .act-name {
    font-size: 21px !important;
    line-height: 1.2 !important;
    margin-bottom: 6px !important;
}

#campingTabletContainer [id^="label_dc_"],
#campingTabletContainer .camp-invisible-table .skill-name-large {
    font-size: 17px !important;
    line-height: 1.2 !important;
    padding: 3px 12px !important;
    margin-top: 0 !important;
}

#campingTabletContainer .camp-invisible-table td:not(.camp-act-cell) {
    height: auto !important;
    padding: 8px 4px !important;
}

#campingTabletContainer .camp-invisible-table input[type="radio"] {
    width: 32px !important;
    height: 32px !important;
}

/* Аккуратный отступ портретов внутри карточки, чтобы не касались рамок */
#campingTabletContainer .camp-assigned-allies-group {
    right: 12px !important;
    gap: 10px !important;
}

#campingTabletContainer .camp-assigned-ally-badge.is-leader .camp-assigned-ally-img {
    width: 58px !important;
    height: 58px !important;
}

#campingTabletContainer .camp-assigned-ally-badge.is-helper .camp-assigned-ally-img {
    width: 44px !important;
    height: 44px !important;
}
/* ============================================================================
   АДАПТАЦИЯ ПЛАНШЕТА ПРИВАЛА ДЛЯ ОКОННОГО РЕЖИМА БРАУЗЕРА (НЕ F11, <= 1000px)
   ============================================================================ */
@media (max-height: 1000px) {
    #campingTabletContainer {
        padding: 10px 18px !important;
        gap: 14px !important;
    }

    #campingTabletContainer .camping-left-col {
        gap: 6px !important;
    }

    #campingTabletContainer .camp-current-hex-banner {
        padding: 6px 12px !important;
        font-size: 18px !important;
    }

    #campingTabletContainer #campWeatherHost .w-shared-calendar-bar {
        padding: 4px 10px !important;
        font-size: 12px !important;
    }

    #campingTabletContainer .camping-region-bar {
        padding: 7px 12px !important;
        gap: 4px !important;
    }

    #campingTabletContainer .camp-param-label {
        font-size: 20px !important;
    }

    #campingTabletContainer #campEncounterTerrainLabel {
        font-size: 16px !important;
    }

    #campingTabletContainer .camp-gm-inputs-grid {
        padding: 6px 12px !important;
    }

    #campingTabletContainer .camp-invisible-table {
        border-spacing: 0 7px !important;
    }

    #campingTabletContainer .camp-invisible-table th {
        padding: 2px 4px 3px 4px !important;
        font-size: 17px !important;
    }

    #campingTabletContainer .camp-invisible-table td.camp-act-cell {
        min-height: 62px !important;
        padding: 8px 136px 8px 12px !important;
    }

    #campingTabletContainer .camp-invisible-table .act-name {
        font-size: 19px !important;
        margin-bottom: 4px !important;
    }

    #campingTabletContainer [id^="label_dc_"],
    #campingTabletContainer .camp-invisible-table .skill-name-large {
        font-size: 15px !important;
        padding: 2px 10px !important;
    }

    #campingTabletContainer .camp-invisible-table td:not(.camp-act-cell) {
        padding: 4px 2px !important;
    }

    #campingTabletContainer .camp-invisible-table input[type="radio"] {
        width: 28px !important;
        height: 28px !important;
    }

    #campingTabletContainer .camp-assigned-ally-badge.is-leader .camp-assigned-ally-img {
        width: 48px !important;
        height: 48px !important;
    }

    #campingTabletContainer .camp-assigned-ally-badge.is-helper .camp-assigned-ally-img {
        width: 38px !important;
        height: 38px !important;
    }

    #campingTabletContainer .camp-allies-dock {
        padding: 6px 10px !important;
        gap: 5px !important;
    }

    #campingTabletContainer .camp-allies-dock-title {
        font-size: 14px !important;
        padding-bottom: 3px !important;
    }
}
/* ============================================================================
   ТВ-МАСШТАБИРОВАНИЕ ПЛАНШЕТА КОРОЛЕВСТВА (#kingdomTabletContainer)
   ============================================================================ */
#kingdomTabletContainer {
    font-size: 18px !important;
}

/* 1. Верхняя панель подвкладок и кнопок управления ходом */
#kingdomTabletContainer .k-subtabs-bar .btn {
    font-size: 16px !important;
    padding: 8px 14px !important;
}

/* 2. Общая плашка календаря Голариона и погоды в шапке */
#kingdomTabletContainer .w-shared-calendar-bar {
    font-size: 17px !important;
    padding: 9px 14px !important;
}

#kingdomTabletContainer .w-shared-calendar-bar .btn,
#kingdomTabletContainer .w-shared-calendar-bar .w-btn-weather-summary,
#kingdomTabletContainer .w-shared-calendar-bar .w-btn-active-hazard {
    font-size: 15px !important;
    padding: 5px 11px !important;
    line-height: 1.2 !important;
}

/* 3. Заголовки секций, подписи полей и инпуты */
#kingdomTabletContainer .k-sec-title {
    font-size: 21px !important;
    margin-bottom: 12px !important;
}

#kingdomTabletContainer .k-lbl {
    font-size: 15px !important;
    margin-bottom: 5px !important;
}

#kingdomTabletContainer .k-inp,
#kingdomTabletContainer select.k-inp,
#kingdomTabletContainer textarea.k-inp {
    font-size: 18px !important;
    padding: 7px 10px !important;
}

/* 4. Карточки 4 характеристик королевства (Культура, Экономика, Лояльность, Стабильность) */
#kingdomTabletContainer .k-stat-card {
    padding: 12px 10px !important;
}

#kingdomTabletContainer .k-stat-name {
    font-size: 17px !important;
}

#kingdomTabletContainer .k-stat-mod {
    font-size: 32px !important;
}

#kingdomTabletContainer .k-stat-card button {
    font-size: 20px !important;
    padding: 3px 12px !important;
}

/* 5. Склады ресурсов, ОР (RP), XP, Беспорядки и Руины */
#kingdomTabletContainer .k-res-val,
#kingdomTabletContainer [id^="k_comm_val_"] {
    font-size: 22px !important;
}

#kingdomTabletContainer .k-panel {
    font-size: 17px !important;
    line-height: 1.45 !important;
}

#kingdomTabletContainer .k-panel .btn {
    font-size: 15px !important;
    padding: 6px 12px !important;
}

/* 6. Таблица навыков королевства */
#kingdomTabletContainer .k-skills-table th {
    font-size: 15px !important;
    padding: 8px 6px !important;
}

#kingdomTabletContainer .k-skills-table td {
    font-size: 18px !important;
    padding: 7px 6px !important;
}

#kingdomTabletContainer .k-skills-table .k-inp,
#kingdomTabletContainer .k-skills-table select {
    font-size: 16px !important;
    padding: 4px 6px !important;
}

/* 7. Адаптация под оконный режим браузера (не F11, <= 1000px) */
@media (max-height: 1000px) {
    #kingdomTabletContainer {
        font-size: 16px !important;
    }

    #kingdomTabletContainer .k-sec-title {
        font-size: 19px !important;
        margin-bottom: 8px !important;
    }

    #kingdomTabletContainer .k-lbl {
        font-size: 14px !important;
    }

    #kingdomTabletContainer .k-inp,
    #kingdomTabletContainer select.k-inp {
        font-size: 16px !important;
        padding: 5px 8px !important;
    }

    #kingdomTabletContainer .k-skills-table td {
        font-size: 16px !important;
        padding: 5px 5px !important;
    }
}
/* ============================================================================
   ПЛАШКА КАЛЕНДАРЯ И ПОГОДЫ В ТРЕКЕРЕ ИНИЦИАТИВЫ (#initiativeTabletContainer)
   ============================================================================ */
#initiativeTabletContainer .w-shared-calendar-bar {
    font-size: 16px !important;
    padding: 8px 14px !important;
    margin-bottom: 10px !important;
}

#initiativeTabletContainer .w-shared-calendar-bar .btn,
#initiativeTabletContainer .w-shared-calendar-bar .w-btn-weather-summary,
#initiativeTabletContainer .w-shared-calendar-bar .w-btn-active-hazard {
    font-size: 14px !important;
    padding: 4px 10px !important;
    line-height: 1.2 !important;
}
#initiativeTabletContainer .init-cards-scroll-list:not(.mode-bg3) {
    max-height: calc(100vh - 265px) !important;
}

#initiativeTabletContainer .w-combat-weather-banner {
    font-size: 16px !important;
    padding: 8px 14px !important;
}
/* ============================================================================
   АТМОСФЕРНЫЕ ВИЗУАЛЬНЫЕ ЭФФЕКТЫ ПОГОДЫ В ТРЕКЕРЕ ИНИЦИАТИВЫ
   ============================================================================ */
#initiativeTabletContainer {
    position: relative !important;
}

.init-weather-fx-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2000001;
    overflow: hidden;
}

/* 1. Дождь / Ливень */
.init-weather-fx-layer.fx-rain {
    background-image: repeating-linear-gradient(
            105deg,
            transparent 0px,
            transparent 18px,
            rgba(116, 185, 255, 0.22) 19px,
            transparent 21px
    );
    background-size: 120px 120px;
    animation: initRainFall 0.45s linear infinite;
}

@keyframes initRainFall {
    0%   { background-position: 0 0; }
    100% { background-position: -32px 120px; }
}

/* 2. Снег / Метель */
.init-weather-fx-layer.fx-snow {
    background-image:
            radial-gradient(3px 3px at 20px 30px, rgba(255,255,255,0.75), transparent),
            radial-gradient(4px 4px at 80px 70px, rgba(255,255,255,0.65), transparent),
            radial-gradient(2px 2px at 140px 20px, rgba(220,240,255,0.8), transparent);
    background-size: 180px 180px;
    animation: initSnowFall 3.5s linear infinite;
}

.init-weather-fx-layer.fx-blizzard {
    background-image:
            radial-gradient(3px 3px at 20px 30px, rgba(255,255,255,0.85), transparent),
            radial-gradient(5px 3px at 80px 70px, rgba(255,255,255,0.75), transparent);
    background-size: 140px 140px;
    background-color: rgba(200, 230, 255, 0.08);
    animation: initBlizzardFall 0.9s linear infinite;
}

@keyframes initSnowFall {
    0%   { background-position: 0 0; }
    100% { background-position: 40px 180px; }
}

@keyframes initBlizzardFall {
    0%   { background-position: 0 0; }
    100% { background-position: -140px 140px; }
}

/* 3. Туман */
.init-weather-fx-layer.fx-fog {
    background: radial-gradient(circle at 50% 50%, rgba(200, 214, 229, 0.14) 0%, rgba(131, 149, 167, 0.28) 100%);
    animation: initFogPulse 5s ease-in-out infinite alternate;
}

@keyframes initFogPulse {
    0%   { opacity: 0.55; }
    100% { opacity: 0.95; }
}

/* 4. Вспышка молнии при грозе */
@keyframes initLightningFlash {
    0%, 100% { background-color: transparent; }
    10%      { background-color: rgba(200, 230, 255, 0.45); }
    20%      { background-color: transparent; }
    30%      { background-color: rgba(255, 255, 255, 0.65); }
    50%      { background-color: transparent; }
}

.init-lightning-active {
    animation: initLightningFlash 0.75s ease-out;
}
#initiativeTabletContainer .w-combat-weather-reminder {
    font-size: 16px !important;
}

@media (max-height: 1000px) {
    #initiativeTabletContainer .w-shared-calendar-bar {
        padding: 5px 10px !important;
        margin-bottom: 6px !important;
        font-size: 14px !important;
    }

    #initiativeTabletContainer .w-combat-weather-reminder {
        padding: 5px 10px !important;
        margin-bottom: 6px !important;
        font-size: 14px !important;
    }
}
/* ============================================================================
   КОМПАКТНЫЙ БЛОК «БАЗОВЫЕ ПРОВЕРКИ / СЛ СЛУЧАЙНОЙ СЦЕНЫ» В ПРИВАЛЕ
   ============================================================================ */
#campingTabletContainer .camping-left-col {
    gap: 8px !important;
}

#campingTabletContainer .camping-region-bar {
    padding: 8px 14px !important;
    gap: 6px !important;
}

#campingTabletContainer .camp-param-box {
    min-height: 30px !important;
}

#campingTabletContainer .camp-param-label {
    font-size: 18px !important;
    line-height: 1.2 !important;
}

#campingTabletContainer #campEncounterTerrainLabel {
    font-size: 16px !important;
    margin-top: 2px !important;
    padding-top: 4px !important;
    border-top: 1px dashed rgba(138, 100, 33, 0.35) !important;
}

/* Компактное окошко с кнопками - и + */
#campingTabletContainer .camp-count-controls {
    padding: 2px 10px !important;
    gap: 10px !important;
    border-width: 1.5px !important;
}

#campingTabletContainer .camp-count-controls button {
    font-size: 22px !important;
    line-height: 1 !important;
    padding: 0 4px !important;
}

/* Компактные цифры 2 и 12 (включая плашку СЛ случайной сцены) */
#campingTabletContainer #campBaseChecksVal,
#campingTabletContainer #campCheckModVal {
    font-size: 20px !important;
    line-height: 1.1 !important;
    min-width: 28px !important;
    padding: 2px 8px !important;
}
/* ============================================================================
   ВЫРАВНИВАНИЕ «СЛ СЛУЧАЙНОЙ СЦЕНЫ» И «ТИП МЕСТНОСТИ» В ОДНУ СТРОЧКУ (ПРИВАЛ)
   ============================================================================ */
#campingTabletContainer .camping-region-bar .camp-param-box {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
}

/* Левый блок с заголовком «СЛ случайной сцены» и типом местности в одну строку */
#campingTabletContainer .camping-region-bar .camp-param-box > div:first-child {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px 14px !important;
    flex: 1 !important;
}

/* Плашка «Тип местности: 🌾 Равнины (СЛ 12)» в одну линию с заголовком */
#campingTabletContainer #campEncounterTerrainLabel {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 3px 10px !important;
    background: rgba(4, 9, 5, 0.85) !important;
    border: 1px solid #8a6421 !important;
    border-radius: 5px !important;
    font-size: 18px !important;
    color: #ffd875 !important;
    white-space: nowrap !important;
}

/* Защита правого блока кнопок (- 12 +) от сжатия */
#campingTabletContainer .camping-region-bar .camp-count-controls {
    flex-shrink: 0 !important;
}
/* ============================================================================
   ФИКС ПРИВАЛА: ЗАЗОР МЕЖДУ ПОРТРЕТАМИ И КОМПАКТНАЯ ШАПКА ДЛЯ ДОКА СОЮЗНИКОВ
   ============================================================================ */

/* 1. Горизонтальный зазор между основным героем и помощником в блоке действия */
#campingTabletContainer .camp-assigned-allies-group {
    right: 14px !important;
    gap: 14px !important;
}

/* Чуть увеличиваем правый отступ текста действия, чтобы название не наезжало на портреты */
#campingTabletContainer .camp-invisible-table td.camp-act-cell {
    padding-right: 175px !important;
}

/* 2. Компактные отступы верхней панели Привала, чтобы нижний док союзников всегда влезал */
#campingTabletContainer .camping-left-col {
    gap: 6px !important;
    justify-content: flex-start !important;
}

#campingTabletContainer .camp-current-hex-banner {
    padding: 7px 14px !important;
    font-size: 20px !important;
}

#campingTabletContainer #campWeatherHost .w-shared-calendar-bar,
#campingTabletContainer #campWeatherHost > div {
    padding: 4px 10px !important;
    margin-bottom: 5px !important;
    font-size: 13px !important;
}

#campingTabletContainer .camping-region-bar {
    padding: 8px 14px !important;
    gap: 6px !important;
}

#campingTabletContainer .camp-param-label {
    font-size: 20px !important;
}

#campingTabletContainer #campEncounterTerrainLabel {
    font-size: 17px !important;
}

#campingTabletContainer .camp-invisible-table {
    border-spacing: 0 7px !important;
}

#campingTabletContainer .camp-invisible-table td.camp-act-cell {
    min-height: 76px !important;
    padding-top: 9px !important;
    padding-bottom: 9px !important;
}

#campingTabletContainer .camp-allies-dock {
    margin-top: auto !important;
    padding: 8px 12px !important;
}
/* ============================================================================
   ОДНА СТРОКА ДЛЯ СЛ СЛУЧАЙНОЙ СЦЕНЫ И ТИПА МЕСТНОСТИ + ОТСТУП МЕЖДУ СОЮЗНИКАМИ
   ============================================================================ */

/* 1. Выстраиваем «🎲 СЛ случайной сцены» и «Тип местности» строго в одну строку */
#campingTabletContainer .camping-region-bar .camp-param-box:has(#campEncounterTerrainLabel),
#campingTabletContainer .camping-region-bar .camp-param-box:has(#campCheckModVal) {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
}

#campingTabletContainer #campEncounterTerrainLabel {
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
    margin: 0 !important;
    margin-left: auto !important;
    padding: 3px 10px !important;
    background: rgba(4, 9, 5, 0.85) !important;
    border: 1px solid #8a6421 !important;
    border-radius: 4px !important;
    font-size: 18px !important;
    color: #ffd875 !important;
}

/* 2. Увеличиваем горизонтальный отступ между 6 портретами в нижнем доке союзников */
#campingTabletContainer .camp-allies-grid {
    gap: 18px !important;
    padding: 4px 2px !important;
}

/* 3. Увеличиваем горизонтальный отступ между основным героем и помощником в блоках действий */
#campingTabletContainer .camp-assigned-allies-group {
    gap: 16px !important;
}

#campingTabletContainer .camp-invisible-table td.camp-act-cell {
    padding-right: 178px !important;
}

/* Базовый плавный переход для рамки цитаты */
.init-focus-quote-shield {
    transition: all 0.35s ease;
}

/* 🌟 Натуральная 20 — яркое золотое сияние */
.init-focus-quote-shield.quote-state-nat20 {
    border-color: #ffd700 !important;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.16), rgba(35, 28, 10, 0.92)) !important;
    box-shadow: 0 0 22px rgba(255, 215, 0, 0.45), inset 0 0 12px rgba(255, 215, 0, 0.25) !important;
}

/* 💀 При смерти (dying) — тревожная красная пульсация */
.init-focus-quote-shield.quote-state-dying {
    border-color: #ff3838 !important;
    background: linear-gradient(135deg, rgba(180, 20, 20, 0.25), rgba(25, 8, 8, 0.94)) !important;
    animation: initQuoteDyingPulse 1.4s infinite ease-in-out;
}

@keyframes initQuoteDyingPulse {
    0%, 100% {
        box-shadow: 0 0 12px rgba(255, 56, 56, 0.35), inset 0 0 8px rgba(255, 56, 56, 0.2);
    }
    50% {
        box-shadow: 0 0 28px rgba(255, 56, 56, 0.85), inset 0 0 18px rgba(255, 56, 56, 0.45);
    }
}

/* 💫 Распластан (prone) — янтарно-оранжевый акцент */
.init-focus-quote-shield.quote-state-prone {
    border-color: #ff9f1a !important;
    background: linear-gradient(135deg, rgba(255, 159, 26, 0.14), rgba(28, 20, 10, 0.92)) !important;
    box-shadow: 0 0 16px rgba(255, 159, 26, 0.3) !important;
}

/* 🤡 Натуральная 1 — приглушенный холодно-серый тон */
.init-focus-quote-shield.quote-state-nat1 {
    border-color: #747d8c !important;
    background: linear-gradient(135deg, rgba(116, 125, 140, 0.14), rgba(16, 18, 22, 0.94)) !important;
    box-shadow: 0 0 14px rgba(116, 125, 140, 0.25) !important;
}
