/* Reset and base */
html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #0a0a0a;
  color: #ddd;
}
body {
  display: flex;
  flex-direction: column;
}
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: black;
  z-index: 9999;
  opacity: 1;
  animation: fadeOut 1.5s ease-out forwards;
  pointer-events: none;
}
@keyframes fadeOut {
  to {
    opacity: 0;
  }
}
/* Header */
header {
  background-color: #1f1f1f;
  background-image:
    linear-gradient(135deg, rgba(99, 60, 17, 0.05) 25%, transparent 25%),
    linear-gradient(225deg, rgba(99, 60, 17, 0.05) 25%, transparent 25%),
    linear-gradient(45deg, rgba(99, 60, 17, 0.05) 25%, transparent 25%),
    linear-gradient(315deg, rgba(99, 60, 17, 0.05) 25%, #1f1f1f 25%);
  background-size: 40px 40px;
  padding: 2rem;
  text-align: center;
  border-bottom: 3px solid #633c11;
  transition: all 0.5s ease;
  flex-shrink: 0;
  z-index: 10;
  position: relative;
}
@keyframes flicker {
  0%, 100% { box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.05); }
  50% { box-shadow: inset 0 0 90px rgba(255, 140, 0, 0.1); }
}
header {
  animation: flicker 3s infinite ease-in-out;
}
header.hidden {
  padding: 0;
  border: none;
  height: 0;
  overflow: hidden;
}
header h1, #intro p, #intro h2 {
  user-select: none;
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none;    /* Firefox */
  -ms-user-select: none;     /* IE10+ */
  cursor: auto; /* Optional: indicate interactivity */
}
header h1 {
  font-family: 'UnifrakturCook', cursive;
  font-size: 4rem;
  margin: 0;
  background: linear-gradient(45deg, #f7d488, #a97234, #f7d488);
  background-size: 200% auto;
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 2.5s linear infinite;
  text-shadow: 0 0 8px rgba(255, 215, 100, 0.3);
  cursor: pointer; /* Optional: indicate interactivity */
}
@keyframes shine {
  0% {
    background-position: 200% center;
  }
  100% {
    background-position: 0% center;
  }
}
/* Menu button */
.menu-button {
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: 70px;
  height: 70px;
  background-color: #a97234;
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 1001;
  box-shadow: 0 0 10px #a97234aa;
  user-select: none;
  transition: background-color 0.3s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0; /* remove default padding */
}
.menu-button img {
  width: 60px;
  height: 60px;
  pointer-events: none;
  /*filter: brightness(0) invert(1);  makes it white */
}
.menu-button:hover {
  background-color: #c08e3a;
  box-shadow: 0 0 14px #c08e3aaa;
  transform: scale(1.05);
}
.menu-button.highlighted {
  position: fixed;
  border: none; /* remove existing border */
}

.menu-button.highlighted::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(
    from 0deg,
    #f5c156,
    #e07b39,
    #a97234,
    #ff9f1c,
    #f5c156,
    #e07b39,
    #a97234,
    #ff9f1c
  );
  -webkit-mask:
    radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))
    content-box;
  mask:
    radial-gradient(farthest-side, transparent calc(100% - 4px), black calc(100% - 3px))
    content-box;
  animation: spin 2s linear infinite;
  pointer-events: none;
  z-index: 1002;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


.floating-menu {
  position: fixed;
  top: 6rem;
  left: 1rem;
  background-color: #1f1f1fdd;
  border: 1px solid #633c11;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 0 20px #633c1177;
  z-index: 1000;
  user-select: none;
  width: 120px;
  /* animation-ready styles */
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.2s ease;
}
.floating-menu.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  max-height: 500px;
}
.floating-menu a {
  display: flex;
  align-items: center;
  color: #d1b378;
  text-decoration: none;
  margin-bottom: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.3s ease;
  gap: 0.5rem; /* space between icon and text */
}

.floating-menu a img {
  width: 16px;
  height: 16px;
  /*filter: brightness(0) saturate(100%) invert(75%) sepia(40%) saturate(500%) hue-rotate(10deg);*/
}
.floating-menu a:hover {
  color: #f0d99a;
  text-shadow: 0 0 3px #f0d99a;
}
/* Main container for sections */
main {
  flex-grow: 1;
  position: relative;
  height: calc(100vh - 7.5rem);
  overflow: hidden;
}
/* Common styles for all page sections */
.page-section {
  visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  padding: 3rem 4rem;
  box-sizing: border-box;
  color: #ddd;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  user-select: text;
  border-radius: 0;
  transition: background-color 0.5s ease;
  box-shadow: inset 0 0 60px #000000cc;
}
.page-section.active {
  visibility: visible;
  z-index: 999; /* REMOVABLE */
  animation: fadeInUp 1s ease forwards;
}
/* Fade and slide up animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Scrollbar styling */
.page-section::-webkit-scrollbar {
  width: 8px;
}
.page-section::-webkit-scrollbar-thumb {
  background: #633c11aa;
  border-radius: 4px;
}
.page-section::-webkit-scrollbar-track {
  background: transparent;
}
/* Specific page styles */
/* Main Page */
#intro {
  position: relative;
  background: linear-gradient(135deg, #121212, #1b1b1b);
  text-align: center;
  color: #e2c893;
  text-shadow: 0 0 5px #a9732c;
  overflow: hidden;
}

.logo {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 110%; /* adjust size */
  transform: translate(-50%, -50%);
  opacity: 0.1; /* adjust opacity */
  pointer-events: none; /* lets users click through it */
}

#intro h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-family: 'UnifrakturCook', cursive;
  text-shadow: 0 0 8px #a9732c;
}
#intro p {
  font-size: 1.3rem;
  line-height: 1.6;
  max-width: 700px;
  margin: 0 auto 1.5rem auto;
  color: #e2c893cc;
}
/* Saloon page wrapper */
#saloon {
  background: linear-gradient(120deg, #3a2613, #6a4e1e);
  color: #f4e1b1;
  box-shadow: inset 0 0 40px #3a2613cc;
  font-weight: 600;
  display: flex;
  height: 100%;
  padding: 0; /* remove page section padding to handle inside */
  overflow: hidden;
}
/* Saloon columns */
.saloon-sidebar {
  background-color: #4a3210;
  box-shadow: inset 0 0 12px #301e07aa;
  padding: 1.5rem 1.8rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  user-select: none;
  scrollbar-width: thin;
  scrollbar-color: #d7b36a transparent;
  min-width: 280px;
  max-width: 320px;
}
/* Left sidebar */
#saloon-left {
  border-right: 2px solid #6e4c13;
}

.sidebar-tabs {
  display: flex;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.tab-button {
  background-color: #6a4e1e;
  color: #f4e1b1;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}

.tab-button.active {
  background-color: #8a6a3d;
  box-shadow: 0 0 6px #d7b36a88;
}

.tab-content {
  display: block;
}

.tab-content.hidden {
  display: none;
}

/* Center content */
#saloon-center {
  flex-grow: 1;
  box-sizing: border-box;
  overflow-y: auto;
  user-select: text;
  color: #f4e1b1cc;
  scrollbar-width: thin;
  scrollbar-color: #d7b36a transparent;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
/* Right sidebar - chat */
#saloon-right {
  border-left: 2px solid #6e4c13;
  background-color: #4a3210;
  box-shadow: inset 0 0 12px #301e07aa;
  padding: .6rem .6rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  user-select: text;
  scrollbar-width: thin;
  scrollbar-color: #d7b36a transparent;
}
/* Hide right sidebar initially */
#saloon-right.hidden {
  display: none;
}
/* Scrollbar for all scrollable areas */
#saloon-left::-webkit-scrollbar,
#saloon-center::-webkit-scrollbar,
#saloon-right::-webkit-scrollbar {
  width: 8px;
}
#saloon-left::-webkit-scrollbar-thumb,
#saloon-center::-webkit-scrollbar-thumb,
#saloon-right::-webkit-scrollbar-thumb {
  background: #d7b36aaa;
  border-radius: 4px;
}
#saloon-left::-webkit-scrollbar-track,
#saloon-center::-webkit-scrollbar-track,
#saloon-right::-webkit-scrollbar-track {
  background: transparent;
}
/* Headings in saloon */
#saloon-left h3,
#saloon-center h3,
#saloon-right h3 {
  font-family: 'UnifrakturCook', cursive;
  font-size: 1.8rem;
  margin: 0 0 1rem 0;
  color: #f4e1b1;
  text-shadow: 0 0 6px #f4e1b1;
  user-select: none;
}
/* Buttons and inputs consistent with saloon */
#saloon-left button,
#saloon-left input,
#saloon-left select {
  font-weight: 700;
  border: 2px solid #d7b36a;
  background-color: #4f3712;
  color: #ffeab7;
  box-shadow: 0 0 8px #d7b36a88;
  transition: all 0.3s ease;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 1rem;
  width: 100%;
  box-sizing: border-box;
}
#saloon-left button:hover,
#saloon-left input:hover,
#saloon-left select:hover {
  background-color: #654917;
  border-color: #f9e58c;
  box-shadow: 0 0 12px #f9e58ccc;
  color: #fff;
}
/* Room list in center */
#room-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 100%;
  overflow-y: auto;
  color: #f4e1b1cc;
}
#room-list li {
  background: #6a4e1e88;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.8rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  box-shadow: 0 0 6px #533c12;
}
#room-list li:hover {
  background: #a9732cdd;
  color: #1b1b1b;
  box-shadow: 0 0 10px #a9732cdd;
}
#room-list li .join-btn {
  background-color: #a97234cc;
  border: none;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-weight: 700;
  color: #1b1b1b;
  box-shadow: 0 0 8px #a9732cdd;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease;
}
#room-list li .join-btn:hover {
  background-color: #d7b36a;
  box-shadow: 0 0 12px #d7b36a;
}
/* Player list when in room */
#player-list {
  list-style: none;
  padding: 0;
  margin: 0;
  color: #f4e1b1cc;
  overflow-y: auto;
  flex-grow: 1;
  font-weight: 600;
}
#player-list li {
  position: relative;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #6e4c13;
  user-select: none;
  overflow: visible;
}
#player-list li.current-player {
  background-color: #a9732caa;
  color: #1b1b1b;
  font-weight: 700;
}

.floating-chat-bubble {
  position: absolute;
  background: #fff7e6;
  color: #1b1b1b;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.85em;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  animation: messagefadeInOut 3s forwards;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);

  /* Make space for the tail on the left */
  margin-left: 12px;
}

/* Tail on the LEFT of the bubble, pointing RIGHT */
.floating-chat-bubble::before {
  content: '';
  position: absolute;
  left: 0;            /* tail at bubble’s left edge */
  top: 50%;
  transform: translate(-100%, -50%);
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 10px solid #fff7e6;  /* tail pointing right */
}

@keyframes messagefadeInOut {
  0% { opacity: 0; transform: translateY(0%); }
  10% { opacity: 1; transform: translateY(-45%); }
  90% { opacity: 1; transform: translateY(-55%); }
  100% { opacity: 0; transform: translateY(-100%); }
}


/* Map grid container */
#map-grid {
  flex-grow: 1;
  background: #654917;
  border-radius: 12px;
  box-shadow: inset 0 0 30px #3a2613;
  padding: 1rem;
  overflow: auto;
  user-select: none;
  display: grid;
  grid-template-columns: repeat(15, 40px);
  grid-template-rows: repeat(10, 40px);
  gap: 2px;
  justify-content: center;
  align-content: center;
  margin-top: 0.5rem;
}
/* Single cell for map */
.map-cell {
  width: 40px;
  height: 40px;
  background-color: #a9732c;
  border-radius: 4px;
  box-shadow: inset 0 0 8px #654917;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.map-cell:hover {
  background-color: #d7b36a;
}
/* Chat styles */
#chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
#chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 0.5rem 1rem;
  background-color: #5a3e11;
  border-radius: 8px;
  box-shadow: inset 0 0 8px #3a2613;
  font-size: 0.9rem;
  line-height: 1.3;
  color: #f4e1b1cc;
  user-select: text;
  overflow-x: hidden;
}
#chat-messages p {
  margin: 0 0 0.5rem 0;
  word-wrap: break-word;
}
#chat-input-container {
  margin-top: 1rem;
  grid-template-columns: auto 60px;
  display: grid;
  gap: 0.6rem;
}
#chatInput {
  flex-grow: 1;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 2px solid #d7b36a;
  background-color: #4f3712;
  color: #ffeab7;
  box-shadow: 0 0 8px #d7b36a88;
  transition: all 0.3s ease;
  user-select: text;
  min-width: 0px;
}
#chatInput:focus {
  outline: none;
  border-color: #0c0c0a;
  box-shadow: 0 0 14px #f9e58ccc;
  background-color: #654917;
  color: #fff;
}
#chat-send-btn {
  padding: 0.6rem 1.2rem;
  background-color: #d7b36a;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  color: #1b1b1b;
  cursor: pointer;
  box-shadow: 0 0 10px #d7b36aaa;
  user-select: none;
  transition: background-color 0.3s ease;
}
#chat-send-btn:hover {
  background-color: #f9e58c;
  box-shadow: 0 0 14px #f9e58ccc;
}
.message {
  display: flex;
  gap: 0.4rem;
  margin-bottom: .6rem;
  align-items: flex-start;
}
.message img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #a97234;
}
.message-content {
  flex-grow: 1;
  min-width: 0; /* ✅ crucial for flex layouts */
}
.message-header {
  font-weight: bold;
  color: #e2c893;
  margin-bottom: 0.2rem;
  font-size: 0.95rem;
}
.message-header span {
  font-size: 0.75rem;
  font-weight: 500;
  color: #d7b36a;
  margin-left: 0.5rem;
}
.message-body {
  font-size: 0.9rem;
  color: #ffeab7;
  word-wrap: break-word;     /* Wrap words that are too long */
  white-space: pre-wrap;     /* Preserve newlines, wrap normally */
  overflow-wrap: break-word; /* Force break on long words */
}


#dice-context-menu {
  position: absolute;
  display: none;
  flex-direction: column;
  background: #362707;
  border: 1px solid #d7b36a;
  border-radius: 6px;
  box-shadow: 0 0 8px #d7b36a88;
  padding: 0.25rem;
  z-index: 9999;
  transform: translate(-100%, -100%); /* Position from bottom-right corner */
}

#dice-context-menu button {
  background: none;
  border: none;
  color: #ffeab7;
  text-align: left;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  width: 100%;
  line-height: 1.2;
  white-space: nowrap;
}

#dice-context-menu button:hover {
  background-color: #d7b36a22;
  color: #fff1c1;
}



/* Buttons to leave room */
#leave-room-btn, #invite-room-btn {
  background-color: #a97234cc;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  color: #1b1b1b;
  box-shadow: 0 0 8px #a9732cdd;
  cursor: pointer;
  user-select: none;
  margin-top: 1rem;
  transition: background-color 0.3s ease;
  width: 100%;
}
#leave-room-btn:hover, #invite-room-btn:hover {
  background-color: #d7b36a;
  box-shadow: 0 0 12px #d7b36a;
}
/* Other page styles */
#world {
  background: linear-gradient(120deg, #133a1d, #1e6a22);
  color: #b9f4b1;
  box-shadow: inset 0 0 40px #133a15cc;
  padding: 3rem 4rem;
  overflow-y: auto;
}
#characters {
  background: linear-gradient(135deg, #3e2a54, #6a4e7e);
  color: #d4c4f7;
  padding: 3rem 4rem;
  overflow-y: auto;
}
#compendium {
  background: linear-gradient(135deg, #223366, #335599);
  color: #cce3f5;
  padding: 1rem 1rem;
  overflow-y: auto;
  font-family: 'Cinzel', serif;
  display: flex;
  height: 100vh;
  margin: 0;
}
/* Footer */
footer {
  background-color: #1f1f1f;
  color: #6e4c13;
  text-align: center;
  padding: 1rem 0;
  font-weight: 600;
  flex-shrink: 0;
  border-top: 3px solid #633c11;
  user-select: none;
  transition: all 0.5s ease;
}
footer.hidden {
  padding: 0;
  border: none;
  height: 0;
  overflow: hidden;
}
.topbar {
  background-color: #1f1f1f;
  background-image:
    linear-gradient(135deg, rgba(99, 60, 17, 0.05) 25%, transparent 25%),
    linear-gradient(225deg, rgba(99, 60, 17, 0.05) 25%, transparent 25%),
    linear-gradient(45deg, rgba(99, 60, 17, 0.05) 25%, transparent 25%),
    linear-gradient(315deg, rgba(99, 60, 17, 0.05) 25%, #1f1f1f 25%);
  background-size: 40px 40px;
  border-bottom: 3px solid #633c11;
  padding: 0.5rem 1rem;
  animation: flicker 3s infinite ease-in-out;
  position: relative;
  z-index: 10;
  overflow: hidden;
}
.topbar.hidden {
  padding: 0;
  border: none;
  height: 0;
  overflow: hidden;
}
@keyframes flicker {
  0%, 100% { box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.05); }
  50% { box-shadow: inset 0 0 90px rgba(100, 50, 0, 0.1); }
}
.topbar a,
.topbar .dropdown {
  float: right;
  font-weight: 600;
  font-size: 1rem;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.topbar a {
  display: block;
  padding: 12px 16px;
  color: #d1b378;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}
.topbar a:hover {
  background-color: #2e1f10;
  color: #f0d99a;
  text-shadow: 0 0 4px #f0d99a;
  transform: translateY(-2px);
}
.dropdown .dropbtn {
  background: none;
  border: none;
  color: #d1b378;
  padding: 12px 16px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}
.dropdown .dropbtn:hover {
  color: #f0d99a;
  text-shadow: 0 0 4px #f0d99a;
  transform: scale(1.05);
}
.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: #2a1d11;
  border: 1px solid #633c11;
  box-shadow: 0 0 12px #633c1177;
  border-radius: 6px;
  z-index: 100;
  animation: dropdownFadeIn 0.3s ease-in-out;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  min-width: 160px;
}
.dropdown:hover .dropdown-content {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.dropdown-content a {
  display: block;
  color: #e2c893;
  padding: 10px 14px;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 600;
}
.dropdown-content a:hover {
  background-color: #4a3210;
  color: #fff6d5;
  padding-left: 18px;
  text-shadow: 0 0 4px #ffe7b2;
}
@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.social-sidebar {
  position: fixed;
  bottom: 0%;
  left: 0;
  transform: translateY(0%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px;
  z-index: 1000;
}

.social-icon {
  width: 40px;
  height: 40px;
  background-color: #1a1a1a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.social-icon:hover {
  background-color: #444;
}

.social-icon img {
  width: 20px;
  height: 20px;
  filter: invert(1); /* makes icons white if they are black */
}


@media (max-width: 768px) {
  /* General fixes */
  html, body {
    overflow: auto;
  }
  
  @media (max-width: 768px) {
    body {
      font-size: 0.95rem;
      line-height: 1.4;
    }
  }

  header h1 {
    font-size: 2.5rem;
  }

  .menu-button {
    width: 50px;
    height: 50px;
  }

  .menu-button img {
    width: 36px;
    height: 36px;
  }

  .floating-menu {
    width: 100px;
    left: 0.5rem;
    top: 4.5rem;
    padding: 0.5rem;
  }

  .floating-menu a {
    font-size: 0.85rem;
  }

  main {
    height: auto;
    overflow: hidden;
  }

  .page-section {
    padding: 1.5rem 1rem;
  }

  #intro h2 {
    font-size: 2rem;
  }

  #intro p {
    font-size: 1rem;
    padding: 0 1rem;
  }

  /* Saloon layout - stack columns */
  #saloon {
    flex-direction: column;
  }

  #saloon-left,
  #saloon-right,
  #saloon-center {
    min-width: 100%;
    max-width: 100%;
    padding: 1rem;
    border: none;
  }

  #saloon-right.hidden {
    display: none;
  }

  #saloon-left {
    order: 1;
  }

  #saloon-center {
    order: 2;
  }

  #saloon-right {
    order: 3;
  }

  /* Map grid adapts */
  #map-grid {
    grid-template-columns: repeat(auto-fit, minmax(30px, 1fr));
    grid-template-rows: auto;
    gap: 1px;
    padding: 0.5rem;
  }

  .map-cell {
    width: 30px;
    height: 30px;
  }

  /* Chat layout */
  #chat-input-container {
    grid-template-columns: auto 50px;
    gap: 0.4rem;
  }

  #chat-send-btn {
    padding: 0.5rem;
  }

  /* Page sections like world, characters, compendium */
  #world,
  #characters,
  #compendium {
    padding: 1.5rem 1rem;
  }

  /* World container panels stack */
  .world-container {
    flex-direction: column;
    gap: 16px;
  }

  .left-panel,
  .right-panel {
    flex: 1 1 100%;
  }

  /* Footer */
  footer {
    font-size: 0.9rem;
    padding: 0.5rem 0;
  }

  /* Topbar */
  .topbar a, .topbar .dropdown {
    font-size: 0.85rem;
    padding: 8px 12px;
  }

  /* Social icons */
  .social-icon {
    width: 32px;
    height: 32px;
  }

  .social-icon img {
    width: 16px;
    height: 16px;
  }
}

.resizable-wrapper {
  display: flex;
  height: 100%;
  position: relative;
}

.saloon-sidebar {
  resize: none;
  overflow: auto;
  min-width: 100px;
  max-width: 500px;
}

/* Resizer style */
.resizer {
  width: 6px;
  cursor: ew-resize;
  background-color: #7a5b31;
  transition: background-color 0.2s;
  z-index: 10;
}

.resizer:hover {
  background-color: #bfa25f;
}

.resizer-left {
  cursor: ew-resize;
}

.resizer-right {
  cursor: ew-resize;
}

/* CONFIG PAGE IMPROVEMENTS */

#config {
  background: linear-gradient(120deg, #35423c, #596b65);
  color: #f4e1b1;
  font-weight: 600;
  box-shadow: inset 0 0 40px #1f2f29cc;
  display: flex;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
}

.resizable-wrapper {
  display: flex;
  position: relative;
  height: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.config-sidebar {
  background-color: #3d5049;
  box-shadow: inset 0 0 12px #343b39aa;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-width: 250px;
  max-width: 400px;
  transition: all 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: #a9b8b0 transparent;
}

#config-left {
  border-right: 2px solid #888;
}

/* Resizer between panels */
.resizer {
  width: 6px;
  background-color: #7a5b31;
  cursor: ew-resize;
  transition: background-color 0.2s ease;
  z-index: 10;
}
.resizer:hover {
  background-color: #c0a862;
}

