@import url("https://fonts.googleapis.com/css?family=Ubuntu:400, 500,700,900");

canvas {
  font-family: 'Ubuntu', sans-serif;
  border-radius: 0; /* Ensures square limit for the game canvas */
}

/* Universe background canvas */
#bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #050010;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: 'Ubuntu', sans-serif;
  user-select: none;
  background-color: #fff;
  border-radius: 0; /* Ensuring outer container is square */
}

h1, h2, h3, h4, p {
  margin: 0;
  padding: 0;
}

img {
  -webkit-user-drag: none; 
  user-drag: none;        
  pointer-events: all;   
}

.info-alert {
  position: fixed;
  display: flex;
  justify-content: center;
  width: 100%;
  font-weight: 700;
  font-size: 32px;
  margin-top: 8px;
  color: rgb(255, 47, 0);
  z-index: 10;
}

.dialog {
  z-index: 10;
  position: fixed;
  display: none;
  height: 100vh;
  width: 100vw;
  justify-content: center;
  align-items: center;
  background-color: #00000065;
}

.dialog>.menu-card {
  width: 380px;
}

.dialog>.menu-card>p {
  margin-top: 6px;
}

#login-dialog{
  display: none;
}

#login-dialog hr {
  border: 0;
  height: 2px; 
  background-color: #7289da54;
  margin: 10px 0; 
}

#login-dialog > .menu-card{
  width: 550px;
}

#login-dialog .login-benefits {
  list-style-type: none;
  padding: 0;
  margin: 10px 0;
  text-align: left;
}

#login-dialog .login-benefits li {
  font-size: 16px;
  color: #555;
  padding: 5px 0px;
}

#login-dialog .actions {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 20px;
}

#login-dialog .actions > button  {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  width: 100%;
}

#signup-dialog .signup-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

#signup-dialog .signup-discord-row {
  display: flex;
  margin-top: 2px;
}

#signup-dialog #signup-discord {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(122, 194, 255, 0.45);
  background: linear-gradient(135deg, rgba(52, 110, 255, 0.42), rgba(114, 152, 255, 0.22));
  color: #f5f9ff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 160ms ease, transform 160ms ease, border-color 160ms ease;
}

#signup-dialog #signup-discord:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  border-color: rgba(150, 210, 255, 0.8);
}

#signup-dialog #signup-google {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 208, 122, 0.45);
  background: linear-gradient(135deg, rgba(255, 149, 61, 0.38), rgba(255, 214, 126, 0.2));
  color: #fff7ec;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 160ms ease, transform 160ms ease, border-color 160ms ease;
}

#signup-dialog #signup-google:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  border-color: rgba(255, 220, 148, 0.82);
}

#signup-dialog .signup-form input {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
}

#signup-dialog .signup-form input::placeholder {
  color: #cccccc;
}

#signup-dialog .menu-card {
  color: #ffffff;
}

#signup-dialog .actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

#signup-dialog .actions > button {
  padding: 8px 14px;
  border: none;
  border-radius: 12px;
  background: rgba(180,160,255,0.25);
  color: #ffffff;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

#signup-dialog .actions > button:hover {
  background: rgba(180,160,255,0.45);
  transform: scale(1.05);
}

#signin-dialog .signin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

#signin-dialog .signin-form input {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
}

#signin-dialog .signin-form input::placeholder {
  color: #cccccc;
}

#signin-dialog .menu-card {
  color: #ffffff;
}

#signin-dialog .actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

#signin-dialog .actions > button {
  padding: 8px 14px;
  border: none;
  border-radius: 12px;
  background: rgba(180,160,255,0.25);
  color: #ffffff;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

#signin-dialog .actions > button:hover {
  background: rgba(180,160,255,0.45);
  transform: scale(1.05);
}

#privacy-dialog {
  display: none;
  z-index: 10020;
}

#privacy-dialog > .menu-card.privacy-card {
  width: min(760px, 94vw);
  max-height: 82vh;
  overflow: hidden;
  position: relative;
}

#privacy-dialog .privacy-card h2,
#terms-dialog .privacy-card h2,
#about-dialog .privacy-card h2 {
  color: #f1f6ff;
}

#privacy-dialog .privacy-updated {
  color: #b7c8ff;
  font-size: 13px;
  margin-top: -6px;
}

#terms-dialog .privacy-updated,
#about-dialog .privacy-updated {
  color: #b7c8ff;
  font-size: 13px;
  margin-top: -6px;
}

#privacy-dialog .privacy-content {
  margin-top: 10px;
  padding-right: 10px;
  overflow-y: auto;
  max-height: calc(82vh - 130px);
}

#terms-dialog .privacy-content,
#about-dialog .privacy-content {
  margin-top: 10px;
  padding-right: 10px;
  overflow-y: auto;
  max-height: calc(82vh - 130px);
}

#privacy-dialog .privacy-content h3 {
  margin: 12px 0 6px 0;
  color: #d9e7ff;
  font-size: 16px;
}

#terms-dialog .privacy-content h3,
#about-dialog .privacy-content h3 {
  margin: 12px 0 6px 0;
  color: #d9e7ff;
  font-size: 16px;
}

#privacy-dialog .privacy-content p {
  color: #e5ecff;
  line-height: 1.45;
  font-size: 14px;
}

#terms-dialog .privacy-content p,
#about-dialog .privacy-content p {
  color: #e5ecff;
  line-height: 1.45;
  font-size: 14px;
}

#terms-dialog,
#about-dialog {
  display: none;
  z-index: 10020;
}

#guest-button {
  background-color: #f0f0f0;
  color: #333;
}

#close-dialog-button {
  background: #f4f4f4;
  color: #333;
}

#close-dialog-button:hover {
  background: #e2e2e2;
  transform: scale(1.05);
}

#skin-library-dialog {
  display: none;
  z-index: 10000 !important;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
}

#skin-library-dialog>.menu-card {
  width: fit-content;
  max-width: 90vw;
  max-height: 80vh;
  padding: 30px;
  overflow-y: auto;
  z-index: 10001 !important;
}

#skin-library-dialog .exit-button{
  margin: 10px;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

#skin-library-dialog h1 {
  color: white;
  text-align: center;
  margin-bottom: 20px;
}

#skin-grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Force 3 columns */
  gap: 15px;
  margin-top: 20px;
  padding: 10px;
}

/* Responsive: 1 column on very small screens, 2 on medium */
@media (max-width: 600px) {
  #skin-grid-container {
    grid-template-columns: repeat(1, 1fr);
  }
}

@media (min-width: 601px) and (max-width: 1000px) {
  #skin-grid-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

.skin-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
}

.skin-circle img {
  position: absolute;

  /* Do not force 100% */
  max-width: 120%;
  max-height: 120%;

  width: auto;
  height: auto;

  /* Keep true centering */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  object-fit: contain;
}

.skin-circle:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}


#current-skin-img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

#skin-name-display {
  font-size: 11px;
  color: white;
  text-align: center;
  margin: 0;
  padding: 2px;
  background: rgba(0, 0, 0, 0.5);
  width: 100%;
  position: absolute;
  bottom: 0;
}

/* Force skin preview to be image-only and fully filled */
#skin-name-display {
  display: none !important;
}

#current-skin-img,
.skin-circle img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  max-width: none !important;
  max-height: none !important;
}

.skin-nav-btn {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 20px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.skin-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.1);
}

.skin-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Skin selector wrapper */
#skin-selector-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Skin Use button */
.skin-use-btn {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  border: none;
  border-radius: 20px;
  padding: 8px 30px;
  color: white;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

.skin-use-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.5);
}

.skin-use-btn:active {
  transform: translateY(0);
}

.skin-use-btn.selected {
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
  box-shadow: 0 2px 10px rgba(33, 150, 243, 0.3);
}

.skin-use-btn.selected:hover {
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.5);
}

/* Skin grid items in library dialog */
#skin-grid-container .skin-item {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

#skin-grid-container .skin-item:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

#skin-grid-container .skin-item.equipped {
  border-color: #4CAF50;
  background: rgba(76, 175, 80, 0.2);
}

#skin-grid-container .skin-item img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 8px;
}

#skin-grid-container .skin-item .skin-placeholder {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin-bottom: 8px;
}

#skin-grid-container .skin-item .skin-name {
  display: none;
}

#skin-grid-container .skin-item p {
  display: none;
}

#skin-list {
  position: relative;
  display: flex;
  margin-bottom: 10px;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

#skin-container{
  display: flex;
  /* Removed overflow: hidden; to ensure all skins are visible */
  gap: 15px; /* Increased gap for better spacing */
  width: fit-content; /* Allow container to grow with content */
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
}

.skin-level-locked > img {
  filter: invert(0.75);
}

#skin-carousel-prev,
#skin-carousel-next{
  width: min-content;
  font-size: 25px;
  z-index: 1;
  border: 2px solid #ff6b6b;
  background: transparent;
  color: #ff6b6b;
} 


#skin-carousel-prev {
  left: -25px;
}

 
#skin-carousel-next{
  right: -25px;
}

#skin-carousel-prev.end ,
#skin-carousel-next.end{
  opacity: 0.2; 
  pointer-events: none; 
}

.skin-list-item{
  padding: 0 3px 3px 3px;
  scroll-snap-align: start;
}

.skin-list-item>.skin-details {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 2px dashed rgba(0, 0, 0, 0.3);
  height: 130px;
  width: 90px;
}

.skin-list-item>.skin-details>h1 {
  position: absolute;
  top: 0;
  font-size: 16px;
  padding: 10px;
  color: rgba(255, 255, 255, 0.9);
}

.skin-list-item>.skin-details>img {
  width: 80%;
  aspect-ratio: 1/1;
  border-radius: 50%;
  border: 2px solid #666666;
}

.skin-list-item>button {
  margin-top: 10px;
  width: 100%;
  background-color: #ff6b6b;
  color: #ffff;
}

.skin-list-item>.skin-level-locked {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  height: 30px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.skin-list-item>button{
  border: 2px #ff6b6b solid;
  color: #ff6b6b;
  background-color: transparent;
  height: 30px; 
}


.skin-list-item>button.selected {
  color: #ffff;
  background-color: #ff6b6b;
}

#account-container {
  position: relative;
  height: 100%;
}

#account-container>h1 {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 6px;
}

#account-button, #signup-button{
  width: auto;
  font-size: 16px;
  padding: 5px;
  margin-top: 10px;
  flex: 1;
}

.account-buttons {
  display: flex;
  gap: 10px;
}

#account-button.login, #signup-button{
  background-color: #7289da;
  color: #ffffff;
}

#skin-preview {
  position: relative;
  height: 140px;
  width: 140px;
  border-radius: 50%;
  border: rgba(0, 0, 0, 0.307)3px solid;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 400;
  cursor: pointer;
  transition: ease-in-out 50ms;
}

#skin-preview:hover {
  transform: scale(1.015);
}

#skin-preview>img{
  height: 100%;
  width: 100%;
  border-radius: 50%;
}

#skin-preview>div {
  position: absolute;
  left: 0;
  top: 0;
  background-color: greenyellow;
  color: #ffffff;
  font-size: 32px;
  font-weight: 400;
  text-align: center;
  line-height: 32px;
  border-radius: 50%;
  height: 35px;
  width: 35px;
  border: 2px solid rgba(0, 0, 0, 0.07);
}

#level-progression {
  font-size: 16px;
  width: 100%;
}

#level-progression .progress-icon {
  color: #ffffff;
  background-color: #5bc2e4;
  font-size: 14px;
  font-weight: 700;
  right: -3px;
  height: 30px;
  width: 30px;
  border-radius: 50%;
}

#level-progression .progress-bar {
  background-color: #5bc2e4;
  height: 15px;
}

#level-progression .progress-text {
  line-height: 15px;
}

#stats-container>div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  color: rgba(255, 255, 255, 0.9);
}

/* Skin menu styles */
#skin-list-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
}

#skin-container-menu {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  padding: 10px 0;
  scrollbar-width: thin;
}

#skin-container-menu::-webkit-scrollbar {
  height: 6px;
}

#skin-container-menu::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

#skin-container-menu .skin-item {
  min-width: 80px;
  height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  background-color: rgba(0, 0, 0, 0.05);
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#skin-container-menu .skin-item:hover {
  transform: scale(1.05);
  background-color: rgba(0, 0, 0, 0.1);
}

#skin-container-menu .skin-item.equipped {
  border-color: #7289da;
  background-color: rgba(114, 137, 218, 0.2);
}

#skin-container-menu .skin-item img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

#skin-container-menu .skin-item .skin-placeholder {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
}

#skin-container-menu .skin-item p {
  display: none;
}

#skin-container-menu .skin-item .skin-lock,
#skin-container-menu .skin-item .skin-price {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

#skin-container-menu .skin-item .skin-lock {
  background-color: rgba(255, 100, 100, 0.2);
  color: #ff6b6b;
}

#skin-container-menu .skin-item .skin-price {
  background-color: rgba(255, 215, 0, 0.2);
  color: #b8860b;
}

#skin-container-menu .skin-item.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

#skin-container-menu .skin-item.locked:hover {
  transform: none;
}

#skin-carousel-prev-menu,
#skin-carousel-next-menu {
  background-color: rgba(0, 0, 0, 0.1);
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 18px;
  transition: background-color 0.2s ease;
  position: relative;
  z-index: 20;
  pointer-events: auto;
}

#skin-carousel-prev-menu:hover,
#skin-carousel-next-menu:hover {
  background-color: rgba(0, 0, 0, 0.2);
}

#global-leaderboard {
  display: none;
  top: 60px;
}

@media (max-width: 1100px) {
  #global-leaderboard {
    visibility: hidden;
  }

  #featured-youtubers {
    visibility: hidden;
  }
}

#upgrade-container {
  display: none;
  flex-direction: column;
  position: absolute;

  left: 8px;
  width: 310px;
  z-index: 1;
  background-color: #66666675;
  color: #fff;
  padding: 8px;
  gap: 8px;
  border-radius: 3px;
  text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
}

#upgrade-container>h1 {
  font-size: 24px;
  margin: 0;
}

#upgrade-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;

}

#upgrade-tabs>.tab {
  position: relative;
  display: flex;
  background-color: #00000037;
  height: 30px;
  width: 100%;
  justify-content: center;
  align-items: center;
  border-radius: 3px;
  cursor: pointer;
  border: 3px solid transparent;
}

#upgrade-tabs>.tab.selected,
#upgrade-tabs>.tab.selected:hover {
  background-color: #8787877c;
  border-color: #00000029;
  font-weight: 600;
}

#upgrade-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#upgrade-list>.upgrade-item {
  position: relative;
  background-color: #00000037;
  padding: 8px;
  display: flex;
  gap: 10px;
  height: 80px;
  transition: ease-in-out 100ms;
  cursor: pointer;
  border-radius: 3px;
}

#upgrade-list>.upgrade-item .upgrade-next-tooltip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  min-width: 220px;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(180, 160, 255, 0.32);
  background: rgba(20, 10, 40, 0.92);
  box-shadow: 0 8px 24px rgba(180, 160, 255, 0.16);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 25;
}

#upgrade-list>.upgrade-item:hover .upgrade-next-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

#upgrade-list>.upgrade-item .upgrade-next-tooltip .title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: #b4a0ff;
  letter-spacing: 0.3px;
}

#upgrade-list>.upgrade-item .upgrade-next-tooltip .line {
  margin: 0;
  font-size: 12px;
  line-height: 1.25;
  color: #e0d6ff;
}

#upgrade-list>.upgrade-item .upgrade-next-tooltip .line.muted {
  color: #b9afd6;
}

#upgrade-list>.upgrade-item .upgrade-next-tooltip .next-upgrade-icon-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#upgrade-list>.upgrade-item .upgrade-next-tooltip .next-upgrade-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 72px;
}

#upgrade-list>.upgrade-item .upgrade-next-tooltip .next-upgrade-icon-canvas,
#upgrade-list>.upgrade-item .upgrade-next-tooltip .next-upgrade-icon-fallback {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.123);
  border: 1px solid rgba(255, 255, 255, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d8cbff;
  font-size: 10px;
  font-weight: 700;
}

#upgrade-list>.upgrade-item .upgrade-next-tooltip .next-upgrade-icon-label {
  margin: 0;
  width: 100%;
  font-size: 11px;
  line-height: 1.2;
  color: #e0d6ff;
  text-align: center;
  overflow-wrap: anywhere;
}

#upgrade-list>.upgrade-item.coming-soon {
  justify-content: center;
  align-items: center;
  font-size: 18px;

}

#upgrade-container .preview {
  background-color: rgba(255, 255, 255, 0.123);
  border-radius: 3px;
}

#upgrade-container .header {
  font-size: 19px;
  font-weight: 600;
}

#upgrade-container .text {
  font-size: 16px;

  line-height: 18px;
}

#upgrade-container .hotkey, #destroy-button .hotkey {
  font-size: 14px;
  font-weight: 600;
  position: absolute;
  top: 6px;
  right: 8px;
  color: #f8ff77;
  letter-spacing: 1px;
}

#upgrade-container .cost {
  font-size: 18px;
  font-weight: 600;
  position: absolute;
  bottom: 8px;
  right: 8px;
}



#upgrade-tabs>.tab:hover,
#upgrade-list>.upgrade-item:hover,
#destroy-button:hover {
  background-color: #0000006f;
  transform: scale(1.02);
}

#game-settings .slider {
  display: none !important;
  display: flex;
  position: fixed;
  top: 340px;
  height: 35px; /* Slightly increased height */
  background: rgba(180, 160, 255, 0.25); /* Consistent background */
  border: 1px solid rgba(180, 160, 255, 0.3); /* Consistent border */
  border-radius: 0; /* Consistent with other panels */
  box-shadow: 0 4px 12px rgba(180, 160, 255, 0.15); /* Added box-shadow */
  backdrop-filter: blur(5px); /* Added backdrop-filter */
  transition: left 0.5s ease, background 0.3s ease, border 0.3s ease, box-shadow 0.3s ease; /* Updated transition */
  left: -80px;
  z-index: 5;
}

#game-settings .slider:hover {
  left: 0px;
  background: rgba(180, 160, 255, 0.4); /* Darker background on hover */
}

#game-settings .slider button {
  height: 100%;
  margin: 0;
  padding: 0;
  padding-left: 8px;
  background-color: transparent;
  font-size: 18px;
  color: #fff;
}

#game-settings .slider img {
  height: 100%;
  object-fit: cover;
}

#game-settings .settings {
  display: none;
  position: fixed;
  top: 340px;
  min-height: 160px;
  height: auto;
  width: 430px;
  max-height: min(78vh, 640px);
  overflow-y: auto;
  left: 8px;
  flex-direction: column;
  gap: 10px;
  background: rgba(20, 10, 40, 0.6); /* Modernized background */
  border: 1px solid rgba(180, 160, 255, 0.3); /* Added border */
  padding: 15px; /* Adjusted padding */
  border-radius: 0; /* Set to 0 for consistency */
  box-shadow: 0 8px 24px rgba(180, 160, 255, 0.2); /* Added box-shadow */
  backdrop-filter: blur(8px); /* Added backdrop-filter */
  text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
  color: #ffffff;
  font-weight: 700;
  font-size: 24px;
  z-index: 5;
}

.exit-button {
  display: flex;
  position: absolute;
  right: 2px;
  top: 2px;
  background-color: transparent;
  font-size: 20px;
  color: #fff;
}

#game-settings .settings h1 {
  font-size: 26px;
  margin-bottom: 15px;
}

#game-settings .settings p {
  font-size: 20px;
}

#game-settings .theme-settings {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#theme-select {
  width: 100%;
  padding: 8px 12px;
  margin: 8px 0;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #33333384;
  color: #fff;
  font-size: 16px;
  font-weight: 400;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: background-color 0.3s, border-color 0.3s;
}

#theme-select:hover {
  background-color: #444444d5;
  border-color: #888;
}

.misc-settings {
  margin-top: 0;
}

.misc-settings label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: #fff;
  cursor: pointer;
}

.misc-settings input[type="checkbox"] {
  margin-right: 0;
  width: 16px;
  height: 16px;
  accent-color: #4a90e2;
}

.hud-customization-panel {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(180, 160, 255, 0.18);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hud-customization-panel h3 {
  margin: 0;
  color: #e9ddff;
  font-size: 16px;
}

.hud-customization-help {
  color: #cbbfe9;
  font-size: 12px;
  line-height: 1.35;
}

.hud-customization-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hud-customization-actions button {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(180, 160, 255, 0.24);
  background: rgba(180, 160, 255, 0.12);
  color: #e0d6ff;
  font-size: 12px;
  font-weight: 700;
}

.hud-customization-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.hud-customization-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #d8cdf5;
  font-size: 12px;
}

.hud-customization-grid input,
.hud-customization-grid select {
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(180, 160, 255, 0.25);
  background: rgba(18, 10, 34, 0.9);
  color: #e8ddff;
  padding: 0 8px;
  outline: none;
}

.hud-customization-grid input {
  text-transform: lowercase;
  font-weight: 700;
  text-align: center;
}

body.hud-customize-mode .hud-customizable {
  outline: 2px dashed rgba(96, 234, 255, 0.55);
  outline-offset: -2px;
  cursor: move;
}

.hud-resize-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  right: 4px;
  bottom: 4px;
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(96, 234, 255, 0.95), rgba(180, 160, 255, 0.95));
  box-shadow: 0 0 8px rgba(96, 234, 255, 0.35);
  cursor: nwse-resize;
  display: none;
  z-index: 3;
}

body.hud-customize-mode .hud-customizable .hud-resize-handle {
  display: block;
}

.hud-edit-session-overlay {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 24000;
  pointer-events: none;
}

.hud-edit-session-card {
  pointer-events: auto;
  width: min(640px, calc(100vw - 24px));
  background: rgba(20, 10, 40, 0.92);
  border: 1px solid rgba(180, 160, 255, 0.32);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), 0 0 18px rgba(180,160,255,0.14);
  backdrop-filter: blur(10px);
  padding: 10px 12px;
  color: #e0d6ff;
}

.hud-edit-session-title {
  font-size: 15px;
  font-weight: 900;
  color: #9fe8ff;
}

.hud-edit-session-help {
  margin-top: 2px;
  font-size: 12px;
  color: #cbbfe9;
  line-height: 1.25;
}

.hud-edit-session-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.hud-edit-btn {
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid rgba(180, 160, 255, 0.24);
  background: rgba(180, 160, 255, 0.12);
  color: #e0d6ff;
  font-size: 12px;
  font-weight: 700;
}

.hud-edit-btn.save {
  background: rgba(96, 234, 255, 0.14);
  border-color: rgba(96, 234, 255, 0.35);
}

.hud-edit-btn.reset {
  background: rgba(255, 160, 120, 0.12);
  border-color: rgba(255, 160, 120, 0.28);
}

.hud-edit-btn.keys {
  background: rgba(120, 190, 255, 0.12);
  border-color: rgba(120, 190, 255, 0.28);
}

.hud-edit-btn.models {
  background: rgba(120, 255, 170, 0.10);
  border-color: rgba(120, 255, 170, 0.24);
}

.unit-style-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 25020;
  background: rgba(5, 3, 12, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 64px 16px 16px;
}

.unit-style-editor-card {
  width: min(780px, 96vw);
  max-height: 82vh;
  overflow: auto;
  overflow-x: hidden;
  background: rgba(20, 10, 40, 0.95);
  border: 1px solid rgba(180, 160, 255, 0.32);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(0,0,0,0.4), 0 0 18px rgba(180,160,255,0.14);
  color: #e0d6ff;
  padding: 12px;
}

.unit-style-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.unit-style-editor-header h3 {
  margin: 0;
  color: #9fe8ff;
  font-size: 18px;
}

.unit-style-editor-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(180,160,255,0.22);
  background: rgba(180,160,255,0.12);
  color: #e0d6ff;
  font-weight: 700;
}

.unit-style-editor-help {
  margin: 0 0 10px;
  color: #cbbfe9;
  font-size: 12px;
  line-height: 1.35;
}

.unit-style-editor-section {
  margin-top: 8px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(180,160,255,0.14);
  background: rgba(180, 160, 255, 0.04);
}

.unit-style-editor-title {
  font-size: 12px;
  font-weight: 800;
  color: #9fe8ff;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.unit-style-editor-shapes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.unit-style-editor-shapes label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #d8cdfa;
}

.unit-style-editor-shapes select {
  width: 100%;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(180,160,255,0.20);
  background: rgba(16, 8, 32, 0.9);
  color: #efe9ff;
  padding: 0 8px;
}

.unit-style-editor-model-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.unit-model-card {
  border: 1px solid rgba(180,160,255,0.14);
  background: rgba(180,160,255,0.04);
  border-radius: 10px;
  padding: 8px 6px;
  color: #e0d6ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.unit-model-card.selected {
  border-color: rgba(96, 234, 255, 0.38);
  background: rgba(96, 234, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(96, 234, 255, 0.12) inset;
}

.unit-model-preview {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid #666;
  background: #72d6ff;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
}

.unit-model-preview.triangle {
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-left: 28px solid transparent !important;
  border-right: 28px solid transparent !important;
  border-bottom: 50px solid #72d6ff !important;
  border-radius: 0 !important;
  border-top: 0 !important;
  position: relative;
  overflow: visible;
}

.unit-model-preview.triangle::before {
  content: "";
  position: absolute;
  left: -31px;
  top: -3px;
  width: 0;
  height: 0;
  border-left: 31px solid transparent;
  border-right: 31px solid transparent;
  border-bottom: 56px solid rgba(102,102,102,0.95);
  z-index: -1;
}

.unit-model-preview.triangle.unit-type-soldier {
  border-bottom-color: #72d6ff !important;
}

.unit-model-preview.triangle.unit-type-tank {
  border-bottom-color: #72d6ff !important;
}

.unit-model-preview.triangle.unit-type-siege {
  border-bottom-color: #72d6ff !important;
}

.unit-model-preview.model1::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 0 0 5px rgba(255,255,255,0);
}

.unit-model-preview.model1::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
}

.unit-model-preview.model2::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.9);
}

.unit-model-preview.model2::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
}

.unit-model-preview.model3::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(-25deg,
      rgba(255,255,255,0.88) 0 2px,
      transparent 2px 7px);
}

.unit-model-preview.model4::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  background: rgba(255,255,255,0.88);
  transform: translate(-50%, -50%) rotate(45deg);
}

.unit-model-preview.model5::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  box-shadow: 20px 0 0 rgba(255,255,255,0.95);
}

.unit-model-preview.model5::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 31px;
  width: 24px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,0.95);
}

.unit-model-preview.triangle.model1::after,
.unit-model-preview.triangle.model1::before,
.unit-model-preview.triangle.model2::before,
.unit-model-preview.triangle.model2::after,
.unit-model-preview.triangle.model3::before,
.unit-model-preview.triangle.model4::before,
.unit-model-preview.triangle.model5::before,
.unit-model-preview.triangle.model5::after {
  top: auto;
}

.unit-model-preview.triangle.model1::before {
  display: none;
}

.unit-model-preview.triangle.model1::after {
  display: none;
}

.unit-model-preview.triangle.model2::before {
  left: -12px;
  top: 12px;
  width: 24px;
  height: 24px;
}

.unit-model-preview.triangle.model2::after {
  left: -3px;
  top: 21px;
  width: 7px;
  height: 7px;
}

.unit-model-preview.triangle.model3::before {
  left: -26px;
  top: 6px;
  width: 52px;
  height: 40px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.unit-model-preview.triangle.model4::before {
  left: -12px;
  top: 14px;
  width: 24px;
  height: 24px;
}

.unit-model-preview.triangle.model5::before {
  left: -12px;
  top: 18px;
}

.unit-model-preview.triangle.model5::after {
  left: -12px;
  top: 31px;
  width: 24px;
}

.unit-model-label {
  font-size: 11px;
  font-weight: 700;
  color: #d8cdfa;
  text-align: center;
}

.unit-style-editor-footer {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.unit-style-editor-footer button {
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(180,160,255,0.20);
  color: #e0d6ff;
  background: rgba(180,160,255,0.10);
  font-weight: 700;
}

.unit-style-editor-reset {
  background: rgba(255,160,120,0.12);
  border-color: rgba(255,160,120,0.26);
}

.unit-style-editor-done {
  background: rgba(96, 234, 255, 0.14);
  border-color: rgba(96, 234, 255, 0.32);
}

@media (max-width: 900px) {
  .unit-style-editor-shapes {
    grid-template-columns: 1fr;
  }

  .unit-style-editor-model-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.keybind-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 25010;
  background: rgba(5, 3, 12, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 16px 16px;
}

.keybind-editor-card {
  width: min(760px, 96vw);
  max-height: 82vh;
  overflow: auto;
  overflow-x: hidden;
  background: rgba(20, 10, 40, 0.94);
  border: 1px solid rgba(180, 160, 255, 0.32);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(0,0,0,0.4), 0 0 18px rgba(180,160,255,0.14);
  color: #e0d6ff;
  padding: 12px 12px 10px;
}

.keybind-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  background: rgba(20, 10, 40, 0.96);
  padding: 10px 0 8px;
  z-index: 2;
  border-bottom: 1px solid rgba(180,160,255,0.12);
  margin: -12px -12px 0;
  padding-left: 12px;
  padding-right: 12px;
}

.keybind-editor-header h3 {
  margin: 0;
  color: #9fe8ff;
  font-size: 18px;
}

.keybind-editor-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(180,160,255,0.22);
  background: rgba(180,160,255,0.12);
  color: #e0d6ff;
}

.keybind-editor-help {
  margin: 6px 0 10px;
  color: #cbbfe9;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
}

.keybind-editor-group {
  margin-top: 8px;
  margin-bottom: 2px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(96, 234, 255, 0.06);
  border: 1px solid rgba(96, 234, 255, 0.14);
  color: #9fe8ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.keybind-editor-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.keybind-editor-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 90px 80px 80px;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(180,160,255,0.14);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  padding: 8px;
}

.keybind-editor-row:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(180,160,255,0.2);
}

.keybind-editor-label {
  font-size: 13px;
  color: #e7deff;
  font-weight: 600;
}

.keybind-editor-value {
  text-align: center;
  border: 1px solid rgba(180,160,255,0.18);
  background: rgba(18,10,34,0.9);
  border-radius: 8px;
  padding: 6px 8px;
  font-weight: 800;
  color: #fff;
}

.keybind-editor-btn {
  border-radius: 8px;
  border: 1px solid rgba(180,160,255,0.24);
  background: rgba(180,160,255,0.12);
  color: #e0d6ff;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 700;
}

.keybind-editor-btn.ghost {
  background: rgba(255,255,255,0.03);
}

.keybind-editor-footer {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  position: sticky;
  bottom: 0;
  background: rgba(20, 10, 40, 0.96);
  padding: 8px 12px 2px;
  margin: 0 -12px -10px;
  border-top: 1px solid rgba(180,160,255,0.12);
}

.keybind-editor-reset,
.keybind-editor-done {
  border-radius: 8px;
  border: 1px solid rgba(180,160,255,0.24);
  background: rgba(180,160,255,0.12);
  color: #e0d6ff;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 640px) {
  .keybind-editor-row {
    grid-template-columns: 1fr 70px 70px;
  }
  .keybind-editor-label {
    grid-column: 1 / -1;
  }
}

#theme-select:focus {
  background-color: #444444d5;
  border-color: #aaa;
  outline: none;
}


#game-metrics {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 1000;
  font-size: 12px;
  color: white;
  text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.4);
}

.loading-overlay {
  position: fixed;
  display: flex;
  height: 100vh;
  width: 100vw;
  z-index: 99;
  background-color: #00000065;
  justify-content: center;
  align-items: center;
  color: #ffffff;
  font-size: 50px;
  font-weight: 700;
  gap: 2px;
  -webkit-text-stroke: 3px #464646;
}

@keyframes wave {
  0%, 70%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.wave-animation {
  animation-name: wave;
  animation-duration: 1.2s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.chat {
  zoom: 0.7 !important;
  position: absolute;
  display: none;
  flex-direction: column;
  gap: 5px;
  right: 8px;
  bottom: 8px;
  background-color: #66666685;
  width: 300px;
  height: 200px;
  border-radius: 3px;
  z-index: 1000;
    display: flex;
  flex-direction: column;
  background: rgba(20, 10, 40, 0.7);
  border: 1px solid rgba(180, 160, 255, 0.3);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(180, 160, 255, 0.2);
  backdrop-filter: blur(10px);
  width: 300px;
  max-height: 300px;
  overflow: hidden;
  font-family: 'Segoe UI', sans-serif;
  color: #e0d6ff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  
}
#chat:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(180, 160, 255, 0.35);
  
}
.chat>.header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
    display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: rgba(180, 160, 255, 0.05);
  border-bottom: 1px solid rgba(180, 160, 255, 0.2);
}

.chat>.header>h3 {
  margin: 10px 10px 0;
  text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.4);
  color: #ffffff;
  font-size: 24px;
    margin: 0;
  font-size: 1.2em;
  color: #b4a0ff;
}

.chat>.header>.chat-move-button {
  display: none;
}

#chat-messages {
  text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.4);
  overflow-y: scroll;
  overflow-x: hidden;
  height: 100%;
  scrollbar-width: thin;
  /* For Firefox */
  scrollbar-color: #888 #f1f1f197;
  /* For Firefox */

}

/* For WebKit browsers like Chrome and Safari */
#chat-messages::-webkit-scrollbar {
  width: 8px;
}

#chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.chat .message {
  display: flex;
  gap: 10px;
  padding: 5px 10px;
  font-size: 18px;
  color: #ffffff;
  text-shadow: 0px 2px 2px rgb(0 0 0 / 47%);
}

.chat .message>.name {
  font-weight: 700;
  text-wrap: nowrap;
}

.chat .message>.text {

  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.chat>.actions {
  display: flex;
  flex-direction: row;
}

.chat-message-input {
  width: 70%;
  padding: 8px;
  background-color: transparent;
  border: solid 2px #66666625;
  color: #ffffff;
  text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.4);
  font-size: 18px;
  border-radius: 0 0 0 4px;
  font-family: 'Ubuntu', sans-serif;
  outline: none;
  border-right: none;
}

.chat-message-input::placeholder {
  color: #ffffff96;
}

.chat-button {
  flex: 1;
  background-color: transparent;
  border: solid 2px #66666625;
  border-radius: 0 0 4px 0;
  color: #ffffff;
  text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.4);
  font-family: 'Ubuntu', sans-serif;
  font-size: 18px;
}

.chat-button:hover {
  background-color: #66666625;
}

.leaderboard {
  position: fixed;
  display: flex;
  flex-direction: column;
  gap: 5px;
  right: 8px;
  top: 8px;
  background-color: #66666675;
  padding: 20px;
  width: 230px;
  border-radius: 3px;
  text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
    background: rgba(20, 10, 40, 0.6);
  border: 1px solid rgba(180, 160, 255, 0.3);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(180, 160, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 20px;
  margin: 20px auto;
  max-width: 400px;
  color: #e0d6ff;
  font-family: 'Segoe UI', sans-serif;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  zoom: 0.7;
}
.leaderboard:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(180, 160, 255, 0.35);
}

/* In-game right sidebar panels: snap to screen edges */
#leaderboard-container .leaderboard {
  top: 0 !important;
  right: 0 !important;
  margin: 0 !important;
}

#chat {
  right: 0 !important;
  bottom: 0 !important;
  margin: 0 !important;
  max-width: min(420px, 100vw) !important;
  width: min(420px, 100vw) !important;
  max-height: min(380px, 48vh) !important;
  box-sizing: border-box;
  border-bottom-right-radius: 0 !important;
}
.leaderboard>h2 {
  margin: 0;
  text-align: center;
  font-size: 24px;
  margin-bottom: 5px;
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 15px;
  font-size: 1.8em;
  text-align: center;
}

.leaderboard>p {
  display: flex;
  margin: 0;
}

#leaderboard-container .leaderboard.hud-panel-collapsed {
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  padding: 14px 14px 10px !important;
}

#leaderboard-container .leaderboard.hud-panel-collapsed > :not(h2):not(.hud-collapse-toggle) {
  display: none !important;
}

#leaderboard-container .leaderboard.hud-panel-collapsed > h2 {
  margin: 0 !important;
  margin-right: 26px !important;
  font-size: 1.45em !important;
}

.leaderboard .rank {
  font-size: 20px;
  color: #ffffffd7;
  font-weight: 700;
   color: #b4a0ff;
}

.leaderboard .name {
  padding-left: 10px;
  font-size: 20px;
  color: #ffffffc7;
  font-weight: 700;
  cursor: pointer;
}

.leaderboard .score {
  margin-left: auto;
  font-size: 20px;
  color: #ffffff;
   flex: 1;
  text-align: center;
  font-weight: 700;
}

.leaderboard .highlight>* {
  color: #f8ff77;
}

#global-leaderboard.global-account-leaderboard {
  display: flex !important;
  visibility: visible !important;
  position: fixed;
  z-index: 30;
  right: 0;
  top: 0;
  width: min(380px, calc(100vw - 16px));
  max-width: 380px;
  padding: 12px 12px 10px;
  gap: 6px;
  zoom: 0.66;
  margin: 0 !important;
}

#global-leaderboard.global-account-leaderboard > h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1;
  text-align: left;
  color: #ffffff;
}

#global-leaderboard .global-rank-subtitle {
  color: #b4a0ff;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.95;
}

#global-leaderboard .global-rank-head,
#global-leaderboard .global-rank-row {
  display: grid;
  grid-template-columns: 24px minmax(110px, 1fr) 62px 58px 56px;
  gap: 8px;
  align-items: center;
}

#global-leaderboard .global-rank-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-height: 40px;
}

#global-leaderboard .global-rank-head {
  margin-top: 4px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 160, 255, 0.12);
  color: #bdb2df;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#global-leaderboard .global-rank-row {
  padding: 6px 7px;
  border-radius: 8px;
  border: 1px solid rgba(180, 160, 255, 0.12);
  background: rgba(20, 10, 40, 0.34);
  font-size: 12px;
  color: #e0d6ff;
}

#global-leaderboard .global-rank-row:hover {
  background: rgba(30, 15, 60, 0.48);
  border-color: rgba(180, 160, 255, 0.24);
}

#global-leaderboard .global-rank-row .rank {
  color: #f8ff77;
  font-weight: 800;
  text-align: center;
}

#global-leaderboard .global-rank-row .name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#global-leaderboard .global-rank-row .score,
#global-leaderboard .global-rank-row .playtime,
#global-leaderboard .global-rank-row .kills {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#global-leaderboard .global-rank-empty {
  margin-top: 6px;
  padding: 12px;
  border-radius: 10px;
  border: 1px dashed rgba(180, 160, 255, 0.25);
  color: #d2c8f1;
  font-size: 13px;
}


#resource-container {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  z-index: 1001;
  zoom: 0.7;
}

#resource-container>* {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #66666675;
  padding: 10px;
  border-radius: 3px;
  text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
  color: #ffffff;
  font-weight: 700;
  font-size: 24px;
}

#resource-container>* span {
  color: #ffffffc7;
  margin-left: 10px;
  font-size: 26px;
}

#shield {
  position: absolute;
  left: 8px;
  bottom: 80px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 1000;
  background-color: #66666675;
  padding: 10px;
  border-radius: 3px;
  text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
  color: #ffffff;
  font-weight: 700;
  font-size: 24px;
}

#shield span {
  color: #ffffffc7;
  margin-left: 10px;
  font-size: 26px;
}

#minimap-container {
  position: absolute;
  display: none;
  bottom: 170px;
  left: 8px;
  border-radius: 0;
  border: 1px #66666628 solid;
  width: 150px;
  height: 150px;
}

#toolbar-container {
  position: fixed;
  display: flex;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  zoom: 0.7;
}

.toolbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 80px;
  width: 80px;
  border-radius: 10px;
  background-color: rgba(0, 0, 0, 0.1);
  margin: 0 5px;
  cursor: pointer;
  transition: ease-in-out 100ms;
}

.toolbar-item:hover {
  transform: scale(1.05);
}

.toolbar-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.toolbar-item>.tooltip {
  font-family: 'Ubuntu', sans-serif;
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.3);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 20px;
  word-wrap: normal;
  visibility: hidden;
  width: 200px;
}

.tooltip>.tooltip-limit {
  font-size: 18px;
  font-weight: 700;
  float: right;
}

.infinity-symbol {
  font-size: 24px;
  vertical-align: middle;
}

.tooltip>.tooltip-header {
  font-size: 20px;
  font-weight: 700;
}

.tooltip>.tooltip-content {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 500;
}

.tooltip>.tooltip-cost {
  margin-top: 8px;
  font-weight: 500;
  font-size: 18px;
}

@keyframes slideDown {
  from {
    transform: translateY(-25%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

#menu-container {
  position: fixed;
  height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  flex-direction: column;
  background-color: #00000045;
}

/* Announcement Container */
#announcement-container {
  position: fixed;
  left: 30px; /* Moved to the left edge */
  top: 50%;
  transform: translateY(-50%);
  width: 350px; /* Increased width */
  max-height: 90vh; /* Increased max height */
  overflow-y: auto;
  z-index: 10;
  
  /* Glassmorphism styling */
  background: rgba(20,10,40,0.75);
  border: 1px solid rgba(180,160,255,0.3);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(180,160,255,0.2);
  backdrop-filter: blur(12px);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  color: #ffffff;
  font-family: 'Segoe UI', sans-serif;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  zoom: 0.8; /* Slightly larger zoom for larger container */
}

#announcement-container:hover {
  transform: translateY(-50%) translateY(-4px); /* Lift slightly on hover */
  box-shadow: 0 16px 40px rgba(180,160,255,0.35);
}

#announcement-container h2 {
  font-size: 1.8em;
  color: #b4a0ff;
  margin-bottom: 10px;
  text-align: center;
}

#announcement-container p {
  font-size: 1em;
  line-height: 1.5;
  text-align: center;
}

/* How to Play Container */
#how-to-play-container {
  position: fixed;
  right: 30px; /* Position it 30px from the right edge */
  top: 50%; /* Center vertically */
  transform: translateY(-50%); /* Adjust for vertical centering */
  width: 400px; /* Fixed width, adjust as needed */
  max-height: 90vh; /* Max height relative to viewport */
  overflow-y: auto; /* Enable scrolling if content overflows */
  z-index: 10;
  
  /* Glassmorphism styling */
  background: rgba(20,10,40,0.75);
  border: 1px solid rgba(180,160,255,0.3);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(180,160,255,0.2);
  backdrop-filter: blur(12px);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  color: #ffffff;
  font-family: 'Segoe UI', sans-serif;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  zoom: 0.8; /* Apply zoom for consistency */
}

#how-to-play-container:hover {
  transform: translateY(-50%) translateY(-4px); /* Lift slightly on hover */
  box-shadow: 0 16px 40px rgba(180,160,255,0.35);
}

#how-to-play-container h2 {
  font-size: 1.8em;
  color: #b4a0ff;
  margin-bottom: 10px;
  text-align: center;
}

/* Responsive video wrapper */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio (divide 9 by 16 = 0.5625) */
  height: 0;
  overflow: hidden;
  border-radius: 12px; /* Match menu-card border-radius */
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

#menu-container>.top-right,
#menu-container>.bottom-right {
  position: fixed;
  right: 0;
  width: min-content;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 40px;
}

#menu-container>.top-right {
  top: 0;
}

#menu-container>.bottom-right {
  bottom: 0;
}

#menu-container>.top-right>a,
#menu-container>.bottom-right>a {
  font-size: 20px;
  text-decoration: none;
  color: #551a8b;
  white-space: nowrap;
}

#menu-container>.top-right>a:hover,
#menu-container>.bottom-right>a:hover {
  text-decoration: underline;
}

#menu-container>.top-right>p,
#menu-container>.bottom-right>p {
  font-weight: 900;
  font-size: 16px;
  margin: 0;
}



#menu-container>.top-left {
  position: fixed;
  left: 0;
  top: 0;
}

#menu-container #changelog {
  width: 400px;
  padding: 15px;
}

#menu-container #changelog>p {
  margin: 5px;
}

#game-title {
  animation: slideDown 0.7s ease forwards;
}

#game-title>.title {
  display: flex;
  margin: 0;
  color: #ffffff;
  margin-top: 100px;
  font-size: 120px;
  text-align: center;
  text-shadow: 0px 3px 8px rgba(0, 0, 0, 0.5);
}

#game-title>.title>span {
  color: #c4c6c6;
}

#game-title>.subtitle {
  font-size: 20px;
  font-weight: 400;
  margin-top: 0;
  padding-left: 5px;
  color: #ffffff;
  text-align: center;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.menu-content-container {
  display: flex;
  flex-direction: column;
  margin-top: 30px;
  gap: 8px;
  z-index: 1;
  animation: slideDown 0.7s ease forwards;
}

@media (max-height: 680px) {
  #game-title>.title {
    margin-top: 50px;
    font-size: 60px;

  }

  .menu-content-container {
    margin-top: 20px;

  }
}

.progress-container {
  width: 100%;
  background-color: #c0bebe;
  border-radius: 6px;
  margin-top: 12px;
  position: relative;
  display: flex;
  align-items: center;
}

.progress-icon {
  position: absolute;
  right: 0;
  height: 30px;
  width: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.progress-bar {
  position: relative;
  height: 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  --progress: 0%;
}

.progress-bar::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--progress);
  background: linear-gradient(90deg, rgba(110,220,255,0.95), rgba(80,120,255,0.95));
  transition: width 420ms cubic-bezier(.2,.9,.2,1);
}

.progress-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  line-height: 20px;
  text-align: center;
  color: white;
  z-index: 1;
  font-weight: bold;
  text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
}


.menu-content {
  display: flex;
  gap: 8px;
}

.bottom-card {
  display: flex;
  height: 80px;
  justify-content: center;
  align-items: center;
}

.menu-card {
  position: relative;
  background-color: #ffffff;
  border-radius: 4px;
  padding: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.player-info {
  padding: 15px;
}

.player-settings {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Main center card highlight (name + play) */
.player-settings > .menu-card {
  position: relative;
  border: 1px solid rgba(201, 122, 255, 0.62);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 0 34px rgba(170, 92, 255, 0.34),
    0 14px 34px rgba(30, 12, 66, 0.62);
  padding: 16px 18px;
}

.player-settings > .menu-card::before {
  content: "";
  position: absolute;
  inset: -26px -30px;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(169, 100, 255, 0.22) 0%, rgba(169, 100, 255, 0.08) 38%, rgba(169, 100, 255, 0) 72%);
  filter: blur(10px);
  z-index: -1;
}

.player-input-container {
  display: flex;
  flex-direction: row;
  height: min-content;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
}

input.player-name-input {
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 18px;
  font-family: 'Ubuntu', sans-serif;
  outline: none;
}

button {
  font-family: 'Ubuntu', sans-serif;
  font-size: 20px;
  font-weight: 700;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: ease-in-out 50ms;
}

button:hover {
  transform: scale(1.03);
  transform-origin: center center; 
}


.play-button {
  background-color: #ff605f;
  color: white;
}




.settings-container>select {
  width: 100%;
  padding: 8px 4px;
  margin: 8px 0;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  font-size: 14px;
  font-weight: 400;
  outline: none;
}


.menu-header {
  font-size: 20px;
}

#gamemode-select {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  margin-bottom: 15px;
  gap: 10px;
}

#gamemode-select>.gamemode {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #5be4b6;
  color: #ffffff;
  height: 45px;
  width: 100%;
  border-radius: 4px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: solid 3px #0000001a;
  transition: ease-in-out 50ms;
}

#gamemode-select>.gamemode.selected:hover {
  transform: scale(1.03);
}


#gamemode-select>.gamemode.selected {
  border-color: #00000040;
}


#gamemode-select>.gamemode.disabled {
  background-color: #c0bebe;
  cursor: auto;
  font-weight: 200;
}


#game-over-container {
  position: fixed;
  height: 100vh;
  width: 100vw;
  display: none;
  flex-direction: column;
  align-items: center;
  background-color: #00000045;
}

#game-over-content {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: column;
  padding: 120px;
  gap: 20px;
  text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
}

@media (min-height: 800px) {
  #game-over-content {
    margin-bottom: 40px;
  }
}

#game-over-content>h1 {
  color: #ffffff;
  text-align: center;
  font-size: 55px;
}

#game-over-stats {
  display: flex;
  color: #ffffff;
  gap: 100px;
  font-size: 25px;
  height: 100%;
}

#game-over-content .actions {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 10px;
}

#game-over-content .actions>button {
  height: 50px;
  width: 150px;
}

#inactivity-warning-container {
  position: fixed;
  height: 100vh;
  width: 100vw;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #000000a0;
  z-index: 10000;
  color: white;
  text-shadow: 0 0 10px black;
}

.inactivity-warning-content {
  text-align: center;
}

.inactivity-warning-content h1 {
    font-size: 48px;
}

.inactivity-warning-content p {
    font-size: 24px;
}

#inactivity-timer {
    font-size: 48px;
    font-weight: bold;
}
/* =================== CHAT =================== */
#chat {
    border-radius: 0;
    box-shadow: 0 8px 24px rgba(180, 160, 255, 0.2);
    backdrop-filter: blur(10px);
    width: 200px;
    height: 700px;
    overflow: hidden;
    font-family: 'Segoe UI', sans-serif;
    color: #e0d6ff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#unit-controls-container {
  position: relative;
}

.hud-collapse-toggle {
  border: 1px solid rgba(180, 160, 255, 0.28);
  background: rgba(20, 10, 40, 0.78);
  color: #e0d6ff;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 6;
}

.hud-collapse-toggle.floating {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  font-size: 13px;
}

.hud-collapse-toggle.inline {
  position: static;
  width: 28px;
  height: 28px;
  margin-left: 6px;
  font-size: 14px;
  border-radius: 9px;
}

.hud-collapse-toggle.leaderboard-inline {
  width: 22px;
  height: 22px;
  min-width: 22px;
  margin-left: 8px;
  vertical-align: middle;
  font-size: 13px;
}

.hud-collapse-toggle:hover {
  background: rgba(30, 15, 60, 0.9);
  border-color: rgba(180, 160, 255, 0.4);
}

#chat:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(180, 160, 255, 0.35);
}

#chat .header {
    display: none !important;
}

#chat .header h3 {
    margin: 0;
    font-size: 1.2em;
    color: #b4a0ff;
}

#chat .chat-move-button {
    background: rgba(180, 160, 255, 0.2);
    border: none;
    border-radius: 8px;
    padding: 2px 6px;
    cursor: pointer;
    color: #e0d6ff;
    font-weight: bold;
    transition: background 0.3s ease, transform 0.2s ease;
}

#chat .chat-move-button:hover {
    background: rgba(180, 160, 255, 0.35);
    transform: scale(1.1);
}

#chat-messages {
    flex: 1;
    overflow-y: scroll;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: none;
}

#chat-messages::-webkit-scrollbar {
    width: 0;
    height: 0;
}

#chat-messages .message {
    background: rgba(180, 160, 255, 0.1);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.95em;
    transition: background 0.3s ease;
}

#chat-messages .message:hover {
    background: rgba(180, 160, 255, 0.25);
}

#chat-suggestions-container {
    position: relative;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 150px;
    overflow-y: auto;
    background: rgba(20, 10, 40, 0.9);
    border-top: 1px solid rgba(180, 160, 255, 0.2);
    border-bottom: 1px solid rgba(180, 160, 255, 0.2);
    display: none; /* Hidden by default */
    flex-direction: column;
    padding: 5px 0;
    z-index: 1001;
}

.chat-suggestion-item {
    padding: 8px 15px;
    cursor: pointer;
    color: #e0d6ff;
    font-size: 0.9em;
    transition: background 0.2s ease;
}

.chat-suggestion-item:hover, .chat-suggestion-item.selected {
    background: rgba(180, 160, 255, 0.3);
}

.chat #chat-messages .message.mention-highlight {
    background: rgba(255, 165, 0, 0.3); /* A more prominent orange background */
    border: 2px solid rgba(255, 165, 0, 0.8); /* Thicker, more vibrant orange border */
    transform: scale(1.03); /* Slightly larger scale */
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.6); /* Stronger glow effect */
    font-weight: bold; /* Make text bold */
}

#chat .actions {
    display: flex;
    padding: 10px 15px;
    gap: 0;
    border-top: 1px solid rgba(180, 160, 255, 0.2);
}

#chat .chat-message-input {
    flex: 1;
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid rgba(180, 160, 255, 0.3);
    background: rgba(30, 15, 60, 0.6);
    color: #e0d6ff;
    outline: none;
    transition: border 0.3s ease, background 0.3s ease;
}

#chat .chat-message-input:focus {
    border: 1px solid #b4a0ff;
    background: rgba(30, 15, 60, 0.8);
}

#chat .chat-button {
    display: none !important;
}

#chat .chat-button:hover {
    background: rgba(180, 160, 255, 0.45);
    transform: scale(1.05);
}

#chat.hud-panel-collapsed {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

#chat.hud-panel-collapsed #chat-messages,
#chat.hud-panel-collapsed #chat-suggestions-container {
  display: none !important;
}

#chat.hud-panel-collapsed .actions {
  border-top: 0 !important;
  padding: 6px 8px !important;
}

#chat.hud-panel-collapsed .chat-message-input {
  min-height: 28px;
}

/* =================== RESOURCE CONTAINER =================== */
#resource-container {

  
}

#resource-container #power {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(20, 10, 40, 0.6);
  border: 1px solid rgba(180, 160, 255, 0.3);
  box-shadow: 0 8px 24px rgba(180, 160, 255, 0.2);
  font-weight: 700;
  font-size: 1.06em;
  line-height: 1;
  color: #b4a0ff;
  margin-top: 0;
}

#resource-container #power span {
  color: #e0d6ff;
  margin-left: 0;
  font-size: 1.06em;
}

#unit-controls-container {
  position: static;
  display: flex;
  align-items: center;
  bottom: auto;
  left: auto;
  transform: none;
  z-index: 1001;
  zoom: 1;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.unit-control-button {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-width: 150px;
  border-radius: 12px;
  background: rgba(20, 10, 40, 0.66);
  border: 1px solid rgba(180, 160, 255, 0.32);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  margin-right: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.25s ease;
  color: #e7dcff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.unit-control-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
  background: rgba(28, 14, 56, 0.72);
}

.unit-control-button.active {
  background: rgba(68, 172, 255, 0.22);
  border-color: rgba(101, 197, 255, 0.6);
  color: #dff4ff;
}

/* Keep the bottom group toggle aligned with the purple glass UI (avoid gray fallback styles). */
#group-units-button {
  background: rgba(20, 10, 40, 0.6) !important;
  border: 1px solid rgba(180, 160, 255, 0.3) !important;
  color: #e0d6ff !important;
  box-shadow: 0 8px 24px rgba(180, 160, 255, 0.2) !important;
}

#group-units-button:hover {
  background: rgba(30, 15, 60, 0.7) !important;
  border-color: rgba(180, 160, 255, 0.42) !important;
}

#group-units-button.active {
  background: rgba(44, 22, 76, 0.78) !important;
  border-color: rgba(180, 160, 255, 0.55) !important;
  color: #e9ddff !important;
}

#resource-container #group-units-button {
  height: 42px;
  min-width: 148px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1;
}

#unit-controls-container.hud-panel-collapsed #group-units-button {
  min-width: 92px !important;
  height: 34px !important;
  padding: 0 8px !important;
  border-radius: 10px !important;
  font-size: 11px !important;
  box-shadow: 0 4px 12px rgba(180, 160, 255, 0.14) !important;
}

#toolbar-container {
  display: flex;
  gap: 5px;
  padding: 4px 6px 8px;
}

#toolbar-container.hud-panel-collapsed {
  gap: 3px;
  padding: 3px 4px 6px;
}

#toolbar-container.hud-panel-collapsed .toolbar-item:not(.toolbar-item-0) {
  display: none !important;
}

.toolbar-item {
  position: relative;
  width: 70px;
  height: 70px;
  background: rgba(20, 10, 40, 0.6);
  border: 1px solid rgba(180, 160, 255, 0.3);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(180, 160, 255, 0.2);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease, background 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(180, 160, 255, 0.35);
  background: rgba(30, 15, 60, 0.7);
}

.toolbar-item canvas {
  width: 60px;
  height: 60px;
  border-radius: 10px;
}

#toolbar-container.hud-panel-collapsed .toolbar-item {
  width: 50px;
  height: 50px;
  border-radius: 8px;
}

#toolbar-container .hud-collapse-toggle.floating {
  top: -10px;
  right: -10px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
}

#toolbar-container.hud-panel-collapsed .toolbar-item canvas {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.toolbar-item .tooltip {
  position: absolute;
  top: -140px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  background: rgba(20, 10, 40, 0.9);
  border: 1px solid rgba(180, 160, 255, 0.4);
  border-radius: 12px;
  padding: 10px;
  color: #e0d6ff;
  font-size: 0.85em;
  font-family: 'Segoe UI', sans-serif;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 100;
}

.toolbar-item:hover .tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

.tooltip-header {
  font-weight: bold;
  color: #b4a0ff;
  margin-bottom: 4px;
}

.tooltip-content {
  margin-bottom: 4px;
}

.tooltip-cost, .tooltip-limit {
  font-size: 0.8em;
  color: #d0c0ff;
}

.infinity-symbol {
  color: #b4a0ff;
}

/* =================== SHIELD =================== */
#shield {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 10px;
  background: rgba(20, 10, 40, 0.6);
  border: 1px solid rgba(180, 160, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(180, 160, 255, 0.2);
  backdrop-filter: blur(8px);
  font-family: 'Segoe UI', sans-serif;
  color: #e0d6ff;
  font-weight: bold;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  width: fit-content;
  margin: 6px auto;
  zoom: 0.62;
}

#shield:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(180, 160, 255, 0.35);
  background: rgba(30, 15, 60, 0.7);
}

#shield span {
  color: #b4a0ff;
  font-weight: bold;
  font-size: 0.95em;
}
#upgrade-container {
  background: rgba(20, 10, 40, 0.65); /* vidro levemente transparente */
  border: 1px solid rgba(180, 160, 255, 0.3);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  font-family: 'Segoe UI', sans-serif;
  color: #e0d6ff;
  zoom: 0.62;
  width: 280px;
  padding: 7px;
  gap: 6px;
  
}

#upgrade-container > h1 {
  font-size: 20px;
}

#upgrade-list {
  gap: 6px;
}

#upgrade-list > .upgrade-item {
  height: 68px;
  padding: 6px;
  gap: 8px;
  border-radius: 10px;
}

#upgrade-container .preview {
  width: 64px;
  height: 64px;
}

#upgrade-container .header {
  font-size: 16px;
  line-height: 1.05;
}

#upgrade-container .text {
  font-size: 13px;
  line-height: 14px;
}

#upgrade-container .hotkey {
  font-size: 12px;
  top: 5px;
  right: 6px;
}

#upgrade-container .cost {
  font-size: 15px;
  bottom: 6px;
  right: 6px;
}

/* Close button */
#upgrade-container-exit {
  background: rgba(180, 160, 255, 0.2);
  color: #e0d6ff;
  font-family: 'Segoe UI', sans-serif;
}

/* Upgrade items */
.upgrade-item {
  background: rgba(30, 15, 60, 0.6);
  border: 1px solid rgba(180, 160, 255, 0.3);
  border-radius: 12px;
  font-family: 'Segoe UI', sans-serif;
  color: #e0d6ff;
}

/* Textos dentro dos upgrades */
.upgrade-item .description .header {
  color: #b4a0ff;
  font-family: 'Segoe UI', sans-serif;
}

.upgrade-item .description .text,
.upgrade-item .description .hotkey,
.upgrade-item .description .cost {
  font-family: 'Segoe UI', sans-serif;
  color: #e0d6ff;
}

/* Destroy button */
#destroy-button {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 600;
  height: 40px;
  background: rgba(180, 40, 40, 0.3);
  border: 1px solid rgba(180, 40, 40, 0.5);
  font-family: 'Segoe UI', sans-serif;
  color: #ffcccc;
  transition: ease-in-out 100ms;
  cursor: pointer;
  border-radius: inherit;
}

#destroy-button .refund-amount {
  font-size: 14px;
  color: #a0ffa0;
}
#power {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  background: rgba(20, 10, 40, 0.65); /* vidro levemente transparente */
  border: 1px solid rgba(180, 160, 255, 0.3);
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(180, 160, 255, 0.2);
  backdrop-filter: blur(8px);
  font-family: 'Segoe UI', sans-serif;
  color: #e0d6ff;
  font-weight: bold;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#power:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(180, 160, 255, 0.35);
}

#power span {
  color: #b4a0ff;
  font-weight: bold;
  margin-left: 5px;
}
/* Container geral do menu */
.menu-content-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 28px 30px 30px 30px;
  gap: 20px;
  font-family: 'Segoe UI', sans-serif;
  color: #ffffff;
  zoom:0.7;
}

#game-title {
  margin-top: 28px;
}

/* Menu Content */
.menu-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 540px;
  max-width: calc(100vw - 32px);
}

/* Cards de menu */
.menu-card {
  background: rgba(20,10,40,0.75);
  border: 1px solid rgba(180,160,255,0.3);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(180,160,255,0.2);
  backdrop-filter: blur(12px);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.menu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(180,160,255,0.35);
}

#legal-links-corner {
  position: fixed;
  right: 8px;
  bottom: 8px;
  z-index: 25;
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(8, 10, 28, 0.75);
  border: 1px solid rgba(126, 165, 255, 0.35);
  border-radius: 12px;
  padding: 8px;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

#language-control {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
}

#language-label {
  color: #d6e7ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

#language-select {
  height: 30px;
  min-width: 118px;
  border-radius: 8px;
  border: 1px solid rgba(126, 165, 255, 0.45);
  background: linear-gradient(180deg, rgba(21, 38, 86, 0.95) 0%, rgba(10, 22, 58, 0.95) 100%);
  color: #e8f1ff;
  font-size: 12px;
  font-weight: 700;
  padding: 0 8px;
  outline: none;
}

#language-select:focus {
  border-color: rgba(170, 205, 255, 0.9);
  box-shadow: 0 0 0 2px rgba(120, 170, 255, 0.25);
}

#language-select option {
  color: #0f1a3d;
  background: #f3f7ff;
}

.legal-link-button {
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(126, 165, 255, 0.45);
  background: linear-gradient(180deg, rgba(44, 76, 150, 0.92) 0%, rgba(20, 42, 100, 0.92) 100%);
  color: #e8f1ff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.legal-link-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(95, 150, 255, 0.25);
  filter: brightness(1.05);
}

@media (max-width: 700px) {
  #legal-links-corner {
    left: 6px;
    right: 6px;
    bottom: 6px;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
  }

  #language-control {
    width: 100%;
    justify-content: center;
  }

  #language-select {
    width: 160px;
  }

  .legal-link-button {
    flex: 1 1 30%;
    min-width: 0;
    font-size: 12px;
  }
}

/* Player Settings Container - horizontal layout */
.player-input-container {
  display: flex;
  flex-direction: row; /* horizontal */
  gap: 15px;
  align-items: center;
}

.player-input-container.embedded-in-account {
  width: 100%;
  max-width: 360px;
  box-sizing: border-box;
  margin-bottom: 12px;
  margin-left: auto;
  margin-right: auto;
}

#account-container.compact-account-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#account-container.compact-account-center > * {
  width: 100%;
}

#account-container.compact-account-center #account-handle {
  display: none !important;
}

#account-container.compact-account-center .account-buttons {
  width: 100%;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 2px;
}

/* Player name input */

.player-name-input {
  flex-grow: 1; /* Allow input to take available space */
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 13px 16px;
  border: 1px solid rgba(190, 165, 255, 0.42);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(37, 19, 73, 0.96), rgba(27, 12, 56, 0.96));
  color: #e0d6ff;
  font-size: 1.16em;
  font-family: 'Segoe UI', sans-serif;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.player-name-input::placeholder {
  color: #a090c0;
}

.player-name-input:focus {
  border: 1px solid rgba(205, 175, 255, 0.9);
  background: linear-gradient(180deg, rgba(43, 22, 82, 0.98), rgba(30, 14, 62, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 2px rgba(180, 120, 255, 0.14);
}

/* Play Button */
.play-button {
  padding: 13px 27px;
  border-radius: 12px;
  background: linear-gradient(90deg, #6e48aa, #9d50bb);
  color: #ffffff;
  font-size: 1.16em;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.play-button:hover {
  background: linear-gradient(90deg, #5b3d8d, #803f99);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Menu Settings Button */
.menu-settings-button {
  padding: 12px 15px;
  border-radius: 12px;
  background: rgba(180, 160, 255, 0.2);
  color: #e0d6ff;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.menu-settings-button:hover {
  background: rgba(180, 160, 255, 0.35);
  transform: scale(1.05);
}

/* Discord and Shop Links */
#discord-shop-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 0;
  margin-bottom: 10px;
  width: 100%;
}

/* Skin is now chosen when pressing Play */
#skin-selector-wrapper {
  display: none !important;
}

#discord-button,
#shop-button {
  flex: 0 0 auto;
  min-width: 132px;
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 1.0em;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#discord-button {
  background: linear-gradient(135deg, #6f88de 0%, #5f79d0 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(85, 105, 180, 0.35);
}

#discord-button:hover {
  background: #5b6eae;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

#shop-button {
  background: linear-gradient(135deg, #31cf7a 0%, #22b565 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(24, 120, 70, 0.35);
}

#shop-button:hover {
  background: #27ae60;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Highlight the player name + play row (main CTA area) */
.player-input-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 122px;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(198, 158, 255, 0.42);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(34, 17, 70, 0.92), rgba(22, 10, 46, 0.9));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 22px rgba(170,120,255,0.18);
  padding: 12px 14px;
  position: relative;
  overflow: visible;
}

#logged-in-nickname {
  color: #efe9ff !important;
  font-weight: 700;
  letter-spacing: 0.2px;
}

#play-button {
  width: 122px;
  min-width: 122px;
  height: 48px;
  min-height: 48px;
  justify-self: end;
  white-space: nowrap;
  font-weight: 800;
  letter-spacing: 0.4px;
  border: 1px solid rgba(230, 190, 255, 0.55);
  background: linear-gradient(180deg, #c85dff 0%, #9f42df 58%, #7f2ec3 100%);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1) inset, 0 10px 22px rgba(166, 76, 230, 0.45);
}

#play-button:hover {
  background: linear-gradient(180deg, #d470ff 0%, #ab4be8 58%, #8b34cd 100%);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.14) inset, 0 12px 26px rgba(166, 76, 230, 0.52);
}

@media (max-width: 640px) {
  .menu-content {
    width: min(540px, calc(100vw - 20px));
  }

  .player-settings > .menu-card {
    padding: 12px 12px;
  }

  .player-input-container {
    grid-template-columns: minmax(0, 1fr) 108px;
    gap: 10px;
    padding: 10px;
  }

  #play-button {
    width: 108px;
    min-width: 108px;
    height: 44px;
    min-height: 44px;
  }

  .player-name-input {
    height: 44px;
  }
}

/* Account Handle */
#account-handle {
  font-size: 1.4em;
  color: #b4a0ff;
  text-align: center;
  margin-top: 15px;
}

/* Account Buttons (Login/Sign Up) */
.account-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.account-buttons button {
  flex: 1;
  padding: 11px 15px;
  border-radius: 11px;
  font-size: 1.03em;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(178, 140, 255, 0.42);
  background: linear-gradient(180deg, rgba(34, 17, 70, 0.86), rgba(20, 9, 44, 0.82));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

#account-button {
  background: rgba(180, 160, 255, 0.2);
  color: #e0d6ff;
}

#account-button:hover {
  background: linear-gradient(180deg, rgba(60, 31, 112, 0.92), rgba(34, 15, 72, 0.88));
  border-color: rgba(204, 174, 255, 0.62);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(140, 92, 215, 0.28);
}

#account-button:not(.login):hover,
#my-profile-button:hover {
  background: rgba(32, 18, 64, 0.82) !important;
  transform: none !important;
}

#signup-button {
  background: rgba(180, 160, 255, 0.2);
  color: #e0d6ff;
}

#signup-button:hover {
  background: linear-gradient(180deg, rgba(60, 31, 112, 0.92), rgba(34, 15, 72, 0.88));
  border-color: rgba(204, 174, 255, 0.62);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(140, 92, 215, 0.28);
}

.preplay-skin-overlay {
  position: fixed;
  inset: 0;
  z-index: 25000;
  background: rgba(4, 0, 12, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.preplay-skin-modal {
  width: min(760px, 94vw);
  max-height: min(78vh, 700px);
  overflow: auto;
  background: rgba(20, 10, 40, 0.9);
  border: 1px solid rgba(180, 160, 255, 0.32);
  border-radius: 16px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45), 0 0 24px rgba(180, 160, 255, 0.18);
  padding: 14px;
  color: #e0d6ff;
}

.preplay-skin-modal h3 {
  margin: 0;
  font-size: 22px;
  color: #ffffff;
}

.preplay-skin-subtitle {
  margin-top: 4px;
  color: #b4a0ff;
  font-size: 13px;
}

.preplay-skin-current {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(180, 160, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
}

.preplay-skin-current span {
  color: #9dff9f;
  font-weight: 700;
}

.preplay-skin-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.preplay-skin-card {
  border: 1px solid rgba(180, 160, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: #e0d6ff;
  padding: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 100px;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.preplay-skin-card:hover {
  border-color: rgba(180, 160, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.preplay-skin-card.selected {
  border-color: rgba(96, 234, 255, 0.75);
  box-shadow: inset 0 0 0 1px rgba(96, 234, 255, 0.2), 0 0 14px rgba(96, 234, 255, 0.16);
  background: rgba(96, 234, 255, 0.06);
}

.preplay-skin-card img,
.preplay-skin-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(180, 160, 255, 0.22);
  background: rgba(255, 255, 255, 0.03);
}

.preplay-skin-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #cfc6ef;
}

.preplay-skin-card > span {
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preplay-skin-actions {
  margin-top: 10px;
  margin-bottom: 10px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.preplay-skin-btn {
  min-width: 92px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(180, 160, 255, 0.24);
  background: rgba(180, 160, 255, 0.12);
  color: #e0d6ff;
  font-weight: 700;
  cursor: pointer;
}

.preplay-skin-btn.primary {
  background: rgba(153, 86, 255, 0.44);
  border-color: rgba(186, 132, 255, 0.45);
  color: #fff;
}

.preplay-skin-btn.secondary {
  background: rgba(255, 255, 255, 0.03);
}

/* Skins Section */
#skin-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

#skin-carousel-prev,
#skin-carousel-next {
  background: rgba(180, 160, 255, 0.1);
  border: 1px solid rgba(180, 160, 255, 0.2);
  color: #e0d6ff;
  font-size: 1.5em;
  padding: 5px 10px;
  border-radius: 8px;
  transition: background 0.3s ease, transform 0.2s ease;
}

#skin-carousel-prev:hover,
#skin-carousel-next:hover {
  background: rgba(180, 160, 255, 0.25);
  transform: scale(1.1);
}

#skin-preview {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 3px solid rgba(180, 160, 255, 0.4);
  background: rgba(30, 15, 60, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#skin-preview:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

#skin-preview>img {
  width: 90%;
  height: 90%;
  border-radius: 50%;
  object-fit: cover;
}

#skin-preview>p {
  position: absolute;
  color: #e0d6ff;
  font-weight: bold;
  font-size: 1.2em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#skin-preview>div {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: #2ecc71;
  color: #ffffff;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  font-weight: bold;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

#skin-container {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  max-height: 200px; /* Limit height for scroll if many skins */
  overflow-y: auto;
  padding: 10px;
  border-top: 1px solid rgba(180, 160, 255, 0.1);
  margin-top: 15px;
}

.skin-list-item {
  background: rgba(30, 15, 60, 0.4);
  border: 1px solid rgba(180, 160, 255, 0.2);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  width: 120px;
  transition: transform 0.2s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.skin-list-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
  background: rgba(30, 15, 60, 0.6);
}

.skin-list-item img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #b4a0ff;
  margin-bottom: 8px;
}

.skin-list-item h1 {
  font-size: 1em;
  color: #e0d6ff;
  margin-bottom: 5px;
}

.skin-list-item button {
  background: rgba(180, 160, 255, 0.2);
  color: #e0d6ff;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: bold;
}

.skin-list-item button.selected {
  background: linear-gradient(90deg, #6e48aa, #9d50bb);
  color: #ffffff;
}

.skin-level-locked {
  color: #a090c0;
  font-size: 0.8em;
}

.skin-level-locked img {
  filter: grayscale(100%);
}

/* Global Settings Button */
#global-settings-button {
    position: fixed;
    top: 8px; /* For game state: aligned with leaderboard */
    right: 286px; /* For game state: positioned next to leaderboard */
    display: flex;
    align-items: center;
    gap: 8px; /* Slightly smaller gap for game state */
    background: linear-gradient(145deg, rgba(20, 10, 40, 0.7), rgba(40, 20, 80, 0.7)); /* Slightly less prominent background for game state */
    border: 1px solid rgba(180, 160, 255, 0.4); /* Slightly softer border for game state */
    border-radius: 12px; /* Standard rounded corners for game state */
    box-shadow: 0 4px 15px rgba(180, 160, 255, 0.3); /* Softer shadow for game state */
    backdrop-filter: blur(8px);
    padding: 8px 12px; /* Smaller padding for game state */
    color: #f0f0f0;
    font-family: 'Segoe UI', sans-serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    width: min-content;
}

#global-settings-button:hover {
    transform: translateY(-2px) scale(1.02); /* Less dramatic hover for game state */
    box-shadow: 0 8px 25px rgba(180, 160, 255, 0.5); /* Medium shadow on hover for game state */
    background: linear-gradient(145deg, rgba(30, 15, 60, 0.8), rgba(50, 25, 100, 0.8));
    color: #ffffff;
}

#global-settings-button .settings-icon {
    font-size: 24px; /* Smaller icon size for game state */
    color: #e0d6ff;
    text-shadow: 0 0 6px rgba(180, 160, 255, 0.6); /* Softer glow for game state */
    animation: rotate 4s linear infinite;
}

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

#global-settings-button p.settings-text {
    margin: 0;
    font-size: 1em; /* Standard font size for game state */
    color: #e0d6ff;
    display: none; /* Hidden by default for game state */
}

/* Styles for Menu State */
body.menu-active #global-settings-button {
    top: 20px; /* Top-right corner for menu state */
    right: 20px;
    gap: 10px; /* Larger gap for menu state */
    background: linear-gradient(145deg, rgba(20, 10, 40, 0.8), rgba(40, 20, 80, 0.8)); /* Prominent background for menu state */
    border: 2px solid rgba(180, 160, 255, 0.5); /* Stronger border for menu state */
    border-radius: 15px; /* More rounded for menu state */
    box-shadow: 0 8px 25px rgba(180, 160, 255, 0.4); /* Stronger shadow for menu state */
    padding: 12px 20px; /* Larger padding for menu state */
}

body.menu-active #global-settings-button .settings-icon {
    font-size: 32px; /* Larger icon for menu state */
    text-shadow: 0 0 8px rgba(180, 160, 255, 0.7); /* Stronger glow for menu state */
}

body.menu-active #global-settings-button p.settings-text {
    display: block; /* Show text for menu state */
    font-size: 1.2em; /* Larger text for menu state */
}

#featured {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 10;
    pointer-events: all;
}

#featured img {
    width: 150px;
    height: 150px;
    border-radius: 12px;
}

