body {
    background-color: #060606;
    /* background-image: linear-gradient(black, gold); */
    background-size: cover; 
    background-repeat: no-repeat;
    margin: 0px;
    font-size: calc(16px * var(--font-scale));
}

button {
    border-width: 1px;
}

#prestigeSubButtons, #mainSubButtons, #settingSubButtons, #statsSubButtons, #achSubButtons, #topButtons, #challengeSubButtons, #reflashSubButtons {
    margin: 0 auto;
    display: flex;
    justify-content: center;
}
.titleTab {
    margin: 0 auto;
    color: white;
    font-size: calc(30px * var(--font-scale));
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px
}

.tabButton {
    border-style: solid;
    border-radius: 3px;
    height: auto;
    min-height: 38px;
    border-color:rgb(255, 255, 255);
    color: rgb(255, 255, 255);
    background-color: rgb(0, 0, 0);
    text-align: center;
    font-family: "Poly"; 
    font-size: calc(18px * var(--font-scale));
    margin-bottom: 10px;
    cursor: pointer;
    margin-right: 0.3vw;
    white-space: nowrap;
}
.tabButton:hover {
    background-color: rgb(62, 62, 62)
}
.tabButton::before {
    color: black !important;
}

#balanceSelect {
  border-color: white !important;
  color: white;
}

/* Active/selected tab: swap background and text colors */
.tabButton.active,
.tabButton[aria-selected="true"] {
    background-color: rgb(255, 255, 255);
    color: rgb(0, 0, 0) !important;
    border-color: rgb(0, 0, 0);
}
.tabButton.active:hover,
.tabButton[aria-selected="true"]:hover {
    background-color: rgb(230, 230, 230);
}

.shopSelection.active,
.shopSelection[aria-selected="true"] {
    background-color: rgb(255, 255, 255);
    color: rgb(0, 0, 0);
    border-color: rgb(0, 0, 0);
}
.shopSelection.active:hover,
.shopSelection[aria-selected="true"]:hover {
    background-color: rgb(230, 230, 230);
}

.bulkBuySelection.active,
.bulkBuySelection[aria-selected="true"] {
    background-color: rgb(255, 255, 255);
    color: rgb(0, 0, 0);
    border-color: rgb(0, 0, 0);
}
.bulkBuySelection.active:hover,
.bulkBuySelection[aria-selected="true"]:hover {
    background-color: rgb(230, 230, 230);
}

ut { /*title of upgrade */
    font-weight:900;
    pointer-events: none; /* текст сообщения не мешает кликать по кнопке */
    user-select: none;
}

it {
    font-style: italic;
}

.subButton {
    opacity: 0.85;
    min-height: 32px;
    height: auto;
    font-size: calc(16px * var(--font-scale))
}

.whiteButton {
    border-style: solid;
    border-radius: 3px;
    max-height: 40px;
    height: 4vw;
    border-color:rgb(255, 255, 255);
    color: rgb(255, 255, 255);
    background-color: rgb(0, 0, 0);
    text-align: center;
    font-family: "Poly"; 
    font-size: calc(18px * var(--font-scale));
    margin-bottom: 10px;
    cursor: pointer;
    margin-right: 0.3vw;
    white-space: nowrap;
}
.whiteButton:hover {
    background-color: rgb(62, 62, 62)
}
.whiteButton::before {
    color: black !important;
}
.whiteButtonThin {
    opacity: 0.8;
    max-height: 25px;
    height: 3vw;
    font-size: calc(15px * var(--font-scale));
}

.tooltip {
    background: #000000;
    color: white;
    font-size: calc(12px * var(--font-scale));
    border-radius: 4px;
    border-color: white;
    border: 2px solid rgb(255, 255, 255);
    display: none;
    max-width: 180px;
    width: 30vw;
    text-align: center;
    word-wrap: break-word;
    padding: 7px;
    z-index: 10000;
}

.tooltip br {
    height: 0px;
}

.tooltip[data-show] {
    display: block;
}

.arrow,
.arrow::before {
    position: absolute;
    width: 8px;
    height: 8px;
    background: inherit;
    background-color: rgb(0, 0, 0);
    border: solid 0px;
    content: '';
}

.arrow {
    visibility: visible;
}

.arrow::before {
    visibility: visible;
    transform: rotate(45deg);
    border-bottom-width: 2px;
    border-right-width: 2px;
    content: '';
    right: 0px;
    top: 4px
}

.tooltip[data-popper-placement^='top'] > .arrow {
    bottom: 0px;
}

.tooltip[data-popper-placement^='bottom'] > .arrow {
    top: -6px; /* Поднимаем стрелку на самую верхнюю границу рамки */
    bottom: auto;
    transform: rotate(45deg); /* Поворачиваем уголок вверх */
}

.tooltip[data-popper-placement^='bottom'] > .arrow::before {
    transform: rotate(45deg); /* Сбрасываем лишние вращения */
    top: 0px;
    right: 0px;
    border-bottom-width: 0px;
    border-right-width: 0px;
    border-top-width: 2px;   /* Рисуем верхнюю и левую границу уголка */
    border-left-width: 2px;
}

.tooltip[data-popper-placement^='left'] > .arrow {
    right: -4px;
}

.tooltip[data-popper-placement^='right'] > .arrow {
    left: -4px;
}

.tooltipUpgrade {
    font-size: calc(12px * var(--font-scale));
    padding: 10px
}

#eventSelect {
    border-color: red;
}

#eventSelect:hover {
    background-color: rgba(255, 0, 0, 0.338);
}

#spiritualEvent, #triplePowerEvent {
    flex-direction: column;
    align-items: center;
}

#automationTab {
    display: none;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}
.automationContainer {
    border: 2px solid var(--shard);
    border-radius: 10px;
    display: flex;
    max-height: 150px;
    max-width: 230px;
    width: 20vw;
    height: 25vw;
    background-color: #101010;
    flex-direction: column;
    align-items: center;
    padding: 10px 0px;
}

.automationUpgrade, .automationUpgrade2 {
    border: 2px var(--shard) solid;
    height: 50px;
    background-color:  #101010;
    color: var(--shard);
    cursor:pointer;
    border-radius: 5px;
    font-size: calc(12px * var(--font-scale));
    display: block;
}

.automationContainer input {
    max-width: 300px;
    width: 80%;
}


.automationUpgrade:hover, #autoPrestigeMode:hover, .automationUpgrade2:hover {
    background-color: var(--shard);
    color: black
}

.automationRow {
    display:flex;
    flex-direction: row;
    margin-bottom:20px;
    gap: 20px;
}

#prestigeModeDiv input {
    max-width: 300px;
    width: 100%;
    box-sizing: border-box;
}

#prestigeModeDiv {
    display: flex;
    max-width: 300px;
    width: 70%;
}

#autoPrestigeMode {
    border: 2px rgb(202, 255, 248) solid;
    background-color: #101010;
    color: rgb(202, 255, 248);
    cursor: pointer;
    font-size: calc(12px * var(--font-scale));
    border-bottom: 0px;
}

.prestigeInput {
    border: 2px rgb(202, 255, 248) solid;
    background-color: #222222;
    color: white;
}

#autoUmultiInterval, #autoUpowerInterval, #autoUpowerInterval2, #mineralsBulkBuy, #autoUadderInterval, #autoUadderInterval2, #autoUreducerInterval, #autoUreducerInterval2, .intervalText {
    font-size: calc(12px * var(--font-scale));
    color: white;
}

input:focus {
    outline: none;
}

input {
    font-family: 'Poly';
}

.challengeDiv, .challengePDiv {
    font-size: calc(20px * var(--font-scale));
    border: white 2px solid;
    border-radius: 10px;
    max-width: 390px;
    width: 20vw;
    display: flex;
    flex-direction: column;
    color: white;
    align-items: center;
    text-align: center;
    padding: 5px;
    margin: 5px;
    height: 250px;
}

.challengePDiv {
    border-color: var(--crystal)
}

#challenges, #prestigeChallenges {
    display: flex;
    flex-direction: row;
    max-width: 1800px;
    width: 90vw;
    flex-wrap: wrap;
    justify-content: center;
}

#challenges .challengeDiv, #prestigeChallenges .challengePDiv {
  flex: 0 1 20vw; 
  box-sizing: border-box;
}

#challengeTab {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.challengeRow {
    flex-direction: row;
    display:flex;
    justify-content: center;
}

.challengeTitle, .challengePTitle {
    font-weight: bold;
    margin: 10px;
}

.challengeCond, .challengePCond {
    height: 140px;
}

button {
    cursor:pointer;
}

.challengeStart, .challengePstart {
    margin: 0;
}

#worldTextDiv {
    height: 120px;
    display: flex;
    align-items: end;
}

#worldText {
    display: flex;
    margin-top: 7px;
    white-space: nowrap;
    width: 100%;
    text-align: center;
    justify-content: center;
    align-items: center;
}

#exitChallenge, #exitPChallenge {
    display: none;
    font-size: calc(14px * var(--font-scale)) !important;
    margin: 5px;
    height: 20px;
}

.challengeDesc {
    font-size: calc(13px * var(--font-scale)) !important
}

#challengeCondition {
    font-size: calc(12px * var(--font-scale));
    display: flex;
    align-items: center;
}

.smallDesc{
    color: rgb(130 130 130);
    font-size: calc(14px * var(--font-scale));
    margin: 5px;
    text-align: center;
}

#challengeCoinTab, #challengePrestigeTab {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#bookWindow {
    width: 1152px; 
    aspect-ratio: 1.5 / 1;
    background: url('./images/Lore/Book\ png.png') no-repeat; 
    background-size: cover; 
    display: none;
    justify-content: center; 
    align-items: center; 
    image-rendering: pixelated;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* width: 80vw;
    height: 51vh; */
    z-index: 9989;
}

.page { 
    width: 39%; 
    height: 100%; 
    position: relative; 
    padding: 0px; 
    box-sizing: border-box; 
}

.grid-buttons {
    display: grid;
    grid-template-columns: repeat(2, 150px); /* 2 колонки по 180px */
    grid-template-rows: repeat(2, 200px);    /* 2 строки по 240px */
    gap: 50px; /* Расстояние между бумажками */
    justify-content: center;
    margin-top: 30px;
}

.btn { 
    width: 150px; 
    height: 200px; 
    cursor: pointer; 
}

/* Стрелки внизу */
.arrow-btn { 
    position: absolute; 
    bottom: 130px; 
    width: 80px; 
    height: 50px; 
}
.left-arrow { 
    background: url('./images/Lore/RightArrow.png') no-repeat; 
    background-size: cover; 
    image-rendering: pixelated;
    border: 0px !important;
    left: 30px; 
}
.right-arrow { 
    background: url('./images/Lore/LeftArrow.png') no-repeat; 
    background-size: cover; 
    image-rendering: pixelated;
    border: 0px !important;
    right: 30px; 
}

/* Кнопка выхода сверху справа */
.close-btn { 
    background: url('./images/Lore/BackArrow.png') no-repeat; 
    background-size: cover; 
    image-rendering: pixelated;
    border: 0px !important;
    position: absolute; 
    top: 50px; 
    right: 10px; 
    width: 60px; 
    height: 40px; 
}

.paper-type {
    border: 0px !important;
    image-rendering: pixelated;
    color: white;
    text-align: center;
    padding-bottom: 25px;
    font-size: calc(16px * var(--font-scale));
    font-weight: bold;
    display: none;
}

.paper-type-1 {
    background: url('./images/Lore/Piece1.png') no-repeat; 
    background-size: cover; 
}
.paper-type-2 {
    background: url('./images/Lore/Piece2.png') no-repeat; 
    background-size: cover; 
}
.paper-type-3 {
    background: url('./images/Lore/Piece3.png') no-repeat; 
    background-size: cover; 
}
.paper-type-4 {
    background: url('./images/Lore/Piece4.png') no-repeat; 
    background-size: cover; 
}

.leftLoreTitle, .rightLoreTitle {
    margin-top: 80px;
    font-size: calc(20px * var(--font-scale)) !important;
    font-weight: bold;
}

#paperWindow {
    background: url('./images/Lore/BigPiece1.png') no-repeat; 
    background-size: cover; 
    border: 0px !important;
    image-rendering: pixelated;
    color: white;
    text-align: center;
    height: 100vh;
    max-height: 1000px;
    font-size: calc(22px * var(--font-scale));
    display: none;
    padding: 40px;
    justify-content: center;
    align-items: flex-start;
}

#chapterDiv {
    height: 100%;
    width: 80%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

#exitPaper {
    top: 100px;
    right: 80px;
    height: 70px;
    width: 90px;
}