/* importa a fonte */
@import url('https://fonts.googleapis.com/css2?family=Jersey+15&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Doto:wght@100..900&family=Jersey+15&display=swap');

/* Reseta o estilo das listas */
ul, ol { list-style: none; }
img { max-width: 100%; -webkit-user-drag: none; }

/* Todos os botões resetam */
button, input {
    appearance: none;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--c1);
}

:root {
    --cs: 72px; /* Coffee Size */
    --bs: rgba(0, 0, 0, .6); /* BOX SHADOW */
    --ts: 3px 3px 2px rgba(0, 0, 0, 0.8); /* TEXT SHADOW */
}

/* Põe a fonte global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Jersey 15", sans-serif;
    font-style: normal;

    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html, body {
    overflow-x: hidden;
    overflow-y: hidden;
    touch-action: manipulation; /* Essa linha previne double-tap zoom no celular */
}

/* Quando está no modo matrix, as variáveis mudam para um tom de verde */
body.matrix {
    --c1: #6ad48a;
    --c1l: #92fcb2;
    --c2: #418a59;
    --c3: #17402d;
    --c4: #163629;
    --c5: #0e2b1b;
    --c6: #002f14;
}

/* Quando está no modo evil, as variáveis mudam para um tom de vermelho */
body.evil {
    --c1: #d46a6a;
    --c1l: #f88f8f;
    --c2: #8a4141;
    --c3: #401717;
    --c4: #381111;
    --c5: #2b0e0e;
    --c6: #2f0000;
}

/* O estilo do body, onde dentro do body tem o container */
body {
    --c1: #6ACBD4;
    --c1l: #94f3fc;
    --c2: #41798A;
    --c3: #172740;
    --c4: #111e38;
    --c5: #0E192B;
    --c6: #00162f;

    --high: #b63737;
    --low: #248b24;

    --c1b: 3px solid var(--c1);

    background: url("./assets/background.webp");
    background-position: -2px -9px;
    background-size: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-size: 1.5rem;
    text-align: center;
    color: var(--c1);
    height: 100vh;
    user-select: none;
}

/* O elemento principal */
main {
    margin: 0 auto;
    max-width: 1000px;
    width: 95%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2em;
}

.table {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    min-height: 150px;
    height: 33vh;
    background-color: var(--c6);
    background: radial-gradient(ellipse at 30% 100%, var(--c3) 0%, var(--c6) 100%);
    z-index: -5;
    transition: box-shadow .5s ease;
}

body.matrix .table {
    overflow: hidden;
    opacity: .8;
    background-position: 0 100%;
    background: linear-gradient(to bottom, #00e20093 0%, 2.86624%, rgb(3, 110, 21) 5.73248%, 12.7389%, rgb(0, 64, 18) 19.7452%, 22.9299%, rgb(0, 56, 19) 26.1146%, 63.0573%, rgb(0, 47, 20) 100%);
}

body.evil .table {
    overflow: hidden;
    opacity: .8;
    background-position: 0 100%;
    background: linear-gradient(to bottom, #e2000093 0%, 2.86624%, rgb(110, 3, 3) 5.73248%, 12.7389%, rgb(64, 0, 0) 19.7452%, 22.9299%, rgb(56, 0, 0) 26.1146%, 63.0573%, rgb(47, 0, 0) 100%);
}

/* O container que envolve a seção da esquerda */
.container-left {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2em;
}

/* Contém os textos do container da esquerda */
.container-left--header {
    text-shadow: var(--ts);
    display: flex;
    flex-direction: column;
}

/* Contém o computador */
.container-left--computer {
    aspect-ratio: 1/1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 100%;
    max-height: 400px;
}
/* Cointainer do erro 404 */
.container-left--computer-error {
    aspect-ratio: 1/1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 100%;
    max-height: 900px;
}

/* Muda a cor do computador apra um tom de verde */
body.matrix .container-left--computer {
    filter: hue-rotate(300deg) contrast(0.95)
}

/* Muda a cor do computador apra um tom de verde */
body.evil .container-left--computer {
    filter: hue-rotate(140deg) contrast(1.2);
}

.computer-monitor { background: url("./assets/monitor.webp");}
.computer-back { background: url("./assets/fundo_monitor.webp"); }
.computer-error { background: url("./assets/fundo_error.webp"); }
.computer-keyboard { background: url("./assets/teclado.webp"); transition: all .1s ease;}

.hacker, .demon {
    aspect-ratio: 1/1;
    background-size: cover;
    position: absolute;
    z-index: -10;
    width: 95%;
    max-width: 500px;
    bottom: 30%;

    filter: blur(1px);
    pointer-events: none;
    opacity: 0;

    transition: opacity .5s linear;
}

.hacker.active, .demon.active {
    opacity: .4;
}

.hacker { background-image: url("./assets/hacker.webp"); }
.demon { 
    bottom: 40%;
    background-image: url("./assets/demon.webp"); 
}

.tap {
    aspect-ratio: 1/1;
    width: 64px;
    background-image: url("./assets/tap.png");
    background-size: cover;
    image-rendering: pixelated;

    pointer-events: none;
    position: absolute;
    top: 72%;
    z-index: 10;
    animation: tapAnim 1s ease-in-out infinite;
}

.tap.disabled {
    display: none;
    visibility: hidden;
}

@keyframes tapAnim {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-5px) scale(1.05); }
}

/* Ainda será implementado algum tipo de luz saindo do monitor */

/* Cada um dos componentes do computador */
.computer {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: 50% 0;
    pointer-events: none;
    filter: brightness(1.2);
}

.light-glow--container.disabled {
    display: none;
    visibility: hidden;
}

.light-glow--container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    pointer-events: none;
    top: 10.7%;
    max-width: 270px;
    width: 63%;
    height: 41.2%;
    pointer-events: none;
    z-index: 5;
    /* transform: translate(-50%, -50%); */
}

.light-glow {
    /* display: none; */
    --times: 2;
    position: absolute;
    max-width: 100vw;
    width: calc(100% * var(--times));
    height: calc(100% * var(--times));
    background: radial-gradient(circle, rgba(0,255,255,0.4) 0%, rgba(0,255,255,0) 70%);
    filter: blur(40px);
    opacity: 0.7;
    animation: glowPulse 3s ease-in-out infinite;
    mix-blend-mode: screen;
}

@keyframes glowPulse {
  0%, 100% {
    opacity: 0.5;
    filter: blur(35px);
  }
  50% {
    opacity: 0.7;
    filter: blur(45px);
  }
}

/* Nome da empresa */
.company-text {
    color: var(--c2);
    font-size: 1.5em;
    transition: color .1s ease, text-shadow .1s ease;
}

/* Adiciona um pequeno brilho quando active */
.company-text:active {
    color: white;
    /* text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px var(--c2), 0 0 40px var(--c2), 0 0 50px var(--c2), 0 0 60px var(--c2), 0 0 70px var(--c2); */
}

/* Área de fato clicável do teclado */
.computer-hitbox {
    position: absolute;
    left: 10%;
    bottom: 0;
    right: 10%;
    top: 75%;
    pointer-events: auto;
    cursor: pointer;
    outline: none;
}

/* Deixa levemente maior ao clicar */
/* .computer-hitbox:active ~ .computer-keyboard { transform: scale(1.05); } */
.pulinho { animation: pop .2s ease; }


/* SALSICHINHAS */

.computer-codelines {
    position: relative;
    pointer-events: none;
    top: 10.7%;
    max-width: 270px;
    width: 63%;
    height: 41.2%;
}

.computer-codelines--wrapper {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: repeat(30, 1fr);
    gap: 2px;
}

.code-line-wrapper {
    --fs: .2em;
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 5px;
}

.code-line {
    height: 100%;
    flex: 1;
    display: flex;
    gap: 2px;
    margin-left: 0;
}

.line-number {
    position: absolute;
    margin-left: 2px;
    font-family: monospace;
    font-size: var(--fs);
    color: var(--c2);
}

.code-block {
    /* height: calc(var(--fs)/2); */
    border-radius: 3px;
    transition: width 0.3s;
}

body.evil .line-number {
    color: #3e777d;
}

body.matrix .code-block, body.evil .code-block  {
    background-color: #008080 !important; 
}

@keyframes pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.ls-text { font-size: 1.5em; }

.clicks-container {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 15;
}

.click {
    --time: 4s;
    position: absolute;
    transform: translate(-50%, -90%);
    transition: opacity var(--time) linear, transform var(--time) linear;
    white-space: nowrap;
}

.combo {
    opacity: .8;
    font-size: .8em;
}

.fading-up {
    opacity: 0;
    transform: translate(-50%, -2000%);
}

/* O container que envolve a seção da direita */
.container-right {
    display: flex;
    flex-direction: column;
    padding: 1em;
    border-radius: 10px;
    border: var(--c1b);

    flex-basis: 400px;
    background-color: var(--c4);
    max-height: 600px;
    height: 90dvh;
    box-shadow: 5px 5px 10px var(--bs);
}

/* Quando o efeito de matrix estiver ativo, haverá uma pequena opacidade no fundo */
body.matrix .container-right, body.evil .container-right {
    background-color: color-mix(in srgb, var(--c4) 80%, transparent);
}

/* Onde estão os botões para torcar entre abas */
.container-right--header {
    margin: -1em;
    display: flex;
    flex-direction: row;
}

.container-right:not(:has( .estrutura)) .items-bulk {
    display: none;
    visibility: hidden;
}

.items-bulk {
    border-radius: 5px 5px 0 0;
    margin-top: 2em;
    background-color: var(--c5);
    padding: .2em;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}


.cust {
    text-align: left;
    font-weight: normal;
}

.coin::before {
    content: "<\002F>"; /* </> */
    aspect-ratio: 1/1;
    width: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    bottom: 3px;
    margin-right: 5px;
    font-family: monospace;
    text-align: center;
    /* letter-spacing: -2px; */
    background-color: var(--c6);
    border-radius: 5px;
    font-size: .6rem;
    text-shadow: none;
    color: var(--c1);
}

.container-right:has( [data-bulk^="10"].active):not(:has(.upgrade)) .cust-wrapper::before {
    color: rgb(255, 255, 255);
    font-size: .8em;
    font-weight: normal;
}

.container-right:has( [data-bulk="10"].active):not(:has(.upgrade)) .cust-wrapper::before { content: 'x10'; }
.container-right:has( [data-bulk="100"].active):not(:has(.upgrade))  .cust-wrapper::before { content: 'x100'; }

.bulks-wrapper {
    display: flex;
    flex-direction: row;
    gap: .5em;
}

.bulk {
    font-size: 1em;
    transition: color .2s ease;
}

.bulk.active {
    color: white;
}

/* Conteúdo do cotainer da direita */
.container-content {
    --ob: 1; /* OPACITY BOTTOM */
    --ot: 0; /* OPACITY TOP */
    position: relative;
}

.container-content:has( .upgrade) {
    margin-top: 2em;
}

/* Modifica a barra de rolagem */
.container-content::-webkit-scrollbar { 
    background-color: transparent;
    width: 5px;
}

.container-content::-webkit-scrollbar-thumb { 
    background-color: var(--c1);
    border-radius: 10px;
 }

/* Lista que armazena os upgrades/estruturas */
.content-list {
    /* opacity: 0; */
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

/* Cada um dos items da lista */
.content-item {
    --time: .8s;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .4em;
    padding: .5em;
    border-radius: 5px;
    border: var(--c1b);
    background-color: var(--c3);
    font-weight: bold;
    cursor: pointer;
    opacity: .5;
    transition: opacity .1s linear;
}

/* Deixa a opacidade normal ao ser desbloqueado (e puder ser comprado) */
.content-item.unlocked:not(:has(.high)) { opacity: 1; }

/* Deixa levemente transparente enquanto está no modo matrix */
body.matrix .content-item, body.evil .content-item { background-color: color-mix(in srgb, var(--c3) 80%, transparent); }

.item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    aspect-ratio: 1/1;
    width: 50px;
    transition: opacity var(--time) linear, filter 1s linear;
    filter: drop-shadow(5px 5px 2px var(--bs));
}

/* Deixa o icone preto enquanto ele nao for desbloqueado */
.content-item.hidden .item-icon, .tooltip-icon.hidden {
    filter: brightness(0);
    opacity: .7;
}

.item-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.item-content {
    flex: 1;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 5px;
    align-items: center;
    text-shadow: var(--ts);
}

.item-text--wrapper {
    display: flex; 
    flex-direction: row; 
    align-items: center;
    gap: 5px;
}

/* Textos para a estrutura */
.mobile-purchased { color: white; font-weight: normal; }
.item-purchased { font-size: 1.8em; color: var(--c2); font-weight: normal; }
.item-name, .mobile-name { font-size: 1.2em; text-align: left; }
.high { color: var(--high);}
.low { color: var(--low);}

.mobile-name, .mobile-purchased {
    display: none;
    visibility: hidden;
}

.info-bttn {
    display: none;
    visibility: hidden;

    align-self: stretch;
    /* background-color: var(--c2); */
    font-size: 1em;
    padding: 0 .5em;
    border: var(--c1b);
    border-radius: 5px;
}

/* Os botões que ficam para trocar entre a aba de upgrades e de estruturas */
/* Todos eles, no principio, ficam com essa aparência de "apagados" */
.button-header {
    position: relative;
    font-size: 1.2em;
    text-transform: uppercase;
    flex-grow: 1;
    padding: 1em;
    color: var(--c2);
    background-color: var(--c5);
    border-bottom: 3px solid black;
    transition: color .2s ease;
}

.button-header.left {
    border-radius: 10px 0 0 0;
}

.button-header.right {
    border-radius: 0 10px 0 0;
}

.notification {
    opacity: 0;
    transition: opacity .2s linear;
}

.button-header.has-notification:not(.active) .notification {
    opacity: 1;
    animation: bounce 1s;
}

/* Bounce effect para a notificaçãozinha */
/* @keyframes bounce {
    0%   { transform: scale(1,1)    translateY(0); }
    10%  { transform: scale(1.1,.9) translateY(0); }
    30%  { transform: scale(.9,1.1) translateY(-20px); }
    50%  { transform: scale(1,1)    translateY(0); }
    57%  { transform: scale(1,1)    translateY(-7px); }
    64%  { transform: scale(1,1)    translateY(0); }
    100% { transform: scale(1,1)    translateY(0); }
} */

@keyframes bounce {
	0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
	40% {transform: translateY(-15px);}
	60% {transform: translateY(-8px);}
}

.notification {
    aspect-ratio: 1/1;
    width: .8em;
    border-radius: 50%;
    background-color: #ad0909;
    right: 5px;
    top: 5px;
    position: absolute;
}

.notification::after {
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: .7em;
    content: '!';
}

body.matrix .button-header, body.evil .button-header {
    background-color: color-mix(in srgb, var(--c5) 80%, transparent);
}

/* Quando são ativos, a cor fica igual a do fundo e a fonte tbm fica mais "viva" */
.button-header.active {
    color: var(--c1);
    background-color: var(--c4);
    border-bottom: none;
}

body.matrix .button-header.active, body.evil .button-header.active { background-color: transparent; }

.button-header.left.active { border-right: 3px solid black;} /* Se o botão da esquerda que tá ativo, cria uma bordinha na direita */
.button-header.right.active { border-left: 3px solid black;} /* Se o botão da direita que tá ativo, cria uma bordinha na esquerda */

/* EVENTO ALEATÓRIO DO CAFÉ */

#coffee-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden; /* garante que cafés não escapem */
    pointer-events: none;
    z-index: 1000;
}

.coffee-wrapper {
    --time: 4s;
    position: absolute;
    display: block;
    opacity: 0;
    transform: scale(0) rotate(0);

    transform-origin: center;
    will-change: transform;
    transition: opacity var(--time) linear, transform var(--time) ease;
}

.coffee-wrapper.fade-out {
    transition: opacity var(--time) linear, transform var(--time) ease;
}

.coffee {
    display: block;
    width: var(--cs);
    height: var(--cs);
    cursor: pointer;
    background-size: var(--cs) var(--cs);
    background-image: url('./assets/icons/coffee.png');
    background-position: 0 0;
    image-rendering: pixelated;

    pointer-events: auto;
    transform-origin: center;
    will-change: transform;
}

.alert-back {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 140%;
    height: 120%;
    background-color: var(--bs); /* fundo escuro com transparência */
    border-radius: 50px;
    filter: blur(10px);
    opacity: .7;
    z-index: 50;
}

.alert-coffee {
    color: rgb(255, 255, 255);
    width: fit-content;
    display: block;
    position: absolute;
    filter: blur(0);
    transform: translate(calc(-50% + var(--cs)/2), 0);
    opacity: 0;

    transition: opacity .5s linear, transform 1s ease-out;
    text-align: center;
}


.alert-text {
    font-size: .9em;
    position: relative;
    z-index: 51;
}

.alert-name {
    font-size: 1.4em;
}

/* Animações do Café */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes tilt {
  0% { rotate: 0deg; }
  17% { rotate: -3deg; }
  34% { rotate: 3deg; }
  51% { rotate: 0deg; }
  68% { rotate: 3deg; }
  85% { rotate: -3deg; }
  100% { rotate: 0deg; }
}

/* MATRIX */

.matrix-canvas {
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: -100;
    opacity: 1;
    pointer-events: none;
    transition: opacity .5s ease;
}

@starting-style {
    .matrix-canvas { opacity: 0; }
}

/* MODAL */

.modal, .items-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, .8);
    z-index: 100000;
    touch-action: none;
    transition: opacity .2s linear;
}

.modal-content, .items-modal--content {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 5px;
    border: var(--c1b);
    background-color: var(--c3);
    max-width: 450px;
    width: 90vw;
    padding: 1em;
}

.modal-title {
    font-size: 1.5em;
    text-align: center;
}

.modal-warning {
    max-width: 300px;
    opacity: .5;
    font-size: .8em;
}

.modal-form {
    position: relative;
    margin-top: 1.5em;
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: .5em;
}

.modal-error {
    position: absolute;
    transform: translateY(-100%);
    color: #ce3030;
    font-size: .7em;
}

.modal-input {
    background-color: var(--c2);
    border-radius: 5px;
    border: var(--c1b);
    flex-grow: 1;
    font-size: 1em;
    padding: .5em;
    min-width: 0;
    cursor: auto;
    color: white;
}

::placeholder {
    color: white;
    opacity: .5;
}

.modal-submit {
    appearance: none;
    border-radius: 5px;
    border: none;
    background-color: var(--c2);
    color: white;
    cursor: pointer;
    font-size: 1em;
    padding: .2em 1em;
    transition: filter .2s ease;
}

.modal.disabled {
    display: none;
    pointer-events: none;
    opacity: 0;
}

/* ITEMS MODAL */

.items-modal {
    opacity: 0;
    pointer-events: none;
    display: none;
    visibility: hidden;
}

.items-modal--content {
    max-height: 80vh;
    max-width: 460px;
}

.items-modal.enabled {
    pointer-events: auto;
    display: block;
    visibility: visible;
}

.items-modal--title {
    font-size: 1.3em;
    width: 100%;
    padding: .2em;
    border-bottom: 1px solid var(--c1);
}

.items {
    padding: .5em 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: .2em;
    border-bottom: 1px solid var(--c1);
}

.item-wrapper {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: .5em;
    align-items: center;
}

.item-wrapper > span:nth-of-type(1) {
    text-align: left;
}

.item-wrapper > span:nth-of-type(2) {
    font-size: .8em;
    text-align: right;
    color: white;
}


.items-upgrades-owned {
    width: 100%;
    padding: .2em 0;
}

.item-upgrades--container {
    position: relative;
    width: 100%;
    /* margin-top: 1em; */
    row-gap: .5em; 
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
}

.item-icon--wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    width: 3em;
    border: 5px solid var(--c1);
    border-radius: 3px;
    background: radial-gradient(circle, var(--c3) 0%, var(--c6) 100%);
    cursor: pointer;
    transition: border .2s ease;
    box-shadow: 5px 5px 5px var(--bs);
}

.stats-upgrades {
    /* flex: 80px 1 0; */
    /* max-height: 120px; */
    display: flex;
    flex-direction: column;
    gap: .2em;
    align-items: center;
    justify-content: center;
}

.stats-upgrades > .item-name {
    width: 100px;
    text-align: center;
    font-size: .5em;
}

.stats {
    pointer-events: all;
    transition: transform .2s ease;
    filter: drop-shadow(5px 5px 5px var(--bs));
}

.stats-icon {
    aspect-ratio: 1/1;
    width: var(--icon-size);
    position: relative;
    left: -3px;
    border-radius: 0 5px 5px 0;
    border: var(--c1b);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    background-size: cover;
    background-color: var(--c3);
    cursor: pointer;
    /* background-image: url('./assets/placeholder.png'); */
}

.stats-svg {
    width: 90%;
    height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1em;
}

/* SIDE BTTNS */

.side-bttns {
    --icon-size: 52px;
    pointer-events: none;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    justify-content: center;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: .5em;
}

/* CONTAINER BOOSTS */

.container-boosts {
    display: flex;
    flex-direction: row;
    gap: 1em;
    position: fixed;
    bottom: 1em;
    left: 50%;
    transform: translateX(-50%);
}

.boost {
    --time: 5s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1/1;
    width: 2.5em;
    border: 5px solid var(--c1);
    border-radius: 3px;
    background: radial-gradient(circle, var(--c3) 0%, var(--c6) 100%);
    cursor: pointer;
    transition: border .2s ease;
    box-shadow: 5px 5px 5px var(--bs);
}

.boost-icon {
    aspect-ratio: 1/1;
    width: 80%;
    filter: drop-shadow(2px 2px 2px var(--bs));
}

/* Propriedade que serve pra animar o "conic-gradient" (efeito de cooldown) */
@property --a {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

.boost.cooldown::after {
    opacity: .5;
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: conic-gradient(transparent 0deg, transparent var(--a), var(--c1) var(--a));
    animation: fill var(--time) linear normal;
    animation-fill-mode: forwards;
    z-index: 100;
}

@keyframes fill {
  0% {
    --a: 0deg;
  }
  100% {
    --a: 360deg;
  }
}

/* TOOLTIP */

.mobile-tooltip {
    touch-action: none;
    pointer-events: none;
    display: none;
    visibility: hidden;
    opacity: 0;

    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200000;
    background-color: var(--bs);
    transition: opacity .2s linear;
}

.mobile-tooltip.enabled {
    pointer-events: auto;
    display: block;
    visibility: visible;
}

.mobile-tooltip--content {
    display: flex;
    flex-direction: column;
    gap: .5em;
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 450px;
    width: 90dvw;
    max-height: 500px;
    height: 80dvh;
    padding: 0.4em;
    z-index: 10001;

    border-radius: 5px;
    border: var(--c1b);
    background-color: var(--c3);
}

.mobile-tooltip--title {
    font-size: 1.3em;
    width: 100%;
    padding: .2em;
    border-bottom: 1px solid var(--c1);
}

.mobile-tooltip--header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .5em;
    padding: .2em;
    border-radius: 5px;
    border: var(--c1b);
    width: 100%;
}

.mobile-tooltip--wrapper {
    display: flex;
    flex-direction: column;
    gap: .5em;
    flex: 1;
}

.mobile-tooltip--icon {
    aspect-ratio: 1/1;
    width: 80px;
    filter :drop-shadow(5px 5px 2px var(--bs));
}

.mobile-tooltip--header-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    text-shadow: var(--ts);
}

.mobile-tooltip--name {
    font-size: 1.5em;
}

.close-bttn {
    width: 100%;
    background-color: var(--c5);
    font-size: 1.4em;
    padding: .5em;
    border-radius: 5px;
}

.tooltip {
    width: 450px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: .5em;
    position: absolute;
    background-color: var(--c3);
    padding: 8px 12px;
    border: var(--c1b);
    border-radius: 5px;
    font-size: 1em;
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.tooltip.bonus {
    width: 250px;
    font-size: .8em;
}

.tooltip-header {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    border-bottom: 1px solid var(--c1);
    padding-bottom: 5px;
    text-shadow: var(--ts);
}

.tooltip-header.center {
    display: block;
}

.tooltip-header--left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
}

.tooltip-icon {
    aspect-ratio: 1/1;
    filter: drop-shadow(5px 5px 2px var(--bs));
    width: 60px;
}

.tooltip-name {
    text-align: left;
    font-weight: bold;
    font-size: 1.2em;
}

.tooltip-price {
    font-weight: normal;
    text-align: right;
}

.tooltip-header.center .tooltip-name {
    text-align: center;
}

.tooltip-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tooltip-content:has(+ .tooltip-extra:not(.hidden)) {
    border-bottom: 1px solid var(--c1);
}

.tooltip-extra.hidden {
    display: none;
    visibility: hidden;
}

.tooltip-description {
    font-style: italic;
    text-align: right;
    opacity: .6;
    max-width: 350px;
    align-self: flex-end;
}


.tooltip-description {
    line-height: .8em;
}

.tooltip-description::before { content: '"'; }
.tooltip-description::after { content: '"'; }

.tooltip-function {
    text-align: left;
    margin-bottom: .4em;
}

.tooltip ul, .mobile-tooltip ul {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tooltip li, .mobile-tooltip li {
    text-align: left;
    font-size: .9em;
    background-color: var(--c2);
    background-size: 50%;
    border-radius: 10px;
}

.tooltip li::before, .mobile-tooltip li::before {
    content: "• ";
}

/* LEADERBOARD */

.leaderboard-wrapper {
    --cont-w: 280px;
    --cont-h: 326px;
    pointer-events: all;
    display: flex;
    align-items: flex-start;
    /* position: fixed;
    left: 0em;
    top: 50%; */
    width: calc(var(--cont-w) + var(--icon-size));
    transform: translateX(calc(-1 * var(--cont-w)));
    transition: transform .2s ease;
    filter: drop-shadow(5px 5px 5px var(--bs));

    overflow: hidden;
    z-index: 200;
}

.leaderboard-icon {
    aspect-ratio: 1/1;
    width: var(--icon-size);
    position: relative;
    left: -3px;
    border-radius: 0 5px 5px 0;
    border: var(--c1b);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    background-size: cover;
    background-color: var(--c3);
    /* background-image: url('./assets/placeholder.webp'); */
}

.lb-svg {
    width: 90%;
    height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1em;
}

.lb--prev-pos {
    z-index: 1;
    color: white;
    padding: 0 .1em;
}

.leaderboard-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: var(--cont-w);
    height: var(--cont-h);
    border-radius: 0 0 5px 0;
    border: var(--c1b);
    border-left: none;
    background-color: var(--c3);
}

.leaderboard-content h2 {
    font-size: 1.2em;
    padding: .3em;
    width: 100%;
    border-bottom: var(--c1b);
}

.leaderboard-content ul {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.leaderboard-content li {
    position: absolute;
    /* background-color: var(--c4); */
    font-size: .6em;
    display: flex;
    width: 100%;
    flex-direction: row;
    align-items: center;
    /* justify-content: space-between; */
    gap: 5px;
    padding: .2em .5em;
    /* margin: 0 0 4px; */
    /* border-radius: 5px; */
    border-bottom: 2px solid var(--c4);
}

.leaderboard-content li.you {
    background-color: var(--c4);
    /* filter: brightness(1.1); */
}

.lb-pos { 
    flex-basis: .8em;
    text-align: right;
    /* border-right: var(--c1b); */
 }

.lb-number {
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
}
.lb-name { 
    flex: 1;
    text-align: left;
    font-size: 1.2em;
    white-space: nowrap;
    overflow: hidden;
}

.leaderboard-content li:has(.lb-1), .lb--prev-pos.lb-1 { color: gold; }
.leaderboard-content li:has(.lb-2), .lb--prev-pos.lb-2 { color: silver; }
.leaderboard-content li:has(.lb-3), .lb--prev-pos.lb-3 { color: #C68346; }
.leaderboard-content li:has(.lb-last) {
    top: -2px;
    /* border-bottom: 2px solid var(--c1); */
    border-bottom: none;
    border-top: 2px solid var(--c2);
    /* color: #613737; */
    /* background-color: var(--c4); */
    /* color: white; */
}

.leaderboard-end {
    display: flex;
    align-items: center;
    justify-content: center;
}

/**/
/* SCROLL SHADOW */


.scroll-shadow {
    overflow-y: auto;
    scrollbar-width: none;
}

.scroll-shadow::before, 
.scroll-shadow::after {
    --h: 30px;
    --i: .7; /* INITIAL */
    content: '';
    display: block;
    width: 100%;
    height: var(--h);
    margin-top: calc(var(--h) * -1);
    position: sticky;
    filter: blur(10px);
    z-index: 100;
}

.scroll-shadow::before {
    top: 0px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, var(--i)) 50%, transparent);
    /* background: radial-gradient(at center top, rgba(0, 0, 0, var(--i)) 50%, transparent); */
    opacity: var(--ot);
}

.scroll-shadow::after {
    bottom: 0px;
    background: linear-gradient(to top, rgba(0, 0, 0, var(--i)) 50%, transparent);
    /* background: radial-gradient(at center bottom, rgba(0, 0, 0, var(--i)) 50%, transparent); */
    opacity: var(--ob);
}

/* Essa media query funciona somente em dispositivos que possuem hover (eliminando o mobile) */
@media (hover: hover) {
    .modal-submit:hover {
        filter: brightness(1.1);
    }

    .button-header:hover {
        color: white;
    }

    .content-item:hover {
        filter: brightness(1.2);
    }

    .content-item:not(:has(.high)):active {
        filter: brightness(1.0)
    }

    .computer-hitbox:hover ~ .computer-keyboard {
        transform: scale(1.05);
        /* Brilho no teclado, que ainda não será implementado */
        /* filter: drop-shadow(0 0 4px var(--c1)) drop-shadow(0 0 8px var(--c1)); */
    }
    .computer-hitbox:active ~ .computer-keyboard { transform: scale(1.0); }

    .leaderboard-content {
        opacity: 0;
    }

    .leaderboard-wrapper:hover {
        transform: translateX(0);
    }

    .leaderboard-wrapper.visible .leaderboard-content  {
        opacity: 1;
    }

    .leaderboard-wrapper:hover .leaderboard-content li {
        transition: transform .2s ease, color .2s ease;
    }

    .boost:hover {
        border: 5px solid var(--c1l);
    }
}

/* Responsividade */
/* PRECISA FICAR ABAIXO DE TODO O RESTO */
@media (min-height: 900px) {
    .table {
        min-height: 150px;
        height: 40vh;
    }
}

@media (max-width: 900px) {
    .computer-codelines, .light-glow--container {
        height: 39%;
        top: 10%;
    }
}

@media (max-width: 800px) {
    :root {
        --cs: 64px;
    }

    html {
        overflow-y: auto;
    }

    body {
        font-size: 1.4rem;
        background-size: auto;
    }

    main {
        position: absolute;
        top: 0;
        padding-top: 5rem;
        flex-direction: column;
        width: 100%;
    }
    
    .side-bttns {
        --icon-size: 42px;    
    }

    .leaderboard-wrapper {
        --cont-w: auto;
        transform: none;
        transition: background .2s ease;
    }

    .leaderboard-content ul {
        font-size: 1.3em;
    }

    .leaderboard-content {
        display: none;
        visibility: hidden;

        --cont-w: 90%;
        --cont-h: 348px;
        max-width: 350px;
        border: var(--c1b);
        border-radius: 5px;
        inset: 1em;
        opacity: 0;
        transition: opacity .2s linear;
    }

    .leaderboard-wrapper.enabled {
        position: fixed;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100vw;
        height: 100vh;
        touch-action: none;
        z-index: 100000;
    }

    .lb-name {
        font-size: 1em;
    }

    .leaderboard-wrapper.enabled .leaderboard-content {
        display: block;
        visibility: visible;
    }

    .leaderboard-wrapper.enabled  .leaderboard-icon {
        display: none;
        visibility: hidden;
    }

    .table {
        position: absolute;
        left: 0;
        right: 0;
        top: 440px;
        height: 240px;
        min-height: auto;
        background: radial-gradient(ellipse at bottom, var(--c3) 0%, var(--c6) 100%);
    }

    .container-left {
        margin-top: 7rem;
    }

    .container-left--header {
        width: 90%;
        pointer-events: none;
        position: fixed;
        top: 2em;
        z-index: 50;
    }

    .container-right--header {
        margin: -1em -.4em;
    }

    .notification {
        right: .8em;
        width: 1.2em;
    }

    .notification::after {
        font-size: 1.1em;
    }

    .container-left--computer {
        max-height: 400px;
        height: 85vw;
    }

    .container-left {
        width: 95%;
    }

    .computer-codelines, .light-glow--container {
        width: 60%;
        height: 41.2%;
        top: 10.7%;
    }

    .container-right {
        border-radius: 0;
        border: none;
        border-top: 3px solid var(--c1);
        width: 100%;
        max-height: 70dvh;
        padding: 1em .4em;
        flex: 1 0 auto;
    }

    .item-purchased { 
        display: none;
        visibility: hidden;
    }

    .content-item.unlocked .info-bttn, .upgrade .info-bttn { 
        display: block; 
        visibility: visible;
    }

    .item-name, .mobile-name {
        font-size: clamp(.9em, 6vw,1.2em);
    }

    .content-item.estrutura .item-name {
        display: none;
        visibility: hidden;
    }

    .mobile-name, .mobile-purchased.with-value {
        display: block;
        visibility: visible;
    }

    .tooltip-description {
        font-size: .8em;
        max-width: 280px;
    }

    .container-boosts {
        /* top: 1em; */
        bottom: 1em;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
    }
}

@media (max-width: 470px) {
    .loading-txt {
        font-size: clamp(1.8em, 20vw, 3em);
    }

    .table {
        top: calc(245px + 42vw);
        height: 55vw;
    }
}

/* Botão para parar */
.buttonStop, .resume{
    z-index: 200;
    border: var(--c1b);
    position: fixed;
    left: 0;
    top: 0;
    margin: 10px;
    padding: 5px;
    background-color: var(--c4);
    font-size: 1em;
}

.resume {
    top: auto;
    bottom: 0;
}