:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --text: #232838;
  --muted: #616b82;
  --line: #dde5f1;
  --accent: #ff7d21;
  --accent-strong: #ea6810;
  --accent-soft: rgba(255, 125, 33, 0.12);
  --shadow: 0 10px 30px rgba(32, 48, 88, 0.08);
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --max-width: 1120px;
  --font-ui: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f9fbff 0%, #f2f6fc 100%);
  color: var(--text);
  font-family: var(--font-ui);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
}

input,
button {
  font: inherit;
}

.site-header {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
}

.header-inner,
.category-strip__inner,
.page-shell {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  flex-shrink: 0;
}

.brand__logo {
  display: block;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: contain;
}

.brand__name {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.search-form input {
  width: min(260px, 48vw);
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--text);
}

.search-form input:focus {
  border-color: rgba(255, 125, 33, 0.45);
}

.search-form button {
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #ff8c34 0%, var(--accent) 100%);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(255, 125, 33, 0.24);
}

.category-strip {
  background: #fff;
  border-bottom: 3px solid var(--accent);
}

.category-strip__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding: 12px 0;
}

.category-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.category-link:not(:last-child)::after {
  content: "\2022";
  margin-left: 18px;
  color: #c3cada;
}

.page-shell {
  padding: 34px 0 48px;
}

.page-shell > section + section {
  margin-top: 22px;
}

.intro-panel,
.content-section,
.featured-section,
.games-section,
.faq-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.intro-panel {
  padding: 24px 18px 20px;
}

.intro-panel--compact {
  padding: 18px 18px 16px;
}

.intro-panel h1,
.section-heading h2,
.game-card h3 {
  margin: 0;
}

.intro-panel h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  line-height: 1.05;
}

.intro-panel p {
  max-width: 60ch;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.intro-panel--compact h1 {
  font-size: clamp(1.65rem, 3vw, 2rem);
}

.intro-panel--compact p {
  max-width: none;
  margin-top: 10px;
  font-size: 0.96rem;
  line-height: 1.55;
}

.intro-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.intro-panel--compact .intro-stats {
  gap: 10px;
  margin-top: 16px;
}

.intro-stat {
  min-width: 140px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.intro-panel--compact .intro-stat {
  min-width: 120px;
  padding: 10px 12px;
}

.intro-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.intro-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.4rem;
}

.intro-panel--compact .intro-stat strong {
  margin-top: 6px;
  font-size: 1.2rem;
}

.content-section,
.featured-section,
.games-section,
.faq-section {
  padding: 20px 18px;
}

.section-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

.featured-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.rich-text {
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.75;
}

.rich-text > *:first-child {
  margin-top: 0;
}

.rich-text p,
.rich-text ul,
.rich-text ol {
  margin: 0 0 14px;
}

.rich-text h3 {
  margin: 22px 0 10px;
  color: var(--text);
  font-size: 1.08rem;
}

.rich-text ul,
.rich-text ol {
  padding-left: 20px;
}

.featured-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 125, 33, 0.18);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.category-showcase-list {
  display: grid;
  gap: 22px;
  margin-top: 18px;
}

.category-showcase {
  padding-top: 2px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.category-showcase__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.category-showcase__header > div {
  min-width: 0;
}

.category-showcase__header h3,
.category-showcase__header p {
  margin: 0;
}

.category-showcase__header h3 {
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  line-height: 1.1;
}

.category-showcase__header p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.category-showcase__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 125, 33, 0.2);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
  white-space: nowrap;
}

.category-showcase__grid {
  margin-top: 16px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.category-showcase__viewport {
  overflow: hidden;
  margin-top: 16px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.category-showcase__track {
  display: flex;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  transition: transform 260ms ease;
  will-change: transform;
}

.category-showcase__page {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  min-width: 100%;
}

.category-showcase__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.category-showcase__pager {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.category-showcase__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 125, 33, 0.2);
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-weight: 800;
  cursor: pointer;
  transition: background-color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.category-showcase__nav:hover:not(:disabled),
.category-showcase__nav:focus-visible:not(:disabled) {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.category-showcase__nav:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.category-showcase__status {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.category-showcase__mobile-link {
  display: none;
}

.category-showcase[data-page-count="1"] .category-showcase__controls {
  display: none;
}

.category-showcase.is-search-mode .category-showcase__track {
  display: block;
  transform: none !important;
}

.category-showcase.is-search-mode .category-showcase__page {
  min-width: 0;
}

.category-showcase.is-search-mode .category-showcase__page + .category-showcase__page {
  margin-top: 16px;
}

.category-showcase.is-search-mode .category-showcase__controls {
  display: none;
}

.game-card {
  display: flex;
  flex-direction: column;
  min-height: 196px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(32, 48, 88, 0.05);
}

.game-card__top {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.game-card__image {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  overflow: hidden;
  background: #eef4fc;
}

.game-card__image img {
  height: 100%;
  object-fit: cover;
}

.game-card__content {
  min-width: 0;
}

.game-card h3 {
  font-size: 1rem;
  line-height: 1.3;
}

.game-card__description {
  display: -webkit-box;
  margin: 10px 0 0;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.game-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  min-width: 0;
}

.game-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.game-card__meta span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 125, 33, 0.28);
  border-radius: var(--radius-pill);
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.game-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, #ff8c34 0%, var(--accent) 100%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.faq-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 800;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item__body {
  padding: 0 16px 16px;
  color: var(--muted);
  line-height: 1.7;
}

.empty-state {
  margin: 16px 0 0;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.site-footer__inner {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 26px;
}

.site-footer__left,
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer__links a:hover,
.site-footer__left a:hover,
.site-footer__links a:focus-visible,
.site-footer__left a:focus-visible {
  color: var(--text);
}

@media (max-width: 980px) {
  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-form {
    width: 100%;
  }

  .search-form input {
    width: 100%;
  }

  .category-showcase__header {
    flex-direction: column;
  }

  .category-showcase__controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .intro-panel,
  .content-section,
  .featured-section,
  .games-section,
  .faq-section {
    padding: 18px 16px;
  }

  .category-showcase__pager {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 620px) {
  .header-inner,
  .category-strip__inner,
  .page-shell {
    width: min(calc(100% - 24px), var(--max-width));
  }

  .page-shell {
    padding-top: 22px;
  }

  .search-form {
    align-items: stretch;
    flex-direction: column;
    padding: 10px;
  }

  .search-form button {
    width: 100%;
  }

  .category-strip__inner {
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .category-strip__inner::-webkit-scrollbar {
    display: none;
  }

  .category-link {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface-soft);
  }

  .category-link:not(:last-child)::after {
    content: none;
  }

  .intro-panel,
  .content-section,
  .featured-section,
  .games-section,
  .faq-section {
    padding: 18px 16px;
  }

  .intro-panel h1 {
    font-size: 1.75rem;
  }

  .intro-panel p,
  .section-heading p,
  .rich-text,
  .faq-item__body,
  .empty-state {
    font-size: 1rem;
    line-height: 1.65;
  }

  .intro-stats {
    gap: 10px;
  }

  .intro-stat,
  .intro-panel--compact .intro-stat {
    min-width: 0;
    flex: 1 1 120px;
  }

  .game-grid {
    grid-template-columns: 1fr;
  }

  .category-showcase__controls {
    display: flex;
    justify-content: center;
  }

  .category-showcase__pager,
  .category-showcase__status {
    display: none;
  }

  .category-showcase__mobile-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid rgba(255, 125, 33, 0.2);
    border-radius: var(--radius-pill);
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-weight: 800;
  }

  .game-card {
    min-height: 0;
    padding: 14px;
  }

  .game-card__top {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .game-card__image {
    width: 96px;
    height: 96px;
    aspect-ratio: auto;
  }

  .game-card__content,
  .game-card h3,
  .game-card__description {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .game-card__description {
    -webkit-line-clamp: 4;
  }

  .game-card__footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .category-showcase__nav {
    flex: 1 1 0;
  }

  .game-card__cta,
  .category-showcase__cta {
    width: auto;
  }

  .site-footer__inner {
    align-items: flex-start;
    flex-direction: column;
  }
}
