.tier-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.4rem;
  overflow-x: auto;
  padding-bottom: 8px;
}

.label-holder {
  width: 40px;
  text-align: center;
  padding: 0.4rem;
  border-radius: 0.375rem;
  margin-right: 0.4rem;
  flex-shrink: 0;
}

.tier {
  flex: 1;
  min-height: 80px;
  border: 1px solid #4a5568;
  border-radius: 0.375rem;
  padding: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  background-color: #2d3748;
  transition: background-color 0.2s;
  position: relative;
}

.tier.drop-active {
  background-color: #4a5568;
}

.tier-item {
  background-color: #2d3748;
  padding: 0.4rem;
  border-radius: 0.375rem;
  cursor: grab;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  touch-action: none;
}

.pool-item {
  background-color: #2d3748;
  padding: 0.4rem;
  border-radius: 0.375rem;
  cursor: grab;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  touch-action: none;
}

.tier-item img,
.pool-item img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 0.375rem;
}

.tier-item::after,
.pool-item::after {
  content: attr(data-name);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(16, 16, 16, 0.7);
  color: white;
  padding: 4px;
  font-size: 12px;
  text-align: center;
  border-radius: 0 0 0.375rem 0.375rem;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tier-item:hover::after,
.pool-item:hover::after {
  opacity: 1;
}

.pool {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding: 1.5rem;
  border: 1px solid #4a5568;
  border-radius: 0.375rem;
  background-color: #1a202c;
  justify-content: center;
  position: relative;
  margin-top: 1.5rem;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-bottom: 0.8rem;
}

.header .text-center {
  flex: 1;
  text-align: center;
}

#backButton {
  margin-right: 10px;
  position: relative;
  z-index: auto;
}

#saveButton {
  margin-left: 10px;
}

.header h1 {
  margin: 0;
}

.header p {
  margin: 0;
  color: #a0aec0;
}

.draggable-mirror {
  z-index: 9999;
  opacity: 0.9;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  position: fixed;
  transform: scale(0.8);
}

.draggable-source--is-dragging {
  opacity: 0.3;
}

.draggable-container--over {
  background-color: rgba(74, 85, 104, 0.5);
}

#searchContainer {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

#searchInput {
  transition: all 0.3s;
  border-radius: 50px;
  padding: 10px 24px;
  font-size: 16px;
  height: 45px;
}

#searchInput:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
}

#helpButton {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background-color: #374151;
  color: white;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#helpButton:hover {
  background-color: #4B5563;
}

body.tierlist-visible #helpButton {
  display: none;
}

.hidden {
  display: none;
}

.backing-plate {
  background-color: #161e2e;
  border-radius: 0.5rem;
  padding: 2rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

body.tierlist-visible .backing-plate {
  background-color: transparent;
  box-shadow: none;
  padding: 0;
}

.scroll-top-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #374151;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  border: none;
  cursor: pointer;
  z-index: 9999;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
}

.scroll-top-button.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-top-button:hover {
  background-color: #2c5282;
}

.scroll-top-button:active {
  transform: scale(0.95);
}

/* Hide the button on desktop or when tierlist is not visible */
@media (min-width: 1024px) {
  body:not(.tierlist-visible) .scroll-top-button {
    display: none;
  }
}

/* Toggle switch styles */
#oldFlavorsToggleContainer .dot {
  transition: transform 0.3s ease-in-out;
}

#toggleOldFlavors:checked~.dot {
  transform: translateX(16px) !important;
}

#toggleOldFlavors:checked~div {
  background-color: #3B82F6 !important;
}

/* Fancy Toggle Switch */
.switch {
  --switch-width: 46px;
  --switch-height: 24px;
  --switch-bg: rgb(75, 85, 99);
  --switch-checked-bg: rgb(59, 130, 246);
  --switch-offset: calc((var(--switch-height) - var(--circle-diameter)) / 2);
  --switch-transition: all .2s cubic-bezier(0.27, 0.2, 0.25, 1.51);
  /* circle */
  --circle-diameter: 18px;
  --circle-bg: #fff;
  --circle-shadow: 1px 1px 2px rgba(146, 146, 146, 0.45);
  --circle-checked-shadow: -1px 1px 2px rgba(163, 163, 163, 0.45);
  --circle-transition: var(--switch-transition);
  /* icon */
  --icon-transition: all .2s cubic-bezier(0.27, 0.2, 0.25, 1.51);
  --icon-cross-color: var(--switch-bg);
  --icon-cross-size: 6px;
  --icon-checkmark-color: var(--switch-checked-bg);
  --icon-checkmark-size: 10px;
  /* effect line */
  --effect-width: calc(var(--circle-diameter) / 2);
  --effect-height: calc(var(--effect-width) / 2 - 1px);
  --effect-bg: var(--circle-bg);
  --effect-border-radius: 1px;
  --effect-transition: all .2s ease-in-out;
  display: inline-block;
}

.switch input {
  display: none;
}

.switch svg {
  transition: var(--icon-transition);
  position: absolute;
  height: auto;
}

.switch .checkmark {
  width: var(--icon-checkmark-size);
  color: var(--icon-checkmark-color);
  transform: scale(0);
}

.switch .cross {
  width: var(--icon-cross-size);
  color: var(--icon-cross-color);
}

.slider {
  box-sizing: border-box;
  width: var(--switch-width);
  height: var(--switch-height);
  background: var(--switch-bg);
  border-radius: 999px;
  display: flex;
  align-items: center;
  position: relative;
  transition: var(--switch-transition);
  cursor: pointer;
}

.circle {
  width: var(--circle-diameter);
  height: var(--circle-diameter);
  background: var(--circle-bg);
  border-radius: inherit;
  box-shadow: var(--circle-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--circle-transition);
  z-index: 1;
  position: absolute;
  left: var(--switch-offset);
}

.slider::before {
  content: "";
  position: absolute;
  width: var(--effect-width);
  height: var(--effect-height);
  left: calc(var(--switch-offset) + (var(--effect-width) / 2));
  background: var(--effect-bg);
  border-radius: var(--effect-border-radius);
  transition: var(--effect-transition);
}

/* actions */
.switch input:checked+.slider {
  background: var(--switch-checked-bg);
}

.switch input:checked+.slider .checkmark {
  transform: scale(1);
}

.switch input:checked+.slider .cross {
  transform: scale(0);
}

.switch input:checked+.slider::before {
  left: calc(100% - var(--effect-width) - (var(--effect-width) / 2) - var(--switch-offset));
}

.switch input:checked+.slider .circle {
  left: calc(100% - var(--circle-diameter) - var(--switch-offset));
  box-shadow: var(--circle-checked-shadow);
}