/* ===========================
   GLOBAL STYLES
=========================== */
body.index_body, body.game_body {
  font-family: Arial, sans-serif;
  background: linear-gradient(120deg, #1c1823, #2e2438, #1c1823);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  color: aliceblue;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
/* ===== Header & Footer ===== */
.site-header {
  display: grid;
  place-items: center;
  padding: 1rem;
  background: transparent;
}

.site-footer {
  background-color: rgba(33, 30, 34, 0.9);
  margin-top: auto;
  text-align: center;
  font-size: 0.9em;
  color: aliceblue;
  padding: 0.5rem;
}

/* ===== Main Section ===== */
main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 1rem;
}

/* ===== Fade-In Lift Animation ===== */
@keyframes fadeInLift {
  0% { opacity: 0; transform: translateY(40px); }
  100% { opacity: 1; transform: translateY(0); }
}
.container {
  display: flex;
  width: 80%;
  max-width: 1100px;
  min-height: 500px;
  justify-content: center;
  align-items: center;
  border: 0.1rem solid #444;
  border-radius: 0.5rem;
  background-color: rgba(33, 30, 39, 0.85);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: fadeInLift 1s ease forwards;
  animation-delay: 0.3s;
  opacity: 0;
}
/* ===== Login Section ===== */
.login-section {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.login-box {
  width: 70%;
  max-width: 400px;
}

h2 {
  text-align: center;
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  background-color: rgb(33, 30, 34);
  color: aliceblue;
  border: 1px solid #444;
  border-radius: 5px;
  box-sizing: border-box;
}

.index_button {
  width: 100%;
  padding: 10px;
  background-color: #6c4994;
  color: aliceblue;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.index_button:hover {
  background-color: #522b69;
}

a {
  color: #b89ff3;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #d6c7ff;
  text-decoration: underline;
}

/* ===== Info Section ===== */
.info-section {
  flex: 1;
  justify-content: left;
  align-items: center;
  padding: 2rem;
  color: aliceblue;
  font-size: 1em;
  line-height: 1.6;
  background: linear-gradient(145deg, rgba(108, 73, 148, 0.3), rgba(82, 43, 105, 0.2));
  border-left: 0.1rem solid #444;
}
/* ===========================
   STRUCTURE
=========================== */
.site-header {
  display: grid;
  place-items: center;
  padding: 1rem;
  background: transparent;
}

.site-footer {
  background-color: rgba(33, 30, 34, 0.9);
  margin-top: auto;
  text-align: center;
  font-size: 0.9em;
  color: aliceblue;
  padding: 0.5rem;
}

main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 1rem;
}

/* ===========================
   MODALS
=========================== */
.modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background-color: #111;
  color: #ddd;
  padding: 20px;
  border-radius: 10px;
  border: 1px solid #444;
  width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content.large { width: 800px; }

.close-account {
  float: right;
  font-size: 20px;
  cursor: pointer;
  color: #999;
}

.close-account:hover { color: white; }

.clickable-username { cursor: pointer; }
.clickable-username:hover { text-decoration: underline; }

/* ===========================
   LEFT / RIGHT PANELS
=========================== */
.leftModal {
  width: 75%;
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  z-index: 1;
}

.rightModal {
  width: 25%;
  height: 100vh;
  background-color: rgba(33, 30, 34);
  border-left: 0.1rem solid #444;
  border-radius: 0 0.3rem 0.3rem 0;
  position: fixed;
  top: 0; right: 0;
  overflow-y: auto;
  box-sizing: border-box;
  z-index: 2;
}

#userModal, #actionModal, #chatModal {
  background-color: rgba(33, 30, 34);
  border: 0.1rem solid #444;
  padding: 0.5rem;
  border-radius: 0.3rem;
  overflow-y: auto;
  margin-right: 0.5rem;
}
#userModal {
  flex: 0 0 15%;
  margin: 0 .5rem .5rem 0;
}

#actionModal {
  flex: 0 0 38%;
  margin: 0 .5rem .5rem 0;
}
#chatModal {
  flex: 0 0 40%;
  margin-right: 0.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 0.1rem solid #444;
  border-radius: 0.3rem;
  overflow: hidden;
  position: relative;
}
/* ===========================
   CHAT LAYOUT
=========================== */
#chatModal {
  flex: 0 0 40%;
  display: flex;
  flex-direction: column;
  border: 0.1rem solid #444;
  border-radius: 0.3rem;
  overflow: hidden;
  position: relative;
}

#chatButtons {
  flex: 0 0 auto;
  height: 23px;
  padding-bottom: 1px;
}

#chatMessages {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  word-wrap: break-word;
}

.message {
  padding: 2px 6px;
  font-size: 0.9rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.message.general { color: aliceblue; }
.message.whisper { color: rgb(55, 114, 165); }
.message.guild   { color: rgb(144, 100, 180); }
.message.market  { color: rgb(60, 138, 102); }
.message.help    { color: rgb(192, 148, 66); }

#chatInputArea {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  box-sizing: border-box;
}

/* Chat Input & Channel Colors */
#chatInput{
  flex: auto;
  padding: 2px;
  resize:none;
  border: 1px solid #444;
  border-radius: 4px;
  background-color: rgb(22, 20, 22);
  color: aliceblue;
  transition: border-color 0.3s, box-shadow 0.3s;
}

#sendChatButton {
  width: 70px;
  height: 2.2rem;
  margin-left: 0.5rem;
  background-color: #6c4994;
  color: aliceblue;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

#sendChatButton:hover { background-color: #522b69; }


/* ===========================
   CHAT CHANNEL BUTTONS
=========================== */
.chatButton {
  background-color: rgba(33, 30, 34, 0.95);
  margin: -10px -10px 0 4px;
  padding: 3px 10px 0 10px;
  cursor: pointer;
  font-size: 1rem;
  height: 2rem;
  border-radius: 4px;
  border: 1px solid #444;
  transition: all 0.25s ease-in-out;
}

/* Per-channel button colors */
#generalChatButton { color: aliceblue; border-color: #666; }
#whisperChatButton { color: rgb(55,114,165); border-color: rgb(55,114,165); }
#guildChatButton   { color: rgb(108,73,148); border-color: rgb(108,73,148); }
#marketChatButton  { color: rgb(60,138,102); border-color: rgb(60,138,102); }
#helpChatButton    { color: rgb(192,148,66); border-color: rgb(192,148,66); }

.chatButton.active {
  color: aliceblue;
}
#whisperChatButton:hover, #whisperChatButton.active { color: aliceblue; background: rgb(55,114,165); }
#guildChatButton:hover,   #guildChatButton.active   { color: aliceblue; background: rgb(108,73,148); }
#marketChatButton:hover,  #marketChatButton.active  { color: aliceblue; background: rgb(60,138,102); }
#helpChatButton:hover,    #helpChatButton.active    { color: aliceblue; background: rgb(192,148,66); }
#generalChatButton:hover, #generalChatButton.active { color: aliceblue; background: #3a3a3a; }

/* ===========================
   ACCOUNT MANAGEMENT (TABBED)
=========================== */
.account-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.account-tab {
  background: #1a1a1a;
  border: 1px solid #444;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: #ccc;
}

.account-tab.active {
  background: rgb(55,114,165);
  color: white;
  border-color: rgb(55,114,165);
}

.tab-content { padding: 10px; border-top: 1px solid #333; }

/* Moderator sub-tabs */
.mod-subtab {
  margin-right: 5px;
  padding: 5px 10px;
  border: 1px solid #444;
  border-radius: 4px;
  cursor: pointer;
  color: #bbb;
}
.mod-subtab.active { background: rgb(55,114,165); color: #fff; }

/* ===========================
   TOAST NOTIFICATIONS
=========================== */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #333;
  color: #fff;
  padding: 10px 15px;
  border-radius: 6px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s;
  z-index: 99999;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: green; }
.toast.error   { background: #b00; }
.toast.info    { background: #555; }

/* ===========================
   MODERATION MENU
=========================== */
.moderation-menu {
  position: absolute;
  background: #111;
  color: #fff;
  border: 1px solid #555;
  border-radius: 6px;
  z-index: 9999;
  width: 160px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}
.moderation-menu ul { list-style: none; margin: 0; padding: 4px; }
.moderation-menu li { padding: 6px 10px; cursor: pointer; }
.moderation-menu li:hover { background: #333; }

/* ===========================
   RESPONSIVE DESIGN
=========================== */
@media (max-width: 1024px) {
  .leftModal, .rightModal {
    position: relative;
    width: 100%;
    height: auto;
    border-radius: 0;
  }
  .leftModal { border-right: none; padding: 0.5rem; }
  .rightModal {
    border-left: none;
    border-top: 0.1rem solid #444;
    padding: 0.5rem;
    overflow-y: visible;
  }
}

@media (max-width: 768px) {
  #chatButtons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
  }
  .chatButton {
    height: auto;
    font-size: 0.85rem;
    padding: 4px 8px;
    margin: 2px;
  }
  #chatInput { width: 100%; font-size: 0.9rem; }
  #sendChatButton { width: 60px; font-size: 0.8rem; }
  #chatMessages { max-height: 300px; }
}

@media (max-width: 480px) {
  #chatMessages { max-height: 200px; }
  #chatInput { font-size: 0.85rem; padding: 6px; }
  #sendChatButton { height: 1.8rem; font-size: 0.75rem; }
  .message { font-size: 0.85rem; }
}
/* === Staff (red tones) === */
#staffChatButton {
  color: rgb(192, 66, 66);
  border-color: rgb(192, 66, 66);
}
#staffChatButton:hover,
#staffChatButton.active {
  background-color: rgb(192, 66, 66);
  color: aliceblue;
}
#activeUserList{
display:none;
position:relative;
top:18px;
left:0;
background:#111;
border:1px solid #444;
border-radius:6px;
padding:6px 10px;
width:180px;
max-height:200px;
overflow-y:auto;
z-index:10000;
}
.skill {
  width:50%;
}
#skillContainer{
    border:1px solid #444;
    width:20%;
}
progress { width: 100%; height: 10px; }
button { margin-top: 5px; }
#woodcuttingHUD {
  background: rgba(255,255,255,0.08);
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 12px;
  box-shadow: 0 0 8px rgba(0,0,0,0.4);
}

#xpBarContainer {
  width: 10%;
  height: 20px;
  background: #333;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 5px;
}

#xpBar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00c853, #64dd17);
  transition: width 0.5s ease;
}

.tree {
  border: 1px solid #555;
  border-radius: 8px;
  padding: 8px;
  margin: 6px 0;
  transition: transform 0.15s;
}
.tree.chopping {
  transform: scale(0.97);
  background: rgba(100,255,100,0.15);
}
.cooldown {
  color: #ccc;
  font-size: 0.9em;
  margin-top: 4px;
}
#skillsInventoryContainer {
  display: grid;
  grid-template-columns: 40% 60%;
  gap: 0.5rem;
  height: auto;
  padding: 0.5rem;
  box-sizing: border-box;
}

#skillsPanel, #skillActionPanel, #inventoryPanel {
  background-color: rgba(33, 30, 34, 0.85);
  border: 1px solid #444;
  border-radius: 6px;
  padding: 10px;
  overflow-y: auto;
}


#skillsPanel h3, #inventoryPanel h3 {
  margin-top: 0;
  text-align: center;
}

.skill-category {
  cursor: pointer;
  font-weight: bold;
  padding: 5px;
  margin-top: 4px;
  border-radius: 4px;
  transition: 0.2s;
}
.skill-category:hover {
  background-color: rgba(108,73,148,0.4);
}

.skill-actions {
  display: none;
  padding-left: 15px;
  margin-top: 5px;
}

.skill-action {
  cursor: pointer;
  padding: 4px;
  border-radius: 3px;
  transition: 0.2s;
}
.skill-action:hover {
  background-color: rgba(55,114,165,0.3);
}

.skill-action.locked {
  opacity: 0.4;
  pointer-events: none;
}

/* Responsive layout */
@media (max-width: 900px) {
  #skillsInventoryContainer {
    grid-template-columns: 1fr;
    height: auto;
  }
  #skillActionPanel {
    order: -1;
  }
}
/* === Skill Progress Bar === */
#skillExpContainer {
  width: 100%;
  margin-top: 10px;
  height:auto;
}

#skillExpBar {
  width: 100%;
  height: 14px;
  background-color: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

#skillExpProgress {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3790d6, #6c49d6);
  border-radius: 8px;
  transition: width 0.8s ease;
}

#skillExpText {
  font-size: 0.9rem;
  margin-top: 4px;
  color: #ccc;
  text-align: left;
}
/* === Skill List Styling === */
.skill-category {
  background-color: rgba(40, 35, 45, 0.9);
  border: 1px solid #444;
  border-radius: 6px;
  margin-bottom: 10px;
  padding: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.skill-category:hover {
  background-color: rgba(55, 50, 65, 0.95);
}

.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.skill-level {
  font-size: 0.85rem;
  color: #9fdfff;
}

.skill-bar {
  width: 100%;
  height: 8px;
  background-color: #222;
  border: 1px solid #333;
  border-radius: 4px;
  overflow: hidden;
}

.skill-bar-fill {
  height: auto;
  background: linear-gradient(90deg, #3790d6, #6c49d6);
  transition: width 0.8s ease;
}

.skill-exp {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  color: #aaa;
}

.skill-actions {
  margin-top: 6px;
  display: none;
}

.skill-action {
  padding: 4px 8px;
  border-radius: 4px;
  margin: 2px 0;
  background-color: #2a2a2a;
  cursor: pointer;
}

.skill-action:hover {
  background-color: #3a3a3a;
}

.skill-action.locked {
  opacity: 0.5;
  cursor: not-allowed;
}
/* Accordion styles */
.skill-area {
  margin: 1rem 0;
  border: 1px solid #444;
  border-radius: 6px;
  background: rgba(33, 30, 34, 0.9);
  overflow: hidden;
}

.accordion-toggle {
  cursor: pointer;
  background: #2b2433;
  color: aliceblue;
  padding: 10px 15px;
  font-size: 1.2rem;
  margin: 0;
  border-bottom: 1px solid #444;
  transition: background 0.3s ease;
}

.accordion-toggle:hover {
  background: #3a3244;
}

.accordion-content {
  display: none;
  padding: 10px;
  animation: slideDown 0.3s ease forwards;
}

.accordion-content.show {
  display: block;
}

.chop-btn {
  display: block;
  width: 100%;
  margin: 5px 0;
  padding: 8px;
  background-color: #6c4994;
  color: aliceblue;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.chop-btn:hover {
  background-color: #522b69;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

