:root {
  --accent-transparent: solid rgba(255, 255, 255, 0.3) 1px;
  --primary: #343f51;
  --text-primary: #ebe2d5;
  --text-weak: #aeaeae;
  --text-background: #403d3a;
  --button-default-text: #ebe2d5;
  --button-hover-text: #767069;
  --tray-height: 50px;
  --transluscent-menu: #1e1e1ebe;

}
  
* {
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
  box-sizing: border-box;
  margin: 0;
}

#game-root {
  position: relative;
  min-height: 100vh;
}

#incremental-game,
#rogue-like-game {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100vh;
}
  
*.unselectable {
  -moz-user-select: -moz-none;
  -khtml-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.direction-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
}

.icon__controls:hover {
  cursor: pointer;
}

.icon__controls svg {
  transform: scale(0.33) !important;
  transform-origin: center;
}

.icon__controls:hover svg {
  stroke: orange;
  transform: scale(1.15);
}

.icon__dismiss {
  opacity: 0.6;
}

.icon__dismiss:hover {
  opacity: 1;
  cursor: pointer;
}

.hidden {
  display: none;
}

body {
  background-color: rgba(24, 26, 27, 1);
  color: var(--text-primary);
  text-align: center;
}

#page-container {
  display: grid;
}

#objective-message-text {
  display: flex;
  align-items: center;
  position: relative;
  font-size: 1.2em;
  text-align: left;
  margin-bottom: 0.5em;
  gap: 0.75rem;
}

#objective-message-dismiss {
  display: none;
  position: absolute;
  top: 8px;
  right: 12px;
  pointer-events: auto;
}
  
h1 {
  background-color: rgba(255, 255, 255, 0.1);
  height: 50px;
  max-width: 400px;
  min-width: 200px;
  margin: auto;
  margin-top: 30px;
  margin-bottom: 30px;
  padding: 20px 35px 20px 35px;
  line-height: 10px;
  border-radius: 10px;
  cursor: default;
}
  
#stats-popup {
  display: none;
  position: fixed;
  pointer-events: none;
  will-change: transform;
  background-color: rgba(0, 0, 0, 0.555);
  border: solid orange 1px;
  padding: 10px;
  text-align: left;
}

.orange-highlight {
  color: orange;
}

.context-menu {
  position: absolute;
  background: #2c2c2c;
  border: 1px solid orange;
  border-radius: 6px;
  padding: 5px 0;
  z-index: 9999;
  width: 120px;
}

.context-menu div {
  padding: 6px 10px;
  cursor: pointer;
}

.context-menu div:hover {
  color: rgba(255,165,0);
  background-color: rgba(255,165,0,0.2);
}

.context-menu.hidden { display: none; }
.context-menu button {
  display: block;
  width: 100%;
  margin: 2px 0;
  cursor: pointer;
}

.player-equipment > div > img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.player-equipment > div > img:hover {
  cursor: pointer;
  transform: translateY(-2px);
  background: rgba(255,255,255,0.05);
}

.items-field {
  display: flex;
  gap: 0.5rem;
  padding: 0.5em;
  flex-wrap: wrap;
  justify-content: center;
}

.item-title {
  font-weight: 600;
  line-height: 20px;
}

.column {
  position: relative;
  float: left;
  width: 33.33%;
  min-height: 100vh;
  height: 100%;
  padding: 0 3em 3em 3em;
  border-right: var(--accent-transparent);
}

.column {
  flex: 1;
  min-height: 100vh;
  padding: 0 3em 3em 3em;
  border-right: var(--accent-transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.column-content {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

#column-right{
  border-right: 0;
}

div.resources img {
  width: 32px;
  height: 32px;
  object-fit: contain;
} 
  
div.resources > img:hover {
  cursor: pointer;
}

button:hover {
  cursor: pointer;
}

.rock-nodes {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 2rem;
}

.node-image {
  height: 50px;
  width: 50px;
}

#nodes__tier-two,
#nodes__tier-three {
  display: none;
}
  
.node-image:active {
  transform: scale(1.2);
}

.node-image.cooldown:active {
  transform: none;
}

.node-image:hover {
  cursor: pointer;
}
  
fieldset {
  border-color: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  min-width: 210px;
}
  
legend {
  font-size: 18px;
}

#resources-products {
  display: none;
  margin-block: 25px;
}

select {
  font-size: 0.8em;
  color: #1e1d1b;
  background-color: rgba(255, 255, 255, 0.49);
  border-radius: 7.5px;
  text-overflow: ellipsis;
}

.purchasable-item {
  position: relative;
}

.purchasable-item:after {
  pointer-events: none;
}
  
.purchasable-item:hover {
  cursor: pointer;
}

#furnace-shop:after {
  pointer-events: none;
}

#tool-shop {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: center;
  margin: auto;
  margin-bottom: 10px;
  height: 100%;
  position: relative;
}

#pickaxes-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.pickaxes {
  max-width: 60px;
  height: auto;
}

.resources:not(.hidden) {
  display: inline-flex;
}

#furnace-shop, #anvil-shop, #miner-shop {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 100%;
  position: relative;
  padding: 8px;
}

#furnace-shop img{
  display: flex;
  justify-content: center;
  width: 40px;
  height: auto;
}

#miner-shop img {
  display: flex;
  justify-content: center;
  width: auto;
  height: 50px;
}

.furnace-actions, .anvil-actions {
  display: flex;
  gap: 8px;
}

#anvil-image {
  display: flex;
  justify-content: center;
  width: 40px;
  height: auto;
}
  
.sell-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  justify-content: center;
  gap: 20px;
}

.button-default {
  font-size: 1em;
  background-color: var(--primary);
  color: var(--button-default-text);
  padding: 5px;
  width: 120px;
  border-radius: 10px;
}

.button-small {
  font-size: 0.8em;
  background-color: var(--primary);
  color: var(--button-default-text);
  padding: 5px;
  min-width: 80px;
  max-width: 100px;
  border-radius: 10px;
}

.button-square {
  height: 30px;
  width: 30px;
  font-size: 1em;
  background-color: var(--primary);
  color: var(--button-default-text);
  padding: 5px;
  border-radius: 10px;
}

.button-icon {
  height: 2rem;
  width: 2rem;
  padding: 0;
  border: none;
  background: none;
}

.button-icon svg {
  height: 1.5rem;
  width: 1.5rem;
  color: var(--button-default-text);
}

.button-icon svg:hover {
  color: var(--button-hover-text);
  cursor: pointer;
}

.button-icon:active {
  transform: translateY(2px);
  cursor: pointer;
}

.dev-button {
  margin-top: 10px;
  font-size: 1em;
  background-color: rgba(255, 255, 255, 0.2);
  font-family: tahoma;
  color: #ebe2d5;
  padding: 5px;
  width: 120px;
  border-radius: 10px;
}

.miner-controls:not(.hidden) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#show-dev-tools {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

.sell-btn {
  background-color: rgba(255, 255, 255, 0.2);
  font-family: tahoma;
  color: #ebe2d5;
  padding: 5px;
  width: 120px;
  border-radius: 10px;
}
  
#sell-one {
  margin-right: 15px;
}

#resource-coins {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(to bottom, #2a2f3a, #1e1e1e);
  box-shadow: inset 0 0 8px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.1);
}

#coins-image {
  width: 32px;
  height: 32px;
  object-fit: contain;
  cursor: default;
}

.resource-index,
.shop-index {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.resources {
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 10px;
}

.resources:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.05);
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.resources.sellable.selected-ore {
  border-color: #ffb347;
  box-shadow:
    0 0 10px rgba(255,179,71,0.35),
    inset 0 0 6px rgba(255,179,71,0.25);
}

.resources > img {
  width: auto;
  height: 32px;
}

.resources img {
  height: 2rem;
}

#resource-bronze-helm {
  display: none;
}
  
#messages {
  display: flex;
  flex-direction: column;
}

.info {
  width: 100%;
}

#dev-tools.show {
  display: flex;
  flex-direction: column;
  align-items: center;
}

img.purchasable-item {
  pointer-events: auto;
}

#combat-content {
  display: flex;
  flex-direction: row;
  gap: 1rem;
}

#combat-log {
  border: solid white 1px;
  border-radius: 5px;
  height: 5rem;
  width: 25rem;
  overflow-y: scroll;
  padding: 0.5rem;
}

#combat-log p {
  text-align: left;
}

#objectives-tutorial.show {
  position: absolute;
  bottom: calc(var(--tray-height) + 12px);
  right: 1rem;
  width: 260px;

  display: flex;
  flex-direction: column;
  gap: 0.75rem;

  text-align: left;
  background: rgba(30,30,30,0.95);
  border: 1px solid orange;
  padding: 16px;
  border-radius: 10px;
}

#objectives-tutorial::after {
  content: "";
  position: absolute;
  bottom: -12px;
  right: 1rem;

  width: 0;
  height: 0;

  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 12px solid orange;
}

#objectives-tutorial > div {
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  max-height: 40vh;
  overflow: hidden;
  background: var(--transluscent-menu);
  border-top: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
  z-index: 10000;
}

.drawer-bottom.open {
  transform: translateY(0);
  box-shadow: 0 -10px 30px rgba(0,0,0,0.8);
}

.drawer-right {
  position: fixed;
  top: 0;
  right: 0;
  width: auto;
  max-width: 50%;
  height: 100%;
  background: var(--transluscent-menu);
  border-left: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),     box-shadow 0.4s ease;
  z-index: 9997;
}

.drawer-right.open {
  transform: translateX(0);
  box-shadow: 0 -10px 30px rgba(0,0,0,0.8);
}

.drawer-right.hidden {
  display: none;
}

.control-tray {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--tray-height);
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 9998;
}

.control-tray-tabs {
  display: flex;
  flex-direction: row;
  gap: 1rem;
}

.drawer-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4rem;
  padding: 4rem;
  overflow-y: auto;
}

.drawer-tab {
  height: 50px;
  width: 50px;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.2s ease;
  color: #ebe2d5;
  border-radius: 10px 10px 0 0;
  padding: 8px;
  background: linear-gradient(to bottom, #2a2f3a, #1e1e1e);
  box-shadow: inset 0 0 8px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.1);
}

.drawer-tab:hover {
  transform: scale(1.15);
}

#magic-list {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
  justify-content: center;
}

.spell-btn {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  border: 2px solid transparent;
  transition: all 0.15s ease;
  padding: 0.5em;
}

.spell-btn:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.1);
  cursor: pointer;
}

.spell-btn:active {
  transform: translateY(2px);
  background: rgb(255, 255, 255);
  cursor: pointer;
}

.player-items {
  display: grid;
  grid-template-columns: repeat(4, 64px);
  grid-auto-rows: 64px;
  gap: 12px;
  justify-content: center;
  overflow-y: auto;
}

.item-slot {
  position: relative;
  width: 4rem;
  height: 4rem;
  padding: 0.3rem;
  background: #2a2f3a;
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.item-slot img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}

.item-slot:hover {
  border-color: orange;
  box-shadow: 0 0 6px rgba(255,165,0,0.5);
  cursor: pointer;
}

.stack-count {
  position: absolute;
  bottom: 4px;
  right: 6px;
  font-size: 0.8rem;
  font-weight: bold;
  color: white;
  text-shadow: 0 0 4px black;
}

#game-message {
  display: flex;
  align-items: center;
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  max-width: 80%;
  text-align: center;
  font-size: 1.5em;
  font-weight: bold;
  pointer-events: auto;
  z-index: 9996;
  background-color: var(--text-background);
  padding: 1.2rem 2.5rem;
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  overflow: hidden;
}

#game-message-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: none;
  background: none;
  pointer-events: auto;
  color: var(--text-primary);
  font-size: 1.2rem;
  line-height: 1;
  font-weight: bold;
  opacity: 0.6;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

#game-message-close:hover {
  cursor: pointer;
  opacity: 1;
  transform: scale(1.1);
}

#game-message-close:active {
  transform: scale(0.95);
}

#game-message.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#game-message-text.objective {
  color: var(--text-primary);
  font-weight: bold;
  animation: fadeSlide 0.4s ease;
}

#game-message-text.alert {
  color: #ff5a5a;
  animation: pulse 0.3s ease;
}

#game-message-timer {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background: var(--text-primary);
  transform-origin: left;
  transform: scaleX(1);
}

.timer-running {
  animation: messageTimer linear forwards;
}

@keyframes messageTimer {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.completed-objectives {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.25rem;
}

.completed-objectives > p {
  display: flex;
  text-decoration: line-through;
  text-align: left;
  margin-bottom: 0.5em;
  color: var(--text-weak);
}

.objective-line {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
  margin-bottom: 0.5em;
  gap: 0.75rem;
}

#objectives-tab.flash {
  animation: objectiveFlash 0.5s ease-in-out 3;
}

@keyframes objectiveFlash {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 orange); }
  50%      { transform: scale(1.2); filter: drop-shadow(0 0 10px orange); }
}


#node-map {
  display: none;
  position: relative;
  padding: 2rem;
  text-align: center;
  background: linear-gradient(145deg, #f0e6d2 0%, #e0d8c0 50%, #d8caa8 100%);
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
  margin: 1rem;
  border-radius: 12px;
}

#node-container {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 2rem;
  width: 100%;
}

.node-row {
  display: flex;
  justify-content: center;
  position: relative;
  gap: 2rem;
}

.node {
  position: relative;
  width: 80px;
  height: 60px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
  z-index: 999;
}

.node-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  pointer-events: none;
}

.node.locked {
  pointer-events: none;
}

@keyframes nodePulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.node:not(.locked) .node-icon {
  animation: nodePulse 1.8s ease-in-out infinite;
  transition: transform 0.15s ease;
}

.node:not(.locked):hover .node-icon {
  animation: none;
  transform: scale(1.2);
}

.node:not(.locked):hover {
  transform: translateY(-4px);
}

.node.completed {
  background: #4caf50;
}

#node-connections {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

#rogue-like-game {
  justify-content: center;
  align-items: center;
  position: relative;

  background:
    radial-gradient(
      ellipse at center,
      rgba(0,0,0,0) 40%,
      rgba(0, 0, 0, 0.858) 75%,
      rgba(0,0,0,0.9) 100%
    ),
    url("images/caves_background.png");

  background-size: auto, contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: black;
}

#rogue-like-game.active {
  display: flex;
}

#arena {
  flex: 1;
  display: flex;
  gap: 3rem;
  justify-content: space-around;
  align-items: center ;
  margin-bottom: 20px;
  padding: 20px;
}

#player-sprite, #enemy-sprite {
  width: 128px;
  height: 128px;
  object-fit: contain;
}

#player-arena, #enemy-arena {
  display: flex;
  position: relative;
  flex-direction: column;
  align-items: center;
}

#mines {
  display: flex;
  align-items: center;
  gap: 4rem;
}

#treasure-rocks {
  height: 256px;
  width: auto;
  object-fit: contain;
}

#treasure-rocks:hover {
  cursor: pointer;
}

.hp-container {
  margin: 10px 0;
  width: 250px;
}

.hp-label {
  font-size: 14px;
  margin-bottom: 4px;
}

.hp-bar {
  width: 100%;
  height: 18px;
  background-color: #333;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #555;
}

.hp-fill {
  height: 100%;
  width: 100%;
  background-color: #4caf50;
  transition: width 0.25s ease;
}

.hp-fill.enemy {
  background-color: #e53935;
}

.damage-number {
  position: absolute;
  left: 50%;
  top: 20%;
  transform: translateX(-50%);
  font-size: 2em;
  font-weight: bold;
  pointer-events: none;
  animation: float-damage 0.8s ease-out forwards;
}

.damage-number.miss {
  color: gray;
  font-style: italic;
}

.damage-number.crit {
  color: gold;
  font-size: 2.5em;
}

.damage-number.heal {
  color: lime;
}

.damage-number.block {
  color: cyan;
}

#player-receives, #enemy-receives {
  position: absolute;
  font-size: 2em;
  font-weight: bold;
  color: red;
}

#player-equipment-roguelike {
  display: none;
  position: absolute;
  z-index: 1000;
}

.damage-pop {
  animation: float-damage 1s forwards;
}

#death-screen {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 40px;
  z-index: 10000;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 20px;
}

#victory-screen {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 40px;
  z-index: 10000;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 20px;
}


@keyframes float-damage {
  0% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -60px);
  }
}

#combat-hud {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  gap: 10px;
}


@media (max-width: 800px) {
  .column {
    width: 100%;
    min-height: 500px;
  }

  
}
@media (max-width: 860px) {
  .player-items {
    grid-template-columns: repeat(3, 64px);
    grid-auto-rows: 64px;
    gap: 12px;
    justify-content: center;
    overflow-y: auto;
  }
}