@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

body {
  height: 100%;
  margin: 0;
}

body,
button,
input {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial;
}

#link {
  color: #475569;
}

#backgroundStrip {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  z-index: -1; /* ensure it’s behind everything */
}

#backgroundGrid {
  position: fixed;
  inset: 0;
  display: grid;
  grid-auto-rows: 1fr;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 0;
  width: 100vw;
  height: 200vh;
  margin-top: -50vh;
  z-index: 0;
}

#backgroundGrid .bg-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 18px;
  box-sizing: border-box;
  gap: 10px;
  transform: rotate(18deg);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bg-cell .code {
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: 2rem;
  transform: rotate(-18deg);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.bg-cell .var {
  font-size: 12px;
  opacity: 0.9;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  display: none;
  transform: rotate(-18deg);
}

.bg-cell button.copy {
  margin-top: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  transform: rotate(-18deg);
  margin-left: 6%;
  mix-blend-mode: hard-light;
}

#randomize {
  padding: 16px 16px;
}
.overlay {
  font-family: "Inter";
  position: fixed;
  left: 50%;
  top: 0;
  transform: translate(-50%, 0%);
  z-index: 20;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 0px 0px 16px 16px;
  padding: 24px 24px 8px 24px;
  box-shadow: 0 12px 40px rgba(2, 6, 23, 0.28);
  backdrop-filter: blur(6px) saturate(120%);
  max-width: 720px;
}

.clr-field {
  flex: 1;
  font-weight: 900;
}

.clr-field button {
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
}

.clr-alpha {
  display: none;
}

.title {
  font-size: 1.5em;
  font-weight: 800;
  margin-bottom: 0.5em;
}
.subtitle {
  font-size: 13px;
  color: #475569;
  margin-bottom: 14px;
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgb(230, 230, 230);
  height: 32px !important;
  border-radius: 8px;
}
.input-wrap input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
  padding: 6px;
}

.btn {
  padding: 16px 24px;
  border-radius: 8px;
  border: 1px solid rgb(230, 230, 230);
  background: white;
  color: #191919;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn.ghost {
  background: transparent;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tab {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 400;
  font-size: 14px;
}
.tab.active {
  background: #191919;
  color: white;
}

.controls-right {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  background: #111827;
  color: white;
  padding: 10px 12px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.28s ease;
  z-index: 60;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media only screen and (max-width: 1220px) {
  .input-wrap {
    width: 70%;
  }
  .controls-right {
    margin-left: 0 !important;
  }
  .code {
    font-size: 1rem !important;
  }
  #backgroundGrid {
    height: 100vh;
    margin-top: 0vh;
  }
  #backgroundGrid .bg-cell,
  .bg-cell .code,
  .bg-cell button.copy {
    transform: rotate(0deg);
  }
  .bg-cell button.copy {
    margin-left: 0;
  }
  #backgroundGrid .bg-cell {
    justify-content: flex-end;
  }
}

@media only screen and (max-width: 600px) {
  .bg-cell .code {
    font-size: 0.7rem !important;
  }
  .bg-cell button.copy {
    font-size: 0.7rem;
    padding: 4px 8px;
  }
  #backgroundGrid .bg-cell {
    padding: 16px 0px;
  }
}