/*=========== Apps Layout =====*/
.apps-layout {
  display: flex;
  flex-direction: row;
  flex: 1;
  width: 100%;
  overflow: hidden;
  gap: clamp(1vw, 2vw, 2vw);
  padding: clamp(1vw, 2vw, 2vw);
  box-sizing: border-box;
}

.apps {
  flex: 1;
  min-width: 10rem;
  padding: 2rem;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fill, clamp(10rem, 13rem, 15rem));
  gap: 4rem;
  row-gap: clamp(1rem, 2rem, 4rem);
  justify-content: center;
  height: 100%;
  align-content: start;
  background-color: var(--bg-header-inner);
  border: var(--outline-width) solid var(--outline-color);
  box-shadow: var(--hard-shadow);
  border-radius: 30px;
  scrollbar-width: none;
}

.apps::-webkit-scrollbar {
  display: none;
}

.apps-inner {
  display: contents;
}

/*=========== App Card =====*/
.app {
  width: clamp(10rem, 13rem, 15rem);
  height: 20rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  border: none;
  box-shadow: none;
}

.nameTag {
  width: 70%;
  height: 20%;
  padding: 1%;
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.appName {
  box-shadow: var(--neg-shadow), inset 0 0 10px rgba(0, 0, 0, 0.15);
  width: 100%;
  height: 60%;
  border: var(--outline-width) solid var(--outline-color);
  background-color: var(--surface-soft);
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 160%;
  color: var(--text-accent);
}

.status-indicator {
  width: 0.9rem;
  aspect-ratio: 1;
  border-radius: 50%;
  border: var(--outline-width) solid var(--outline-color);
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.status-indicator.ready {
  background-color: var(--online);
  box-shadow: 0 0 6px var(--online), inset 2px 2px 0 rgba(0, 0, 0, 0.25);
}

.status-indicator.not-ready {
  background-color: var(--pending);
  box-shadow: 0 0 6px var(--pending), inset 2px 2px 0 rgba(0, 0, 0, 0.25);
}

.status-indicator.unknown {
  background-color: var(--offline);
  box-shadow: 0 0 6px var(--offline), inset 2px 2px 0 rgba(0, 0, 0, 0.25);
}

/*=========== Icon =====*/
.icon {
  background-color: var(--surface-strong);
  width: 10rem;
  aspect-ratio: 1;
  height: 10rem;
  margin: 1rem;
  border: var(--outline-width) solid var(--outline-color);
  box-shadow: var(--neg-shadow);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

.icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.3) 3px,
    rgba(0, 0, 0, 0.3) 4px
  );
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
}

.icon::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(102, 158, 49, 0.08);
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
}

.icon a {
  display: flex;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
}

.icon img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  filter:
    grayscale(1)
    sepia(1)
    hue-rotate(80deg)
    saturate(3)
    brightness(0.6)
    drop-shadow(0 0 6px rgba(102, 158, 49, 0.7));
}

/*=========== App Info =====*/
.appinfo {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  justify-items: center;
  max-height: 20%;
  width: 100%;
}

.status {
  height: 1rem;
  width: 1rem;
  border-radius: 50%;
  border: var(--outline-width) solid var(--outline-color);
  box-shadow: inset 4px 4px 0px rgba(0, 0, 0, 0.2);
  background-color: var(--online);
  grid-column: 1;
}

.appinfo h1 {
  font-family: var(--comic-font);
  font-size: 1.3rem;
  color: var(--text-main);
  -webkit-text-stroke: var(--text-stroke-strong) var(--text-stroke-color);
  paint-order: stroke fill;
  text-shadow: var(--text-shadow-strong);
  margin: 0;
  grid-column: 2;
}

/*=========== Replica Control =====*/
.replica-control {
  background-color: var(--bg-header-inner);
  border: var(--outline-width) solid var(--outline-color);
  box-shadow: var(--hard-shadow);
  border-radius: 30px;
  padding: 1vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  overflow-y: hidden;
  container-type: inline-size;
  flex-shrink: 0;
  min-width: 6rem;
}

.replica-control h2 {
  font-family: var(--comic-font);
  font-size: clamp(1.5rem, 1.5vw, 10vw);
  color: var(--text-main);
  text-align: center;
}

.replica-control .app-name {
  font-family: var(--comic-font);
  font-size: clamp(1rem, 0.9vw, 5vw);
  color: var(--on);
  -webkit-text-stroke: var(--text-stroke-strong) var(--text-stroke-color);
  paint-order: stroke fill;
  text-shadow: var(--text-shadow-strong);
  text-align: center;
  word-break: break-word;
}

.replica-info {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.5rem;
}

.replica-count {
  font-family: var(--comic-font);
  font-size: 2rem;
  color: var(--text-main);
  -webkit-text-stroke: var(--text-stroke-strong) var(--text-stroke-color);
  paint-order: stroke fill;
  text-shadow: var(--text-shadow-strong);
}

.replica-label {
  font-family: var(--comic-font);
  font-size: 1rem;
  color: var(--text-main);
  -webkit-text-stroke: var(--text-stroke-soft) var(--text-stroke-color);
  paint-order: stroke fill;
  text-shadow: var(--text-shadow-soft);
}

/*=========== Slider =====*/
.replica-slider {
  display: flex;
  flex-direction: column;
  width: 20%;
  align-items: center;
  gap: 1rem;
  flex: 1;
  justify-content: center;
  overflow: visible;
  background: var(--surface-muted);
  border: var(--outline-width) solid var(--outline-color);
  border-radius: 10px;
}

.slider {
  -webkit-appearance: none;
  appearance: none;
  writing-mode: vertical-lr;
  display: flex;
  direction: rtl;
  width: 6px;
  height: 100%;
  flex: 1;
  cursor: pointer;
  overflow: visible;
  background: transparent;
  border: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 100cqw;
  aspect-ratio: 3/1;
  background: var(--slider-thumb);
  cursor: pointer;
  border-radius: 5px;
  transition: height 0.2s ease;
  border: var(--outline-width) solid var(--outline-color);
}

.slider::-webkit-slider-runnable-track {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: none;
  box-shadow: none;
}

.slider::-moz-range-thumb {
  height: 20px;
  width: 75cqw;
  background: var(--slider-thumb-alt);
  cursor: pointer;
  border: 2px solid var(--text-contrast);
  border-radius: 5px;
  border: var(--outline-width) solid var(--outline-color);
}

.slider::-moz-range-track {
  background: transparent;
  border: none;
  box-shadow: none;
}

.slider::-moz-range-progress {
  background: transparent;
  border: none;
}

.slider-value {
  font-family: var(--comic-font);
  font-size: 1.5rem;
  color: var(--text-main);
  -webkit-text-stroke: var(--text-stroke-strong) var(--text-stroke-color);
  paint-order: stroke fill;
  text-shadow: var(--text-shadow-strong);
  text-align: center;
}
