body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: url('assets/bg.jpg') no-repeat center center fixed;
	background-color: #000;
    background-size: contain;
    color: #fff;
}

.game-container {
    width: 100%;
    height: 92vh;
    display: flex;
    flex-direction: column;
    padding: 10px;
    box-sizing: border-box;
}

.top-bar {
    display: flex;
    justify-content: flex-end;
    padding: 10px;
    height: 162px;
    align-items: flex-start;
}

.top-bar button {
    margin-left: 10px;
    padding: 5px 10px;
    background: #444;
    color: #fff;
    border: 1px solid #fff;
    cursor: pointer;
    height: 40px; /* Fixed height */
}

.top-bar button#reset {
    background: #ff0000;
}

.game-content {
    display: flex;
    flex: 1;
    margin-top: 10px;
    height: calc(100% - 162px); /* Adjust for top bar only */
}

.character-panel {
    width: calc(35% - 150px);
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #fff;
    padding: 10px;
}

.player-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.character-stats {
    margin-bottom: 20px;
}

.stat-row {
    display: flex;
    align-items: center;
    margin: 5px 0;
}

.stat-label {
    width: 100px;
    text-align: left;
}

.stat-value {
    width: 50px;
    text-align: right;
    margin-right: 10px;
}

.upgrade-btn {
    background: #676b76;
    color: #fff;
    border: 1px solid #fff;
    padding: 2px 5px;
    cursor: pointer;
}

.upgrade-btn:disabled {
    background: #222;
    cursor: not-allowed;
}

.character-slots {
    position: relative;
    flex: 1;
    min-height: 400px; /* Ensure a minimum height for the container */
}

.character-image {
    width: 100%;
    height: 100%;
    opacity: 0.5;
    position: absolute;
    top: 0;
    left: 0;
    object-fit: contain; /* Ensure the image fits within the container */
}

.slot-wrapper {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.slot {
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #fff;
}

.slot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.slot-label {
    font-size: 12px;
    text-align: center;
    margin-top: 5px;
}

/* Adjusted slot positions to align with the character silhouette */
.head-slot-wrapper { top: 5%; left: 50%; transform: translateX(-50%); } /* Top of the head */
.weapon-slot-wrapper { top: 55%; right: 5%; } /* Moved down to avoid overlap with right hand */
.torso-slot-wrapper { top: 25%; left: 50%; transform: translateX(-50%); } /* Centered on the chest */
.hands-slot-wrapper.left { top: 40%; left: 5%; } /* Left hand */
.hands-slot-wrapper.right { top: 40%; right: 5%; } /* Right hand */
.legs-slot-wrapper { top: 55%; left: 50%; transform: translateX(-50%); } /* Upper legs */
.feet-slot-wrapper.left { bottom: 5%; left: 30%; } /* Left foot */
.feet-slot-wrapper.right { bottom: 5%; right: 30%; } /* Right foot */
.accessory-slot-wrapper.left { top: 20%; left: 5%; } /* Moved up to avoid overlap with left hand */
.accessory-slot-wrapper.right { top: 20%; right: 5%; } /* Moved up to avoid overlap with right hand */

@media (max-width: 1920px) {
	.weapon-slot-wrapper { top: 60%; right: 5%; } /* Moved down to avoid overlap with right hand */
	
	.top-bar {
    height: 122px;
}

.game-content {
    height: calc(100% - 122px); /* Adjust for top bar only */
}

.game-container {
    width: 100%;
    height: 90vh;
}

.inventory-slot {
    width: 80px !important; 
    height: 80px !important;
}

.slot {
    width: 70px;
    height: 70px;
}
}

@media (max-width: 1599px) {
#nm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.inventory-slot {
    width: 90px; 
    height: 90px;
}

#nm-overlay .nm-content {
    background: #222;
    padding: 20px;
    border: 1px solid #fff;
    max-width: 450px;
    max-height: 80vh;
    overflow-y: auto;
    color: #fff;
}

#nm-overlay h2 {
    margin-top: 0;
    text-align: center;
}
}

@media (max-width: 768px) {
#nm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#nm-overlay .nm-content {
    background: #222;
    padding: 20px;
    border: 1px solid #fff;
    max-width: 350px;
    max-height: 80vh;
    overflow-y: auto;
    color: #fff;
}

#nm-overlay h2 {
    margin-top: 0;
    text-align: center;
}
}

.inventory-missions {
    width: calc(65% + 150px);
    margin-left: 10px;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure full height */
}

.missions {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #fff;
    padding: 10px;
    flex: 2;
    /*display: flex;
    flex-direction: column;*/
}

.inventory {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #fff;
    padding: 10px;
    flex: 1;
}

.missions h3, .inventory h3 {
    margin: 0 0 10px 0;
}

.progress-bar {
    width: 100%;
    background: #222;
    height: 28px;
    margin: 10px 0;
	border-radius: 8px;
}

#mission-progress {
    height: 100%;
    background: #1762be;
    text-align: center;
    line-height: 29px;
    transition: width 1s linear; /* Smoothly animate width changes over 1 second */
	border-radius: 8px;
}

.missions button {
    margin: 5px;
    padding: 10px;
    background: #444;
    color: #fff;
    border: 1px solid #fff;
    cursor: pointer;
	min-width: 150px;
}

.inventory-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    width: 100%;
}

.inventory-slot {
    position: relative; /* Make the slot a positioning context for the stack count */
    width: 110px; 
    height: 110px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-slot img {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

#vendor, #trading-depot {
    margin-top: 5px;
    padding: 5px 10px;
    background: #444;
    color: #fff;
    border: 1px solid #fff;
    cursor: pointer;
    width: 100%;
}

.buffs-container {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #fff;
    padding: 10px;
    text-align: center;
    margin-top: 14px;
}

#vendor { height: 65px; }

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-content {
    background: #222;
    padding: 20px;
    border: 2px solid #fff;
	min-width: 750px;
    max-width: 1600px;
    text-align: center;
}

.overlay-buttons {
    margin-top: 20px;
}

.hidden {
    display: none !important;
}

/* Tooltip Styling */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #fff;
    color: #fff;
    padding: 10px;
    z-index: 1000;
    font-size: 14px;
    width: 410px !important;
    pointer-events: none; /* Prevent tooltip from interfering with mouse events */
}

.tooltip .description {
	max-width: 400px !important;
}

.tooltip .item-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.tooltip ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tooltip ul li {
    margin: 2px 0;
}

.tooltip .comparison {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.tooltip .comparison .current, .tooltip .comparison .hovered {
    width: 45%;
}

.tooltip .comparison .current h4, .tooltip .comparison .hovered h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
}

.tooltip .better {
    color: #00ff00; /* Green for better stats */
}

.tooltip .worse {
    color: #ff0000; /* Red for worse stats */
}

#tooltip b {
    font-weight: bold; /* Ensure bold is applied */
}

/* Trading Depot Overlay */
#trading-depot-overlay .overlay-content {
    background: #222;
    padding: 20px;
    border: 1px solid #fff;
    max-width: 600px;
    margin: auto;
    text-align: center;
}

#trading-depot-items {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

#trading-depot-items .item-wrapper {
    display: flex;
    flex-direction: column; /* Stack slot and button vertically */
    align-items: center; /* Center items horizontally */
    width: 110px; /* Match the width of the inventory-slot */
}

#trading-depot-items .inventory-slot {
    width: 110px;
    height: 110px;
    background: #333;
    border: 1px solid #555;
    display: flex;
    align-items: center;
    justify-content: center;
}

#trading-depot-items .inventory-slot img {
    max-width: 100%;
    max-height: 100%;
}

#trading-depot-items .buy-button {
    margin-top: 5px;
    padding: 2px 5px;
    background: #444;
    border: 1px solid #666;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    width: 100%; /* Ensure the button takes the full width of the item-wrapper */
    text-align: center;
}

#trading-depot-items .buy-button:disabled {
    background: #222;
    color: #666;
    cursor: not-allowed;
}

#trading-depot-items .message {
    color: #fff;
    font-size: 14px;
    margin: 10px 0;
}

/* Help Overlay */
#help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    z-index: 1000;
}

#help-overlay .overlay-content {
    background: #222;
    padding: 20px;
    border: 1px solid #fff;
    max-width: 1200px;
    max-height: 80vh;
    overflow-y: auto;
    color: #fff;
	text-align: left;
}

#help-overlay h2 {
    margin-top: 0;
    text-align: center;
}

#help-overlay p {
    margin: 10px 0;
}

#help-overlay .overlay-buttons {
    margin-top: 20px;
}

#help-overlay .overlay-buttons button {
    background: #444;
    color: #fff;
    border: 1px solid #666;
    padding: 5px 10px;
    cursor: pointer;
}

#help-overlay .overlay-buttons button:hover {
    background: #555;
}

@media (min-width: 1600px) {
#nm-overlay {
    display: none;
}
}

.buy-button, #boost-stats, #boost-money, #disable-cheat-mode {
    margin: 5px;
    padding: 5px 10px;
    background: #333;
    color: #fff;
    border: 1px solid #fff;
    cursor: pointer;
}

.buy-button:hover, #boost-stats:hover, #boost-money:hover, #disable-cheat-mode:hover {
    background: #555;
}

#cheat-items .item-wrapper {
    display: inline-block;
    text-align: center;
    margin: 10px;
    width: 110px; 
}

#cheat-items .inventory-slot {
    width: 90px; 
    height: 90px; 
    background: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto; 
}

#cheat-items img {
    max-width: 100%;
    max-height: 100%;
}

#cheat-items .buy-button {
    display: block; 
    margin: 5px auto; 
    width: 90px; 
    padding: 3px 5px;
    background: #333;
    color: #fff;
    border: 1px solid #fff;
    cursor: pointer;
    font-size: 12px; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#cheat-items .buy-button:hover {
    background: #555;
}

#cheat-items .item-name {
    width: 90px; 
    margin: 5px auto; 
    font-size: 12px;
    color: #fff;
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    text-align: center; 
}

#items-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#items-overlay .overlay-content {
    background: #222;
    padding: 20px;
    border: 1px solid #fff;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    text-align: center;
}

#items-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

#items-list .item-wrapper {
    display: inline-block;
    text-align: center;
    margin: 10px;
    width: 110px;
}

#items-list .inventory-slot {
    width: 90px;
    height: 90px;
    background: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

#items-list img {
    max-width: 100%;
    max-height: 100%;
}

#items-list .item-name {
    width: 90px;
    margin: 5px auto;
    font-size: 12px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

#items-list .item-name.epic {
    color: gold; /* Gold color for epic items */
}

#close-items {
    padding: 5px 10px;
    background: #333;
    color: #fff;
    border: 1px solid #fff;
    cursor: pointer;
}

#close-items:hover {
    background: #555;
}

#reset-confirmation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#reset-confirmation-overlay .overlay-content {
    background: #222;
    padding: 20px;
    border: 1px solid #fff;
    max-width: 400px;
    text-align: center;
}

#reset-confirmation-overlay h2 {
    margin: 0 0 10px;
    color: #fff;
}

#reset-confirmation-overlay p {
    margin: 0 0 20px;
    color: #ccc;
}

.confirmation-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

#confirm-reset-yes,
#confirm-reset-no {
    padding: 5px 15px;
    background: #333;
    color: #fff;
    border: 1px solid #fff;
    cursor: pointer;
}

#confirm-reset-yes:hover {
    background: #d33; /* Reddish color to indicate danger */
}

#confirm-reset-no:hover {
    background: #555;
}

#v-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#v-overlay .v-content {
    background: #222;
    padding: 20px;
    border: 1px solid #fff;
    width: 1650px;
    max-height: 675px;
    overflow-y: auto;
    color: #fff;
}

#v-overlay h2 {
    margin-top: 0;
    text-align: center;
}

#lh-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#lh-overlay .lh-content {
    background: #222;
    padding: 20px;
    border: 1px solid #fff;
    width: 1650px;
    max-height: 675px;
    overflow-y: auto;
    color: #fff;
}

#lh-overlay h2 {
    margin-top: 0;
    text-align: center;
}

#lhresult {
	background: #243d75;
	border: 2px #fff solid;
	box-shadow: 0px 0px 2px rgba(0,0,0,1);
	padding: 14px;
	border-radius: 4px;
}

fieldset {
  margin-top: 0.7rem;
  margin-bottom: 0.5rem;
  border: none;
  box-shadow: 0px 0px 2px rgba(0,0,0,1);
  background-color: rgb(12,12,12);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 18px;
}

legend {
  background-color: #243d75;
  padding: 0.55rem;
  font-size: 1.1rem;
  color: white;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
  transform: translateX(-1.1rem);
  box-shadow: -1px 1px 1px rgba(0,0,0,0.8);
}

legend.help {
  background-color: #243d75;
  padding: 0.5rem;
  font-size: 1rem;
  color: white;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
  box-shadow: 2px 2px 2px rgba(0,0,0,0.8);
  text-align: left;
  transform: translateX(-1.6rem);
  width: 200px;
}

legend.current {
  background-color: #e62929;
  padding: 0.55rem;
  font-size: 1.1rem;
  color: white;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
  transform: translateX(-1.1rem);
  box-shadow: -1px 1px 1px rgba(0,0,0,0.8);
}

#v-text, #l-text {
	max-width: 1200px;
}

.item-name.legendary {
    color: #ff00ff !important; /* Magenta for legendary items */
}

#boost-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#boost-overlay .boost-content {
    background: #222;
    padding: 20px;
    border: 1px solid #fff;
    width: 1650px;
    max-height: 675px;
    overflow-y: auto;
    color: #fff;
}

#boost-overlay h2 {
    margin-top: 0;
    text-align: center;
}

.boost-button {
    background: #333;
    color: #fff;
    border: 1px solid #fff;
    padding: 5px 10px;
    margin: 5px;
    cursor: pointer;
}
.boost-button:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
}


#crafting-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#crafting-overlay .crafting-content {
    background: #222;
    padding: 20px;
    border: 1px solid #fff;
    width: 1650px;
    max-height: 675px;
    overflow-y: auto;
    color: #fff;
}

#crafting-overlay h2 {
    margin-top: 0;
    text-align: center;
}

.crafting-button {
    background: #333;
    color: #fff;
    border: 1px solid #fff;
    padding: 5px 10px;
    margin: 5px;
    cursor: pointer;
}

.crafting-button:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
}

#crafting-progress-bar {
    height: 100%;
    background: #1762be;
    text-align: center;
    line-height: 29px;
    transition: width 1s linear; /* Smoothly animate width changes over 1 second */
    border-radius: 8px;
}

#up-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#up-overlay .up-content {
    background: #222;
    padding: 20px;
    border: 1px solid #fff;
    width: 1650px;
    max-height: 675px;
    overflow-y: auto;
    color: #fff;
}

#up-overlay h2 {
    margin-top: 0;
    text-align: center;
}

.up-button {
    background: #333;
    color: #fff;
    border: 1px solid #fff;
    padding: 5px 10px;
    margin: 5px;
    cursor: pointer;
}
.up-button:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
}