:root {
  --bg: #0f1724;
  --surface: #172235;
  --surface-soft: #1d2a40;
  --surface-raised: #22314c;
  --text: #f3f6ff;
  --muted: #a8b6d0;
  --line: #314462;
  --accent: #ff9a2f;
  --accent-strong: #ffd45c;
  --accent-soft: rgba(255, 154, 47, 0.16);
  --spectrum: linear-gradient(90deg, #ff4f5e 0%, #ff932f 18%, #ffd94d 36%, #71cb46 54%, #4aa2e8 74%, #9a63c8 100%);
  --button-primary: linear-gradient(135deg, #ff932f 0%, #ffd45c 100%);
  --button-secondary: linear-gradient(180deg, rgba(39, 64, 95, 0.96) 0%, rgba(29, 44, 67, 0.96) 100%);
  --button-secondary-hover: linear-gradient(180deg, rgba(49, 74, 108, 0.98) 0%, rgba(36, 57, 85, 0.98) 100%);
  --button-secondary-text: #f3f6ff;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  --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;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 79, 94, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(74, 162, 232, 0.18), transparent 26%),
    radial-gradient(circle at 50% 0%, rgba(113, 203, 70, 0.12), transparent 28%),
    linear-gradient(180deg, #101827 0%, #0d1420 100%);
  color: var(--text);
  font-family: var(--font-ui);
  overflow-x: hidden;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid #9ad2ff;
  outline-offset: 2px;
}

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

input,
button {
  font: inherit;
}

.site-header {
  background: rgba(10, 16, 28, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.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;
  background: var(--spectrum);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(23, 34, 53, 0.9);
  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);
  background: rgba(12, 19, 32, 0.95);
}

.search-form button {
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--button-primary);
  color: #09111d;
  font-weight: 800;
  cursor: pointer;
}

.category-strip {
  background: rgba(13, 20, 33, 0.9);
  border-bottom: 0;
  box-shadow: inset 0 -1px 0 var(--line);
}

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

.category-strip::after {
  content: "";
  display: block;
  height: 3px;
  background: var(--spectrum);
}

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

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

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

.game-card,
.content-section,
.related-section,
.faq-section {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(27, 39, 60, 0.98) 0%, rgba(22, 34, 53, 0.98) 100%);
  box-shadow: var(--shadow);
}

.game-card {
  grid-template-columns: minmax(256px, 0.72fr) minmax(0, 1.28fr);
  gap: 24px;
  padding: 18px;
}

.game-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 336px;
  padding: 12px;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 79, 94, 0.18) 0%, rgba(74, 162, 232, 0.16) 100%);
}

.game-card__media img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 14px;
}

.game-card__content {
  display: flex;
  flex-direction: column;
}

.game-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.game-card__content h1,
.game-card__content p {
  margin: 0;
}

.game-card__content h1 {
  margin-top: 14px;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.05;
}

.game-description {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.game-actions {
  margin-top: 22px;
}

.play-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  background: var(--button-primary);
  color: #08111d;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(74, 162, 232, 0.24);
}

.details-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.detail-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(34, 49, 76, 0.96) 0%, rgba(25, 38, 59, 0.96) 100%);
}

.detail-item:nth-child(4n + 1) {
  box-shadow: inset 0 1px 0 rgba(255, 79, 94, 0.34);
}

.detail-item:nth-child(4n + 2) {
  box-shadow: inset 0 1px 0 rgba(255, 217, 77, 0.34);
}

.detail-item:nth-child(4n + 3) {
  box-shadow: inset 0 1px 0 rgba(113, 203, 70, 0.34);
}

.detail-item:nth-child(4n + 4) {
  box-shadow: inset 0 1px 0 rgba(74, 162, 232, 0.34);
}

.detail-item span,
.detail-item strong {
  display: block;
}

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

.detail-item strong {
  margin-top: 8px;
  line-height: 1.45;
}

.content-section,
.related-section,
.faq-section {
  margin-top: 22px;
  padding: 20px 18px;
}

.section-heading h2,
.section-heading p {
  margin: 0;
}

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

.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;
}

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

.related-card {
  display: flex;
  flex-direction: column;
  min-height: 188px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(28, 40, 62, 0.98) 0%, rgba(22, 33, 51, 0.98) 100%);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.24);
}

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

.related-card__image {
  display: block;
  width: 84px;
  height: 84px;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 79, 94, 0.18) 0%, rgba(74, 162, 232, 0.16) 100%);
}

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

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

.related-card__content h3,
.related-card__content p {
  margin: 0;
}

.related-card__content h3 {
  font-size: 1rem;
  line-height: 1.3;
}

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

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

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

.related-card__meta span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 217, 77, 0.2);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.03);
  color: #ffd45c;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.related-card__meta span:nth-child(2n) {
  border-color: rgba(74, 162, 232, 0.2);
  color: #9ad2ff;
}

.related-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(74, 162, 232, 0.24);
  background: var(--button-secondary);
  color: var(--button-secondary-text);
  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: linear-gradient(180deg, rgba(32, 47, 73, 0.96) 0%, rgba(24, 36, 56, 0.96) 100%);
}

.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;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(10, 16, 28, 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: 860px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-form {
    width: 100%;
  }

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

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

  .content-section,
  .related-section,
  .faq-section {
    padding: 18px 16px;
  }

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

@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-pill,
  .category-link {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface-soft);
  }

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

  .game-card,
  .content-section,
  .related-section,
  .faq-section {
    padding: 18px 16px;
  }

  .game-card {
    gap: 16px;
  }

  .game-card__media {
    min-height: 224px;
    padding: 12px;
  }

  .game-card__content h1 {
    font-size: 1.95rem;
  }

  .game-description,
  .section-heading p,
  .rich-text,
  .faq-item__body {
    font-size: 1rem;
    line-height: 1.65;
  }

  .play-button {
    width: 100%;
  }

  .details-panel {
    grid-template-columns: 1fr;
  }

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

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

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

  .related-card__image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

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

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

  .related-card__cta {
    width: auto;
  }

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