:root {
  /* theme stuff */
  --font: "Lato", sans-serif;
  --font-color: #003f7f;
  --bg: linear-gradient(#acc8e5, #719dcc);
  --inner-bg: linear-gradient(#fff5, transparent);
}
body {
  font-family: var(--font);
  color: var(--font-color);
  margin: 0;
  text-align: center;
  box-sizing: border-box;
  user-select: none;
}
table {
  margin: auto;
}

#bg {
  position: fixed;
  z-index: -1;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  background: var(--bg);
}
#inner_bg {
  position: absolute;
  height: 100%;
  width: 95%;
  left: 2.5%;
  background: var(--inner-bg);
}
#loading {
  position: fixed;
  top: calc(50% - 50px);
  left: 0;
  width: 100%;
  height: 50px;
  background: #fff7;
}
#loading * {
  margin: 0;
}
#app {
  margin-left: 2.5%;
  margin-right: 2.5%;
}

h1,
h2,
h3 {
  color: #007fff;
}
.tab_navigator {
  width: 100%;
  height: 20%;
  padding-top: 5px;
  overflow: hidden;
  box-shadow: inset 0 -20px 8px -20px #07f7;
}
.tab_navigator button {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  margin: 0 2px;
}
.tab_navigator[role="layers"] button {
  font-size: 16px;
  padding: 6px 8px;
}
.tab {
  position: relative;
  width: 100%;
}

/* Obligatory news ticker */
.newsTicker {
  padding: 5px 0;
  margin: 10px 10% 0 10%;
  border: 1px solid;
  border-radius: 5px;
  overflow: hidden;
  transition: 0.2s;
}
.newsTicker:active {
  transform: scale(0.95);
}
.newsMessage {
  width: max-content;
}

/*#menu_btn {
  position: fixed;
  bottom: 0;
  left: 0;
}
#menu_tab {
  position: fixed;
  background: #719dcc;
  top: 10%;
  right: 0;
  z-index: 1;

  width: calc(100% - 60px);
  height: 100%;
}*/

button {
  background: linear-gradient(white, #7fcfff);
  color: #000b;
  box-shadow: 0 3px 6px #07f7;
  border: 0px;
  border-radius: 5px;
  padding: 5px 7px;
  font-family: var(--font);
  transition: all 0.3s ease;
  transform: scale(1);
}
button:hover {
  transform: scale(1.05);
}
button:active {
  transform: scale(1);
}

.resource {
  font-size: 18px;
}
.resource b {
  font-size: 24px;
  text-shadow: 0 1px 6px #07f7;
}

.resourceTable td:not(:first-child) button {
  width: 180px;
}

.flex {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  vertical-align: top;
}

.flex-base {
  flex-grow: 1;
  flex-shrink: 0;
}

.inline {
  display: inline-block;
}
.buyables {
  display: grid;
  align-items: center;
  grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
}
.buyable {
  text-align: left;
  display: flex;
  flex-direction: row;
  text-align: left;
  padding: 0px;
}
.buyable > div:first-child {
  padding: 5px 8px;
  flex-grow: 1;
}
.buyable > div:first-child > b {
  font-size: 18px;
}
.buyable > div:first-child > span {
  display: inline-block;
  min-height: 50px;
  padding-top: 2px;
  font-size: 13.3333px;
}
.buyable button {
  width: 180px;
  height: calc(100% - 12px);
  margin: 6px;
}

.canbuy {
  background: linear-gradient(#bfb, #7f7);
  color: #570;
  transition: all 0.8s ease;
}
.cannotbuy {
  background: linear-gradient(grey, #533);
  color: #200;
  transition: all 0.8s ease;
}

.tooltip {
  position: relative;
}
.detailed {
  text-decoration: underline dotted;
}
/* Tooltip text */
.tooltip .tooltiptext {
  --offsetX: 0px;
  visibility: hidden;
  opacity: 0;
  width: max-content;
  max-width: 400px;
  bottom: calc(100% - 8px);
  left: calc(50% + var(--offsetX));
  transform: translateX(-50%) scale(0.9);
  filter: drop-shadow(0 1px 3px #bfdfff) blur(2px);
  background: linear-gradient(white, #bfdfff);
  color: black;
  text-align: center;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 13.3333px;
  pointer-events: none;

  /* Position the tooltip text - see examples below! */
  position: absolute;
  z-index: 1;
  transition: 0.2s;
}
/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  filter: drop-shadow(0 1px 3px #07f7);
  opacity: 1;
  visibility: visible;
}
.tooltip .tooltiptext::after {
  content: "";
  position: absolute;
  top: calc(100% - 1px);
  left: calc(50% - var(--offsetX));
  transform: translateX(-50%);
  border: 9px solid transparent;
  border-top: 9px solid #bfdfff;
}

.tooltip .tooltiptext.bottom {
  top: 100%;
  bottom: auto;
}
.tooltip:hover .tooltiptext.bottom {
  top: calc(100% + 8px);
}
.tooltip .tooltiptext.bottom::after {
  bottom: calc(100% - 1px);
  top: auto;
  border: 9px solid transparent;
  border-bottom: 9px solid white;
}

/* Modifier table */

.tooltiptext table {
  border-spacing: 0;
}
.tooltiptext table td:first-child {
  text-align: left;
}
.tooltiptext table td:last-child {
  padding-left: 1em;
  text-align: right;
}
.tooltiptext table tr:nth-last-child(2) td {
  padding-bottom: 4px;
}
.tooltiptext table tr:last-child td {
  padding-top: 4px;
}
.tooltiptext table tr:last-child td {
  border-top: 1px solid;
}

.ach {
  border-radius: 12px;
  font-size: 12px;
  width: 90px;
  height: 90px;
  border: 2px solid #0000003f;
}
.ach.incomplete {
  background: linear-gradient(red, black);
  background-size: 120px 120px;
  background-position: 0 -10px;
  color: #ffbfbf;
}
.ach.completed {
  background: linear-gradient(lime, green);
  background-size: 120px 120px;
  background-position: 0 -10px;
  color: #007f00;
}

.criticalError #bg {
  background: linear-gradient(red, #000000);
}
.criticalError #inner_bg {
  background: black;
}
.criticalError button {
  background: #800 !important;
  color: black !important;
  box-shadow: 3px 3px 6px #f007;
}
.criticalError #app,
.criticalError #app * {
  color: red !important;
}
.criticalError pre {
  display: inline-block;
  text-align: left;
}

#notifyarea {
  position: fixed;
  top: 0px;
  right: 0px;
  z-index: 1;
}
.notification {
  position: relative;
  top: 0px;
  right: -6px;
  margin: 6px;
  padding: 2px;
  background-color: #000b;
  color: #ffffff;
  text-align: center;
  border-radius: 6px 0 0 6px;
  z-index: 1;
  animation: notifyOpen 0.3s ease-out;
}
@keyframes notifyOpen {
  0% {
    right: -100%;
  }
  100% {
    right: -6px;
  }
}

.notification.close {
  animation: notifyOpen 0.3s ease-in reverse;
}
@keyframes notifyClose {
  0% {
    right: -6px;
  }
  100% {
    right: -100%;
  }
}

#version {
  position: fixed;
  top: 0;
  right: 0;
  text-align: right;
  opacity: 0.5;
}
#hardreset {
  background: linear-gradient(red, black);
  color: white;
  box-shadow: 3px 3px 6px red;
}

/* GAME */
.buyable:is([role="efficient miner"]) {
  background-image: url("images/StrongMiner_BG_LQ.png");
  background-position: auto 25%;
  background-size: cover 20%;
  color: white;
}

.buyable:is([role="ranged miner"]) {
  background-image: url("images/RangedMiner_BG_LQ.png");
  background-position: auto 10%;
  background-size: cover 20%;
  color: white;
}

.upgrade:is([role="miner power"]) {
  background-image: url("images/SSH_Hashing.png");
}

/*.buyable:is([erole="strong miner"]) button {
  box-shadow: 3px 3px 6px #0107;
  color: white;
  background: linear-gradient(#9aaa98, transparent);
}

.buyable:is([role="ranged miner"]) button {
  box-shadow: 3px 3px 6px #0107;
  color: white;
  background: linear-gradient(#0e8f00, transparent);
}*/

button[role="equipment"] {
  background: linear-gradient(white, #c093ed);
}
button[role="greenpapers"] {
  background: linear-gradient(white, #bfb);
}
button[role="achievements"] {
  background: linear-gradient(white, #ffb);
}

/* Formula thingies */

frac {
  display: inline-block;
  vertical-align: middle;
  width: max-content;
  font-size: 0.9em;
}

frac > div:last-child {
  width: 100%;
  border-top: 1px solid;
}
