.generation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  width: 100%;
}

.generation-card {
  position: relative;
  min-height: 320px;
  aspect-ratio: 1 / 1.08;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 18%, rgba(97, 86, 74, 0.12), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #eef1f4 100%);
  border: 1px solid var(--border-default, rgba(17, 17, 17, 0.12));
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(17, 17, 17, 0.08);
}

.generation-viewer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  --poster-color: transparent;
}

.generation-viewer::part(default-progress-bar) {
  height: 2px;
  background-color: #70675c;
}

.generation-input {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  width: clamp(82px, 28%, 118px);
  overflow: hidden;
  background: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.2);
}

.generation-input img {
  display: block;
  width: 100%;
  height: auto;
}

.generation-input span {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 18px 6px 5px;
  color: #ffffff;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.72) 100%);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.generation-texture-button {
  position: absolute;
  z-index: 3;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  max-width: calc(100% - 24px);
  padding: 0 13px;
  color: #ffffff;
  background: rgba(42, 39, 35, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.18);
  backdrop-filter: blur(12px);
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.generation-texture-button:hover,
.generation-texture-button:focus-visible {
  background: rgba(68, 61, 52, 0.96);
  border-color: rgba(255, 255, 255, 0.44);
  transform: translateY(-1px);
}

.generation-texture-button:focus-visible,
.generation-more-link:focus-visible {
  outline: 2px solid #756c60;
  outline-offset: 2px;
}

.generation-texture-button:disabled {
  cursor: default;
  transform: none;
}

.generation-texture-button.is-textured {
  background: rgba(78, 88, 72, 0.94);
}

.generation-texture-button.is-textured:hover,
.generation-texture-button.is-textured:focus-visible {
  background: rgba(66, 78, 62, 0.96);
}

.generation-texture-button svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}

.generation-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.generation-more-wrap[hidden] {
  display: none;
}

.generation-more-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 17px;
  color: #ffffff;
  background: #2f312f;
  border: 1px solid rgba(17, 17, 17, 0.18);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(17, 17, 17, 0.12);
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.generation-more-link:hover,
.generation-more-link:focus-visible {
  background: #45443e;
  border-color: rgba(17, 17, 17, 0.28);
  transform: translateY(-1px);
}

@media (max-width: 760px) {
  .generation-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .generation-card {
    min-height: 300px;
  }
}
