html, body {
        margin: 0;
        padding: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    /* Информация о персонаже */
#playerInfo {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10;

    width: 340px;
    max-width: calc(100vw - 40px);
    box-sizing: border-box;
    padding: 12px 15px;

    background: rgba(20, 23, 29, 0.92);
    border: 2px solid #777;
    border-radius: 10px;

    color: #fff;
    font-family: Arial, sans-serif;
}

/* Уровень и имя */
#playerInfoHeader {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

/* Анимируемый процент заполнения опыта */
@property --experience-progress {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 0%;
}

#playerLevel {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;
    flex-shrink: 0;

    --experience-progress: 0%;
    transition: --experience-progress 0.5s ease-out;

    background: conic-gradient(
        from 0deg,
        #383838 0%,
        #383838 var(--experience-progress),
        #555 var(--experience-progress),
        #555 100%
    );

    border: 1px solid #aaa;
    border-radius: 6px;

    font-size: 24px;
    font-weight: bold;
}

#playerName {
    font-size: 22px;
    font-weight: bold;
    overflow-wrap: anywhere;
}

/* Полоски характеристик */
.playerStat {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 14px;
}

.playerStatBar {
    position: relative;
    grid-column: 2;
    grid-row: 1;

    height: 16px;
    background: #171a1e;
    border: 1px solid #888;
    border-radius: 4px;
    overflow: hidden;
}

.playerStat > span:last-child {
    position: relative;
    grid-column: 2;
    grid-row: 1;
    z-index: 1;
    pointer-events: none;
}

.playerStatBar > div {
    height: 100%;
    width: 0%;
    transition: width 0.2s;
}

#playerHpFill {
    background: linear-gradient(#ff5555, #c60000);
}

#playerMpFill {
    background: linear-gradient(#40baff, #0063bd);
}

#playerEnFill {
    background: linear-gradient(#ffe65b, #e3a900);
}

#playerHpValue,
#playerMpValue,
#playerEnValue {
    text-align: center;
    color: #000;
    font-weight: bold;
    white-space: nowrap;
}

/* Панель быстрого доступа */
#quickBar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;

    display: flex;
    gap: 4px;
    padding: 10px;

    background: rgba(20, 23, 29, 0.92);
    border: 1px solid #777;
    border-radius: 10px;

    max-width: calc(100vw - 20px);
    box-sizing: border-box;
}

/* Дополнительная панель быстрого доступа */
#quickBarExtra {
    position: fixed;
    bottom: 92px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;

    display: flex;
    gap: 4px;
    padding: 10px;

    background: rgba(20, 23, 29, 0.92);
    border: 1px solid #777;
    border-radius: 10px;

    max-width: calc(100vw - 20px);
    box-sizing: border-box;
}

/* Ячейки дополнительной панели */
.quickSlotExtra {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    overflow: hidden;
    box-sizing: border-box;

    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 4px;

    background: #30343c;
    border: 1px solid #777;
    border-radius: 4px;

    color: #c6c6c6;
    font-family: Arial, sans-serif;
    font-size: 12px;
    user-select: none;
}

/* Ячейки способностей */
.quickSlot {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    overflow: hidden;
    box-sizing: border-box;

    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 4px;

    background: #30343c;
    border: 1px solid #777;
    border-radius: 4px;

    color: #c6c6c6;
    font-family: Arial, sans-serif;
    font-size: 12px;
    user-select: none;
}

/* Окно инвентаря */
#inventoryWindow {
    position: fixed;
    top: 180px;
    left: 20px;
    transform: none;
    z-index: 20;

    width: 650px;
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    overflow: auto;
    box-sizing: border-box;

    padding: 15px;
    background: rgba(20, 23, 29, 0.96);
    border: 2px solid #777;
    border-radius: 10px;

    color: #fff;
    font-family: Arial, sans-serif;
}

#inventoryWindow[hidden] {
    display: none;
}

/* Заголовок окна */
#inventoryHeader {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;

    font-size: 20px;
    font-weight: bold;
}

#inventoryCloseButton {
    position: absolute;
    right: 0;
    background: none;
    border: none;
    color: #ccc;
    font-size: 26px;
    cursor: pointer;
}

/* Две части окна */
#inventoryContent {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    container-type: inline-size;

    --slot-size: calc((50cqw - 18px) / 5);
}

.inventorySectionTitle {
    margin-bottom: 12px;
    font-size: 16px;
    color: #e4bd72;
}

/* Слоты экипировки */
#equipmentSlots {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, var(--slot-size));
    grid-template-rows: repeat(5, var(--slot-size));
    gap: 8px;
    justify-content: center;

    padding-top: 70px;
    padding-bottom: 70px;
}

#equipmentSilhouette {
    position: absolute;
    inset: 0;
    pointer-events: none;

    background-image: url('/images/ui/Silhouette.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: auto 100%;
}

.equipmentSlot[data-slot="helmet"] {
    grid-column: 2;
    grid-row: 1;
    transform: translateY(-95px);
}

.equipmentSlot[data-slot="amulet"] {
    grid-column: 2;
    grid-row: 1;
    transform: translateY(-15px);
}

.equipmentSlot[data-slot="chest"] {
    grid-column: 2;
    grid-row: 2;
    transform: translateY(-25px);
}

.equipmentSlot[data-slot="gloves"] {
    grid-column: 3;
    grid-row: 3;
    transform: translateX(30px);
}

.equipmentSlot[data-slot="ring1"] {
    grid-column: 1;
    grid-row: 2;
    transform: translateX(-20px);
}

.equipmentSlot[data-slot="ring2"] {
    grid-column: 3;
    grid-row: 2;
    transform: translateX(20px);
}

.equipmentSlot[data-slot="legs"] {
    grid-column: 2;
    grid-row: 3;
}

.equipmentSlot[data-slot="boots"] {
    grid-column: 2;
    grid-row: 5;
}

.equipmentSlot[data-slot="weapon"] {
    grid-column: 1;
    grid-row: 1;
    transform: translate(-30px, -55px);
}

.equipmentSlot[data-slot="shield"] {
    grid-column: 3;
    grid-row: 1;
    transform: translate(30px, -55px);
}

.equipmentSlot {
    position: relative;
    z-index: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    aspect-ratio: 1;
    min-height: 0;
    padding: 5px;
    box-sizing: border-box;

    background: #30343c;
    border: 1px solid #777;
    border-radius: 4px;

    color: #aaa;
    font-size: 13px;
    text-align: center;
}

/* Сетка инвентаря: 8 рядов по 5 ячеек */
#inventorySlots {
    display: grid;
    grid-template-columns: repeat(5, var(--slot-size));
    gap: 4px;
}

.inventorySlot {
    width: var(--slot-size);
    height: var(--slot-size);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #30343c;
    border: 1px solid #777;
    border-radius: 4px;
    box-sizing: border-box;
    position: relative;
}

.inventorySlot.locked {
    background: #181a1e;
    border-color: #505050;
}

/* Правая панель интерфейса */
#rightInterfacePanel {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20;

    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

/* Окно характеристик персонажа */
#characterStatsWindow {
    position: fixed;
    top: 72px;
    right: 20px;
    z-index: 20;

    width: 400px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    box-sizing: border-box;

    padding: 15px;
    background: rgba(20, 23, 29, 0.96);
    border: 2px solid #777;
    border-radius: 10px;

    color: #fff;
    font-family: Arial, sans-serif;
}

#characterStatsWindow[hidden] {
    display: none;
}

/* Заголовок окна характеристик */
#characterStatsHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;

    font-size: 16px;
    font-weight: bold;
}

#characterStatsCloseButton {
    background: none;
    border: none;
    color: #ccc;
    font-size: 24px;
    cursor: pointer;
}

/* Разделы характеристик */
.characterStatsSection {
    padding: 8px 0;
    border-top: 1px solid #555;
}

.characterStatsSectionTitle {
    margin-bottom: 8px;
    color: #e4bd72;
    font-size: 14px;
    font-weight: bold;
}

/* Строки характеристик */
.characterStatsRow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;

    padding: 3px 0;
    font-size: 14px;
}

.characterStatsRow span:last-child {
    text-align: right;
    white-space: nowrap;
}

.characterStatsColumns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.characterStatsColumn {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

/* Большая карта мира */
#worldMapLargeWindow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(1000px, calc(100vw - 40px), calc(100vh - 40px));
    background: rgba(20, 25, 30, 0.96);
    border: 2px solid #555;
    border-radius: 8px;
    z-index: 1100;
    overflow: hidden;
}

#worldMapLargeWindow[hidden] {
    display: none;
}

#worldMapLargeContent {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
}

#worldMapLargeTransform {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: center center;
    cursor: default;
    user-select: none;
}

#worldMapLargeTransform.dragging {
    cursor: grabbing;
}

#worldMapLargeImage {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    user-select: none;
    -webkit-user-drag: none;
}

#worldMapCollapseButton {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 2;
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 25, 30, 0.7);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
}

#worldMapCollapseButton:hover {
    background: rgba(70, 80, 90, 0.9);
}

/* Слой дорог на большой карте мира */
#worldMapLargeRoads {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: visible;
}

/* Слой городов на большой карте */
#worldMapLargeCities {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* Слой локаций на большой карте */
#worldMapLargeLocations {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* Названия локаций на большой карте */
.worldMapLocationName {
    display: none;
    color: #ffffff;
    font-size: 12px;
    white-space: nowrap;
    text-align: center;
    text-shadow: 0 1px 3px #000000;
}

/* Показываем названия при увеличении карты */
#worldMapLargeTransform.showLocationNames .worldMapLocationName {
    display: block;
}

/* Названия городов на большой карте */
.worldMapCityName {
    font-size: 12px;
}

#worldMapLargePlayerMarker {
    position: absolute;
    width: 6px;
    height: 6px;
    z-index: 2;
    background: #ff3030;
    border: 1px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 4px red;
    pointer-events: none;
}

/* Окно карты мира */
#worldMapWindow {
    position: fixed;
    right: 15px;
    bottom: 15px;
    width: min(300px, calc(100vw - 30px), calc(100vh - 580px));
    background: rgba(20, 25, 30, 0.96);
    border: 2px solid #555;
    border-radius: 8px;
    z-index: 1000;
    overflow: hidden;
}

#worldMapWindow[hidden] {
    display: none;
}

#worldMapHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    color: white;
    font-size: 18px;
    border-bottom: 1px solid #555;
}

#worldMapExpandButton {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 2;
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 25, 30, 0.7);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
}

#worldMapExpandButton:hover {
    background: rgba(70, 80, 90, 0.9);
}

#worldMapCloseButton {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 2;
    width: 26px;
    height: 26px;
    padding: 0;
    background: rgba(20, 25, 30, 0.7);
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 22px;
    cursor: pointer;
}

#worldMapContent {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
}

#worldMapImage {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
}

/* Слой значков городов на маленькой карте */
#worldMapCities {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

#worldMapPlayerMarker {
    position: absolute;
    width: 6px;
    height: 6px;
    z-index: 2;
    background: #ff3030;
    border: 1px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 4px red;
    pointer-events: none;
}

#worldMapCoordinates {
    display: none;
}

/* Навигационный компас */
#navigationCompass {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 70px;
    z-index: 1000;
    pointer-events: none;
}

/* Область шкалы с плавным исчезновением по краям */
#navigationCompassScale {
    position: absolute;
    inset: 0;
    overflow: hidden;

    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 15%,
        black 85%,
        transparent 100%
    );

    mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 15%,
        black 85%,
        transparent 100%
    );
}

/* Подвижные деления и буквы */
#navigationCompassMarks {
    position: absolute;
    width: 100%;
    height: 100%;
}

/* Неподвижный золотистый указатель */
#navigationCompassPointer {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 14px solid #e8b866;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

/* Кнопки подтверждения смены персонажа */
#confirmCharacterChange,
#cancelCharacterChange {
    min-width: 125px;
    height: 38px;
    padding: 0 12px;

    background: linear-gradient(#2c2b30, #222126);
    border: 1px solid #6e6049;
    border-radius: 0;

    color: #d9ccb5;
    font-family: Georgia, serif;
    font-size: 15px;
    font-weight: bold;

    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

#confirmCharacterChange:hover,
#cancelCharacterChange:hover {
    background: linear-gradient(#3b393d, #2c2a2e);
    border-color: #b59a6b;
}

#confirmCharacterChange:active,
#cancelCharacterChange:active {
    background: #1b1a1e;
}

#confirmCharacterChange:disabled,
#cancelCharacterChange:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Окно настроек игры */
#gameSettingsWindow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1100;

    width: 480px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-sizing: border-box;

    padding: 20px 25px;

    background: rgba(20, 23, 29, 0.97);
    border: 2px solid #77705d;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);

    color: #d9ccb5;
    font-family: Georgia, serif;
}

#gameSettingsWindow[hidden] {
    display: none;
}

/* Заголовок */
#gameSettingsHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

#gameSettingsHeader h2 {
    margin: 0;
    color: #e5d5b5;
    font-size: 24px;
}

#gameSettingsClose {
    padding: 0 5px;
    background: transparent;
    border: none;
    color: #b5a06c;
    font-size: 28px;
    cursor: pointer;
}

#gameSettingsClose:hover {
    color: #ffffff;
}

/* Разделы настроек */
.gameSettingsSection {
    margin-bottom: 22px;
}

.gameSettingsSection h3 {
    margin: 0 0 15px;
    padding-bottom: 7px;
    border-bottom: 1px solid #554b3c;
    color: #b5a06c;
    font-size: 18px;
}

.gameSettingsSection label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 13px;
    font-size: 14px;
    cursor: pointer;
}

/* Ползунки громкости */
.gameSettingsSection input[type="range"] {
    width: 170px;
    accent-color: #b5a06c;
    cursor: pointer;
}

/* Чекбоксы */
.gameSettingsSection input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0 10px 0 0;
    accent-color: #b5a06c;
    cursor: pointer;
}

.gameSettingsSection label:has(input[type="checkbox"]) {
    justify-content: flex-start;
}

/* Выбор камеры */
#settingCameraMode {
    width: 230px;
    padding: 7px 9px;
    box-sizing: border-box;

    background: #222126;
    border: 1px solid #6e6049;
    color: #d9ccb5;
    font-family: Georgia, serif;
    font-size: 14px;
    cursor: pointer;
}

/* Кнопки сохранения и отмены */
#gameSettingsButtons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

#gameSettingsButtons button {
    min-width: 125px;
    height: 38px;
    padding: 0 12px;

    background: linear-gradient(#2c2b30, #222126);
    border: 1px solid #6e6049;
    border-radius: 0;

    color: #d9ccb5;
    font-family: Georgia, serif;
    font-size: 15px;
    font-weight: bold;

    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

#gameSettingsButtons button:hover {
    background: linear-gradient(#3b393d, #2c2a2e);
    border-color: #b59a6b;
}

#gameSettingsButtons button:active {
    background: #1b1a1e;
}

/* Выпадающее игровое меню */
/* Контейнер игрового меню */
#rightInterfaceButtons {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

/* Кнопка игрового меню */
#gameMenuButton {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;
    padding: 0;

    background: rgba(25, 29, 35, 0.95);
    border: 1px solid #77705d;
    border-radius: 6px;

    color: #dddddd;
    font-size: 26px;
    line-height: 1;

    cursor: pointer;

    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    transition: background 0.15s, border-color 0.15s;
}

#gameMenuButton:hover {
    background: rgba(55, 60, 68, 0.95);
    border-color: #b5a06c;
}

#gameMenuButton:active {
    background: rgba(75, 80, 88, 0.95);
}

#gameMenuDropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    display: flex;
    flex-direction: column;
    padding: 6px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #555;
    border-radius: 6px;
    z-index: 1000;
}

#gameMenuDropdown[hidden] {
    display: none;
}

#gameMenuDropdown button {
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: #eee;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
}

#gameMenuDropdown button:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Окно смерти персонажа */
#characterDeathWindow {
    position: fixed;
    inset: 0;
    z-index: 2000;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;

    pointer-events: none;
}

#characterDeathWindow[hidden] {
    display: none;
}

/* Надпись о смерти */
#characterDeathTitle {
    color: #b03030;
    font-family: Georgia, serif;
    font-size: 48px;
    font-weight: bold;
    text-align: center;
    text-shadow: 2px 2px 8px #000000;
    user-select: none;
}

/* Кнопки возрождения */
#resurrectionButton,
#resurrectionOnSpotButton {
    min-width: 250px;
    height: 45px;
    padding: 0 20px;

    background: linear-gradient(#2c2b30, #222126);
    border: 1px solid #6e6049;
    border-radius: 0;

    color: #d9ccb5;
    font-family: Georgia, serif;
    font-size: 17px;
    font-weight: bold;

    cursor: pointer;
    pointer-events: auto;

    transition: background 0.15s, border-color 0.15s;
}

#resurrectionButton:hover,
#resurrectionOnSpotButton:hover {
    background: linear-gradient(#3b393d, #2c2a2e);
    border-color: #b59a6b;
}

#resurrectionButton:active,
#resurrectionOnSpotButton:active {
    background: #1b1a1e;
}

#resurrectionButton:disabled,
#resurrectionOnSpotButton:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Затемнение экрана при возрождении */
#resurrectionFade {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: #000000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease-in-out;
}

#resurrectionFade[hidden] {
    display: none;
}

#resurrectionFade.visible {
    opacity: 1;
}

/* Направление взгляда камеры на картах */
#worldMapPlayerMarker::after,
#worldMapLargePlayerMarker::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    transform:
    translate(-50%, -50%)
    rotate(var(--camera-angle, 0deg))
    translateY(-10px)
    rotate(45deg);
    transform-origin: center;
    pointer-events: none;
}

/* Игровой чат */
#chatWindow {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 1000;

    width: 420px;
    height: 280px;
    min-width: 280px;
    min-height: 160px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    box-sizing: border-box;

    display: flex;
    flex-direction: column;

    background: rgba(20, 23, 29, 0.82);
    border: 1px solid #77705d;
    border-radius: 6px;

    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 13px;
}

/* История сообщений */
#chatHistory {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;

    padding: 8px 10px;
    overflow-wrap: anywhere;
    scrollbar-width: thin;
    scrollbar-color: #77705d transparent;
}

/* Отдельное сообщение */
.chatMessage {
    margin-bottom: 3px;
    line-height: 1.35;
}

/* Цвета каналов */
.chatMessage[data-channel="general"] {
    color: #ffffff;
}

.chatMessage[data-channel="whisper"] {
    color: #b65acb;
}

.chatMessage[data-channel="party"] {
    color: #8cde7c;
}

.chatMessage[data-channel="guild"] {
    color: #69cfe8;
}

.chatMessage[data-channel="trade"] {
    color: #f18bc0;
}

.chatMessage[data-channel="vip"] {
    color: #f2c45a;
}

.chatMessage[data-channel="admin"] {
    color: #ff9c4d;
}

.chatMessage[data-channel="system"] {
    color: #aaaaaa;
}

/* Вкладки чата */
#chatTabs {
    display: flex;
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;

    border-top: 1px solid #555;
    border-bottom: 1px solid #555;
}

#chatTabs::-webkit-scrollbar {
    display: none;
}

.chatTab {
    flex: 1 0 auto;
    min-width: 0;
    padding: 6px 8px;

    background: rgba(35, 38, 44, 0.9);
    border: none;
    border-right: 1px solid #555;

    color: #bbbbbb;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
}

.chatTab:last-child {
    border-right: none;
}

.chatTab:hover {
    background: #41454d;
}

.chatTab.active {
    background: #665638;
    color: #ffffff;
}

.chatTab[hidden] {
    display: none;
}

/* Строка ввода */
#chatInputRow {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 8px;
    padding: 6px 8px;
}

#chatInput {
    flex: 1;
    min-width: 0;
    padding: 5px 7px;

    background: rgba(10, 12, 16, 0.85);
    border: 1px solid #666;
    border-radius: 3px;

    color: #ffffff;
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    outline: none;
}

#chatInput:focus {
    border-color: #b5a06c;
}

/* Счётчик символов */
#chatCharacterCounter {
    flex-shrink: 0;
    color: #aaaaaa;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

/* Область изменения размеров окна */
#chatResizeHandle {
    position: absolute;
    top: 0;
    right: 0;
    width: 18px;
    height: 18px;
    z-index: 2;

    cursor: nesw-resize;
}

#chatResizeHandle::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;

    width: 7px;
    height: 7px;

    border-top: 2px solid #b5a06c;
    border-right: 2px solid #b5a06c;
}

/* Глобальные уведомления администрации */
#globalAnnouncement {
    position: fixed;
    top: 35px;
    left: 50%;
    transform: translate(-50%, -15px);

    max-width: calc(100vw - 40px);
    padding: 12px 28px;

    background: linear-gradient(
        to bottom,
        rgba(48, 35, 29, 0.95),
        rgba(25, 19, 17, 0.95)
    );

    border: 1px solid #c88638;
    border-radius: 5px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.65);

    color: #ffa500;
    font-family: Georgia, serif;
    font-size: 17px;
    text-align: center;
    overflow-wrap: anywhere;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        visibility 0.3s ease;

    z-index: 20000;
}

#globalAnnouncement.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* Панель выбранного таргета */
#targetStatusBar {
    position: fixed;
    top: 85px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    box-sizing: border-box;
    z-index: 1000;
    pointer-events: none;

    background: rgba(20, 23, 29, 0.9);
    border: 1px solid #6e6049;
    border-radius: 4px;
    overflow: hidden;
}

#targetStatusBar[hidden],
#targetHealthBar[hidden] {
    display: none;
}

#targetStatusName {
    padding: 8px 12px;
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
}

#targetHealthBar {
    height: 7px;
    background: #331515;
}

#targetHealthFill {
    width: 100%;
    height: 100%;
    background: #cc3030;
}

/* Открывающиеся окна всегда находятся поверх чата */
#chatWindow {
    z-index: 100;
}

#inventoryWindow,
#characterStatsWindow,
#gameSettingsWindow,
#worldMapWindow {
    z-index: 1200;
}

/* Большая карта остаётся выше обычных окон */
#worldMapLargeWindow {
    z-index: 1300;
}

/* Области захвата окон */
#inventoryHeader,
#characterStatsHeader,
#gameSettingsHeader {
    cursor: grab;
    user-select: none;
    touch-action: none;
}

#inventoryHeader:active,
#characterStatsHeader:active,
#gameSettingsHeader:active {
    cursor: grabbing;
}

/* Область захвата миникарты между её кнопками */
#worldMapDragHandle {
    position: absolute;
    top: 0;
    left: 42px;
    right: 40px;
    height: 36px;
    z-index: 3;
    cursor: grab;
    touch-action: none;
}

#worldMapDragHandle:active {
    cursor: grabbing;
}