/* Reset browser styles */
h1, h2, h3, p, div, ul, li, a {
  margin: 0;
  padding: 0;
  border: 0;
}

/* Sprite Stuff */
:root {
   --pixel-size: 4;
}
 
.Character {
   width: calc(32px * var(--pixel-size));
   height: calc(32px * var(--pixel-size));
   overflow: hidden;
   position: relative;
   margin: 0;
   background-color: pink 0.5;
}

.Character_spritesheet {
   animation: moveSpritesheet 1s steps(4) infinite;
   width: calc(128px * var(--pixel-size));
   position: absolute;
}

.Character_shadow { 
   position: absolute;
   width: calc(32px * var(--pixel-size));
   height: calc(32px * var(--pixel-size));
}

.pixelart {
   image-rendering: pixelated;
}

.face-left {
   top: calc(-32px * var(--pixel-size));
}
.face-right {
   top: calc(-64px * var(--pixel-size));
}
.face-up {
   top: calc(-96px * var(--pixel-size));
}

@keyframes moveSpritesheet {
   from {
      transform: translate3d(0px,0,0)
   }
   to {
      transform: translate3d(-100%,0,0)
   }
}
html, body {
  margin: 0;
  padding: 0;
  font-size: 16px;
  font-family: 'Roboto', 'sans-serif';
  color: darkcyan;
  overflow: auto;
  background: #111;
}
footer {
  position: fixed;
  bottom: 2.5%;
  display: block;
  width: 200px;
  height: 100px;
  overflow-y: scroll;
}

#audio {
	display: block;
	position: absolute;
	bottom: 0;
	left: 0;
	opacity: 50%;
}

#master-grid-container {
  display: grid;
  width: 8000px;
  height: 8000px;
  grid-template-columns: repeat(500, 16px);
  grid-template-rows: repeat(500, 16px);
  margin: 0;
  position: relative;
  background: green;
}

#home-container {
	height: 100vh;
	width: 100vw;
	background: DarkSlateGrey;
}

#embersEdgeLogo {
padding-top: 25px;
background: DarkSlateGrey;
width: 100%;
}

#embersEdgeLogo img {
margin: auto;
display: block;
max-width: 100%;
height: auto;
}

#signin-container {
	background: DarkSlateGrey;
	z-index: 5;
}

#signin-form-container {
  padding: 0;
  text-align: center;
}

#signin-form {
margin: 25px;
background: DarkSlateGrey;
}

/* ============================================================
   #WORLD/GRID STYLING#
   ============================================================ */

.grid-item {
  width: 16px;
  height: 16px;
  background-color: #33cc33;
}

/* ============================================================
   #WOODCUTTING SYSTEM# - Tree Styling
   ============================================================ */

.Tree {
  width: calc(32px * var(--pixel-size));
  height: calc(32px * var(--pixel-size));
  position: relative;
  z-index: 3;
  pointer-events: none;
}

.Tree_sprite {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.3));
}

.tree-normal .Tree_sprite {
  /* Normal trees - green */
}

.tree-oak .Tree_sprite {
  /* Oak trees - brown */
}

.tree-willow .Tree_sprite {
  /* Willow trees - light green */
}

/* ============================================================
   #EQUIPMENT INTERFACE# - Clean Equipment Display
   ============================================================ */

#equipment-interface {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(20, 20, 20, 0.95);
  border: 3px solid #8B4513;
  border-radius: 10px;
  padding: 15px;
  z-index: 1000;
  min-width: 200px;
}

.equipment-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.equipment-header {
  color: #FFD700;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 5px;
  border-bottom: 2px solid #666;
  padding-bottom: 5px;
}

.equipment-slot {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid #555;
  border-radius: 5px;
  padding: 10px;
}

.slot-label {
  color: #aaa;
  font-size: 12px;
  margin-bottom: 5px;
}

.slot-content {
  color: white;
  font-size: 16px;
  font-weight: bold;
  min-height: 24px;
}

.equipped-item-name {
  color: #FFD700;
}

/* Player Health Bar */
#player-health-bar {
  position: fixed;
  top: 70px;
  left: 20px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #666;
  border-radius: 5px;
  padding: 10px;
  z-index: 1000;
  min-width: 200px;
}

.health-label {
  color: #FFD700;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 5px;
}

.health-bar-bg {
  width: 100%;
  height: 24px;
  background: rgba(50, 50, 50, 0.8);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  border: 1px solid #333;
}

.health-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff0000, #cc0000);
  transition: width 0.3s ease;
}

.health-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 1px 1px 2px black;
  z-index: 1;
}

/* ============================================================
   #BAG ICON# - Inventory Toggle
   ============================================================ */

#bag-icon {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  cursor: pointer;
  z-index: 1000;
  transition: transform 0.2s;
}

#bag-icon:hover {
  transform: scale(1.1);
}

/* ============================================================
   #FULL INVENTORY INTERFACE# - RuneScape Style
   ============================================================ */

#full-inventory-interface {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20, 20, 20, 0.98);
  border: 3px solid #8B4513;
  border-radius: 10px;
  padding: 20px;
  z-index: 2000;
  min-width: 700px;
  min-height: 500px;
}

#full-inventory-interface.open {
  display: block;
}

.inventory-container {
  display: flex;
  gap: 30px;
  position: relative;
}

.close-inventory-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #8B4513;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 18px;
  cursor: pointer;
  font-weight: bold;
}

.close-inventory-btn:hover {
  background: #A0522D;
}

.equipment-section, .inventory-section {
  flex: 1;
}

.equipment-section h3, .inventory-section h3 {
  color: #FFD700;
  margin-bottom: 15px;
  border-bottom: 2px solid #666;
  padding-bottom: 5px;
}

.equipment-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.equip-slot {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid #555;
  border-radius: 5px;
  padding: 10px;
  min-height: 80px;
}

.slot-name {
  color: #aaa;
  font-size: 12px;
  margin-bottom: 5px;
}

.slot-item {
  color: #FFD700;
  font-size: 14px;
  font-weight: bold;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  cursor: pointer;
}

.slot-item:hover {
  background: rgba(255, 215, 0, 0.1);
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.inventory-item {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid #555;
  border-radius: 5px;
  padding: 10px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.inventory-item:hover {
  border-color: #FFD700;
  background: rgba(255, 215, 0, 0.1);
}

.inventory-item .item-name {
  color: white;
  font-size: 12px;
  text-align: center;
  margin-bottom: 5px;
}

.inventory-item .item-count {
  color: #FFD700;
  font-size: 14px;
  font-weight: bold;
}

.inventory-item .equip-btn {
  position: absolute;
  bottom: 5px;
  background: #4CAF50;
  color: white;
  border: none;
  padding: 3px 8px;
  font-size: 10px;
  border-radius: 3px;
  cursor: pointer;
}

.inventory-item .equip-btn:hover {
  background: #45a049;
}

/* ============================================================
   #GROUND ITEMS# - Item drops on map
   ============================================================ */

.ground-item {
  position: absolute;
  width: 30px;
  height: 30px;
  background: rgba(255, 215, 0, 0.8);
  border: 2px solid #FFD700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  z-index: 100;
  animation: itemBounce 1s infinite;
}

.ground-item:hover {
  transform: scale(1.2);
  background: rgba(255, 215, 0, 1);
}

@keyframes itemBounce {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}

@keyframes dmgFloat {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-50px); }
}

/* Old Bag Inventory - REMOVE */
#bag-inventory-old {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(40, 40, 40, 0.95);
  border: 3px solid #8B4513;
  border-radius: 10px;
  padding: 20px;
  z-index: 2000;
  display: none;
}

#bag-inventory.open {
  display: block;
}

#bag-inventory h2 {
  color: #FFD700;
  text-align: center;
  margin-bottom: 15px;
}

.bag-grid {
  display: grid;
  grid-template-columns: repeat(5, 60px);
  gap: 8px;
}

.bag-slot {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid #666;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.bag-slot:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #999;
}

/* XP Bar */
#xp-bar-container {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px;
  border-radius: 5px;
  z-index: 1000;
  min-width: 200px;
}

.xp-bar-label {
  color: white;
  font-size: 12px;
  margin-bottom: 5px;
}

.xp-bar {
  width: 100%;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  transition: width 0.3s ease;
  width: 0%;
}

.xp-bar-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 11px;
  text-shadow: 1px 1px black;
  z-index: 1;
}

/* ============================================================
   #SKILLS INTERFACE# - RuneScape Style
   ============================================================ */

#skills-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  z-index: 1000;
  font-size: 16px;
  border: 2px solid #666;
  transition: all 0.2s;
}

#skills-btn:hover {
  background: rgba(0, 0, 0, 0.95);
  border-color: #FFD700;
  transform: translateY(-2px);
}

#skills-interface {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(30, 30, 30, 0.98);
  border: 3px solid #8B4513;
  border-radius: 10px;
  padding: 0;
  z-index: 3000;
  display: none;
  width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}

#skills-interface.open {
  display: block;
}

.skills-header {
  background: #8B4513;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 7px 7px 0 0;
}

.skills-header h2 {
  color: #FFD700;
  margin: 0;
  font-size: 20px;
}

.skills-header .close-btn {
  background: rgba(0, 0, 0, 0.3);
  border: none;
  color: white;
  font-size: 20px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

.skills-header .close-btn:hover {
  background: rgba(0, 0, 0, 0.6);
}

.skills-list {
  padding: 20px;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid #555;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  transition: all 0.2s;
}

.skill-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #888;
  transform: translateX(5px);
}

.skill-item.level-up-flash {
  animation: levelUpFlash 1s ease;
}

@keyframes levelUpFlash {
  0%, 100% { background: rgba(255, 255, 255, 0.05); }
  50% { background: rgba(255, 215, 0, 0.3); border-color: #FFD700; }
}

.skill-icon {
  font-size: 40px;
  min-width: 50px;
  text-align: center;
}

.skill-info {
  flex: 1;
}

.skill-name {
  color: white;
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 5px;
}

.skill-level {
  color: #FFD700;
  font-size: 14px;
  margin-bottom: 3px;
}

.skill-xp {
  color: #aaa;
  font-size: 12px;
  margin-bottom: 8px;
}

.skill-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  overflow: hidden;
}

.skill-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  transition: width 0.5s ease;
  width: 0%;
}

/* ============================================================
   #INTERACTION SYSTEM# - Prompts
   ============================================================ */

#interaction-prompt {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -150%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 12px 25px;
  border-radius: 5px;
  display: none;
  z-index: 1500;
  font-size: 14px;
  border: 2px solid #666;
}

#interaction-prompt.show {
  display: block;
  animation: promptBounce 0.5s ease;
}

@keyframes promptBounce {
  0%, 100% { transform: translate(-50%, -150%); }
  50% { transform: translate(-50%, -160%); }
}

/* ============================================================
   #XP DROPS & LEVEL UP ANIMATIONS#
   ============================================================ */

@keyframes xpDropFloat {
  0% {
    opacity: 1;
    transform: translate(-50%, -100px);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -200px);
  }
}

@keyframes levelUpPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.1); }
}

.xp-drop {
  font-weight: bold;
  text-shadow: 2px 2px 3px black;
  pointer-events: none;
}

.level-up-notification {
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

/* ============================================================
   #COMBAT SYSTEM# - NPCs & Combat UI
   ============================================================ */

.NPC {
  width: calc(32px * var(--pixel-size));
  height: calc(32px * var(--pixel-size));
  position: relative;
  z-index: 3;
  pointer-events: none;
}

.npc-name {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  text-shadow: 1px 1px black;
  font-size: 12px;
  white-space: nowrap;
  z-index: 3;
}

.health-bar {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 4px;
  background: rgba(0, 0, 0, 0.5);
  z-index: 3;
}

.health-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff0000, #cc0000);
  transition: width 0.3s ease;
}

.Goblin_sprite, .Shopkeeper_sprite {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* ============================================================
   #SHOP SYSTEM# - Trading Interface
   ============================================================ */

#shop-interface {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(30, 30, 30, 0.98);
  border: 3px solid #8B4513;
  border-radius: 10px;
  padding: 0;
  z-index: 3000;
  display: none;
  min-width: 500px;
}

#shop-interface.open {
  display: block;
}

.shop-header {
  background: #8B4513;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 7px 7px 0 0;
}

.shop-header h2 {
  color: #FFD700;
  margin: 0;
  font-size: 22px;
}

.shop-header .close-btn {
  background: rgba(0, 0, 0, 0.3);
  border: none;
  color: white;
  font-size: 20px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

.shop-header .close-btn:hover {
  background: rgba(0, 0, 0, 0.6);
}

.shop-items {
  padding: 20px;
  display: grid;
  gap: 15px;
}

.shop-item {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid #666;
  border-radius: 5px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  transition: all 0.2s;
}

.shop-item:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #FFD700;
  transform: translateY(-2px);
}

.shop-item-icon {
  font-size: 40px;
}

.shop-item-info {
  flex: 1;
  color: white;
}

.shop-item-name {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 5px;
}

.shop-item-description {
  font-size: 12px;
  color: #aaa;
}

.shop-item-price {
  color: #FFD700;
  font-size: 16px;
  font-weight: bold;
}

.shop-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.shop-buttons button {
  padding: 10px 30px;
  font-size: 14px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
}

.shop-buttons .buy-btn {
  background: #4CAF50;
  color: white;
}

.shop-buttons .sell-btn {
  background: #2196F3;
  color: white;
}

.shop-buttons .close-btn {
  background: #666;
  color: white;
}

.shop-buttons button:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

#player-gold {
  position: fixed;
  top: 80px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 15px;
  border-radius: 5px;
  color: #FFD700;
  font-weight: bold;
  z-index: 1000;
  display: none;
}

#player-gold.show {
  display: block;
}
