body,
html {
    margin: 0;
    padding: 0;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    background-color: #000;
    color: #fff;
    height: 100%;
    overflow: hidden;
    /* Отключаем скролл для body */
    display: flex;
    flex-direction: column;
}

a {
    color: #FFF;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #111;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
    /* Фиксируем высоту шапки */
    min-height: 32px;
}

.logo-menu {
    display: flex;
    align-items: center;
}

.menu-toggle {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    margin-right: 10px;
}

.sidebar a{
    cursor: pointer;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    position: relative;
    width: 40px;
}

.logo img {
    height: 40px;
    position: absolute;
    top: -20px;
}

.back-but {
    width: 50px;
    margin-left: 20px;
}

.back-but a {
    color: #999;
    text-decoration: none;
    border-radius: 3px;
    border: 1px Solid #777;
    padding: 5px 8px 8px 8px;
}

.section-title {
    font-size: 18px;
}

.settings-icon {
    font-size: 24px;
    cursor: pointer;
}

.container {
    display: flex;
    flex-grow: 1;
    /* Занимаем все доступное пространство */
    overflow: hidden;
}

.sidebar {
    width: 350px;
    background-color: #111;
    border-right: 1px solid #333;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    /* Устанавливаем вертикальное расположение элементов */
    justify-content: space-between;
    /* Размещаем элементы по вертикали с пространством между ними */
    padding-top: 20px;
    z-index: 9999;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    padding: 10px 20px;
}

.sidebar li a {
    color: #fff;
    text-decoration: none;
}

.uinfo {
    padding: 10px 20px;
    background-color: #222;
    /* Цвет фона для блока авторизации */
    border-top: 1px solid #333;
    /* Разделительная линия сверху */
    color: #fff;
}

.search-form select{
    width: 90px;
    margin-right: 10px;
    height: 29px;
}

.content {
    flex-grow: 1;
    overflow-y: auto;
    /* Скролл только для основного контента */
    padding: 5px 20px;
}

.content-inner {
    /* max-width: 800px; */
    margin: 0 auto;
    /* padding-bottom: 50px; */
    height: 100%;
}

.textinfo div,
.textinfo li {
    margin-bottom: 5px;
}
.textinfo .row{
    display: flex;
    flex-direction: row;
    justify-content: center;
}
.textinfo .col{
    display: flex;
    flex-direction: column;
    max-width: 510px;
    margin-right: 100px;
}
.textinfo .col img{
    width: 100%;
}
.textinfo .col > div{
    margin-bottom: 50px;
}

.footer {
    background-color: #111;
    color: #fff;
    text-align: center;
    border-top: 1px solid #333;
    flex-shrink: 0;
    /* Фиксируем высоту подвала */
    font-size: 10px;
}

.footer p {
    font-size: 12px;
}

.mb0{
    margin-bottom: 0px !important;
}

a.active {
    font-weight: bold;
}


/* page list */
.cover-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 20px;
}

.cover_item {
    width: 256px;
    height: auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    background: linear-gradient(to bottom, rgba(13, 21, 24, 1),rgba(13, 21, 24, 1) 90%, rgba(13, 21, 24, 0));
    border-radius: 5px;
}

.cover_item img {
    width: 100%;
    height: 256px;
    object-fit: cover;
    display: block;
}

.cover_item_title {
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
    color: #fff;
    word-wrap: break-word;
    max-width: 100%;
}

.cover_item .addinfo{
    position: relative;
}
.cover_item .addinfo > div{
    position: absolute;
    top: 0px;
    width: calc(100% - 10px);
    font-size: 12px;
    background: linear-gradient(to top, rgba(13, 21, 24, 0),rgba(13, 21, 24, 1), rgba(13, 21, 24, 1));
    padding: 5px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
.cover_item .addinfo svg {
    height: 10px;
}
.cover_item a{
    text-decoration: none;
}

/* play area */
.play_info_area {
    display: flex;
    flex-direction: row;
    justify-content: center;
    margin-bottom: 0 !important;
}

.play_info_area>* {
    padding: 20px;
}

.play_info_area>div>div {
    margin-bottom: 10px;
}
.play_info_area>div>div:last-child{
    margin-bottom: 0;
}
.play_info_area .header {
    font-size: 20px;
    font-weight: bold;
    padding: 5px 0;
}

.play_info_area .sub-header {
    font-weight: bold;
    background-color: #333;
    padding: 5px 10px;
}

.play_info_area .cover {
    width: 33vw;
    height: auto;
    overflow: hidden;
}

.play_info_area .cover img {
    width: 100%;
    height: 512px;
    object-fit: cover;
    display: block;
}

.play_info_area .history {
    display: flex;
    flex-direction: column;
    /* height: calc(100vh - 155px); */
    flex-grow: 1;
    overflow-y: auto;
}

.play_info_area .history .list {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 10px;
    scrollbar-width: thin;
}

.play_info_area .history .list>* {
    margin: 10px 0;
}

/* общие стили*/
.buts {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-grow: 0;
}

.buts>div {
    padding: 10px 20px;
    margin-right: 10px;
    /* margin-bottom: 5px; */
    cursor: pointer;
    font-size: 16px;
    /* background-color: none; */
    border: 1px solid #333;
    font-weight: bold;
}

.buts>div:hover {
    background-color: #333;
    border-color: #777;
}


.play_info_area .history .a {
    border-left: 2px Solid #FFF;
    padding-left: 10px;
}

.play_info_area .history .img {
    text-align: center;
}

.play_info_area .history .img img {
    max-width: 100%;
    max-height: 40vh;
}

.play_info_area .history .u {
    padding-right: 10px;
}

.play_info_area .history .u::before {
    content: ">";
    margin-right: 5px;
    font-size: 16px;
    font-weight: bold;
}

.play_info_area .history .hr {
    border-top: 1px Solid #FFF;
}

.play_info_area .history .help {
    border-radius: 5px;
    border:1px Solid #005741;
    background: linear-gradient(30deg, #000000 0%, #000500 50%, #000000 100%);
    font-size: 14px;
    font-family: monospace;
}
.play_info_area .history .help > div{
    margin-bottom: 8px;
    margin-top: 8px;
    line-height: 16px;
}

.play_info_area .info {
    min-width: 30%;
    overflow-y: scroll;
    height: calc(100vh - 155px);
    display: relative;
}

.user-input {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    align-content: stretch;
    border-radius: 28px;
    border: 1px Solid #777;
    overflow: hidden;
    min-height: 41px;
}

.user-input input {
    width: 100%;
    padding: 5px;
    margin-right: 10px;
    flex-grow: 1;
    font-size: 14px;
    outline: none;
    background-color: transparent;
    border-color: transparent;
    color: white;
}

.user-input .mode-change{
    width: 50px;
    cursor: pointer;
    position: relative;
}

.user-input .mode-change img{
    width: 24px;
    height: 24px;
    filter: invert(100%);
    margin-left: 30%;
    margin-top: 20%;
}

.user-input .but{
    border: none;
    margin-right: 0px;
}
.user-input .but:hover{
    border: none;
    background-color: #333;
    border-color: #777;
}

.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.npcs {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.npcs>div {
    margin-right: 5px;
}

.npcs img {
    /* max-height: 120px; */
    height: 200px;
}

.npcs img.enemy {
    border: 1px Solid #F77;
}

.npcs img.friend {
    border: 1px Solid #008563;
}

.npcs img.was_winned {
    opacity: 0.3;
}

#locations {
    height: 40%;
}

.victory {
    justify-content: center;
    font-size: 48px;
    color: #e1e429;
    font-family: 'Times New Roman', Times, serif;
}

.victory img {
    width: 256px;
    margin-bottom: 30px;
}

.hidden {
    display: none;
}

.logout-btn {
    margin-top: 10px;
}

.back {
    background-image: url('/static/images/back_01.jpg');
    background-size: cover;
    /* Ensures the image covers the entire div */
    background-position: center;
    /* Centers the image */
    background-repeat: no-repeat;
    /* Prevents the image from repeating */
    background-blend-mode: darken;
    width: 100%;
    /* Ensures the div takes up the full width of its container */
    /* height: 100%; */
    /* Ensures the div takes up the full height of its container */
}

.uinfo h2 {
    margin: 5px 0 10px 0;
    font-size: 0.7em;
    text-align: center;
}

.uinfo a {
    color: #FFF;
    text-decoration: none;
}

.uinfo input {
    background-color: #1a1a1a;
    /* Dark gray background to contrast with the black page */
    color: #ffffff;
    /* White text for readability */
    border: 1px solid #333333;
    /* Subtle border to define the input field */
    padding: 10px;
    /* Adds space inside the input for better text readability */
    border-radius: 5px;
    /* Slightly rounded corners for a modern look */
    font-size: 14px;
    /* Ensures the text is legible */
    width: 100%;
    /* Makes the input responsive, adjust as needed */
    box-sizing: border-box;
    /* Ensures padding and border are included in the element's total width and height */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    /* Smooth transition for interactive effects */
    margin: 5px 0;
}

.uinfo input:focus {
    border-color: #ffffff;
    /* Changes border color on focus for better visibility */
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    /* Adds a subtle glow effect on focus */
    outline: none;
    /* Removes default outline for a cleaner look */
}

.uinfo input[type="checkbox"] {
    appearance: none;
    /* Removes default styling */
    width: 16px;
    /* Sets the width of the checkbox */
    height: 16px;
    /* Sets the height of the checkbox */
    background-color: #1a1a1a;
    /* Matches the dark gray background of the text input */
    border: 1px solid #333333;
    /* Subtle border to define the checkbox */
    border-radius: 3px;
    /* Slightly rounded corners for a modern look */
    cursor: pointer;
    /* Changes cursor to pointer to indicate clickability */
    position: relative;
    /* Allows for positioning of the checkmark */
    transition: background-color 0.3s ease, border-color 0.3s ease;
    /* Smooth transition for interactive effects */
    margin: 5px 0;
    /* Consistent margin with text input */
}

.uinfo input[type="checkbox"]:checked {
    background-color: #ffffff;
    /* Changes background color when checked */
    border-color: #ffffff;
    /* Changes border color when checked */
}

.uinfo input[type="checkbox"]:checked::after {
    content: '';
    /* Adds content for the checkmark */
    position: absolute;
    /* Positions the checkmark */
    top: 4px;
    /* Adjusts the vertical position of the checkmark */
    left: 8px;
    /* Adjusts the horizontal position of the checkmark */
    width: 4px;
    /* Width of the checkmark */
    height: 8px;
    /* Height of the checkmark */
    border: solid #1a1a1a;
    /* Color of the checkmark */
    border-width: 0 2px 2px 0;
    /* Creates the checkmark shape */
    transform: rotate(45deg);
    /* Rotates the element to form a checkmark */
}

.uinfo input[type="checkbox"]:focus {
    outline: none;
    /* Removes default outline */
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    /* Adds a subtle glow effect on focus */
}

.w100{
    width: 100%;
}

.login-btn {
    background-color: #333333;
    /* Dark gray background for contrast */
    color: #ffffff;
    /* White text for readability */
    border: none;
    /* Removes default border for a cleaner look */
    padding: 8px 20px;
    /* Adds space for a comfortable click area */
    border-radius: 5px;
    /* Rounded corners for a modern appearance */
    font-size: 14px;
    /* Ensures the text is legible */
    cursor: pointer;
    /* Changes cursor to pointer to indicate clickability */
    transition: background-color 0.3s ease, transform 0.3s ease;
    /* Smooth transition for interactive effects */
    display: inline-block;
    /* Ensures the button respects padding and margin */
    text-align: center;
    /* Centers the text within the button */
    margin-top: 5px;
}

.login-btn:hover {
    background-color: #555555;
    /* Lightens the background on hover for a visual cue */
    transform: translateY(-2px);
    /* Slight lift effect on hover */
}

.login-btn:active {
    background-color: #222222;
    /* Darkens the background when the button is active */
    transform: translateY(0);
    /* Resets the lift effect on click */
}

.user-info-email {
    margin: 5px 0;
}

.subauth {
    font-size: 14px;
    margin-bottom: 5px;
}

.subauth a {
    color: #5a98eb;
    text-decoration: underline;
}

.f12 {
    font-size: 12px;
}

.red {
    color: #FF0000;
}

.center {
    text-align: center;
}

.uinfo .close {
    float: right;
}

.tools {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
}

.tools>div {
    padding: 5px 10px;
    border-radius: 5px;
    margin-left: 5px;
    margin-right: 0px;
    cursor: pointer;
    font-size: 14px;
    border: 1px solid #333;
    font-weight: bold;
}
.tools>div:hover{
    border-color: #FFF;
}
.tools>div.selected{
    background-color: #555555;
}

.settings {
    background-color: #111;
    padding: 10px 0px;
    font-size: 12px;
}

.npcs img {
    cursor: pointer;
}

.tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 1);
    color: white;
    border-radius: 8px;
    padding: 20px;
    z-index: 1000;
    top: 5vh;
    height: 80vh;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    border: 1px Solid #FFF;
}

.tooltip .img {
    flex-grow: 1; /* занимает все свободное пространство */
    display: flex;
    justify-content: center; /* выравнивание по горизонтали */
    align-items: center; /* выравнивание по вертикали */
    min-height: 0;
}

.tooltip .img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.tooltip .msg{
    flex-shrink: 0;
}

.tooltip .name {
    border-top: 1px Solid #777;
    padding-top: 20px;
    font-weight: bold;
    margin-top: 5px;
}
.tooltip .sm{
    font-size: 12px;
}

.inv {
    cursor: pointer;
}


.help {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #fff; /* Белый текст для контраста с черным фоном родителя */
    padding: 20px;
    width: 100%; /* Занимает 100% ширины родителя */
    box-sizing: border-box; /* Учитывает padding в ширине */
}

.help h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #ecf0f1; /* Светлый оттенок для заголовка */
}

.game-interface {
    background-color: #333; /* Темно-серый фон для контраста */
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
}

.game-interface p {
    margin-bottom: 10px;
}

.game-interface div {
    margin-left: 20px;
    margin-bottom: 20px;
}

.game-interface img {
    max-width: 90%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

.admin{
    padding-bottom: 20px;
}
.admin table { border-collapse: collapse; margin-top: 20px; }
.admin th, .admin td { border: 1px solid #ddd; padding: 8px; text-align: right; }
.admin th { background-color: #2b2b2b; position: sticky; top: 0; }
.admin .controls { margin-bottom: 20px; }
.admin select, .admin button { margin-right: 10px; padding: 5px; }

/* Стили для иконок в кружочках */
.info-icon, .help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    margin-left: 5px;
    cursor: help; /* Курсор-подсказка */
    /* border: 1px Solid #999; */
}

.info-icon {
    color: #000;
    background-color: #999;
}

#g_auth {
    position: relative;
    font-size: 14px;
    cursor: pointer;
    margin: 5px 0;
    background-color: #000;
    padding: 10px;
    font-family: Arial, Helvetica, sans-serif;
}
#g_auth img{
    position: absolute;
    left: 10px;
    top: 7px;
}

.hflex{
    display: flex;
    flex-direction: row;
}
.hflex > * {
    flex-grow: 1;
}

.vflex{
    display: flex;
    flex-direction: column;
}

.mb{
    margin-bottom: 5px;
}

.a-button{
    cursor: pointer;
    padding: 5px 10px;
    border: 1px Solid #CCC;
    position: relative;
    margin-right: 10px;
    flex-grow: 0;
}
.a-sub{
    display: none;
    position: absolute;
    flex-direction: column;
    bottom: 100%;
    left: 0;
    background-color: #333;
}
.a-sub > div{
    padding: 5px 10px;
    cursor: pointer;
    white-space: nowrap;
}
.a-sub > div.disable{
    cursor: default;
    color: #999;
}
.a-sub > div:hover{
    background-color: #222;
}
.a-button:hover > .a-sub{
    display: flex;
}

.img-container {
  display: table-cell;
}

.img-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.more-area{
    display: flex;
    justify-content: stretch;
}
.more-area > * {
    flex-grow: 1;
}

.progress-bar{
    border: 1px Solid #DDD;
    background-color: #EEE;
    width: 100%;
    border-radius: 5px;
    height: 5px;
    min-height: 3px;
}
.progress-bar .percent{
    background-color: #008563;
    height: 100%;
}

.subhelp{
    color:#FFF;
    margin: 15px 0px;
    font-size: .8em;
}

.mobile-menu{
    padding: 3px 0px;
    display: flex;
}

.mobile-menu .back-but{
    margin-left: 10px;
    width: 45px;
}
.mobile-menu-add{
    position: relative;
    padding: 0;
    margin: 0;
    height: 0;
    z-index: 1000;
}
.mobile-menu-add > div, .mobile-menu-add #locations{
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    background-color: #000;
    max-height: 60vh;
    min-height: 12vh;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    border: 1px Solid #FFF;
    overflow-y: auto;
}
.mobile-menu-add #locations{
    height: 60vh;
}
.mobile-menu-add > div.close{
    border: none;
    height: auto;
    width: fit-content;
    right: 2px; 
    top: 1px;
    padding-top: 5px;
    min-height: 37px;
    overflow: visible;
}

.mobile-menu-add .npcs > div{
    padding: 10px 5px 5px 5px;
    font-size: .9rem;
    border-bottom: 1px Solid #333;
    margin-bottom: 5px;
}
.mobile-menu-add .npcs .npc_info{
    padding-left: 10px;
    font-size: .8rem;
}
.mobile-menu-add .npcs .npc_info .name{
    font-weight: bold;
}
.mobile-menu-add .npcs .back-but{
    margin-left: 5px;
}

.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 2rem;
}

.ifiction-buttons{
    display: flex;
    flex-wrap: wrap; 
    justify-content: center;
}
.ifiction-buttons > * {
    margin-bottom: 5px;
}
.ifiction-image-place{
    width: 100%;
    background-color: #050505;
    min-height: 32px;
    aspect-ratio: 2.625;
    color: #555;
    display: flex;
    justify-content: center;
    align-items: center;
}

.type_help{
    font-size: .7rem;
    color:#999;
}


@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .sidebar {
        position: absolute;
        top: 50px;
        left: 0;
        height: calc(100vh - 200px);
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .textinfo .row{
        flex-direction: column;
    }
    .textinfo h2{
        font-size: 1.2em;
    }
    .help{
        padding: 5px;
    }
    .game-interface div{
        margin-left: 0;
    }

    .content{
        padding: 5px;
    }
    .play_info_area {
        flex-direction: column;
    }

    .play_info_area > * {
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .play_info_area > .mobile-menu-add{
        padding: 0px;
    }

    .play_info_area .cover {
        width: 100%;
        height: auto;
    }

    .play_info_area .cover img {
        height: auto;
        max-height: 300px;
    }

    .play_info_area .history{
        padding: 0px;
    }

    .play_info_area .info {
        min-width: 100%;
        height: auto;
        max-height: 40vh;
        overflow-y: auto;
    }

    .play_info_area .history .img img {
        max-height: 30vh;
        width: 100%;
    }


    .tooltip {
        width: 90vw !important;
        left: 5vw !important;
        top: 10vh !important;
        height: 80vh;
    }

    .tooltip .img img {
        height: 40vh;
    }

    .a-button{
        font-size: .7rem;
        margin-right: 5px;
        margin-bottom: 5px;
    }
    .settings-area, .play_info_area{
        font-size: .9rem;
    }
    .tools{
        flex-direction: column;
    }
    .header{
        padding: 5px 10px;
        font-size: .9rem;
    }
    .header .back-but{
        margin-left: 10px;
    }
    footer{
        display: none;
    }
    .section-title{
        padding-left: 10px;
    }
}