@import url("css/stats.css");
@import url("css/inventory.css");
@import url("css/stash.css");
@import url("css/skilltree.css");
@import url("css/tooltip.css");
@import url("css/refine.css");
@import url("css/party.css");
@import url("css/randombox.css");
@import url("css/cashshop.css");
@import url("css/market.css");
@import url("css/daily.css");

*,
*::before,
*::after {
  box-sizing: border-box;
}

#scalable-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 1440px;
  height: 720px;
  transform-origin: top left;
}

#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

body,
h2,
h3,
p {
  margin: 0;
}

main,
section,
aside {
  display: block;
}

:root {
  --color-bg-darkest: #222;
  --color-bg-dark: #333;
  --color-panel-bg: #444;
  --color-border-medium: #555;
  --color-border-dark: #666;
  --color-text-light: #eee;
  --color-text-medium: #ccc;
  --color-text-dark: #aaa;
  --color-highlight-primary: #00aaff;
  --color-highlight-secondary: #008cba;
  --color-gold: #ffd700;
  --color-success: #4caf50;
  --color-danger: #f44336;
  --color-danger-dark: #4d0f0f;
  --color-danger-border: #f5c6cb;
  --color-danger-text: #721c24;
  --color-danger-bg: #f8d7da;

  --font-main: "Courier New", Courier, monospace;
  --font-damage: "Arial Black", Gadget, sans-serif;
}

@font-face {
  font-family: "Poppins";
  src: url("assets/fonts/poppins-v24-latin-regular.woff2") format("opentype");
  font-weight: normal;
  font-style: normal;
}

body {
  font-family: "Tahoma", sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: var(--color-bg-darkest);
  color: var(--color-text-light);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  overflow: hidden !important;
  margin: 0;
}

input,
textarea {
  -webkit-user-select: auto;
  -moz-user-select: auto;
  -ms-user-select: auto;
  user-select: auto;
}

main#game-container {
  margin-top: 20px;
}

button {
  font-family: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  background-color: var(--color-border-dark);
  color: var(--color-text-dark);
}

.hidden {
  display: none !important;
}

#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 200;
  color: var(--color-text-medium);
}

#loading-text {
  margin-top: 20px;
  font-size: 1.2em;
}

.spinner {
  border: 8px solid #f3f3f3;
  border-top: 8px solid var(--color-highlight-primary);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1.5s linear infinite;
}

.modal,
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.popup-overlay {
  z-index: 101;
  background-color: rgba(0, 0, 0, 0.7);
}

.modal-content,
.popup-content {
  background: var(--color-panel-bg);
  padding: 20px;
  border-radius: 8px;
  position: relative;
  border: 2px solid var(--color-border-dark);
}

.modal-content {
  width: 600px;
}

.popup-content {
  padding: 25px 35px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.modal-content > h2 {
  margin-bottom: 15px;
}

.modal-close {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-dark);
  font-size: 24px;
  font-weight: normal;
  cursor: pointer;
  z-index: 10;
  border-radius: 50%;
  transition: background-color 0.2s, color 0.2s;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

#popup-message {
  margin: 0 0 20px 0;
  font-size: 1.1em;
  color: var(--color-text-light);
}

#custom-alert-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: 10000;
  backdrop-filter: blur(2px);
  opacity: 1;
  transition: opacity 0.2s ease;
}

#custom-alert-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#custom-alert-box {
  background: var(--color-panel-bg);
  border: 2px solid var(--color-border-dark);
  padding: 20px 24px;
  width: 90%;
  max-width: 350px;
  text-align: center;
  color: var(--color-text-light);
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  animation: fadeInScale 0.2s ease-out;
}

#custom-alert-box h2#custom-alert-title {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.5em;
  color: var(--color-highlight-primary);
  font-weight: normal;
  letter-spacing: normal;
  padding-bottom: 10px;

  border-bottom: 1px solid var(--color-border-dark);
}

#custom-alert-box p#custom-alert-message {
  font-size: 1.1em;
  line-height: 1.5;
  margin: 15px 0 25px;
  color: var(--color-text-medium);
}

#custom-alert-ok-btn,
#custom-alert-cancel-btn {
  border: none;
  border-radius: 5px;
  color: white;
  padding: 10px 24px;
  font-size: 1em;
  font-weight: normal;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease;
  flex-grow: 1;
}

#custom-alert-ok-btn {
  background-color: var(--color-highlight-secondary);
}

#custom-alert-ok-btn:hover {
  background-color: var(--color-highlight-primary);
}

#custom-alert-cancel-btn {
  background-color: #6c757d;
}

#custom-alert-cancel-btn:hover {
  background-color: #868e96;
}

#class-selection-modal .modal-content {
  background: radial-gradient(circle, #3a3a3a 0%, var(--color-bg-darkest) 100%);
  border: 2px solid var(--color-border-dark);
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.7);
  max-width: 800px;
  width: 95%;
  padding: 30px;
}

#class-selection-modal h2 {
  font-family: "DotGothic16", sans-serif;
  font-size: 2.5em;
  text-align: center;
  color: var(--color-highlight-primary);
  text-shadow: 0 0 10px var(--color-highlight-secondary);
  margin-bottom: 25px;
}

.name-input-container {
  text-align: center;
  margin-bottom: 35px;
}

.name-input-container label {
  font-size: 1.1em;
  color: var(--color-text-medium);
  margin-right: 10px;
}

#name-input-wrapper {
  display: inline-block;
  position: relative;
}

#player-name-input {
  background-color: var(--color-bg-dark);
  border: 2px solid var(--color-border-medium);
  border-radius: 5px;
  color: var(--color-text-light);
  font-size: 1.2em;
  padding: 8px 12px;
  width: 250px;
  transition: all 0.3s ease;
  font-family: var(--font-main);
}

#player-name-input:focus {
  outline: none;
  border-color: var(--color-highlight-primary);
  box-shadow: 0 0 10px var(--color-highlight-secondary);
}

#class-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

.class-card {
  background-color: #2c2c2e;
  border: 2px solid var(--color-border-medium);
  padding: 15px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 180px;
  text-align: center;
}

.class-card:hover {
  transform: translateY(-5px) scale(1.05);
  border-color: var(--color-highlight-primary);
  box-shadow: 0 5px 15px rgba(0, 170, 255, 0.3);
}

.class-card.selected {
  transform: translateY(-5px) scale(1.05);
  border-color: #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  background-color: #3e3e40;
}

.class-sprite-container {
  margin-bottom: 20px;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 50%;
  border: 2px dashed var(--color-border-dark);
}

.class-sprite {
  width: 32px;
  height: 32px;
  background-size: 64px 32px;
  background-position: 0 0;
  transform: scale(3);
  image-rendering: pixelated;
  transition: background-position 0.1s steps(1, end);
}

.class-card:hover .class-sprite {
  background-position: -32px 0;
}

.class-card h3 {
  margin-top: auto;
  font-family: "DotGothic16", sans-serif;
  font-size: 1.3em;
  color: var(--color-text-medium);
  transition: color 0.3s ease;
  margin-bottom: 0;
}

.class-card:hover h3,
.class-card.selected h3 {
  color: var(--color-highlight-primary);
}

.class-card.selected h3 {
  color: #ffd700;
}

#confirmation-popup {
  position: static;
  background-color: transparent;
  width: 100%;
  padding: 0;
  margin-top: 20px;
}

#confirmation-popup .popup-content {
  background-color: transparent;
  padding: 0;
  box-shadow: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

#popup-message {
  font-size: 1.2em;
  color: var(--color-text-light);
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  margin: 0;
}

#confirmation-popup.ready #popup-message {
  visibility: visible;
  opacity: 1;
}

.popup-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.popup-btn {
  font-size: 1em;
  font-family: "DotGothic16", sans-serif;
  border: none;
  border-radius: 5px;
  padding: 10px 24px;
  transition: all 0.2s ease;
  min-width: 120px;
}

.popup-btn.confirm {
  background-color: var(--color-highlight-secondary);
  color: white;
}

.popup-btn.confirm:hover:not(:disabled) {
  background-color: var(--color-highlight-primary);
  box-shadow: 0 0 15px var(--color-highlight-primary);
}

.popup-btn.confirm:disabled {
  background-color: var(--color-border-dark);
  color: var(--color-text-dark);
  cursor: not-allowed;
  box-shadow: none;
}

.popup-btn.cancel {
  background-color: #6c757d;
  color: white;
}
.popup-btn.cancel:hover {
  background-color: #868e96;
}
#game-container {
  width: 100%;
  height: 100%;
  margin: 20px auto;
}
#game-area {
  width: 100%;
  aspect-ratio: 2 / 1;
  border: 2px solid var(--color-border-medium);
  background-color: var(--color-bg-dark);
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  background-image: url("assets/images/backgrounds/standard.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#game-area::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: var(--new-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.3s ease-in-out;
}

#game-area.is-fading::before {
  opacity: 1;
}

#time-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: background-color 3s ease-in-out;
  z-index: 0;
  background-color: transparent;
}

#time-overlay.morning {
  background-color: rgba(255, 239, 213, 0.15);
}

#time-overlay.day {
  background-color: rgba(0, 0, 0, 0);
}

#time-overlay.sunset {
  background-color: rgba(255, 165, 0, 0.1);
}

#time-overlay.night {
  background-color: rgba(25, 25, 112, 0.1);
}

.custom-buff-tooltip {
  position: absolute;
  visibility: hidden;
  background-color: rgba(30, 30, 30, 0.95);
  color: #f0f0f0;
  padding: 8px 12px;
  border-radius: 5px;
  border: 1px solid #555;
  z-index: 1000;
  pointer-events: none;
  font-size: 14px;
  white-space: pre;
  transition: opacity 0.1s ease;
  opacity: 0;
}

.custom-buff-tooltip.visible {
  visibility: visible;
  opacity: 1;
}

.panel {
  background-color: var(--color-panel-bg);
  padding: 15px;
  border-radius: 8px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.panel h3 {
  margin-top: 0;
  font-size: 0.8em;
  font-weight: 600;
}

#stats-panel h3, 
#items-panel h3,    
#equipment-panel h3  
{
    border-bottom: 1px solid var(--color-border-dark);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.bulk-action-content {
  max-width: 300px;
  max-height: 200px;
  text-align: center;
}

.bulk-action-item-display {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 8px 0;
  justify-content: center;
}

#bulk-action-item-slot {
  width: 40px;
  height: 40px;
  position: relative;
  background-color: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--color-border-medium);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

#bulk-action-item-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  position: absolute;
  top: 0;
  left: 0;
}

#bulk-action-item-name {
  font-size: 1.2em;
  font-weight: bold;
}

#bulk-action-confirm,
#bulk-action-cancel {
  padding: 0px 20px;
  font-size: 14px;
  width: auto;
  min-width: 100px;
  flex-grow: 0;
  border-radius: 4px;
  height: 30px;
  line-height: 1;
}

#custom-alert-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

#custom-alert-buttons:not(.multiple-buttons) button {
  flex-grow: 1;
}

.cooldown-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.65);
  pointer-events: none;
  z-index: 10;
  height: 0%;
  transition: height 0.1s linear;
}

.global-cooldown-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background-color: rgba(0, 0, 0, 0.75);
  pointer-events: none;
  z-index: 3;
}

.cooldown-timer {
  position: absolute;
  color: white;
  font-size: 0.8em;
  font-weight: bold;
  text-shadow: 1px 1px 4px black;
  pointer-events: none;
  z-index: 20;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}


@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.item-ghost {
  width: 42px;
  height: 42px;
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  transform: scale(1.3);
  opacity: 1;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.item-ghost img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.item-slot.dragging {
  opacity: 0.7;
  transform: scale(0.95);
}

.refine-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  top: auto;
  left: auto;
  font-family: "Arial", sans-serif;
  font-weight: 900;
  font-size: 10px;
  line-height: 1;
  background-color: transparent;
  border: none;
  color: #ffe100;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000,
    1px 1px 0 #000, 0px 2px 2px rgba(0, 0, 0, 0.8);
  z-index: 10;
  pointer-events: none;
}

.modal-content.theme-sell #bulk-action-title,
#custom-alert-box.theme-sell #custom-alert-title {
  color: var(--color-gold);
}

.modal-content.theme-sell #bulk-action-confirm,
#custom-alert-box.theme-sell #custom-alert-ok-btn {
  background-color: #b89500;
}
.modal-content.theme-sell #bulk-action-confirm:hover,
#custom-alert-box.theme-sell #custom-alert-ok-btn:hover {
  background-color: var(--color-gold);
}

#top-right-buttons {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 50;
  display: flex;
  flex-direction: row;
  gap: 10px;
}

#top-right-buttons .action-btn {
  width: 40px;
  height: 40px;
  font-size: 20px;
  color: #fdfdfd;
  background-color: var(--color-panel-bg);
  border: 2px solid var(--color-border-dark);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

#top-right-buttons .action-btn:hover {
  transform: translateY(-2px) scale(1.05);
  background-color: var(--color-border-medium);
  border-color: var(--color-highlight-secondary);
  box-shadow: 0 5px 8px rgba(0, 0, 0, 0.2);
}

#top-right-buttons .action-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

#top-right-buttons .action-btn i {
  transition: transform 0.5s ease-in-out;
  margin: 0;
}

#options-btn:hover i {
  transform: rotate(180deg);
}

#options-panel {
  position: fixed;
  top: 60px;
  right: 0px;
  width: 250px;
  background-color: rgba(44, 44, 44, 0.85);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(120, 120, 120, 0.5);
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  z-index: 1001;
  opacity: 0;
  transform: scale(0.95) translateY(-10px);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

#options-panel.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

#options-panel #close-options-btn {
  display: none;
}

#options-panel .options-header {
  padding: 10px 15px;
}
#options-panel .options-content {
  padding: 0 15px 15px 15px;
}
#options-panel hr {
  border-color: #666666;
  margin: 10px 0;
}

.options-button-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

.options-button-group .popup-btn {
  padding: 8px 12px;
  font-size: 0.9em;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  background-color: #6c757d;
  color: white;
  border: none;
}

.options-button-group .popup-btn:hover {
  background-color: #868e96;
}

#options-panel #logout-btn {
  width: 100%;
  padding: 10px;
  font-size: 1em;
  background-color: #6c757d;
  border: none;
}
#options-panel #logout-btn:hover {
  background-color: #868e96;
}

.volume-slider {
  display: block !important;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 150px;
  height: 6px;
  background: #555;
  border-radius: 3px;
  outline: none;
  margin: 10px 0;
}

.volume-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: #555;
  border-radius: 3px;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #ddd;
  border-radius: 50%;
  border: 1px solid #888;
  cursor: pointer;
  margin-top: -5px;
}

.volume-slider::-moz-range-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: #555;
  border-radius: 3px;
}

.volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #ddd;
  border-radius: 50%;
  border: 1px solid #888;
  cursor: pointer;
}

.other-player-hud {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.custom-slider {
  width: 100%;
  padding: 10px 0;
  cursor: pointer;
}

.slider-track {
  position: relative;
  width: 100%;
  height: 8px;
  background-color: #333;
  border-radius: 5px;
}

.slider-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background-color: var(--track-color, #f2c94c);
  border-radius: 5px;
}

.slider-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 20px;
  height: 20px;
  background-color: #fff;
  border-radius: 50%;
  border: 2px solid #555;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

input[type="range"] {
  display: none;
}

.modal-content.theme-buy #custom-slider {
  --track-color: #12921d;
}

.modal-content.theme-sell #custom-slider {
  --track-color: #b89500;
}

#main-menu-wrapper {
    position: relative;
    display: inline-block;
}

#main-menu-toggle-btn.active {
    background-color: var(--color-highlight-secondary);
    border-color: #fff;
    color: #fff;
}

#main-menu-dropdown {
    position: absolute;
    top: 100%;
    left: -75%; 
    right: auto;
    margin-top: 5px;
    transform: translateX(-50%); 
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: max-content;
    z-index: 61;
    transform-origin: top center;
    animation: menu-pop-horizontal 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes menu-pop-horizontal {
    from { 
        opacity: 0; 
        transform: translateX(-50%) scale(0.8, 0.5) translateY(-5px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(-50%) scale(1) translateY(0); 
    }
}
#main-menu-dropdown.hidden {
    display: none !important;
}

#main-menu-dropdown .action-btn {
    width: 40px;
    height: 40px;
    margin: 0;
    transition: all 0.1s ease;
}

#main-menu-dropdown .action-btn:hover {
    transform: translateX(-3px);
    border-color: var(--color-highlight-primary);
}

#open-daily-btn,
#open-market-btn {
    position: relative; 
}

.notify-badge::after {
    content: '!';
    position: absolute;
    top: -2px; 
    right: -2px; 
    width: 16px;
    height: 16px;
    background-color: #ff3b30;
    color: white;
    font-size: 10px;
    font-weight: bold;
    border-radius: 50%; 
    border: 2px solid #2c3e50; 
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 0 5px rgba(255, 59, 48, 0.8);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(255, 59, 48, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

.panel {
  background-color: var(--color-panel-bg);
  padding: 5px;
  border-radius: 8px;
}

.panel hr {
  border: none;
  border-top: 1px solid var(--color-border-dark);
  margin: 10px 0;
}

.options-section {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #444;
}

.options-section h4 {
  margin: 0 0 10px 0;
  color: var(--color-text-medium);
  font-size: 0.9em;
  font-weight: bold;
  padding-bottom: 0;
  border-bottom: none;
}

.options-button-group {
  display: flex;
  gap: 10px;
  margin: 20px 0;
}

.options-button-group .popup-btn {
  flex-grow: 1;
  padding: 6px 10px;
  font-size: 0.85em;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#options-panel #logout-btn {
  width: 100%;
  padding: 8px;
  font-size: 0.95em;
}

#hotkey-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 10px;
}

.hotkey-setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--color-bg-dark);
  padding: 2px 5px;
  border-radius: 3px;
}

.hotkey-setting-row label {
  font-size: 0.8em;
  color: var(--color-text-light);
}

.hotkey-change-btn {
  min-width: 25px;
  background-color: var(--color-border-medium);
  border: 1px solid var(--color-border-dark);
  color: white;
  padding: 1px 4px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.9em;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.hotkey-change-btn:hover {
  background-color: #777;
}

.hotkey-change-btn.listening {
  background-color: var(--color-highlight-secondary);
  box-shadow: 0 0 5px var(--color-highlight-primary);
  color: white;
}

#chat-indicator {
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 40px;
  height: 40px;
  background-color: rgba(30, 30, 30, 0.75);
  border: 2px solid rgba(150, 150, 150, 0.5);
  border-radius: 30%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 198;
  transition: all 0.2s ease-in-out;
}

#chat-indicator:hover {
  background-color: rgba(60, 60, 60, 0.9);
  border-color: #fff;
  transform: scale(1.1);
}

#chat-indicator i {
  font-size: 24px;
  color: #d0d0d0;
}

#chat-input-wrapper {
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 400px;
  z-index: 200;
  display: flex;
  align-items: center;
  opacity: 0.9;
}

#chat-input {
  width: 100%;
  padding: 8px 45px 8px 12px;
  border-radius: 5px;
  border: 1px solid #000;
  background-color: rgba(20, 20, 20, 0.8);
  color: #fff;
  font-size: 16px;
  outline: none;
}

#chat-send-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #a0a0a0;
  font-size: 28px;
  font-weight: bold;
  padding: 0 10px;
  cursor: pointer;
  transition: color 0.2s ease;
  display: none;
}

#chat-input-wrapper:not(.hidden) #chat-send-btn {
  display: block;
}

#chat-send-btn:hover {
  color: #ffffff;
}

#chat-send-btn.sending {
  animation: send-swoosh 0.3s forwards ease-out;
}

@keyframes send-swoosh {
  0% {
    transform: translateY(-50%) scale(1) translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-50%) scale(1.5) translateX(25px);
    opacity: 0;
  }
}

#chat-log-container {
  position: absolute;
  bottom: 80px;
  left: 20px;
  width: 400px;
  max-height: 150px;
  z-index: 199;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  pointer-events: none;
}

.chat-log-message {
    font-weight: bold;
    text-shadow: 
        -1px -1px 0 #000,  
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000,
         0px 0px 2px #000; 
    margin-bottom: 2px;
    padding: 2px 5px;
}

body.chat-open #chat-indicator {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

.chat-log-message strong {
    text-shadow: 
        -1px -1px 0 #000,  
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000;
}

.chat-name-local {
  color: #efdd6c;
}

.chat-name-party {
  color: #80dbe7;
}

#general-shop-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 51;
  background: none;
  border: none;
  width: auto;
  height: auto;
}

#general-shop-modal .modal-content {
  width: 850px;
  height: 550px;
  padding: 0;
  background-color: var(--color-bg-dark);
  border: 1px solid var(--color-border-dark);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  font-family: "Poppins", "DotGothic16", sans-serif;
  overflow: hidden;
  position: relative;
}

#general-shop-modal > .modal-content > #close-general-shop-btn {
  top: 15px;
  right: 15px;
  z-index: 10;
  font-size: 28px;
}

.general-shop-container {
  display: flex;
  width: 100%;
  height: 100%;
}

#general-shop-modal .shop-mode-tabs,
#general-shop-modal #shop-sell-tabs {
  display: flex;
}

#general-shop-modal .shop-mode-tabs .shop-tab-btn,
#general-shop-modal #shop-sell-tabs .inventory-tab-btn {
  flex: 1;
  text-align: center;
}

#general-shop-modal #shop-grid-display {
  scrollbar-gutter: stable;
}
#general-shop-modal #shop-grid-display::-webkit-scrollbar-track {
  margin-top: 5px;

  background: transparent;
}

.shop-main-area {
  flex: 3;
  padding: 0 10px 10px 10px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--color-border-dark);
}

.shop-mode-tabs {
  display: flex;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--color-border-dark);
}

.shop-tab-btn {
  flex: 1;
  padding: 10px;
  font-size: 1em;
  font-weight: bold;
  background-color: transparent;
  border: none;
  color: var(--color-text-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 3px solid transparent;
}

.shop-tab-btn.active {
  color: var(--color-highlight-primary);
  border-bottom-color: var(--color-highlight-primary);
}

.shop-cart-area h3 {
  margin: 0 0 15px 0;
  padding-top: 12px;
  font-size: 1.2em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border-dark);
  font-size: 1.1em;
  font-weight: 500;
  color: var(--color-text-light);
}

#shop-grid-display {
  flex-grow: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  padding: 5px 15px 5px 5px;
  align-content: start;
}

.shop-item {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg-darkest);
  border: 1px solid var(--color-border-medium);
  border-radius: 4px;
  padding: 8px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  height: 60px;
}

.shop-item:hover {
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
  border-color: #ffd700;
}
.shop-item-info {
  flex-grow: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  gap: 8px;
}
.shop-item-icon-wrapper {
  border: 2px solid transparent;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  position: relative;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}
.shop-item-icon-wrapper img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.shop-item.rarity-common .shop-item-icon-wrapper {
  border-color: #9e9e9e;
}
.shop-item.rarity-uncommon .shop-item-icon-wrapper {
  border-color: #4caf50;
}
.shop-item.rarity-rare .shop-item-icon-wrapper {
  border-color: #2196f3;
}
.shop-item.rarity-epic .shop-item-icon-wrapper {
  border-color: #9d5de4;
}
.shop-item.rarity-legendary .shop-item-icon-wrapper {
  border-color: #f44336;
}

.shop-item .shop-item-name {
  width: 100%;
  font-size: 0.85em;
  font-weight: 500;
  color: var(--color-text-light);

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  min-width: 0;
  text-align: left;
}

.shop-item-text-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  gap: 2px;
}

.shop-item-price {
  font-size: 0.9em;
  font-weight: bold;
  color: var(--color-gold);
  text-align: left;
}

.shop-item .add-to-cart-btn:hover {
  background-color: #ffed8a;
}

.shop-cart-area {
  flex: 2;
  padding: 0 10px 10px 10px;
  background-color: var(--color-bg-darkest);
  display: flex;
  flex-direction: column;
}

#cart-items-list {
  flex-grow: 1;
  overflow-y: auto;
  padding: 0 10px 0 0;
  margin: 0;
}

.cart-empty-msg {
  color: var(--color-text-dark);
  text-align: center;
  margin-top: 40%;
}

.cart-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  margin-bottom: 10px;
  background-color: var(--color-bg-dark);
  border: 1px solid var(--color-border-medium);
  border-radius: 6px;
}

.cart-item-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  grid-column: 1 / 2;
}
.cart-item-icon img {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.cart-item-details {
  grid-column: 2 / 3;
  overflow: hidden;
  padding: 0;
  text-align: left;
}
.cart-item-details .item-name {
  font-weight: 500;
  color: var(--color-text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-details .item-price {
  color: var(--color-text-medium);
  font-size: 0.9em;
}

.cart-item-controls {
  grid-column: 3 / 4;
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: var(--color-bg-darkest);
  border-radius: 4px;
  padding: 4px;
  border: 1px solid var(--color-border-dark);
}

.cart-item-controls .quantity {
  font-size: 1em;
  font-weight: 500;
  min-width: 28px;
  text-align: center;
  color: var(--color-text-light);
}

.cart-item-controls button {
  width: 28px;
  height: 28px;
  background: var(--color-border-medium);
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  line-height: 1;
  font-size: 1.2em;
  padding: 0;
  transition: background-color 0.2s;
}
.cart-item-controls button:hover {
  background-color: #666;
}
.cart-item-controls .remove-btn {
  font-size: 1.5em;
  line-height: 0.8;
}

#cart-summary {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--color-border-dark);
}

.cart-total {
  font-size: 1.1em;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
}

#cart-total-price {
  color: var(--color-gold);
  font-weight: bold;
}

#cart-purchase-btn {
  width: 100%;
  padding: 8px;
  font-size: 0.95em;
  font-weight: bold;
  border-radius: 5px;
  background-color: var(--color-highlight-secondary);
}

#cart-purchase-btn:hover:not(:disabled) {
  background-color: var(--color-highlight-primary);
  box-shadow: 0 0 10px var(--color-highlight-primary);
}

#shop-grid-display::-webkit-scrollbar,
#cart-items-list::-webkit-scrollbar {
  width: 8px;
}
#shop-grid-display::-webkit-scrollbar-track,
#cart-items-list::-webkit-scrollbar-track {
  background: transparent;
}
#shop-grid-display::-webkit-scrollbar-thumb,
#cart-items-list::-webkit-scrollbar-thumb {
  background: var(--color-border-medium);
  border-radius: 4px;
}

#general-shop-modal,
#cash-shop-modal,
#map-selection-modal,
#multiplayer-modal {
  z-index: 51;
}

#bulk-action-modal,
.popup-overlay {
  z-index: 60;
}

#custom-alert-overlay {
  z-index: 1000;
}

.comparable-tooltip {
  z-index: 900;
}

.tooltip-level-info.current-skill-level {
  background-color: rgba(169, 152, 255, 0.15);
  border-left: 3px solid #a998ff;
  padding-left: 10px;
  margin-left: -13px;
  border-radius: 4px;
}

.tooltip-element-line {
  margin-top: 8px;
  padding: 4px 0;
  display: flex;
  font-size: 14px;
}

.tooltip-element-line .label {
  color: var(--color-text-dim);
  font-weight: normal;
}

.tooltip-element-line .value {
  font-weight: bold;
}

.current-skill-level .level-label {
  color: #a998ff;
}

.tooltip-skill-bonus-section {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  padding: 8px;
  margin-top: 5px;
}

.tooltip-stat-line.sp-cost .value {
  color: #f78181;
}

.shop-main-area #shop-sell-tabs {
  display: flex;
}

#map-selection-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#map-selection-modal .modal-content {
  height: 90%;
  aspect-ratio: 1 / 1;
  padding: 10px;
  background-color: #2c2e2e;
  border: 1px solid #555;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

#map-selection-modal .modal-title {
  font-size: 1.1em;
  text-align: center;
  color: var(--color-text-light);
  margin-bottom: 13px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border-dark);
  flex-shrink: 0;
}

#world-map-container {
  position: relative;
  flex-grow: 1;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.world-map-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-location {
  position: absolute;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 215, 0, 0.6);
  border: 2px solid rgba(255, 215, 0, 1);
  border-radius: 50%;
  box-shadow: 0 0 14px 4px rgba(255, 215, 0, 0.5);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease-in-out;
}

.map-location.safe-zone:not(.locked) {
  background-color: rgba(60, 255, 120, 0.7);
  border-color: rgba(60, 255, 120, 1);
  box-shadow: 0 0 15px 4px rgba(60, 255, 120, 0.6);
}

.map-location.safe-zone:not(.locked):hover {
  transform: translate(-50%, -50%) scale(1.4);
  box-shadow: 0 0 22px 6px rgba(120, 255, 180, 0.7);
}

.map-location:not(.locked):hover {
  transform: translate(-50%, -50%) scale(1.4);
  box-shadow: 0 0 22px 6px rgba(255, 255, 120, 0.7);
  z-index: 10;
}
.map-location.boss-lair:not(.locked) {
  background-color: rgba(255, 60, 60, 0.7);
  border-color: rgba(255, 60, 60, 1);
  box-shadow: 0 0 15px 4px rgba(255, 60, 60, 0.6);
  animation: pulse-boss 1.8s infinite ease-in-out;
}
.map-location.locked {
  background-color: rgba(80, 80, 80, 0.8);
  border-color: #222;
  box-shadow: none;
  cursor: not-allowed;
  filter: grayscale(80%);
}
.map-location .location-name {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 1px 5px;
  border-radius: 2px;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s ease, bottom 0.2s ease;
  pointer-events: none;
}

.map-location:hover {
  z-index: 10;
}

.map-location:hover .location-name {
  opacity: 1;
  bottom: 150%;
}

@keyframes pulse-boss {
  0%,
  100% {
    box-shadow: 0 0 15px 4px rgba(255, 40, 40, 0.6);
  }
  50% {
    box-shadow: 0 0 25px 8px rgba(255, 100, 100, 0.8);
  }
}
.chat-name-system {
  color: #ffd700;
  font-weight: bold;
}

#skill-bar-panel-container {
  position: absolute;
  top: -394px;
  left: 255px;
  transform: translateX(-50%);
  width: auto;
  height: auto;
  background: none;
  border: none;
  box-shadow: none;
  padding-top: 20px;
  cursor: grab;
}

#skill-bar-panel-container .panel-drag-handle {
  position: absolute;
  top: 44px;
  left: 224px;
  transform: translateX(-50%);
  width: 220px;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  cursor: grab;
  transition: background-color 0.2s ease;
  z-index: 100;
}

#skill-bar-panel-container .panel-drag-handle:hover {
  background-color: rgba(255, 255, 255, 0.7);
}

#skill-bar-panel-container .panel-drag-handle:active {
  background-color: rgba(255, 255, 255, 0.9);
  cursor: grabbing;
}

#auto-potion-panel-container {
  width: 350px;
  height: 43px;
  top: -395px;
  left: 615px;
  position: absolute;
  pointer-events: none;
}

#auto-potion-panel-container .panel-drag-handle {
  position: absolute;
  top: 45px;
  left: 50%;
  transform: translateX(-50%);
  width: 250px;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  z-index: 100;
  cursor: grab;
  pointer-events: auto;
  transition: background-color 0.2s ease;
}

#auto-potion-panel-container .panel-drag-handle:hover {
  background-color: rgba(255, 255, 255, 0.7);
}

#auto-potion-panel-container .panel-drag-handle:active {
  background-color: rgba(255, 255, 255, 0.9);
  cursor: grabbing;
}


#buff-container {
    position: absolute;
    top: 14%;
    left: 14px;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(6, 34px);
    gap: 8px 4px; 
}

.buff-icon {
  width: 34px;
  height: 34px;
  background-size: contain;
  border: 1px solid var(--color-gold);
  border-radius: 3px;
  position: relative;
  overflow: visible;
  image-rendering: pixelated;
  transform: translateZ(0);
}

.buff-duration-bar-container {
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 2px;
  border: 1px solid rgba(50, 50, 50, 0.8);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.buff-duration-bar {
  width: 100%;
  height: 100%;
  background-color: #f0f0f0;
  border-radius: 1px;
  transition: width 0.25s linear, background-color 0.3s ease;
}

.reroll-menu-list::-webkit-scrollbar {
    width: 6px; 
}

.reroll-menu-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2); 
    border-radius: 3px;
    margin: 5px 0; 
}

.reroll-menu-list::-webkit-scrollbar-thumb {
    background: #485460; 
    border-radius: 3px; 
    transition: background 0.2s;
}

.reroll-menu-list::-webkit-scrollbar-thumb:hover {
    background: #576574;
}

.reroll-menu-list {
    scrollbar-width: thin;
    scrollbar-color: #485460 rgba(0, 0, 0, 0.2);
}

.item-name.rarity-common {
  color: #ffffff;
}
.item-name.rarity-uncommon {
  color: #4dd485;
}
.item-name.rarity-rare {
  color: #52a8e2;
}
.item-name.rarity-epic {
  color: #9b59b6;
}
.item-name.rarity-legendary {
  color: #eb5050;
}
