* {
  box-sizing: border-box;
}

.skip-link {
  position: absolute;
  z-index: 10;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-160%);
  border: 1px solid #111111;
  background: #ffffff;
  color: #111111;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  background: #f4f1ea;
}

body {
  margin: 0;
  background: #f4f1ea;
  color: #111111;
  font-family: Arial, Helvetica, sans-serif;
}

.site-header {
  padding: 24px 20px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1100px;
  min-height: 58px;
  margin: 0 auto;
  border-bottom: 1px solid #111111;
}

.site-name {
  color: #111111;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.categories-link {
  color: #111111;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.categories-link:hover {
  text-decoration: underline;
}

.random-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid #111111;
  border-radius: 2px;
  background: #ff5a36;
  color: #111111;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.random-button:hover {
  background: #111111;
  color: #ffffff;
}

.random-button:focus-visible,
.site-name:focus-visible,
.categories-link:focus-visible,
.website-card:focus-visible,
.details-back:focus-visible,
.details-visit:focus-visible,
.contact-link:focus-visible,
.contact-back:focus-visible,
.contact-email:focus-visible,
.category-list a:focus-visible {
  outline: 3px solid #ff5a36;
  outline-offset: 3px;
}

.introduction {
  max-width: 1100px;
  margin: 0 auto;
  padding: 72px 20px 52px;
  text-align: center;
}

.introduction h1,
.featured-section h1 {
  margin: 0 0 12px;
  font-size: clamp(36px, 5vw, 48px);
  line-height: 1;
}

.introduction p {
  margin: 0;
  color: #666666;
  font-size: 18px;
}

.website-section {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 52px;
}

.website-section h2 {
  margin: 0 0 20px;
  font-size: 24px;
  line-height: 1.2;
}

.featured-section {
  padding-top: 48px;
  padding-bottom: 48px;
}

.featured-section .website-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.website-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.games-section .website-grid {
  --homepage-columns: 5;
  grid-template-columns: repeat(var(--homepage-columns), minmax(0, 1fr));
}

.homepage-categories-link {
  margin: 28px 0 0;
  color: #666666;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
}

.homepage-categories-link a {
  color: #111111;
  font-weight: 700;
  text-decoration: underline;
}

.homepage-categories-link a:hover {
  color: #ff5a36;
}

.website-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 180px;
  padding: 18px;
  border: 1px solid #111111;
  border-radius: 2px;
  background: #ffffff;
  color: #111111;
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease;
}

.website-card:hover {
  background: #ff5a36;
  color: #ffffff;
}

.website-number {
  font-size: 14px;
  color: #666666;
}

.website-card:hover .website-number {
  color: #ffffff;
}

.website-name {
  margin: 16px 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.website-sponsored {
  position: absolute;
  right: 18px;
  bottom: 20px;
  margin: 0;
  color: #666666;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.website-card:hover .website-sponsored {
  color: #ffffff;
}

.website-visit {
  font-size: 14px;
  font-weight: 700;
}

.site-footer {
  padding: 28px 20px 36px;
  border-top: 1px solid #111111;
  color: #666666;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 8px;
}

.contact-link {
  display: inline-block;
  margin-top: 0;
  color: #111111;
  font-weight: 700;
  text-decoration: underline;
}

.site-footer p + p {
  margin-top: 6px;
}

.contact-page {
  width: 100%;
  max-width: 1100px;
  min-height: calc(100vh - 82px);
  margin: 0 auto;
  padding: 48px 20px 80px;
}

.contact-back {
  color: #111111;
  font-weight: 700;
  text-decoration: underline;
}

.contact-label {
  margin: 96px 0 18px;
  color: #666666;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-page h1 {
  margin: 0 0 24px;
  font-size: clamp(44px, 8vw, 88px);
  line-height: 0.95;
}

.contact-description {
  max-width: 620px;
  margin: 0 0 32px;
  color: #666666;
  font-size: clamp(18px, 2.5vw, 24px);
  line-height: 1.45;
}

.contact-email {
  color: #111111;
  font-size: 20px;
  font-weight: 700;
  text-decoration: underline;
}

.details-page[hidden] {
  display: none;
}

.details-inner {
  width: 100%;
  max-width: 1100px;
  min-height: calc(100vh - 82px);
  margin: 0 auto;
  padding: 48px 20px 80px;
}

.details-back {
  padding: 0;
  border: 0;
  background: transparent;
  color: #111111;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
}

.details-label {
  margin: 96px 0 18px;
  color: #666666;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.details-inner h2 {
  max-width: 800px;
  margin: 0 0 24px;
  font-size: clamp(44px, 8vw, 88px);
  line-height: 0.95;
}

.details-description {
  max-width: 620px;
  margin: 0 0 44px;
  color: #666666;
  font-size: clamp(18px, 2.5vw, 24px);
  line-height: 1.45;
}

.details-visit {
  display: block;
  width: min(100%, 620px);
  padding: 24px 28px;
  border: 1px solid #111111;
  background: #ff5a36;
  color: #111111;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease;
}

.details-visit:hover {
  background: #111111;
  color: #ffffff;
}

.categories-page {
  width: 100%;
  max-width: 1100px;
  min-height: calc(100vh - 82px);
  margin: 0 auto;
  padding: 48px 20px 80px;
}

.categories-page h1 {
  margin: 0 0 18px;
  font-size: clamp(44px, 8vw, 88px);
  line-height: 0.95;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.category-card {
  padding: 24px;
  border: 1px solid #111111;
  background: #ffffff;
}

.category-card h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.category-card > p {
  margin: 0 0 20px;
  color: #666666;
}

.category-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-list li:last-child:nth-child(odd) {
  grid-column: 2;
}

.category-list a {
  color: #111111;
  font-weight: 700;
  text-decoration: underline;
}

.category-list a:hover {
  color: #ff5a36;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 1100px) {
  .games-section .website-grid {
    --homepage-columns: 3;
  }

  .website-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .featured-section .website-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 699px) {
  .games-section .website-grid {
    --homepage-columns: 2;
  }

  .website-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .featured-section .website-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 599px) {
  .games-section .website-grid {
    --homepage-columns: 1;
  }

  .site-header {
    padding: 16px 16px 0;
  }

  .header-inner {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding-bottom: 12px;
  }

  .header-actions {
    flex-wrap: wrap;
    justify-content: center;
  }

  .site-name {
    max-width: 100%;
    font-size: 16px;
  }

  .header-actions {
    gap: 14px;
  }

  .categories-link {
    font-size: 15px;
  }

  .random-button {
    padding: 8px 14px;
  }

  .introduction {
    padding: 56px 16px 40px;
  }

  .introduction p {
    font-size: 16px;
  }

  .website-section {
    padding: 24px 16px 40px;
  }

  .featured-section {
    padding-top: 36px;
    padding-bottom: 36px;
  }

  .website-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .featured-section .website-grid {
    grid-template-columns: 1fr;
  }


  .website-card {
    min-height: 128px;
  }

  .categories-page {
    padding: 32px 16px 60px;
  }

  .category-grid {
    grid-template-columns: 1fr;
    margin-top: 36px;
  }

  .category-card {
    padding: 20px;
  }

  .category-list li:last-child:nth-child(odd) {
    grid-column: auto;
  }
}
