.community-grid {
  display: flex;
  flex-wrap: wrap;
  text-align: center;
  align-items: center;
  justify-content: center;
}

.tags-grid {
  display: flex;
  flex-wrap: wrap;
  text-align: center;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px 0;
}

.tablinks {
  font-family: Arial, sans-serif;
  font-size: 10px;
}

.mod-image {
  width: 80%;
  border: 4px solid white;
  height: auto;
}

.mod-title {
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 10px 10px 0 0;
  padding-top: 10px;
  margin-bottom: 10px;
  height: 15%;
  display: flex;
  font-size: 18px;
  font-weight: bolder;
  width: 100%;
  position: relative;
}

.trophy-holder {
  height: 32px;
  width: 32px;
  position: absolute;
  right: 8px;
  bottom: 8px;
}

.mod-trophy {
  position: absolute;
  right: 0px;
  bottom: 0px;
  transition: transform .2s;
  /* Animation */
}

.mod-trophy:hover {
  position: relative;
  transform: scale(1.1);
  /* (150% zoom - Note: if the zoom is too large, it will go outside of the viewport) */
}

.mod-title p {
  padding: 10px;
}

.mod-img-desc {
  overflow-y: scroll;
}

.mod-desc {
  flex: 1;
  height: auto;
  text-align: center;
  font-size: 12px;
  width: 89%;
  margin: 5px auto;
  border-radius: 5px;
  padding: 5px;
  overflow-y: clip;
}

.tag-button {
  padding: 10px;
  font-weight: bold;
  background-color: #BFE6FF;
  margin: 5px 5px 10px 10px;
  border-radius: 10px;
}

.tag-button:hover {
  background-color: #aacee2;
}

.community-grid-element {
  width: 23%;
  height: 25rem;
  background-color: #BFE6FF;
  margin: 5px 5px 10px 10px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hover-button-holder {
  display: inline-flex;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  margin: 10px;
  height: 12%;
}

.hover-button {
  font-size: x-large;
  font-weight: bolder;
  flex-grow: 1;
  display: inline-block;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  outline: none;
  color: #fff;
  background-color: rgb(85, 111, 176);
  border: none;
  border-radius: 10px;
  margin: 5px;
}

.hover-button:hover {
  background-color: rgb(76, 98, 154);
}

.hover-button:active {
  background-color: rgb(85, 111, 176);
  box-shadow: 0 5px #666;
  transform: translateY(4px);
}

/* Style the tab */
.tab {
  overflow: hidden;
  border: 1px solid #ccc;
  background-color: #f1f1f1;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: center;
}

/* Style the buttons that are used to open the tab content */
.tab button {
  background-color: inherit;
  float: left;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 14px 16px;
  transition: 0.3s;
  font-weight: bold;
}

/* Change background color of buttons on hover */
.tab button:hover {
  background-color: #ddd;
}

/* Create an active/current tablink class */
.tab button.active {
  background-color: #ccc;
}

/* Style the tab content */
.tabcontent {
  display: none;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-top: none;
}

#achwindow {
  position: absolute;
  z-index: 9;
  background-color: #f1f1f1;
  border: 1px solid #d3d3d3;
  text-align: center;
  width: 50%;
  height: auto;
  max-height: 50vh;
  overflow: hidden;
  padding-bottom: 5%;
}

#achwindowheader {
  position: relative;
  padding: 10px;
  cursor: move;
  z-index: 10;
  background-color: #2196F3;
  color: #fff;
  font-weight: bold;
  font-size: large;
}

#achcontent {
  width: 100%;
  height: auto;
  overflow-y: scroll;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  max-height: 50vh;
}

#achclose {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
}

.achHolder {
  outline: #3d3b46;
  outline-width: 2px;
  outline-style: solid;
  margin: 32px auto 16px auto;
  width: 90%;
  display: flex;
  flex-direction: column;
}

.achSubHolder {
  transition: max-height 0.3s ease-out;
}

.achSubHolder {
  display: inline-flex;
  justify-content: center;
  flex-wrap: wrap;
}

.achLabel {
  display: flex;
  justify-content: center;
  padding-left: 5%;
  padding-right: 5%;
  margin-top: 0px;
  font-size: xx-large;
  font-weight: bolder;
  background-color: #BFE6FF;
  position: relative;
  cursor: pointer;
  user-select: none;
}

.achBox {
  transition: all 0.2s ease-out;
  height: 250px;
  max-height: 250px;
  max-width: 150px;
  margin: 5%;
  display: flex;
  outline: 2px solid #3d3b46;
  justify-content: center;
  text-align: center;
  justify-items: center;
  flex-wrap: wrap;
  background-color: #BFE6FF;
  border-radius: 5px;
  padding: 16px;
  padding-bottom: 32px;
}

.achImageHolder {
  margin: 10%;
  object-fit: cover;
  border: .3em solid white;
  border-radius: .3em;
  position: relative;
}

.achToggle {
  user-select: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  cursor: pointer;
  opacity: 80%;
}

.achImage {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.achTitle {
  width: 100%;
  height: auto;
  max-height: 25%;
  font-size: 16pt;
  font-weight: bolder;
  margin: 5%;
  text-align: center;
  justify-content: center;
  word-wrap: break-word;
}

.achText {
  overflow-y: auto;
  overflow-x: hidden;
  height: 10%;
  font-size: 12px;
  border-radius: 5px;
  padding: 5px;
}

.achSubHolder {
  overflow: auto;
  transition: opacity 0.3s ease-out;
  max-height: none;
  opacity: 0;
  display: none;
}

.achSubHolder.visible {
  opacity: 1;
  display: inline-flex;
  flex-wrap: wrap;
}

.ach-pagination {
  display: flex;
  justify-content: center;
  margin-top: 15px;
  gap: 10px;
}

.ach-pagination button,
.ach-controls button,
.pin-button,
.fav-icon {
  padding: 5px 10px;
  background-color: #4a6ea9;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin: 2px;
}

.ach-pagination button:disabled,
.ach-controls button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

.ach-pagination-info {
  padding: 5px 10px;
}

.ach-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

.ach-controls button.active {
  background-color: #2a4e89;
  font-weight: bold;
}

.mod-actions {
  position: absolute;
  top: 5px;
  left: 5px;
  display: flex;
  gap: 5px;
  z-index: 10;
}

.pin-button,
.fav-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 16px;
}

.pin-button.pinned {
  background-color: #f0ad4e;
}

.fav-icon {
  background-color: #f0ad4e;
  cursor: default;
}

.achLabel {
  position: relative;
}

.mod-completion {
  color: white;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.ach-search-container {
  display: flex;
  justify-content: center;
  margin: 10px 0;
  padding: 0 10px;
  width: 100%;
  box-sizing: border-box;
}

.ach-search-input {
  width: 100%;
  max-width: 400px;
  padding: 8px 12px;
  border: 2px solid #4a6ea9;
  border-radius: 4px;
  font-size: 14px;
}

.ach-search-input:focus {
  outline: none;
  border-color: #2a4e89;
}

.search-highlight {
  background-color: yellow;
  font-weight: bold;
}

/* Mobile and small screen responsive styles */
@media (max-width: 768px) {
  #achwindow {
    width: 95vw !important;
    height: 90vh !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
  }

  #achcontent {
    max-height: calc(90vh - 80px);
  }

  .ach-controls button {
    padding: 12px 6px;
    font-size: 16px;
    min-height: 44px;
  }

  .ach-pagination {
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
  }

  .ach-pagination button {
    padding: 12px 20px;
    font-size: 16px;
    min-height: 44px;
    touch-action: manipulation;
  }

  .ach-pagination-info {
    text-align: center;
    padding: 12px;
    font-size: 16px;
  }

  .achBox {
    margin: 8px 4px;
    min-width: calc(50% - 8px);
  }

  .achBox img {
    width: calc(50% - 8px);
  }

  .achLabel {
    padding: 12px;
    min-height: 40px;
    cursor: pointer;
  }

  .achLabel p {
    font-size: 16px;
    margin: 0;
    padding-right: 80px;
  }

}

@media (max-width: 480px) {
  .achBox {
    min-width: calc(60% - 8px);
  }

  .ach-controls {
    padding: 0 5px;
  }

  .ach-pagination {
    padding: 0 5px;
  }

  .achLabel p {
    font-size: 14px;
    padding-right: 60px;
  }

  .mod-completion {
    font-size: 10px;
    padding: 4px;
  }

  .achBox img {
    width: calc(40% - 8px);
  }

  .pin-button,
  .fav-icon {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }
}

.locked {
  -webkit-filter: grayscale(100%);
  /* Safari 6.0 - 9.0 */
  filter: grayscale(100%);
}

#benefitwindow {
  position: absolute;
  z-index: 9;
  background-color: #f1f1f1;
  border: 1px solid #d3d3d3;
  text-align: center;
  width: 25%;
  height: 90vh;
}

#benefitwindowheader {
  position: relative;
  padding: 10px;
  cursor: move;
  z-index: 10;
  background-color: #2196F3;
  color: #fff;
  font-weight: bold;
  font-size: large;
}

#benefitcontent {
  margin: 10px;
  height: 90%;
  overflow-y: scroll;
}

#benefitclose {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
}

.cheatIndicator {
  top: 0;
  padding: 10px;
  background: #ff9595;
  width: fit-content;
  position: fixed;
  border-radius: 0 .5em .5em 0;
  font-size: large;
  font-weight: bold;
  z-index: 999;
  transition: background-color 0.3s ease, opacity 0.3s ease;
  cursor: pointer;
  user-select: none;
}

.cheatIndicator:hover {
  opacity: 0.90;
  transform: scale(1.02);
}

.cheatIndicator:active {
  transform: scale(0.98);
}

.mode-button {
  font-family: Arial, sans-serif;
  font-size: medium;
  font-weight: bolder;
  flex-grow: 1;
  display: inline-block;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  outline: none;
  color: #ffffff;
  background-color: rgb(85, 111, 176);
  border: none;
  border-radius: 10px;
  margin: 5px;
  padding: 10px 10px;
  vertical-align: middle;
}

.mode-button:hover {
  background-color: rgb(76, 98, 154);
}

.mode-button:active {
  background-color: rgb(53, 70, 113);
}

.mode-button:disabled {
  background-color: #999;
  cursor: not-allowed;
}

.pagination-info {
  display: inline-block;
  margin: 0 15px;
  padding: 10px 15px;
  font-weight: bold;
  vertical-align: middle;
  background-color: #BFE6FF;
  color: #000;
  border-radius: 10px;
}

.pagination-input-container {
  display: inline-flex;
  vertical-align: middle;
  margin: 0px 15px 0 -5px;
}

.pagination-input {
  width: 60px;
  height: 36px;
  text-align: center;
  margin: 0;
  border-radius: 10px 0 0 10px;
  font-size: 16px;
  border: 2px solid rgb(85, 111, 176);
  border-right: none;
}

.pagination-go-button {
  margin: 0;
  border-radius: 0 10px 10px 0;
  flex-grow: 0;
}

.no-favorites-message {
  width: 100%;
  text-align: center;
  font-size: 1.2em;
  font-weight: bold;
  padding: 40px;
  color: #fff;
}

.pressed {
  background-color: rgb(53, 70, 113) !important;
}

/* Tooltip container */
.tooltip {
  position: relative;
  display: inline-block;
  border-bottom: 1px dotted black;
  /* If you want dots under the hoverable text */
}

/* Tooltip text */
.tooltip .tooltiptext,
.trophy-holder .tooltiptext {
  visibility: hidden;
  width: 120px;
  background-color: rgb(255, 255, 255);
  color: #fff;
  outline-color: black;
  outline-width: 1px;
  outline-style: solid;
  color: black;
  text-align: center;
  padding: 5px 0;
  border-radius: 6px;
  padding: 3px;

  /* Position the tooltip text - see examples below! */
  position: absolute;
  z-index: 1;
}

/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
  visibility: visible;
}

.trophy-holder:hover .tooltiptext,
.trophy-holder:active .tooltiptext {
  visibility: visible;
  font-size: small;
}

.tooltip .tooltiptext {
  top: -5px;
  right: 105%;
}

.trophy-holder .tooltiptext {
  bottom: 48px;
  left: -150%;
  padding: 10px;
}

.rating-background {
  background-color: rgb(85, 111, 176);
  width: 100%;
  border-radius: 0px 0px 10px 10px;
  color: white;
  padding-top: 10px;
  position: relative;
  padding-bottom: 5px;
}

.rating-holder {
  display: flex;
  gap: 5px;
  margin: 5px;
  justify-content: center;
}

.rate-button {
  overflow: hidden;
  background-size: cover;
  outline-style: solid;
  outline-width: 3px;
  outline-color: white;
  width: 32px;
  height: 32px;
  margin: 2px;
}

.rate-button:active {
  transform: translateY(1px);
}

.rate-button.pressed {
  filter: brightness(40%);
}

.announcement {
  background-color: white;
  padding-top: 12px;
  padding-bottom: 12px;
  font-weight: bold;
  text-align: center;
  font-size: larger;
}

.announcement>a {
  color: red;
}

.announcement>span {
  color: red;
  font-weight: bolder;
}

.center {
  text-align: center;
}

#variableTooltip {
  position: absolute;
  display: none;
  background-color: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 8px;
  border-radius: 5px;
  font-size: 12px;
  z-index: 9999;
  pointer-events: none;
  max-width: 500px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* CTS theme readability fixes */
.cts-theme .custom-mod-label,
.cts-theme .custom-mod-note,
.cts-theme .footer h4 {
  color: #fff !important;
}

/* Classic theme readability fixes */
.classic-theme .mod-sort-label,
.classic-theme .mod-legacy-view-label {
  color: #000 !important;
}

/* Hidden for accessbility */
.mod-sort-label, .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}