/* Catalogue and preview only; shared navigation and footer keep their styles. */
body.textures-page {
  margin: 0;
}
.textures-page main {
  --texture-muted: #bfc5cd;
}
.textures-page main *,
.texture-preview-dialog,
.texture-preview-dialog * {
  box-sizing: border-box;
}
.textures-page main [hidden],
.texture-preview-dialog [hidden] {
  display: none !important;
}
.textures-page main :is(a, button, input, select):focus-visible,
.texture-preview-dialog button:focus-visible {
  outline: 2px solid #89cff0;
  outline-offset: 4px;
}
.textures-page main button,
.texture-preview-dialog button {
  font: inherit;
}
.textures-skip {
  position: fixed;
  top: 8px;
  left: 16px;
  z-index: 10010;
  padding: 12px 16px;
  background: #89cff0;
  color: #112732;
  border-radius: 8px;
  transform: translateY(-200%);
}
.textures-skip:focus {
  transform: none;
}
.textures-page .hero {
  height: auto;
  min-height: 430px;
  padding: 138px 24px 66px;
  background-image: url('bac.webp');
  background-position: center 48%;
}
.textures-page .hero-overlay {
  background: linear-gradient(180deg, #0d17245c, #11182296 48%, #1a1a1a);
}
.textures-page .hero-content {
  width: min(900px, 100%);
  animation: none;
}
.textures-page .hero-content h1 {
  max-width: 840px;
  margin: 0 auto 18px;
  font-size: clamp(32px, 4.2vw, 54px);
  line-height: 1.12;
  letter-spacing: -1.8px;
  text-wrap: balance;
}
.textures-page .hero-content p {
  margin: 0 auto 26px;
  max-width: 640px;
  font-size: 16px;
  line-height: 1.7;
  color: #e3e9ef;
}
.textures-page .hero-button {
  min-height: 46px;
  padding: 12px 20px;
  border-radius: 9px;
  font-size: 14px;
  box-shadow: none;
}
.textures-page .texture-gallery {
  width: min(1256px, 100%);
  margin: 0 auto;
  padding: 36px 28px 72px;
  background: transparent;
  scroll-margin-top: 88px;
}
.textures-catalog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.textures-catalog-heading h2 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.8px;
}
.textures-catalog-heading p {
  margin: 0;
  font-size: 13px;
  color: var(--texture-muted);
}
#texture-results {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.textures-toolbar {
  display: flex;
  align-items: stretch;
  gap: 16px;
}
.textures-search {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border: 1px solid #454c54;
  border-radius: 9px;
  background: #22262b;
  padding: 0 14px;
  color: #a8b2be;
}
.textures-search:focus-within {
  border-color: #89cff0;
  box-shadow: 0 0 0 2px #89cff020;
}
.textures-search input {
  width: 100%;
  min-width: 0;
  height: 48px;
  border: none;
  padding: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 14px;
  outline: none !important;
}
.textures-search input::placeholder {
  color: #aab4c0;
}
.textures-search input::-webkit-search-cancel-button {
  display: none;
}
.textures-search button {
  display: grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  border: 0;
  border-radius: 5px;
  background: #ffffff09;
  color: #d3dce4;
  cursor: pointer;
}
.textures-sort {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--texture-muted);
}
.textures-sort select {
  height: 50px;
  padding: 0 32px 0 13px;
  border: 1px solid #454c54;
  border-radius: 9px;
  background: #22262b;
  color: #f2f4f8;
  font: inherit;
  font-size: 13px;
  color-scheme: dark;
  cursor: pointer;
}
.textures-page .primary-category {
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  overflow: visible;
  padding: 0;
  margin: 18px 0 28px;
}
.textures-page .filter-btn {
  min-height: 40px;
  min-width: 0;
  margin: 0;
  padding: 8px 13px;
  gap: 10px;
  border: 1px solid #41474d;
  border-radius: 8px;
  background: #25292e;
  color: #d9dfe6;
  font-size: 12px;
  box-shadow: none;
  backdrop-filter: none;
  animation: none;
  transform: none;
  overflow: visible;
}
.textures-page .filter-btn::before {
  display: none;
}
.textures-page .filter-btn.active {
  background: #89cff0;
  border-color: #89cff0;
  color: #142932;
}
.textures-page .filter-btn:hover {
  border-color: #89cff0;
  transform: none;
}
.filter-count {
  opacity: 0.8;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.textures-page .texture-container {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
.textures-page .theme-card {
  min-width: 0;
  width: auto;
  max-width: none;
  margin: 0;
  border-radius: 12px;
  background: #222529;
  border: 1px solid #3c4148;
  backdrop-filter: none;
  box-shadow: none;
  transition: border-color 0.18s ease;
}
.textures-page .theme-card:hover {
  transform: none;
  border-color: #687581;
  box-shadow: none;
}
.textures-page .theme-preview {
  display: block;
  flex: none;
  width: 100%;
  aspect-ratio: 3 / 2;
  height: auto;
  min-height: 0;
  padding: 0;
  border: none;
  background: #121619;
  color: #fff;
  cursor: zoom-in;
  overflow: hidden;
}
.textures-page .theme-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.textures-page .theme-preview:focus-visible {
  outline-offset: -5px;
}
.texture-edition,
.texture-preview-count {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #10171ee8;
  color: #edf2f8;
  border: 1px solid #ffffff24;
  border-radius: 5px;
  padding: 6px 9px;
}
.texture-edition {
  left: 12px;
  top: 12px;
}
.texture-preview-count {
  right: 12px;
  bottom: 12px;
}
.textures-page .theme-info {
  padding: 21px;
  gap: 0;
}
.textures-page .theme-info h3 {
  margin: 0 0 12px;
  display: block;
  font-size: 21px;
  line-height: 1.35;
  letter-spacing: -0.5px;
  overflow-wrap: anywhere;
}
.textures-page .theme-info > p {
  display: block;
  margin: 0 0 18px;
  min-height: 0;
  color: #c0c7d0;
  font-size: 13px;
  line-height: 1.7;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.textures-page .style-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
  margin-bottom: 21px;
}
.texture-tag {
  padding: 5px 8px;
  border: 1px solid #ffffff1c;
  border-radius: 5px;
  color: var(--pack-accent);
  background: #ffffff05;
  font-size: 11px;
  line-height: 1.4;
}
.texture-stats-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-top: 14px;
  border-top: 1px solid #ffffff16;
  color: #bbc4cd;
  font-size: 11px;
}
.texture-downloads {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.textures-page .theme-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.78fr);
  gap: 9px;
}
.textures-page .btn-download,
.textures-page .btn-preview {
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 10px 8px;
  border-radius: 7px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  text-align: center;
}
.textures-page .btn-download {
  color: #12232b;
  background: var(--pack-accent);
  border: 1px solid transparent;
}
.textures-page .btn-preview {
  color: #e9edf2;
  background: #ffffff05;
  border: 1px solid #56616b;
}
.textures-page .btn-download:hover,
.textures-page .btn-preview:hover {
  filter: brightness(1.1);
  transform: none;
}
.textures-empty {
  display: grid;
  justify-items: center;
  padding: 55px 20px;
  border: 1px dashed #485460;
  border-radius: 12px;
  text-align: center;
  background: #20252a;
}
.textures-empty > i {
  font-size: 27px;
  color: #89cff0;
}
.textures-empty h3 {
  margin: 18px 0 8px;
  font-size: 21px;
}
.textures-empty p {
  margin: 0 0 24px;
  color: #bdc7d1;
  font-size: 14px;
}
.textures-empty button {
  padding: 12px 18px;
  border: 0;
  border-radius: 7px;
  background: #89cff0;
  color: #12242e;
  cursor: pointer;
}
.texture-preview-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  width: min(1120px, calc(100vw - 40px));
  height: min(820px, calc(100dvh - 40px));
  max-width: none;
  max-height: none;
  color: #edf2f7;
  background: #161c22;
  border: 1px solid #485461;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 28px 100px #0008;
}
.texture-preview-dialog::backdrop {
  background: #080c12d9;
  backdrop-filter: blur(5px);
}
.texture-preview-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: 100%;
  height: 100%;
  padding: 18px;
  gap: 12px;
}
.texture-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 6px;
  background: none;
  border: 0;
}
.texture-preview-heading p {
  margin: 0 0 5px;
  color: #aab9c7;
  font-size: 11px;
}
.texture-preview-heading h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.35;
}
.texture-preview-dialog button {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #4b5661;
  border-radius: 7px;
  background: #262f38;
  color: #fff;
  cursor: pointer;
}
.texture-preview-dialog button:hover {
  border-color: #89cff0;
}
.texture-preview-dialog button:disabled {
  opacity: 0.45;
  cursor: default;
}
.texture-preview-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  min-width: 0;
  position: relative;
  background: #0c1116;
  border-radius: 7px;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}
.texture-preview-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  min-height: 0;
}
.texture-preview-stage p {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  text-align: center;
  font-size: 14px;
  color: #c8d2dc;
}
.texture-preview-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
}
#preview-counter {
  min-width: 55px;
  text-align: center;
  font-size: 13px;
  color: #c4cfdb;
  font-variant-numeric: tabular-nums;
}
.texture-preview-thumbnails {
  position: relative;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #657382 #232b33;
  padding: 5px 3px 8px;
}
.texture-preview-thumbnails button {
  width: 86px;
  height: 58px;
  padding: 3px;
  border: 2px solid transparent;
  background: transparent;
}
.texture-preview-thumbnails button[aria-pressed='true'] {
  border-color: #89cff0;
}
.texture-preview-thumbnails img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 3px;
}
@media (max-width: 1050px) {
  .textures-page .texture-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .textures-page .hero {
    min-height: 375px;
    padding: 118px 20px 46px;
  }
  .textures-page .hero-content h1 {
    font-size: clamp(30px, 8vw, 40px);
    letter-spacing: -1px;
  }
  .textures-page .hero-content p {
    font-size: 14px;
  }
  .textures-page .texture-gallery {
    padding: 28px 16px 48px;
  }
  .textures-catalog-heading {
    gap: 12px;
    margin-bottom: 20px;
  }
  .textures-catalog-heading h2 {
    font-size: 23px;
  }
  .textures-catalog-heading p {
    font-size: 11px;
  }
  .textures-toolbar {
    flex-direction: column;
    gap: 12px;
  }
  .textures-sort {
    justify-content: space-between;
  }
  .textures-sort select {
    flex: 1;
    max-width: 220px;
    height: 44px;
  }
  .textures-page .primary-category {
    gap: 7px;
    margin: 16px 0 22px;
  }
  .textures-page .filter-btn {
    min-height: 44px;
    padding: 8px 11px;
    font-size: 11px;
    gap: 8px;
  }
  .textures-page .texture-container {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .textures-page .theme-info {
    padding: 19px;
  }
  .textures-page .theme-info > p {
    font-size: 13px;
  }
  .texture-preview-dialog {
    width: calc(100vw - 16px);
    height: min(calc(60vw + 220px), calc(100dvh - 16px));
    border-radius: 9px;
  }
  .texture-preview-shell {
    padding: 12px;
    gap: 10px;
  }
  .texture-preview-heading h2 {
    font-size: 17px;
  }
  .texture-preview-thumbnails button {
    width: 72px;
    height: 50px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .textures-page main *,
  .texture-preview-dialog * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
