html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  font-family: sans-serif;
  background: #181c24;
  color: #fff;
  position: relative; /* Add this */
}

#map-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-size: cover;
  background-position: center;
  border: 2px solid rgba(126, 207, 255, 0.18);
  z-index: 1;
}

.picked-up {
  outline: 2px dashed #007bff;
  z-index: 1000;
}

#map-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  background-size: 70px 70px;
  --grid-color: #000;
  /* Example grid using background-image */
  background-image: 
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  z-index: 1;
}

.token {
  position: absolute;
  cursor: pointer;
  border-radius: 30px;
  border-width: 2px !important;
  z-index: 2;
}

#sidebar {
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  height: 100vh;
  background: #23283a;
  padding: 10px;
  overflow-y: auto;
  box-shadow: 0 4px 24px #0006;
  transition: transform 0.3s ease;
  z-index: 3;
}

#sidebar.hidden {
  transform: translateX(100%);
}

#toggleSidebarBtn {
  position: absolute;
  top: 0;
  right: 250px;
  z-index: 4;
  width: 50px;
  height: 50px;
  font-size: 24px;
  background: #23283a;
  color: rgba(126, 208, 255, 0.262);
  border-radius: 30px;
  box-shadow: 0 4px 24px #0006;
  cursor: pointer;
  transition: right 0.3s ease;
}

#sidebar.hidden + #toggleSidebarBtn {
  right: 0;
}

#initiative-order {
  list-style: none;
  padding: 0;
}

#initiative-order li {
  padding: 5px;
  margin-bottom: 5px;
  background: #222b3a;
  cursor: grab;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 30px;
  box-shadow: 0 4px 24px #0006;
  border: 1px solid #222b3a;
  transition: background 0.2s, box-shadow 0.2s;
}

#initiative-order li:hover {
  background: rgb(54, 72, 103);
}

input, button {
  margin-bottom: 10px;
  width: 100%;
  background: #222b3a;
  color: #fff;
  border: 1px solid #222b3a;
  box-shadow: 0 4px 24px #0006;
}

.tokenBorderColor{
    border-radius: 30px;
}

/* Style color input boxes to be rounded */
input[type="color"] {
    border-radius: 20px !important;
    width: 60% !important;
    height: 20px !important;
    border: 2px solid #222b3a !important;
    background: #222b3a !important;
    cursor: pointer;
    padding: 2px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

input[type="color"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

/* Remove the default color input styling */
input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 18px;
    border: none;
}

input[type="color"]::-webkit-color-swatch {
    border-radius: 16px;
    border: none;
}

#initiative-order button {
  width: 30px;
  height: 30px;
  margin-top: 10px;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  transition: background 0.2s;
}

#initiative-order button:hover {
  background: rgba(221, 0, 0, 0.3); /* More transparent red */
}

#sidebar label,
#sidebar input,
#sidebar button {
  display: block;
  text-align: left;
  margin-left: 0;
}

#sidebar label[style*="display: flex"] {
  width: auto;
  margin-bottom: 10px;
}

#sidebar label[style*="display: flex"] input[type="checkbox"] {
  width: auto;
  margin-bottom: 0;
}

#sidebar label[style*="display: flex"] span {
  width: auto;
}

/* Make the Add Token button green and rounded */
#sidebar button[onclick="addToken()"] {
  width: 40%;
  padding: 3px;
  text-align: center;
  background: #195c29;
  color: #fff;
  border-radius: 20px;
  border: none;
  font-weight: bold;
  transition: background 0.2s;
}

#sidebar button[onclick="addToken()"]:hover {
  cursor: pointer;
  background: #218838;
}

/* Make all inputs and file uploads rounded */
#sidebar input,
#sidebar input[type="file"] {
  border-radius: 12px;
}

#sidebar-icon {
  margin-top: 10px;
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: 10px;
}

#tokenSize,
#tokenName {
  width: 50%;
  padding-left: 8px;
}

#saveWorldBtn,
#loadWorldBtn {
  width: 40%;
  padding: 3px;
  text-align: center;
  background: #195c29;
  color: #fff;
  border-radius: 20px;
  border: none;
  font-weight: bold;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

#sidebar #saveWorldBtn,
#sidebar #loadWorldBtn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  text-align: center !important;
}

#saveWorldBtn:hover, #loadWorldBtn:hover {
  cursor: pointer;
  background: #218838;
}

/* Add this to styles.css */
.initiative-token {
  background: #2a3a5a; /* Your desired color */
}

.sidebar-header {
  display: block;
  position: relative;
  margin-bottom: 10px;
}

.sidebar-socials {
  position: absolute;
  top: 0;
  right: 80px; /* 70px logo width + 10px gap */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  z-index: 2;
}

.sidebar-socials a img{
  width: 30px;
  height: 30px;
  transition: transform 0.2s;
}

.sidebar-changelog-btn {
  width: 100%;
  margin-top: 20px;
  background: #23283a;
  color: #fff;
  border: none;
  padding: 12px 0;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  text-align: center; /* Center the button text */
}
.sidebar-changelog-btn:hover {
  background: #323c61;
}
    /* #region Download Buttons */
    .sidebar-download-btn {
        width: 100%;
        margin-top: 10px;
        background: #23283a;
        color: #fff;
        border: none;
        padding: 12px 0;
        border-radius: 8px;
        font-size: 1rem;
        cursor: pointer;
        transition: background 0.2s;
        text-align: center;
    }

    .sidebar-download-btn:hover {
        background: #2D3748;
    }

    .download-btn{
        width: 30%;
        padding: 12px;
        border-radius: 8px;
        border: none;
        color: white;
        cursor: pointer;
    }
    /* #endregion Download Buttons */

/* Social Button */
.sidebar-social-btn {
  width: 100%;
  margin-top: 10px;
  background: #23283a;
  color: #fff;
  border: none;
  padding: 12px 0;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  text-align: center;
}

.sidebar-social-btn:hover {
  background: #343c59;
}

/* Social Modal Styles */
#socialModal .modal-content {
  background: #23283a;
  color: #fff;
  padding: 30px;
  border-radius: 12px;
  min-width: 700px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 32px rgba(0,0,0,0.7);
  position: relative;
}

.social-modal-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.social-content h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #7E4EC2;
  font-size: 2rem;
}

.social-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 25px;
}

.social-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.social-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.social-icon {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
}

.social-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.social-details h3 {
  margin: 0;
  color: #fff;
  font-size: 1.3rem;
}

.social-details p {
  margin: 0;
  color: #ccc;
  font-size: 0.95rem;
  line-height: 1.4;
}

.social-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  align-self: flex-start;
  margin-top: 5px;
}

.discord-btn {
  background: #5865F2;
}

.discord-btn:hover {
  background: #4752C4;
}

.youtube-btn {
  background: #FF0000;
}

.youtube-btn:hover {
  background: #CC0000;
}

.tiktok-btn {
  background: #FF0050;
}

.tiktok-btn:hover {
  background: #E6003C;
}

.social-footer {
  text-align: center;
  padding: 20px;
  background: rgba(126, 78, 194, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(126, 78, 194, 0.2);
}

.social-footer p {
  margin: 0;
  color: #ddd;
  font-size: 0.9rem;
}

/* Responsive design for social modal */
@media (max-width: 768px) {
  #socialModal .modal-content {
    min-width: auto;
    padding: 20px;
  }
  
  .social-item {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  
  .social-details {
    align-items: center;
  }
  
  .social-btn {
    align-self: center;
  }
}

/* Modal styles */
.modal {
  display: none; 
  position: fixed; 
  z-index: 1000; 
  left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.5); 
  justify-content: center; 
  align-items: center;
}

.modal-content {
  background: #222; 
  color: #fff; 
  padding: 30px 20px; 
  border-radius: 12px;
  min-width: 320px; 
  max-height: 80vh; 
  overflow-y: auto;
  box-shadow: 0 4px 32px rgba(0,0,0,0.7);
  position: relative;
}

.close {
  position: absolute; 
  top: 10px; 
  right: 18px; 
  font-size: 2rem; 
  cursor: pointer;
  color: #fff;
  transition: color 0.3s;
}

.close:hover {
  color: #ff6b6b;
}

/* Changelog Modal Specific Styling */
#changelogModal .modal-content {
  background: #23283a;; /* Match sidebar color */
  color: #fff; 
  padding: 30px; 
  border-radius: 12px;
  max-width: 1000px; 
  max-height: 700px; 
  overflow-y: auto;
  box-shadow: 0 4px 32px rgba(0,0,0,0.7);
  position: relative;
}

#changelogContent h3 {
  color: #4CAF50;
  margin-top: 25px;
  margin-bottom: 10px;
  border-bottom: 1px solid #444;
  padding-bottom: 5px;
}

#changelogContent .version-date {
  color: #888;
  font-size: 0.9em;
  font-weight: normal;
  margin-left: 10px;
}

#changelogContent ul {
  margin-left: 20px;
  margin-bottom: 20px;
}

#changelogContent li {
  margin-bottom: 8px;
  color: #ddd;
  line-height: 1.4;
}

/* Download Modal Specific Styling */
#downloadModal .modal-content {
  background: #23283a; /* Match sidebar color */
  color: #fff; 
  padding: 30px; 
  border-radius: 12px;
  min-width: 800px; /* Make it wider to accommodate logo */
  max-width: 90vw; 
  max-height: 80vh; 
  overflow-y: auto;
  box-shadow: 0 4px 32px rgba(0,0,0,0.7);
  position: relative;
}

.download-modal-layout {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  min-height: 400px;
}

.download-content-left {
  flex: 2;
  min-width: 0; /* Allows flex item to shrink */
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.download-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.download-logo-right {
  flex: 1;
  max-width: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.download-modal-logo {
  width: 100%;
  max-width: 200px;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  margin-bottom: 15px;
}

.logo-text {
  text-align: center;
  color: #ccc;
  font-size: 0.9em;
  margin-top: 10px;
}

/* Adjust download buttons for better layout */
#downloadModal .download-btn {
  width: 100%;
  margin-bottom: 0;
  padding: 15px 20px;
  font-size: 1.1em;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
}

#downloadModal .download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
