/* Player Menu Button on Hud */
.menu-btn {
  font-family: var(--font-playermenu);
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 20;
  font-size: 1.6em;
  background: linear-gradient(120deg, #22252c 80%, #222335 100%);
  opacity: 0.8;
  color: var(--dk-txt);
  border: 1px solid #3af0ff;
  border-radius: 4px;
  padding: 12px 20px;
  cursor: pointer;
}
.player-menu.hidden {
  display: none;
}

/* Player Menu Styles */
.player-menu {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.60);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Player Menu Content */
.player-menu-content {
  font-family: 'Press Start 2P', var(--font-playermenu);
  background: linear-gradient(120deg, #22252c 80%, #222335 100%);
  border-radius: 8px;
  box-shadow: 0 8px 48px #3af0ff44, 0 0 0 4px #3af0ff22;
  padding: 36px 32px 24px 32px;
  width: 500px;
  min-height: 400px;
  color: var(--title-header);
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  border: 3px solid #3af0ff;
}

/* Player Menu Inner Content */
.player-menu-inner {
  display: flex;
  flex-direction: row;
  height: 100%;
}

/* Player Menu Header */
.h1 {
  font-size: 1.6em;
  margin-top: 1px;
  letter-spacing: 0.08em;
}

/* Left side of Player Menu */
.menu-left {
  width: 250px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  margin-right: 24px;
  margin-top: 16px;
  gap: 12px;
}

/* Right Side of Player Menu */
.menu-right {
  flex: 1;
  display: flex;
}

/* Menu Buttons */
.menu-nav-btn {
  font-family: var(--font-playermenu);
  padding: 12px 0;
  margin-bottom: 4px;
  font-size: 1.4em;
  background: #8a8e9983;
  color: #fffbe6;
  border: 1px solid #3af0ff;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 2px 12px #3af0ff44, 0 0 0 2px #3af0ff22;
  transition: background 0.2s;
}
.menu-nav-btn:hover, .menu-nav-btn.active {
  background: #3aefff8f;
  color: #1b3d41;
  border-color: #3af0ff;
}

/* Player Sprite Preview for Player Menu */
#player-sprite-preview {
  width: 128px;
  height: 128px;
  background: transparent;
  border-radius: 10px;
  bottom: 40%;
  right: 12%;
  display: fixed;
  position: absolute;
  overflow: hidden;
}

/* Player Stats Preview for Player Menu */
#player-stats-preview {
  font-family: var(--font-playermenu);
  color: var(--dk-txt);
  padding: 2px;
  position: absolute;
  bottom: 10%;
  right: 9%;
  font-size: 1.2em;
}

/* Close Button for Player Menu */
.close-btn { 
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: #ffe082;
  font-size: 1.6em;
  cursor: pointer;
  opacity: 0.8;
  transition: color 0.2s, opacity 0.2s;
}
.close-btn:hover {
  opacity: 1;
  color: #fffbe6;
}

/* Hide Menu Pages */
.menu-page {
  display: none;
}

/* Display Menu Pages */
.menu-page.active {
  display: block;
}

/* Inventory Menu */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  grid-template-rows: repeat(3, 64px);
  gap: 12px;
  justify-content: center;
  margin: 24px auto;
}

/* Inventory Slot */
.inventory-slot {
  width: 64px;
  height: 64px;
  background: #8a8e9983;
  border: 1px solid #3af0ff;
  border-radius: 4px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Inventory Slot Image */
.inventory-slot img {
  width: 48px;
  height: 48px;
}

/* Inventory Item Amount Number */
.inventory-amount {
  position: absolute;
  bottom: 4px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 1em;
  padding: 1px 6px;
  border-radius: 3px;
}

/* Overlay for Item Dropdown */ 
#item-dropdown-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 1999;
  background: transparent;
}

/* Dropdown Menu for Items */
.item-dropdown {
  position: fixed;
  width: 240px;
  background: rgba(30,30,30,0.96);
  color: #fff;
  padding: 22px 18px 18px 18px;
  border-radius: 6px;
  z-index: 2000;
  box-shadow: 0 2px 18px rgba(0,0,0,0.22), 0 0 24px 4px rgba(255,255,255,0.12);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  font-family: var(--font-playermenu);
  font-size: 1em;
  transition: box-shadow 0.2s;
}

/* Item Rarity Glows */
.item-dropdown.rarity-common    { box-shadow: 0 2px 18px rgba(0,0,0,0.22), 0 0 24px 4px rgba(255,255,255,0.12);}
.item-dropdown.rarity-rare      { box-shadow: 0 2px 18px rgba(0,0,0,0.22), 0 0 24px 4px rgba(0,180,255,0.18);}
.item-dropdown.rarity-epic      { box-shadow: 0 2px 18px rgba(0,0,0,0.22), 0 0 24px 4px rgba(180,0,255,0.18);}
.item-dropdown.rarity-legendary { box-shadow: 0 2px 18px rgba(0,0,0,0.22), 0 0 24px 4px rgba(255,180,0,0.18);}

/* Item Dropdown Close Button */
.item-dropdown .dropdown-close-btn {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2em;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.item-dropdown .dropdown-close-btn:hover {
  opacity: 1;
}

/* Item Name In Dropdown */
.item-dropdown .dropdown-name {
  font-weight: bold;
  font-size: 1.15em;
  margin-bottom: 6px;
}

/* Item Description In Dropdown */
.item-dropdown .dropdown-desc {
  font-size: 0.98em;
  color: #ffe082;
  margin-bottom: 8px;
}

/* Item Rarity In Dropdown */
.item-dropdown .dropdown-rarity {
  font-size: 0.93em;
  color: #9ff;
  margin-bottom: 14px;
}

/* Buttons In Dropdown Menu */
.item-dropdown .dropdown-btn {
  margin-bottom: 10px;
  padding: 8px 0;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.item-dropdown .dropdown-btn.use {
  background: #3e3;
  color: #222;
}
.item-dropdown .dropdown-btn.remove {
  background: #c33;
  color: #fff;
  margin-bottom: 0;
}

/* Item Remove Amount Block */
.item-dropdown .remove-amount-block {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  gap: 10px;
}

/* Item Remove Amount Button */
.item-dropdown .remove-amount-btn {
  width: 32px;
  height: 32px;
  font-size: 1.2em;
  background: #444;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.item-dropdown .remove-amount-btn:hover {
  background: #666;
}

/* Item Remove Amount Number */
.item-dropdown .remove-amount-num {
  font-size: 1.1em;
  min-width: 24px;
  text-align: center;
}

/* Item Remove Amount Confirm Button */
.item-dropdown .remove-amount-ok {
  margin-left: 12px;
  padding: 6px 18px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.item-dropdown .remove-amount-ok:hover {
  background: #555;
}

/* Quests Menu */
#quests-menu.menu-page {
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 0;
}

/* Quests List */
.quests-list {
  font-family: var(--font-playermenu);
    max-height: 260px;
    overflow-y: auto;
    padding: 0 8px;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0;
}

/* Quest List Reward Item Preview */
.quest-list-item {
    padding: 12px 0 8px 0;
    text-align: left;
}

/* Quest List Divider */
.quest-divider {
    border: none;
    border-top: 1px solid #444;
    margin: 0 0 0 0;
}

/* Quest Menu Tab Buttons */
.quest-tab {
    background: #8a8e9983;
    border: none;
    color: #fffbe6;
    border-radius: 4px 4px 0 0;
    padding: 8px 24px;
    font-size: 1em;
    cursor: pointer;
    opacity: 0.85;
    transition: background 0.2s;
}
.quest-tab.active {
    background: #3aefff8f;
    color: #1b3d41;
    opacity: 1;
}